VLC  4.0.0-dev
Data Structures | Macros | Enumerations | Functions | Variables
decoder.c File Reference
Include dependency graph for decoder.c:

Data Structures

struct  vlc_input_decoder_t
 

Macros

#define PREROLL_NONE   INT64_MIN
 
#define PREROLL_FORCED   INT64_MAX
 
#define MAX_CC_DECODERS   64 /* The es_out only creates one type of es */
 
#define DECODER_BOGUS_VIDEO_DELAY   ((vlc_tick_t)(DEFAULT_PTS_DELAY * 30))
 
#define DECODER_SPU_VOUT_WAIT_DURATION   VLC_TICK_FROM_MS(200)
 
#define BLOCK_FLAG_CORE_PRIVATE_RELOADED   (1 << BLOCK_FLAG_CORE_PRIVATE_SHIFT)
 
#define decoder_Notify(decoder_priv, event, ...)
 

Enumerations

enum  reload { RELOAD_NO_REQUEST, RELOAD_DECODER, RELOAD_DECODER_AOUT }
 

Functions

static vlc_input_decoder_t * dec_get_owner (decoder_t *p_dec)
 
static int LoadDecoder (decoder_t *p_dec, bool b_packetizer, const es_format_t *restrict p_fmt)
 Load a decoder module. More...
 
static int DecoderThread_Reload (vlc_input_decoder_t *p_owner, const es_format_t *restrict p_fmt, enum reload reload)
 
static void DecoderUpdateFormatLocked (vlc_input_decoder_t *p_owner)
 
static void MouseEvent (const vlc_mouse_t *newmouse, void *user_data)
 
static bool aout_replaygain_changed (const audio_replay_gain_t *a, const audio_replay_gain_t *b)
 
static int ModuleThread_UpdateAudioFormat (decoder_t *p_dec)
 
static int CreateVoutIfNeeded (vlc_input_decoder_t *, vout_thread_t **, enum vlc_vout_order *, vlc_decoder_device **)
 
static int ModuleThread_UpdateVideoFormat (decoder_t *p_dec, vlc_video_context *vctx)
 
static vlc_decoder_device * ModuleThread_GetDecoderDevice (decoder_t *p_dec)
 
static picture_t * ModuleThread_NewVideoBuffer (decoder_t *p_dec)
 
static subpicture_t * ModuleThread_NewSpuBuffer (decoder_t *p_dec, const subpicture_updater_t *p_updater)
 
static int InputThread_GetInputAttachments (decoder_t *p_dec, input_attachment_t ***ppp_attachment, int *pi_attachment)
 
static vlc_tick_t ModuleThread_GetDisplayDate (decoder_t *p_dec, vlc_tick_t system_now, vlc_tick_t i_ts)
 
static float ModuleThread_GetDisplayRate (decoder_t *p_dec)
 
block_t * decoder_NewAudioBuffer (decoder_t *dec, int samples)
 This function will return a new audio buffer usable by a decoder as an output buffer. More...
 
static void RequestReload (vlc_input_decoder_t *p_owner)
 
static void DecoderThread_AbortPictures (decoder_t *p_dec, bool b_abort)
 
static void DecoderWaitUnblock (vlc_input_decoder_t *p_owner)
 
static void DecoderUpdatePreroll (vlc_tick_t *pi_preroll, const block_t *p)
 
static void DecoderPlayCc (vlc_input_decoder_t *p_owner, block_t *p_cc, const decoder_cc_desc_t *p_desc)
 
static void PacketizerGetCc (vlc_input_decoder_t *p_owner, decoder_t *p_dec_cc)
 
static void ModuleThread_QueueCc (decoder_t *p_videodec, block_t *p_cc, const decoder_cc_desc_t *p_desc)
 
static int ModuleThread_PlayVideo (vlc_input_decoder_t *p_owner, picture_t *p_picture)
 
static void ModuleThread_UpdateStatVideo (vlc_input_decoder_t *p_owner, bool lost)
 
static void ModuleThread_QueueVideo (decoder_t *p_dec, picture_t *p_pic)
 
static vlc_decoder_device * thumbnailer_get_device (decoder_t *p_dec)
 
static picture_t * thumbnailer_buffer_new (decoder_t *p_dec)
 
static void ModuleThread_QueueThumbnail (decoder_t *p_dec, picture_t *p_pic)
 
static int ModuleThread_PlayAudio (vlc_input_decoder_t *p_owner, block_t *p_audio)
 
static void ModuleThread_UpdateStatAudio (vlc_input_decoder_t *p_owner, bool lost)
 
