Commit graph

315 commits

Author SHA1 Message Date
Wim Taymans cf925ebb6f gst/base/gstbasesink.*: No need to store the clock, the parent element class already has it.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_class_init),
(gst_base_sink_wait), (gst_base_sink_do_sync),
(gst_base_sink_handle_event):
* gst/base/gstbasesink.h:
No need to store the clock, the parent element class already
has it.

* gst/gstbin.c: (gst_bin_set_clock_func), (gst_bin_add_func):
Updates for clock_set returning a gboolean

* gst/gstclock.c: (gst_clock_entry_new), (gst_clock_id_wait),
(gst_clock_id_wait_async), (gst_clock_class_init),
(gst_clock_init), (gst_clock_finalize),
(gst_clock_get_internal_time), (gst_clock_get_time),
(gst_clock_slave_callback), (gst_clock_set_master),
(gst_clock_get_master), (do_linear_regression),
(gst_clock_add_observation), (gst_clock_set_property),
(gst_clock_get_property):
* gst/gstclock.h:
Implement master/slave. When setting a clock as a slave, a
periodic timeout is scheduled to sample master and slave times.
Then the slave clock is recalibrated to match offset and rate
of the master clock.
Update logging a bit.
Add flag so that a clock can state that is cannot be slaved to
another clock.

* gst/gstelement.c: (gst_element_set_clock):
* gst/gstelement.h:
The set_clock returns a gboolean for when an element cannot
deal with the selected clock in the pipeline.

* gst/gstpipeline.c: (gst_pipeline_change_state),
(gst_pipeline_set_clock):
* gst/gstpipeline.h:
Handle the case where the selected clock cannot be set on
the pipeline.

* gst/net/gstnetclientclock.c: (gst_net_client_clock_class_init),
(gst_net_client_clock_init), (gst_net_client_clock_finalize),
(gst_net_client_clock_set_property),
(gst_net_client_clock_get_property),
(gst_net_client_clock_observe_times):
* gst/net/gstnetclientclock.h:
Use regression code in GstClock parent, remove duplicated
functionality.
2005-11-22 18:28:44 +00:00
Wim Taymans 5252cefbed gst/gstbin.c: Fix for #321595
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_change_state_func):
Fix for #321595
2005-11-21 19:13:13 +00:00
Andy Wingo 44c548b205 *.*: Ran scripts/update-macros. Oh yes. gst/gstobject.h (GST_OBJECT_GET_LOCK, GST_OBJECT_LOCK)
Original commit message from CVS:
2005-11-21  Andy Wingo  <wingo@pobox.com>

* *.h:
* *.c: Ran scripts/update-macros. Oh yes.

* gst/gstobject.h (GST_OBJECT_GET_LOCK, GST_OBJECT_LOCK)
(GST_OBJECT_TRYLOCK, GST_OBJECT_UNLOCK): Renamed from
GST_GET_LOCK, etc.

* scripts/update-macros: New script. Run it on your files to
change GST_LOCK to GST_OBJECT_LOCK, and the same for UNLOCK as
well.
2005-11-21 16:34:26 +00:00
Andy Wingo eb8cc5ab32 gst/gstbin.c (gst_bin_remove_func): Wim claims I can remove this state_broadcast call.
Original commit message from CVS:
2005-11-21  Andy Wingo  <wingo@pobox.com>

* gst/gstbin.c (gst_bin_remove_func): Wim claims I can remove this
state_broadcast call.
2005-11-21 15:01:48 +00:00
Wim Taymans 5209b1b0a2 Make message handling overridable.
Original commit message from CVS:
* docs/design/part-TODO.txt:
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_provide_clock_func),
(gst_bin_add_func), (gst_bin_remove_func), (bin_bus_handler),
(gst_bin_handle_message_func):
* gst/gstbin.h:
Make message handling overridable.
2005-11-19 18:28:40 +00:00
Andy Wingo 5748aa1156 gst/gstutils.h: gst/gstutils.c (g_static_rec_cond_wait)
Original commit message from CVS:
2005-11-19  Andy Wingo  <wingo@pobox.com>

