mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
fixes for recent changes:
Original commit message from CVS: fixes for recent changes: - GstAlsaClock is not a GstSystemClock - initialize debugging system correctly
This commit is contained in:
parent
9ddf040472
commit
280c25766a
6 changed files with 16 additions and 14 deletions
|
@ -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),
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <gst/gst.h>
|
||||
|
||||
|
||||
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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include "gstalsasink.h"
|
||||
#include "gstalsasrc.h"
|
||||
|
||||
GST_DEBUG_CATEGORY (alsa_debug);
|
||||
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue