VLC  4.0.0-dev
Modules | Files | Data Structures | Macros | Typedefs | Functions

Decoder. More...

Collaboration diagram for Decoder:

Modules

 Data blocks
 Blocks of binary data.
 
 Decoder
 Audio, video and text decoders.
 
 Decoder hardware device
 
 Demultiplexer
 Demultiplexers (file format parsers)
 
 ES output
 Elementary streams output.
 
 Media source
 
 Player
 VLC Player API.
 
 Stream
 Buffered input byte streams.
 
 Stream Extractor
 If a stream can be viewed as a directory, such as when opening a compressed archive, a stream-extractor is used to get access to the entities inside said stream.
 
 Timestamps, error-free
 These functions support generating timestamps without long term rounding errors due to sample rate conversions.
 

Files

file  vlc_input.h
 Input thread interface.
 

Data Structures

struct  seekpoint_t
 
struct  input_title_t
 
struct  input_attachment_t
 

Macros

#define INPUT_TITLE_MENU   0x01 /* Menu title */
 
#define INPUT_TITLE_INTERACTIVE   0x02 /* Interactive title. Playback position has no meaning. */
 
#define INPUT_RATE_MIN   0.03125f
 Input rate. More...
 
#define INPUT_RATE_MAX   31.25f
 Maximal rate value. More...
 

Typedefs

typedef struct input_resource_t input_resource_t
 This defines an opaque input resource handler. More...
 
typedef struct input_resource_t input_resource_t
 
typedef struct input_title_t input_title_t
 

Functions

decoder_tinput_DecoderCreate (vlc_object_t *, const es_format_t *, input_resource_t *)
 Spawn a decoder thread outside of the input thread. More...
 
void input_DecoderDelete (decoder_t *)
 Kills a decoder thread and waits until it's finished. More...
 
void input_DecoderDecode (decoder_t *, block_t *, bool b_do_pace)
 Put a block_t in the decoder's fifo. More...
 
void input_DecoderDrain (decoder_t *)
 Signals that there are no further blocks to decode, and requests that the decoder drain all pending buffers. More...
 
void input_DecoderFlush (decoder_t *)
 Requests that the decoder immediately discard all pending buffers. More...
 
int input_DecoderSetSpuHighlight (decoder_t *, const vlc_spu_highlight_t *)
 
input_resource_tinput_resource_New (vlc_object_t *)
 It creates an empty input resource handler. More...
 
void input_resource_Release (input_resource_t *)
 It releases an input resource. More...
 
audio_output_tinput_resource_HoldAout (input_resource_t *)
 
audio_output_tinput_resource_GetAout (input_resource_t *)
 This function creates or recycles an audio output. More...
 
void input_resource_PutAout (input_resource_t *, audio_output_t *)
 This function retains or destroys an audio output. More...
 
static seekpoint_tvlc_seekpoint_New (void)
 
static void vlc_seekpoint_Delete (seekpoint_t *point)
 
static seekpoint_tvlc_seekpoint_Duplicate (const seekpoint_t *src)
 
static input_title_tvlc_input_title_New (void)
 
static void vlc_input_title_Delete (input_title_t *t)
 
static input_title_tvlc_input_title_Duplicate (const input_title_t *t)
 
static void vlc_input_attachment_Delete (input_attachment_t *a)
 
static input_attachment_tvlc_input_attachment_New (const char *psz_name, const char *psz_mime, const char *psz_description, const void *p_data, size_t i_data)
 
static input_attachment_tvlc_input_attachment_Duplicate (const input_attachment_t *a)
 

Detailed Description

Decoder.

Input thread.

Macro Definition Documentation

◆ INPUT_RATE_MAX

#define INPUT_RATE_MAX   31.25f

Maximal rate value.

Referenced by Control().

◆ INPUT_RATE_MIN

#define INPUT_RATE_MIN   0.03125f

Input rate.

It is an float used by the variable "rate" in the range [INPUT_RATE_MIN, INPUT_RATE_MAX] the default value being 1.f. It represents the ratio of playback speed to nominal speed (bigger is faster). Minimal rate value

Referenced by Control().

◆ INPUT_TITLE_INTERACTIVE

#define INPUT_TITLE_INTERACTIVE   0x02 /* Interactive title. Playback position has no meaning. */

◆ INPUT_TITLE_MENU

#define INPUT_TITLE_MENU   0x01 /* Menu title */

Typedef Documentation

◆ input_resource_t [1/2]

This defines an opaque input resource handler.

◆ input_resource_t [2/2]

◆ input_title_t

typedef struct input_title_t input_title_t

Function Documentation

