Commit graph

238 commits

Author SHA1 Message Date
Wim Taymans d5a2005e0c gst/base/: Implement clock sync in base class.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_do_sync):
* gst/base/gstbasesrc.c: (gst_base_src_wait),
(gst_base_src_do_sync), (gst_base_src_get_range):
Implement clock sync in base class.
2005-11-10 14:45:27 +00:00
Andy Wingo 179f6c4f3b gst/base/gstbasesink.c: Add the beginning of docs here -- have to work on something else now tho...
Original commit message from CVS:
2005-11-09  Andy Wingo  <wingo@pobox.com>

* gst/base/gstbasesink.c: Add the beginning of docs here -- have
to work on something else now tho...
2005-11-09 10:06:30 +00:00
Wim Taymans 5bb924622f gst/: Avoid excessive typechecking in macros.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_preroll_queue_empty),
(gst_base_sink_do_sync), (gst_base_sink_handle_event),
(gst_base_sink_chain), (gst_base_sink_change_state):
* gst/base/gstbasesink.h:
* gst/base/gstbasesrc.h:
* gst/gstelement.h:
* gst/gstevent.h:
Avoid excessive typechecking in macros.

* gst/gstminiobject.c: (gst_mini_object_get_type),
(gst_mini_object_init), (gst_mini_object_new),
(gst_mini_object_free):
* gst/gstobject.c: (gst_object_class_init), (gst_object_init),
(gst_object_finalize):
Remove cruft code, optimize alloc_trace.
2005-11-08 11:13:07 +00:00
Wim Taymans 82a38aff77 check/states/sinks.c: Uncomment fixed check.
Original commit message from CVS:
* check/states/sinks.c: (GST_START_TEST):
Uncomment fixed check.

* docs/design/part-TODO.txt:
Updated TODO.

* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_handle_object), (gst_base_sink_do_sync),
(gst_base_sink_get_position):
If we are going to PLAYING, post the right pending state
when we post the intermediate paused message.

* gst/gstelement.c: (gst_element_continue_state),
(gst_element_set_state_func), (gst_element_change_state):
Don't post state changes that were between the same state
and were not ASYNC.
2005-11-03 20:14:24 +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 f2e8f7198f gst/base/gstbasesink.c: Some more debugging.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_get_position):
Some more debugging.

* gst/base/gstbasetransform.c: (gst_base_transform_finalize),
(gst_base_transform_init), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_getrange),
(gst_base_transform_chain):
* gst/base/gstbasetransform.h:
Fix debugging,
Protect transform and concurrent buffer alloc with a new lock.
Try not to break ABI/API.
2005-10-27 20:59:00 +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 b204604572 gst/base/gstbasesink.c: Don't use invalid stream_time.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_get_position):
Don't use invalid stream_time.

* gst/gstevent.c: (gst_event_new_newsegment):
stream_time in newsegment cannot be undefined.
2005-10-25 10:15:45 +00:00
Thomas Vander Stichele 013e3acc3d remove prematurely added error category and clean up the instances
Original commit message from CVS:
remove prematurely added error category and clean up the instances
2005-10-23 09:08:44 +00:00
Wim Taymans 62cfdde715 gst/base/gstbasesink.c: Simply set the right flag when going to playing, that's all we need to do instead of calling ...
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_get_position), (gst_base_sink_query),
(gst_base_sink_change_state):
Simply set the right flag when going to playing, that's all
we need to do instead of calling a function inside the object
lock (that could take the lock as well and deadlock)
2005-10-21 17:53:31 +00:00
Wim Taymans 17b62f0353 docs/design/part-TODO.txt: Update TODO
Original commit message from CVS:
* docs/design/part-TODO.txt:
Update TODO

* gst/base/gstbasesink.c: (gst_base_sink_get_position),
(gst_base_sink_query):
Don't use clock time to report position when in EOS.
2005-10-20 17:18:12 +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 ce3b4e17f6 gst/base/gstbasesink.c: Fix query handling again.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_handle_object), (gst_base_sink_query), (do_playing):
Fix query handling again.
2005-10-19 17:06:56 +00:00
Wim Taymans 7612a38449 gst/: API change fix.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_handle_object), (gst_base_sink_query), (do_playing):
* gst/base/gstbasesrc.c: (gst_base_src_query):
* gst/elements/gstfilesink.c: (gst_file_sink_query):
* gst/elements/gsttypefindelement.c:
(gst_type_find_handle_src_query), (find_element_get_length),
(gst_type_find_element_activate):
API change fix.

* gst/gstquery.c: (gst_query_new_position),
(gst_query_set_position), (gst_query_parse_position),
(gst_query_new_duration), (gst_query_set_duration),
(gst_query_parse_duration), (gst_query_set_segment),
(gst_query_parse_segment):
* gst/gstquery.h:
Bundling query position/duration is not a good idea since duration
does not change much and we don't want to recalculate it for every
position query, so they are separated again..
Base value in segment query is not needed.

* gst/gstqueue.c: (gst_queue_handle_src_query):
* gst/gstutils.c: (gst_element_query_position),
(gst_element_query_duration), (gst_pad_query_position),
(gst_pad_query_duration):
* gst/gstutils.h:
Updates for query API change.
Added some docs here and there.
2005-10-19 15:50:10 +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
Michael Smith 2992b384a6 Check validity of end time based on end time variable, not start time.
Original commit message from CVS:
Check validity of end time based on end time variable, not start time.
2005-10-17 17:46:37 +00:00
Michael Smith e145f9f8a0 Fix a doc typo.
Original commit message from CVS:
Fix a doc typo.
2005-10-17 10:37:13 +00:00
Thomas Vander Stichele 2dd1598c56 whitespace fixes
Original commit message from CVS:
whitespace fixes
2005-10-15 15:30:24 +00:00
Thomas Vander Stichele d4ea9fbeba gst/base/: fix up debugging
Original commit message from CVS:
2005-10-13  Thomas Vander Stichele  <thomas at apestaart dot org>

* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
* gst/base/gstbasesrc.c: (gst_base_src_get_range):
fix up debugging
* tools/gst-launch.c: (event_loop):
print out clock nicely
2005-10-13 15:22:26 +00:00
Thomas Vander Stichele 04a38508e1 gst/base/: fix more guint64<->gdouble conversions
Original commit message from CVS:

* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
* gst/base/gstbasesrc.c: (gst_base_src_query):
fix more guint64<->gdouble conversions
2005-10-12 21:56:52 +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 427aa60014 gst/: Some more debugging info.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_buffer):
* gst/elements/gstfilesink.c: (gst_file_sink_event),
(gst_file_sink_render):
Some more debugging info.
2005-10-12 14:12:37 +00:00
Wim Taymans 0fd18045b1 gst/base/gstbasesink.c: No need to prerol after receiving EOS.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_change_state):
No need to prerol after receiving EOS.

* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfakesrc.c: (gst_fake_src_event_handler):
* gst/elements/gstidentity.c: (gst_identity_event):
Print events more verbosely.
2005-10-12 09:02:42 +00:00
Wim Taymans 9decf461f5 gst/base/gstbasesink.*: Correctly parse newsegment info.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_query),
(gst_base_sink_change_state):
* gst/base/gstbasesink.h:
Correctly parse newsegment info.
2005-10-11 17:32:00 +00:00
Wim Taymans c97e237a14 Added extra flag to newsegment for future API freeze.
Original commit message from CVS:
* check/gst/gstevent.c: (GST_START_TEST):
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_change_state):
* gst/base/gstbasesrc.c: (gst_base_src_default_newsegment):
* gst/base/gstbasetransform.c: (gst_base_transform_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
* gst/gstevent.c: (gst_event_new_newsegment),
(gst_event_parse_newsegment):
* gst/gstevent.h:
Added extra flag to newsegment for future API freeze.
Updated check and base elements.
2005-10-11 16:28:49 +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
Wim Taymans 06bc343e3f gst/base/gstbasesink.c: Better log message.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_handle_buffer):
Better log message.

* gst/gstbus.h:
* gst/gstelement.h:
More docs.

* gst/gstqueue.c: (gst_queue_class_init), (gst_queue_init),
(gst_queue_set_property), (gst_queue_get_property):
* gst/gstqueue.h:
Remove old unused properties.
2005-10-08 14:57:09 +00:00
Wim Taymans 5d5dbe9bc0 gst/base/gstbasesink.c: Prepare for doing QOS.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_handle_buffer):
Prepare for doing QOS.
2005-10-08 13:39:02 +00:00
Wim Taymans d80f874fc8 gst/base/gstbasesink.*: Repost EOS message while going to PLAYING if still EOS.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_preroll_queue_flush),
(gst_base_sink_handle_object), (gst_base_sink_event),
(gst_base_sink_wait), (gst_base_sink_handle_event),
(gst_base_sink_change_state):
* gst/base/gstbasesink.h:
Repost EOS message while going to PLAYING if still EOS.
Make sure that when receiving a FLUSH_START we don't attempt
to sync on the clock anymore.
2005-10-08 09:58:30 +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
Andy Wingo 2f46ef713d Remove memchunk benchmark stuff, this is taken over by GLib bug 118439.
Original commit message from CVS:
2005-09-26  Andy Wingo  <wingo@pobox.com>

* configure.ac:
* tests/Makefile.am:
* tests/memchunk: Remove memchunk benchmark stuff, this is taken
over by GLib bug 118439.

* gst/base/gstbasesink.c (gst_base_sink_wait): Factor out the wait
routines to a function.

* docs/libs/gstreamer-libs-sections.txt: I am a good person today.

* libs/gst/controller/gsthelper.c:
* libs/gst/controller/gstcontroller.h (gst_controller_sync_values)
(gst_object_sync_values): Renamed from sink_values. Ugh.

* libs/gst/controller/gsthelper.c: Update for __gst_controller_key.

* libs/gst/controller/gstcontroller.c (__gst_controller_key):
Renamed from controller_key, as it is exported.

* gst/gstvalue.c (_gst_value_initialize): Fake out the compiler.
2005-09-26 15:43:30 +00:00
Thomas Vander Stichele 3f519e30e9 various doc updates
Original commit message from CVS:

* docs/README:
* gst/gstpad.c: (gst_pad_class_init), (gst_pad_chain):
* gst/gstpluginfeature.c:
* gst/gstutils.c:
various doc updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
change an assert into an error until it gets fixed properly
2005-09-23 15:36:28 +00:00
Wim Taymans 43c8433a07 gst/base/gstbasesink.c: Prepare for more accurate position reporting and query handling.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_class_init),
(gst_base_sink_send_event), (gst_base_sink_peer_query),
(gst_base_sink_query):
Prepare for more accurate position reporting and query
handling.

* gst/gstelement.c: (gst_element_send_event),
(gst_element_set_state):
Add some comment.
2005-09-22 18:07:22 +00:00
Wim Taymans 46d159afce gst/base/gstbasesink.c: Make sync property settable from subclass.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_class_init),
(gst_base_sink_init):
Make sync property settable from subclass.

* gst/elements/gstfakesink.c: (gst_fake_sink_init),
(gst_fake_sink_change_state):
Set sync to FALSE by default.
2005-09-20 17:38:51 +00:00
Wim Taymans 3a3b15c8a3 gst/base/gstbasesink.*: Added sync property to basesink to disable clock sync.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_class_init),
(gst_base_sink_set_property), (gst_base_sink_get_property),
(gst_base_sink_do_sync):
* gst/base/gstbasesink.h:
Added sync property to basesink to disable clock sync.
2005-09-20 12:05:47 +00:00
Thomas Vander Stichele 574cabacba debug fixes
Original commit message from CVS:
debug fixes
2005-09-11 11:57:08 +00:00
Thomas Vander Stichele ffd3d7b3c7 object debugging is good
Original commit message from CVS:
object debugging is good
2005-09-09 18:05:40 +00:00
Andy Wingo c477a458d7 gst/base/gstbasesink.c (gst_base_sink_activate_pull): Fix a race condition whereby the pad's task function is entered...
Original commit message from CVS:
2005-09-07  Andy Wingo  <wingo@pobox.com>

