MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Enumerations | Functions
dvb_audio.h File Reference

DVB Audio functions are required by MHEG5 engine. All required functions should be non-blocking. Functions with a post condition (synchronously returned values) MUST perform quickly, otherwise should copy passed data and return asynchronously through a asynchronous return path, where available. References: [1] UK DTG D-Book 7 A. [2] ISO/IEC 13818-1:2000 - Information technology – Generic coding of moving pictures and associated audio information: Systems [3] ISO/IEC 13818-6:1998 - Information technology – Generic coding of moving pictures and associated audio information – Part 6: Extensions for DSM-CC Notes: [a] Required functions may or may not use all of the allowed return values, depending on the error handling capabilities of the controlling application implementation. More...

#include "techtype.h"
#include "dvblocator.h"
#include "mherrors.h"

Go to the source code of this file.

Enumerations

enum  E_AudioSpeed { AUDIO_SPEED_PAUSE, AUDIO_SPEED_PLAY }
 
enum  E_AudioEncoding { AUDIO_ENC_MPEG2, AUDIO_ENC_HEAAC, AUDIO_ENC_E_AC3, AUDIO_ENC_MP3 }
 

Functions

E_MhegErr DVB_MhegAudioPlayDefault (void)
 MHEG5 engine gives control of Audio to external application. Set decoding and presentation of Audio according to the default user selection. More...
 
E_MhegErr DVB_MhegAudioStopStream (void)
 MHEG5 engine takes control of Audio - and specifies that decoding and presentation of any Audio stream must be stopped. More...
 
E_MhegErr DVB_MhegAudioPlayStream (S_DvbComponent *pDvbComponent)
 MHEG5 engine takes control of Audio - and informs that Audio must be switched to the specified Audio stream. This setting takes effect regardless of whether or not an audio stream is currently playing. If the currently playing stream is the same as the specified one, then the stream should continue playing without interruption. If the locator references a service component that is not currently being broadcast, the audio should be muted until the referenced component is being broadcast. More...
 
E_MhegErr DVB_MhegAudioPlayClip (U8BIT *pAudioData, U32BIT dataLength, U32BIT repeatCount, E_AudioEncoding encoding)
 Instruct the controlling application that the provided audio sound clip should be played. Playback from an audio stream and playback of an audio clip are mutually exclusive. If an audio clip is still playing due to a previous call to DVB_MhegPlayAudioClip(), the previous playback should be silently terminated without a call to DVB_MhegNotifyAudioPlayStopped. The audio data passed MUST be copied before use, as the caller retains exclusive ownership. The audio data can be discarded when either the playback of the last loop finishes, DVB_MhegPlayAudioClip() is invoked with a new audio clip or DVB_MhegAudioStopClip() is invoked. Each block of audio data is formatted as either: More...
 
E_MhegErr DVB_MhegAudioStopClip (void)
 Instruct the controlling application that playback of the previously supplied audio clip should be stopped. This should not generate a DVB_EVENT_SAMPLE_STOPPED event If no audio clip currently playing, the call should be silently ignored. More...
 
E_MhegErr DVB_MhegAudioSetSpeed (E_AudioSpeed speed)
 Instruct the controlling application that playback of the previously supplied audio clip should be paused or restarted. When there is no audio clip currently playing, it should be silently ignored. This MUST be a non-blocking function. More...
 
E_MhegErr DVB_MhegAudioSetVolume (S32BIT volumeAdjust)
 Adjust sound level for any external application sourced audio. A setting of 0 dB means leave the audio volume unchanged. A setting of greater than 0 dB may be approximated as 0 dB. A setting of less than 0 dB may be approximated as a mute. This affects playback of audio from stream and audio clips. More...
 
U8BIT DVB_MhegPrefAudioLangs (U32BIT *langs, U8BIT max)
 Get list of preferred audio languages. If there is no preference then zero is returned. This only writes into array up to 'max' items This MUST be a non-blocking function, returning results immediately. More...
 
BOOLEAN DVB_MhegAudioDescriptionPref (void)
 This function is used by the MHEG-5 engine to determine whether audio description is currently enabled. This may be used to allow a content provider to make available streams with and without audio description to avoid streaming unused data. This MUST be a non-blocking function. More...
 

Detailed Description

DVB Audio functions are required by MHEG5 engine. All required functions should be non-blocking. Functions with a post condition (synchronously returned values) MUST perform quickly, otherwise should copy passed data and return asynchronously through a asynchronous return path, where available. References: [1] UK DTG D-Book 7 A. [2] ISO/IEC 13818-1:2000 - Information technology – Generic coding of moving pictures and associated audio information: Systems [3] ISO/IEC 13818-6:1998 - Information technology – Generic coding of moving pictures and associated audio information – Part 6: Extensions for DSM-CC Notes: [a] Required functions may or may not use all of the allowed return values, depending on the error handling capabilities of the controlling application implementation.

