VLC  2.1.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
video_output.c File Reference
Include dependency graph for video_output.c:

Data Structures

struct  vout_filter_t

Macros

#define VOUT_REDISPLAY_DELAY   (INT64_C(80000))
#define VOUT_DISPLAY_LATE_THRESHOLD   (INT64_C(20000))
 Late pictures having a delay higher than this value are thrashed.
#define VOUT_MWAIT_TOLERANCE   (INT64_C(4000))

Functions

static void * Thread (void *)
static void VoutDestructor (vlc_object_t *)
static int VoutValidateFormat (video_format_t *dst, const video_format_t *src)
static void VideoFormatCopyCropAr (video_format_t *dst, const video_format_t *src)
static bool VideoFormatIsCropArEqual (video_format_t *dst, const video_format_t *src)
static vout_thread_tVoutCreate (vlc_object_t *object, const vout_configuration_t *cfg)
vout_thread_t *() vout_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 *vout)
 This function will close a vout created by vout_Request.
void vout_ChangePause (vout_thread_t *vout, bool is_paused, mtime_t date)
 This function will (un)pause the display of pictures.
void vout_GetResetStatistic (vout_thread_t *vout, int *displayed, int *lost)
 This function will return and reset internal statistics.
void vout_Flush (vout_thread_t *vout, mtime_t date)
 This function will ensure that all ready/displayed pciture have at most the provided dat.
void vout_Reset (vout_thread_t *vout)
bool vout_IsEmpty (vout_thread_t *vout)
 This function will return true if no more pictures are to be displayed.
void vout_FixLeaks (vout_thread_t *vout)
 This function will try to detect if pictures are being leaked.
void vout_NextPicture (vout_thread_t *vout, mtime_t *duration)
 This function will force to display the next picture while paused.
void vout_DisplayTitle (vout_thread_t *vout, const char *title)
 This function will ask the display of the input title.
void vout_PutSubpicture (vout_thread_t *vout, subpicture_t *subpic)
int vout_RegisterSubpictureChannel (vout_thread_t *vout)
void vout_FlushSubpictureChannel (vout_thread_t *vout, int channel)
picture_tvout_GetPicture (vout_thread_t *vout)
 It retreives a picture from the vout or NULL if no pictures are available yet.
void vout_PutPicture (vout_thread_t *vout, picture_t *picture)
 It gives to the vout a picture to be displayed.
void vout_ReleasePicture (vout_thread_t *vout, picture_t *picture)
 It releases a picture retreived by vout_GetPicture.
void vout_HoldPicture (vout_thread_t *vout, picture_t *picture)
 It increment the reference counter of a picture retreived by vout_GetPicture.
int vout_GetSnapshot (vout_thread_t *vout, block_t **image_dst, picture_t **picture_dst, video_format_t *fmt, const char *type, mtime_t timeout)
 This function will handle a snapshot request.
