diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-09-30 15:47:17 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-09-30 15:49:02 +0200 |
commit | d96defb1645a0d6b34d38fb0c598d7c8f033bb98 (patch) | |
tree | 8fcf37f16cd8448262c722c8c03b5718cbc1583e | |
parent | 25837289c4cbf5381e40bcb80e94cf14f57e9f59 (diff) |
resindvdbin: Create external srcpads from the static pad templates
-rw-r--r-- | ext/resindvd/resindvdbin.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/ext/resindvd/resindvdbin.c b/ext/resindvd/resindvdbin.c index 7ee34c559..37f6f84ca 100644 --- a/ext/resindvd/resindvdbin.c +++ b/ext/resindvd/resindvdbin.c @@ -57,26 +57,24 @@ enum enum { ARG_0, ARG_DEVICE }; -/* FIXME: Could list specific video and audio caps: */ static GstStaticPadTemplate video_src_template = GST_STATIC_PAD_TEMPLATE ("video", GST_PAD_SRC, GST_PAD_SOMETIMES, - GST_STATIC_CAPS - ("video/mpeg, mpegversion=(int) { 1, 2 }, systemstream=false") + GST_STATIC_CAPS ("video/x-raw-yuv") ); static GstStaticPadTemplate audio_src_template = GST_STATIC_PAD_TEMPLATE ("audio", GST_PAD_SRC, GST_PAD_SOMETIMES, - GST_STATIC_CAPS ("audio/x-raw-int;audio/x-raw-float") + GST_STATIC_CAPS ("audio/x-raw-int; audio/x-raw-float") ); static GstStaticPadTemplate subpicture_src_template = GST_STATIC_PAD_TEMPLATE ("subpicture", GST_PAD_SRC, GST_PAD_SOMETIMES, @@ -357,12 +355,13 @@ _pad_block_destroy_notify (RsnDvdBinPadBlockCtx * ctx) g_slice_free (RsnDvdBinPadBlockCtx, ctx); } static gboolean create_elements (RsnDvdBin * dvdbin) { + GstPadTemplate *src_templ = NULL; GstPad *src = NULL; GstPad *sink = NULL; RsnDvdBinPadBlockCtx *bctx = NULL; if (!try_create_piece (dvdbin, DVD_ELEM_SOURCE, NULL, RESIN_TYPE_DVDSRC, "dvdsrc", "DVD source")) { @@ -448,13 +447,15 @@ create_elements (RsnDvdBin * dvdbin) src = gst_element_get_static_pad (dvdbin->pieces[DVD_ELEM_VIDQ], "src"); #else src = gst_element_get_static_pad (dvdbin->pieces[DVD_ELEM_PARSET], "src"); #endif if (src == NULL) goto failed_video_ghost; - dvdbin->video_pad = gst_ghost_pad_new ("video", src); + src_templ = gst_static_pad_template_get (&video_src_template); + dvdbin->video_pad = gst_ghost_pad_new_from_template ("video", src, src_templ); + gst_object_unref (src_templ); if (dvdbin->video_pad == NULL) goto failed_video_ghost; gst_pad_set_active (dvdbin->video_pad, TRUE); bctx = g_slice_new (RsnDvdBinPadBlockCtx); bctx->dvdbin = gst_object_ref (dvdbin); bctx->pad = gst_object_ref (dvdbin->video_pad); @@ -491,13 +492,16 @@ create_elements (RsnDvdBin * dvdbin) gst_object_unref (sink); src = sink = NULL; src = gst_element_get_static_pad (dvdbin->pieces[DVD_ELEM_SPUQ], "src"); if (src == NULL) goto failed_spu_ghost; - dvdbin->subpicture_pad = gst_ghost_pad_new ("subpicture", src); + src_templ = gst_static_pad_template_get (&subpicture_src_template); + dvdbin->subpicture_pad = + gst_ghost_pad_new_from_template ("subpicture", src, src_templ); + gst_object_unref (src_templ); if (dvdbin->subpicture_pad == NULL) goto failed_spu_ghost; gst_pad_set_active (dvdbin->subpicture_pad, TRUE); bctx = g_slice_new (RsnDvdBinPadBlockCtx); bctx->dvdbin = gst_object_ref (dvdbin); bctx->pad = gst_object_ref (dvdbin->subpicture_pad); @@ -548,13 +552,15 @@ create_elements (RsnDvdBin * dvdbin) src = sink = NULL; /* ghost audio munge output pad onto bin */ src = gst_element_get_static_pad (dvdbin->pieces[DVD_ELEM_AUD_MUNGE], "src"); if (src == NULL) goto failed_aud_ghost; - dvdbin->audio_pad = gst_ghost_pad_new ("audio", src); + src_templ = gst_static_pad_template_get (&audio_src_template); + dvdbin->audio_pad = gst_ghost_pad_new_from_template ("audio", src, src_templ); + gst_object_unref (src_templ); if (dvdbin->audio_pad == NULL) goto failed_aud_ghost; gst_pad_set_active (dvdbin->audio_pad, TRUE); bctx = g_slice_new (RsnDvdBinPadBlockCtx); bctx->dvdbin = gst_object_ref (dvdbin); bctx->pad = gst_object_ref (dvdbin->audio_pad); @@ -586,13 +592,13 @@ failed_vidq_connect: GST_ELEMENT_ERROR (dvdbin, CORE, FAILED, (NULL), ("Could not connect DVD aspect ratio adjuster and video buffer elements")); goto error_out; #endif failed_video_ghost: GST_ELEMENT_ERROR (dvdbin, CORE, FAILED, (NULL), - ("Could not ghost SPU output pad")); + ("Could not ghost video output pad")); goto error_out; failed_spuq_connect: GST_ELEMENT_ERROR (dvdbin, CORE, FAILED, (NULL), ("Could not connect DVD subpicture selector and buffer elements")); goto error_out; failed_spu_ghost: |