VLC  3.0.15
Data Structures | Typedefs
Decoder

Audio, video and text decoders. More...

Collaboration diagram for Decoder:

Data Structures

struct  decoder_t
 
struct  decoder_cc_desc_t
 

Typedefs

typedef struct decoder_owner_sys_t decoder_owner_sys_t
 
typedef struct decoder_cc_desc_t decoder_cc_desc_t
 
static int decoder_UpdateVideoFormat (decoder_t *dec)
 Updates the video output format. More...
 
static picture_tdecoder_NewPicture (decoder_t *dec)
 Allocates an output picture buffer. More...
 
void decoder_AbortPictures (decoder_t *dec, bool b_abort)
 Abort any calls of decoder_NewPicture. More...
 
static int decoder_QueueVideo (decoder_t *dec, picture_t *p_pic)
 This function queues a single picture to the video output. More...
 
static int decoder_QueueCc (decoder_t *dec, block_t *p_cc, const decoder_cc_desc_t *p_desc)
 This function queues the Closed Captions. More...
 
static int decoder_QueueAudio (decoder_t *dec, block_t *p_aout_buf)
 This function queues a single audio block to the audio output. More...
 
static int decoder_QueueSub (decoder_t *dec, subpicture_t *p_spu)
 This function queues a single subtitle to the video output. More...
 
static int decoder_UpdateAudioFormat (decoder_t *dec)
 This function notifies the audio output pipeline of a new audio output format (fmt_out.audio). More...
 
block_tdecoder_NewAudioBuffer (decoder_t *, int i_nb_samples)
 This function will return a new audio buffer usable by a decoder as an output buffer. More...
 
subpicture_tdecoder_NewSubpicture (decoder_t *, const subpicture_updater_t *)
 This function will return a new subpicture usable by a decoder as an output buffer. More...
 
int decoder_GetInputAttachments (decoder_t *, input_attachment_t ***ppp_attachment, int *pi_attachment)
 This function gives all input attachments at once. More...
 
mtime_t decoder_GetDisplayDate (decoder_t *, mtime_t)
 This function converts a decoder timestamp into a display date comparable to mdate(). More...
 
int decoder_GetDisplayRate (decoder_t *)
 This function returns the current input rate. More...
 

Detailed Description

Audio, video and text decoders.

Typedef Documentation

◆ decoder_cc_desc_t

◆ decoder_owner_sys_t

Function Documentation

◆ decoder_AbortPictures()

void decoder_AbortPictures ( decoder_t dec,
bool  b_abort 
)

Abort any calls of decoder_NewPicture.

If b_abort is true, all pending and futures calls of decoder_NewPicture will be aborted. This function can be used by asynchronous video decoders to unblock a thread that is waiting for a picture.

◆ decoder_GetDisplayDate()

mtime_t decoder_GetDisplayDate ( decoder_t ,
mtime_t   
)

This function converts a decoder timestamp into a display date comparable to mdate().

You MUST use it only for gathering statistics about speed.

References decoder_t::pf_get_display_date, and VLC_TS_INVALID.

◆ decoder_GetDisplayRate()

int decoder_GetDisplayRate ( decoder_t )

This function returns the current input rate.

You MUST use it only for gathering statistics about speed.

References INPUT_RATE_DEFAULT, and decoder_t::pf_get_display_rate.

◆ decoder_GetInputAttachments()

int decoder_GetInputAttachments ( decoder_t ,
input_attachment_t ***  ppp_attachment,
int *  pi_attachment 
)

This function gives all input attachments at once.

You MUST release the returned values

< Unspecified error

References decoder_t::pf_get_attachments, and VLC_EGENERIC.

◆ decoder_NewAudioBuffer()

block_t* decoder_NewAudioBuffer ( decoder_t ,
int  i_nb_samples 
)

This function will return a new audio buffer usable by a decoder as an output buffer.

It must be released with block_Release() or returned it to the caller as a decoder_QueueAudio parameter.

