VLC 4.0.0-dev
vlc_codec.h File Reference

Decoder and encoder modules interface. More...

Include dependency graph for vlc_codec.h:

Go to the source code of this file.

Data Structures

struct  decoder_owner_callbacks
 
struct  decoder_t
 
struct  decoder_cc_desc_t
 
struct  encoder_owner_callbacks
 
struct  vlc_encoder_operations
 
struct  encoder_t
 
struct  vlc_decoder_device_operations
 
struct  vlc_decoder_device
 Decoder context struct. More...
 

Macros

#define VLCDEC_SUCCESS   VLC_SUCCESS
 
#define VLCDEC_ECRITICAL   VLC_EGENERIC
 
#define VLCDEC_RELOAD   (-100)
 
#define set_callback_dec_device(activate, priority)
 

Typedefs

typedef struct decoder_cc_desc_t decoder_cc_desc_t
 
typedef struct vlc_decoder_device vlc_decoder_device
 Decoder context struct. More...
 
typedef int(* vlc_decoder_device_Open) (vlc_decoder_device *device, vlc_window_t *window)
 "decoder device" module open entry point More...
 

Enumerations

enum  vlc_decoder_device_type {
  VLC_DECODER_DEVICE_VAAPI , VLC_DECODER_DEVICE_VDPAU , VLC_DECODER_DEVICE_DXVA2 , VLC_DECODER_DEVICE_D3D11VA ,
  VLC_DECODER_DEVICE_VIDEOTOOLBOX , VLC_DECODER_DEVICE_AWINDOW , VLC_DECODER_DEVICE_NVDEC , VLC_DECODER_DEVICE_MMAL ,
  VLC_DECODER_DEVICE_GSTDECODE
}
 Decoder device type. More...
 

Functions

vlc_decoder_devicevlc_encoder_GetDecoderDevice (encoder_t *)
 Creates/Updates the output decoder device. More...
 
void vlc_encoder_Destroy (encoder_t *encoder)
 
static block_tvlc_encoder_EncodeVideo (encoder_t *encoder, picture_t *pic)
 
static block_tvlc_encoder_EncodeAudio (encoder_t *encoder, block_t *audio)
 
static block_tvlc_encoder_EncodeSub (encoder_t *encoder, subpicture_t *sub)
 
vlc_decoder_devicevlc_decoder_device_Create (vlc_object_t *, vlc_window_t *window)
 Create a decoder device from a window. More...
 
vlc_decoder_devicevlc_decoder_device_Hold (vlc_decoder_device *device)
 Hold a decoder device. More...
 
void vlc_decoder_device_Release (vlc_decoder_device *device)
 Release a decoder device. More...
 
static vlc_decoder_devicedecoder_GetDecoderDevice (decoder_t *dec)
 Creates/Updates the output decoder device. More...
 
int decoder_UpdateVideoOutput (decoder_t *dec, vlc_video_context *vctx_out)
 Creates/Updates the rest of the video output pipeline. More...
 
int decoder_UpdateVideoFormat (decoder_t *dec)
 Updates the video output format. More...
 
picture_tdecoder_NewPicture (decoder_t *dec)
 Allocates an output picture buffer. More...
 
void decoder_Init (decoder_t *dec, es_format_t *fmt_in, const es_format_t *fmt)
 Initialize a decoder structure before creating the decoder. More...
 
void decoder_Destroy (decoder_t *p_dec)
 Destroy a decoder and reset the structure. More...
 
void decoder_Clean (decoder_t *p_dec)
 Unload a decoder module and reset the input/output formats. More...
 
static void decoder_QueueVideo (decoder_t *dec, picture_t *p_pic)
 This function queues a single picture to the video output. More...
 
static void decoder_QueueCc (decoder_t *dec, vlc_frame_t *p_cc, const decoder_cc_desc_t *p_desc)
 This function queues the Closed Captions. More...
 
static void decoder_QueueAudio (decoder_t *dec, vlc_frame_t *p_aout_buf)
 This function queues a single audio block to the audio output. More...
 
static void 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...
 
vlc_frame_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...
 
static subpicture_tdecoder_NewSubpicture (decoder_t *dec, const subpicture_updater_t *p_dyn)
 This function will return a new subpicture usable by a decoder as an output buffer. More...
 
static int decoder_GetInputAttachments (decoder_t *dec, input_attachment_t ***ppp_attachment, int *pi_attachment)
 This function gives all input attachments at once. More...
 
static vlc_tick_t decoder_GetDisplayDate (decoder_t *dec, vlc_tick_t system_now, vlc_tick_t i_ts)
 This function converts a decoder timestamp into a display date comparable to vlc_tick_now(). More...
 
static float decoder_GetDisplayRate (decoder_t *dec)
 This function returns the current input rate. More...
 

Detailed Description

Decoder and encoder modules interface.

Macro Definition Documentation

◆ VLCDEC_ECRITICAL

#define VLCDEC_ECRITICAL   VLC_EGENERIC

◆ VLCDEC_RELOAD

#define VLCDEC_RELOAD   (-100)

◆ VLCDEC_SUCCESS

#define VLCDEC_SUCCESS   VLC_SUCCESS

Function Documentation

◆ vlc_encoder_GetDecoderDevice()

vlc_decoder_device * vlc_encoder_GetDecoderDevice ( encoder_t enc)

Creates/Updates the output decoder device.

Note
This function is not reentrant.
Returns
the held decoder device, NULL if none should be used

Creates/Updates the output decoder device.

References encoder_t::cbs, encoder_t::fmt_in, encoder_owner_callbacks::get_device, es_format_t::i_cat, unlikely, encoder_owner_callbacks::video, VIDEO_ES, and vlc_assert.