◆ input_DecoderCreate()

decoder_t* input_DecoderCreate ( vlc_object_t ,
const es_format_t ,
input_resource_t  
)

Spawn a decoder thread outside of the input thread.

References decoder_New().

◆ input_DecoderDecode()

void input_DecoderDecode ( decoder_t p_dec,
block_t p_block,
bool  b_do_pace 
)

Put a block_t in the decoder's fifo.

Thread-safe w.r.t. the decoder. May be a cancellation point.

Parameters
p_decthe decoder object
p_blockthe data block

References decoder_owner::b_waiting, block_ChainRelease(), BLOCK_FLAG_DISCONTINUITY, dec_get_owner(), block_t::i_flags, msg_Warn, decoder_owner::p_fifo, vlc_fifo_DequeueAllUnlocked(), vlc_fifo_GetBytes(), vlc_fifo_GetCount(), vlc_fifo_Lock(), vlc_fifo_QueueUnlocked(), vlc_fifo_Unlock(), vlc_fifo_WaitCond(), and decoder_owner::wait_fifo.

Referenced by EsOutSend().

◆ input_DecoderDelete()

void input_DecoderDelete ( decoder_t p_dec)

◆ input_DecoderDrain()

void input_DecoderDrain ( decoder_t p_dec)

Signals that there are no further blocks to decode, and requests that the decoder drain all pending buffers.

This is used to ensure that all intermediate buffers empty and no samples get lost at the end of the stream.

Note
The function does not actually wait for draining. It just signals that draining should be performed once the decoder has emptied FIFO.

References decoder_owner::b_draining, dec_get_owner(), decoder_owner::p_fifo, vlc_fifo_Lock(), vlc_fifo_Signal(), and vlc_fifo_Unlock().

Referenced by EsOutDrainCCChannels(), EsOutDrainDecoder(), and EsOutVaControlLocked().

◆ input_DecoderFlush()

void input_DecoderFlush ( decoder_t p_dec)

◆ input_DecoderSetSpuHighlight()

int input_DecoderSetSpuHighlight ( decoder_t ,
const vlc_spu_highlight_t  
)

◆ input_resource_GetAout()

audio_output_t* input_resource_GetAout ( input_resource_t )

◆ input_resource_HoldAout()

audio_output_t* input_resource_HoldAout ( input_resource_t )
Returns
the current audio output if any. Use aout_Release() to drop the reference.

References aout_Hold(), input_resource_t::lock_hold, input_resource_t::p_aout, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by ControlNav(), ViewpointApply(), and vlc_player_aout_Hold().

◆ input_resource_New()

input_resource_t* input_resource_New ( vlc_object_t )

It creates an empty input resource handler.

The given object MUST stay alive as long as the input_resource_t is not deleted.

References input_resource_t::lock, input_resource_t::lock_hold, input_resource_t::p_parent, input_resource_t::p_vout_dummy, input_resource_t::rc, vlc_atomic_rc_init(), vlc_mutex_init(), and vout_CreateDummy().

Referenced by Create(), and vlc_player_New().

◆ input_resource_PutAout()

void input_resource_PutAout ( input_resource_t ,
audio_output_t  
)

◆ input_resource_Release()

void input_resource_Release ( input_resource_t )

◆ vlc_input_attachment_Delete()

static void vlc_input_attachment_Delete ( input_attachment_t a)
inlinestatic

◆ vlc_input_attachment_Duplicate()

static input_attachment_t* vlc_input_attachment_Duplicate ( const input_attachment_t a)
inlinestatic

◆ vlc_input_attachment_New()

static input_attachment_t* vlc_input_attachment_New ( const char *  psz_name,
const char *  psz_mime,
const char *  psz_description,
const void *  p_data,
size_t  i_data 
)
inlinestatic

◆ vlc_input_title_Delete()

static void vlc_input_title_Delete ( input_title_t t)
inlinestatic

◆ vlc_input_title_Duplicate()

static input_title_t* vlc_input_title_Duplicate ( const input_title_t t)
inlinestatic

◆ vlc_input_title_New()

static input_title_t* vlc_input_title_New ( void  )
inlinestatic

◆ vlc_seekpoint_Delete()

static void vlc_seekpoint_Delete ( seekpoint_t point)
inlinestatic

References seekpoint_t::psz_name.

Referenced by vlc_input_title_Delete().

◆ vlc_seekpoint_Duplicate()

static seekpoint_t* vlc_seekpoint_Duplicate ( const seekpoint_t src)
inlinestatic

◆ vlc_seekpoint_New()

static seekpoint_t* vlc_seekpoint_New ( void  )
inlinestatic