void vout_ControlChangeFullscreen (vout_thread_t *vout, bool fullscreen)
void vout_ControlChangeOnTop (vout_thread_t *vout, bool is_on_top)
void vout_ControlChangeDisplayFilled (vout_thread_t *vout, bool is_filled)
void vout_ControlChangeZoom (vout_thread_t *vout, int num, int den)
void vout_ControlChangeSampleAspectRatio (vout_thread_t *vout, unsigned num, unsigned den)
void vout_ControlChangeCropRatio (vout_thread_t *vout, unsigned num, unsigned den)
void vout_ControlChangeCropWindow (vout_thread_t *vout, int x, int y, int width, int height)
void vout_ControlChangeCropBorder (vout_thread_t *vout, int left, int top, int right, int bottom)
void vout_ControlChangeFilters (vout_thread_t *vout, const char *filters)
void vout_ControlChangeSubSources (vout_thread_t *vout, const char *filters)
void vout_ControlChangeSubFilters (vout_thread_t *vout, const char *filters)
void vout_ControlChangeSubMargin (vout_thread_t *vout, int margin)
static void VoutGetDisplayCfg (vout_thread_t *vout, vout_display_cfg_t *cfg, const char *title)
vout_window_tvout_NewDisplayWindow (vout_thread_t *vout, vout_display_t *vd, const vout_window_cfg_t *cfg)
void vout_DeleteDisplayWindow (vout_thread_t *vout, vout_display_t *vd, vout_window_t *window)
static picture_tVoutVideoFilterInteractiveNewPicture (filter_t *filter)
static picture_tVoutVideoFilterStaticNewPicture (filter_t *filter)
static void VoutVideoFilterDelPicture (filter_t *filter, picture_t *picture)
static int VoutVideoFilterStaticAllocationSetup (filter_t *filter, void *data)
static int VoutVideoFilterInteractiveAllocationSetup (filter_t *filter, void *data)
static void ThreadFilterFlush (vout_thread_t *vout, bool is_locked)
static void ThreadChangeFilters (vout_thread_t *vout, const video_format_t *source, const char *filters, bool is_locked)
static int ThreadDisplayPreparePicture (vout_thread_t *vout, bool reuse, bool is_late_dropped)
static int ThreadDisplayRenderPicture (vout_thread_t *vout, bool is_forced)
static int ThreadDisplayPicture (vout_thread_t *vout, bool now, mtime_t *deadline)
static void ThreadManage (vout_thread_t *vout, mtime_t *deadline, vout_interlacing_support_t *interlacing)
static void ThreadDisplaySubpicture (vout_thread_t *vout, subpicture_t *subpicture)
static void ThreadFlushSubpicture (vout_thread_t *vout, int channel)
static void ThreadDisplayOsdTitle (vout_thread_t *vout, const char *string)
static void ThreadChangeSubSources (vout_thread_t *vout, const char *filters)
static void ThreadChangeSubFilters (vout_thread_t *vout, const char *filters)
static void ThreadChangeSubMargin (vout_thread_t *vout, int margin)
static void ThreadChangePause (vout_thread_t *vout, bool is_paused, mtime_t date)
static void ThreadFlush (vout_thread_t *vout, bool below, mtime_t date)
static void ThreadReset (vout_thread_t *vout)
static void ThreadStep (vout_thread_t *vout, mtime_t *duration)
static void ThreadChangeFullscreen (vout_thread_t *vout, bool fullscreen)
static void ThreadChangeOnTop (vout_thread_t *vout, bool is_on_top)
static void ThreadChangeDisplayFilled (vout_thread_t *vout, bool is_filled)
static void ThreadChangeZoom (vout_thread_t *vout, int num, int den)
static void ThreadChangeAspectRatio (vout_thread_t *vout, unsigned num, unsigned den)
static void ThreadExecuteCropWindow (vout_thread_t *vout, unsigned x, unsigned y, unsigned width, unsigned height)
static void ThreadExecuteCropBorder (vout_thread_t *vout, unsigned left, unsigned top, unsigned right, unsigned bottom)
static void ThreadExecuteCropRatio (vout_thread_t *vout, unsigned num, unsigned den)
static int ThreadStart (vout_thread_t *vout, const vout_display_state_t *state)
static void ThreadStop (vout_thread_t *vout, vout_display_state_t *state)
static void ThreadInit (vout_thread_t *vout)
static void ThreadClean (vout_thread_t *vout)
static int ThreadReinit (vout_thread_t *vout, const vout_configuration_t *cfg)

Macro Definition Documentation

#define VOUT_DISPLAY_LATE_THRESHOLD   (INT64_C(20000))

Late pictures having a delay higher than this value are thrashed.

Referenced by ThreadDisplayPreparePicture().

#define VOUT_MWAIT_TOLERANCE   (INT64_C(4000))

Referenced by ThreadDisplayPicture().

#define VOUT_REDISPLAY_DELAY   (INT64_C(80000))

Referenced by ThreadDisplayPicture().

Function Documentation

static void * Thread ( void *  object)
static

