mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
ext/swfdec/gstswfdec.c: Add debugging category and return GstFlowReturn in the right places
Original commit message from CVS: * ext/swfdec/gstswfdec.c: (gst_swfdec_class_init), (gst_swfdec_chain), (gst_swfdec_render): Add debugging category and return GstFlowReturn in the right places * ext/wavpack/gstwavpackdec.c: (gst_wavpack_dec_link): Get something from the peer pad once we've checked if there is a peer pad. * gst/qtdemux/qtdemux.c: (gst_qtdemux_change_state), (qtdemux_tree_get_child_by_type), (qtdemux_parse_trak), (qtdemux_video_caps): Couple of fixes
This commit is contained in:
parent
ac8b1191d4
commit
95d65be727
4 changed files with 38 additions and 8 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2005-12-19 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
|
* ext/swfdec/gstswfdec.c: (gst_swfdec_class_init),
|
||||||
|
(gst_swfdec_chain), (gst_swfdec_render):
|
||||||
|
Add debugging category and return GstFlowReturn in the right places
|
||||||
|
* ext/wavpack/gstwavpackdec.c: (gst_wavpack_dec_link):
|
||||||
|
Get something from the peer pad once we've checked if there is a peer pad.
|
||||||
|
* gst/qtdemux/qtdemux.c: (gst_qtdemux_change_state),
|
||||||
|
(qtdemux_tree_get_child_by_type), (qtdemux_parse_trak),
|
||||||
|
(qtdemux_video_caps):
|
||||||
|
Couple of fixes
|
||||||
|
|
||||||
2005-12-19 Edgard Lima <edgard.lima@indt.org.br>
|
2005-12-19 Edgard Lima <edgard.lima@indt.org.br>
|
||||||
|
|
||||||
* ext/divx/Makefile.am:
|
* ext/divx/Makefile.am:
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <swfdec_buffer.h>
|
#include <swfdec_buffer.h>
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_STATIC (swfdec_debug);
|
||||||
|
#define GST_CAT_DEFAULT swfdec_debug
|
||||||
|
|
||||||
/* elementfactory information */
|
/* elementfactory information */
|
||||||
static GstElementDetails gst_swfdec_details =
|
static GstElementDetails gst_swfdec_details =
|
||||||
GST_ELEMENT_DETAILS ("SWF video decoder",
|
GST_ELEMENT_DETAILS ("SWF video decoder",
|
||||||
|
@ -243,6 +246,9 @@ gst_swfdec_class_init (GstSwfdecClass * klass)
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
G_STRUCT_OFFSET (GstSwfdecClass, embed_url), NULL, NULL,
|
G_STRUCT_OFFSET (GstSwfdecClass, embed_url), NULL, NULL,
|
||||||
g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
|
g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_INIT (swfdec_debug, "swfdec", 0, "Flash decoder plugin");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
|
@ -332,11 +338,13 @@ gst_swfdec_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
GstSwfdec *swfdec = GST_SWFDEC (GST_PAD_PARENT (pad));
|
GstSwfdec *swfdec = GST_SWFDEC (GST_PAD_PARENT (pad));
|
||||||
|
|
||||||
g_static_rec_mutex_lock (&swfdec->mutex);
|
g_static_rec_mutex_lock (&swfdec->mutex);
|
||||||
|
GST_DEBUG_OBJECT (swfdec, "about to call swfdec_decoder_parse");
|
||||||
ret = swfdec_decoder_parse (swfdec->decoder);
|
ret = swfdec_decoder_parse (swfdec->decoder);
|
||||||
if (ret == SWF_NEEDBITS) {
|
if (ret == SWF_NEEDBITS) {
|
||||||
guint buf_size;
|
guint buf_size;
|
||||||
GstBuffer *prev_buffer;
|
GstBuffer *prev_buffer;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (swfdec, "SWF_NEEDBITS, feeding data to swfdec-decoder");
|
||||||
buf_size = gst_adapter_available (swfdec->adapter);
|
buf_size = gst_adapter_available (swfdec->adapter);
|
||||||
if (buf_size) {
|
if (buf_size) {
|
||||||
prev_buffer = gst_buffer_new_and_alloc (buf_size);
|
prev_buffer = gst_buffer_new_and_alloc (buf_size);
|
||||||
|
@ -351,8 +359,6 @@ gst_swfdec_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
swfdec_decoder_add_buffer (swfdec->decoder,
|
swfdec_decoder_add_buffer (swfdec->decoder,
|
||||||
gst_swfdec_buffer_to_swf (buffer));
|
gst_swfdec_buffer_to_swf (buffer));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else if (ret == SWF_CHANGE) {
|
} else if (ret == SWF_CHANGE) {
|
||||||
|
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
@ -363,6 +369,7 @@ gst_swfdec_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
GstTagList *taglist;
|
GstTagList *taglist;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (swfdec, "SWF_CHANGE");
|
||||||
gst_adapter_push (swfdec->adapter, buffer);
|
gst_adapter_push (swfdec->adapter, buffer);
|
||||||
|
|
||||||
swfdec_decoder_get_image_size (swfdec->decoder,
|
swfdec_decoder_get_image_size (swfdec->decoder,
|
||||||
|
@ -411,6 +418,7 @@ gst_swfdec_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else if (ret == SWF_EOF) {
|
} else if (ret == SWF_EOF) {
|
||||||
|
GST_DEBUG_OBJECT (swfdec, "SWF_EOF");
|
||||||
gst_swfdec_render (swfdec, ret);
|
gst_swfdec_render (swfdec, ret);
|
||||||
gst_task_start (swfdec->task);
|
gst_task_start (swfdec->task);
|
||||||
}
|
}
|
||||||
|
@ -439,8 +447,10 @@ gst_swfdec_render (GstSwfdec * swfdec, int ret)
|
||||||
GstBuffer *videobuf;
|
GstBuffer *videobuf;
|
||||||
GstBuffer *audiobuf;
|
GstBuffer *audiobuf;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
GstFlowReturn res;
|
||||||
const char *url;
|
const char *url;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (swfdec, "render:SWF_EOF");
|
||||||
swfdec_decoder_set_mouse (swfdec->decoder, swfdec->x, swfdec->y,
|
swfdec_decoder_set_mouse (swfdec->decoder, swfdec->x, swfdec->y,
|
||||||
swfdec->button);
|
swfdec->button);
|
||||||
|
|
||||||
|
@ -448,8 +458,8 @@ gst_swfdec_render (GstSwfdec * swfdec, int ret)
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
gst_task_stop (swfdec->task);
|
gst_task_stop (swfdec->task);
|
||||||
gst_pad_push_event (swfdec->videopad, gst_event_new_eos ());
|
res = gst_pad_push_event (swfdec->videopad, gst_event_new_eos ());
|
||||||
gst_pad_push_event (swfdec->audiopad, gst_event_new_eos ());
|
res = gst_pad_push_event (swfdec->audiopad, gst_event_new_eos ());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,13 +83,14 @@ static GstPadLinkReturn
|
||||||
gst_wavpack_dec_link (GstPad * pad, GstPad * peer)
|
gst_wavpack_dec_link (GstPad * pad, GstPad * peer)
|
||||||
{
|
{
|
||||||
GstWavpackDec *wavpackdec = GST_WAVPACK_DEC (gst_pad_get_parent (pad));
|
GstWavpackDec *wavpackdec = GST_WAVPACK_DEC (gst_pad_get_parent (pad));
|
||||||
GstStructure *structure = gst_caps_get_structure (GST_PAD_CAPS (peer), 0);
|
GstStructure *structure;
|
||||||
GstCaps *srccaps;
|
GstCaps *srccaps;
|
||||||
gint bits;
|
gint bits;
|
||||||
|
|
||||||
if (!gst_caps_is_fixed (GST_PAD_CAPS (peer)))
|
if (!gst_caps_is_fixed (GST_PAD_CAPS (peer)))
|
||||||
return GST_PAD_LINK_REFUSED;
|
return GST_PAD_LINK_REFUSED;
|
||||||
|
|
||||||
|
structure = gst_caps_get_structure (GST_PAD_CAPS (peer), 0);
|
||||||
gst_structure_get_int (structure, "rate",
|
gst_structure_get_int (structure, "rate",
|
||||||
(gint32 *) & wavpackdec->samplerate);
|
(gint32 *) & wavpackdec->samplerate);
|
||||||
gst_structure_get_int (structure, "channels",
|
gst_structure_get_int (structure, "channels",
|
||||||
|
|
|
@ -473,6 +473,7 @@ gst_qtdemux_change_state (GstElement * element, GstStateChange transition)
|
||||||
for (n = 0; n < qtdemux->n_streams; n++) {
|
for (n = 0; n < qtdemux->n_streams; n++) {
|
||||||
gst_element_remove_pad (element, qtdemux->streams[n]->pad);
|
gst_element_remove_pad (element, qtdemux->streams[n]->pad);
|
||||||
g_free (qtdemux->streams[n]->samples);
|
g_free (qtdemux->streams[n]->samples);
|
||||||
|
if (qtdemux->streams[n]->caps)
|
||||||
gst_caps_unref (qtdemux->streams[n]->caps);
|
gst_caps_unref (qtdemux->streams[n]->caps);
|
||||||
g_free (qtdemux->streams[n]);
|
g_free (qtdemux->streams[n]);
|
||||||
}
|
}
|
||||||
|
@ -1765,7 +1766,13 @@ qtdemux_tree_get_child_by_type (GNode * node, guint32 fourcc)
|
||||||
child = g_node_next_sibling (child)) {
|
child = g_node_next_sibling (child)) {
|
||||||
buffer = child->data;
|
buffer = child->data;
|
||||||
|
|
||||||
|
child_fourcc = GST_READ_UINT32_LE (buffer);
|
||||||
|
GST_LOG ("First chunk of buffer %p is [%" GST_FOURCC_FORMAT "]",
|
||||||
|
buffer, GST_FOURCC_ARGS (child_fourcc));
|
||||||
|
|
||||||
child_fourcc = GST_READ_UINT32_LE (buffer + 4);
|
child_fourcc = GST_READ_UINT32_LE (buffer + 4);
|
||||||
|
GST_LOG ("buffer %p has fourcc [%" GST_FOURCC_FORMAT "]",
|
||||||
|
buffer, GST_FOURCC_ARGS (child_fourcc));
|
||||||
|
|
||||||
if (child_fourcc == fourcc) {
|
if (child_fourcc == fourcc) {
|
||||||
return child;
|
return child;
|
||||||
|
@ -1899,7 +1906,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||||
stream = g_new0 (QtDemuxStream, 1);
|
stream = g_new0 (QtDemuxStream, 1);
|
||||||
|
|
||||||
tkhd = qtdemux_tree_get_child_by_type (trak, FOURCC_tkhd);
|
tkhd = qtdemux_tree_get_child_by_type (trak, FOURCC_tkhd);
|
||||||
g_assert (tkhd);
|
g_return_if_fail (tkhd);
|
||||||
|
|
||||||
GST_LOG ("track[tkhd] version/flags: 0x%08x",
|
GST_LOG ("track[tkhd] version/flags: 0x%08x",
|
||||||
QTDEMUX_GUINT32_GET (tkhd->data + 8));
|
QTDEMUX_GUINT32_GET (tkhd->data + 8));
|
||||||
|
@ -2621,7 +2628,7 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc,
|
||||||
return gst_caps_from_string ("image/jpeg");
|
return gst_caps_from_string ("image/jpeg");
|
||||||
case GST_MAKE_FOURCC ('m', 'j', 'p', 'b'):
|
case GST_MAKE_FOURCC ('m', 'j', 'p', 'b'):
|
||||||
_codec ("Motion-JPEG format B");
|
_codec ("Motion-JPEG format B");
|
||||||
return gst_caps_from_string ("image/jpeg-b");
|
return gst_caps_from_string ("video/x-mjpeg-b");
|
||||||
case GST_MAKE_FOURCC ('S', 'V', 'Q', '3'):
|
case GST_MAKE_FOURCC ('S', 'V', 'Q', '3'):
|
||||||
_codec ("Sorensen video v.3");
|
_codec ("Sorensen video v.3");
|
||||||
return gst_caps_from_string ("video/x-svq, " "svqversion = (int) 3");
|
return gst_caps_from_string ("video/x-svq, " "svqversion = (int) 3");
|
||||||
|
|
Loading…
Reference in a new issue