static void ModuleThread_QueueAudio (decoder_t *p_dec, block_t *p_aout_buf)
 
static void ModuleThread_PlaySpu (vlc_input_decoder_t *p_owner, subpicture_t *p_subpic)
 
static void ModuleThread_QueueSpu (decoder_t *p_dec, subpicture_t *p_spu)
 
static void DecoderThread_ProcessInput (vlc_input_decoder_t *p_owner, block_t *p_block)
 Decode a block. More...
 
static void DecoderThread_DecodeBlock (vlc_input_decoder_t *p_owner, block_t *p_block)
 
static void DecoderThread_Flush (vlc_input_decoder_t *p_owner)
 
static void DecoderThread_ChangePause (vlc_input_decoder_t *p_owner, bool paused, vlc_tick_t date)
 
static void DecoderThread_ChangeRate (vlc_input_decoder_t *p_owner, float rate)
 
static void DecoderThread_ChangeDelay (vlc_input_decoder_t *p_owner, vlc_tick_t delay)
 
static void * DecoderThread (void *p_data)
 The decoding main loop. More...
 
static vlc_input_decoder_t * CreateDecoder (vlc_object_t *p_parent, const es_format_t *fmt, vlc_clock_t *p_clock, input_resource_t *p_resource, sout_instance_t *p_sout, bool b_thumbnailing, const struct vlc_input_decoder_callbacks *cbs, void *cbs_userdata)
 Create a decoder object. More...
 
static void DeleteDecoder (vlc_input_decoder_t *p_owner)
 Destroys a decoder object. More...
 
static void DecoderUnsupportedCodec (decoder_t *p_dec, const es_format_t *fmt, bool b_decoding)
 
static vlc_input_decoder_t * decoder_New (vlc_object_t *p_parent, const es_format_t *fmt, vlc_clock_t *p_clock, input_resource_t *p_resource, sout_instance_t *p_sout, bool thumbnailing, const struct vlc_input_decoder_callbacks *cbs, void *userdata)
 
vlc_input_decoder_t * vlc_input_decoder_New (vlc_object_t *parent, es_format_t *fmt, vlc_clock_t *p_clock, input_resource_t *resource, sout_instance_t *p_sout, bool thumbnailing, const struct vlc_input_decoder_callbacks *cbs, void *cbs_userdata)
 Spawns a new decoder thread from the input thread. More...
 
vlc_input_decoder_t * vlc_input_decoder_Create (vlc_object_t *p_parent, const es_format_t *fmt, input_resource_t *p_resource)
 Spawn a decoder thread outside of the input thread. More...
 
void vlc_input_decoder_Delete (vlc_input_decoder_t *p_owner)
 Kills a decoder thread and waits until it's finished. More...
 
void vlc_input_decoder_Decode (vlc_input_decoder_t *p_owner, block_t *p_block, bool b_do_pace)
 Put a block_t in the decoder's fifo. More...
 
bool vlc_input_decoder_IsEmpty (vlc_input_decoder_t *p_owner)
 This function returns true if the decoder fifo is empty and false otherwise. More...
 
void vlc_input_decoder_Drain (vlc_input_decoder_t *p_owner)
 Signals that there are no further blocks to decode, and requests that the decoder drain all pending buffers. More...
 
void vlc_input_decoder_Flush (vlc_input_decoder_t *p_owner)
 Requests that the decoder immediately discard all pending buffers. More...
 
void vlc_input_decoder_GetCcDesc (vlc_input_decoder_t *p_owner, decoder_cc_desc_t *p_desc)
 This function get cc channels descriptions. More...
 
static bool vlc_input_decoder_HasCCChanFlag (vlc_input_decoder_t *p_owner, vlc_fourcc_t codec, int i_channel)
 
int vlc_input_decoder_SetCcState (vlc_input_decoder_t *p_owner, vlc_fourcc_t codec, int i_channel, bool b_decode)
 This function activates the request closed caption channel. More...
 
int vlc_input_decoder_GetCcState (vlc_input_decoder_t *p_owner, vlc_fourcc_t codec, int i_channel, bool *pb_decode)
 This function returns an error if the requested channel does not exist and set pb_decode to the channel status(active or not) otherwise. More...
 
void vlc_input_decoder_ChangePause (vlc_input_decoder_t *p_owner, bool b_paused, vlc_tick_t i_date)
 This function changes the pause state. More...
 
void vlc_input_decoder_ChangeRate (vlc_input_decoder_t *owner, float rate)
 Changes the decoder rate. More...
 