* gst/base/gstbasesink.c (gst_base_sink_activate_pull): Fix a race
condition whereby the pad's task function is entered before the
pad_mode variable was set.
2005-09-07 10:06:56 +00:00
Tim-Philipp Müller 46616180d1 gst/base/gstbasesink.c: Add comment.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_pad_buffer_alloc):
Add comment.
* gst/elements/gstfakesink.c: (gst_fake_sink_init),
(gst_fake_sink_change_state):
Make state change function thread-safe.
* gst/gstpad.c: (gst_pad_alloc_buffer):
Set offset on generic buffer allocated by fallback.
2005-09-02 23:17:26 +00:00
Andy Wingo e040bb2dbe gst/gstelement.h (GstState): Renamed from GstElementState, changed to be a normal enum instead of flags.
Original commit message from CVS:
2005-09-02  Andy Wingo  <wingo@pobox.com>

* gst/gstelement.h (GstState): Renamed from GstElementState,
changed to be a normal enum instead of flags.
(GstStateChangeReturn): Renamed from GstElementStateReturn, names
munged to be GST_STATE_CHANGE_*.
(GST_STATE_CHANGE): Renamed from GST_STATE_TRANSITION, updated to
work with the new state representation.
(GstStateChange): New enumeration of possible state transitions.
Replaces GST_STATE_FOO_TO_BAR with GST_STATE_CHANGE_FOO_TO_BAR.
(GstElementClass::change_state): Pass the GstStateChange along as
an argument. Helps language bindings, so they don't have to use
tricky lock-needing macros like GST_STATE_CHANGE ().

* scripts/update-states (file): New script. Run it on a file to
update it for state naming and API changes. Updates files in
place.

* All files updated for the new API.
2005-09-02 15:42:00 +00:00
Wim Taymans 8099c34220 gst/base/gstbasesink.*: Handle newsegments more correctly.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_handle_event):
* gst/base/gstbasesink.h:
Handle newsegments more correctly.

* gst/gstbus.c:
Fix docs.

* gst/gstevent.c: (gst_event_new_newsegment):
A newsegment cannot have a start_time of -1
2005-09-01 18:12:18 +00:00
Wim Taymans d7cfd8a12e gst/base/gstadapter.c: Flushing out 0 bytes is ok for this function.
Original commit message from CVS:
* gst/base/gstadapter.c: (gst_adapter_flush):
Flushing out 0 bytes is ok for this function.

* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
no newsegment gives a warning and sets the start/stop to
invalid.

* gst/base/gstbasetransform.c: (gst_base_transform_change_state),
(gst_base_transform_set_passthrough):
Some debug info.

* gst/gstminiobject.c: (gst_mini_object_ref):
Check refcount here too.

* gst/gstpad.c: (gst_pad_init):
Pads are initially flushing and refusing data.

* gst/gstutils.c: (gst_element_link_pads_filtered):
When adding a capsfilter element make sure it has the
same state as the parent bin.
2005-08-30 19:29:59 +00:00
Andy Wingo 9d1b5e07b3 check/pipelines/simple_launch_lines.c (run_pipeline): Check element_set_state's return val.
Original commit message from CVS:
2005-08-26  Andy Wingo  <wingo@pobox.com>

* check/pipelines/simple_launch_lines.c (run_pipeline): Check
element_set_state's return val.
(test_2_elements): Add test that's been disabled for months.

* gst/elements/gstfakesink.c: Cleanups. Add can-activate-push and
can-activate-pull properties.

* gst/elements/gstfakesrc.c: Cleanups. Add can-activate-push and
can-activate-pull properties. Implement is_seekable so fakesrc can
operate in pull mode.

* gst/base/gstbasesink.c (GstBaseSink): Remove has-loop, has-chain
properties.
(gst_base_sink_activate, gst_base_sink_activate_pull)
(gst_base_sink_activate_push): Make activation mode choosing work.
Cleanups.
(gst_base_sink_chain, gst_base_sink_loop): Assert activation mode
is right. Make pull mode work. Post an eos before pausing in pull
mode.
(gst_base_sink_change_state): Pay attention to the core's
change_state() return val.

* gst/base/gstbasesrc.c (GstBaseSrc): Remove has-loop,
has-getrange properties. Cleanups.

* gst/base/gstbasesrc.h (GstBaseSrc): Remove has_loop,
has_getrange and replace with can_activate_pull and
can_activate_push.

* gst/base/gstbasesink.h (GstBaseSink): Rearrange fields, add
locking comments. Remove has_loop, has_chain and replace with
can_activate_pull and can_activate_push.
2005-08-26 14:21:43 +00:00
Thomas Vander Stichele 6c3416a44d gst/base/: fix up some debugging
Original commit message from CVS:

* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_size),
fix up some debugging
(gst_base_transform_get_unit_size),
(gst_base_transform_buffer_alloc), (gst_base_transform_event),
(gst_base_transform_handle_buffer):
* gst/base/gstbasetransform.h:
handle and store timed NEWSEGMENT events so that subclasses that
calculate time by counting samples have a segment_start time they
need to add to their timestamps - see audioresample
2005-08-26 11:56:11 +00:00
Wim Taymans ec8ec3da8a gst/base/gstbasesink.*: Handle newsegment events correctly.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_handle_buffer), (gst_base_sink_change_state):
* gst/base/gstbasesink.h:
Handle newsegment events correctly.
Drop buffers out of the segment range.
2005-08-24 17:57:36 +00:00
Jan Schmidt 05fa076d05 gst/base/gstbasesink.c: Remove extra parameter to debug output
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
Remove extra parameter to debug output

* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_activate_push):
Fix seek event handling.

* gst/gstpipeline.c: (gst_pipeline_change_state):
* gst/gstqueue.c: (gst_queue_handle_sink_event),
(gst_queue_src_activate_push):
Don't start the src pad task on FLUSH_STOP if the pad
isn't linked.
Debug changes.
2005-08-22 18:48:48 +00:00
Thomas Vander Stichele e5afa8a31b check/Makefile.am: clean up environment for when registry gets built versus when actual tests are run; valgrind seems...
Original commit message from CVS:

* check/Makefile.am:
clean up environment for when registry gets built versus
when actual tests are run; valgrind seems to not report
leaks if GST_PLUGIN_PATH is set to some specific values
* check/gst/gstbin.c: (GST_START_TEST):
add more refcounting checks; maybe this exposes a
preroll lock bug ?
* common/check.mak:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
* gst/check/gstcheck.h:
* gst/gstbin.c: (bin_element_is_semi_sink), (gst_bin_get_state),
(gst_bin_change_state):
* gst/gstpad.c: (gst_pad_activate_push), (gst_pad_chain):
add/fix debugging/whitespace
2005-08-21 15:01:18 +00:00
Andy Wingo aa0fb69d49 Make sure that when a pipeline goes to PLAYING, that data has actually hit the sink.
Original commit message from CVS:
2005-08-18  Andy Wingo  <wingo@pobox.com>

