diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt index 62fb7473f1..c0ed9370c3 100644 --- a/docs/libs/gst-plugins-base-libs-sections.txt +++ b/docs/libs/gst-plugins-base-libs-sections.txt @@ -384,7 +384,7 @@ GstAudioRingBufferSpec GstAudioRingBufferCallback GstAudioRingBufferSegState GstAudioRingBufferState -GstBufferFormatType +GstAudioRingBufferFormatType GST_AUDIO_RING_BUFFER_BROADCAST GST_AUDIO_RING_BUFFER_GET_COND diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index 3f96a7d1ec..090114a44b 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -597,7 +597,7 @@ alsasink_parse_spec (GstAlsaSink * alsa, GstAudioRingBufferSpec * spec) alsa->iec958 = FALSE; switch (spec->type) { - case GST_BUFTYPE_RAW: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW: switch (GST_AUDIO_INFO_FORMAT (&spec->info)) { case GST_AUDIO_FORMAT_U8: alsa->format = SND_PCM_FORMAT_U8; @@ -693,13 +693,13 @@ alsasink_parse_spec (GstAlsaSink * alsa, GstAudioRingBufferSpec * spec) goto error; } break; - case GST_BUFTYPE_A_LAW: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW: alsa->format = SND_PCM_FORMAT_A_LAW; break; - case GST_BUFTYPE_MU_LAW: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW: alsa->format = SND_PCM_FORMAT_MU_LAW; break; - case GST_BUFTYPE_IEC958: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958: alsa->format = SND_PCM_FORMAT_S16_BE; alsa->iec958 = TRUE; break; @@ -764,7 +764,7 @@ gst_alsasink_prepare (GstAudioSink * asink, GstAudioRingBufferSpec * spec) alsa = GST_ALSA_SINK (asink); - if (spec->type == GST_BUFTYPE_IEC958) { + if (spec->type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958) { snd_pcm_close (alsa->handle); alsa->handle = gst_alsa_open_iec958_pcm (GST_OBJECT (alsa)); if (G_UNLIKELY (!alsa->handle)) { diff --git a/ext/alsa/gstalsasrc.c b/ext/alsa/gstalsasrc.c index 3909ac86e8..223cf6425b 100644 --- a/ext/alsa/gstalsasrc.c +++ b/ext/alsa/gstalsasrc.c @@ -530,7 +530,7 @@ static gboolean alsasrc_parse_spec (GstAlsaSrc * alsa, GstAudioRingBufferSpec * spec) { switch (spec->type) { - case GST_BUFTYPE_RAW: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW: switch (GST_AUDIO_INFO_FORMAT (&spec->info)) { case GST_AUDIO_FORMAT_U8: alsa->format = SND_PCM_FORMAT_U8; @@ -626,10 +626,10 @@ alsasrc_parse_spec (GstAlsaSrc * alsa, GstAudioRingBufferSpec * spec) goto error; } break; - case GST_BUFTYPE_A_LAW: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW: alsa->format = SND_PCM_FORMAT_A_LAW; break; - case GST_BUFTYPE_MU_LAW: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW: alsa->format = SND_PCM_FORMAT_MU_LAW; break; default: diff --git a/gst-libs/gst/audio/gstaudioiec61937.c b/gst-libs/gst/audio/gstaudioiec61937.c index 821a6b24f6..983d58ec72 100644 --- a/gst-libs/gst/audio/gstaudioiec61937.c +++ b/gst-libs/gst/audio/gstaudioiec61937.c @@ -75,10 +75,10 @@ guint gst_audio_iec61937_frame_size (const GstAudioRingBufferSpec * spec) { switch (spec->type) { - case GST_BUFTYPE_AC3: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3: return IEC61937_PAYLOAD_SIZE_AC3; - case GST_BUFTYPE_EAC3: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3: /* Check that the parser supports /some/ alignment. Need to be less * strict about this at checking time since the alignment is dynamically * set at the moment. */ @@ -87,7 +87,7 @@ gst_audio_iec61937_frame_size (const GstAudioRingBufferSpec * spec) else return 0; - case GST_BUFTYPE_DTS: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS: { gint dts_frame_size = caps_get_int_field (spec->caps, "frame-size"); gint iec_frame_size = caps_get_int_field (spec->caps, "block-size") * 4; @@ -99,7 +99,7 @@ gst_audio_iec61937_frame_size (const GstAudioRingBufferSpec * spec) return 0; } - case GST_BUFTYPE_MPEG: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG: { int version, layer, channels, frames; @@ -176,7 +176,7 @@ gst_audio_iec61937_payload (const guint8 * src, guint src_n, guint8 * dst, dst[three] = 0x1F; switch (spec->type) { - case GST_BUFTYPE_AC3: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3: { g_return_val_if_fail (src_n >= 6, FALSE); @@ -196,7 +196,7 @@ gst_audio_iec61937_payload (const guint8 * src, guint src_n, guint8 * dst, break; } - case GST_BUFTYPE_EAC3: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3: { if (g_str_equal (caps_get_string_field (spec->caps, "alignment"), "iec61937")) @@ -218,7 +218,7 @@ gst_audio_iec61937_payload (const guint8 * src, guint src_n, guint8 * dst, break; } - case GST_BUFTYPE_DTS: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS: { int blocksize = caps_get_int_field (spec->caps, "block-size"); @@ -242,7 +242,7 @@ gst_audio_iec61937_payload (const guint8 * src, guint src_n, guint8 * dst, break; } - case GST_BUFTYPE_MPEG: + case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG: { int version, layer; diff --git a/gst-libs/gst/audio/gstaudioringbuffer.c b/gst-libs/gst/audio/gstaudioringbuffer.c index eae7c37f1a..017cecabf6 100644 --- a/gst-libs/gst/audio/gstaudioringbuffer.c +++ b/gst-libs/gst/audio/gstaudioringbuffer.c @@ -209,14 +209,14 @@ gst_audio_ring_buffer_parse_caps (GstAudioRingBufferSpec * spec, GstCaps * caps) if (!gst_audio_info_from_caps (&info, caps)) goto parse_error; - spec->type = GST_BUFTYPE_RAW; + spec->type = GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW; } else if (g_str_equal (mimetype, "audio/x-alaw")) { /* extract the needed information from the cap */ if (!(gst_structure_get_int (structure, "rate", &info.rate) && gst_structure_get_int (structure, "channels", &info.channels))) goto parse_error; - spec->type = GST_BUFTYPE_A_LAW; + spec->type = GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW; info.bpf = info.channels; } else if (g_str_equal (mimetype, "audio/x-mulaw")) { /* extract the needed information from the cap */ @@ -224,35 +224,35 @@ gst_audio_ring_buffer_parse_caps (GstAudioRingBufferSpec * spec, GstCaps * caps) gst_structure_get_int (structure, "channels", &info.channels))) goto parse_error; - spec->type = GST_BUFTYPE_MU_LAW; + spec->type = GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW; info.bpf = info.channels; } else if (g_str_equal (mimetype, "audio/x-iec958")) { /* extract the needed information from the cap */ if (!(gst_structure_get_int (structure, "rate", &info.rate))) goto parse_error; - spec->type = GST_BUFTYPE_IEC958; + spec->type = GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958; info.bpf = 4; } else if (g_str_equal (mimetype, "audio/x-ac3")) { /* extract the needed information from the cap */ if (!(gst_structure_get_int (structure, "rate", &info.rate))) goto parse_error; - spec->type = GST_BUFTYPE_AC3; + spec->type = GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3; info.bpf = 4; } else if (g_str_equal (mimetype, "audio/x-eac3")) { /* extract the needed information from the cap */ if (!(gst_structure_get_int (structure, "rate", &info.rate))) goto parse_error; - spec->type = GST_BUFTYPE_EAC3; + spec->type = GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3; info.bpf = 16; } else if (g_str_equal (mimetype, "audio/x-dts")) { /* extract the needed information from the cap */ if (!(gst_structure_get_int (structure, "rate", &info.rate))) goto parse_error; - spec->type = GST_BUFTYPE_DTS; + spec->type = GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS; info.bpf = 4; } else if (g_str_equal (mimetype, "audio/mpeg") && gst_structure_get_int (structure, "mpegaudioversion", &i) && @@ -262,7 +262,7 @@ gst_audio_ring_buffer_parse_caps (GstAudioRingBufferSpec * spec, GstCaps * caps) if (!(gst_structure_get_int (structure, "rate", &info.rate))) goto parse_error; - spec->type = GST_BUFTYPE_MPEG; + spec->type = GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG; info.bpf = 4; } else { goto parse_error; @@ -563,7 +563,7 @@ gst_audio_ring_buffer_acquire (GstAudioRingBuffer * buf, g_free (buf->empty_seg); buf->empty_seg = g_malloc (segsize); - if (buf->spec.type == GST_BUFTYPE_RAW) { + if (buf->spec.type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW) { gst_audio_format_fill_silence (buf->spec.info.finfo, buf->empty_seg, segsize); } else { diff --git a/gst-libs/gst/audio/gstaudioringbuffer.h b/gst-libs/gst/audio/gstaudioringbuffer.h index 0fe9babb6d..5f581b4f8f 100644 --- a/gst-libs/gst/audio/gstaudioringbuffer.h +++ b/gst-libs/gst/audio/gstaudioringbuffer.h @@ -67,37 +67,37 @@ typedef enum { } GstAudioRingBufferState; /** - * GstBufferFormatType: - * @GST_BUFTYPE_RAW: samples in linear or float - * @GST_BUFTYPE_MU_LAW: samples in mulaw - * @GST_BUFTYPE_A_LAW: samples in alaw - * @GST_BUFTYPE_IMA_ADPCM: samples in ima adpcm - * @GST_BUFTYPE_MPEG: samples in mpeg audio (but not AAC) format - * @GST_BUFTYPE_GSM: samples in gsm format - * @GST_BUFTYPE_IEC958: samples in IEC958 frames (e.g. AC3) - * @GST_BUFTYPE_AC3: samples in AC3 format - * @GST_BUFTYPE_EAC3: samples in EAC3 format - * @GST_BUFTYPE_DTS: samples in DTS format - * @GST_BUFTYPE_MPEG2_AAC: samples in MPEG-2 AAC format - * @GST_BUFTYPE_MPEG4_AAC: samples in MPEG-4 AAC format + * GstAudioRingBufferFormatType: + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW: samples in linear or float + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW: samples in mulaw + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW: samples in alaw + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IMA_ADPCM: samples in ima adpcm + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG: samples in mpeg audio (but not AAC) format + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_GSM: samples in gsm format + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958: samples in IEC958 frames (e.g. AC3) + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3: samples in AC3 format + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3: samples in EAC3 format + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS: samples in DTS format + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC: samples in MPEG-2 AAC format + * @GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC: samples in MPEG-4 AAC format * * The format of the samples in the ringbuffer. */ typedef enum { - GST_BUFTYPE_RAW, - GST_BUFTYPE_MU_LAW, - GST_BUFTYPE_A_LAW, - GST_BUFTYPE_IMA_ADPCM, - GST_BUFTYPE_MPEG, - GST_BUFTYPE_GSM, - GST_BUFTYPE_IEC958, - GST_BUFTYPE_AC3, - GST_BUFTYPE_EAC3, - GST_BUFTYPE_DTS, - GST_BUFTYPE_MPEG2_AAC, - GST_BUFTYPE_MPEG4_AAC, -} GstBufferFormatType; + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IMA_ADPCM, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_GSM, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC, + GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC +} GstAudioRingBufferFormatType; /** * GstAudioRingBufferSpec: @@ -120,8 +120,8 @@ struct _GstAudioRingBufferSpec GstCaps *caps; /* the caps of the buffer */ /* in/out */ - GstBufferFormatType type; - GstAudioInfo info; + GstAudioRingBufferFormatType type; + GstAudioInfo info; guint64 latency_time; /* the required/actual latency time, this is the * actual the size of one segment and the