void vlc_input_decoder_ChangeDelay (vlc_input_decoder_t *owner, vlc_tick_t delay)
 This function changes the delay. More...
 
void vlc_input_decoder_StartWait (vlc_input_decoder_t *p_owner)
 This function makes the decoder start waiting for a valid data block from its fifo. More...
 
void vlc_input_decoder_StopWait (vlc_input_decoder_t *p_owner)
 This function exits the waiting mode of the decoder. More...
 
void vlc_input_decoder_Wait (vlc_input_decoder_t *p_owner)
 This function waits for the decoder to actually receive data. More...
 
void vlc_input_decoder_FrameNext (vlc_input_decoder_t *p_owner, vlc_tick_t *pi_duration)
 This function force the display of the next picture and fills the stream time consumed. More...
 
bool vlc_input_decoder_HasFormatChanged (vlc_input_decoder_t *p_owner, es_format_t *p_fmt, vlc_meta_t **pp_meta)
 This function will return true if the ES format or meta data have changed since the last call. More...
 
size_t vlc_input_decoder_GetFifoSize (vlc_input_decoder_t *p_owner)
 This function returns the current size in bytes of the decoder fifo. More...
 
static bool DecoderHasVbi (decoder_t *dec)
 
int vlc_input_decoder_GetVbiPage (vlc_input_decoder_t *owner, bool *opaque)
 
int vlc_input_decoder_SetVbiPage (vlc_input_decoder_t *owner, unsigned page)
 
int vlc_input_decoder_SetVbiOpaque (vlc_input_decoder_t *owner, bool opaque)
 
void vlc_input_decoder_SetVoutMouseEvent (vlc_input_decoder_t *owner, vlc_mouse_event mouse_event, void *user_data)
 
int vlc_input_decoder_AddVoutOverlay (vlc_input_decoder_t *owner, subpicture_t *sub, size_t *channel)
 
int vlc_input_decoder_DelVoutOverlay (vlc_input_decoder_t *owner, size_t channel)
 
int vlc_input_decoder_SetSpuHighlight (vlc_input_decoder_t *p_owner, const vlc_spu_highlight_t *spu_hl)
 

Variables

static const struct decoder_owner_callbacks dec_video_cbs
 
static const struct decoder_owner_callbacks dec_thumbnailer_cbs
 
static const struct decoder_owner_callbacks dec_audio_cbs
 
static const struct decoder_owner_callbacks dec_spu_cbs
 

Macro Definition Documentation

◆ BLOCK_FLAG_CORE_PRIVATE_RELOADED

#define BLOCK_FLAG_CORE_PRIVATE_RELOADED   (1 << BLOCK_FLAG_CORE_PRIVATE_SHIFT)

◆ DECODER_BOGUS_VIDEO_DELAY

#define DECODER_BOGUS_VIDEO_DELAY   ((vlc_tick_t)(DEFAULT_PTS_DELAY * 30))

◆ decoder_Notify

#define decoder_Notify (   decoder_priv,
  event,
  ... 
)
Value:
if (decoder_priv->cbs && decoder_priv->cbs->event) \
decoder_priv->cbs->event(decoder_priv, __VA_ARGS__, \
decoder_priv->cbs_userdata);

Referenced by DeleteDecoder(), ModuleThread_NewSpuBuffer(), ModuleThread_QueueThumbnail(), ModuleThread_UpdateStatAudio(), ModuleThread_UpdateStatVideo(), and ModuleThread_UpdateVideoFormat().

◆ DECODER_SPU_VOUT_WAIT_DURATION

#define DECODER_SPU_VOUT_WAIT_DURATION   VLC_TICK_FROM_MS(200)

◆ MAX_CC_DECODERS

#define MAX_CC_DECODERS   64 /* The es_out only creates one type of es */

◆ PREROLL_FORCED

#define PREROLL_FORCED   INT64_MAX

Referenced by DecoderUpdatePreroll().

◆ PREROLL_NONE

#define PREROLL_NONE   INT64_MIN

Enumeration Type Documentation

◆ reload

enum reload
Enumerator
RELOAD_NO_REQUEST 
RELOAD_DECODER 
RELOAD_DECODER_AOUT 

Function Documentation

◆ aout_replaygain_changed()

static bool aout_replaygain_changed ( const audio_replay_gain_t *  a,
const audio_replay_gain_t *  b 
)
static

◆ CreateDecoder()

static vlc_input_decoder_t* CreateDecoder ( vlc_object_t *  p_parent,
const es_format_t *  fmt,
vlc_clock_t *  p_clock,
input_resource_t *  p_resource,
sout_instance_t *  p_sout,
bool  b_thumbnailing,
const struct vlc_input_decoder_callbacks *  cbs,
void *  cbs_userdata 
)
static

