mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 17:18:15 +00:00
ext/theora/gsttheoraparse.h: ext/theora/theoraparse.c (theora_parse_drain_event_queue) (theora_parse_push_headers, th...
Original commit message from CVS: 2006-07-14 Andy Wingo <wingo@pobox.com> * ext/theora/gsttheoraparse.h: * ext/theora/theoraparse.c (theora_parse_drain_event_queue) (theora_parse_push_headers, theora_parse_clear_queue) (theora_parse_drain_queue_prematurely, ) (theora_parse_sink_event, theora_parse_change_state): Queue events until we initialized our state, like in vorbisparse.
This commit is contained in:
parent
9781f4ff93
commit
7e6940446a
4 changed files with 48 additions and 5 deletions
|
@ -1,5 +1,12 @@
|
|||
2006-07-14 Andy Wingo <wingo@pobox.com>
|
||||
|
||||
* ext/theora/gsttheoraparse.h:
|
||||
* ext/theora/theoraparse.c (theora_parse_drain_event_queue)
|
||||
(theora_parse_push_headers, theora_parse_clear_queue)
|
||||
(theora_parse_drain_queue_prematurely, )
|
||||
(theora_parse_sink_event, theora_parse_change_state): Queue events
|
||||
until we initialized our state, like in vorbisparse.
|
||||
|
||||
* ext/vorbis/vorbisparse.h:
|
||||
* ext/vorbis/vorbisparse.c (vorbis_parse_drain_event_queue)
|
||||
(vorbis_parse_push_headers, vorbis_parse_clear_queue)
|
||||
|
|
|
@ -59,6 +59,7 @@ struct _GstTheoraParse {
|
|||
gboolean streamheader_received;
|
||||
GstBuffer * streamheader[3];
|
||||
|
||||
GQueue * event_queue;
|
||||
GQueue * buffer_queue;
|
||||
|
||||
theora_info info;
|
||||
|
|
|
@ -214,11 +214,24 @@ theora_parse_set_streamheader (GstTheoraParse * parse)
|
|||
parse->streamheader_received = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
theora_parse_drain_event_queue (GstTheoraParse * parse)
|
||||
{
|
||||
while (parse->event_queue->length) {
|
||||
GstEvent *event;
|
||||
|
||||
event = GST_EVENT_CAST (g_queue_pop_head (parse->event_queue));
|
||||
gst_pad_event_default (parse->sinkpad, event);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
theora_parse_push_headers (GstTheoraParse * parse)
|
||||
{
|
||||
gint i;
|
||||
|
||||
theora_parse_drain_event_queue (parse);
|
||||
|
||||
if (!parse->streamheader_received)
|
||||
theora_parse_set_streamheader (parse);
|
||||
|
||||
|
@ -239,6 +252,12 @@ theora_parse_clear_queue (GstTheoraParse * parse)
|
|||
buf = GST_BUFFER_CAST (g_queue_pop_head (parse->buffer_queue));
|
||||
gst_buffer_unref (buf);
|
||||
}
|
||||
while (parse->event_queue->length) {
|
||||
GstEvent *event;
|
||||
|
||||
event = GST_EVENT_CAST (g_queue_pop_head (parse->event_queue));
|
||||
gst_buffer_unref (event);
|
||||
}
|
||||
}
|
||||
|
||||
static gint64
|
||||
|
@ -314,6 +333,10 @@ theora_parse_drain_queue_prematurely (GstTheoraParse * parse)
|
|||
|
||||
GST_DEBUG_OBJECT (parse, "got EOS, draining queue");
|
||||
|
||||
/* if we get an eos before pushing the streamheaders, drain our events before
|
||||
* eos */
|
||||
theora_parse_drain_event_queue (parse);
|
||||
|
||||
while (!g_queue_is_empty (parse->buffer_queue)) {
|
||||
GstBuffer *buf;
|
||||
|
||||
|
@ -452,6 +475,13 @@ theora_parse_chain (GstPad * pad, GstBuffer * buffer)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
theora_parse_queue_event (GstTheoraParse * parse, GstEvent * event)
|
||||
{
|
||||
g_queue_push_tail (parse->event_queue, event);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
theora_parse_sink_event (GstPad * pad, GstEvent * event)
|
||||
{
|
||||
|
@ -472,7 +502,10 @@ theora_parse_sink_event (GstPad * pad, GstEvent * event)
|
|||
ret = gst_pad_event_default (pad, event);
|
||||
break;
|
||||
default:
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
if (parse->send_streamheader && GST_EVENT_IS_SERIALIZED (event))
|
||||
ret = theora_parse_queue_event (parse, event);
|
||||
else
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -661,6 +694,7 @@ theora_parse_change_state (GstElement * element, GstStateChange transition)
|
|||
parse->packetno = 0;
|
||||
parse->send_streamheader = TRUE;
|
||||
parse->buffer_queue = g_queue_new ();
|
||||
parse->event_queue = g_queue_new ();
|
||||
parse->prev_keyframe = -1;
|
||||
parse->prev_frame = -1;
|
||||
break;
|
||||
|
@ -676,6 +710,7 @@ theora_parse_change_state (GstElement * element, GstStateChange transition)
|
|||
theora_comment_clear (&parse->comment);
|
||||
theora_parse_clear_queue (parse);
|
||||
g_queue_free (parse->buffer_queue);
|
||||
g_queue_free (parse->event_queue);
|
||||
parse->buffer_queue = NULL;
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (parse->streamheader[i]) {
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#define GST_LICENSE "LGPL"
|
||||
|
||||
/* package name in plugins */
|
||||
#define GST_PACKAGE_NAME "GStreamer Base Plug-ins source release"
|
||||
#define GST_PACKAGE_NAME "GStreamer Base Plug-ins CVS/prerelease"
|
||||
|
||||
/* package origin */
|
||||
#define GST_PACKAGE_ORIGIN "Unknown package origin"
|
||||
|
@ -211,13 +211,13 @@
|
|||
#undef PACKAGE_NAME "GStreamer Base Plug-ins"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING "GStreamer Base Plug-ins 0.10.9"
|
||||
#undef PACKAGE_STRING "GStreamer Base Plug-ins 0.10.9.1"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME "gst-plugins-base"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION "0.10.9"
|
||||
#undef PACKAGE_VERSION "0.10.9.1"
|
||||
|
||||
/* directory where plugins are located */
|
||||
#undef PLUGINDIR
|
||||
|
@ -241,7 +241,7 @@
|
|||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.10.9"
|
||||
#define VERSION "0.10.9.1"
|
||||
|
||||
/* Define to 1 if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
|
|
Loading…
Reference in a new issue