* gst/gstutils.h:
* gst/gstutils.c (g_static_rec_cond_wait)
(g_static_rec_cond_timed_wait): Removed, no longer needed.

* gst/gstbin.c: Remove terrible continue_state prototype.

* gst/gstelement.h (gst_element_continue_state): Make public.

* gst/gstelement.h:
* gst/gstelement.c (gst_element_commit_state): Removed, replaced
by continue_state. Fixes #319389.
2005-11-19 17:50:52 +00:00
Wim Taymans 02253f5807 gst/gstbin.*: Removing a clock provider from a bin, triggers a clock lost message so that a new clock will be selected.
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_provide_clock_func), (gst_bin_add_func),
(gst_bin_remove_func), (bin_bus_handler):
* gst/gstbin.h:
Removing a clock provider from a bin, triggers a clock lost message
so that a new clock will be selected.
Adding a clock to a bin triggers a clock provider message.
Make sure we reselect a clock when we received a clock lost message.
Keep a reference to the element that provided the clock.
2005-11-18 11:03:10 +00:00
Wim Taymans 40e4311d94 gst/gstbin.c: And unref the child too..
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_provide_clock_func),
(gst_bin_sort_iterator_new):
And unref the child too..
2005-11-17 16:02:48 +00:00
Wim Taymans a1aa83c759 gst/gstbin.c: Refactor the sort iterator so it can be used while holding the
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_dispose), (gst_bin_provide_clock_func),
(gst_bin_sort_iterator_new), (gst_bin_iterate_sorted):
Refactor the sort iterator so it can be used while holding the
LOCK too.
Make clock selection select a clock closest to the source.
2005-11-17 14:51:11 +00:00
Wim Taymans 43fe0b06e9 check/states/sinks.c: Added some more checks. Specifically the case where NO_PREROLL elements are in the pipeline.
Original commit message from CVS:
* check/states/sinks.c: (GST_START_TEST), (gst_object_suite):
Added some more checks. Specifically the case where NO_PREROLL
elements are in the pipeline.

* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_handle_object), (gst_base_sink_do_sync),
(gst_base_sink_get_position):
Post READY->PAUSED state change messages too.
Fix bug where VOID was posted as pending state...

* gst/gstbin.c: (gst_bin_recalc_state):
use _element_continue_state() to continue the state change.

* gst/gstelement.c: (gst_element_continue_state),
(gst_element_commit_state), (gst_element_set_state_func),
(gst_element_change_state), (gst_element_change_state_func):
Lots of state change cleanups, assign the STATE_RETURN in
a new continue_state() function that also propagates the
last return value from a state change to the app.
Update some debug statements with proper category.
2005-11-03 17:12:00 +00:00
Wim Taymans 563477a64e gst/gstbin.c: Fix typo in docs.
Original commit message from CVS:
* gst/gstbin.c:
Fix typo in docs.

* gst/gstelement.c: (gst_element_commit_state):
Remove unused value.

* gst/gstiterator.c:
Mention that the returned element is reffed in the docs.
2005-11-02 18:44:20 +00:00
Thomas Vander Stichele d581d5c976 doc updates
Original commit message from CVS:

* docs/README:
* docs/gst/gstreamer-sections.txt:
* gst/gstbin.c:
doc updates
* gst/gstregistry.c: (gst_registry_scan_path_level):
fix for a nasty little missed situation where an installed plug-in
which was in the cache did not get overridden by an uninstalled one
which was earlier in the plugin path because the newly created plugin
for the uninstalled one (not in the registry) didn't get its
->registered set to TRUE
2005-11-02 15:34:23 +00:00
Thomas Vander Stichele 4652cba829 more doc updates
Original commit message from CVS:
more doc updates
2005-11-01 19:16:58 +00:00
Thomas Vander Stichele 4a8451a360 Documentation updates.
Original commit message from CVS:
Documentation updates.
2005-10-28 17:35:43 +00:00
Wim Taymans 7f22710f65 gst/base/gstbasesink.c: Some more debug.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_position):
Some more debug.

