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:
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;
}
g_assert_not_reached ();
break;
}
- gst_alsa_clock_start (GST_ALSA_CLOCK (this->clock));
+ gst_alsa_clock_start (this->clock);
return TRUE;
}
void
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 */
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),
#include <gst/gst.h>
-GST_DEBUG_CATEGORY_STATIC (alsa_debug);
+GST_DEBUG_CATEGORY_EXTERN (alsa_debug);
#define GST_CAT_DEFAULT alsa_debug
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;
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
#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 {
#include "gstalsasink.h"
#include "gstalsasrc.h"
+GST_DEBUG_CATEGORY (alsa_debug);
+
static gboolean
plugin_init (GstPlugin * plugin)
{
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));
}
/* 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);
}
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));