From 280c25766a76d6f1b353567eb52b03565104b242 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 18 Nov 2003 15:32:52 +0000 Subject: [PATCH] fixes for recent changes: Original commit message from CVS: fixes for recent changes: - GstAlsaClock is not a GstSystemClock - initialize debugging system correctly --- ext/alsa/gstalsa.c | 10 +++++----- ext/alsa/gstalsa.h | 7 +++++-- ext/alsa/gstalsaclock.h | 3 --- ext/alsa/gstalsaplugin.c | 2 ++ ext/alsa/gstalsasink.c | 6 +++--- ext/alsa/gstalsasrc.c | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index 755650c..72c930d 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -697,7 +697,7 @@ gst_alsa_change_state (GstElement *element) GST_ERROR_OBJECT (this, "Error unpausing sound: %s", snd_strerror (err)); return GST_STATE_FAILURE; } - gst_alsa_clock_start (GST_ALSA_CLOCK (this->clock)); + gst_alsa_clock_start (this->clock); } break; case GST_STATE_PLAYING_TO_PAUSED: @@ -708,7 +708,7 @@ gst_alsa_change_state (GstElement *element) GST_ERROR_OBJECT (this, "Error pausing sound: %s", snd_strerror (err)); return GST_STATE_FAILURE; } - gst_alsa_clock_stop (GST_ALSA_CLOCK (this->clock)); + gst_alsa_clock_stop (this->clock); } break; } @@ -946,7 +946,7 @@ gst_alsa_start (GstAlsa *this) g_assert_not_reached (); break; } - gst_alsa_clock_start (GST_ALSA_CLOCK (this->clock)); + gst_alsa_clock_start (this->clock); return TRUE; } void @@ -1177,7 +1177,7 @@ gst_alsa_drain_audio (GstAlsa *this) switch (snd_pcm_state (this->handle)) { case SND_PCM_STATE_XRUN: case SND_PCM_STATE_RUNNING: - gst_alsa_clock_stop (GST_ALSA_CLOCK (this->clock)); + gst_alsa_clock_stop (this->clock); /* fall through - clock is already stopped when paused */ case SND_PCM_STATE_PAUSED: /* snd_pcm_drain only works in blocking mode */ @@ -1204,7 +1204,7 @@ gst_alsa_stop_audio (GstAlsa *this) switch (snd_pcm_state (this->handle)) { case SND_PCM_STATE_XRUN: case SND_PCM_STATE_RUNNING: - gst_alsa_clock_stop (GST_ALSA_CLOCK (this->clock)); + gst_alsa_clock_stop (this->clock); /* fall through - clock is already stopped when paused */ case SND_PCM_STATE_PAUSED: ERROR_CHECK (snd_pcm_drop (this->handle), diff --git a/ext/alsa/gstalsa.h b/ext/alsa/gstalsa.h index 8b64931..c2b394a 100644 --- a/ext/alsa/gstalsa.h +++ b/ext/alsa/gstalsa.h @@ -29,7 +29,7 @@ #include -GST_DEBUG_CATEGORY_STATIC (alsa_debug); +GST_DEBUG_CATEGORY_EXTERN (alsa_debug); #define GST_CAT_DEFAULT alsa_debug @@ -110,6 +110,9 @@ typedef enum { else { (GST_ALSA (obj)->pcm_caps &= ~(1<<(flag))); } \ }G_STMT_END +typedef struct _GstAlsaClock GstAlsaClock; +typedef struct _GstAlsaClockClass GstAlsaClockClass; + typedef struct _GstAlsa GstAlsa; typedef struct _GstAlsaClass GstAlsaClass; @@ -143,7 +146,7 @@ struct _GstAlsa { gboolean autorecover; /* clocking */ - GstSystemClock * clock; /* our provided clock */ + GstAlsaClock * clock; /* our provided clock */ snd_pcm_uframes_t transmitted; /* samples transmitted since last sync This thing actually is our master clock. We will event insert silent samples or diff --git a/ext/alsa/gstalsaclock.h b/ext/alsa/gstalsaclock.h index 0912926..4629289 100644 --- a/ext/alsa/gstalsaclock.h +++ b/ext/alsa/gstalsaclock.h @@ -32,9 +32,6 @@ G_BEGIN_DECLS #define GST_IS_ALSA_CLOCK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_CLOCK)) #define GST_TYPE_ALSA_CLOCK (gst_alsa_clock_get_type()) -typedef struct _GstAlsaClock GstAlsaClock; -typedef struct _GstAlsaClockClass GstAlsaClockClass; - typedef GstClockTime (*GstAlsaClockGetTimeFunc) (GstAlsa *); struct _GstAlsaClock { diff --git a/ext/alsa/gstalsaplugin.c b/ext/alsa/gstalsaplugin.c index 93e5a5a..657bf36 100644 --- a/ext/alsa/gstalsaplugin.c +++ b/ext/alsa/gstalsaplugin.c @@ -27,6 +27,8 @@ #include "gstalsasink.h" #include "gstalsasrc.h" +GST_DEBUG_CATEGORY (alsa_debug); + static gboolean plugin_init (GstPlugin * plugin) { diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index fc4b0cc..f2683e4 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -149,7 +149,7 @@ gst_alsa_sink_init (GstAlsaSink *sink) gst_pad_set_getcaps_function (this->pad[0], gst_alsa_get_caps); gst_element_add_pad (GST_ELEMENT (this), this->pad[0]); - this->clock = GST_SYSTEM_CLOCK (gst_alsa_clock_new ("alsasinkclock", gst_alsa_sink_get_time, this)); + this->clock = gst_alsa_clock_new ("alsasinkclock", gst_alsa_sink_get_time, this); /* we hold a ref to our clock until we're disposed */ gst_object_ref (GST_OBJECT (this->clock)); gst_object_sink (GST_OBJECT (this->clock)); @@ -232,10 +232,10 @@ gst_alsa_sink_check_event (GstAlsaSink *sink, gint pad_nr) } /* if the clock is running */ - if (GST_CLOCK_TIME_IS_VALID (GST_ALSA_CLOCK (this->clock)->start_time)) { + if (GST_CLOCK_TIME_IS_VALID (this->clock->start_time)) { g_assert (this->format); /* adjust the start time */ - GST_ALSA_CLOCK (this->clock)->start_time += + this->clock->start_time += gst_alsa_samples_to_timestamp (this, this->transmitted) - gst_alsa_samples_to_timestamp (this, value); } diff --git a/ext/alsa/gstalsasrc.c b/ext/alsa/gstalsasrc.c index f241ce5..5004af5 100644 --- a/ext/alsa/gstalsasrc.c +++ b/ext/alsa/gstalsasrc.c @@ -144,7 +144,7 @@ gst_alsa_src_init (GstAlsaSrc *src) gst_pad_set_getcaps_function (this->pad[0], gst_alsa_get_caps); gst_element_add_pad (GST_ELEMENT (this), this->pad[0]); - this->clock = GST_SYSTEM_CLOCK (gst_alsa_clock_new ("alsasrcclock", gst_alsa_src_get_time, this)); + this->clock = gst_alsa_clock_new ("alsasrcclock", gst_alsa_src_get_time, this); /* we hold a ref to our clock until we're disposed */ gst_object_ref (GST_OBJECT (this->clock)); gst_object_sink (GST_OBJECT (this->clock)); -- 2.7.4