* gst/gstbin.c: (message_check), (bin_replace_message),
(bin_remove_messages), (is_eos), (gst_bin_add_func),
(update_degree), (gst_bin_sort_iterator_next), (bin_bus_handler),
(bin_query_duration_init), (bin_query_duration_fold),
(bin_query_duration_done), (bin_query_generic_fold),
(gst_bin_query):
* tools/gst-launch.c: (main):
Remove old option.
2005-10-27 08:55:44 +00:00
Wim Taymans ef17d9b6bb gst/gstbin.c: Some doc and debug updates.
Original commit message from CVS:
* gst/gstbin.c: (message_check), (bin_replace_message),
(bin_remove_messages), (is_eos), (gst_bin_add_func),
(update_degree), (gst_bin_sort_iterator_next), (bin_bus_handler),
(bin_query_duration_init), (bin_query_duration_fold),
(bin_query_duration_done), (bin_query_generic_fold),
(gst_bin_query):
Some doc and debug updates.
Cache previously requested query DURATION for speed. invalidate
cached duration if element posts a DURATION message.
2005-10-25 17:41:24 +00:00
Wim Taymans 2803a5587e docs/design/part-TODO.txt: Update TODO.
Original commit message from CVS:
* docs/design/part-TODO.txt:
Update TODO.

* gst/gstbin.c: (message_check), (bin_replace_message),
(bin_remove_messages), (is_eos), (gst_bin_add_func),
(update_degree), (gst_bin_sort_iterator_next), (bin_bus_handler),
(bin_query_duration_init), (bin_query_duration_fold),
(bin_query_duration_done), (bin_query_generic_fold),
(gst_bin_query):
Handle SEGMENT_START/DONE messages correctly.
More evolved query algorithm that handles duration queries
correctly.

* gst/gstelement.c: (gst_element_send_event), (gst_element_query),
(gst_element_get_state_func), (gst_element_abort_state),
(gst_element_commit_state), (gst_element_lost_state):
Some more debugging.

* gst/gstmessage.h:
Added doc.
2005-10-25 15:39:36 +00:00
Wim Taymans 40f11256e8 gst/gstbin.c: Reworked the message handling a bit, cache the messages instead of only the senders. alows us to do mor...
Original commit message from CVS:
* gst/gstbin.c: (message_check), (bin_replace_message),
(bin_remove_messages), (is_eos), (gst_bin_add_func),
(update_degree), (gst_bin_sort_iterator_next),
(gst_bin_change_state_func), (gst_bin_dispose), (bin_bus_handler):
Reworked the message handling a bit, cache the messages instead of
only the senders. alows us to do more in the future.
2005-10-20 17:22:40 +00:00
Wim Taymans 4dbc7a5bf8 gst/base/gstbasesink.c: Speed up current position calculation.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_get_position),
(gst_base_sink_query):
Speed up current position calculation.

* gst/base/gstbasesrc.c: (gst_base_src_query),
(gst_base_src_default_newsegment):
Correctly set stream position in newsegment.

* gst/gstbin.c: (gst_bin_add_func), (add_to_queue),
(update_degree), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free):
* gst/gstmessage.c: (gst_message_new_custom):
Clean up debugging info

* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query):
Pause task faster.
2005-10-20 11:48:53 +00:00
Wim Taymans 1cef8c5b5a check/: Small state change torture test.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/stress.c: (GST_START_TEST),
(simple_launch_lines_suite), (main):
Small state change torture test.

* docs/design/part-states.txt:
* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_handle_object), (gst_base_sink_event), (do_playing),
(gst_base_sink_change_state):
Never take state lock from streaming thread, clean up ugly
hacks. Unfortunatly core does not yet support nice ways to
async commit state.

* gst/gstbin.c: (gst_bin_remove_func), (gst_bin_recalc_state),
(bin_bus_handler):
Start state recalc if a STATE_DIRTY message is posted, but only
on the toplevel bin.