References vout_control_cmd_t::boolean, vout_control_cmd_t::border, vout_control_cmd_t::cfg, vout_thread_sys_t::control, vout_control_cmd_t::integer, vout_interlacing_support_t::is_interlaced, mdate(), vout_thread_t::p, vout_control_cmd_t::pair, vout_control_cmd_t::pause, vout_control_cmd_t::string, vout_control_cmd_t::subpicture, ThreadChangeAspectRatio(), ThreadChangeDisplayFilled(), ThreadChangeFilters(), ThreadChangeFullscreen(), ThreadChangeOnTop(), ThreadChangePause(), ThreadChangeSubFilters(), ThreadChangeSubMargin(), ThreadChangeSubSources(), ThreadChangeZoom(), ThreadClean(), ThreadDisplayOsdTitle(), ThreadDisplaySubpicture(), ThreadExecuteCropBorder(), ThreadExecuteCropRatio(), ThreadExecuteCropWindow(), ThreadFlush(), ThreadFlushSubpicture(), ThreadInit(), ThreadManage(), ThreadReinit(), ThreadReset(), ThreadStart(), ThreadStep(), ThreadStop(), vout_control_cmd_t::time, vout_control_cmd_t::time_ptr, vout_control_cmd_t::type, vout_control_cmd_t::u, VLC_TS_INVALID, VOUT_CONTROL_ASPECT_RATIO, VOUT_CONTROL_CHANGE_FILTERS, VOUT_CONTROL_CHANGE_SUB_FILTERS, VOUT_CONTROL_CHANGE_SUB_MARGIN, VOUT_CONTROL_CHANGE_SUB_SOURCES, VOUT_CONTROL_CLEAN, vout_control_cmd_Clean(), VOUT_CONTROL_CROP_BORDER, VOUT_CONTROL_CROP_RATIO, VOUT_CONTROL_CROP_WINDOW, VOUT_CONTROL_DISPLAY_FILLED, VOUT_CONTROL_FLUSH, VOUT_CONTROL_FLUSH_SUBPICTURE, VOUT_CONTROL_FULLSCREEN, VOUT_CONTROL_INIT, VOUT_CONTROL_ON_TOP, VOUT_CONTROL_OSD_TITLE, VOUT_CONTROL_PAUSE, vout_control_Pop(), VOUT_CONTROL_REINIT, VOUT_CONTROL_RESET, VOUT_CONTROL_STEP, VOUT_CONTROL_SUBPICTURE, VOUT_CONTROL_ZOOM, and vout_control_cmd_t::window.

Referenced by VoutCreate().

static void ThreadChangeAspectRatio ( vout_thread_t vout,
unsigned  num,
unsigned  den 
)
static
static void ThreadChangeDisplayFilled ( vout_thread_t vout,
bool  is_filled 
)
static
static void ThreadChangeFilters ( vout_thread_t vout,
const video_format_t source,
const char *  filters,
bool  is_locked 
)
static
static void ThreadChangeFullscreen ( vout_thread_t vout,
bool  fullscreen 
)
static
static void ThreadChangeOnTop ( vout_thread_t vout,
bool  is_on_top 
)
static
static void ThreadChangePause ( vout_thread_t vout,
bool  is_paused,
mtime_t  date 
)
static
static void ThreadChangeSubFilters ( vout_thread_t vout,
const char *  filters 
)
static
static void ThreadChangeSubMargin ( vout_thread_t vout,
int  margin 
)
static
static void ThreadChangeSubSources ( vout_thread_t vout,
const char *  filters 
)
static
static void ThreadChangeZoom ( vout_thread_t vout,
int  num,
int  den 
)
static
static void ThreadClean ( vout_thread_t vout)
static
static void ThreadDisplayOsdTitle ( vout_thread_t vout,
const char *  string 
)
static
static int ThreadDisplayPicture ( vout_thread_t vout,
bool  now,
mtime_t deadline 
)
static
static int ThreadDisplayPreparePicture ( vout_thread_t vout,
bool  reuse,
bool  is_late_dropped 
)
static
static int ThreadDisplayRenderPicture ( vout_thread_t vout,
bool  is_forced 
)
static

< Unspecified error

< Unspecified error

< Unspecified error

< Unspecified error

< No error