Make sure that when a pipeline goes to PLAYING, that data has
actually hit the sink.

* check/states/sinks.c (test_sink): A sink that doesn't get any
data shouldn't return SUCCESS for going to either PLAYING or
PAUSED. Test also the return values on the way back down.

* gst/gstelement.c (gst_element_set_state): When changing the
state of an element currently changing state asynchronously, go to
lost-state after commiting the pending state. Makes future calls
to get_state continue to return ASYNC.

* gst/base/gstbasesink.c (gst_base_sink_change_state): Return
ASYNC when going to PLAYING if we still don't have preroll, as can
happen with live sources.
2005-08-18 16:20:24 +00:00
Jan Schmidt 8377afc0ba check/: I wrote a test!
Original commit message from CVS:
* check/Makefile.am:
* check/gst/gstevents.c: (GST_START_TEST), (event_probe),
(test_event), (timediff), (gstevents_suite), (main):
I wrote a test!

* docs/design/part-seeking.txt:
Spelling correction

* docs/gst/tmpl/gstevent.sgml:
Docs updates.

* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
Treat a buffer-without-newsegment the same as a receiving
a newsegment not in time format, and disable syncing to the clock
with a warning.

* gst/gstbus.c: (gst_bus_set_sync_handler):
Assert if anyone tries to replace the existing sync_handler for bus,
as only the owner should be setting it.

* gst/gstevent.h:
Have a fixed set of custom event enums with events identified by
their structure name (as in 0.8), rather than a free-for-all
allowing collisions between enum values from different plugins.

* gst/gstpad.c: (gst_pad_class_init):
Docs change.

* gst/gstqueue.c: (gst_queue_handle_sink_event):
Handle out-of-band downstream events from the sending thread.
2005-08-18 15:31:28 +00:00
Stefan Kost 722f83a8fc add short/long description docs to base classes add pushsrc to the docs remove consolidated doc fragments
Original commit message from CVS:
add short/long description docs to base classes
add pushsrc to the docs
remove consolidated doc fragments
2005-08-03 13:30:18 +00:00
Wim Taymans 66d7070ef1 Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates

* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.

* gst/gstbuffer.h:
Use faster casts.

* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.

* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.

* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.

* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.

* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.

* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.

* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
Wim Taymans 9f06376bab docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.

* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.

* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.

* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.

* gst/gstbus.c: (gst_bus_post):
Added some comments.

* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
Wim Taymans 030ff93e82 docs/design/part-seeking.txt: Some small additions.
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small additions.

* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesink.h:
discont values are gint64, handle the math correctly.

* gst/base/gstbasesrc.c: (gst_base_src_loop):
Make the basesrc report error if the source pad is not linked.

* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_src_activate_push):
Make queue collect data even if the srcpad is not linked.
Start pushing out data as soon as it is linked.

* gst/gstutils.c: (gst_element_unlink), (gst_flow_get_name):
* gst/gstutils.h:
Added gst_flow_get_name() to ease error reporting.
2005-07-21 17:22:13 +00:00
Wim Taymans 56453e01b9 gst/base/gstbasesink.c: Refcounting fixes.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_pad_getcaps),
(gst_base_sink_pad_setcaps), (gst_base_sink_pad_buffer_alloc),
(gst_base_sink_preroll_queue_flush), (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_chain), (gst_base_sink_loop),
(gst_base_sink_deactivate), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull), (gst_base_sink_change_state):
Refcounting fixes.
Fix logic for returning ASYNC when not prerolled.
2005-07-17 22:26:02 +00:00
Wim Taymans 11bc479656 gst/base/gstbasesink.c: Fix compile error.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync):
Fix compile error.
2005-07-16 14:52:15 +00:00
Wim Taymans d5be929bf8 gst/base/gstbasesink.*: Store and use discont values when syncing buffers as described in design docs.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_get_times),
(gst_base_sink_do_sync), (gst_base_sink_change_state):
* gst/base/gstbasesink.h:
Store and use discont values when syncing buffers as described
in design docs.

* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start),
(gst_base_src_activate_push):
Push discont event when starting.

* gst/elements/gstidentity.c: (gst_identity_transform):
Small cleanups.

* gst/gstbin.c: (gst_bin_change_state):
Small cleanups in base_time  distribution.

* gst/gstelement.c: (gst_element_set_base_time),
(gst_element_get_base_time), (gst_element_change_state):
* gst/gstelement.h:
Added methods for the base_time of the element.
Some MT fixes.

* gst/gstpipeline.c: (gst_pipeline_send_event),
(gst_pipeline_change_state), (gst_pipeline_set_new_stream_time),
(gst_pipeline_get_last_stream_time):
* gst/gstpipeline.h:
MT fixes.
Handle seeking as described in design doc, remove stream_time
hack.
Cleanups clock and stream_time selection code. Added accessors
for the stream_time.
2005-07-16 14:41:25 +00:00
Thomas Vander Stichele 82596fea62 more macro splitting
Original commit message from CVS:
more macro splitting
2005-07-10 12:03:13 +00:00
Jan Schmidt ba5cecf321 examples/: Update a couple of the examples to work again.
Original commit message from CVS:
* examples/Makefile.am:
* examples/helloworld/helloworld.c: (event_loop), (main):
* examples/queue/queue.c: (event_loop), (main):
* examples/queue2/queue2.c: (main):
Update a couple of the examples to work again.

* gst/base/gstbasesink.c: (gst_base_sink_preroll_queue_empty),
(gst_base_sink_preroll_queue_flush), (gst_base_sink_handle_event):
Spelling corrections and extra debug.