* gst/gstelement.c: (gst_element_sync_state_with_parent),
(gst_element_get_state_func), (gst_element_abort_state),
(gst_element_commit_state), (gst_element_lost_state),
(gst_element_set_state_func), (gst_element_change_state):
* gst/gstelement.h:
State variables are now protected with the LOCK, the state
lock is only used to serialize _set_state().
2005-10-18 17:06:29 +00:00
Wim Taymans 0176d5a0cf Seriously, this is better than a previous commit as we only need to notify the fact that an element changed state in ...
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
* check/gst/gstmessage.c: (GST_START_TEST):
* check/gst/gstpipeline.c: (GST_START_TEST), (message_received):
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_recalc_func),
(bin_bus_handler):
* gst/gstelement.c: (gst_element_abort_state),
(gst_element_commit_state), (gst_element_lost_state):
* gst/gstmessage.c: (gst_message_new_state_changed),
(gst_message_new_state_dirty), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_duration),
(gst_message_parse_state_changed),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done), (gst_message_parse_duration):
* gst/gstmessage.h:
* tools/gst-launch.c: (event_loop):
Seriously, this is better than a previous commit as we only need
to notify the fact that an element changed state in a streaming
thread, marking the state of the parents dirty, hence the
STATE_DIRTY message instead of abusing a boolean in a STATE_CHANGE
message.
2005-10-18 16:25:38 +00:00
Wim Taymans 2c61a2f4d5 gst/: Cleanups, prepare for state change fixes.
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_get_state_func),
(gst_bin_recalc_func):
* gst/gstelement.c: (gst_element_set_clock),
(gst_element_abort_state), (gst_element_lost_state):
Cleanups, prepare for state change fixes.
2005-10-18 15:15:11 +00:00
Wim Taymans 20aff65b34 Make messages future proof. state-change gets a flag if it was a message comming from the streaming thread.
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
* check/gst/gstmessage.c: (GST_START_TEST):
* check/gst/gstpipeline.c: (GST_START_TEST), (message_received):
* gst/gstbin.c: (bin_bus_handler):
* gst/gstelement.c: (gst_element_commit_state),
(gst_element_lost_state):
* gst/gstmessage.c: (gst_message_new_state_changed),
(gst_message_new_segment_start), (gst_message_new_segment_done),
(gst_message_new_duration), (gst_message_parse_state_changed),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done), (gst_message_parse_duration):
* gst/gstmessage.h:
* tools/gst-launch.c: (event_loop):
Make messages future proof.
state-change gets a flag if it was a message comming from the
streaming thread.
segment-start/stop can also be specified in other formats.
A message to notify an app that a pipeline changed playback
duration.
Also fix a GstMessage leak in -launch
2005-10-18 13:19:16 +00:00
Thomas Vander Stichele 2ca1c89aac gst/gst.*: remove _gst_registry_auto_load, not used anymore
Original commit message from CVS:

