AVBlocks for C++  2.1
Audio and Video Software Development Kit
AudioStreamInfo Class Referenceabstract

AudioStreamInfo describes an elementary audio stream. More...

Inheritance diagram for AudioStreamInfo:
StreamInfo Reference

Public Member Functions

virtual int32_t bitsPerSample () const =0
 Returns the number of bits per sample (sample resolution). More...
 
virtual int32_t bytesPerFrame () const =0
 Returns the number of bytes occupied by an audio frame (smallest discrete unit). More...
 
virtual int32_t channelLayout () const =0
 Returns the channel layout which defines the mapping between channels and speakers. More...
 
virtual int32_t channels () const =0
 Returns the number of audio channels. More...
 
virtual AudioStreamInfoclone () const =0
 Creates a copy of this object. More...
 
virtual bool_t copyTo (AudioStreamInfo *destination) const =0
 Copies the state of the current object to a destination object of the same type. More...
 
virtual int32_t pcmFlags () const =0
 Returns the audio format flags which describe various properties of the audio stream. More...
 
virtual int32_t sampleRate () const =0
 Returns the audio sample rate. More...
 
virtual bool_t setBitsPerSample (int32_t bitsPerSample)=0
 Sets the number of bits per sample (sample resolution). More...
 
virtual bool_t setBytesPerFrame (int32_t bytesPerFrame)=0
 Sets the number of bytes occupied by an audio frame (smallest discrete unit). More...
 
virtual bool_t setChannelLayout (int32_t channelLayout)=0
 Sets the channel layout which defines the mapping between channels and speakers. More...
 
virtual bool_t setChannels (int32_t numChannels)=0
 Sets the number of audio channels. More...
 
virtual bool_t setPcmFlags (int32_t flags)=0
 Sets the audio format flags which describe various properties of the audio stream. More...
 
virtual bool_t setSampleRate (int32_t sampleRate)=0
 Sets the audio sample rate. More...
 
- Public Member Functions inherited from StreamInfo
virtual int32_t bitrate () const =0
 Returns the stream bitrate. More...
 
virtual int32_t bitrateMode () const =0
 Returns the stream bitrate mode. More...
 
virtual bool_t copyTo (StreamInfo *destination) const =0
 Copies the state of the current object to a destination object of the same type. More...
 
virtual double duration () const =0
 Returns the stream duration. More...
 
virtual int32_t ID () const =0
 Returns the ID of the elementary stream. More...
 
virtual bool_t immutable () const =0
 Returns whether the object is immutable. More...
 
virtual MediaType::Enum mediaType () const =0
 Returns the stream media type. More...
 
virtual int32_t programNumber () const =0
 Returns the number of the program to which the elementary stream belongs. More...
 
virtual bool_t reset ()=0
 Resets the stream information to its default state. More...
 
virtual bool_t setBitrate (int32_t bitrate)=0
 Sets the stream bitrate. More...
 
virtual bool_t setBitrateMode (int32_t bitrateMode)=0
 Sets the stream bitrate mode. More...
 
virtual bool_t setDuration (double duration)=0
 Sets the stream duration in seconds. More...
 
virtual bool_t setID (int32_t id)=0
 Sets the ID of the elementary stream. More...
 
virtual bool_t setProgramNumber (int32_t programNumber)=0
 Sets the program to which the elementary stream belongs. More...
 
virtual bool_t setStreamSubType (StreamSubType::Enum type)=0
 Sets the stream subtype. More...
 
virtual bool_t setStreamType (StreamType::Enum type)=0
 Sets the stream type. More...
 
virtual StreamSubType::Enum streamSubType () const =0
 Returns the stream subtype. More...
 
virtual StreamType::Enum streamType () const =0
 Returns the stream type. More...
 
- Public Member Functions inherited from Reference
virtual int32_t release () const =0
 Releases the instance. More...
 
virtual int32_t retain () const =0
 Retains the instance. More...
 
virtual int32_t retainCount () const =0
 Returns the current reference count. More...
 

Protected Member Functions

 ~AudioStreamInfo ()
 This object can be destroyed only by its implementation. More...
 
- Protected Member Functions inherited from StreamInfo
 ~StreamInfo ()
 This object can be destroyed only by its implementation. More...
 

