diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2004-12-20 17:54:16 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2004-12-20 17:54:16 +0000 |
commit | 1a293825c71a0803c9032f357f934aee6b54fe79 (patch) | |
tree | b31779cc6a7142a781d7a782e9aa92766a5a6d6a | |
parent | 4ad298d6806a7130c64fce65bf3aa3f7313bba8d (diff) | |
download | gstreamer-plugins-bad-1a293825c71a0803c9032f357f934aee6b54fe79.tar.gz |
Various plugin updates to have something to play with.
Original commit message from CVS:
Various plugin updates to have something to play with.
-rw-r--r-- | ChangeLog | 84 | ||||
m--------- | common | 0 | ||||
-rw-r--r-- | examples/negotiation/Makefile.am | 7 | ||||
-rw-r--r-- | examples/negotiation/colorspace.c | 97 | ||||
-rw-r--r-- | examples/negotiation/queue.c | 147 | ||||
-rw-r--r-- | gst-libs/gst/Makefile.am | 3 | ||||
-rw-r--r-- | gst-libs/gst/audio/gstaudiofilter.c | 39 | ||||
-rw-r--r-- | gst-libs/gst/audio/testchannels.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/gconf/gconf.c | 25 | ||||
-rw-r--r-- | gst-libs/gst/media-info/media-info-priv.c | 21 | ||||
-rw-r--r-- | gst-libs/gst/media-info/media-info.c | 17 | ||||
-rw-r--r-- | gst-libs/gst/riff/riff-read.c | 13 |
12 files changed, 406 insertions, 49 deletions
@@ -1,3 +1,87 @@ +2004-12-20 Wim Taymans <wim@fluendo.com> + + * configure.ac: + * examples/negotiation/Makefile.am: + * examples/negotiation/colorspace.c: (message_received), + (my_chain), (main): + * examples/negotiation/queue.c: (message_received), (block_done), + (do_block), (do_renegotiate), (main): + * ext/mad/gstid3tag.c: (gst_id3_tag_class_init), + (gst_id3_tag_init), (gst_id3_tag_sink_event), + (gst_id3_tag_do_caps_nego), (gst_id3_tag_src_link), + (gst_id3_tag_send_tag_event), (gst_id3_tag_chain), + (gst_id3_tag_change_state): + * ext/mad/gstmad.c: (gst_mad_init), (gst_mad_update_info), + (gst_mad_sink_event), (gst_mad_check_caps_reset), (gst_mad_chain): + * gst-libs/gst/Makefile.am: + * gst-libs/gst/audio/gstaudiofilter.c: (gst_audiofilter_link), + (gst_audiofilter_init), (gst_audiofilter_chain): + * gst-libs/gst/audio/testchannels.c: (main): + * gst-libs/gst/gconf/gconf.c: (gst_bin_find_unconnected_pad), + (gst_gconf_render_bin_from_description): + * gst-libs/gst/media-info/media-info-priv.c: (gmip_reset), + (gmip_find_type), (gmip_find_stream), (gmip_find_track_metadata), + (gmip_find_track_streaminfo), (gmip_find_track_format): + * gst-libs/gst/media-info/media-info.c: + (gst_media_info_read_idler): + * gst-libs/gst/riff/riff-read.c: (gst_riff_read_use_event), + (gst_riff_read_info): + * gst/ac3parse/gstac3parse.c: (gst_ac3parse_class_init), + (gst_ac3parse_init), (gst_ac3parse_chain): + * gst/effectv/gstaging.c: (gst_agingtv_class_init): + * gst/effectv/gstdice.c: (gst_dicetv_class_init): + * gst/effectv/gstquark.c: (gst_quarktv_class_init), + (gst_quarktv_link), (gst_quarktv_init), (gst_quarktv_chain): + * gst/effectv/gstrev.c: (gst_revtv_class_init): + * gst/effectv/gstvertigo.c: (gst_vertigotv_class_init): + * gst/effectv/gstwarp.c: (gst_warptv_class_init): + * gst/ffmpegcolorspace/gstffmpegcolorspace.c: + (gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context), + (gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init), + (gst_ffmpegcsp_chain): + * gst/tags/gstvorbistag.c: (gst_vorbis_tag_chain): + * gst/typefind/gsttypefindfunctions.c: (aac_type_find), + (mp3_type_find), (mpeg2_sys_type_find), (mpeg1_sys_type_find), + (mpeg_video_type_find), (mpeg_video_stream_type_find), + (dv_type_find): + * gst/videofilter/gstgamma.c: (gst_gamma_class_init): + * gst/videofilter/gstvideobalance.c: (gst_videobalance_class_init): + * gst/videofilter/gstvideofilter.c: (gst_videofilter_getcaps), + (gst_videofilter_setcaps), (gst_videofilter_init), + (gst_videofilter_chain), (gst_videofilter_set_output_size): + * gst/videofilter/gstvideoflip.c: (gst_videoflip_class_init): + * gst/videotestsrc/gstvideotestsrc.c: + (gst_videotestsrc_class_init), (gst_videotestsrc_src_negotiate), + (gst_videotestsrc_src_link), (gst_videotestsrc_parse_caps), + (gst_videotestsrc_src_accept_caps), (gst_videotestsrc_setcaps), + (gst_videotestsrc_src_unlink), (gst_videotestsrc_activate), + (gst_videotestsrc_change_state), (gst_videotestsrc_getcaps), + (gst_videotestsrc_init), (gst_videotestsrc_src_query), + (gst_videotestsrc_handle_src_event), (gst_videotestsrc_loop): + * gst/videotestsrc/gstvideotestsrc.h: + * sys/oss/gstosselement.c: (gst_osselement_class_init), + (gst_osselement_parse_caps), (gst_osselement_open_audio), + (gst_osselement_close_audio), (gst_osselement_set_property): + * sys/oss/gstossmixer.c: (gst_ossmixer_build_list): + * sys/oss/gstosssink.c: (gst_osssink_class_init), + (gst_osssink_init), (gst_osssink_setcaps), (gst_osssink_getcaps), + (gst_osssink_handle_event), (gst_osssink_chain), + (gst_osssink_convert), (gst_osssink_sink_query), + (gst_osssink_change_state): + * sys/oss/gstosssrc.c: (gst_osssrc_class_init), (gst_osssrc_init), + (gst_osssrc_getcaps), (gst_osssrc_src_link), + (gst_osssrc_negotiate), (gst_osssrc_loop), (gst_osssrc_convert), + (gst_osssrc_src_event), (gst_osssrc_src_query): + * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support), + (gst_xvimagesink_xcontext_clear), (gst_xvimagesink_fixate), + (gst_xvimagesink_getcaps), (gst_xvimagesink_sink_link), + (gst_xvimagesink_parse_caps), (gst_xvimagesink_change_state), + (gst_xvimagesink_event), (gst_xvimagesink_chain), + (gst_xvimagesink_buffer_alloc), (gst_xvimagesink_init), + (gst_xvimagesink_class_init): + * sys/xvimage/xvimagesink.h: + Various plugin updates to have something to play with. + 2004-12-07 Christian Fredrik Kalager Schaller <set EMAIL_ADDRESS environment variable> Woooho Monoscope is now effectivly LGPL licensed diff --git a/common b/common -Subproject ded6dc5186cb7f8c64cb06a8591b9f787122c6f +Subproject b2638c100721f67b280c3b43b21f1ce1c9b5e31 diff --git a/examples/negotiation/Makefile.am b/examples/negotiation/Makefile.am new file mode 100644 index 000000000..ccd7e4b49 --- /dev/null +++ b/examples/negotiation/Makefile.am @@ -0,0 +1,7 @@ +examples = queue colorspace + +noinst_PROGRAMS = $(examples) + +# we have nothing but apps here, we can do this safely +LIBS = $(GST_LIBS) $(GTK_LIBS) $(GST_CONTROL_LIBS) +AM_CFLAGS = $(GST_CFLAGS) $(GTK_CFLAGS) diff --git a/examples/negotiation/colorspace.c b/examples/negotiation/colorspace.c new file mode 100644 index 000000000..b970a1c79 --- /dev/null +++ b/examples/negotiation/colorspace.c @@ -0,0 +1,97 @@ +/* + * colorspace.c + * + * demo application for negotiation of a simple plugin. + */ + +#include <string.h> +#include <gst/gst.h> + +static GstElement *pipeline; +static GstElement *space; + +static GstPad *src; +static GstPad *sink; +static GstPad *test; + +static gboolean caught_error = FALSE; +static GMainLoop *loop; + +static gboolean +message_received (GstBus * bus, GstMessage * message, gpointer data) +{ + switch (GST_MESSAGE_TYPE (message)) { + case GST_MESSAGE_EOS: + if (g_main_loop_is_running (loop)) + g_main_loop_quit (loop); + break; + case GST_MESSAGE_ERROR: + gst_object_default_error (GST_MESSAGE_SRC (message), + GST_MESSAGE_ERROR_GERROR (message), + GST_MESSAGE_ERROR_DEBUG (message)); + caught_error = TRUE; + if (g_main_loop_is_running (loop)) + g_main_loop_quit (loop); + break; + default: + break; + } + gst_message_unref (message); + + return TRUE; +} + +static GstFlowReturn +my_chain (GstPad * pad, GstBuffer * buffer) +{ + g_print ("got buffer\n"); + return GST_FLOW_OK; +} + +int +main (int argc, char *argv[]) +{ + GstBus *bus; + GstBuffer *buffer; + + gst_init (&argc, &argv); + + pipeline = gst_pipeline_new ("pipeline"); + bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); + loop = g_main_loop_new (NULL, FALSE); + gst_bus_add_watch (bus, message_received, pipeline); + + space = gst_element_factory_make ("ffmpegcolorspace", "space"); + + gst_bin_add (GST_BIN (pipeline), space); + + sink = gst_element_get_pad (space, "sink"); + src = gst_element_get_pad (space, "src"); + gst_element_set_state (pipeline, GST_STATE_PLAYING); + + test = gst_pad_new ("test", GST_PAD_SINK); + gst_pad_set_chain_function (test, my_chain); + + gst_pad_link (src, test); + gst_pad_set_active (test, TRUE); + + gst_pad_set_caps (sink, + gst_caps_new_simple ("video/x-raw-yuv", + "format", GST_TYPE_FOURCC, GST_STR_FOURCC ("YUY2"), + "width", G_TYPE_INT, 240, + "height", G_TYPE_INT, 120, "framerate", G_TYPE_DOUBLE, 30.0, NULL)); + + while (g_main_context_iteration (NULL, FALSE)); + + buffer = gst_buffer_new (); + + GST_REAL_PAD (sink)->chainfunc (sink, buffer); + + while (g_main_context_iteration (NULL, FALSE)); + + gst_element_set_state (pipeline, GST_STATE_NULL); + + gst_object_unref (GST_OBJECT (pipeline)); + + return 0; +} diff --git a/examples/negotiation/queue.c b/examples/negotiation/queue.c new file mode 100644 index 000000000..c7903d9e1 --- /dev/null +++ b/examples/negotiation/queue.c @@ -0,0 +1,147 @@ +/* + * queue.c + * + * demo application for negotiation over queues. + */ + +#include <string.h> +#include <gtk/gtk.h> +#include <gst/gst.h> + +static GstElement *pipeline; +static GstElement *src; +static GstElement *queue; +static GstElement *sink; + +static GstPad *pad1, *peer1; +static GstPad *pad2, *peer2; + +static gboolean caught_error = FALSE; +static GMainLoop *loop; + +static gboolean +message_received (GstBus * bus, GstMessage * message, gpointer data) +{ + switch (GST_MESSAGE_TYPE (message)) { + case GST_MESSAGE_EOS: + if (g_main_loop_is_running (loop)) + g_main_loop_quit (loop); + break; + case GST_MESSAGE_ERROR: + gst_object_default_error (GST_MESSAGE_SRC (message), + GST_MESSAGE_ERROR_GERROR (message), + GST_MESSAGE_ERROR_DEBUG (message)); + caught_error = TRUE; + if (g_main_loop_is_running (loop)) + g_main_loop_quit (loop); + break; + default: + break; + } + gst_message_unref (message); + + return TRUE; +} + +static void +block_done (GstPad * pad, gboolean blocked, gpointer data) +{ + if (blocked) { + g_print ("pad blocked\n"); + /* let's unlink to be cool too */ + gst_pad_unlink (pad2, peer2); + } else { + g_print ("pad unblocked\n"); + } +} + +static gboolean +do_block (GstPipeline * pipeline) +{ + static gint iter = 0; + + + if (iter++ % 2) { + g_print ("blocking pad.."); + if (!gst_pad_set_blocked_async (pad2, TRUE, block_done, NULL)) + g_print ("was blocked\n"); + } else { + /* and relink */ + gst_pad_link (pad2, peer2); + g_print ("unblocking pad.."); + if (!gst_pad_set_blocked_async (pad2, FALSE, block_done, NULL)) + g_print ("was unblocked\n"); + } + return TRUE; +} + +static gboolean +do_renegotiate (GstPipeline * pipeline) +{ + GstCaps *caps; + static gint iter = 0; + + g_print ("reneg\n"); + + if (iter++ % 2) { + caps = gst_caps_new_simple ("video/x-raw-yuv", + "format", GST_TYPE_FOURCC, GST_STR_FOURCC ("I420"), + "width", G_TYPE_INT, 320, + "height", G_TYPE_INT, 240, "framerate", G_TYPE_DOUBLE, 5.0, NULL); + } else { + caps = gst_caps_new_simple ("video/x-raw-yuv", + "format", GST_TYPE_FOURCC, GST_STR_FOURCC ("YUY2"), + "width", G_TYPE_INT, 240, + "height", G_TYPE_INT, 120, "framerate", G_TYPE_DOUBLE, 30.0, NULL); + } + + gst_pad_relink_filtered (pad1, peer1, caps); + gst_caps_unref (caps); + + return TRUE; +} + +int +main (int argc, char *argv[]) +{ + GstBus *bus; + + gtk_init (&argc, &argv); + gst_init (&argc, &argv); + + pipeline = gst_pipeline_new ("pipeline"); + bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); + loop = g_main_loop_new (NULL, FALSE); + gst_bus_add_watch (bus, message_received, pipeline); + + src = gst_element_factory_make ("videotestsrc", "src"); + queue = gst_element_factory_make ("queue", "queue"); + sink = gst_element_factory_make ("xvimagesink", "sink"); + + gst_bin_add (GST_BIN (pipeline), src); + gst_bin_add (GST_BIN (pipeline), queue); + gst_bin_add (GST_BIN (pipeline), sink); + + pad1 = gst_element_get_pad (src, "src"); + peer1 = gst_element_get_pad (queue, "sink"); + + pad2 = gst_element_get_pad (queue, "src"); + peer2 = gst_element_get_pad (sink, "sink"); + + gst_pad_link (pad1, peer1); + gst_pad_link (pad2, peer2); + + gst_element_set_state (pipeline, GST_STATE_PLAYING); + + g_timeout_add (1000, (GSourceFunc) do_block, pipeline); + + g_main_loop_run (loop); + + g_timeout_add (200, (GSourceFunc) do_renegotiate, pipeline); + + gst_element_set_state (pipeline, GST_STATE_NULL); + + gst_object_unref (GST_OBJECT (pipeline)); + + return 0; +} diff --git a/gst-libs/gst/Makefile.am b/gst-libs/gst/Makefile.am index ac8f5952f..ec5cc9157 100644 --- a/gst-libs/gst/Makefile.am +++ b/gst-libs/gst/Makefile.am @@ -27,8 +27,7 @@ SUBDIRS = \ video \ xoverlay \ $(X_DIR) \ - . \ - play + . DIST_SUBDIRS = \ audio \ diff --git a/gst-libs/gst/audio/gstaudiofilter.c b/gst-libs/gst/audio/gstaudiofilter.c index 70ae6bf98..c5ba9e35b 100644 --- a/gst-libs/gst/audio/gstaudiofilter.c +++ b/gst-libs/gst/audio/gstaudiofilter.c @@ -51,7 +51,7 @@ static void gst_audiofilter_set_property (GObject * object, guint prop_id, static void gst_audiofilter_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_audiofilter_chain (GstPad * pad, GstData * _data); +static GstFlowReturn gst_audiofilter_chain (GstPad * pad, GstBuffer * buffer); GstCaps *gst_audiofilter_class_get_capslist (GstAudiofilterClass * klass); static GstElementClass *parent_class = NULL; @@ -113,18 +113,20 @@ gst_audiofilter_class_init (gpointer g_class, gpointer class_data) } static GstPadLinkReturn -gst_audiofilter_link (GstPad * pad, const GstCaps * caps) +gst_audiofilter_link (GstPad * pad, GstPad * peer) { GstAudiofilter *audiofilter; - GstPadLinkReturn ret; - GstPadLinkReturn link_ret; - GstStructure *structure; + + //GstPadLinkReturn ret; + //GstPadLinkReturn link_ret; + //GstStructure *structure; GstAudiofilterClass *audiofilter_class; GST_DEBUG ("gst_audiofilter_link"); audiofilter = GST_AUDIOFILTER (gst_pad_get_parent (pad)); audiofilter_class = GST_AUDIOFILTER_CLASS (G_OBJECT_GET_CLASS (audiofilter)); +#if 0 ret = GST_PAD_LINK_DELAYED; /* intialise with dummy value */ if (pad == audiofilter->srcpad) { link_ret = gst_pad_try_set_caps (audiofilter->sinkpad, caps); @@ -158,6 +160,7 @@ gst_audiofilter_link (GstPad * pad, const GstCaps * caps) if (audiofilter_class->setup) (audiofilter_class->setup) (audiofilter); +#endif return GST_PAD_LINK_OK; } @@ -177,7 +180,7 @@ gst_audiofilter_init (GTypeInstance * instance, gpointer g_class) gst_element_add_pad (GST_ELEMENT (audiofilter), audiofilter->sinkpad); gst_pad_set_chain_function (audiofilter->sinkpad, gst_audiofilter_chain); gst_pad_set_link_function (audiofilter->sinkpad, gst_audiofilter_link); - gst_pad_set_getcaps_function (audiofilter->sinkpad, gst_pad_proxy_getcaps); + //gst_pad_set_getcaps_function (audiofilter->sinkpad, gst_pad_proxy_getcaps); pad_template = gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "src"); @@ -185,24 +188,24 @@ gst_audiofilter_init (GTypeInstance * instance, gpointer g_class) audiofilter->srcpad = gst_pad_new_from_template (pad_template, "src"); gst_element_add_pad (GST_ELEMENT (audiofilter), audiofilter->srcpad); gst_pad_set_link_function (audiofilter->srcpad, gst_audiofilter_link); - gst_pad_set_getcaps_function (audiofilter->srcpad, gst_pad_proxy_getcaps); + //gst_pad_set_getcaps_function (audiofilter->srcpad, gst_pad_proxy_getcaps); audiofilter->inited = FALSE; } -static void -gst_audiofilter_chain (GstPad * pad, GstData * data) +static GstFlowReturn +gst_audiofilter_chain (GstPad * pad, GstBuffer * buffer) { - GstBuffer *inbuf = GST_BUFFER (data); + GstBuffer *inbuf = GST_BUFFER (buffer); GstAudiofilter *audiofilter; GstBuffer *outbuf; GstAudiofilterClass *audiofilter_class; GST_DEBUG ("gst_audiofilter_chain"); - g_return_if_fail (pad != NULL); - g_return_if_fail (GST_IS_PAD (pad)); - g_return_if_fail (inbuf != NULL); + g_return_val_if_fail (pad != NULL, GST_FLOW_ERROR); + g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR); + g_return_val_if_fail (inbuf != NULL, GST_FLOW_ERROR); audiofilter = GST_AUDIOFILTER (gst_pad_get_parent (pad)); //g_return_if_fail (audiofilter->inited); @@ -212,14 +215,14 @@ gst_audiofilter_chain (GstPad * pad, GstData * data) GST_BUFFER_SIZE (inbuf), GST_OBJECT_NAME (audiofilter)); if (audiofilter->passthru) { - gst_pad_push (audiofilter->srcpad, data); - return; + gst_pad_push (audiofilter->srcpad, buffer); + return GST_FLOW_OK; } audiofilter->size = GST_BUFFER_SIZE (inbuf); audiofilter->n_samples = audiofilter->size / audiofilter->bytes_per_sample; - if (gst_data_is_writable (data)) { + if (gst_data_is_writable (GST_DATA (buffer))) { if (audiofilter_class->filter_inplace) { (audiofilter_class->filter_inplace) (audiofilter, inbuf); outbuf = inbuf; @@ -246,7 +249,9 @@ gst_audiofilter_chain (GstPad * pad, GstData * data) gst_buffer_unref (inbuf); } - gst_pad_push (audiofilter->srcpad, GST_DATA (outbuf)); + gst_pad_push (audiofilter->srcpad, outbuf); + + return GST_FLOW_OK; } static void diff --git a/gst-libs/gst/audio/testchannels.c b/gst-libs/gst/audio/testchannels.c index b886c820a..3f226f318 100644 --- a/gst-libs/gst/audio/testchannels.c +++ b/gst-libs/gst/audio/testchannels.c @@ -49,7 +49,7 @@ main (gint argc, gchar * argv[]) str = gst_caps_to_string (caps); g_print ("Test caps #2: %s\n", str); g_free (str); - gst_caps_free (caps); + gst_caps_unref (caps); return 0; } diff --git a/gst-libs/gst/gconf/gconf.c b/gst-libs/gst/gconf/gconf.c index 00b35a22b..b3c566813 100644 --- a/gst-libs/gst/gconf/gconf.c +++ b/gst-libs/gst/gconf/gconf.c @@ -55,25 +55,34 @@ gst_bin_find_unconnected_pad (GstBin * bin, GstPadDirection direction) const GList *pads = NULL; GstElement *element = NULL; - elements = (GList *) gst_bin_get_list (bin); + GST_LOCK (bin); + elements = bin->children; /* traverse all elements looking for unconnected pads */ while (elements && pad == NULL) { element = GST_ELEMENT (elements->data); - pads = gst_element_get_pad_list (element); + GST_LOCK (element); + pads = element->pads; while (pads) { + GstPad *testpad = GST_PAD (pads->data); + /* check if the direction matches */ - if (GST_PAD_DIRECTION (GST_PAD (pads->data)) == direction) { - if (GST_PAD_PEER (GST_PAD (pads->data)) == NULL) { + if (GST_PAD_DIRECTION (testpad) == direction) { + GST_LOCK (pad); + if (GST_PAD_PEER (testpad) == NULL) { + GST_UNLOCK (pad); /* found it ! */ - pad = GST_PAD (pads->data); + pad = testpad; + break; } + GST_UNLOCK (pad); } - if (pad) - break; /* found one already */ pads = g_list_next (pads); } + GST_UNLOCK (element); elements = g_list_next (elements); } + GST_UNLOCK (bin); + return pad; } @@ -147,7 +156,7 @@ gst_gconf_render_bin_from_description (const gchar * description) /* parse the pipeline to a bin */ desc = g_strdup_printf ("bin.( %s )", description); - bin = GST_ELEMENT (gst_parse_launch (desc, &error)); + //bin = GST_ELEMENT (gst_parse_launch (desc, &error)); g_free (desc); if (error) { g_print ("DEBUG: gstgconf: error parsing pipeline %s\n%s\n", diff --git a/gst-libs/gst/media-info/media-info-priv.c b/gst-libs/gst/media-info/media-info-priv.c index 27fadde5e..37f29a844 100644 --- a/gst-libs/gst/media-info/media-info-priv.c +++ b/gst-libs/gst/media-info/media-info-priv.c @@ -273,7 +273,7 @@ G_STMT_START { \ #define CAPS_RESET(target) \ G_STMT_START { \ - if (target) gst_caps_free (target); \ + if (target) gst_caps_unref (target); \ target = NULL; \ } G_STMT_END CAPS_RESET (priv->type); @@ -509,7 +509,9 @@ gmip_find_type (GstMediaInfoPriv * priv, GError ** error) if (!gmip_find_type_pre (priv, error)) return FALSE; GST_DEBUG ("gmip_find_type: iterating"); - while ((priv->type == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) + while ((priv->type == NULL) + // && gst_bin_iterate (GST_BIN (priv->pipeline)) + ) GMI_DEBUG ("+"); GMI_DEBUG ("\n"); return gmip_find_type_post (priv); @@ -616,7 +618,7 @@ gmip_find_stream (GstMediaInfoPriv * priv) /* iterate until caps are found */ /* FIXME: this should be done through the plugin sending some signal * that it is ready for queries */ - while (gst_bin_iterate (GST_BIN (priv->pipeline)) && priv->format == NULL); + //while (gst_bin_iterate (GST_BIN (priv->pipeline)) && priv->format == NULL); if (gst_element_set_state (priv->pipeline, GST_STATE_PAUSED) == GST_STATE_FAILURE) g_warning ("Couldn't set to paused"); @@ -659,7 +661,9 @@ gmip_find_track_metadata (GstMediaInfoPriv * priv) { gmip_find_track_metadata_pre (priv); GST_DEBUG ("gmip_find_metadata: iterating"); - while ((priv->metadata == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) + while ((priv->metadata == NULL) + //&& gst_bin_iterate (GST_BIN (priv->pipeline)) + ) GMI_DEBUG ("+"); GMI_DEBUG ("\n"); gmip_find_track_metadata_post (priv); @@ -729,8 +733,9 @@ gmip_find_track_streaminfo (GstMediaInfoPriv * priv) { gmip_find_track_streaminfo_pre (priv); GST_DEBUG ("DEBUG: gmip_find_streaminfo: iterating"); - while ((priv->streaminfo == NULL) && - gst_bin_iterate (GST_BIN (priv->pipeline))) + while ((priv->streaminfo == NULL) + // && gst_bin_iterate (GST_BIN (priv->pipeline)) + ) GMI_DEBUG ("+"); GMI_DEBUG ("\n"); gmip_find_track_streaminfo_post (priv); @@ -766,7 +771,9 @@ gmip_find_track_format (GstMediaInfoPriv * priv) { gmip_find_track_format_pre (priv); GST_DEBUG ("DEBUG: gmip_find_format: iterating"); - while ((priv->format == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) + while ((priv->format == NULL) + //&& gst_bin_iterate (GST_BIN (priv->pipeline)) + ) GMI_DEBUG ("+"); GMI_DEBUG ("\n"); gmip_find_track_format_post (priv); diff --git a/gst-libs/gst/media-info/media-info.c b/gst-libs/gst/media-info/media-info.c index 16a662502..8e1ecee43 100644 --- a/gst-libs/gst/media-info/media-info.c +++ b/gst-libs/gst/media-info/media-info.c @@ -266,7 +266,8 @@ gst_media_info_read_idler (GstMediaInfo * info, GstMediaInfoStream ** streamp, gchar *mime; GST_LOG ("STATE_TYPEFIND"); - if ((priv->type == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) { + //if ((priv->type == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) { + if ((priv->type == NULL)) { GST_DEBUG ("iterating while in STATE_TYPEFIND"); GMI_DEBUG ("?"); return TRUE; @@ -298,7 +299,8 @@ gst_media_info_read_idler (GstMediaInfo * info, GstMediaInfoStream ** streamp, case GST_MEDIA_INFO_STATE_STREAM: { GST_LOG ("STATE_STREAM"); - if ((priv->format == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) { + //if ((priv->format == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) { + if ((priv->format == NULL)) { GMI_DEBUG ("?"); return TRUE; } @@ -317,7 +319,7 @@ gst_media_info_read_idler (GstMediaInfo * info, GstMediaInfoStream ** streamp, case GST_MEDIA_INFO_STATE_METADATA: { if ((priv->metadata == NULL) && - gst_bin_iterate (GST_BIN (priv->pipeline)) && + //gst_bin_iterate (GST_BIN (priv->pipeline)) && priv->metadata_iters < MAX_METADATA_ITERS) { GMI_DEBUG ("?"); priv->metadata_iters++; @@ -338,8 +340,9 @@ gst_media_info_read_idler (GstMediaInfo * info, GstMediaInfoStream ** streamp, } case GST_MEDIA_INFO_STATE_STREAMINFO: { - if ((priv->streaminfo == NULL) && - gst_bin_iterate (GST_BIN (priv->pipeline))) { + if ((priv->streaminfo == NULL) + //&& gst_bin_iterate (GST_BIN (priv->pipeline)) + ) { GMI_DEBUG ("?"); return TRUE; } @@ -355,7 +358,9 @@ gst_media_info_read_idler (GstMediaInfo * info, GstMediaInfoStream ** streamp, } case GST_MEDIA_INFO_STATE_FORMAT: { - if ((priv->format == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) { + if ((priv->format == NULL) + // && gst_bin_iterate (GST_BIN (priv->pipeline)) + ) { GMI_DEBUG ("?"); return TRUE; } diff --git a/gst-libs/gst/riff/riff-read.c b/gst-libs/gst/riff/riff-read.c index d53947116..7c7e1d09d 100644 --- a/gst-libs/gst/riff/riff-read.c +++ b/gst-libs/gst/riff/riff-read.c @@ -174,10 +174,6 @@ gst_riff_read_use_event (GstRiffRead * riff, GstEvent * event) gst_pad_event_default (riff->sinkpad, event); return FALSE; - case GST_EVENT_INTERRUPT: - gst_event_unref (event); - return FALSE; - case GST_EVENT_DISCONTINUOUS: GST_WARNING_OBJECT (riff, "Unexpected discont - might lose sync"); gst_event_unref (event); @@ -941,15 +937,16 @@ gst_riff_read_info (GstRiffRead * riff) const GList *padlist; /* let the world know about this wonderful thing */ - for (padlist = gst_element_get_pad_list (element); - padlist != NULL; padlist = padlist->next) { + /* FIXME, MT unsafe */ + for (padlist = element->pads; padlist != NULL; padlist = padlist->next) { if (GST_PAD_IS_SRC (padlist->data) && GST_PAD_IS_USABLE (padlist->data)) { gst_event_ref (event); - gst_pad_push (GST_PAD (padlist->data), GST_DATA (event)); + gst_pad_push_event (GST_PAD (padlist->data), event); } } - gst_element_found_tags (element, taglist); + gst_element_post_message (GST_ELEMENT (element), + gst_message_new_tag (GST_OBJECT (element), taglist)); gst_event_unref (event); } else { |