* gst/gst.c:
* gst/gst.h:
remove _gst_registry_auto_load, not used anymore
* gst/gstbin.c: (gst_bin_get_type):
* gst/gstbin.h:
* gst/gstelement.c: (gst_element_get_type):
* gst/gstelement.h:
* gst/gstobject.c: (gst_object_get_type):
* gst/gstobject.h:
* gst/gstpad.c: (gst_pad_get_type):
* gst/gstpad.h:
make _get_type functions similar, fixes data export from library
2005-10-15 16:33:09 +00:00
Thomas Vander Stichele bef56ce78d various style fixes
Original commit message from CVS:
various style fixes
2005-10-15 16:01:57 +00:00
Thomas Vander Stichele 2dd1598c56 whitespace fixes
Original commit message from CVS:
whitespace fixes
2005-10-15 15:30:24 +00:00
Wim Taymans f6e003890d gst/: Protect flags with proper lock. unref provided cached clock in dispose.
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_add_func), (gst_bin_remove_func),
(reset_degree), (gst_bin_dispose), (bin_bus_handler):
* gst/gstelement.c: (gst_element_commit_state),
(gst_element_set_state):
Protect flags with proper lock.
unref provided cached clock in dispose.
2005-10-12 19:38:44 +00:00
Stefan Kost a98aef82db 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
Wim Taymans 6d0be74351 Use GstClockTime in _get_state() instead of GTimeVal.
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
* check/gst/gstelement.c: (GST_START_TEST):
* check/gst/gstevent.c: (GST_START_TEST), (test_event):
* check/gst/gstghostpad.c: (GST_START_TEST):
* check/gst/gstpipeline.c: (GST_START_TEST):
* check/pipelines/simple_launch_lines.c: (run_pipeline):
* check/states/sinks.c: (GST_START_TEST):
* gst/elements/gsttypefindelement.c: (stop_typefinding):
* gst/gstbin.c: (gst_bin_provide_clock_func), (gst_bin_add_func),
(gst_bin_remove_func), (gst_bin_get_state_func),
(gst_bin_recalc_state), (gst_bin_change_state_func),
(bin_bus_handler):
* gst/gstelement.c: (gst_element_get_state_func),
(gst_element_get_state), (gst_element_abort_state),
(gst_element_commit_state), (gst_element_set_state),
(gst_element_change_state), (gst_element_change_state_func):
* gst/gstelement.h:
* gst/gstpipeline.c: (gst_pipeline_class_init), (do_pipeline_seek),
(gst_pipeline_provide_clock_func):
* gst/gstutils.c: (gst_element_link_pads_filtered):
* tools/gst-launch.c: (main):
* tools/gst-typefind.c: (main):
Use GstClockTime in _get_state() instead of GTimeVal.
Remove old code in gstutils.c
2005-10-12 12:18:48 +00:00
Wim Taymans cc28efc239 check/: Moved sinks2 testcode in sinks check.
Original commit message from CVS:
* check/Makefile.am:
* check/states/sinks.c: (GST_START_TEST), (gst_object_suite):
* check/states/sinks2.c:
Moved sinks2 testcode in sinks check.

* gst/gstbin.c: (gst_bin_provide_clock_func), (gst_bin_add_func),
(gst_bin_remove_func), (gst_bin_recalc_state),
(gst_bin_change_state_func), (bin_bus_handler):
Fix potential race condition when _get_state() iterated over an
ASYNC element right before it posted a state completion.

* gst/gstclock.h:
Do proper cast here.

* gst/gstevent.c: (gst_event_new_newsegment),
(gst_event_parse_newsegment):
A playback rate of 0.0 is not allowed.
2005-10-12 08:38:06 +00:00
Wim Taymans 4dd6c2a587 gst/gstbin.*: Prepare to make current EOS message queue more generic.
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_init), (gst_bin_provide_clock_func),
(is_eos), (gst_bin_add_func), (gst_bin_remove_func),
(gst_bin_recalc_state), (gst_bin_change_state_func),
(gst_bin_dispose), (bin_bus_handler):
* gst/gstbin.h:
Prepare to make current EOS message queue more generic.
Fix some typos.

* gst/gstevent.c: (gst_event_new_newsegment),
(gst_event_parse_newsegment):
* gst/gstevent.h:
Rename base to stream_time.

* gst/gstmessage.h:
Fix typo in docs.
2005-10-11 15:05:55 +00:00
Wim Taymans fc5dc6de66 gst/gstbin.*: Work on proper clock selection.
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_init), (gst_bin_provide_clock_func),
(gst_bin_add_func), (gst_bin_remove_func), (gst_bin_recalc_state),
(gst_bin_change_state_func), (bin_bus_handler):
* gst/gstbin.h:
Work on proper clock selection.
2005-10-11 12:58:44 +00:00
Wim Taymans fd1a66e8b5 docs/design/part-states.txt: Some more docs.
Original commit message from CVS:
* docs/design/part-states.txt:
Some more docs.

* gst/gstbin.c: (gst_bin_set_clock_func), (gst_bin_recalc_state),
(gst_bin_change_state_func), (bin_bus_handler):
Doc updates. Don't distribute the same clock over and over again.