Date
20/12/2012
Author
Adam Sturtridge

Function Documentation

BOOLEAN DVB_MhegAudioDescriptionPref ( void  )

This function is used by the MHEG-5 engine to determine whether audio description is currently enabled. This may be used to allow a content provider to make available streams with and without audio description to avoid streaming unused data. This MUST be a non-blocking function.

Returns
TRUE if the current viewer preferences is for the receiver to use the audio description soundtrack
E_MhegErr DVB_MhegAudioPlayClip ( U8BIT *  pAudioData,
U32BIT  dataLength,
U32BIT  repeatCount,
E_AudioEncoding  encoding 
)

Instruct the controlling application that the provided audio sound clip should be played. Playback from an audio stream and playback of an audio clip are mutually exclusive. If an audio clip is still playing due to a previous call to DVB_MhegPlayAudioClip(), the previous playback should be silently terminated without a call to DVB_MhegNotifyAudioPlayStopped. The audio data passed MUST be copied before use, as the caller retains exclusive ownership. The audio data can be discarded when either the playback of the last loop finishes, DVB_MhegPlayAudioClip() is invoked with a new audio clip or DVB_MhegAudioStopClip() is invoked. Each block of audio data is formatted as either:

  1. MPEG2 audio elementary stream, or
  2. HE-AAC audio elementary stream, or
  3. E-AC3 audio elementary stream The audio clip should be played a number of times, as indicated by the repeatCount parameter. Once playback of all loops has completed, the DVB_MhegNotifyAudioPlayStopped() function should be called. Playback can be aborted by a call to DVB_MhegAudioStopClip(). In this case, the DVB_MhegNotifyAudioPlayStopped() function will not be invoked. This MUST be a non-blocking function.
    Parameters
    pAudioDataAudio data to play.
    dataLengthLength of the audio data.
    repeatCountNumber of times to repeat play of audio data.
    encodingencoding - see E_AudioEncoding
    Returns
    - MHERR_OK on success

MHERR_OTHER controlling application specific error.

E_MhegErr DVB_MhegAudioPlayDefault ( void  )

MHEG5 engine gives control of Audio to external application. Set decoding and presentation of Audio according to the default user selection.

Returns
MHERR_OK - Success, MHERR_OTHER - failure
E_MhegErr DVB_MhegAudioPlayStream ( S_DvbComponent pDvbComponent)

MHEG5 engine takes control of Audio - and informs that Audio must be switched to the specified Audio stream. This setting takes effect regardless of whether or not an audio stream is currently playing. If the currently playing stream is the same as the specified one, then the stream should continue playing without interruption. If the locator references a service component that is not currently being broadcast, the audio should be muted until the referenced component is being broadcast.

Parameters
pDvbComponentpointer to specified component
Returns
MHERR_OK - Success, MHERR_OTHER - failure
E_MhegErr DVB_MhegAudioSetSpeed ( E_AudioSpeed  speed)

Instruct the controlling application that playback of the previously supplied audio clip should be paused or restarted. When there is no audio clip currently playing, it should be silently ignored. This MUST be a non-blocking function.

Parameters
speedThe new speed for audio. As speed can only be 0 or 1.
Returns
- MHERR_OK on success
  • MHERR_BAD_PARAMETER invalid parameter
  • MHERR_OTHER controlling application specific error.
E_MhegErr DVB_MhegAudioSetVolume ( S32BIT  volumeAdjust)

Adjust sound level for any external application sourced audio. A setting of 0 dB means leave the audio volume unchanged. A setting of greater than 0 dB may be approximated as 0 dB. A setting of less than 0 dB may be approximated as a mute. This affects playback of audio from stream and audio clips.

Parameters
volumeAdjustNew setting of the amount by which to adjust volume in dB
Returns
- MHERR_OK on success
  • MHERR_BAD_PARAMETER invalid parameter
  • MHERR_OTHER controlling application specific error.
E_MhegErr DVB_MhegAudioStopClip ( void  )

Instruct the controlling application that playback of the previously supplied audio clip should be stopped. This should not generate a DVB_EVENT_SAMPLE_STOPPED event If no audio clip currently playing, the call should be silently ignored.

Returns
- MHERR_OK on success
  • MHERR_OTHER controlling application specific error.
E_MhegErr DVB_MhegAudioStopStream ( void  )

MHEG5 engine takes control of Audio - and specifies that decoding and presentation of any Audio stream must be stopped.

Returns
MHERR_OK - Success, MHERR_OTHER - failure
U8BIT DVB_MhegPrefAudioLangs ( U32BIT *  langs,
U8BIT  max 
)

Get list of preferred audio languages. If there is no preference then zero is returned. This only writes into array up to 'max' items This MUST be a non-blocking function, returning results immediately.

Parameters
langsArray of ISO 639 language codes to be returned
maxmaximum number of preferred languages required by caller
Returns
U32BIT - number of actual language codes returned