From b5b650c6ee599b38a7d1e984d726ebbe7984c6e0 Mon Sep 17 00:00:00 2001 From: gb Date: Tue, 22 Jun 2010 13:57:33 +0000 Subject: [PATCH] Really drop any dependency on libgstvideo. i.e. inline the helpers. --- gst-libs/gst/video/gstbasevideodecoder.c | 28 ++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/gst-libs/gst/video/gstbasevideodecoder.c b/gst-libs/gst/video/gstbasevideodecoder.c index 54a91288c9..7804cb1ce4 100644 --- a/gst-libs/gst/video/gstbasevideodecoder.c +++ b/gst-libs/gst/video/gstbasevideodecoder.c @@ -147,25 +147,31 @@ gst_base_video_decoder_sink_setcaps (GstPad * pad, GstCaps * caps) state = &base_video_decoder->state; - if (state->codec_data) { + if (state->codec_data) gst_buffer_unref (state->codec_data); - } memset (state, 0, sizeof (GstVideoState)); structure = gst_caps_get_structure (caps, 0); - gst_video_format_parse_caps (caps, NULL, &state->width, &state->height); - gst_video_parse_caps_framerate (caps, &state->fps_n, &state->fps_d); - gst_video_parse_caps_pixel_aspect_ratio (caps, &state->par_n, &state->par_d); + gst_structure_get_int (structure, "width", &state->width); + gst_structure_get_int (structure, "height", &state->height); + + /* framerate default: 25 fps */ + if (!gst_structure_get_fraction (structure, "framerate", + &state->fps_n, &state->fps_d)) { + state->fps_n = 25; + state->fps_d = 1; + } + + /* pixel-aspect-ratio default: 1/1 */ + if (!gst_structure_get_fraction (structure, "pixel-aspect-ratio", + &state->par_n, &state->par_d)) { + state->par_n = 1; + state->par_d = 1; + } -#if 0 - /* requires 0.10.23 */ - state->have_interlaced = - gst_video_format_parse_caps_interlaced (caps, &state->interlaced); -#else state->have_interlaced = gst_structure_get_boolean (structure, "interlaced", &state->interlaced); -#endif codec_data = gst_structure_get_value (structure, "codec_data"); if (codec_data && G_VALUE_TYPE (codec_data) == GST_TYPE_BUFFER) {