* gst/gstclock.c:
* gst/gstclock.h:
Doc updates.

* gst/gstpad.c: (gst_flow_get_name), (gst_flow_to_quark),
(gst_pad_get_type), (gst_pad_push), (gst_pad_push_event),
(gst_pad_send_event):
* gst/gstpad.h:
Make probe emission threadsafe again.
Register quarks and move _get_name() from utils.
Doc updates.

* gst/gstpipeline.c: (gst_pipeline_class_init),
(gst_pipeline_change_state), (gst_pipeline_provide_clock_func):
Only redistribute the clock of it changed.

* gst/gstsystemclock.h:
Doc updates.

* gst/gstutils.c:
* gst/gstutils.h:
Moved the _flow_get_name() to GstPad.
2005-10-11 11:08:52 +00:00
Wim Taymans 2153c45964 check/: Check fixes, use API as stated in design docs, remove hacks.
Original commit message from CVS:
* check/Makefile.am:
* check/generic/states.c: (GST_START_TEST):
* check/gst/gstbin.c: (GST_START_TEST):
* check/gst/gstpipeline.c: (GST_START_TEST), (gst_pipeline_suite):
* check/states/sinks.c: (GST_START_TEST):
* check/states/sinks2.c: (GST_START_TEST), (gst_object_suite),
(main):
Check fixes, use API as stated in design docs, remove hacks.

* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_change_state):
Catch stopping our task while we're shutting down.