Create a decoder object.

Parameters
p_inputthe input thread
p_esthe es descriptor
b_packetizerinstead of a decoder
Returns
the decoder object

References AUDIO_ES, es_format_t::audio_replay_gain, AUDIO_REPLAY_GAIN_MAX, vlc_input_decoder_t::b_draining, vlc_input_decoder_t::b_first, vlc_input_decoder_t::b_fmt_description, vlc_input_decoder_t::b_has_data, vlc_input_decoder_t::b_idle, es_format_t::b_packetized, vlc_input_decoder_t::b_sout_created, vlc_input_decoder_t::b_supported, vlc_input_decoder_t::b_waiting, block_FifoNew(), vlc_input_decoder_t::cbs, decoder_t::cbs, vlc_input_decoder_t::cbs_userdata, vlc_input_decoder_t::cc, vlc_input_decoder_t::dec, dec_audio_cbs, dec_spu_cbs, dec_thumbnailer_cbs, dec_video_cbs, vlc_input_decoder_t::delay, vlc_input_decoder_t::desc, vlc_input_decoder_t::drained, vlc_input_decoder_t::error, es_format_Init(), vlc_input_decoder_t::flushing, vlc_input_decoder_t::fmt, decoder_t::fmt_in, decoder_t::fmt_out, vlc_input_decoder_t::frames_countdown, decoder_cc_desc_t::i_608_channels, decoder_cc_desc_t::i_708_channels, es_format_t::i_cat, vlc_input_decoder_t::i_preroll_end, vlc_input_decoder_t::i_spu_channel, vlc_input_decoder_t::i_spu_order, LoadDecoder(), vlc_input_decoder_t::lock, MAX_CC_DECODERS, vlc_input_decoder_t::mouse_event, vlc_input_decoder_t::mouse_lock, vlc_input_decoder_t::mouse_opaque, msg_Err, vlc_input_decoder_t::output_rate, vlc_input_decoder_t::p_aout, vlc_input_decoder_t::p_clock, vlc_input_decoder_t::p_description, vlc_input_decoder_t::p_fifo, vlc_input_decoder_t::p_packetizer, vlc_input_decoder_t::p_resource, vlc_input_decoder_t::p_sout, vlc_input_decoder_t::p_sout_input, vlc_input_decoder_t::p_vout, vlc_input_decoder_t::pause_date, vlc_input_decoder_t::paused, audio_replay_gain_t::pb_gain, audio_replay_gain_t::pb_peak, audio_replay_gain_t::pf_gain, audio_replay_gain_t::pf_peak, vlc_input_decoder_t::pp_decoder, PREROLL_NONE, vlc_input_decoder_t::reload, RELOAD_NO_REQUEST, vlc_input_decoder_t::request_rate, vlc_input_decoder_t::reset_out_state, SPU_ES, static_assert, unlikely, VIDEO_ES, vlc_cond_init(), vlc_custom_create, vlc_mutex_init(), vlc_object_delete, VLC_TICK_INVALID, VOUT_SPU_CHANNEL_INVALID, vlc_input_decoder_t::vout_thread_started, vlc_input_decoder_t::wait_acknowledge, vlc_input_decoder_t::wait_fifo, and vlc_input_decoder_t::wait_request.

Referenced by decoder_New().

◆ CreateVoutIfNeeded()

static int CreateVoutIfNeeded ( vlc_input_decoder_t *  p_owner,
vout_thread_t **  pp_vout,
enum vlc_vout_order *  order,
vlc_decoder_device **  pp_dec_dev 
)
static

◆ dec_get_owner()

static vlc_input_decoder_t* dec_get_owner ( decoder_t *  p_dec)
inlinestatic

◆ decoder_New()

static vlc_input_decoder_t* decoder_New ( vlc_object_t *  p_parent,
const es_format_t *  fmt,
vlc_clock_t *  p_clock,
input_resource_t *  p_resource,
sout_instance_t *  p_sout,
bool  thumbnailing,
const struct vlc_input_decoder_callbacks *  cbs,
void *  userdata 
)
static

◆ 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.

Referenced by decoder_UpdateAudioFormat().

◆ DecoderHasVbi()

static bool DecoderHasVbi ( decoder_t *  dec)
static

◆ DecoderPlayCc()

static void DecoderPlayCc ( vlc_input_decoder_t *  p_owner,
block_t *  p_cc,
const decoder_cc_desc_t *  p_desc 
)
static

