DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
Functions
audio.c File Reference

DVB Interface for MHEG5 engine - Audio. More...

#include <stdio.h>
#include <techtype.h>
#include <dbgfuncs.h>
#include "stberc.h"
#include "stbhwav.h"
#include "stbdpc.h"
#include "ap_dbacc.h"
#include "ap_cntrl.h"
#include "app.h"
#include "ap_cfg.h"
#include "ap_uiinfo.h"
#include "dvbmh_int.h"
#include "dvb_audio.h"

Functions

void DVBMH_PlayAudio (U8BIT path, U16BIT audio_pid, E_STB_DP_AUDIO_CODEC codec, U16BIT ad_pid)
 
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_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 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_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_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_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...
 
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...
 
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 Interface for MHEG5 engine - Audio.

Date
Janauary 2014
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 locator references a service component that is not currently being broadcast, the audio should be muted until the referenced component is being broadcast.

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