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 2381fd36f6
commit b92468d7a4
3 changed files with 50 additions and 27 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> 2004-01-14 Benjamin Otte <in7y118@public.uni-hamburg.de>
* ext/flac/gstflacdec.c: (gst_flacdec_update_metadata): * ext/flac/gstflacdec.c: (gst_flacdec_update_metadata):

View file

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

View file

@ -474,7 +474,7 @@ gst_mpeg_parse_loop (GstElement *element)
if (mpeg_parse->discont_pending) { if (mpeg_parse->discont_pending) {
if (!mpeg_parse->scr_pending) { if (!mpeg_parse->scr_pending) {
if (mpeg_parse->clock && mpeg_parse->sync) { if (mpeg_parse->clock && mpeg_parse->sync) {
gst_clock_handle_discont (mpeg_parse->clock, MPEGTIME_TO_GSTTIME (mpeg_parse->current_scr)); gst_element_set_time (GST_ELEMENT (mpeg_parse), MPEGTIME_TO_GSTTIME (mpeg_parse->current_scr));
} }
if (CLASS (mpeg_parse)->handle_discont) { if (CLASS (mpeg_parse)->handle_discont) {
CLASS (mpeg_parse)->handle_discont (mpeg_parse); CLASS (mpeg_parse)->handle_discont (mpeg_parse);
@ -509,12 +509,8 @@ gst_mpeg_parse_loop (GstElement *element)
CLASS (mpeg_parse)->send_data (mpeg_parse, data, time); CLASS (mpeg_parse)->send_data (mpeg_parse, data, time);
if (mpeg_parse->clock && mpeg_parse->sync && !mpeg_parse->discont_pending) { if (mpeg_parse->clock && mpeg_parse->sync && !mpeg_parse->discont_pending) {
mpeg_parse->id = gst_clock_new_single_shot_id (mpeg_parse->clock, time);
GST_DEBUG ("syncing mpegparse"); GST_DEBUG ("syncing mpegparse");
gst_element_clock_wait (GST_ELEMENT (mpeg_parse), mpeg_parse->id, NULL); gst_element_wait (GST_ELEMENT (mpeg_parse), time);
gst_clock_id_free (mpeg_parse->id);
mpeg_parse->id = NULL;
} }
if (mpeg_parse->current_scr != -1) if (mpeg_parse->current_scr != -1)
@ -880,7 +876,8 @@ gst_mpeg_parse_release_locks (GstElement *element)
mpeg_parse = GST_MPEG_PARSE (element); mpeg_parse = GST_MPEG_PARSE (element);
if (mpeg_parse->id) { if (mpeg_parse->id) {
gst_clock_id_unlock (mpeg_parse->id); /* FIXME */
//gst_clock_id_unlock (mpeg_parse->id);
} }
return TRUE; return TRUE;