VLC  3.0.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Modules | Data Structures | Macros | Typedefs | Functions
Video Output

This module describes the programming interface for video output threads. More...

Collaboration diagram for Video Output:

Modules

 Video Subpictures
 Subpictures are pictures that should be displayed on top of the video, like subtitles and OSD.

Data Structures

struct  vout_configuration_t
 Vout configuration. More...
struct  vout_thread_t
 Video output thread descriptor. More...

Macros

#define VOUT_ALIGN_LEFT   0x0001
#define VOUT_ALIGN_RIGHT   0x0002
#define VOUT_ALIGN_HMASK   0x0003
#define VOUT_ALIGN_TOP   0x0004
#define VOUT_ALIGN_BOTTOM   0x0008
#define VOUT_ALIGN_VMASK   0x000C
#define vout_Request(a, b)   vout_Request(VLC_OBJECT(a),b)

Typedefs

typedef struct vout_thread_sys_t vout_thread_sys_t
 Video output thread private structure.

Functions

vout_thread_tvout_Request (vlc_object_t *object, const vout_configuration_t *cfg)
 Returns a suitable vout or release the given one.
void vout_Close (vout_thread_t *p_vout)
 This function will close a vout created by vout_Request.
static void vout_CloseAndRelease (vout_thread_t *p_vout)
 This function will close a vout created by vout_Create and then release it.
int vout_GetSnapshot (vout_thread_t *p_vout, block_t **pp_image, picture_t **pp_picture, video_format_t *p_fmt, const char *psz_format, mtime_t i_timeout)
 This function will handle a snapshot request.
void vout_ChangeAspectRatio (vout_thread_t *p_vout, unsigned int i_num, unsigned int i_den)
picture_tvout_GetPicture (vout_thread_t *)
 It retreives a picture from the vout or NULL if no pictures are available yet.
void vout_PutPicture (vout_thread_t *, picture_t *)
 It gives to the vout a picture to be displayed.
void vout_HoldPicture (vout_thread_t *, picture_t *)
 It increment the reference counter of a picture retreived by vout_GetPicture.
void vout_ReleasePicture (vout_thread_t *, picture_t *)
 It releases a picture retreived by vout_GetPicture.
void vout_PutSubpicture (vout_thread_t *, subpicture_t *)
int vout_RegisterSubpictureChannel (vout_thread_t *)
void vout_FlushSubpictureChannel (vout_thread_t *, int)
void vout_EnableFilter (vout_thread_t *, const char *, bool, bool)

Detailed Description

This module describes the programming interface for video output threads.

It includes functions allowing to open a new thread, send pictures to a thread, and destroy a previously opened video output thread.

Macro Definition Documentation

#define VOUT_ALIGN_BOTTOM   0x0008
#define VOUT_ALIGN_HMASK   0x0003
#define VOUT_ALIGN_LEFT   0x0001
#define VOUT_ALIGN_RIGHT   0x0002
#define VOUT_ALIGN_TOP   0x0004
#define VOUT_ALIGN_VMASK   0x000C
#define vout_Request (   a,
 
)    vout_Request(VLC_OBJECT(a),b)

Referenced by RequestVout().

Typedef Documentation

Video output thread private structure.

Function Documentation

void vout_ChangeAspectRatio ( vout_thread_t p_vout,
unsigned int  i_num,
unsigned int  i_den 
)
void vout_Close ( vout_thread_t p_vout)

This function will close a vout created by vout_Request.

The associated vout module is closed. Note: It is not released yet, you'll have to call vlc_object_release() or use the convenient vout_CloseAndRelease().

Parameters
p_voutthe vout to close

References vout_thread_sys_t::control, vout_thread_sys_t::input, vout_thread_t::p, vout_thread_sys_t::snapshot, vout_thread_sys_t::spu, spu_Attach(), spu_Destroy(), vout_thread_sys_t::spu_lock, vout_thread_sys_t::thread, vlc_join(), vlc_mutex_lock(), vlc_mutex_unlock(), VOUT_CONTROL_CLEAN, vout_control_PushVoid(), and vout_snapshot_End().

Referenced by vout_CloseAndRelease().

static void vout_CloseAndRelease ( vout_thread_t p_vout)
inlinestatic

This function will close a vout created by vout_Create and then release it.

Parameters
p_voutthe vout to close and release

References vlc_object_release, and vout_Close().

Referenced by DestroyVout(), RequestVout(), vout_Request(), and VoutCreate().

void vout_EnableFilter ( vout_thread_t ,
const char *  ,
bool  ,
bool   
)
void vout_FlushSubpictureChannel ( vout_thread_t ,
int   
)
picture_t* vout_GetPicture ( vout_thread_t vout)

It retreives a picture from the vout or NULL if no pictures are available yet.

You MUST call vout_PutPicture or vout_ReleasePicture on it.

You may use vout_HoldPicture(paired with vout_ReleasePicture) to keep a read-only reference.

References vout_thread_sys_t::decoder_pool, picture_t::format, vout_thread_sys_t::original, vout_thread_t::p, vout_thread_sys_t::picture_lock, picture_pool_Get(), picture_Reset(), VideoFormatCopyCropAr(), vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by vout_new_buffer().

int vout_GetSnapshot ( vout_thread_t p_vout,
block_t **  pp_image,
picture_t **  pp_picture,
video_format_t p_fmt,
const char *  psz_format,
mtime_t  i_timeout 
)

This function will handle a snapshot request.

pp_image, pp_picture and p_fmt can be NULL otherwise they will be set with returned value in case of success.

pp_image will hold an encoded picture in psz_format format.

i_timeout specifies the time the function will wait for a snapshot to be available.

< Unspecified error

< Unspecified error

< No error

References image_Type2Fourcc(), msg_Err, vout_thread_t::p, picture_Export(), picture_Release(), vout_thread_sys_t::snapshot, var_InheritInteger, VLC_CODEC_PNG, VLC_EGENERIC, VLC_OBJECT, VLC_SUCCESS, and vout_snapshot_Get().

Referenced by VoutSaveSnapshot().

void vout_HoldPicture ( vout_thread_t ,
picture_t  
)

It increment the reference counter of a picture retreived by vout_GetPicture.

References vout_thread_t::p, picture_Hold(), vout_thread_sys_t::picture_lock, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by vout_link_picture().

void vout_PutPicture ( vout_thread_t vout,
picture_t picture 
)

It gives to the vout a picture to be displayed.

The given picture MUST comes from vout_GetPicture.

Becareful, after vout_PutPicture is called, picture_t::p_next cannot be read/used.

References vout_thread_sys_t::control, vout_thread_sys_t::decoder_fifo, vout_thread_t::p, picture_t::p_next, picture_fifo_Push(), vout_thread_sys_t::picture_lock, vlc_mutex_lock(), vlc_mutex_unlock(), and vout_control_Wake().

Referenced by DecoderPlayVideo().

void vout_PutSubpicture ( vout_thread_t ,
subpicture_t  
)
int vout_RegisterSubpictureChannel ( vout_thread_t )
void vout_ReleasePicture ( vout_thread_t ,
picture_t  
)
vout_thread_t* vout_Request ( vlc_object_t object,
const vout_configuration_t cfg 
)

Returns a suitable vout or release the given one.

If cfg->fmt is non NULL and valid, a vout will be returned, reusing cfg->vout is possible, otherwise it returns NULL. If cfg->vout is not used, it will be closed and released.

You can release the returned value either by vout_Request or vout_Close() followed by a vlc_object_release() or shorter vout_CloseAndRelease()

Parameters
objecta vlc object
cfgthe video configuration requested.
Returns
a vout