summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2005-04-20 09:42:56 +0000
committerWim Taymans <wim.taymans@gmail.com>2005-04-20 09:42:56 +0000
commita4f491e438ae265f5e9bf6f14460148369fb197a (patch)
tree9f2bd9f72c57947110f24c243bfd71c66d3687d1
parenta75cf2a9dfccc455e8cd0bc5145ef93c2527063e (diff)
ext/: Fix theora encoder.
Original commit message from CVS: * ext/ogg/gstoggdemux.c: (gst_ogg_demux_factory_filter), (gst_ogg_demux_sink_activate): * ext/theora/theoraenc.c: (theora_enc_sink_setcaps), (theora_set_header_on_caps), (theora_enc_sink_event), (theora_enc_chain): Fix theora encoder.
-rw-r--r--ChangeLog9
-rw-r--r--ext/theora/theoraenc.c16
2 files changed, 20 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ee899ac44..47fe664bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-04-20 Wim Taymans <wim@fluendo.com>
+
+ * ext/ogg/gstoggdemux.c: (gst_ogg_demux_factory_filter),
+ (gst_ogg_demux_sink_activate):
+ * ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
+ (theora_set_header_on_caps), (theora_enc_sink_event),
+ (theora_enc_chain):
+ Fix theora encoder.
+
2005-04-12 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_factory_filter):
diff --git a/ext/theora/theoraenc.c b/ext/theora/theoraenc.c
index 84c525529..1eb4273db 100644
--- a/ext/theora/theoraenc.c
+++ b/ext/theora/theoraenc.c
@@ -303,8 +303,8 @@ theora_enc_sink_setcaps (GstPad * pad, GstCaps * caps)
/* center image if needed */
if (enc->center) {
/* make sure offset is even, for easier decoding */
- enc->offset_x = ROUND_UP_2 (enc->info_width - enc->width) / 2;
- enc->offset_y = ROUND_UP_2 (enc->info_height - enc->height) / 2;
+ enc->offset_x = ROUND_UP_2 ((enc->info_width - enc->width) / 2);
+ enc->offset_y = ROUND_UP_2 ((enc->info_height - enc->height) / 2);
} else {
enc->offset_x = 0;
enc->offset_y = 0;
@@ -401,14 +401,17 @@ theora_push_packet (GstTheoraEnc * enc, ogg_packet * packet,
theora_push_buffer (enc, buf);
}
-static void
+static GstCaps *
theora_set_header_on_caps (GstCaps * caps, GstBuffer * buf1,
GstBuffer * buf2, GstBuffer * buf3)
{
- GstStructure *structure = gst_caps_get_structure (caps, 0);
+ GstStructure *structure;
GValue list = { 0 };
GValue value = { 0 };
+ caps = gst_caps_make_writable (caps);
+ structure = gst_caps_get_structure (caps, 0);
+
/* mark buffers */
GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_IN_CAPS);
GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_IN_CAPS);
@@ -430,6 +433,8 @@ theora_set_header_on_caps (GstCaps * caps, GstBuffer * buf1,
gst_structure_set_value (structure, "streamheader", &list);
g_value_unset (&value);
g_value_unset (&list);
+
+ return caps;
}
static gboolean
@@ -491,7 +496,8 @@ theora_enc_chain (GstPad * pad, GstBuffer * buffer)
/* mark buffers and put on caps */
caps = gst_pad_get_caps (enc->srcpad);
- theora_set_header_on_caps (caps, buf1, buf2, buf3);
+ caps = theora_set_header_on_caps (caps, buf1, buf2, buf3);
+ gst_pad_set_caps (enc->srcpad, caps);
/* negotiate with these caps */
GST_DEBUG ("here are the caps: %" GST_PTR_FORMAT, caps);