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/main.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/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -58,7 +58,6 @@ tee_src_pad_blocked_cb (GstPad *srcpad, TranscodeClientCtx *ctx) { GstCaps *caps; - GstPad *sinkpad; GstBuffer *buffer; GstState state; GstStateChangeReturn ret; @@ -71,8 +70,7 @@ tee_src_pad_blocked_cb (GstPad *srcpad, gst_bin_add (GST_BIN (server_ctx->pipeline), sinkbin); /* t. ! queue ! appsink */ - sinkpad = gst_element_get_static_pad (sinkbin, "qsink"); - gst_pad_link (srcpad, sinkpad); + gst_pad_link (srcpad, ctx->ghostsinkpad); /* Send the WebM stream header through the pipeline first */ caps = gst_pad_get_current_caps (srcpad); @@ -97,7 +95,6 @@ tee_src_pad_blocked_cb (GstPad *srcpad, out: gst_caps_unref (caps); - gst_object_unref (sinkpad); gst_object_unref (sinkbin); return GST_PAD_PROBE_OK; err: @@ -261,7 +258,7 @@ GET: bin = gst_bin_new (NULL); /* queue ! appsink */ - q2 = gst_element_factory_make ("queue", "q2"); + q2 = gst_element_factory_make ("queue", NULL); appsink = gst_element_factory_make ("appsink", NULL); g_object_set (appsink, "drop", FALSE, "emit-signals", TRUE, @@ -270,7 +267,8 @@ GET: gst_element_link (q2, appsink); sinkpadq2 = gst_element_get_static_pad (q2, "sink"); - gst_element_add_pad (bin, gst_ghost_pad_new ("qsink", sinkpadq2)); + client_ctx->ghostsinkpad = gst_ghost_pad_new (NULL, sinkpadq2); + gst_element_add_pad (bin, client_ctx->ghostsinkpad); gst_object_unref (sinkpadq2); /* Set to PAUSED so the bin can pre-roll */ |