summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-09-30 15:47:17 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-09-30 15:49:02 +0200
commitd96defb1645a0d6b34d38fb0c598d7c8f033bb98 (patch)
tree8fcf37f16cd8448262c722c8c03b5718cbc1583e
parent25837289c4cbf5381e40bcb80e94cf14f57e9f59 (diff)
resindvdbin: Create external srcpads from the static pad templates
-rw-r--r--ext/resindvd/resindvdbin.c22
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
@@ -60,20 +60,18 @@ enum
60 ARG_DEVICE 60 ARG_DEVICE
61}; 61};
62 62
63/* FIXME: Could list specific video and audio caps: */
64static GstStaticPadTemplate video_src_template = 63static GstStaticPadTemplate video_src_template =
65GST_STATIC_PAD_TEMPLATE ("video", 64GST_STATIC_PAD_TEMPLATE ("video",
66 GST_PAD_SRC, 65 GST_PAD_SRC,
67 GST_PAD_SOMETIMES, 66 GST_PAD_SOMETIMES,
68 GST_STATIC_CAPS 67 GST_STATIC_CAPS ("video/x-raw-yuv")
69 ("video/mpeg, mpegversion=(int) { 1, 2 }, systemstream=false")
70 ); 68 );
71 69
72static GstStaticPadTemplate audio_src_template = 70static GstStaticPadTemplate audio_src_template =
73 GST_STATIC_PAD_TEMPLATE ("audio", 71 GST_STATIC_PAD_TEMPLATE ("audio",
74 GST_PAD_SRC, 72 GST_PAD_SRC,
75 GST_PAD_SOMETIMES, 73 GST_PAD_SOMETIMES,
76 GST_STATIC_CAPS ("audio/x-raw-int;audio/x-raw-float") 74 GST_STATIC_CAPS ("audio/x-raw-int; audio/x-raw-float")
77 ); 75 );
78 76
79static GstStaticPadTemplate subpicture_src_template = 77static GstStaticPadTemplate subpicture_src_template =
@@ -360,6 +358,7 @@ _pad_block_destroy_notify (RsnDvdBinPadBlockCtx * ctx)
360static gboolean 358static gboolean
361create_elements (RsnDvdBin * dvdbin) 359create_elements (RsnDvdBin * dvdbin)
362{ 360{
361 GstPadTemplate *src_templ = NULL;
363 GstPad *src = NULL; 362 GstPad *src = NULL;
364 GstPad *sink = NULL; 363 GstPad *sink = NULL;
365 RsnDvdBinPadBlockCtx *bctx = NULL; 364 RsnDvdBinPadBlockCtx *bctx = NULL;
@@ -451,7 +450,9 @@ create_elements (RsnDvdBin * dvdbin)
451#endif 450#endif
452 if (src == NULL) 451 if (src == NULL)
453 goto failed_video_ghost; 452 goto failed_video_ghost;
454 dvdbin->video_pad = gst_ghost_pad_new ("video", src); 453 src_templ = gst_static_pad_template_get (&video_src_template);
454 dvdbin->video_pad = gst_ghost_pad_new_from_template ("video", src, src_templ);
455 gst_object_unref (src_templ);
455 if (dvdbin->video_pad == NULL) 456 if (dvdbin->video_pad == NULL)
456 goto failed_video_ghost; 457 goto failed_video_ghost;
457 gst_pad_set_active (dvdbin->video_pad, TRUE); 458 gst_pad_set_active (dvdbin->video_pad, TRUE);
@@ -494,7 +495,10 @@ create_elements (RsnDvdBin * dvdbin)
494 src = gst_element_get_static_pad (dvdbin->pieces[DVD_ELEM_SPUQ], "src"); 495 src = gst_element_get_static_pad (dvdbin->pieces[DVD_ELEM_SPUQ], "src");
495 if (src == NULL) 496 if (src == NULL)
496 goto failed_spu_ghost; 497 goto failed_spu_ghost;
497 dvdbin->subpicture_pad = gst_ghost_pad_new ("subpicture", src); 498 src_templ = gst_static_pad_template_get (&subpicture_src_template);
499 dvdbin->subpicture_pad =
500 gst_ghost_pad_new_from_template ("subpicture", src, src_templ);
501 gst_object_unref (src_templ);
498 if (dvdbin->subpicture_pad == NULL) 502 if (dvdbin->subpicture_pad == NULL)
499 goto failed_spu_ghost; 503 goto failed_spu_ghost;
500 gst_pad_set_active (dvdbin->subpicture_pad, TRUE); 504 gst_pad_set_active (dvdbin->subpicture_pad, TRUE);
@@ -551,7 +555,9 @@ create_elements (RsnDvdBin * dvdbin)
551 src = gst_element_get_static_pad (dvdbin->pieces[DVD_ELEM_AUD_MUNGE], "src"); 555 src = gst_element_get_static_pad (dvdbin->pieces[DVD_ELEM_AUD_MUNGE], "src");
552 if (src == NULL) 556 if (src == NULL)
553 goto failed_aud_ghost; 557 goto failed_aud_ghost;
554 dvdbin->audio_pad = gst_ghost_pad_new ("audio", src); 558 src_templ = gst_static_pad_template_get (&audio_src_template);
559 dvdbin->audio_pad = gst_ghost_pad_new_from_template ("audio", src, src_templ);
560 gst_object_unref (src_templ);
555 if (dvdbin->audio_pad == NULL) 561 if (dvdbin->audio_pad == NULL)
556 goto failed_aud_ghost; 562 goto failed_aud_ghost;
557 gst_pad_set_active (dvdbin->audio_pad, TRUE); 563 gst_pad_set_active (dvdbin->audio_pad, TRUE);
@@ -589,7 +595,7 @@ failed_vidq_connect:
589#endif 595#endif
590failed_video_ghost: 596failed_video_ghost:
591 GST_ELEMENT_ERROR (dvdbin, CORE, FAILED, (NULL), 597 GST_ELEMENT_ERROR (dvdbin, CORE, FAILED, (NULL),
592 ("Could not ghost SPU output pad")); 598 ("Could not ghost video output pad"));
593 goto error_out; 599 goto error_out;
594failed_spuq_connect: 600failed_spuq_connect:
595 GST_ELEMENT_ERROR (dvdbin, CORE, FAILED, (NULL), 601 GST_ELEMENT_ERROR (dvdbin, CORE, FAILED, (NULL),