* gst/gstbin.c: (gst_bin_init), (gst_bin_add_func),
(gst_bin_remove_func), (gst_bin_get_state_func),
(gst_bin_recalc_state), (gst_bin_change_state_func),
(bin_bus_handler):
* gst/gstbin.h:
* gst/gstelement.c: (gst_element_init),
(gst_element_get_state_func), (gst_element_abort_state),
(gst_element_commit_state), (gst_element_lost_state),
(gst_element_set_state), (gst_element_change_state),
(gst_element_change_state_func):
* gst/gstelement.h:
New state change algorithm (see #318116)

* gst/gstpipeline.c: (gst_pipeline_class_init),
(gst_pipeline_init), (gst_pipeline_set_property),
(gst_pipeline_get_property), (do_pipeline_seek),
(gst_pipeline_change_state), (gst_pipeline_provide_clock_func):
* gst/gstpipeline.h:
Remove crude state change hacks.

* gst/gstutils.h:
Remove crude hacks.

* tools/gst-launch.c: (main):
Fixes for state change. Needs some more work to fully use the
new stuff.
2005-10-10 16:38:26 +00:00
Tim-Philipp Müller ee379a13b6 gst/gstbin.c: Pass GType and size arguments to gst_iterator_new() in the right order (maybe we should make _new() tak...
Original commit message from CVS:
Reviewed by: Tim-Philipp Müller  <tim at centricular dot net>
* gst/gstbin.c: (gst_bin_iterate_sorted):
Pass GType and size arguments to gst_iterator_new() in the right
order (maybe we should make _new() take the GType as first argument
just like _new_list()?) (#318447).
2005-10-10 15:27:12 +00:00
Andy Wingo 933bf92949 gst/gstbin.c (gst_bin_get_state_func): Renamed from gst_bin_get_state, cleaned up (but no logic changes).
Original commit message from CVS:
2005-10-10  Andy Wingo  <wingo@pobox.com>

* gst/gstbin.c (gst_bin_get_state_func): Renamed from
gst_bin_get_state, cleaned up (but no logic changes).
(bin_element_is_sink): Comment updates.
(sink_iterator_filter): Remove needless cast.
(gst_bin_iterate_sinks): Doc update.
(gst_bin_change_state_func): Renamed from gst_bin_change_state,
cleaned up (but no logic changes).
2005-10-10 11:52:58 +00:00
Wim Taymans e823f47cdd gst/: Small docs and debug updates.
Original commit message from CVS:
* gst/gstbin.c: (is_eos), (update_degree), (gst_bin_query):
* gst/gstelement.c: (gst_element_post_message):
* gst/gstpipeline.c: (gst_pipeline_change_state):
Small docs and debug updates.
2005-10-08 18:21:20 +00:00
Wim Taymans ae25867a05 gst/gstbin.c: Fix typos, add comments.
Original commit message from CVS:
* gst/gstbin.c: (is_eos), (update_degree), (gst_bin_change_state),
(gst_bin_dispose), (bin_bus_handler):
Fix typos, add comments.
Clear EOS list when going to PAUSED from any direction and do it
in a threadsafe way.
Get base time in a threadsafe way too.
Fix confusing debug in the change_state function.
Various other mall cleanups.

* gst/gstelement.c: (gst_element_post_message):
Fix very verbose bus posting code.

* gst/gstpipeline.c: (gst_pipeline_class_init),
(gst_pipeline_set_property), (gst_pipeline_get_property),
(gst_pipeline_change_state):
Small ARG_ -> PROP_ cleanup
2005-10-08 18:01:04 +00:00
Wim Taymans 3988477b17 gst/gstbin.c: Do a less CPU demanding EOS check because we can.
Original commit message from CVS:
* gst/gstbin.c: (is_eos), (bin_bus_handler):
Do a less CPU demanding EOS check because we can.
2005-10-08 17:30:29 +00:00
Wim Taymans 65006292ce gst/: Make ChildProxy threadsafe and fix mem leaks.
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_lookup), (gst_child_proxy_get_property),
(gst_child_proxy_get_valist), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist):
* gst/parse/grammar.y:
Make ChildProxy threadsafe and fix mem leaks.
2005-10-08 09:24:25 +00:00
Thomas Vander Stichele 80ca485dad gst/: log distributing clocks and base time
Original commit message from CVS:

* gst/gst.c: (init_pre):
* gst/gstbin.c: (gst_bin_add_func):
log distributing clocks and base time
* gst/gstregistry.c: (gst_registry_add_plugin),
(gst_registry_scan_path_level), (gst_registry_scan_path):
clean up the debugging output a little
* gst/gstutils.c: (gst_element_state_get_name):
warn about a memleak (I've actually seen this be used, though
it was probably a bug)
2005-10-08 06:49:09 +00:00
Johan Dahlin 25a0f8c57f Add a GType to GstIterator, update callsites and tests.
Original commit message from CVS:
* check/gst/gstiterator.c: (GST_START_TEST):
* gst/gstbin.c: (gst_bin_iterate_elements),
(gst_bin_iterate_recurse), (gst_bin_iterate_sorted):
* gst/gstelement.c: (gst_element_iterate_pads):
* gst/gstformat.c: (gst_format_iterate_definitions):
* gst/gstiterator.c: (gst_iterator_init), (gst_iterator_new),
(gst_iterator_new_list), (gst_iterator_filter):
* gst/gstiterator.h:
* gst/gstquery.c: (gst_query_type_iterate_definitions):
Add a GType to GstIterator, update callsites and tests.
2005-10-07 00:14:45 +00:00
Wim Taymans 2d3e9f6438 gst/base/gstbasesink.c: Only error is an error.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_change_state):
Only error is an error.

* gst/gstbin.c: (gst_bin_change_state):
Better debugging.

* gst/gstpad.c: (gst_pad_alloc_buffer), (gst_pad_chain):
Also call pad_block in pad alloc.

* gst/gstutils.c: (gst_flow_get_name):
Better debugging.
2005-09-30 08:00:12 +00:00
Thomas Vander Stichele 8c2deca31b use message type names
Original commit message from CVS:
use message type names
2005-09-29 18:25:50 +00:00
Wim Taymans 92836e5172 check/gst/gstbin.c: Add bus to bin.
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
Add bus to bin.

* gst/gstbin.c: (gst_bin_class_init), (gst_bin_init),
(add_to_queue), (clear_queue), (reset_degree), (update_degree),
(find_element), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free),
(gst_bin_iterate_sorted), (gst_bin_element_set_state),
(gst_bin_change_state), (gst_bin_dispose):
A bin does not have a bus, it gets the bus from the parent.