* gst/gstbin.c: (gst_bin_class_init), (gst_bin_init), (is_eos),
(gst_bin_add_func), (bin_element_is_sink), (gst_bin_get_state),
(gst_bin_change_state), (gst_bin_dispose), (bin_bus_handler):
* gst/gstbin.h:
* gst/gstpipeline.c: (gst_pipeline_init), (gst_pipeline_dispose),
(gst_pipeline_change_state):
* gst/gstpipeline.h:
Move the bus handler for children to the GstBin, and create a
separate bus for receiving messages from children to the one the
bus sends 'upwards' on.
2005-07-06 16:22:47 +00:00
Wim Taymans 03aa950f7d gst/base/: Make basesrc negotiate.
Original commit message from CVS:
* gst/base/README:
* gst/base/gstbasesink.c: (gst_base_sink_preroll_queue_empty),
(gst_base_sink_handle_object), (gst_base_sink_loop),
(gst_base_sink_change_state):
* gst/base/gstbasesink.h:
* gst/base/gstbasesrc.c: (gst_base_src_class_init),
(gst_base_src_init), (gst_base_src_setcaps),
(gst_base_src_getcaps), (gst_base_src_loop),
(gst_base_src_default_negotiate), (gst_base_src_negotiate),
(gst_base_src_start), (gst_base_src_change_state):
* gst/base/gstbasesrc.h:
Make basesrc negotiate.
Handle the case where preroll fails in basesink.
Update README.
2005-07-06 13:25:26 +00:00
Wim Taymans 6a6a717235 gst/base/gstbasesink.*: Some tweaks, only EOS and a buffer complete a preroll.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_preroll_queue_empty),
(gst_base_sink_preroll_queue_flush), (gst_base_sink_handle_object),
(gst_base_sink_change_state):
* gst/base/gstbasesink.h:
Some tweaks, only EOS and a buffer complete a preroll.
2005-06-30 12:14:47 +00:00
Wim Taymans 06ab4b7831 gst/base/gstbasesink.c: Small debug line.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_change_state):
Small debug line.

* gst/gstclock.h:
map SIGNAL and BROADCAST to the right function.

* gst/gstobject.h:
Remove redundant braces.

* gst/gstpad.c: (gst_pad_set_caps):
Don't call setcaps function when reseting caps to NULL.

* gst/gstsystemclock.c: (gst_system_clock_dispose),
(gst_system_clock_async_thread), (gst_system_clock_id_wait_async),
(gst_system_clock_id_unschedule):
Use BROADCAST as this is what we do.
2005-06-29 11:10:44 +00:00
Wim Taymans a34bc0bd60 gst/base/gstbasesink.c: We are actually prerolling before commiting the state change.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
We are actually prerolling before commiting the state
change.
2005-06-29 10:24:08 +00:00
Thomas Vander Stichele f0e5bb0a33 did s/bases(rc/ink)_/base_s(rc/ink)_/; wim wants to remove base completely, but that's for later
Original commit message from CVS:
did s/bases(rc/ink)_/base_s(rc/ink)_/; wim wants to remove base completely, but that's for later
2005-06-28 12:01:49 +00:00
Wim Taymans de3be844ec gst/: The deprecated pad loop function is removed now.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_set_pad_functions),
(gst_basesink_preroll_queue_flush):
* gst/base/gstbasesrc.c: (gst_basesrc_set_dataflow_funcs):
* gst/elements/gsttee.c: (gst_tee_update_pad_functions):
* gst/gstghostpad.c: (gst_proxy_pad_do_bufferalloc),
(gst_proxy_pad_do_acceptcaps), (gst_proxy_pad_do_fixatecaps),
(gst_proxy_pad_set_property):
* gst/gstpad.c:
* gst/gstpad.h:
* gst/gstqueue.c: (gst_queue_init):
The deprecated pad loop function is removed now.
2005-06-28 11:36:43 +00:00
Wim Taymans 7dc174d140 gst/base/gstbasesink.c: Flushing the preroll queue always needs to unlock the waiters.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_preroll_queue_flush),
(gst_basesink_event), (gst_basesink_deactivate):
Flushing the preroll queue always needs to unlock the waiters.
2005-06-28 11:02:18 +00:00
Andy Wingo f2cf753b17 gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27  Andy Wingo  <wingo@pobox.com>

* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.

* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.

* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.

* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.

* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.

* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.

* gst/gstmessage.c (_gst_message_initialize): No trace init.

* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.

* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.

* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.

* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.

* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.

* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.

* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.

* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
Wim Taymans 97194517fe gst/: Right, two problems here: ghostpads don't take locks and glib _rec_mutex_lock_full() with depth==0 still locks.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_preroll_queue_empty),
(gst_basesink_handle_object), (gst_basesink_event),
(gst_basesink_do_sync), (gst_basesink_handle_event),
(gst_basesink_change_state):
* gst/gsttask.h:
Right, two problems here: ghostpads don't take locks and
glib _rec_mutex_lock_full() with depth==0 still locks.
Catch illegal locking and g_warn them.
2005-06-25 19:37:59 +00:00
Wim Taymans 613dc3d631 gst/: Unlock STREAM_LOCK whatever the recursion was.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_preroll_queue_empty),
(gst_basesink_handle_object), (gst_basesink_event),
(gst_basesink_do_sync), (gst_basesink_handle_event),
(gst_basesink_change_state):
* gst/gstpad.h:
Unlock STREAM_LOCK whatever the recursion was.
2005-06-25 19:09:28 +00:00
Wim Taymans 8303454db7 gst/base/gstbasesink.c: Reworked the base sink, handle event and buffer serialisation correctly and removed possible ...
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_set_property),
(gst_basesink_preroll_queue_empty),
(gst_basesink_preroll_queue_flush), (gst_basesink_handle_object),
(gst_basesink_event), (gst_basesink_do_sync),
(gst_basesink_handle_event), (gst_basesink_handle_buffer),
(gst_basesink_chain), (gst_basesink_loop), (gst_basesink_activate),
(gst_basesink_change_state):
Reworked the base sink, handle event and buffer serialisation
correctly and removed possible deadlock.
Handle EOS correctly.
2005-06-25 17:54:58 +00:00
Andy Wingo 355499790b gst/base/gstbasesink.c (gst_basesink_chain): Remove bogus assert; it's always possible that the pad gets deactivated ...
Original commit message from CVS:
2005-06-17  Andy Wingo  <wingo@pobox.com>

* gst/base/gstbasesink.c (gst_basesink_chain): Remove bogus
assert; it's always possible that the pad gets deactivated in
between the checks in gstpad.c and the implementation. Rely on
finish_preroll() to return a FLUSHING or similar instead of on the
assert.
2005-06-17 11:58:48 +00:00
Andy Wingo d47ea57975 gst/base/gstbasesink.c (gst_basesink_event): Only wait for the clock and post an EOS message if we come out of finish...
Original commit message from CVS:
2005-06-17  Andy Wingo  <wingo@pobox.com>

