Commit graph

361 commits

Author SHA1 Message Date
Tim-Philipp Müller 3767cb6005 audiosink,audiosrc: ref the audio ring buffer class and type in class_init
Hack around thread-safety issues in GObject and our racy _get_type()
functions (we could easily fix the _get_type() functions, but we still
need to hack around the GObject class races until we require a newer
GLib version, I think).
2009-06-15 15:39:09 +01:00
Wim Taymans a5491ba218 audiosrc: return FALSE when receiving a SEEK event
When receiving a seek event, return FALSE as we don't implement seeking.
2009-06-15 12:57:39 +02:00
Wim Taymans a9c82f9472 ringbuffer: handle border cases in resampler 2009-06-11 19:13:28 +02:00
Wim Taymans 69b7fb3845 baseaudiosink: reset accum when dropping samples
When we are resampling and we drop samples because we paused, reset the accum
counter because it's now invalid.
2009-06-11 12:38:35 +02:00
Tim-Philipp Müller 249d9b4aa1 Don't include config.h multiple times when build audio testchannel app.
Fixes build problem on win32 (#585075).
2009-06-10 21:37:29 +01:00
Wim Taymans 38e59ec75d baseaudiosink: no need to cause discont when clipping
Remove the discont-when-clipping hack now that basesink provides us with
correctly clipped samples when stepping.
2009-06-09 12:09:15 +02:00
Wim Taymans cb4952fc2e audiosink: don't align when we clip
Don't align samples when they were clipped. Not entirely correct but better than
nothing for now.
2009-06-08 17:26:59 +02:00
Andy Wingo c7ca6abe53 add can-activate-pull property to baseaudiosink
* gst-libs/gst/audio/gstbaseaudiosink.c: Add can-activate-pull property
  to baseaudiosink.
2009-05-26 13:17:44 +02:00
Wim Taymans 81170c4989 audiosink: improve debug message 2009-05-21 10:48:49 +02:00
Wim Taymans c68a361e31 audiosink: return the return value of wait_preroll
Return the value that _wait_preroll() returned instead of always WRONG_STATE.
2009-05-19 17:17:37 +02:00
Wim Taymans b9723f6e1c audioclock: make our internal time monotonic
Make the internal time increase monotonically.
2009-05-13 21:38:56 +02:00
Wim Taymans d655120ee6 audioclock: make sure values are ever increasing 2009-05-12 10:39:41 +02:00
Andy Wingo 9f74ce745f Revert "add can-activate-pull property to baseaudiosink"
This reverts commit c4074a2ee4.
2009-04-29 11:18:42 +02:00
Andy Wingo 219a31fa3c Revert "[baseaudiosink] add docs for can-activate-pull"
This reverts commit 416ce16f26.
2009-04-29 11:18:33 +02:00
Andy Wingo 416ce16f26 [baseaudiosink] add docs for can-activate-pull
* gst-libs/gst/audio/gstbaseaudiosink.c: Add documentation for
  can-activate-pull.
2009-04-28 18:48:33 +02:00
Andy Wingo c4074a2ee4 add can-activate-pull property to baseaudiosink
* gst-libs/gst/audio/gstbaseaudiosink.c: Add can-activate-pull property
  to baseaudiosink.
2009-04-28 18:28:50 +02:00
Wim Taymans 32904de58f baseaudiosink: don't unparent the ringbuffer
when going to NULL, don't unparent the ringbuffer because we don't support going
back to 0 very well yet.
Fixes #579203
2009-04-17 11:03:32 +02:00
Stefan Kost ab24d9d65c log: use G_GUINT64_FORMAT instead of llu 2009-04-15 00:02:39 +03:00
Wim Taymans dffd1bcc97 baseaudiosrc: adjust the internal timestamp
Adjust the internal timestamp before comparing it against the adjusted clock
time.
Fixes #578506
2009-04-14 13:16:14 +02:00
Wim Taymans 0c4c1410f9 baseaudiosink: use new clock time methods
Use the unadjusted internal clock times to calculate the internal/external
offset when calibrating the clock.

When going to NULL, unparent and free the ringbuffer, like we do in the source
element.
See #578506
2009-04-14 13:12:59 +02:00
Wim Taymans 4231d54823 audioclock: add methods for the internal offset
Add two methods for getting the unadjusted time of the clock and one for
adjusting an internal time. We will need these methods for correctly handling
the time after a gst_audio_clock_reset().

Add a debug category and some debug lines to the audio clock.

API: gst_audio_clock_get_time()
API: gst_audio_clock_adjust()
API: GST_AUDIO_CLOCK_CAST()
2009-04-14 13:08:52 +02:00
Wim Taymans 251f152c20 baseaudiosink: use the internal clock time
We can't assume that the internal clock time is the same as the function we
installed on our provided clock because somebody might have changed it.
2009-04-10 21:50:55 +02:00
Wim Taymans e6798c5cce ringbuffer: allow for custom commit functions
Allow subclasses to override the commit method.
2009-04-09 18:04:44 +02:00
Wim Taymans cae2981f83 baseaudiosink: fix a small glitch after pause
After we pause the stream and interrupt the writeout to the ringbuffer, also adjust
the amount of output samples we consumed. We can't do this reliably with the
current API when we are doing trick modes but we can do the right thing for
normal playback.
2009-04-08 18:06:54 +02:00
Stefan Kost ff9ee1dc5a audiofilter: don't leak pad-template
gst_element_class_add_pad_template() does not take ownership.
2009-04-07 22:39:07 +03:00
Tim-Philipp Müller 0267e79778 audiosrc: improve 'Dropped n samples' warning message 2009-03-25 11:27:44 +00:00
Stefan Kost 251e4d160a docs: don't put random stuff in tags.
Tags like Since: or Returns: can only be followed by more tags. gtk-doc has no
tag to append text again to the documentation body.
2009-02-26 10:09:59 +02:00
Stefan Kost 486fe43cb9 Add a FIXME 0.11. Make the log message a bit more detailed and add comments. 2009-02-02 18:05:42 +02:00
Stefan Kost 950d0c0a7d Link to the class, as we can't link to the members yet. 2009-01-31 18:44:32 +02:00
Jan Schmidt 63c9ede3d0 Extend and clean up git ignores 2009-01-23 23:16:11 +00:00
José Alburquerque 7431789249 gst-libs/gst/audio/gstaudioclock.*: Make gst_audio_clock_new use const gchar* to ease the wrapping of
Original commit message from CVS:
Patch by: José Alburquerque <jaalburqu svn gnome org>
* gst-libs/gst/audio/gstaudioclock.c: (gst_audio_clock_new):
* gst-libs/gst/audio/gstaudioclock.h:
Make gst_audio_clock_new use const gchar* to ease the wrapping of
C++ bindings. Fixes #566723.
2009-01-06 17:30:31 +00:00
Wim Taymans 0a4c1bc64c gst-libs/gst/audio/gstbaseaudiosink.c: Avoid holding the OBJECT_LOCK when calling ringbuffer functions that take the ...
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_change_state):
Avoid holding the OBJECT_LOCK when calling ringbuffer functions that
take the ringbuffer lock because rinbuffer lock > OBJECT_LOCK. We can do
this because the async_play method is deprecated and usually not called
anymore.
2009-01-05 17:13:13 +00:00
Edward Hervey e2fcc71650 Switch glib-mkenum for gst-libs/gst/audio from multichannel- to audio- in order to wrap all enums declarations of tha...
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c:
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c:
* win32/MANIFEST:
* win32/common/audio-enumtypes.c:
(gst_audio_channel_position_get_type),
(gst_ring_buffer_state_get_type),
(gst_ring_buffer_seg_state_get_type),
(gst_buffer_format_type_get_type), (gst_buffer_format_get_type):
* win32/common/audio-enumtypes.h:
* win32/common/multichannel-enumtypes.c:
* win32/common/multichannel-enumtypes.h:
* win32/vs6/grammar.dsp:
* win32/vs6/libgstaudio.dsp:
* win32/vs7/libgstaudio.vcproj:
* win32/vs8/libgstaudio.vcproj:
Switch glib-mkenum for gst-libs/gst/audio from multichannel- to
audio- in order to wrap all enums declarations of that library.
This modification should not matter since that header file is not a
public header (it will be included by public headers).
Modify win32 crap^Wfiles accordingly.
2008-12-31 11:20:26 +00:00
Edward Hervey 20adaa1328 gst-libs/gst/audio/: Complete Sebastien's commit from the 13th by exporting the _slave_method_get_type() methods.
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosrc.h:
* gst-libs/gst/audio/gstbaseaudiosink.h:
Complete Sebastien's commit from the 13th by exporting the
_slave_method_get_type() methods.
2008-12-30 17:55:07 +00:00
Wim Taymans a579eba73d gst-libs/gst/audio/gstbaseaudiosink.c: Pause the write thread before deactivating and releasing the ringbuffer to avo...
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_setcaps):
Pause the write thread before deactivating and releasing the ringbuffer
to avoid a deadlock when we do gapless playback with different sample
rates in playbin2.  Fixes #564929.
2008-12-20 12:45:03 +00:00
Sebastian Dröge 4ed1f5d6fd gst-libs/gst/audio/gstbaseaudiosrc.c: Make GstAudioSrcSlaveMethod get_type() function non-static as it's public now.
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosrc.c:
Make GstAudioSrcSlaveMethod get_type() function non-static
as it's public now.
* win32/common/libgstaudio.def:
* win32/common/libgstnetbuffer.def:
Add some missing functions to the list of exported symbols.
2008-12-19 13:03:00 +00:00
Sebastian Dröge 04d9ff9a24 gst-libs/gst/audio/: API: Add GST_TYPE_BASE_AUDIO_(SRC|SINK)_SLAVE_METHOD to the public API. This is needed for the C...
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_slave_method_get_type),
(gst_base_audio_sink_class_init):
* gst-libs/gst/audio/gstbaseaudiosink.h:
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_slave_method_get_type),
(gst_base_audio_src_class_init):
* gst-libs/gst/audio/gstbaseaudiosrc.h:
API: Add GST_TYPE_BASE_AUDIO_(SRC|SINK)_SLAVE_METHOD to the
public API. This is needed for the C++ bindings to be able
to use this base classes. Fixes bug #564200, #564206.
2008-12-13 06:57:09 +00:00
Wim Taymans af354dbef3 gst-libs/gst/audio/gstbaseaudiosrc.c: Avoid nasty int overflows after about 12 hours and 25 minutes when these code p...
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_get_offset), (gst_base_audio_src_create):
Avoid nasty int overflows after about 12 hours and 25 minutes when these
code paths are triggered.
A free beer to Håvard Graff for finding this!
2008-11-27 16:47:41 +00:00
Wim Taymans 6983c1c85b gst-libs/gst/audio/gstbaseaudiosink.c: Really fix audiosink drain handling by keeping track of the running_time of th...
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_drain), (gst_base_audio_sink_event),
(gst_base_audio_sink_sync_latency), (gst_base_audio_sink_render),
(gst_base_audio_sink_change_state):
Really fix audiosink drain handling by keeping track of the running_time
of the last sample.
2008-11-25 10:32:49 +00:00
Stefan Kost a8264f66c7 gst-libs/gst/audio/gstbaseaudiosink.c: Time is already in running_time. Remove base_time handling. Fixes audiosinks n...
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
Time is already in running_time. Remove base_time handling. Fixes
audiosinks not draining and thus chopping some audio in the end.
2008-11-24 20:11:52 +00:00
Stefan Kost 7f937c99d4 gst-libs/gst/audio/gstbaseaudiosink.c: Add one log message to check for audio_drained. Sync one log message with the ...
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
Add one log message to check for audio_drained. Sync one log message
with the condition. Send EOS after draining audio in pull mode.
2008-11-24 12:56:54 +00:00
Wim Taymans e701e64005 gst-libs/gst/audio/gstbaseaudiosink.c: Use gst_base_sink_do_preroll() to wait for PLAYING and before waiting for the ...
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_sync_latency), (gst_base_audio_sink_render),
(gst_base_audio_sink_callback):
Use gst_base_sink_do_preroll() to wait for PLAYING and before waiting
for the latency to expire, fixes #559567.
2008-11-10 14:22:09 +00:00
Wim Taymans 6eed8ca285 gst-libs/gst/audio/gstaudiosink.c: Implement a separate activate functions to start monitoring the segments or, in pu...
Original commit message from CVS:
* gst-libs/gst/audio/gstaudiosink.c:
(gst_audioringbuffer_class_init), (gst_audioringbuffer_acquire),
(gst_audioringbuffer_activate), (gst_audioringbuffer_release),
(gst_audioringbuffer_stop):
Implement a separate activate functions to start monitoring the segments
or, in pull mode, pulling in data.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_init), (gst_base_audio_sink_dispose),
(gst_base_audio_sink_query_pad), (gst_base_audio_sink_query),
(gst_base_audio_sink_setcaps), (gst_base_audio_sink_callback),
(gst_base_audio_sink_activate_pull),
(gst_base_audio_sink_async_play),
(gst_base_audio_sink_change_state):
Implement pad and element convert query function.
Activate the ringbuffer.
Use the segment last_stop value as the offset to pull.
Use new basesink _do_preroll() method to preroll in the pulling thread.
Take appropriate locking in the pulling thread.
* gst-libs/gst/audio/gstringbuffer.h:
Update some docs.
2008-10-20 15:35:37 +00:00
Wim Taymans a6b78893c0 Add methods to more accuratly control the pulling thread of a ringbuffer.
Original commit message from CVS:
* docs/libs/gst-plugins-base-libs-sections.txt:
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_convert),
(gst_ring_buffer_activate), (gst_ring_buffer_is_active):
* gst-libs/gst/audio/gstringbuffer.h:
Add methods to more accuratly control the pulling thread of a
ringbuffer.
Add format conversion helper code to the ringbuffer.
API: GstRingBuffer:gst_ring_buffer_activate()
API: GstRingBuffer:gst_ring_buffer_is_active()
API: GstRingBuffer:gst_ring_buffer_convert()
2008-10-17 13:19:05 +00:00
Wim Taymans 927999603a gst-libs/gst/audio/gstaudiosink.c: Signal thread startup earlier so that we can immediatly go into pull mode when we ...
Original commit message from CVS:
* gst-libs/gst/audio/gstaudiosink.c: (audioringbuffer_thread_func),
(gst_audioringbuffer_acquire), (gst_audioringbuffer_release),
(gst_audioringbuffer_stop):
Signal thread startup earlier so that we can immediatly go into pull
mode when we have to and block on preroll.
2008-10-16 15:44:37 +00:00
Wim Taymans 7bd29abb9d gst-libs/gst/audio/gstringbuffer.c: In pull mode we want the callback to prepull a buffer we can preroll on even when...
Original commit message from CVS:
* gst-libs/gst/audio/gstringbuffer.c:
(gst_ring_buffer_prepare_read):
In pull mode we want the callback to prepull a buffer we can preroll on
even when we are not yet playing.
2008-10-16 15:38:50 +00:00
Edward Hervey 57b0f5bef6 gst-libs/gst/audio/gstbaseaudiosrc.c: Fix debug statements (space between '%' and actual format).
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_create):
Fix debug statements (space between '%' and actual format).
2008-10-08 15:30:33 +00:00
Håvard Graff 11086cf6f8 gst-libs/gst/audio/gstbaseaudiosrc.c: Implement skew clock slaving. Fixes #552559.
Original commit message from CVS:
Patch by: Håvard Graff <havard dot graff at tandberg dot com>
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_create):
Implement skew clock slaving. Fixes #552559.
2008-10-08 09:12:36 +00:00
Wim Taymans dd01a1e56a gst-libs/gst/audio/: Fix include of config.h
Original commit message from CVS:
* gst-libs/gst/audio/multichannel.c:
* gst-libs/gst/audio/testchannels.c:
Fix include of config.h
2008-10-08 09:10:23 +00:00
Tim-Philipp Müller b579580991 gst-libs/gst/audio/audio.h: Remove trailing comma from enum list, which causes problems with -pendantic (#550729).
Original commit message from CVS:
* gst-libs/gst/audio/audio.h: (GST_AUDIO_FIELD_SIGNED):
Remove trailing comma from enum list, which causes problems
with -pendantic (#550729).
2008-09-13 11:04:02 +00:00