References es_format_t::audio, block_Alloc(), decoder_t::fmt_out, audio_format_t::i_bytes_per_frame, audio_format_t::i_frame_length, block_t::i_length, block_t::i_nb_samples, block_t::i_pts, and likely.

◆ decoder_NewPicture()

static picture_t* decoder_NewPicture ( decoder_t dec)
inlinestatic

Allocates an output picture buffer.

This function pulls an output picture buffer for the decoder from the buffer pool of the video output. The picture must be released with picture_Release() when it is no longer referenced by the decoder.

Note
This function is reentrant. However, decoder_UpdateVideoFormat() cannot be used concurrently; the caller is responsible for serialization.
Warning
The behaviour is undefined if decoder_UpdateVideoFormat() was not called or if the last call returned an error.
Returns
a picture buffer on success, NULL on error

References decoder_t::pf_vout_buffer_new.

◆ decoder_NewSubpicture()

subpicture_t* decoder_NewSubpicture ( decoder_t ,
const subpicture_updater_t  
)

This function will return a new subpicture usable by a decoder as an output buffer.

You have to release it using subpicture_Delete() or by returning it to the caller as a decoder_QueueSub parameter.

◆ decoder_QueueAudio()

static int decoder_QueueAudio ( decoder_t dec,
block_t p_aout_buf 
)
inlinestatic

This function queues a single audio block to the audio output.

Note
The caller doesn't own the audio block anymore after this call (even in case of error).
Returns
0 if the block is queued, -1 on error

References block_t::p_next, and decoder_t::pf_queue_audio.

◆ decoder_QueueCc()

static int decoder_QueueCc ( decoder_t dec,
block_t p_cc,
const decoder_cc_desc_t p_desc 
)
inlinestatic

This function queues the Closed Captions.

Parameters
decthe decoder object
p_ccthe closed-caption to queue
p_descdecoder_cc_desc_t description structure
Returns
0 if queued, -1 on error

References block_Release(), and decoder_t::pf_queue_cc.

◆ decoder_QueueSub()

static int decoder_QueueSub ( decoder_t dec,
subpicture_t p_spu 
)
inlinestatic

This function queues a single subtitle to the video output.

Note
The caller doesn't own the subtitle anymore after this call (even in case of error).
Returns
0 if the subtitle is queued, -1 on error

References subpicture_t::p_next, and decoder_t::pf_queue_sub.

◆ decoder_QueueVideo()

static int decoder_QueueVideo ( decoder_t dec,
picture_t p_pic 
)
inlinestatic

This function queues a single picture to the video output.

Note
The caller doesn't own the picture anymore after this call (even in case of error). FIXME: input_DecoderFrameNext won't work if a module use this function.
Returns
0 if the picture is queued, -1 on error

References picture_t::p_next, and decoder_t::pf_queue_video.

◆ decoder_UpdateAudioFormat()

static int decoder_UpdateAudioFormat ( decoder_t dec)
inlinestatic

This function notifies the audio output pipeline of a new audio output format (fmt_out.audio).

If there is currently no audio output or if the audio output format has changed, a new audio output will be set up.

Returns
0 if the audio output is working, -1 if not.

References AUDIO_ES, decoder_t::fmt_in, es_format_t::i_cat, and decoder_t::pf_aout_format_update.

◆ decoder_UpdateVideoFormat()

static int decoder_UpdateVideoFormat ( decoder_t dec)
inlinestatic

Updates the video output format.

This function notifies the video output pipeline of a new video output format (fmt_out.video). If there was no video output from the decoder so far or if the video output format has changed, a new video output will be set up. decoder_NewPicture() can then be used to allocate picture buffers.

If the format is unchanged, this function has no effects and returns zero.

Note
This function is not reentrant.
Returns
0 if the video output was set up successfully, -1 otherwise.

References decoder_t::fmt_in, es_format_t::i_cat, decoder_t::pf_vout_format_update, and VIDEO_ES.