Detailed Description

AudioStreamInfo describes an elementary audio stream.

Constructor & Destructor Documentation

~AudioStreamInfo ( )
protected

This object can be destroyed only by its implementation.

The caller must use Reference::release.

See Also
Object Management

Member Function Documentation

virtual int32_t bitsPerSample ( ) const
pure virtual

Returns the number of bits per sample (sample resolution).

Returns
bits per sample (usually 8, 16, 24 or 32).

Normally bits per sample is not defined for a compressed audio stream and is 0. However it is possible for a compressed audio stream to return a positive value as an indication of audio quality. It can also designate the bits per sample of the LPCM stream once the compressed stream is decoded.

virtual int32_t bytesPerFrame ( ) const
pure virtual

Returns the number of bytes occupied by an audio frame (smallest discrete unit).

Returns
bytes per frame.

A frame is the smallest unit in an audio stream. It may contain one or more samples. Depending on the audio stream type the frame may contain fixed or variable number of samples.

For compressed streams the frame size is variable even if there are fixed number of samples in each frame. In this case bytes per frame is 0.

For an LCPM stream the frame size is constant. In this case bytes per frame is a positive value. Normally for interleaved LPCM streams the following is true:

Returns
TRUE if bytes per sample is successfully set, otherwise FALSE.
virtual int32_t channelLayout ( ) const
pure virtual

Returns the channel layout which defines the mapping between channels and speakers.

Returns
A combination of flags defined in the AudioChannelFlags::Enum.
virtual int32_t channels ( ) const
pure virtual

Returns the number of audio channels.

Returns
Number of channels.
virtual AudioStreamInfo* clone ( ) const
pure virtual

Creates a copy of this object.

Returns
A new AudioStreamInfo. The caller is responsible for releasing the new object when it is not needed anymore.
See Also
Object Management

Implements StreamInfo.

virtual bool_t copyTo ( AudioStreamInfo destination) const
pure virtual

Copies the state of the current object to a destination object of the same type.

The reference count of the source and the destination is not modified.

Parameters
destination[out] A pointer to the destination object
Returns
TRUE if the object state is copied, FALSE otherwise.
virtual int32_t pcmFlags ( ) const
pure virtual

Returns the audio format flags which describe various properties of the audio stream.

Returns
A combination of flags defined in PcmFlags::Enum.
virtual int32_t sampleRate ( ) const
pure virtual

Returns the audio sample rate.

Returns
sample rate (Hz)
virtual bool_t setBitsPerSample ( int32_t  bitsPerSample)
pure virtual

Sets the number of bits per sample (sample resolution).

Parameters
bitsPerSample(usually 8, 16, 24 or 32)
Returns
TRUE if the number of bits per sample is successfully set, otherwise FALSE.
virtual bool_t setBytesPerFrame ( int32_t  bytesPerFrame)
pure virtual

Sets the number of bytes occupied by an audio frame (smallest discrete unit).

Parameters
bytesPerFrame[in] Specifies how many bytes are occupied by each audio frame. Normally it is valid (greater than 0) for LPCM streams and invalid (0) for compressed audio streams.
Returns
TRUE if the number of bytes per frame is successfully set, otherwise FALSE.
virtual bool_t setChannelLayout ( int32_t  channelLayout)
pure virtual

Sets the channel layout which defines the mapping between channels and speakers.

Parameters
channelLayoutA combination of flags defined in the AudioChannelFlags::Enum.
Returns
TRUE if the channel layout is successfully set, otherwise FALSE.
virtual bool_t setChannels ( int32_t  numChannels)
pure virtual

Sets the number of audio channels.

Parameters
numChannelsnumber of channels.
Returns
TRUE if the number of channels is successfully set, otherwise FALSE.
virtual bool_t setPcmFlags ( int32_t  flags)
pure virtual

Sets the audio format flags which describe various properties of the audio stream.

Parameters
flagsA combination of flags defined in PcmFlags::Enum.
Returns
TRUE if the flags are successfully set, otherwise FALSE.
virtual bool_t setSampleRate ( int32_t  sampleRate)
pure virtual

Sets the audio sample rate.

Parameters
sampleRatesample rate (Hz)
Returns
TRUE if the sample rate is successfully set, otherwise FALSE.