mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
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.
This commit is contained in:
parent
a75cf2a9df
commit
a4f491e438
2 changed files with 20 additions and 5 deletions
|
@ -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>
|
2005-04-12 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_factory_filter):
|
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_factory_filter):
|
||||||
|
|
|
@ -303,8 +303,8 @@ theora_enc_sink_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
/* center image if needed */
|
/* center image if needed */
|
||||||
if (enc->center) {
|
if (enc->center) {
|
||||||
/* make sure offset is even, for easier decoding */
|
/* make sure offset is even, for easier decoding */
|
||||||
enc->offset_x = ROUND_UP_2 (enc->info_width - enc->width) / 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;
|
enc->offset_y = ROUND_UP_2 ((enc->info_height - enc->height) / 2);
|
||||||
} else {
|
} else {
|
||||||
enc->offset_x = 0;
|
enc->offset_x = 0;
|
||||||
enc->offset_y = 0;
|
enc->offset_y = 0;
|
||||||
|
@ -401,14 +401,17 @@ theora_push_packet (GstTheoraEnc * enc, ogg_packet * packet,
|
||||||
theora_push_buffer (enc, buf);
|
theora_push_buffer (enc, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static GstCaps *
|
||||||
theora_set_header_on_caps (GstCaps * caps, GstBuffer * buf1,
|
theora_set_header_on_caps (GstCaps * caps, GstBuffer * buf1,
|
||||||
GstBuffer * buf2, GstBuffer * buf3)
|
GstBuffer * buf2, GstBuffer * buf3)
|
||||||
{
|
{
|
||||||
GstStructure *structure = gst_caps_get_structure (caps, 0);
|
GstStructure *structure;
|
||||||
GValue list = { 0 };
|
GValue list = { 0 };
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
|
|
||||||
|
caps = gst_caps_make_writable (caps);
|
||||||
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
|
|
||||||
/* mark buffers */
|
/* mark buffers */
|
||||||
GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_IN_CAPS);
|
GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_IN_CAPS);
|
||||||
GST_BUFFER_FLAG_SET (buf2, 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);
|
gst_structure_set_value (structure, "streamheader", &list);
|
||||||
g_value_unset (&value);
|
g_value_unset (&value);
|
||||||
g_value_unset (&list);
|
g_value_unset (&list);
|
||||||
|
|
||||||
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -491,7 +496,8 @@ theora_enc_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
|
|
||||||
/* mark buffers and put on caps */
|
/* mark buffers and put on caps */
|
||||||
caps = gst_pad_get_caps (enc->srcpad);
|
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 */
|
/* negotiate with these caps */
|
||||||
GST_DEBUG ("here are the caps: %" GST_PTR_FORMAT, caps);
|
GST_DEBUG ("here are the caps: %" GST_PTR_FORMAT, caps);
|
||||||
|
|
Loading…
Reference in a new issue