From: Luis de Bethencourt Date: Thu, 2 Jun 2011 16:57:05 +0000 (+0200) Subject: theora: set the width/height/par on the srcpad caps X-Git-Tag: 1.19.3~511^2~6555^2~820 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ce538d912ca7738bc509b3bd6b39dc927f4ad83;p=platform%2Fupstream%2Fgstreamer.git theora: set the width/height/par on the srcpad caps --- diff --git a/ext/theora/gsttheoraenc.c b/ext/theora/gsttheoraenc.c index f9967d1..15c9186 100644 --- a/ext/theora/gsttheoraenc.c +++ b/ext/theora/gsttheoraenc.c @@ -699,12 +699,16 @@ theora_enc_sink_setcaps (GstPad * pad, GstCaps * caps) enc->info.fps_denominator = enc->fps_d = fps_d; if (par) { enc->info.aspect_numerator = gst_value_get_fraction_numerator (par); + enc->par_n = gst_value_get_fraction_numerator (par); enc->info.aspect_denominator = gst_value_get_fraction_denominator (par); + enc->par_d = gst_value_get_fraction_denominator (par); } else { /* setting them to 0 indicates that the decoder can chose a good aspect * ratio, defaulting to 1/1 */ enc->info.aspect_numerator = 0; + enc->par_n = 1; enc->info.aspect_denominator = 0; + enc->par_d = 1; } enc->info.colorspace = TH_CS_UNSPECIFIED; @@ -1255,7 +1259,11 @@ theora_enc_chain (GstPad * pad, GstBuffer * buffer) buffers = g_slist_reverse (buffers); /* mark buffers and put on caps */ - caps = gst_pad_get_caps (enc->srcpad); + caps = gst_caps_new_simple ("video/x-theora", + "width", G_TYPE_INT, enc->width, + "height", G_TYPE_INT, enc->height, + "framerate", GST_TYPE_FRACTION, enc->fps_n, enc->fps_d, + "pixel-aspect-ratio", GST_TYPE_FRACTION, enc->par_n, enc->par_d, NULL); caps = theora_set_header_on_caps (caps, buffers); GST_DEBUG ("here are the caps: %" GST_PTR_FORMAT, caps); gst_pad_set_caps (enc->srcpad, caps); diff --git a/ext/theora/gsttheoraenc.h b/ext/theora/gsttheoraenc.h index 08707d8..69d4050 100644 --- a/ext/theora/gsttheoraenc.h +++ b/ext/theora/gsttheoraenc.h @@ -102,6 +102,7 @@ struct _GstTheoraEnc gint info_width, info_height; gint width, height; gint fps_n, fps_d; + gint par_n, par_d; GstClockTime next_ts; GstClockTime expected_ts;