◆ DecoderThread()

static void* DecoderThread ( void *  p_data)
static

◆ DecoderThread_AbortPictures()

static void DecoderThread_AbortPictures ( decoder_t *  p_dec,
bool  b_abort 
)
static

◆ DecoderThread_ChangeDelay()

static void DecoderThread_ChangeDelay ( vlc_input_decoder_t *  p_owner,
vlc_tick_t  delay 
)
static

◆ DecoderThread_ChangePause()

static void DecoderThread_ChangePause ( vlc_input_decoder_t *  p_owner,
bool  paused,
vlc_tick_t  date 
)
static

◆ DecoderThread_ChangeRate()

static void DecoderThread_ChangeRate ( vlc_input_decoder_t *  p_owner,
float  rate 
)
static

◆ DecoderThread_DecodeBlock()

static void DecoderThread_DecodeBlock ( vlc_input_decoder_t *  p_owner,
block_t *  p_block 
)
static

◆ DecoderThread_Flush()

static void DecoderThread_Flush ( vlc_input_decoder_t *  p_owner)
static

◆ DecoderThread_ProcessInput()

static void DecoderThread_ProcessInput ( vlc_input_decoder_t *  p_owner,
block_t *  p_block 
)
static

◆ DecoderThread_Reload()

static int DecoderThread_Reload ( vlc_input_decoder_t *  p_owner,
const es_format_t *restrict  p_fmt,
enum reload  reload 
)
static

◆ DecoderUnsupportedCodec()

static void DecoderUnsupportedCodec ( decoder_t *  p_dec,
const es_format_t *  fmt,
bool  b_decoding 
)
static

◆ DecoderUpdateFormatLocked()

static void DecoderUpdateFormatLocked ( vlc_input_decoder_t *  p_owner)
static

◆ DecoderUpdatePreroll()

static void DecoderUpdatePreroll ( vlc_tick_t *  pi_preroll,
const block_t *  p 
)
inlinestatic

◆ DecoderWaitUnblock()

static void DecoderWaitUnblock ( vlc_input_decoder_t *  p_owner)
static

◆ DeleteDecoder()

static void DeleteDecoder ( vlc_input_decoder_t *  p_owner)
static

◆ InputThread_GetInputAttachments()

static int InputThread_GetInputAttachments ( decoder_t *  p_dec,
input_attachment_t ***  ppp_attachment,
int *  pi_attachment 
)
static

◆ LoadDecoder()

static int LoadDecoder ( decoder_t *  p_dec,
bool  b_packetizer,
const es_format_t *restrict  p_fmt 
)
static

◆ ModuleThread_GetDecoderDevice()

static vlc_decoder_device* ModuleThread_GetDecoderDevice ( decoder_t *  p_dec)
static

◆ ModuleThread_GetDisplayDate()

static vlc_tick_t ModuleThread_GetDisplayDate ( decoder_t *  p_dec,
vlc_tick_t  system_now,
vlc_tick_t  i_ts 
)
static

◆ ModuleThread_GetDisplayRate()

static float ModuleThread_GetDisplayRate ( decoder_t *  p_dec)
static

◆ ModuleThread_NewSpuBuffer()

static subpicture_t* ModuleThread_NewSpuBuffer ( decoder_t *  p_dec,
const subpicture_updater_t *  p_updater 
)
static

◆ ModuleThread_NewVideoBuffer()

static picture_t* ModuleThread_NewVideoBuffer ( decoder_t *  p_dec)
static

◆ ModuleThread_PlayAudio()

static int ModuleThread_PlayAudio ( vlc_input_decoder_t *  p_owner,
block_t *  p_audio 
)
static

◆ ModuleThread_PlaySpu()

static void ModuleThread_PlaySpu ( vlc_input_decoder_t *  p_owner,
subpicture_t *  p_subpic 
)
static

◆ ModuleThread_PlayVideo()

static int ModuleThread_PlayVideo ( vlc_input_decoder_t *  p_owner,
picture_t *  p_picture 
)
static

◆ ModuleThread_QueueAudio()

static void ModuleThread_QueueAudio ( decoder_t *  p_dec,
block_t *  p_aout_buf 
)
static

◆ ModuleThread_QueueCc()

static void ModuleThread_QueueCc ( decoder_t *  p_videodec,
block_t *  p_cc,
const decoder_cc_desc_t *  p_desc 
)
static

◆ ModuleThread_QueueSpu()

static void ModuleThread_QueueSpu ( decoder_t *  p_dec,
subpicture_t *  p_spu 
)
static

