mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
baseaudio: rename GstAudioState to GstAudioFormatInfo
This commit is contained in:
parent
ecf57f2b73
commit
d1ab04f029
6 changed files with 17 additions and 16 deletions
|
@ -442,7 +442,7 @@ static gboolean
|
||||||
gst_base_audio_decoder_src_setcaps (GstPad * pad, GstCaps * caps)
|
gst_base_audio_decoder_src_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstBaseAudioDecoder *dec;
|
GstBaseAudioDecoder *dec;
|
||||||
GstAudioState *state;
|
GstAudioFormatInfo *state;
|
||||||
gboolean res = TRUE, changed;
|
gboolean res = TRUE, changed;
|
||||||
|
|
||||||
dec = GST_BASE_AUDIO_DECODER (gst_pad_get_parent (pad));
|
dec = GST_BASE_AUDIO_DECODER (gst_pad_get_parent (pad));
|
||||||
|
|
|
@ -137,7 +137,7 @@ G_STMT_START { \
|
||||||
struct _GstBaseAudioDecoderContext {
|
struct _GstBaseAudioDecoderContext {
|
||||||
/* input */
|
/* input */
|
||||||
/* (output) audio format */
|
/* (output) audio format */
|
||||||
GstAudioState state;
|
GstAudioFormatInfo state;
|
||||||
|
|
||||||
/* parsing state */
|
/* parsing state */
|
||||||
gboolean eos;
|
gboolean eos;
|
||||||
|
|
|
@ -919,7 +919,7 @@ gst_base_audio_encoder_sink_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
GstBaseAudioEncoder *enc;
|
GstBaseAudioEncoder *enc;
|
||||||
GstBaseAudioEncoderClass *klass;
|
GstBaseAudioEncoderClass *klass;
|
||||||
GstBaseAudioEncoderContext *ctx;
|
GstBaseAudioEncoderContext *ctx;
|
||||||
GstAudioState *state;
|
GstAudioFormatInfo *state;
|
||||||
gboolean res = TRUE, changed = FALSE;
|
gboolean res = TRUE, changed = FALSE;
|
||||||
|
|
||||||
enc = GST_BASE_AUDIO_ENCODER (GST_PAD_PARENT (pad));
|
enc = GST_BASE_AUDIO_ENCODER (GST_PAD_PARENT (pad));
|
||||||
|
|
|
@ -105,7 +105,7 @@ typedef struct _GstBaseAudioEncoderContext GstBaseAudioEncoderContext;
|
||||||
*/
|
*/
|
||||||
struct _GstBaseAudioEncoderContext {
|
struct _GstBaseAudioEncoderContext {
|
||||||
/* input */
|
/* input */
|
||||||
GstAudioState state;
|
GstAudioFormatInfo state;
|
||||||
|
|
||||||
/* output */
|
/* output */
|
||||||
gint frame_samples;
|
gint frame_samples;
|
||||||
|
@ -192,7 +192,7 @@ struct _GstBaseAudioEncoderClass {
|
||||||
gboolean (*stop) (GstBaseAudioEncoder *enc);
|
gboolean (*stop) (GstBaseAudioEncoder *enc);
|
||||||
|
|
||||||
gboolean (*set_format) (GstBaseAudioEncoder *enc,
|
gboolean (*set_format) (GstBaseAudioEncoder *enc,
|
||||||
GstAudioState *state);
|
GstAudioFormatInfo *info);
|
||||||
|
|
||||||
GstFlowReturn (*handle_frame) (GstBaseAudioEncoder *enc,
|
GstFlowReturn (*handle_frame) (GstBaseAudioEncoder *enc,
|
||||||
GstBuffer *buffer);
|
GstBuffer *buffer);
|
||||||
|
|
|
@ -37,7 +37,7 @@ G_STMT_START { \
|
||||||
/**
|
/**
|
||||||
* gst_base_audio_parse_caps:
|
* gst_base_audio_parse_caps:
|
||||||
* @caps: a #GstCaps
|
* @caps: a #GstCaps
|
||||||
* @state: a #GstAudioState
|
* @state: a #GstAudioFormatInfo
|
||||||
* @changed: whether @caps introduced a change in current @state
|
* @changed: whether @caps introduced a change in current @state
|
||||||
*
|
*
|
||||||
* Parses audio format as represented by @caps into a more concise form
|
* Parses audio format as represented by @caps into a more concise form
|
||||||
|
@ -47,7 +47,7 @@ G_STMT_START { \
|
||||||
* Returns: TRUE if parsing succeeded, otherwise FALSE
|
* Returns: TRUE if parsing succeeded, otherwise FALSE
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gst_base_audio_parse_caps (GstCaps * caps, GstAudioState * state,
|
gst_base_audio_parse_caps (GstCaps * caps, GstAudioFormatInfo * state,
|
||||||
gboolean * _changed)
|
gboolean * _changed)
|
||||||
{
|
{
|
||||||
gboolean res = TRUE, changed = FALSE;
|
gboolean res = TRUE, changed = FALSE;
|
||||||
|
@ -168,7 +168,7 @@ gst_base_audio_add_streamheader (GstCaps * caps, GstBuffer * buf, ...)
|
||||||
* @samples and @bytes (and @fmt).
|
* @samples and @bytes (and @fmt).
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gst_base_audio_encoded_audio_convert (GstAudioState * fmt,
|
gst_base_audio_encoded_audio_convert (GstAudioFormatInfo * fmt,
|
||||||
gint64 bytes, gint64 samples, GstFormat src_format,
|
gint64 bytes, gint64 samples, GstFormat src_format,
|
||||||
gint64 src_value, GstFormat * dest_format, gint64 * dest_value)
|
gint64 src_value, GstFormat * dest_format, gint64 * dest_value)
|
||||||
{
|
{
|
||||||
|
@ -236,8 +236,9 @@ exit:
|
||||||
* by @fmt.
|
* by @fmt.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gst_base_audio_raw_audio_convert (GstAudioState * fmt, GstFormat src_format,
|
gst_base_audio_raw_audio_convert (GstAudioFormatInfo * fmt,
|
||||||
gint64 src_value, GstFormat * dest_format, gint64 * dest_value)
|
GstFormat src_format, gint64 src_value,
|
||||||
|
GstFormat * dest_format, gint64 * dest_value)
|
||||||
{
|
{
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
guint scale = 1;
|
guint scale = 1;
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstAudioState:
|
* GstAudioFormatInfo:
|
||||||
* @is_int: whether sample data is int or float
|
* @is_int: whether sample data is int or float
|
||||||
* @rate: rate of sample data
|
* @rate: rate of sample data
|
||||||
* @channels: number of channels in sample data
|
* @channels: number of channels in sample data
|
||||||
|
@ -43,7 +43,7 @@ G_BEGIN_DECLS
|
||||||
* @endian: endianness of sample data
|
* @endian: endianness of sample data
|
||||||
* @bpf: bytes per audio frame
|
* @bpf: bytes per audio frame
|
||||||
*/
|
*/
|
||||||
typedef struct _GstAudioState {
|
typedef struct _GstAudioFormatInfo {
|
||||||
gboolean is_int;
|
gboolean is_int;
|
||||||
gint rate;
|
gint rate;
|
||||||
gint channels;
|
gint channels;
|
||||||
|
@ -54,18 +54,18 @@ typedef struct _GstAudioState {
|
||||||
GstAudioChannelPosition *channel_pos;
|
GstAudioChannelPosition *channel_pos;
|
||||||
|
|
||||||
gint bpf;
|
gint bpf;
|
||||||
} GstAudioState;
|
} GstAudioFormatInfo;
|
||||||
|
|
||||||
gboolean gst_base_audio_parse_caps (GstCaps * caps,
|
gboolean gst_base_audio_parse_caps (GstCaps * caps,
|
||||||
GstAudioState * state, gboolean * changed);
|
GstAudioFormatInfo * state, gboolean * changed);
|
||||||
|
|
||||||
GstCaps *gst_base_audio_add_streamheader (GstCaps * caps, GstBuffer * buf, ...);
|
GstCaps *gst_base_audio_add_streamheader (GstCaps * caps, GstBuffer * buf, ...);
|
||||||
|
|
||||||
gboolean gst_base_audio_encoded_audio_convert (GstAudioState * fmt,
|
gboolean gst_base_audio_encoded_audio_convert (GstAudioFormatInfo * fmt,
|
||||||
gint64 bytes, gint64 samples, GstFormat src_format,
|
gint64 bytes, gint64 samples, GstFormat src_format,
|
||||||
gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
|
gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
|
||||||
|
|
||||||
gboolean gst_base_audio_raw_audio_convert (GstAudioState * fmt, GstFormat src_format,
|
gboolean gst_base_audio_raw_audio_convert (GstAudioFormatInfo * fmt, GstFormat src_format,
|
||||||
gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
|
gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
Loading…
Reference in a new issue