VLC
4.0.0-dev
|
Video output display: output buffers and rendering. More...
![]() |
Files | |
file | vlc_vout_display.h |
Video output display modules interface. | |
Data Structures | |
struct | vlc_video_align |
struct | vout_display_cfg |
Initial/Current configuration for a vout_display_t. More... | |
struct | vout_display_info_t |
Information from a vout_display_t to configure the core behaviour. More... | |
struct | vout_display_owner_t |
Vout owner structures. More... | |
struct | vout_display_t |
struct | vout_display_place_t |
Structure used to store the result of a vout_display_PlacePicture. More... | |
Macros | |
#define | VLC_VIDEO_ALIGN_CENTER 0 |
Possible alignments for vout_display. More... | |
#define | VLC_VIDEO_ALIGN_LEFT 1 |
#define | VLC_VIDEO_ALIGN_RIGHT 2 |
#define | VLC_VIDEO_ALIGN_TOP 1 |
#define | VLC_VIDEO_ALIGN_BOTTOM 2 |
#define | set_callback_display(activate, priority) |
Typedefs | |
typedef struct vout_display_t | vout_display_t |
typedef struct vout_display_sys_t | vout_display_sys_t |
typedef struct vout_display_owner_t | vout_display_owner_t |
typedef struct vlc_video_align | vlc_video_align_t |
typedef struct vout_display_cfg | vout_display_cfg_t |
Initial/Current configuration for a vout_display_t. More... | |
typedef int(* | vout_display_open_cb) (vout_display_t *vd, const vout_display_cfg_t *cfg, video_format_t *fmtp, vlc_video_context *context) |
"vout display" open callback More... | |
Enumerations | |
enum | { VOUT_DISPLAY_RESET_PICTURES, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, VOUT_DISPLAY_CHANGE_DISPLAY_FILLED, VOUT_DISPLAY_CHANGE_ZOOM, VOUT_DISPLAY_CHANGE_SOURCE_ASPECT, VOUT_DISPLAY_CHANGE_SOURCE_CROP, VOUT_DISPLAY_CHANGE_VIEWPOINT } |
Control query for vout_display_t. More... | |
enum | { VOUT_DISPLAY_EVENT_VIEWPOINT_MOVED } |
Event from vout_display_t. More... | |
Functions | |
vout_display_t * | vout_display_New (vlc_object_t *, const video_format_t *, vlc_video_context *, const vout_display_cfg_t *, const char *module, const vout_display_owner_t *) |
Creates video output display. More... | |
void | vout_display_Delete (vout_display_t *) |
Destroys a video output display. More... | |
picture_t * | vout_display_Prepare (vout_display_t *vd, picture_t *picture, subpicture_t *subpic, vlc_tick_t date) |
Prepares a picture for display. More... | |
static void | vout_display_Display (vout_display_t *vd, picture_t *picture) |
Displays a picture. More... | |
void | vout_display_SetSize (vout_display_t *vd, unsigned width, unsigned height) |
static int | vout_display_Control (vout_display_t *vd, int query,...) |
void | vout_display_SendEventPicturesInvalid (vout_display_t *vd) |
static void | vout_display_SendEventMousePressed (vout_display_t *vd, int button) |
static void | vout_display_SendEventMouseReleased (vout_display_t *vd, int button) |
static void | vout_display_SendEventMouseDoubleClick (vout_display_t *vd) |
static void | vout_display_SendEventViewpointMoved (vout_display_t *vd, const vlc_viewpoint_t *vp) |
static void | vout_display_SendMouseMovedDisplayCoordinates (vout_display_t *vd, int m_x, int m_y) |
Helper function that applies the necessary transforms to the mouse position and then calls vout_display_SendEventMouseMoved. More... | |
static bool | vout_display_cfg_IsWindowed (const vout_display_cfg_t *cfg) |
void | vout_display_GetDefaultDisplaySize (unsigned *width, unsigned *height, const video_format_t *source, const vout_display_cfg_t *) |
Computes the default display size given the source and the display configuration. More... | |
static bool | vout_display_PlaceEquals (const vout_display_place_t *p1, const vout_display_place_t *p2) |
void | vout_display_PlacePicture (vout_display_place_t *place, const video_format_t *source, const vout_display_cfg_t *cfg) |
Computes how to place a picture inside the display to respect the given parameters. More... | |
void | vout_display_TranslateMouseState (vout_display_t *vd, vlc_mouse_t *video, const vlc_mouse_t *window) |
Translates mouse state. More... | |
Video output display: output buffers and rendering.
#define set_callback_display | ( | activate, | |
priority | |||
) |
#define VLC_VIDEO_ALIGN_BOTTOM 2 |
Referenced by vout_display_PlacePicture(), and VoutGetDisplayCfg().
#define VLC_VIDEO_ALIGN_CENTER 0 |
Possible alignments for vout_display.
Referenced by VoutGetDisplayCfg().
#define VLC_VIDEO_ALIGN_LEFT 1 |
Referenced by vout_display_PlacePicture(), and VoutGetDisplayCfg().
#define VLC_VIDEO_ALIGN_RIGHT 2 |
Referenced by vout_display_PlacePicture(), and VoutGetDisplayCfg().
#define VLC_VIDEO_ALIGN_TOP 1 |
Referenced by vout_display_PlacePicture(), and VoutGetDisplayCfg().
typedef struct vlc_video_align vlc_video_align_t |
typedef struct vout_display_cfg vout_display_cfg_t |
Initial/Current configuration for a vout_display_t.
typedef int(* vout_display_open_cb) (vout_display_t *vd, const vout_display_cfg_t *cfg, video_format_t *fmtp, vlc_video_context *context) |
"vout display" open callback
vd | vout display context |
cfg | Initial and current configuration. |
fmtp | By default, it is equal to vd->source except for the aspect ratio which is undefined(0) and is ignored. It can be changed by the module to request a different format. |
context | XXX: to be defined. |
typedef struct vout_display_owner_t vout_display_owner_t |
typedef struct vout_display_sys_t vout_display_sys_t |
typedef struct vout_display_t vout_display_t |
anonymous enum |
Control query for vout_display_t.
anonymous enum |
Event from vout_display_t.
Events modifiying the state may be sent multiple times. Only the transition will be retained and acted upon.
Enumerator | |
---|---|
VOUT_DISPLAY_EVENT_VIEWPOINT_MOVED |
|
inlinestatic |
|
inlinestatic |
void vout_display_Delete | ( | vout_display_t * | ) |
Destroys a video output display.
References vout_display_t::close, container_of, vout_display_priv_t::converters, filter_chain_Delete(), vout_display_t::fmt, picture_pool_Release(), vout_display_priv_t::pool, vout_display_t::source, video_format_Clean(), VLC_OBJECT, vlc_object_delete, and vlc_objres_clear().
Referenced by vout_CloseWrapper(), and vout_OpenWrapper().
|
inlinestatic |
Displays a picture.
References vout_display_t::display, picture_Release(), VLC_API, and vout_display_SetSize().
Referenced by ThreadDisplayRenderPicture().
void vout_display_GetDefaultDisplaySize | ( | unsigned * | width, |
unsigned * | height, | ||
const video_format_t * | source, | ||
const vout_display_cfg_t * | |||
) |
Computes the default display size given the source and the display configuration.
This asssumes that the picture is already cropped.
References vlc_rational_t::den, vout_display_cfg::den, vout_display_cfg::display, vout_display_cfg::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, vlc_rational_t::num, vout_display_cfg::num, ORIENT_IS_SWAP, video_format_t::orientation, vout_display_cfg::sar, vout_display_cfg::width, and vout_display_cfg::zoom.
Referenced by vout_display_cfg_IsWindowed(), vout_display_New(), and vout_display_PlacePicture().
vout_display_t* vout_display_New | ( | vlc_object_t * | , |
const video_format_t * | , | ||
vlc_video_context * | , | ||
const vout_display_cfg_t * | , | ||
const char * | module, | ||
const vout_display_owner_t * | |||
) |
Creates video output display.
References vout_display_priv_t::bottom, vout_display_t::cfg, vout_display_priv_t::cfg, vout_display_t::close, vout_display_t::control, vout_display_priv_t::crop, vout_display_priv_t::den, vout_display_cfg::display, vout_display_priv_t::display, vout_display_t::display, vout_display_t::fmt, vout_display_cfg::height, vout_display_t::info, vout_display_priv_t::left, vout_display_priv_t::num, vout_display_t::owner, vout_display_t::pool, vout_display_priv_t::pool, vout_display_t::prepare, vout_display_priv_t::right, vout_display_t::source, vout_display_priv_t::source, vout_display_t::sys, vout_display_priv_t::top, unlikely, var_GetBool(), var_InheritBool(), video_format_Clean(), video_format_Copy(), vlc_custom_create, vlc_module_load, VLC_OBJECT, vlc_object_delete, vlc_objres_clear(), VLC_SUCCESS, vout_display_Control(), vout_display_GetDefaultDisplaySize(), vout_display_start(), VOUT_WINDOW_STATE_ABOVE, VoutDisplayCreateRender(), and vout_display_cfg::width.
Referenced by vout_OpenWrapper().
|
inlinestatic |
void vout_display_PlacePicture | ( | vout_display_place_t * | place, |
const video_format_t * | source, | ||
const vout_display_cfg_t * | cfg | ||
) |
Computes how to place a picture inside the display to respect the given parameters.
This assumes that cropping is done by an external mean.
p_place | Place inside the window (window pixel unit) |
p_source | Video source format |
p_cfg | Display configuration |
References vout_display_cfg::align, vlc_rational_t::den, vout_display_cfg::display, vout_display_cfg::height, vout_display_place_t::height, vlc_video_align::horizontal, video_format_t::i_sar_den, video_format_t::i_sar_num, video_format_t::i_visible_height, video_format_t::i_visible_width, vout_display_cfg::is_display_filled, vlc_rational_t::num, video_format_t::projection_mode, PROJECTION_MODE_RECTANGULAR, vout_display_cfg::sar, vlc_video_align::vertical, video_format_ApplyRotation(), VLC_VIDEO_ALIGN_BOTTOM, VLC_VIDEO_ALIGN_LEFT, VLC_VIDEO_ALIGN_RIGHT, VLC_VIDEO_ALIGN_TOP, vout_display_GetDefaultDisplaySize(), vout_display_cfg::width, vout_display_place_t::width, vout_display_place_t::x, and vout_display_place_t::y.
Referenced by ThreadDisplayRenderPicture(), vout_display_PlaceEquals(), and vout_display_TranslateMouseState().
picture_t* vout_display_Prepare | ( | vout_display_t * | vd, |
picture_t * | picture, | ||
subpicture_t * | subpic, | ||
vlc_tick_t | date | ||
) |
Prepares a picture for display.
This renders a picture for subsequent display, with vout_display_Display().
\ bug Rendering subpictures is not supported with this function yet. subpic
must be NULL
.
vd | display to prepare the picture for |
picture | picure to be prepared |
subpic | reserved, must be NULL |
date | intended time to show the picture |
References vout_display_t::prepare, and vout_ConvertForDisplay().
|
inlinestatic |
|
inlinestatic |
References vout_display_t::cfg, vout_window_ReportMousePressed(), and vout_display_cfg::window.
|
inlinestatic |
References vout_display_t::cfg, vout_window_ReportMouseReleased(), and vout_display_cfg::window.
void vout_display_SendEventPicturesInvalid | ( | vout_display_t * | vd | ) |
References container_of, msg_Err, and vlc_assert_unreachable.
Referenced by vout_display_Control().
|
inlinestatic |
|
inlinestatic |
Helper function that applies the necessary transforms to the mouse position and then calls vout_display_SendEventMouseMoved.
vd | vout_display_t. |
m_x | Mouse x position (relative to place, origin is top left). |
m_y | Mouse y position (relative to place, origin is top left). |
References vout_display_t::cfg, vout_window_ReportMouseMoved(), and vout_display_cfg::window.
void vout_display_SetSize | ( | vout_display_t * | vd, |
unsigned | width, | ||
unsigned | height | ||
) |
References vout_display_priv_t::cfg, container_of, vout_display_cfg::display, vout_display_cfg::height, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, vout_display_CheckReset(), vout_display_Control(), vout_display_Reset(), and vout_display_cfg::width.
Referenced by vout_ChangeDisplaySize(), and vout_display_Display().
void vout_display_TranslateMouseState | ( | vout_display_t * | vd, |
vlc_mouse_t * | video, | ||
const vlc_mouse_t * | window | ||
) |
Translates mouse state.
This translates the mouse (pointer) state from window coordinates to video coordinates.
video
and window
pointers may alias. References vlc_mouse_t::b_double_click, vout_display_t::cfg, vout_display_place_t::height, vlc_mouse_t::i_pressed, video_format_t::i_visible_height, video_format_t::i_visible_width, vlc_mouse_t::i_x, video_format_t::i_x_offset, vlc_mouse_t::i_y, video_format_t::i_y_offset, ORIENT_BOTTOM_LEFT, ORIENT_BOTTOM_RIGHT, ORIENT_LEFT_BOTTOM, ORIENT_LEFT_TOP, ORIENT_RIGHT_BOTTOM, ORIENT_RIGHT_TOP, ORIENT_TOP_LEFT, ORIENT_TOP_RIGHT, video_format_t::orientation, vout_display_t::source, vlc_assert_unreachable, vout_display_PlacePicture(), vout_display_place_t::width, vout_display_place_t::x, and vout_display_place_t::y.
Referenced by ThreadProcessMouseState(), and vout_display_PlaceEquals().