summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2008-11-14 19:52:24 +0000
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2008-11-14 19:52:24 +0000
commit21683124da3e7387616facaa6b4f5e938dbc8d96 (patch)
tree3cff598515ad03af3607eac026a54e1727cf190d
parentc363ecdf67c761ecbca23c22222a759bb3ac7874 (diff)
downloadgst-plugins-bad-21683124da3e7387616facaa6b4f5e938dbc8d96.tar.gz
gst-plugins-bad-21683124da3e7387616facaa6b4f5e938dbc8d96.tar.bz2
gst-plugins-bad-21683124da3e7387616facaa6b4f5e938dbc8d96.zip
ext/x264/gstx264enc.c: Construct source caps in more conventional (and correct) manner.
Original commit message from CVS: * ext/x264/gstx264enc.c: (gst_x264_enc_set_src_caps): Construct source caps in more conventional (and correct) manner.
-rw-r--r--ChangeLog5
-rw-r--r--ext/x264/gstx264enc.c13
2 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index ce320021..aae89e82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-14 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
+
+ * ext/x264/gstx264enc.c: (gst_x264_enc_set_src_caps):
+ Construct source caps in more conventional (and correct) manner.
+
2008-11-14 Christian Schaller <christian.schaller@collabora.co.uk>
* configure.ac: remove experimental build check, -bad is experimental
diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c
index 75d38164..649366cd 100644
--- a/ext/x264/gstx264enc.c
+++ b/ext/x264/gstx264enc.c
@@ -204,7 +204,9 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("video/x-h264")
+ GST_STATIC_CAPS ("video/x-h264, "
+ "framerate = (fraction) [0/1, MAX], "
+ "width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ]")
);
static void gst_x264_enc_finalize (GObject * object);
@@ -712,15 +714,14 @@ gst_x264_enc_header_buf (GstX264Enc * encoder)
static gboolean
gst_x264_enc_set_src_caps (GstX264Enc * encoder, GstPad * pad, GstCaps * caps)
{
- GstStructure *structure;
GstBuffer *buf;
GstCaps *outcaps;
gboolean res;
- structure = gst_caps_get_structure (caps, 0);
- structure = gst_structure_copy (structure);
- gst_structure_set_name (structure, "video/x-h264");
- outcaps = gst_caps_new_full (structure, NULL);
+ outcaps = gst_caps_new_simple ("video/x-h264",
+ "width", G_TYPE_INT, encoder->width,
+ "height", G_TYPE_INT, encoder->height,
+ "framerate", GST_TYPE_FRACTION, encoder->fps_num, encoder->fps_den, NULL);
if (!encoder->byte_stream) {
buf = gst_x264_enc_header_buf (encoder);