MixAudioConfigParams

MixAudioConfigParams — MixAudio configuration parameters object.

Synopsis


#include <mixacp.h>

enum                MixACPOpAlign;
enum                MixACPBPSType;
enum                MixDecodeMode;
                    MixAudioConfigParams;
MixAudioConfigParams * mix_acp_new                      (void);
MixAudioConfigParams * mix_acp_ref                      (MixAudioConfigParams *mix);
#define             mix_acp_unref                       (obj)
#define             MIX_ACP_DECODEMODE                  (obj)
#define             MIX_ACP_NUM_CHANNELS                (obj)
#define             MIX_ACP_BITRATE                     (obj)
#define             MIX_ACP_SAMPLE_FREQ                 (obj)
MixDecodeMode       mix_acp_get_decodemode              (MixAudioConfigParams *obj);
MIX_RESULT          mix_acp_set_decodemode              (MixAudioConfigParams *obj,
                                                         MixDecodeMode mode);
gchar *             mix_acp_get_streamname              (MixAudioConfigParams *obj);
MIX_RESULT          mix_acp_set_streamname              (MixAudioConfigParams *obj,
                                                         const gchar *streamname);
MIX_RESULT          mix_acp_set_audio_manager           (MixAudioConfigParams *obj,
                                                         MixAudioManager am);
MixAudioManager     mix_acp_get_audio_manager           (MixAudioConfigParams *obj);
gboolean            mix_acp_is_streamname_valid         (MixAudioConfigParams *obj);
MixACPBPSType       mix_acp_get_bps                     (MixAudioConfigParams *obj);
MIX_RESULT          mix_acp_set_bps                     (MixAudioConfigParams *obj,
                                                         MixACPBPSType type);
MixACPOpAlign       mix_acp_get_op_align                (MixAudioConfigParams *obj);
MIX_RESULT          mix_acp_set_op_align                (MixAudioConfigParams *obj,
                                                         MixACPOpAlign op_align);

Description

MixAudio configuration parameters object which is used to communicate audio specific parameters.

This object is should not be instantiated as codec specific parameters are definied in individual derive classes.

Details

enum MixACPOpAlign

typedef enum {
  MIX_ACP_OUTPUT_ALIGN_UNKNOWN=-1,
  MIX_ACP_OUTPUT_ALIGN_16=0,
  MIX_ACP_OUTPUT_ALIGN_MSB,
  MIX_ACP_OUTPUT_ALIGN_LSB,
  MIX_ACP_OUTPUT_ALIGN_LAST
} MixACPOpAlign;

Audio Output alignment.

MIX_ACP_OUTPUT_ALIGN_UNKNOWN

Output alignment undefined.

MIX_ACP_OUTPUT_ALIGN_16

MIX_ACP_OUTPUT_ALIGN_MSB

Output word is MSB aligned

MIX_ACP_OUTPUT_ALIGN_LSB

Output word is LSB aligned

MIX_ACP_OUTPUT_ALIGN_LAST

Last entry in list.

enum MixACPBPSType

typedef enum {
  MIX_ACP_BPS_UNKNOWN=0,
  MIX_ACP_BPS_16=16,
  MIX_ACP_BPS_24=24,
} MixACPBPSType;

Audio Output Size in bits per sample.

MIX_ACP_BPS_UNKNOWN

Bit Per Sample undefined.

MIX_ACP_BPS_16

Output bits per sample is 16 bits

MIX_ACP_BPS_24

Output bits per sample is 24 bits

enum MixDecodeMode

typedef enum {
  MIX_DECODE_NULL=0,
  MIX_DECODE_DIRECTRENDER,
  MIX_DECODE_DECODERETURN,
  MIX_DECODE_LAST
} MixDecodeMode;

Operation Mode for a MI-X session. See mix_audio_configure().

MIX_DECODE_NULL

Undefined decode mode.

MIX_DECODE_DIRECTRENDER

Stream is configured in Direct Render mode

MIX_DECODE_DECODERETURN

Stream is configured in Decode Return mode

MIX_DECODE_LAST

Last index in the enumeration.

MixAudioConfigParams

typedef struct {
  MixParams parent;

  /* Audio Session Parameters */
  MixDecodeMode decode_mode;
  gchar *stream_name;
  MixAudioManager audio_manager;

  /* Audio Format Parameters */
  gint num_channels;
  gint bit_rate;
  gint sample_freq;
  MixACPBPSType bits_per_sample;
  MixACPOpAlign op_align;
} MixAudioConfigParams;

MixAudio configuration parameters object.

MixParams parent;

parent.

MixDecodeMode decode_mode;

Decode Mode to use for current session. See mix_acp_set_decodemode

gchar *stream_name;

Stream name. See mix_acp_set_streamname. This object will release the string upon destruction.

MixAudioManager audio_manager;

Type of Audio Manager. See mix_acp_set_audio_manager.

gint num_channels;

Number of output channels. See MIX_ACP_NUM_CHANNELS

gint bit_rate;

Optional. See MIX_ACP_BITRATE

gint sample_freq;

Output frequency. See MIX_ACP_SAMPLE_FREQ

MixACPBPSType bits_per_sample;

Number of output bit per sample. See mix_acp_set_bps