References vout_chrono_t::avg, vout_display_t::cfg, vout_thread_sys_t::chain_interactive, vout_thread_sys_t::current, picture_t::date, vout_thread_sys_t::date, vout_thread_sys_t::decoder_pool, vout_thread_sys_t::display, vout_display_cfg_t::display, vout_thread_sys_t::display_pool, vout_thread_sys_t::displayed, vout_thread_sys_t::filter, filter_chain_VideoFilter(), filter_DeleteBlend(), filter_NewBlend(), vout_thread_sys_t::filtered, vout_display_t::fmt, filter_t::fmt_out, picture_t::format, vout_display_place_t::height, video_format_t::i_chroma, video_format_t::i_height, video_format_t::i_sar_den, video_format_t::i_sar_num, video_format_t::i_visible_height, video_format_t::i_visible_width, video_format_t::i_width, vout_display_t::info, vout_thread_sys_t::is_on, vout_display_info_t::is_slow, vout_thread_sys_t::lock, mdate(), msg_Err, msg_Info, msg_Warn, mwait, vout_thread_t::p, vout_thread_sys_t::pause, picture_BlendSubpicture(), picture_Copy(), picture_Hold(), picture_pool_Get(), picture_Release(), vout_thread_sys_t::private_pool, vout_thread_sys_t::render, vout_display_cfg_t::sar, vout_thread_sys_t::snapshot, vout_display_t::source, vout_thread_sys_t::spu, vout_thread_sys_t::spu_blend, vout_thread_sys_t::spu_blend_chroma, spu_Render(), vout_thread_sys_t::statistic, vout_display_info_t::subpicture_chromas, subpicture_Delete(), vout_thread_sys_t::use_dr, vout_chrono_t::var, vout_thread_sys_t::vd, es_format_t::video, VideoFormatCopyCropAr(), VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), VLC_OBJECT, VLC_SUCCESS, vout_chrono_Start(), vout_chrono_Stop(), vout_display_Display(), vout_display_PlacePicture(), vout_display_Prepare(), vout_FilterDisplay(), vout_IsDisplayFiltered(), vout_snapshot_IsRequested(), vout_snapshot_Set(), vout_statistic_AddDisplayed(), vout_UpdateDisplaySourceProperties(), and vout_display_place_t::width.

Referenced by ThreadDisplayPicture().

static void ThreadDisplaySubpicture ( vout_thread_t vout,
subpicture_t subpicture 
)
static
static void ThreadExecuteCropBorder ( vout_thread_t vout,
unsigned  left,
unsigned  top,
unsigned  right,
unsigned  bottom 
)
static
static void ThreadExecuteCropRatio ( vout_thread_t vout,
unsigned  num,
unsigned  den 
)
static
static void ThreadExecuteCropWindow ( vout_thread_t vout,
unsigned  x,
unsigned  y,
unsigned  width,
unsigned  height 
)
static
static void ThreadFilterFlush ( vout_thread_t vout,
bool  is_locked 
)
static
static void ThreadFlush ( vout_thread_t vout,
bool  below,
mtime_t  date 
)
static
static void ThreadFlushSubpicture ( vout_thread_t vout,
int  channel 
)
static
static void ThreadInit ( vout_thread_t vout)
static
static void ThreadManage ( vout_thread_t vout,
mtime_t deadline,
vout_interlacing_support_t interlacing 
)
static
static int ThreadReinit ( vout_thread_t vout,
const vout_configuration_t cfg 
)
static
static void ThreadReset ( vout_thread_t vout)
static
static int ThreadStart ( vout_thread_t vout,
const vout_display_state_t state 
)
static
static void ThreadStep ( vout_thread_t vout,
mtime_t duration 
)
static
static void ThreadStop ( vout_thread_t vout,
vout_display_state_t state 
)
static
static void VideoFormatCopyCropAr ( video_format_t dst,
const video_format_t src 
)
static
static bool VideoFormatIsCropArEqual ( video_format_t dst,
const video_format_t src 
)
static
void vout_ChangePause ( vout_thread_t ,
bool  b_paused,
mtime_t  i_date 
)
void vout_ControlChangeCropBorder ( vout_thread_t vout,
int  left,
int  top,
int  right,
int  bottom 
)
void vout_ControlChangeCropRatio ( vout_thread_t vout,
unsigned  num,
unsigned  den 
)
void vout_ControlChangeCropWindow ( vout_thread_t vout,
int  x,
int  y,
int  width,
int  height 
)
void vout_ControlChangeDisplayFilled ( vout_thread_t vout,
bool  is_filled 
)
void vout_ControlChangeFilters ( vout_thread_t vout,
const char *  filters 
)
void vout_ControlChangeFullscreen ( vout_thread_t vout,
bool  fullscreen 
)
void vout_ControlChangeOnTop ( vout_thread_t vout,
bool  is_on_top 
)
void vout_ControlChangeSampleAspectRatio ( vout_thread_t vout,
unsigned  num,
unsigned  den 
)
void vout_ControlChangeSubFilters ( vout_thread_t vout,
const char *  filters 
)
void vout_ControlChangeSubMargin ( vout_thread_t vout,
int  margin 
)
void vout_ControlChangeSubSources ( vout_thread_t vout,
const char *  filters 
)
void vout_ControlChangeZoom ( vout_thread_t vout,
int  num,
int  den 
)
void vout_DeleteDisplayWindow ( vout_thread_t vout,
vout_display_t vd,
vout_window_t window 
)
void vout_DisplayTitle ( vout_thread_t vout,
const char *  title 
)