* gst/base/gstbasesink.c (gst_basesink_event): Only wait for the
clock and post an EOS message if we come out of finish_preroll in
the playing state.
2005-06-17 11:33:27 +00:00
Andy Wingo 4b908e33e0 gst/gstutils.c: RPAD fixes all around.
Original commit message from CVS:
2005-06-08  Andy Wingo  <wingo@pobox.com>

* gst/gstutils.c: RPAD fixes all around.
(gst_element_link_pads): Refcounting fixes.

* tools/gst-inspect.c:
* tools/gst-xmlinspect.c:
* parse/grammar.y:
* gst/base/gsttypefindhelper.c:
* gst/base/gstbasesink.c:
* gst/gstqueue.c: RPAD fixes.

* gst/gstghostpad.h:
* gst/gstghostpad.c: New ghost pad implementation as full proxy
pads. The tricky thing is they provide both source and sink
interfaces, since they proxy the internal pad for the external
pad, and vice versa. Implement with lower-level ProxyPad objects,
with the interior proxy pad as a child of the exterior ghost pad.
Should write a doc on this.

* gst/gstpad.h: s/RPAD/PAD/, s/RealPad/Pad/.
(gst_pad_set_name, gst_pad_set_parent): Macros removed, use
gst_object API.

* gst/gstpad.c: Big changes. No more stub base GstPad, now all
pads are real pads. No ghost pads in this file. Not documenting
the myriad s/RPAD/PAD/ and REALIZE fixes.
(gst_pad_class_init): Add properties for "direction" and
"template". Both are construct-only, so they can't change during
the life of the pad. Fixes properly deriving from GstPad.
(gst_pad_custom_new, gst_pad_custom_new_from_template): Gone. For
derived objects, just set properties when creating the objects via
g_object_new.
(gst_pad_get_parent): Implement as a function, return NULL if the
parent is not an element.
(gst_pad_get_real_parent, gst_pad_add_ghost_pad)
(gst_pad_remove_ghost_pad, gst_pad_realize): Removed.

* gst/gstobject.c (gst_object_class_init): Make name a construct
property. Don't set it in the object init.

* gst/gstelement.c (gst_element_add_pad): Don't allow adding pads
with UNKNOWN direction.
(gst_element_add_ghost_pad): Remove non-orthogonal API. Replace
with gst_element_add_pad (e, gst_ghost_pad_new (name, pad)).
(gst_element_remove_pad): Remove ghost-pad special cases.
(gst_element_pads_activate): Remove rpad cruft.

* gst/gstbin.c (gst_bin_change_state): Use gst_pad_get_parent to
catch the pad's-parent-not-an-element case.

* gst/gst.h: Include gstghostpad.h.

* gst/gst.c (init_post): No more real, ghost pads.

* gst/Makefile.am: Add gstghostpad.[ch].

