diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-09 13:10:55 (GMT) |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-09 14:24:15 (GMT) |
commit | c29edc61afd14a6b59da7ba5c5c9f9fd54d1d397 (patch) | |
tree | d62db3c78f1d19035eb4cfe8960e038cc0830902 /src/lib.c | |
parent | f903b16ba37e2b25826360883278a6432733d8c5 (diff) | |
download | soup-transcoding-proxy-c29edc61afd14a6b59da7ba5c5c9f9fd54d1d397.zip soup-transcoding-proxy-c29edc61afd14a6b59da7ba5c5c9f9fd54d1d397.tar.gz |
main/appsink: Don't hard-code element names
Diffstat (limited to 'src/lib.c')
-rw-r--r-- | src/lib.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -60,7 +60,6 @@ pad_blocked_cleanup_cb (GstPad *srcpad, GstPadProbeInfo *info, TranscodeClientCtx *ctx) { - GstPad *sinkpad; GstElement *tee; GstElement *sinkbin = GST_ELEMENT (gst_element_get_parent (ctx->appsink)); @@ -69,13 +68,12 @@ pad_blocked_cleanup_cb (GstPad *srcpad, gst_pad_remove_probe (srcpad, GST_PAD_PROBE_INFO_ID (info)); tee = gst_pad_get_parent_element (srcpad); - sinkpad = gst_element_get_static_pad (sinkbin, "qsink"); - gst_pad_unlink (srcpad, sinkpad); + gst_pad_unlink (srcpad, ctx->ghostsinkpad); gst_element_remove_pad (tee, srcpad); - - gst_object_unref (sinkpad); + gst_object_unref (srcpad); gst_object_unref (tee); + gst_element_set_state (sinkbin, GST_STATE_NULL); gst_bin_remove (GST_BIN (ctx->server_ctx->pipeline), sinkbin); gst_object_unref (sinkbin); gst_object_unref (ctx->appsink); @@ -88,7 +86,7 @@ pad_blocked_cleanup_cb (GstPad *srcpad, void stp_cleanup_transcode_client_ctx (TranscodeClientCtx *ctx) { - GstPad *sinkpad, *srcpad; + GstPad *srcpad; TranscodeServerCtx *server_ctx = ctx->server_ctx; GstElement *sinkbin = GST_ELEMENT (gst_element_get_parent (ctx->appsink)); @@ -100,8 +98,7 @@ stp_cleanup_transcode_client_ctx (TranscodeClientCtx *ctx) server_ctx->clients = g_list_remove (server_ctx->clients, ctx); /* Block sinkpad and srcpad, then unlink and remove */ - sinkpad = gst_element_get_static_pad (sinkbin, "qsink"); - srcpad = gst_pad_get_peer (sinkpad); + srcpad = gst_pad_get_peer (ctx->ghostsinkpad); gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_BLOCK, (GstPadProbeCallback) pad_blocked_cleanup_cb, |