MixACPOpAlign op_align;

Output Byte Alignment. See mix_acp_set_op_align

mix_acp_new ()

MixAudioConfigParams * mix_acp_new                      (void);

Use this method to create new instance of MixAudioConfigParams

returns :

A newly allocated instance of MixAudioConfigParams

mix_acp_ref ()

MixAudioConfigParams * mix_acp_ref                      (MixAudioConfigParams *mix);

Add reference count.

mix :

object to add reference

returns :

the MixAudioConfigParams instance where reference count has been increased.

mix_acp_unref()

#define mix_acp_unref(obj) mix_params_unref(MIX_PARAMS(obj))

Decrement reference count of the object.

obj :

object to unref.

MIX_ACP_DECODEMODE()

#define MIX_ACP_DECODEMODE(obj) (MIX_AUDIOCONFIGPARAMS(obj)->decode_mode)

MixAudioConfigParam.decode_mode accessor.

Configure the decode mode to one of MixDecodeMode value.

obj :

MixAudioConfigParams object

MIX_ACP_NUM_CHANNELS()

#define MIX_ACP_NUM_CHANNELS(obj) (MIX_AUDIOCONFIGPARAMS(obj)->num_channels)

MixAudioConfigParam.num_channels accessor.

Configure the number of output channels. This value need to be exact the same as the supported output channel in the audio since down-mixing is not supported.

This value can be used during MIX_DECODE_DECODERETURN mode for buffer size/duration calculation.

In Moorestown, number of channel must be 1 or 2.

obj :

MixAudioConfigParams object

MIX_ACP_BITRATE()

#define MIX_ACP_BITRATE(obj) (MIX_AUDIOCONFIGPARAMS(obj)->bit_rate)

MixAudioConfigParam.bit_rate accessor.

Bit rate of the current audio.

Optional

obj :

MixAudioConfigParams object

MIX_ACP_SAMPLE_FREQ()

#define MIX_ACP_SAMPLE_FREQ(obj) (MIX_AUDIOCONFIGPARAMS(obj)->sample_freq)

MixAudioConfigParam.sample_freq accessor.

Output sampling frequency.

This value can be used during MIX_DECODE_DECODERETURN mode for buffer size/duration calculation.

obj :

MixAudioConfigParams object

mix_acp_get_decodemode ()

MixDecodeMode       mix_acp_get_decodemode              (MixAudioConfigParams *obj);

Retrieve currently configured MixDecodeMode.


mix_acp_set_decodemode ()

MIX_RESULT          mix_acp_set_decodemode              (MixAudioConfigParams *obj,
                                                         MixDecodeMode mode);

Configure session for one of the MixDecodeMode.

obj :

MixAudioConfigParams

mode :

MixDecodeMode to set

returns :

MIX_RESULT

mix_acp_get_streamname ()

gchar *             mix_acp_get_streamname              (MixAudioConfigParams *obj);

Return copy of streamname. caller must free with g_free()

obj :

MixAudioConfigParams

returns :

pointer to a copy of the stream name. NULL if name is not available.

mix_acp_set_streamname ()

MIX_RESULT          mix_acp_set_streamname              (MixAudioConfigParams *obj,
                                                         const gchar *streamname);

Set the stream name. The object will make a copy of the input stream name string.

obj :

MixAudioConfigParams

streamname :

Stream name to set

returns :

MIX_RESULT

mix_acp_set_audio_manager ()

MIX_RESULT          mix_acp_set_audio_manager           (MixAudioConfigParams *obj,
                                                         MixAudioManager am);

Set the Audio Manager to one of the MixAudioManager.

obj :

MixAudioConfigParams

am :

MixAudioManager

returns :

MIX_RESULT

mix_acp_get_audio_manager ()

MixAudioManager     mix_acp_get_audio_manager           (MixAudioConfigParams *obj);

Retrieve name of currently configured audio manager.


mix_acp_is_streamname_valid ()

gboolean            mix_acp_is_streamname_valid         (MixAudioConfigParams *obj);

Check if stream name is valid considering the current Decode Mode.

obj :

MixAudioConfigParams

returns :

boolean indicates if stream name is valid.

mix_acp_get_bps ()

MixACPBPSType       mix_acp_get_bps                     (MixAudioConfigParams *obj);

Retrive currently configured bit-per-stream value.


mix_acp_set_bps ()

MIX_RESULT          mix_acp_set_bps                     (MixAudioConfigParams *obj,
                                                         MixACPBPSType type);

Configure bit-per-stream of one of the supported MixACPBPSType.

obj :

MixAudioConfigParams

mode :

MixACPBPSType to set

returns :

MIX_RESULT

mix_acp_get_op_align ()

MixACPOpAlign       mix_acp_get_op_align                (MixAudioConfigParams *obj);

Get Output Alignment.

obj :

MixAudioConfigParams object

returns :

MixACPOpAlign

mix_acp_set_op_align ()

MIX_RESULT          mix_acp_set_op_align                (MixAudioConfigParams *obj,
                                                         MixACPOpAlign op_align);

Set Output Alignment to one of the MixACPOpAlign value.

obj :

MixAudioConfigParams object

op_align :

One of the supported MixACPOpAlign

returns :

MIX_RESULT