◆ ModuleThread_QueueThumbnail()

static void ModuleThread_QueueThumbnail ( decoder_t *  p_dec,
picture_t *  p_pic 
)
static

◆ ModuleThread_QueueVideo()

static void ModuleThread_QueueVideo ( decoder_t *  p_dec,
picture_t *  p_pic 
)
static

◆ ModuleThread_UpdateAudioFormat()

static int ModuleThread_UpdateAudioFormat ( decoder_t *  p_dec)
static

◆ ModuleThread_UpdateStatAudio()

static void ModuleThread_UpdateStatAudio ( vlc_input_decoder_t *  p_owner,
bool  lost 
)
static

◆ ModuleThread_UpdateStatVideo()

static void ModuleThread_UpdateStatVideo ( vlc_input_decoder_t *  p_owner,
bool  lost 
)
static

◆ ModuleThread_UpdateVideoFormat()

static int ModuleThread_UpdateVideoFormat ( decoder_t *  p_dec,
vlc_video_context *  vctx 
)
static

◆ MouseEvent()

static void MouseEvent ( const vlc_mouse_t *  newmouse,
void *  user_data 
)
static

◆ PacketizerGetCc()

static void PacketizerGetCc ( vlc_input_decoder_t *  p_owner,
decoder_t *  p_dec_cc 
)
static

◆ RequestReload()

static void RequestReload ( vlc_input_decoder_t *  p_owner)
static

◆ thumbnailer_buffer_new()

static picture_t* thumbnailer_buffer_new ( decoder_t *  p_dec)
static

◆ thumbnailer_get_device()

static vlc_decoder_device* thumbnailer_get_device ( decoder_t *  p_dec)
static

References VLC_UNUSED.

◆ vlc_input_decoder_AddVoutOverlay()

int vlc_input_decoder_AddVoutOverlay ( vlc_input_decoder_t *  owner,
subpicture_t *  sub,
size_t *  channel 
)

◆ vlc_input_decoder_ChangeDelay()

void vlc_input_decoder_ChangeDelay ( vlc_input_decoder_t *  owner,
vlc_tick_t  delay 
)

◆ vlc_input_decoder_ChangePause()

void vlc_input_decoder_ChangePause ( vlc_input_decoder_t *  ,
bool  b_paused,
vlc_tick_t  i_date 
)

This function changes the pause state.

The date parameter MUST hold the exact date at which the change has been done for proper vout/aout pausing.

References vlc_input_decoder_t::frames_countdown, vlc_input_decoder_t::p_fifo, vlc_input_decoder_t::pause_date, vlc_input_decoder_t::paused, vlc_fifo_Lock(), vlc_fifo_Signal(), and vlc_fifo_Unlock().

Referenced by EsOutDecodersChangePause().

◆ vlc_input_decoder_ChangeRate()

void vlc_input_decoder_ChangeRate ( vlc_input_decoder_t *  dec,
float  rate 
)

Changes the decoder rate.

This function changes rate of the intended playback speed to nominal speed.

Parameters
decdecoder
rateplayback rate (default is 1)

References vlc_input_decoder_t::p_fifo, vlc_input_decoder_t::request_rate, vlc_fifo_Lock(), and vlc_fifo_Unlock().

Referenced by EsOutChangeRate(), and EsOutCreateDecoder().

◆ vlc_input_decoder_Create()

vlc_input_decoder_t* vlc_input_decoder_Create ( vlc_object_t *  p_parent,
const es_format_t *  fmt,
input_resource_t *  p_resource 
)

Spawn a decoder thread outside of the input thread.

References decoder_New().

◆ vlc_input_decoder_Decode()

void vlc_input_decoder_Decode ( vlc_input_decoder_t *  p_owner,
block_t *  p_block,
bool  b_do_pace 
)

◆ vlc_input_decoder_Delete()

void vlc_input_decoder_Delete ( vlc_input_decoder_t *  p_owner)

◆ vlc_input_decoder_DelVoutOverlay()

int vlc_input_decoder_DelVoutOverlay ( vlc_input_decoder_t *  owner,
size_t  channel 
)

◆ vlc_input_decoder_Drain()

void vlc_input_decoder_Drain ( vlc_input_decoder_t *  p_owner)

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 vlc_input_decoder_t::b_draining, vlc_input_decoder_t::p_fifo, vlc_fifo_Lock(), vlc_fifo_Signal(), and vlc_fifo_Unlock().

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

◆ vlc_input_decoder_Flush()

void vlc_input_decoder_Flush ( vlc_input_decoder_t *  p_owner)