This function will ask the display of the input title.

References vout_thread_sys_t::control, vout_thread_t::p, VOUT_CONTROL_OSD_TITLE, and vout_control_PushString().

Referenced by DisplayVoutTitle().

void vout_FixLeaks ( vout_thread_t p_vout)

This function will try to detect if pictures are being leaked.

If so it will release them.

XXX This function is there to workaround bugs in decoder

References vout_thread_sys_t::decoder_fifo, vout_thread_sys_t::decoder_pool, msg_Err, vout_thread_t::p, picture_fifo_Peek(), vout_thread_sys_t::picture_lock, picture_pool_Get(), picture_pool_NonEmpty(), picture_Release(), vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by vout_new_buffer().

void vout_Flush ( vout_thread_t vout,
mtime_t  date 
)

This function will ensure that all ready/displayed pciture have at most the provided dat.

References vout_thread_sys_t::control, vout_thread_t::p, VOUT_CONTROL_FLUSH, vout_control_PushTime(), and vout_control_WaitEmpty().

Referenced by DecoderDecodeVideo(), DecoderPlayVideo(), DecoderProcessVideo(), and RequestVout().

void vout_GetResetStatistic ( vout_thread_t vout,
int *  displayed,
int *  lost 
)

This function will return and reset internal statistics.

References vout_thread_t::p, vout_thread_sys_t::statistic, and vout_statistic_GetReset().

Referenced by DecoderPlayVideo().

bool vout_IsEmpty ( vout_thread_t vout)

This function will return true if no more pictures are to be displayed.

References vout_thread_sys_t::decoder_fifo, vout_thread_t::p, picture_fifo_Peek(), vout_thread_sys_t::picture_lock, picture_Release(), vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by input_DecoderIsEmpty().

vout_window_t* vout_NewDisplayWindow ( vout_thread_t vout,
vout_display_t vd,
const vout_window_cfg_t cfg 
)
void vout_NextPicture ( vout_thread_t vout,
mtime_t duration 
)
void vout_Reset ( vout_thread_t vout)
static vout_thread_t* VoutCreate ( vlc_object_t object,
const vout_configuration_t cfg 
)
static
static void VoutDestructor ( vlc_object_t object)
static
static void VoutGetDisplayCfg ( vout_thread_t vout,
vout_display_cfg_t cfg,
const char *  title 
)
static
static int VoutValidateFormat ( video_format_t dst,
const video_format_t src 
)
static
static void VoutVideoFilterDelPicture ( filter_t filter,
picture_t picture 
)
static
static int VoutVideoFilterInteractiveAllocationSetup ( filter_t filter,
void *  data 
)
static
static picture_t* VoutVideoFilterInteractiveNewPicture ( filter_t filter)
static
static int VoutVideoFilterStaticAllocationSetup ( filter_t filter,
void *  data 
)
static
static picture_t* VoutVideoFilterStaticNewPicture ( filter_t filter)
static