* check/Makefile.am:
* check/gst/gstbin.c:
* check/gst/gstghostpad.c (test_ghost_pads): Check that linking
into a bin creates ghost pads, and that the refcounts are right.
Partly moved from gstbin.c.
2005-06-08 22:16:27 +00:00
Wim Taymans d3edbe1718 gst/: Bufferalloc: return GstFlowReturn to more accuratly report why allocation failed.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_pad_buffer_alloc),
(gst_base_sink_buffer_alloc), (gst_basesink_preroll_queue_push),
(gst_basesink_activate):
* gst/base/gstbasesink.h:
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_link_prepare),
(gst_pad_link), (gst_pad_accept_caps), (gst_pad_alloc_buffer),
(gst_pad_query), (gst_pad_start_task):
* gst/gstpad.h:
* gst/gstqueue.c: (gst_queue_bufferalloc),
(gst_queue_handle_sink_event), (gst_queue_chain):
Bufferalloc: return GstFlowReturn to more accuratly report
why allocation failed.
2005-06-02 09:42:02 +00:00
Wim Taymans be66bb03b4 gst/base/gstbasesink.c: Handle EOS in preroll.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_preroll_queue_push),
(gst_basesink_activate):
Handle EOS in preroll.
2005-05-30 15:36:09 +00:00
Wim Taymans add280cd10 gst/: Implement gst_pad_pause/start/stop_task(), take STREAM lock in task function.
Original commit message from CVS:
* gst/base/gstadapter.c: (gst_adapter_peek), (gst_adapter_flush):
* gst/base/gstbasesink.c: (gst_basesink_preroll_queue_push),
(gst_basesink_finish_preroll), (gst_basesink_chain),
(gst_basesink_loop), (gst_basesink_activate),
(gst_basesink_change_state):
* gst/base/gstbasesrc.c: (gst_basesrc_do_seek),
(gst_basesrc_get_range), (gst_basesrc_loop),
(gst_basesrc_activate):
* gst/elements/gsttee.c: (gst_tee_sink_activate):
* gst/gstpad.c: (gst_pad_dispose), (gst_real_pad_class_init),
(gst_real_pad_init), (gst_real_pad_set_property),
(gst_real_pad_get_property), (gst_pad_set_active),
(gst_pad_is_active), (gst_pad_get_query_types), (gst_pad_unlink),
(gst_pad_link_prepare), (gst_pad_link), (gst_pad_get_real_parent),
(gst_real_pad_get_caps_unlocked), (gst_pad_peer_get_caps),
(gst_pad_accept_caps), (gst_pad_get_peer), (gst_pad_realize),
(gst_pad_event_default_dispatch), (gst_pad_event_default),
(gst_pad_dispatcher), (gst_pad_query), (gst_real_pad_dispose),
(gst_pad_save_thyself), (handle_pad_block), (gst_pad_chain),
(gst_pad_push), (gst_pad_get_range), (gst_pad_pull_range),
(gst_pad_send_event), (gst_pad_start_task), (gst_pad_pause_task),
(gst_pad_stop_task):
* gst/gstpad.h:
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_src_activate):
* gst/gsttask.c: (gst_task_init), (gst_task_set_lock),
(gst_task_get_state):
* gst/gsttask.h:
* gst/schedulers/threadscheduler.c:
(gst_thread_scheduler_task_start), (gst_thread_scheduler_func):
Implement gst_pad_pause/start/stop_task(), take STREAM lock
in task function.
Remove ACTIVE pad flag, use FLUSHING everywhere
Added _pad_chain(), _pad_get_range() to call chain/getrange
functions.
Add locks around IS_FLUSHING when reading.
Take STREAM lock in chain(), get_range() functions so plugins
don't need to take it anymore.
2005-05-25 11:50:11 +00:00
Wim Taymans 637c74bdb8 gst/base/gstbasesink.c: Don't free preroll queue too early.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_class_init),
(gst_basesink_init), (gst_basesink_finalize),
(gst_basesink_activate), (gst_basesink_change_state):
Don't free preroll queue too early.
2005-05-19 16:23:04 +00:00
Wim Taymans 576b2181d8 gst/: Don't queue buffers in basesink when we are flushing.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_finish_preroll),
(gst_basesink_chain_unlocked), (gst_basesink_activate):
* gst/gstminiobject.c: (gst_mini_object_get_type),
(gst_mini_object_free):
* gst/gstpad.c: (gst_pad_accept_caps), (gst_pad_query),
(gst_pad_push), (gst_pad_push_event):
* gst/gstqueue.c: (gst_queue_change_state):
Don't queue buffers in basesink when we are flushing.
Unref buffer when flushing in basesink.
Flush queue when going to READY
Unref buffer when _push() returns an error.
Don't free MiniObject instance when refcount is incremented
in _finalize() so that we can recover objects.
2005-05-17 17:37:43 +00:00
Wim Taymans 1c4ea6213b gst/: Identify sinks by their flag to avoid overly complicated checks (fow now).
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_init),
(gst_basesink_activate):
* gst/base/gstbasesrc.c: (gst_basesrc_unlock),
(gst_basesrc_is_seekable):
* gst/gstbin.c: (gst_bin_add_func), (gst_bin_remove_func),
(bin_element_is_sink), (gst_bin_change_state):
* gst/gstelement.c: (gst_element_add_pad), (gst_element_query):
* gst/gstelement.h:
Identify sinks by their flag to avoid overly complicated
checks (fow now).
Do state changes even for elements not reachable from the
sinks.
BaseSink is a sink now :)
Some more debugging info in the basesrc.
2005-05-12 19:45:44 +00:00
Wim Taymans 92dd87a8c5 gst/base/gstbasesink.c: Actually do something with error codes returned from the push functions.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_preroll_queue_empty),
(gst_basesink_handle_buffer), (gst_basesink_chain_unlocked),
(gst_basesink_activate):
Actually do something with error codes returned from the push
functions.
2005-05-06 16:19:59 +00:00
Wim Taymans c11c932f88 Some more documentation.
Original commit message from CVS:
* docs/design/part-element-sink.txt:
* docs/design/part-element-source.txt:
* gst/base/gstbasesink.c: (gst_basesink_class_init),
(gst_basesink_event), (gst_basesink_activate):
* gst/base/gstbasesink.h:
* gst/base/gstbasesrc.c: (gst_basesrc_init), (gst_basesrc_unlock),
(gst_basesrc_activate):
* gst/base/gstbasesrc.h:
* gst/gstelement.c: (gst_element_pads_activate):
Some more documentation.
Fixed scheduling decision in _pads_activate().
2005-05-06 08:25:19 +00:00
Andy Wingo 57183c39dc revert cruft
Original commit message from CVS:
revert cruft
2005-05-05 21:42:24 +00:00
Andy Wingo b4d7be2014 GCC 4 fixen.
Original commit message from CVS:
2005-05-04  Andy Wingo <wingo@pobox.com>