◆ vlc_input_decoder_FrameNext()

void vlc_input_decoder_FrameNext ( vlc_input_decoder_t *  p_owner,
vlc_tick_t *  pi_duration 
)

◆ vlc_input_decoder_GetCcDesc()

void vlc_input_decoder_GetCcDesc ( vlc_input_decoder_t *  p_owner,
decoder_cc_desc_t *  p_desc 
)

This function get cc channels descriptions.

References vlc_input_decoder_t::cc, vlc_input_decoder_t::desc, vlc_input_decoder_t::lock, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by EsOutSend().

◆ vlc_input_decoder_GetCcState()

int vlc_input_decoder_GetCcState ( vlc_input_decoder_t *  p_owner,
vlc_fourcc_t  codec,
int  i_channel,
bool *  pb_decode 
)

This function returns an error if the requested channel does not exist and set pb_decode to the channel status(active or not) otherwise.

References vlc_input_decoder_t::cc, vlc_input_decoder_t::lock, vlc_input_decoder_t::pp_decoder, VLC_EGENERIC, vlc_input_decoder_HasCCChanFlag(), vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.

Referenced by EsIsSelected().

◆ vlc_input_decoder_GetFifoSize()

size_t vlc_input_decoder_GetFifoSize ( vlc_input_decoder_t *  p_owner)

This function returns the current size in bytes of the decoder fifo.

References block_FifoSize(), and vlc_input_decoder_t::p_fifo.

Referenced by EsOutIsExtraBufferingAllowed().

◆ vlc_input_decoder_GetVbiPage()

int vlc_input_decoder_GetVbiPage ( vlc_input_decoder_t *  owner,
bool *  opaque 
)

◆ vlc_input_decoder_HasCCChanFlag()

static bool vlc_input_decoder_HasCCChanFlag ( vlc_input_decoder_t *  p_owner,
vlc_fourcc_t  codec,
int  i_channel 
)
static

◆ vlc_input_decoder_HasFormatChanged()

bool vlc_input_decoder_HasFormatChanged ( vlc_input_decoder_t *  p_dec,
es_format_t *  p_fmt,
vlc_meta_t **  pp_meta 
)

This function will return true if the ES format or meta data have changed since the last call.

In which case, it will do a copy of the current es_format_t if p_fmt is not NULL and will do a copy of the current description if pp_meta is non NULL. The es_format_t MUST be freed by es_format_Clean and *pp_meta MUST be freed by vlc_meta_Delete. Otherwise it will return false and will not initialize p_fmt and *pp_meta.

References vlc_input_decoder_t::b_fmt_description, es_format_Copy(), vlc_input_decoder_t::fmt, vlc_input_decoder_t::lock, vlc_input_decoder_t::p_description, vlc_meta_Merge(), vlc_meta_New(), vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by EsOutSend().

◆ vlc_input_decoder_IsEmpty()

bool vlc_input_decoder_IsEmpty ( vlc_input_decoder_t *  p_owner)

◆ vlc_input_decoder_New()

vlc_input_decoder_t* vlc_input_decoder_New ( vlc_object_t *  parent,
es_format_t *  fmt,
vlc_clock_t *  p_clock,
input_resource_t *  resource,
sout_instance_t *  p_sout,
bool  thumbnailing,
const struct vlc_input_decoder_callbacks *  cbs,
void *  cbs_userdata 
)

Spawns a new decoder thread from the input thread.

Parameters
p_inputthe input thread
p_esthe es descriptor
Returns
the spawned decoder object

References decoder_New().

Referenced by EsOutCreateDecoder(), EsOutSetRecord(), and vlc_input_decoder_SetCcState().

◆ vlc_input_decoder_SetCcState()

int vlc_input_decoder_SetCcState ( vlc_input_decoder_t *  p_owner,
vlc_fourcc_t  codec,
int  i_channel,
bool  b_decode 
)

◆ vlc_input_decoder_SetSpuHighlight()

int vlc_input_decoder_SetSpuHighlight ( vlc_input_decoder_t *  p_owner,
const vlc_spu_highlight_t *  spu_hl 
)

◆ vlc_input_decoder_SetVbiOpaque()

int vlc_input_decoder_SetVbiOpaque ( vlc_input_decoder_t *  owner,
bool  opaque 
)

◆ vlc_input_decoder_SetVbiPage()

int vlc_input_decoder_SetVbiPage ( vlc_input_decoder_t *  owner,
unsigned  page 
)

◆ vlc_input_decoder_SetVoutMouseEvent()