* gst/gstelement.c: (gst_element_requires_clock),
(gst_element_provides_clock), (gst_element_is_indexable),
(gst_element_is_locked_state), (gst_element_change_state),
(gst_element_set_bus_func):
Small cleanups.

* gst/gstpipeline.c: (gst_pipeline_class_init),
(gst_pipeline_init), (gst_pipeline_provide_clock_func):
The pipeline provides a bus.
2005-09-29 09:39:36 +00:00
Wim Taymans de789ca484 gst/gstbin.c: Small doc fixes. get_clock -> provide_clock.
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_provide_clock_func),
(add_to_queue), (clear_queue), (reset_degree), (update_degree),
(find_element), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free),
(gst_bin_iterate_sorted), (gst_bin_element_set_state),
(gst_bin_change_state), (gst_bin_dispose):
Small doc fixes. get_clock -> provide_clock.

* gst/gstelement.c: (gst_element_class_init),
(gst_element_provides_clock), (gst_element_provide_clock),
(gst_element_get_clock), (gst_element_commit_state),
(gst_element_lost_state):
* gst/gstelement.h:
Make get/set_clock() symetric. Add provide_clock vmethod since
that is actually what this function does.

* gst/gstpipeline.c: (gst_pipeline_class_init),
(gst_pipeline_change_state), (gst_pipeline_provide_clock_func),
(gst_pipeline_get_clock):
get_clock -> provide_clock.
2005-09-28 13:41:27 +00:00
Wim Taymans cacb844d6f gst/gstbin.c: Some documentation updates.
Original commit message from CVS:
* gst/gstbin.c: (add_to_queue), (clear_queue), (reset_outdegree),
(update_outdegree), (find_element), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free),
(gst_bin_iterate_sorted), (gst_bin_element_set_state),
(gst_bin_change_state), (gst_bin_dispose):
Some documentation updates.
Clean up dispose handlers.

* gst/gstobject.c: (gst_object_ref), (gst_object_unref):
* gst/gstpad.c: (gst_pad_dispose):
Clean up dispose handler.

* gst/gstpipeline.c: (gst_pipeline_change_state):
Removed spurious UNLOCK.
2005-09-28 11:03:58 +00:00
Thomas Vander Stichele daadaad81b gst/: remove now useless and leaky resurrection code in dispose
Original commit message from CVS:

* gst/gstbin.c: (gst_bin_dispose):
* gst/gstelement.c: (gst_element_dispose):
remove now useless and leaky resurrection code in dispose
* gst/base/gstbasesrc.c: (gst_base_src_init):
* gst/gstelementfactory.c: (gst_element_factory_create):
* gst/gstobject.c: (gst_object_set_parent):
add some debugging
2005-09-27 18:33:48 +00:00
Wim Taymans 1da84c7e67 docs/design/part-TODO.txt: Update TODO.
Original commit message from CVS:
* docs/design/part-TODO.txt:
Update TODO.

* gst/gstbin.c: (add_to_queue), (clear_queue), (reset_outdegree),
(update_outdegree), (find_element), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free),
(gst_bin_iterate_sorted), (gst_bin_element_set_state),
(gst_bin_change_state):
* gst/gstelement.h:
Remove element variable, we keep element info in the iterator now.
2005-09-27 17:00:13 +00:00
Wim Taymans 4d4a60f6c9 check/gst/gstbin.c: Enable check that works now.
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
Enable check that works now.

* gst/gstbin.c: (add_to_queue), (clear_queue), (reset_outdegree),
(update_outdegree), (find_element), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free),
(gst_bin_iterate_sorted), (gst_bin_element_set_state),
(gst_bin_change_state):
* gst/gstbin.h:
Redid the state change algorithm using a topological sort algo.
Handles all cases correctly.
Exposed iterator for state change order.

* gst/gstelement.h:
Temp storage for state changes. Need to get rid of this soon.
2005-09-27 16:16:39 +00:00