* check/Makefile.am:
* docs/gst/tmpl/gstatomic.sgml:
* docs/gst/tmpl/gstplugin.sgml:
* gst/base/gstbasesink.c: (gst_basesink_activate):
* gst/base/gstbasesrc.c: (gst_basesrc_class_init),
(gst_basesrc_init), (gst_basesrc_set_dataflow_funcs),
(gst_basesrc_query), (gst_basesrc_set_property),
(gst_basesrc_get_property), (gst_basesrc_check_get_range),
(gst_basesrc_activate):
* gst/base/gstbasesrc.h:
* gst/base/gstbasetransform.c: (gst_base_transform_sink_activate),
(gst_base_transform_src_activate):
* gst/elements/gstelements.c:
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init),
(gst_fakesrc_set_property), (gst_fakesrc_get_property):
* gst/elements/gsttee.c: (gst_tee_sink_activate):
* gst/elements/gsttypefindelement.c: (find_element_get_length),
(gst_type_find_element_checkgetrange),
(gst_type_find_element_activate):
* gst/gstbin.c: (gst_bin_save_thyself), (gst_bin_restore_thyself):
* gst/gstcaps.c: (gst_caps_do_simplify), (gst_caps_save_thyself),
(gst_caps_load_thyself):
* gst/gstelement.c: (gst_element_pads_activate),
(gst_element_save_thyself), (gst_element_restore_thyself):
* gst/gstpad.c: (gst_pad_load_and_link), (gst_pad_save_thyself),
(gst_ghost_pad_save_thyself), (gst_pad_check_pull_range):
* gst/gstpad.h:
* gst/gstxml.c: (gst_xml_write), (gst_xml_parse_doc),
(gst_xml_parse_file), (gst_xml_parse_memory),
(gst_xml_get_element), (gst_xml_make_element):
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(_file_index_id_save_xml), (gst_file_index_commit):
* gst/registries/gstlibxmlregistry.c: (read_string), (read_uint),
(read_enum), (load_pad_template), (load_feature), (load_plugin),
(load_paths):
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_caps),
(gst_dp_packet_from_event), (gst_dp_caps_from_packet):
* tools/gst-complete.c: (main):
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_element_properties_info):
* tools/gst-launch.c: (xmllaunch_parse_cmdline):
* tools/gst-xmlinspect.c: (print_element_properties):
GCC 4 fixen.
2005-05-04 21:29:44 +00:00
Wim Taymans 71359c38a0 gst/: Better debugging of clocking info.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_base_init),
(gst_basesink_pad_getcaps), (gst_basesink_init),
(gst_basesink_do_sync):
* gst/gstclock.c: (gst_clock_entry_new):
* gst/gstevent.c: (gst_event_discont_get_value):
* gst/gstpipeline.c: (pipeline_bus_handler),
(gst_pipeline_change_state):
* gst/gstsystemclock.c: (gst_system_clock_id_wait_unlocked):
Better debugging of clocking info.
Allow NULL values when getting discont values.
2005-04-28 16:28:28 +00:00
Wim Taymans ee13415b38 gst/: Make gst_caps_replace() work like other _replace() functions.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_base_init),
(gst_basesink_pad_getcaps), (gst_basesink_init),
(gst_basesink_chain_unlocked):
* gst/base/gsttypefindhelper.c: (helper_find_suggest),
(gst_type_find_helper):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_have_type), (gst_type_find_element_init),
(stop_typefinding), (gst_type_find_element_handle_event),
(find_suggest), (gst_type_find_element_chain),
(gst_type_find_element_checkgetrange),
(gst_type_find_element_getrange), (do_typefind),
(gst_type_find_element_activate):
* gst/gstbuffer.c: (_gst_buffer_sub_free),
(gst_buffer_default_free), (gst_buffer_default_copy),
(gst_buffer_set_caps):
* gst/gstcaps.c: (gst_caps_ref), (gst_caps_unref),
(gst_caps_replace):
* gst/gstmessage.c: (gst_message_new),
(gst_message_new_state_changed):
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active),
(gst_pad_set_checkgetrange_function),
(gst_pad_link_prepare_filtered), (gst_pad_relink_filtered),
(gst_pad_set_caps), (gst_pad_check_pull_range),
(gst_pad_pull_range), (gst_static_pad_template_get_caps):
* gst/gstpad.h:
* gst/gsttypefind.c: (gst_type_find_register):
Make gst_caps_replace() work like other _replace() functions.
Use _caps_replace() where possible.
Make sure _message_new() initialises its field.
Add gst_static_pad_template_get_caps()
2005-04-20 09:10:42 +00:00
Wim Taymans 499659f65f Added typefind helper.
Original commit message from CVS:
Added typefind helper.
Small preroll fix in the base sink.
Disable typefind code in basesrc.
Crude port of typefindelement.
Fakesrc cleanups.
2005-04-12 10:52:55 +00:00
Wim Taymans 8cf38d3d3a gst/: Made base source class, make fakesrc extend it.
Original commit message from CVS:
* gst/base/Makefile.am:
* gst/base/README:
* gst/base/gstbasesink.c: (gst_basesink_base_init),
(gst_basesink_pad_getcaps), (gst_basesink_pad_setcaps),
(gst_basesink_pad_buffer_alloc), (gst_basesink_init),
(gst_basesink_do_sync), (gst_basesink_chain_unlocked):
* gst/base/gstbasesrc.c: (gst_basesrc_get_type),
(gst_basesrc_base_init), (gst_basesrc_class_init),
(gst_basesrc_init), (gst_basesrc_get_formats),
(gst_basesrc_get_query_types), (gst_basesrc_query),
(gst_basesrc_get_event_mask), (gst_basesrc_event_handler),
(gst_basesrc_set_property), (gst_basesrc_get_property),
(gst_basesrc_get_range_unlocked), (gst_basesrc_get_range),
(gst_basesrc_loop), (gst_basesrc_activate),
(gst_basesrc_change_state):
* gst/base/gstbasesrc.h:
* gst/elements/gstfakesrc.c: (gst_fakesrc_base_init),
(gst_fakesrc_class_init), (gst_fakesrc_init),
(gst_fakesrc_event_handler), (gst_fakesrc_set_property),
(gst_fakesrc_get_property), (gst_fakesrc_create):
* gst/elements/gstfakesrc.h:
* gst/elements/gstfilesrc.c: (gst_filesrc_getrange),
(gst_filesrc_open_file), (gst_filesrc_loop),
(gst_filesrc_activate), (filesrc_find_peek),
(gst_filesrc_type_find):
Made base source class, make fakesrc extend it.
Add comments to basesink class.
Some filesrc cleanup.
2005-04-05 08:44:20 +00:00
Wim Taymans bb1be5f509 gst/: Simplify pad activation.
Original commit message from CVS:
* gst/base/Makefile.am:
* gst/base/README:
* gst/base/gstbasesink.c: (gst_basesink_get_type),
(gst_basesink_base_init), (gst_basesink_class_init),
(gst_basesink_pad_getcaps), (gst_basesink_init),
(gst_basesink_activate), (gst_basesink_change_state):
* gst/base/gstbasesink.h:
* gst/base/gstbasetransform.c: (gst_base_transform_get_type),
(gst_base_transform_base_init), (gst_base_transform_finalize),
(gst_base_transform_class_init), (gst_base_transform_init),
(gst_base_transform_proxy_getcaps), (gst_base_transform_setcaps),
(gst_base_transform_event), (gst_base_transform_getrange),
(gst_base_transform_chain), (gst_base_transform_handle_buffer),
(gst_base_transform_set_property),
(gst_base_transform_get_property),
(gst_base_transform_sink_activate),
(gst_base_transform_src_activate),
(gst_base_transform_change_state):
* gst/base/gstbasetransform.h:
* gst/elements/gstidentity.c: (gst_identity_finalize),
(gst_identity_class_init), (gst_identity_init),
(gst_identity_event), (gst_identity_check_perfect),
(gst_identity_transform), (gst_identity_set_property),
(gst_identity_get_property), (gst_identity_change_state):
* gst/elements/gstidentity.h:
* gst/gstelement.c: (gst_element_get_state_func),
(gst_element_lost_state), (gst_element_pads_activate):
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active),
(gst_pad_check_pull_range), (gst_pad_pull_range):
* gst/gstpad.h:
Simplify pad activation.
Added function to check if pull_range can be performed.
Error out when pulling inactive or flushing pads.
Removed const from refcounted types as it does not make sense.
Simplify pad templates in basesink
Added base class for simple 1-to-1 transforms.
Make identity subclass the base transform.
2005-03-29 16:18:12 +00:00
Wim Taymans 326d36b8d8 Added state change code.
Original commit message from CVS:
Added state change code.
Added/updated docs.
Added sink base class, make fakesink extend the base class.
Small cleanups in GstPipeline.
2005-03-28 14:54:33 +00:00