2005-03-21 17:34:02 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2004 Wim Taymans <wim@fluendo.com>
|
|
|
|
*
|
|
|
|
* gstbus.h: Header for GstBus subsystem
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_BUS_H__
|
|
|
|
#define __GST_BUS_H__
|
|
|
|
|
2005-07-18 12:49:53 +00:00
|
|
|
typedef struct _GstBus GstBus;
|
2006-02-10 16:04:59 +00:00
|
|
|
typedef struct _GstBusPrivate GstBusPrivate;
|
2005-07-18 12:49:53 +00:00
|
|
|
typedef struct _GstBusClass GstBusClass;
|
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
#include <gst/gstmessage.h>
|
|
|
|
#include <gst/gstclock.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
/* --- standard type macros --- */
|
|
|
|
#define GST_TYPE_BUS (gst_bus_get_type ())
|
|
|
|
#define GST_BUS(bus) (G_TYPE_CHECK_INSTANCE_CAST ((bus), GST_TYPE_BUS, GstBus))
|
|
|
|
#define GST_IS_BUS(bus) (G_TYPE_CHECK_INSTANCE_TYPE ((bus), GST_TYPE_BUS))
|
|
|
|
#define GST_BUS_CLASS(bclass) (G_TYPE_CHECK_CLASS_CAST ((bclass), GST_TYPE_BUS, GstBusClass))
|
|
|
|
#define GST_IS_BUS_CLASS(bclass) (G_TYPE_CHECK_CLASS_TYPE ((bclass), GST_TYPE_BUS))
|
|
|
|
#define GST_BUS_GET_CLASS(bus) (G_TYPE_INSTANCE_GET_CLASS ((bus), GST_TYPE_BUS, GstBusClass))
|
|
|
|
#define GST_BUS_CAST(bus) ((GstBus*)(bus))
|
|
|
|
|
2005-10-08 14:57:09 +00:00
|
|
|
/**
|
|
|
|
* GstBusFlags:
|
|
|
|
* @GST_BUS_FLUSHING: The bus is currently dropping all messages
|
|
|
|
* @GST_BUS_FLAG_LAST: offset to define more flags
|
|
|
|
*
|
|
|
|
* The standard flags that a bus may have.
|
|
|
|
*/
|
2005-05-11 03:37:10 +00:00
|
|
|
typedef enum {
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
* docs/gst/gstreamer-sections.txt:
* gst/base/gstbasesink.c: (gst_base_sink_init):
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_get_range), (gst_base_src_check_get_range),
(gst_base_src_start), (gst_base_src_stop):
* gst/base/gstbasesrc.h:
* gst/elements/gstfakesrc.c: (gst_fake_src_set_property):
* gst/gstbin.c: (gst_bin_add_func), (gst_bin_remove_func),
(bin_element_is_sink), (reset_degree), (gst_bin_element_set_state),
(bin_bus_handler):
* gst/gstbin.h:
* gst/gstbuffer.h:
* gst/gstbus.c: (gst_bus_post), (gst_bus_set_flushing):
* gst/gstbus.h:
* gst/gstelement.c: (gst_element_is_locked_state),
(gst_element_set_locked_state), (gst_element_commit_state),
(gst_element_set_state):
* gst/gstelement.h:
* gst/gstindex.c: (gst_index_init):
* gst/gstindex.h:
* gst/gstminiobject.h:
* gst/gstobject.c: (gst_object_init), (gst_object_sink),
(gst_object_set_parent):
* gst/gstobject.h:
* gst/gstpad.c: (gst_pad_set_blocked_async), (gst_pad_is_blocked),
(gst_pad_get_caps_unlocked), (gst_pad_set_caps):
* gst/gstpad.h:
* gst/gstpadtemplate.h:
* gst/gstpipeline.c: (gst_pipeline_provide_clock_func),
(gst_pipeline_use_clock), (gst_pipeline_auto_clock):
* gst/gstpipeline.h:
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(gst_file_index_commit):
* testsuite/bytestream/filepadsink.c: (gst_fp_sink_init):
* testsuite/pad/link.c: (gst_test_src_init),
(gst_test_filter_init), (gst_test_sink_init):
* testsuite/states/locked.c: (main):
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:28:39 +00:00
|
|
|
GST_BUS_FLUSHING = (GST_OBJECT_FLAG_LAST << 0),
|
|
|
|
/* padding */
|
|
|
|
GST_BUS_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 1)
|
2005-05-11 03:37:10 +00:00
|
|
|
} GstBusFlags;
|
|
|
|
|
2005-10-08 14:57:09 +00:00
|
|
|
/**
|
|
|
|
* GstBusSyncReply:
|
|
|
|
* @GST_BUS_DROP: drop the message
|
|
|
|
* @GST_BUS_PASS: pass the message to the async queue
|
|
|
|
* @GST_BUS_ASYNC: pass message to async queue, continue if message is handled
|
|
|
|
*
|
|
|
|
* The result values for a GstBusSyncHandler.
|
|
|
|
*/
|
2005-03-21 17:34:02 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2005-10-08 14:57:09 +00:00
|
|
|
GST_BUS_DROP = 0,
|
|
|
|
GST_BUS_PASS = 1,
|
2006-07-06 09:21:03 +00:00
|
|
|
GST_BUS_ASYNC = 2
|
2005-03-21 17:34:02 +00:00
|
|
|
} GstBusSyncReply;
|
|
|
|
|
2005-08-25 23:17:18 +00:00
|
|
|
/**
|
|
|
|
* GstBusSyncHandler:
|
|
|
|
* @bus: the #GstBus that sent the message
|
2005-09-11 12:57:36 +00:00
|
|
|
* @message: the #GstMessage
|
2005-08-25 23:17:18 +00:00
|
|
|
* @data: user data that has been given, when registering the handler
|
|
|
|
*
|
|
|
|
* Handler will be invoked synchronously, when a new message has been injected
|
GstBusHandler -> GstBusFunc, return value has the same meaning as any other GSource (FALSE == remove source).
Original commit message from CVS:
* check/gst/gstbin.c: (pop_messages), (GST_START_TEST):
* check/gst/gstbus.c: (message_func_eos), (message_func_app),
(send_messages), (GST_START_TEST), (gstbus_suite):
* check/gst/gstpipeline.c: (GST_START_TEST):
* check/pipelines/cleanup.c: (run_pipeline):
* check/pipelines/simple_launch_lines.c: (run_pipeline),
(GST_START_TEST):
* gst/gstbus.c: (gst_bus_have_pending), (gst_bus_source_prepare),
(gst_bus_source_check), (gst_bus_source_dispatch),
(gst_bus_create_watch), (gst_bus_add_watch_full),
(gst_bus_add_watch), (poll_func), (poll_timeout), (gst_bus_poll):
* gst/gstbus.h:
* tools/gst-launch.c: (event_loop):
* tools/gst-md5sum.c: (event_loop):
GstBusHandler -> GstBusFunc, return value has the same meaning as
any other GSource (FALSE == remove source).
_add_watch() and _add_watch_full() now take a MessageType mask to
only handle specific types of messages.
_poll() returns the GstMessage instead of the message type to avoid
race conditions.
_have_pending() takes a MessageType mask now too.
Added testsuite for multiple bus watches.
Fix testsuites and applications for new bus API.
2005-09-19 11:18:03 +00:00
|
|
|
* into the bus. This function is mostly used internally. Only one sync handler
|
|
|
|
* can be attached to a given bus.
|
2005-08-25 23:17:18 +00:00
|
|
|
*
|
2005-11-04 12:08:19 +00:00
|
|
|
* If the handler returns GST_BUS_DROP, it should unref the message, else the
|
|
|
|
* message should not be unreffed by the sync handler.
|
|
|
|
*
|
2005-08-25 23:17:18 +00:00
|
|
|
* Returns: #GstBusSyncReply stating what to do with the message
|
|
|
|
*/
|
GstBusHandler -> GstBusFunc, return value has the same meaning as any other GSource (FALSE == remove source).
Original commit message from CVS:
* check/gst/gstbin.c: (pop_messages), (GST_START_TEST):
* check/gst/gstbus.c: (message_func_eos), (message_func_app),
(send_messages), (GST_START_TEST), (gstbus_suite):
* check/gst/gstpipeline.c: (GST_START_TEST):
* check/pipelines/cleanup.c: (run_pipeline):
* check/pipelines/simple_launch_lines.c: (run_pipeline),
(GST_START_TEST):
* gst/gstbus.c: (gst_bus_have_pending), (gst_bus_source_prepare),
(gst_bus_source_check), (gst_bus_source_dispatch),
(gst_bus_create_watch), (gst_bus_add_watch_full),
(gst_bus_add_watch), (poll_func), (poll_timeout), (gst_bus_poll):
* gst/gstbus.h:
* tools/gst-launch.c: (event_loop):
* tools/gst-md5sum.c: (event_loop):
GstBusHandler -> GstBusFunc, return value has the same meaning as
any other GSource (FALSE == remove source).
_add_watch() and _add_watch_full() now take a MessageType mask to
only handle specific types of messages.
_poll() returns the GstMessage instead of the message type to avoid
race conditions.
_have_pending() takes a MessageType mask now too.
Added testsuite for multiple bus watches.
Fix testsuites and applications for new bus API.
2005-09-19 11:18:03 +00:00
|
|
|
typedef GstBusSyncReply (*GstBusSyncHandler) (GstBus * bus, GstMessage * message, gpointer data);
|
|
|
|
|
2005-08-25 23:17:18 +00:00
|
|
|
/**
|
GstBusHandler -> GstBusFunc, return value has the same meaning as any other GSource (FALSE == remove source).
Original commit message from CVS:
* check/gst/gstbin.c: (pop_messages), (GST_START_TEST):
* check/gst/gstbus.c: (message_func_eos), (message_func_app),
(send_messages), (GST_START_TEST), (gstbus_suite):
* check/gst/gstpipeline.c: (GST_START_TEST):
* check/pipelines/cleanup.c: (run_pipeline):
* check/pipelines/simple_launch_lines.c: (run_pipeline),
(GST_START_TEST):
* gst/gstbus.c: (gst_bus_have_pending), (gst_bus_source_prepare),
(gst_bus_source_check), (gst_bus_source_dispatch),
(gst_bus_create_watch), (gst_bus_add_watch_full),
(gst_bus_add_watch), (poll_func), (poll_timeout), (gst_bus_poll):
* gst/gstbus.h:
* tools/gst-launch.c: (event_loop):
* tools/gst-md5sum.c: (event_loop):
GstBusHandler -> GstBusFunc, return value has the same meaning as
any other GSource (FALSE == remove source).
_add_watch() and _add_watch_full() now take a MessageType mask to
only handle specific types of messages.
_poll() returns the GstMessage instead of the message type to avoid
race conditions.
_have_pending() takes a MessageType mask now too.
Added testsuite for multiple bus watches.
Fix testsuites and applications for new bus API.
2005-09-19 11:18:03 +00:00
|
|
|
* GstBusFunc:
|
2005-08-25 23:17:18 +00:00
|
|
|
* @bus: the #GstBus that sent the message
|
2005-09-11 12:57:36 +00:00
|
|
|
* @message: the #GstMessage
|
2005-08-25 23:17:18 +00:00
|
|
|
* @data: user data that has been given, when registering the handler
|
|
|
|
*
|
2006-01-20 19:01:59 +00:00
|
|
|
* Specifies the type of function passed to gst_bus_add_watch() or
|
|
|
|
* gst_bus_add_watch_full(), which is called from the mainloop when a message
|
GstBusHandler -> GstBusFunc, return value has the same meaning as any other GSource (FALSE == remove source).
Original commit message from CVS:
* check/gst/gstbin.c: (pop_messages), (GST_START_TEST):
* check/gst/gstbus.c: (message_func_eos), (message_func_app),
(send_messages), (GST_START_TEST), (gstbus_suite):
* check/gst/gstpipeline.c: (GST_START_TEST):
* check/pipelines/cleanup.c: (run_pipeline):
* check/pipelines/simple_launch_lines.c: (run_pipeline),
(GST_START_TEST):
* gst/gstbus.c: (gst_bus_have_pending), (gst_bus_source_prepare),
(gst_bus_source_check), (gst_bus_source_dispatch),
(gst_bus_create_watch), (gst_bus_add_watch_full),
(gst_bus_add_watch), (poll_func), (poll_timeout), (gst_bus_poll):
* gst/gstbus.h:
* tools/gst-launch.c: (event_loop):
* tools/gst-md5sum.c: (event_loop):
GstBusHandler -> GstBusFunc, return value has the same meaning as
any other GSource (FALSE == remove source).
_add_watch() and _add_watch_full() now take a MessageType mask to
only handle specific types of messages.
_poll() returns the GstMessage instead of the message type to avoid
race conditions.
_have_pending() takes a MessageType mask now too.
Added testsuite for multiple bus watches.
Fix testsuites and applications for new bus API.
2005-09-19 11:18:03 +00:00
|
|
|
* is available on the bus.
|
|
|
|
*
|
|
|
|
* The message passed to the function will be unreffed after execution of this
|
2005-10-15 15:30:24 +00:00
|
|
|
* function so it should not be freed in the function.
|
2005-08-25 23:17:18 +00:00
|
|
|
*
|
Documentation updates.
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstbin.c: (bin_bus_handler), (gst_bin_handle_message_func):
* gst/gstbin.h:
* gst/gstbus.c: (gst_bus_class_init):
* gst/gstbus.h:
* gst/gstclock.c:
* gst/gstelement.c: (gst_element_set_locked_state):
* gst/gstsegment.c:
Documentation updates.
* gst/gstpipeline.c: (gst_pipeline_get_type),
(gst_pipeline_class_init), (gst_pipeline_init),
(gst_pipeline_dispose), (gst_pipeline_set_property),
(gst_pipeline_get_property), (do_pipeline_seek),
(gst_pipeline_send_event), (gst_pipeline_change_state),
(gst_pipeline_provide_clock_func), (gst_pipeline_set_delay),
(gst_pipeline_get_delay):
* gst/gstpipeline.h:
Added methods for setting the delay.
API: gst_pipeline_set_delay
API: gst_pipeline_get_delay
Add pipeline debug category
Various cleanups.
Updated docs.
Don't reset stream time when seek failed.
2006-03-13 11:04:38 +00:00
|
|
|
* Note that this function is used as a GSourceFunc which means that returning
|
|
|
|
* FALSE will remove the GSource from the mainloop.
|
|
|
|
*
|
2005-10-15 15:30:24 +00:00
|
|
|
* Returns: %FALSE if the event source should be removed.
|
2005-08-25 23:17:18 +00:00
|
|
|
*/
|
GstBusHandler -> GstBusFunc, return value has the same meaning as any other GSource (FALSE == remove source).
Original commit message from CVS:
* check/gst/gstbin.c: (pop_messages), (GST_START_TEST):
* check/gst/gstbus.c: (message_func_eos), (message_func_app),
(send_messages), (GST_START_TEST), (gstbus_suite):
* check/gst/gstpipeline.c: (GST_START_TEST):
* check/pipelines/cleanup.c: (run_pipeline):
* check/pipelines/simple_launch_lines.c: (run_pipeline),
(GST_START_TEST):
* gst/gstbus.c: (gst_bus_have_pending), (gst_bus_source_prepare),
(gst_bus_source_check), (gst_bus_source_dispatch),
(gst_bus_create_watch), (gst_bus_add_watch_full),
(gst_bus_add_watch), (poll_func), (poll_timeout), (gst_bus_poll):
* gst/gstbus.h:
* tools/gst-launch.c: (event_loop):
* tools/gst-md5sum.c: (event_loop):
GstBusHandler -> GstBusFunc, return value has the same meaning as
any other GSource (FALSE == remove source).
_add_watch() and _add_watch_full() now take a MessageType mask to
only handle specific types of messages.
_poll() returns the GstMessage instead of the message type to avoid
race conditions.
_have_pending() takes a MessageType mask now too.
Added testsuite for multiple bus watches.
Fix testsuites and applications for new bus API.
2005-09-19 11:18:03 +00:00
|
|
|
typedef gboolean (*GstBusFunc) (GstBus * bus, GstMessage * message, gpointer data);
|
2005-03-21 17:34:02 +00:00
|
|
|
|
2005-11-24 09:44:07 +00:00
|
|
|
/**
|
|
|
|
* GstBus:
|
|
|
|
*
|
|
|
|
* The opaque #GstBus data structure.
|
|
|
|
*/
|
2005-03-21 17:34:02 +00:00
|
|
|
struct _GstBus
|
|
|
|
{
|
|
|
|
GstObject object;
|
|
|
|
|
|
|
|
/*< private > */
|
|
|
|
GQueue *queue;
|
|
|
|
GMutex *queue_lock;
|
|
|
|
|
|
|
|
GstBusSyncHandler sync_handler;
|
|
|
|
gpointer sync_handler_data;
|
|
|
|
|
2005-09-29 16:04:31 +00:00
|
|
|
guint signal_watch_id;
|
|
|
|
guint num_signal_watchers;
|
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
/*< private > */
|
2006-02-10 16:04:59 +00:00
|
|
|
GstBusPrivate *priv;
|
|
|
|
gpointer _gst_reserved[GST_PADDING - 1];
|
2005-03-21 17:34:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstBusClass
|
|
|
|
{
|
|
|
|
GstObjectClass parent_class;
|
|
|
|
|
2005-09-28 16:43:20 +00:00
|
|
|
/* signals */
|
check/gst/gstbin.c: Change for new bus API.
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
Change for new bus API.
* check/gst/gstbus.c: (message_func_eos), (message_func_app),
(send_messages), (GST_START_TEST), (gstbus_suite):
Change for new bus signal API.
* gst/gstbus.c: (gst_bus_class_init), (gst_bus_have_pending),
(gst_bus_source_prepare), (gst_bus_source_check),
(gst_bus_create_watch), (gst_bus_add_watch_full),
(gst_bus_add_watch), (gst_bus_poll), (gst_bus_async_signal_func),
(gst_bus_sync_signal_handler), (gst_bus_add_signal_watch):
* gst/gstbus.h:
Remove support for multiple GSources operating on different
message types as it is too complex and unneeded when using
signals.
Added support for receiving signals from the bus.
2005-09-29 13:07:37 +00:00
|
|
|
void (*message) (GstBus *bus, GstMessage *message);
|
|
|
|
void (*sync_message) (GstBus *bus, GstMessage *message);
|
2005-09-28 16:43:20 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
/*< private > */
|
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
|
|
|
};
|
|
|
|
|
|
|
|
GType gst_bus_get_type (void);
|
|
|
|
|
|
|
|
GstBus* gst_bus_new (void);
|
|
|
|
|
|
|
|
gboolean gst_bus_post (GstBus * bus, GstMessage * message);
|
|
|
|
|
check/gst/gstbin.c: Change for new bus API.
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
Change for new bus API.
* check/gst/gstbus.c: (message_func_eos), (message_func_app),
(send_messages), (GST_START_TEST), (gstbus_suite):
Change for new bus signal API.
* gst/gstbus.c: (gst_bus_class_init), (gst_bus_have_pending),
(gst_bus_source_prepare), (gst_bus_source_check),
(gst_bus_create_watch), (gst_bus_add_watch_full),
(gst_bus_add_watch), (gst_bus_poll), (gst_bus_async_signal_func),
(gst_bus_sync_signal_handler), (gst_bus_add_signal_watch):
* gst/gstbus.h:
Remove support for multiple GSources operating on different
message types as it is too complex and unneeded when using
signals.
Added support for receiving signals from the bus.
2005-09-29 13:07:37 +00:00
|
|
|
gboolean gst_bus_have_pending (GstBus * bus);
|
2005-03-21 17:34:02 +00:00
|
|
|
GstMessage * gst_bus_peek (GstBus * bus);
|
|
|
|
GstMessage * gst_bus_pop (GstBus * bus);
|
2007-10-16 20:30:13 +00:00
|
|
|
GstMessage * gst_bus_pop_filtered (GstBus * bus, GstMessageType types);
|
2007-02-27 17:22:07 +00:00
|
|
|
GstMessage * gst_bus_timed_pop (GstBus * bus, GstClockTime timeout);
|
2007-10-16 20:30:13 +00:00
|
|
|
GstMessage * gst_bus_timed_pop_filtered (GstBus * bus, GstClockTime timeout, GstMessageType types);
|
2005-05-11 03:37:10 +00:00
|
|
|
void gst_bus_set_flushing (GstBus * bus, gboolean flushing);
|
2005-03-21 17:34:02 +00:00
|
|
|
|
2005-09-28 16:43:20 +00:00
|
|
|
/* synchronous dispatching */
|
2005-03-21 17:34:02 +00:00
|
|
|
void gst_bus_set_sync_handler (GstBus * bus, GstBusSyncHandler func,
|
|
|
|
gpointer data);
|
2005-09-28 16:43:20 +00:00
|
|
|
/* GSource based dispatching */
|
check/gst/gstbin.c: Change for new bus API.
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
Change for new bus API.
* check/gst/gstbus.c: (message_func_eos), (message_func_app),
(send_messages), (GST_START_TEST), (gstbus_suite):
Change for new bus signal API.
* gst/gstbus.c: (gst_bus_class_init), (gst_bus_have_pending),
(gst_bus_source_prepare), (gst_bus_source_check),
(gst_bus_create_watch), (gst_bus_add_watch_full),
(gst_bus_add_watch), (gst_bus_poll), (gst_bus_async_signal_func),
(gst_bus_sync_signal_handler), (gst_bus_add_signal_watch):
* gst/gstbus.h:
Remove support for multiple GSources operating on different
message types as it is too complex and unneeded when using
signals.
Added support for receiving signals from the bus.
2005-09-29 13:07:37 +00:00
|
|
|
GSource * gst_bus_create_watch (GstBus * bus);
|
2005-03-21 17:34:02 +00:00
|
|
|
guint gst_bus_add_watch_full (GstBus * bus,
|
|
|
|
gint priority,
|
2005-10-15 15:30:24 +00:00
|
|
|
GstBusFunc func,
|
|
|
|
gpointer user_data,
|
2005-03-21 17:34:02 +00:00
|
|
|
GDestroyNotify notify);
|
|
|
|
guint gst_bus_add_watch (GstBus * bus,
|
2005-10-15 15:30:24 +00:00
|
|
|
GstBusFunc func,
|
2005-03-21 17:34:02 +00:00
|
|
|
gpointer user_data);
|
GstBusHandler -> GstBusFunc, return value has the same meaning as any other GSource (FALSE == remove source).
Original commit message from CVS:
* check/gst/gstbin.c: (pop_messages), (GST_START_TEST):
* check/gst/gstbus.c: (message_func_eos), (message_func_app),
(send_messages), (GST_START_TEST), (gstbus_suite):
* check/gst/gstpipeline.c: (GST_START_TEST):
* check/pipelines/cleanup.c: (run_pipeline):
* check/pipelines/simple_launch_lines.c: (run_pipeline),
(GST_START_TEST):
* gst/gstbus.c: (gst_bus_have_pending), (gst_bus_source_prepare),
(gst_bus_source_check), (gst_bus_source_dispatch),
(gst_bus_create_watch), (gst_bus_add_watch_full),
(gst_bus_add_watch), (poll_func), (poll_timeout), (gst_bus_poll):
* gst/gstbus.h:
* tools/gst-launch.c: (event_loop):
* tools/gst-md5sum.c: (event_loop):
GstBusHandler -> GstBusFunc, return value has the same meaning as
any other GSource (FALSE == remove source).
_add_watch() and _add_watch_full() now take a MessageType mask to
only handle specific types of messages.
_poll() returns the GstMessage instead of the message type to avoid
race conditions.
_have_pending() takes a MessageType mask now too.
Added testsuite for multiple bus watches.
Fix testsuites and applications for new bus API.
2005-09-19 11:18:03 +00:00
|
|
|
|
2005-09-28 16:43:20 +00:00
|
|
|
/* polling the bus */
|
GstBusHandler -> GstBusFunc, return value has the same meaning as any other GSource (FALSE == remove source).
Original commit message from CVS:
* check/gst/gstbin.c: (pop_messages), (GST_START_TEST):
* check/gst/gstbus.c: (message_func_eos), (message_func_app),
(send_messages), (GST_START_TEST), (gstbus_suite):
* check/gst/gstpipeline.c: (GST_START_TEST):
* check/pipelines/cleanup.c: (run_pipeline):
* check/pipelines/simple_launch_lines.c: (run_pipeline),
(GST_START_TEST):
* gst/gstbus.c: (gst_bus_have_pending), (gst_bus_source_prepare),
(gst_bus_source_check), (gst_bus_source_dispatch),
(gst_bus_create_watch), (gst_bus_add_watch_full),
(gst_bus_add_watch), (poll_func), (poll_timeout), (gst_bus_poll):
* gst/gstbus.h:
* tools/gst-launch.c: (event_loop):
* tools/gst-md5sum.c: (event_loop):
GstBusHandler -> GstBusFunc, return value has the same meaning as
any other GSource (FALSE == remove source).
_add_watch() and _add_watch_full() now take a MessageType mask to
only handle specific types of messages.
_poll() returns the GstMessage instead of the message type to avoid
race conditions.
_have_pending() takes a MessageType mask now too.
Added testsuite for multiple bus watches.
Fix testsuites and applications for new bus API.
2005-09-19 11:18:03 +00:00
|
|
|
GstMessage* gst_bus_poll (GstBus *bus, GstMessageType events,
|
2005-03-21 17:34:02 +00:00
|
|
|
GstClockTimeDiff timeout);
|
|
|
|
|
2005-09-28 16:43:20 +00:00
|
|
|
/* signal based dispatching helper functions. */
|
|
|
|
gboolean gst_bus_async_signal_func (GstBus *bus, GstMessage *message,
|
|
|
|
gpointer data);
|
|
|
|
GstBusSyncReply gst_bus_sync_signal_handler (GstBus *bus, GstMessage *message,
|
|
|
|
gpointer data);
|
2005-09-29 16:04:31 +00:00
|
|
|
|
|
|
|
/* convenience api to add/remove a gsource that emits the async signals */
|
|
|
|
void gst_bus_add_signal_watch (GstBus * bus);
|
2005-11-22 11:25:01 +00:00
|
|
|
void gst_bus_add_signal_watch_full (GstBus * bus, gint priority);
|
2005-09-29 16:04:31 +00:00
|
|
|
void gst_bus_remove_signal_watch (GstBus * bus);
|
2005-09-28 16:43:20 +00:00
|
|
|
|
2006-02-10 16:04:59 +00:00
|
|
|
void gst_bus_enable_sync_message_emission (GstBus * bus);
|
|
|
|
void gst_bus_disable_sync_message_emission (GstBus * bus);
|
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
G_END_DECLS
|
2005-05-26 10:48:53 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
#endif /* __GST_BUS_H__ */
|