use element time.

Original commit message from CVS:
2004-01-14  Benjamin Otte  <in7y118@public.uni-hamburg.de>

* ext/aalib/gstaasink.c: (gst_aasink_chain):
* ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event):
* ext/esd/esdsink.c: (gst_esdsink_chain):
* ext/libcaca/gstcacasink.c: (gst_cacasink_chain):
* ext/mas/massink.c: (gst_massink_chain):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_chain):
* gst/matroska/matroska-demux.c: (gst_matroska_demux_parse_index),
(gst_matroska_demux_parse_metadata):
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_loop),
(gst_mpeg_parse_release_locks):
* gst/tcp/gsttcpsink.c: (gst_tcpsink_chain):
* gst/udp/gstudpsink.c: (gst_udpsink_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
* sys/oss/gstosssink.c: (gst_osssink_init), (gst_osssink_chain),
(gst_osssink_change_state):
* sys/v4l/gstv4lmjpegsink.c: (gst_v4lmjpegsink_chain):
* sys/ximage/ximagesink.c: (gst_ximagesink_chain):
* sys/xvideo/xvideosink.c: (gst_xvideosink_chain),
(gst_xvideosink_release_locks):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain):
use element time.
* ext/alsa/gstalsaclock.c: (gst_alsa_clock_start),
(gst_alsa_clock_stop):
* gst-libs/gst/audio/audioclock.c: (gst_audio_clock_set_active),
(gst_audio_clock_get_internal_time):
simplify for use with new clocking code.
* testsuite/alsa/Makefile.am:
* testsuite/alsa/sinesrc.c: (sinesrc_init), (sinesrc_force_caps):
fix testsuite for new caps system
This commit is contained in:
Benjamin Otte 2004-01-14 00:53:52 +00:00
parent a9eb10c6ef
commit 596506d443
4 changed files with 50 additions and 32 deletions

View file

@ -1,3 +1,35 @@
2004-01-14 Benjamin Otte <in7y118@public.uni-hamburg.de>
* ext/aalib/gstaasink.c: (gst_aasink_chain):
* ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event):
* ext/esd/esdsink.c: (gst_esdsink_chain):
* ext/libcaca/gstcacasink.c: (gst_cacasink_chain):
* ext/mas/massink.c: (gst_massink_chain):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_chain):
* gst/matroska/matroska-demux.c: (gst_matroska_demux_parse_index),
(gst_matroska_demux_parse_metadata):
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_loop),
(gst_mpeg_parse_release_locks):
* gst/tcp/gsttcpsink.c: (gst_tcpsink_chain):
* gst/udp/gstudpsink.c: (gst_udpsink_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
* sys/oss/gstosssink.c: (gst_osssink_init), (gst_osssink_chain),
(gst_osssink_change_state):
* sys/v4l/gstv4lmjpegsink.c: (gst_v4lmjpegsink_chain):
* sys/ximage/ximagesink.c: (gst_ximagesink_chain):
* sys/xvideo/xvideosink.c: (gst_xvideosink_chain),
(gst_xvideosink_release_locks):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain):
use element time.
* ext/alsa/gstalsaclock.c: (gst_alsa_clock_start),
(gst_alsa_clock_stop):
* gst-libs/gst/audio/audioclock.c: (gst_audio_clock_set_active),
(gst_audio_clock_get_internal_time):
simplify for use with new clocking code.
* testsuite/alsa/Makefile.am:
* testsuite/alsa/sinesrc.c: (sinesrc_init), (sinesrc_force_caps):
fix testsuite for new caps system
2004-01-14 Benjamin Otte <in7y118@public.uni-hamburg.de>
* ext/flac/gstflacdec.c: (gst_flacdec_update_metadata):

View file

@ -225,12 +225,9 @@ gst_massink_chain (GstPad *pad, GstData *_data)
GstMassink *massink = GST_MASSINK (gst_pad_get_parent (pad));
if (massink->clock) {
GstClockID id = gst_clock_new_single_shot_id (massink->clock, GST_BUFFER_TIMESTAMP (buf));
if (massink->clock && GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
GST_DEBUG ("massink: clock wait: %llu\n", GST_BUFFER_TIMESTAMP (buf));
gst_element_clock_wait (GST_ELEMENT (massink), id, NULL);
gst_clock_id_free (id);
gst_element_wait (GST_ELEMENT (massink), GST_BUFFER_TIMESTAMP (buf));
}
if (GST_BUFFER_DATA (buf) != NULL) {

View file

@ -562,13 +562,8 @@ gst_sdlvideosink_chain (GstPad *pad, GstData *_data)
return;
}
if (GST_VIDEOSINK_CLOCK (sdlvideosink)) {
GstClockID id = gst_clock_new_single_shot_id (
GST_VIDEOSINK_CLOCK (sdlvideosink),
GST_BUFFER_TIMESTAMP (buf));
gst_element_clock_wait (GST_ELEMENT (sdlvideosink), id, NULL);
gst_clock_id_free (id);
if (GST_VIDEOSINK_CLOCK (sdlvideosink) && GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
gst_element_wait (GST_ELEMENT (sdlvideosink), GST_BUFFER_TIMESTAMP (buf));
}
if (GST_BUFFER_DATA (buf) != sdlvideosink->overlay->pixels[0]) {

View file

@ -105,19 +105,21 @@ gst_audio_clock_new (gchar *name, GstAudioClockGetTimeFunc func, gpointer user_d
void
gst_audio_clock_set_active (GstAudioClock *aclock, gboolean active)
{
GTimeVal timeval;
GstClockTime time;
GstClockTime audiotime;
GstClock *clock;
g_get_current_time (&timeval);
time = GST_TIMEVAL_TO_TIME (timeval);
audiotime = aclock->func ((GstClock*)aclock, aclock->user_data);
g_return_if_fail (GST_IS_AUDIO_CLOCK (aclock));
clock = GST_CLOCK (aclock);
time = gst_clock_get_event_time (clock);
if (active) {
aclock->adjust = time - audiotime;
}
else {
aclock->adjust = audiotime - time;
aclock->adjust = time - aclock->func (clock, aclock->user_data);
} else {
GTimeVal timeval;
g_get_current_time (&timeval);
aclock->adjust = GST_TIMEVAL_TO_TIME (timeval) - time;
}
aclock->active = active;
@ -129,20 +131,12 @@ gst_audio_clock_get_internal_time (GstClock *clock)
GstAudioClock *aclock = GST_AUDIO_CLOCK (clock);
if (aclock->active) {
GstClockTime audiotime;
audiotime = aclock->func (clock, aclock->user_data) + aclock->adjust;
return audiotime;
}
else {
GstClockTime time;
return aclock->func (clock, aclock->user_data) + aclock->adjust;
} else {
GTimeVal timeval;
g_get_current_time (&timeval);
time = GST_TIMEVAL_TO_TIME (timeval);
return time;
return GST_TIMEVAL_TO_TIME (timeval);
}
}