void vlc_input_decoder_SetVoutMouseEvent ( vlc_input_decoder_t *  owner,
vlc_mouse_event  mouse_event,
void *  user_data 
)

◆ vlc_input_decoder_StartWait()

void vlc_input_decoder_StartWait ( vlc_input_decoder_t *  p_owner)

◆ vlc_input_decoder_StopWait()

void vlc_input_decoder_StopWait ( vlc_input_decoder_t *  p_owner)

◆ vlc_input_decoder_Wait()

void vlc_input_decoder_Wait ( vlc_input_decoder_t *  p_owner)

Variable Documentation

◆ dec_audio_cbs

const struct decoder_owner_callbacks dec_audio_cbs
static
Initial value:
=
{
.audio = {
},
.get_attachments = InputThread_GetInputAttachments,
}
static int InputThread_GetInputAttachments(decoder_t *p_dec, input_attachment_t ***ppp_attachment, int *pi_attachment)
Definition: decoder.c:757
static int ModuleThread_UpdateAudioFormat(decoder_t *p_dec)
Definition: decoder.c:319
static void ModuleThread_QueueAudio(decoder_t *p_dec, block_t *p_aout_buf)
Definition: decoder.c:1275

Referenced by CreateDecoder().

◆ dec_spu_cbs

const struct decoder_owner_callbacks dec_spu_cbs
static
Initial value:
=
{
.spu = {
},
.get_attachments = InputThread_GetInputAttachments,
}
static void ModuleThread_QueueSpu(decoder_t *p_dec, subpicture_t *p_spu)
Definition: decoder.c:1318
static int InputThread_GetInputAttachments(decoder_t *p_dec, input_attachment_t ***ppp_attachment, int *pi_attachment)
Definition: decoder.c:757
static subpicture_t * ModuleThread_NewSpuBuffer(decoder_t *p_dec, const subpicture_updater_t *p_updater)
Definition: decoder.c:662

Referenced by CreateDecoder().

◆ dec_thumbnailer_cbs

const struct decoder_owner_callbacks dec_thumbnailer_cbs
static
Initial value:
=
{
.video = {
.get_device = thumbnailer_get_device,
.buffer_new = thumbnailer_buffer_new,
},
.get_attachments = InputThread_GetInputAttachments,
}
static picture_t * thumbnailer_buffer_new(decoder_t *p_dec)
Definition: decoder.c:1159
static vlc_decoder_device * thumbnailer_get_device(decoder_t *p_dec)
Definition: decoder.c:1150
static int InputThread_GetInputAttachments(decoder_t *p_dec, input_attachment_t ***ppp_attachment, int *pi_attachment)
Definition: decoder.c:757
static void ModuleThread_QueueThumbnail(decoder_t *p_dec, picture_t *p_pic)
Definition: decoder.c:1174

Referenced by CreateDecoder().

◆ dec_video_cbs

const struct decoder_owner_callbacks dec_video_cbs
static
Initial value:
=
{
.video = {
.abort_pictures = DecoderThread_AbortPictures,
.queue_cc = ModuleThread_QueueCc,
.get_display_date = ModuleThread_GetDisplayDate,
.get_display_rate = ModuleThread_GetDisplayRate,
},
.get_attachments = InputThread_GetInputAttachments,
}
static void ModuleThread_QueueCc(decoder_t *p_videodec, block_t *p_cc, const decoder_cc_desc_t *p_desc)
Definition: decoder.c:1037
static picture_t * ModuleThread_NewVideoBuffer(decoder_t *p_dec)
Definition: decoder.c:650
static vlc_decoder_device * ModuleThread_GetDecoderDevice(decoder_t *p_dec)
Definition: decoder.c:601
static int InputThread_GetInputAttachments(decoder_t *p_dec, input_attachment_t ***ppp_attachment, int *pi_attachment)
Definition: decoder.c:757
static int ModuleThread_UpdateVideoFormat(decoder_t *p_dec, vlc_video_context *vctx)
Definition: decoder.c:410
static void DecoderThread_AbortPictures(decoder_t *p_dec, bool b_abort)
Definition: decoder.c:828
static vlc_tick_t ModuleThread_GetDisplayDate(decoder_t *p_dec, vlc_tick_t system_now, vlc_tick_t i_ts)
Definition: decoder.c:773
static void ModuleThread_QueueVideo(decoder_t *p_dec, picture_t *p_pic)
Definition: decoder.c:1140
static float ModuleThread_GetDisplayRate(decoder_t *p_dec)
Definition: decoder.c:790

Referenced by CreateDecoder().