/src/vlc/include/vlc_vout_display.h
Line | Count | Source (jump to first uncovered line) |
1 | | /***************************************************************************** |
2 | | * vlc_vout_display.h: vout_display_t definitions |
3 | | ***************************************************************************** |
4 | | * Copyright (C) 2009 Laurent Aimar |
5 | | * |
6 | | * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org> |
7 | | * |
8 | | * This program is free software; you can redistribute it and/or modify it |
9 | | * under the terms of the GNU Lesser General Public License as published by |
10 | | * the Free Software Foundation; either version 2.1 of the License, or |
11 | | * (at your option) any later version. |
12 | | * |
13 | | * This program is distributed in the hope that it will be useful, |
14 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | | * GNU Lesser General Public License for more details. |
17 | | * |
18 | | * You should have received a copy of the GNU Lesser General Public License |
19 | | * along with this program; if not, write to the Free Software Foundation, |
20 | | * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. |
21 | | *****************************************************************************/ |
22 | | |
23 | | #ifndef VLC_VOUT_DISPLAY_H |
24 | | #define VLC_VOUT_DISPLAY_H 1 |
25 | | |
26 | | #include <vlc_es.h> |
27 | | #include <vlc_picture.h> |
28 | | #include <vlc_subpicture.h> |
29 | | #include <vlc_mouse.h> |
30 | | #include <vlc_vout.h> |
31 | | #include <vlc_window.h> |
32 | | #include <vlc_viewpoint.h> |
33 | | |
34 | | /** |
35 | | * \defgroup video_display Video output display |
36 | | * Video output display: output buffers and rendering |
37 | | * |
38 | | * \ingroup video_output |
39 | | * @{ |
40 | | * \file |
41 | | * Video output display modules interface |
42 | | */ |
43 | | |
44 | | typedef struct vout_display_t vout_display_t; |
45 | | typedef struct vout_display_owner_t vout_display_owner_t; |
46 | | |
47 | | /** |
48 | | * \defgroup video_align Video alignment |
49 | | * @{ |
50 | | */ |
51 | 0 | #define VLC_VIDEO_ALIGN_CENTER 0 |
52 | 0 | #define VLC_VIDEO_ALIGN_LEFT 1 |
53 | 0 | #define VLC_VIDEO_ALIGN_RIGHT 2 |
54 | 0 | #define VLC_VIDEO_ALIGN_TOP 1 |
55 | 0 | #define VLC_VIDEO_ALIGN_BOTTOM 2 |
56 | | |
57 | | /** |
58 | | * Video alignment within the display. |
59 | | */ |
60 | | typedef struct vlc_video_align { |
61 | | /** |
62 | | * Horizontal alignment. |
63 | | * |
64 | | * This must be one of \ref VLC_VIDEO_ALIGN_CENTER, |
65 | | * \ref VLC_VIDEO_ALIGN_LEFT or \ref VLC_VIDEO_ALIGN_RIGHT. |
66 | | */ |
67 | | char horizontal; |
68 | | |
69 | | /** |
70 | | * Vectical alignment. |
71 | | * |
72 | | * This must be one of \ref VLC_VIDEO_ALIGN_CENTER, |
73 | | * \ref VLC_VIDEO_ALIGN_TOP or \ref VLC_VIDEO_ALIGN_BOTTOM. |
74 | | */ |
75 | | char vertical; |
76 | | } vlc_video_align_t; |
77 | | /** @} */ |
78 | | |
79 | | /** |
80 | | * Video automatic scale fitting. |
81 | | */ |
82 | | enum vlc_video_fitting { |
83 | | VLC_VIDEO_FIT_NONE /**< No automatic scaling (use explicit zoom ratio) */, |
84 | | VLC_VIDEO_FIT_SMALLER /**< Fit inside / to smallest dimension */, |
85 | | VLC_VIDEO_FIT_LARGER /**< Fit outside / to largest dimension */, |
86 | | VLC_VIDEO_FIT_WIDTH /**< Fit to width */, |
87 | | VLC_VIDEO_FIT_HEIGHT /**< Fit to height */, |
88 | | }; |
89 | | |
90 | | /** |
91 | | * Display placement and zoom configuration. |
92 | | */ |
93 | | struct vout_display_placement { |
94 | | unsigned width; /**< Requested display pixel width (0 by default). */ |
95 | | unsigned height; /**< Requested display pixel height (0 by default). */ |
96 | | vlc_rational_t sar; /**< Requested sample aspect ratio */ |
97 | | |
98 | | vlc_video_align_t align; /**< Alignment within the window */ |
99 | | enum vlc_video_fitting fitting; /**< Scaling/fitting mode */ |
100 | | vlc_rational_t zoom; /**< Zoom ratio (if fitting is disabled) */ |
101 | | }; |
102 | | |
103 | | /** |
104 | | * User configuration for a video output display (\ref vout_display_t) |
105 | | * |
106 | | * This primarily controls the size of the display area within the video |
107 | | * window, as follows: |
108 | | * - If \ref vout_display_cfg::display::fitting is not disabled, |
109 | | * the video size is fitted to the display size. |
110 | | * - If \ref vout_display_cfg::window "window" size is valid, the video size |
111 | | * is set to the window size, |
112 | | * - Otherwise, the video size is determined from the original video format, |
113 | | * multiplied by the zoom factor. |
114 | | */ |
115 | | typedef struct vout_display_cfg { |
116 | | struct vlc_window *window; /**< Window */ |
117 | | struct vout_display_placement display; /**< Display placement properties */ |
118 | | vlc_icc_profile_t *icc_profile; /**< Currently active ICC profile */ |
119 | | vlc_viewpoint_t viewpoint; |
120 | | } vout_display_cfg_t; |
121 | | |
122 | | /** |
123 | | * Information from a vout_display_t to configure |
124 | | * the core behaviour. |
125 | | * |
126 | | * By default they are all false or NULL. |
127 | | * |
128 | | */ |
129 | | typedef struct { |
130 | | bool can_scale_spu; /* Handles subpictures with a non default zoom factor */ |
131 | | const vlc_fourcc_t *subpicture_chromas; /* List of supported chromas for subpicture rendering. */ |
132 | | } vout_display_info_t; |
133 | | |
134 | | /** |
135 | | * Control query for vout_display_t |
136 | | */ |
137 | | enum vout_display_query { |
138 | | /** |
139 | | * Notifies a change in display size. |
140 | | * |
141 | | * \retval VLC_SUCCESS if the display handled the change |
142 | | * \retval VLC_EGENERIC if a \ref vlc_display_operations::reset_pictures |
143 | | * request is necessary |
144 | | */ |
145 | | VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, |
146 | | |
147 | | /** |
148 | | * Notifies a change of the display fitting mode by the user. |
149 | | * |
150 | | * \retval VLC_SUCCESS if the display handled the change |
151 | | * \retval VLC_EGENERIC if a \ref vlc_display_operations::reset_pictures |
152 | | * request is necessary |
153 | | */ |
154 | | VOUT_DISPLAY_CHANGE_DISPLAY_FILLED, |
155 | | |
156 | | /** |
157 | | * Notifies a change of the user zoom factor. |
158 | | * |
159 | | * \retval VLC_SUCCESS if the display handled the change |
160 | | * \retval VLC_EGENERIC if a \ref vlc_display_operations::reset_pictures |
161 | | * request is necessary |
162 | | */ |
163 | | VOUT_DISPLAY_CHANGE_ZOOM, |
164 | | |
165 | | /** |
166 | | * Notifies a change of the sample aspect ratio. |
167 | | * |
168 | | * \retval VLC_SUCCESS if the display handled the change |
169 | | * \retval VLC_EGENERIC if a \ref vlc_display_operations::reset_pictures |
170 | | * request is necessary |
171 | | */ |
172 | | VOUT_DISPLAY_CHANGE_SOURCE_ASPECT, |
173 | | |
174 | | /** |
175 | | * Notifies a change of the source cropping. |
176 | | * |
177 | | * The cropping requested is stored by source \ref video_format_t `i_x`/`y_offset` |
178 | | * and `i_visible_width`/`height` |
179 | | * |
180 | | * \retval VLC_SUCCESS if the display handled the change |
181 | | * \retval VLC_EGENERIC if a \ref vlc_display_operations::reset_pictures |
182 | | * request is necessary |
183 | | */ |
184 | | VOUT_DISPLAY_CHANGE_SOURCE_CROP, |
185 | | }; |
186 | | |
187 | | /** |
188 | | * Vout owner structures |
189 | | */ |
190 | | struct vout_display_owner_t { |
191 | | /* Private place holder for the vout_display_t creator |
192 | | */ |
193 | | void *sys; |
194 | | |
195 | | /* Event coming from the module |
196 | | * |
197 | | * This function is set prior to the module instantiation and must not |
198 | | * be overwritten nor used directly (use the vout_display_SendEvent* |
199 | | * wrapper. |
200 | | * |
201 | | * You can send it at any time i.e. from any vout_display_t functions or |
202 | | * from another thread. |
203 | | * Be careful, it does not ensure correct serialization if it is used |
204 | | * from multiple threads. |
205 | | */ |
206 | | void (*viewpoint_moved)(void *sys, const vlc_viewpoint_t *vp); |
207 | | }; |
208 | | |
209 | | /** |
210 | | * "vout display" open callback |
211 | | * |
212 | | * @param vd vout display context |
213 | | * @param fmtp It can be changed by the module to request a different format. |
214 | | * @param context The video context to configure the display for. |
215 | | * @return VLC_SUCCESS or a VLC error code |
216 | | */ |
217 | | typedef int (*vout_display_open_cb)(vout_display_t *vd, |
218 | | video_format_t *fmtp, |
219 | | vlc_video_context *context); |
220 | | |
221 | | #define set_callback_display(activate, priority) \ |
222 | | { \ |
223 | | vout_display_open_cb open__ = activate; \ |
224 | | (void) open__; \ |
225 | | set_callback(activate) \ |
226 | | } \ |
227 | | set_capability( "vout display", priority ) |
228 | | |
229 | | struct vlc_display_operations |
230 | | { |
231 | | /** |
232 | | * Destroys the display. |
233 | | */ |
234 | | void (*close)(vout_display_t *); |
235 | | |
236 | | /** |
237 | | * Prepares a picture and an optional subpicture for display (optional). |
238 | | * |
239 | | * This callback is called once a picture buffer content is ready, |
240 | | * as far in advance as possible to the intended display time, |
241 | | * but only after the previous picture was displayed. |
242 | | * |
243 | | * The callback should perform any preprocessing operation that will not |
244 | | * actually cause the picture to be shown, such as blending the subpicture |
245 | | * or upload the picture to video memory. If supported, this can also |
246 | | * queue the picture to be shown asynchronously at the given date. |
247 | | * |
248 | | * |
249 | | * If \ref vlc_display_operations.prepare and |
250 | | * \ref vlc_display_operations.display are not \c NULL, there is an |
251 | | * implicit guarantee that display will be invoked with the exact same |
252 | | * picture afterwards: |
253 | | * prepare 1st picture, display 1st picture, prepare 2nd picture, display |
254 | | * 2nd picture, and so on. |
255 | | * |
256 | | * \note The picture buffers may have multiple references. |
257 | | * Therefore the pixel content of the picture or of the subpicture |
258 | | * must not be changed. |
259 | | * |
260 | | * \param pic picture |
261 | | * \param subpic subpicture to render over the picture |
262 | | * \param date time when the picture is intended to be shown |
263 | | */ |
264 | | void (*prepare)(vout_display_t *, picture_t *pic, |
265 | | subpicture_t *subpic, vlc_tick_t date); |
266 | | |
267 | | /** |
268 | | * Displays a picture. |
269 | | * |
270 | | * This callback is invoked at the time when the picture should be shown. |
271 | | * The picture must be displayed as soon as possible. |
272 | | * |
273 | | * If NULL, prepare must be valid. In that case, the plugin can handle |
274 | | * asynchronous display at the time given by the prepare call. |
275 | | * |
276 | | * \note The picture buffers may have multiple references. |
277 | | * Therefore the pixel content of the picture or of the subpicture |
278 | | * must not be changed. |
279 | | */ |
280 | | void (*display)(vout_display_t *, picture_t *pic); |
281 | | |
282 | | /** |
283 | | * Performs a control request (mandatory). |
284 | | * |
285 | | * \param query request type |
286 | | * |
287 | | * See \ref vout_display_query for the list of request types. |
288 | | */ |
289 | | int (*control)(vout_display_t *, int query); |
290 | | |
291 | | /** |
292 | | * Reset the picture format handled by the module. |
293 | | * This occurs after a |
294 | | * \ref VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, |
295 | | * \ref VOUT_DISPLAY_CHANGE_DISPLAY_FILLED, |
296 | | * \ref VOUT_DISPLAY_CHANGE_ZOOM, |
297 | | * \ref VOUT_DISPLAY_CHANGE_SOURCE_ASPECT or |
298 | | * \ref VOUT_DISPLAY_CHANGE_SOURCE_CROP |
299 | | * control query returns an error. |
300 | | * |
301 | | * \param ftmp video format that the module expects as input |
302 | | */ |
303 | | int (*reset_pictures)(vout_display_t *, video_format_t *fmtp); |
304 | | |
305 | | /** |
306 | | * Notifies a change of VR/360° viewpoint. |
307 | | * |
308 | | * May be NULL. |
309 | | * |
310 | | * \param vp viewpoint to use on the next render |
311 | | */ |
312 | | int (*set_viewpoint)(vout_display_t *, const vlc_viewpoint_t *vp); |
313 | | |
314 | | /** |
315 | | * Notifies a change in output ICC profile. |
316 | | * |
317 | | * May be NULL. Memory owned by the caller. |
318 | | * |
319 | | * \param prof new ICC profile associated with display, or NULL for none |
320 | | */ |
321 | | void (*set_icc_profile)(vout_display_t *, const vlc_icc_profile_t *prof); |
322 | | |
323 | | /** |
324 | | * Notifies a change in the input format. |
325 | | * |
326 | | * The format size is not expected to change. |
327 | | * |
328 | | * \param fmt the requested input format |
329 | | * \param ctx the video context |
330 | | * \return VLC_SUCCESS on success, another value on error |
331 | | */ |
332 | | int (*update_format)(vout_display_t *, const video_format_t *fmt, |
333 | | vlc_video_context *ctx); |
334 | | }; |
335 | | |
336 | | struct vout_display_t { |
337 | | struct vlc_object_t obj; |
338 | | |
339 | | /** |
340 | | * User configuration. |
341 | | * |
342 | | * This cannot be modified directly. It reflects the current values. |
343 | | */ |
344 | | const vout_display_cfg_t *cfg; |
345 | | |
346 | | /** |
347 | | * Source video format. |
348 | | * |
349 | | * This is the format of the video that is being displayed (after decoding |
350 | | * and filtering). It cannot be modified. |
351 | | * |
352 | | * \note |
353 | | * Cropping is not requested while in the open function. |
354 | | */ |
355 | | const video_format_t *source; |
356 | | |
357 | | /** |
358 | | * Picture format. |
359 | | * |
360 | | * This is the format of the pictures that are supplied to the |
361 | | * \ref vlc_display_operations::prepare "prepare" and |
362 | | * \ref vlc_display_operations::display "display" callbacks. |
363 | | * Ideally, it should be identical or as close as possible as \ref source. |
364 | | * |
365 | | * This can only be changed from the display module activation callback, |
366 | | * or within a \ref vlc_display_operations::reset_pictures "reset_pictures" |
367 | | * request. |
368 | | * |
369 | | * By default, it is equal to \ref source except for the aspect ratio |
370 | | * which is undefined(0) and is ignored. |
371 | | */ |
372 | | const video_format_t *fmt; |
373 | | |
374 | | /* Information |
375 | | * |
376 | | * You can only set them in the open function. |
377 | | */ |
378 | | vout_display_info_t info; |
379 | | |
380 | | /* Reserved for the vout_display_t owner. |
381 | | * |
382 | | * It must not be overwritten nor used directly by a module. |
383 | | */ |
384 | | vout_display_owner_t owner; |
385 | | |
386 | | /** |
387 | | * Private data for the display module. |
388 | | * |
389 | | * A module is free to use it as it wishes. |
390 | | */ |
391 | | void *sys; |
392 | | |
393 | | /** |
394 | | * Callbacks the display module must set on Open. |
395 | | */ |
396 | | const struct vlc_display_operations *ops; |
397 | | }; |
398 | | |
399 | | /** |
400 | | * Creates video output display. |
401 | | */ |
402 | | VLC_API |
403 | | vout_display_t *vout_display_New(vlc_object_t *, |
404 | | const video_format_t *, vlc_video_context *, |
405 | | const vout_display_cfg_t *, const char *module, |
406 | | const vout_display_owner_t *); |
407 | | |
408 | | /** |
409 | | * Destroys a video output display. |
410 | | */ |
411 | | VLC_API void vout_display_Delete(vout_display_t *); |
412 | | |
413 | | /** |
414 | | * Prepares a picture for display. |
415 | | * |
416 | | * This renders a picture for subsequent display, with vout_display_Display(). |
417 | | * |
418 | | * \note A reference to the input picture is consumed by the function, which |
419 | | * returns a reference to an output picture for display. The input and output |
420 | | * picture may or may not be equal depending on the underlying display setup. |
421 | | * |
422 | | * \bug Currently, only one picture can be prepared at a time. It must be |
423 | | * displayed with vout_display_Display() before any picture is prepared or |
424 | | * before the display is destroyd with vout_display_Delete(). |
425 | | * |
426 | | \ bug Rendering subpictures is not supported with this function yet. |
427 | | * \c subpic must be @c NULL . |
428 | | * |
429 | | * \param vd display to prepare the picture for |
430 | | * \param picture picure to be prepared |
431 | | * \param subpic reserved, must be NULL |
432 | | * \param date intended time to show the picture |
433 | | * \return The prepared picture is returned, NULL on error. |
434 | | */ |
435 | | VLC_API picture_t *vout_display_Prepare(vout_display_t *vd, picture_t *picture, |
436 | | subpicture_t *subpic, vlc_tick_t date); |
437 | | |
438 | | /** |
439 | | * Displays a picture. |
440 | | */ |
441 | | static inline void vout_display_Display(vout_display_t *vd, picture_t *picture) |
442 | 0 | { |
443 | 0 | if (vd->ops->display != NULL) |
444 | 0 | vd->ops->display(vd, picture); |
445 | 0 | } Unexecuted instantiation: input.c:vout_display_Display Unexecuted instantiation: player.c:vout_display_Display Unexecuted instantiation: aout.c:vout_display_Display Unexecuted instantiation: vout.c:vout_display_Display Unexecuted instantiation: osd.c:vout_display_Display Unexecuted instantiation: resource.c:vout_display_Display Unexecuted instantiation: video_output.c:vout_display_Display Unexecuted instantiation: vout_subpictures.c:vout_display_Display Unexecuted instantiation: video_window.c:vout_display_Display Unexecuted instantiation: vout_intf.c:vout_display_Display Unexecuted instantiation: vout_wrapper.c:vout_display_Display Unexecuted instantiation: filter.c:vout_display_Display Unexecuted instantiation: libvlc-module.c:vout_display_Display Unexecuted instantiation: es_out.c:vout_display_Display Unexecuted instantiation: filters.c:vout_display_Display Unexecuted instantiation: control.c:vout_display_Display Unexecuted instantiation: display.c:vout_display_Display Unexecuted instantiation: interlacing.c:vout_display_Display Unexecuted instantiation: snapshot.c:vout_display_Display Unexecuted instantiation: decoder.c:vout_display_Display |
446 | | |
447 | | VLC_API |
448 | | void vout_display_SetSize(vout_display_t *vd, unsigned width, unsigned height); |
449 | | |
450 | | static inline void vout_display_SendEventMousePressed(vout_display_t *vd, int button) |
451 | 0 | { |
452 | 0 | vlc_window_ReportMousePressed(vd->cfg->window, button); |
453 | 0 | } Unexecuted instantiation: input.c:vout_display_SendEventMousePressed Unexecuted instantiation: player.c:vout_display_SendEventMousePressed Unexecuted instantiation: aout.c:vout_display_SendEventMousePressed Unexecuted instantiation: vout.c:vout_display_SendEventMousePressed Unexecuted instantiation: osd.c:vout_display_SendEventMousePressed Unexecuted instantiation: resource.c:vout_display_SendEventMousePressed Unexecuted instantiation: video_output.c:vout_display_SendEventMousePressed Unexecuted instantiation: vout_subpictures.c:vout_display_SendEventMousePressed Unexecuted instantiation: video_window.c:vout_display_SendEventMousePressed Unexecuted instantiation: vout_intf.c:vout_display_SendEventMousePressed Unexecuted instantiation: vout_wrapper.c:vout_display_SendEventMousePressed Unexecuted instantiation: filter.c:vout_display_SendEventMousePressed Unexecuted instantiation: libvlc-module.c:vout_display_SendEventMousePressed Unexecuted instantiation: es_out.c:vout_display_SendEventMousePressed Unexecuted instantiation: filters.c:vout_display_SendEventMousePressed Unexecuted instantiation: control.c:vout_display_SendEventMousePressed Unexecuted instantiation: display.c:vout_display_SendEventMousePressed Unexecuted instantiation: interlacing.c:vout_display_SendEventMousePressed Unexecuted instantiation: snapshot.c:vout_display_SendEventMousePressed Unexecuted instantiation: decoder.c:vout_display_SendEventMousePressed |
454 | | static inline void vout_display_SendEventMouseReleased(vout_display_t *vd, int button) |
455 | 0 | { |
456 | 0 | vlc_window_ReportMouseReleased(vd->cfg->window, button); |
457 | 0 | } Unexecuted instantiation: input.c:vout_display_SendEventMouseReleased Unexecuted instantiation: player.c:vout_display_SendEventMouseReleased Unexecuted instantiation: aout.c:vout_display_SendEventMouseReleased Unexecuted instantiation: vout.c:vout_display_SendEventMouseReleased Unexecuted instantiation: osd.c:vout_display_SendEventMouseReleased Unexecuted instantiation: resource.c:vout_display_SendEventMouseReleased Unexecuted instantiation: video_output.c:vout_display_SendEventMouseReleased Unexecuted instantiation: vout_subpictures.c:vout_display_SendEventMouseReleased Unexecuted instantiation: video_window.c:vout_display_SendEventMouseReleased Unexecuted instantiation: vout_intf.c:vout_display_SendEventMouseReleased Unexecuted instantiation: vout_wrapper.c:vout_display_SendEventMouseReleased Unexecuted instantiation: filter.c:vout_display_SendEventMouseReleased Unexecuted instantiation: libvlc-module.c:vout_display_SendEventMouseReleased Unexecuted instantiation: es_out.c:vout_display_SendEventMouseReleased Unexecuted instantiation: filters.c:vout_display_SendEventMouseReleased Unexecuted instantiation: control.c:vout_display_SendEventMouseReleased Unexecuted instantiation: display.c:vout_display_SendEventMouseReleased Unexecuted instantiation: interlacing.c:vout_display_SendEventMouseReleased Unexecuted instantiation: snapshot.c:vout_display_SendEventMouseReleased Unexecuted instantiation: decoder.c:vout_display_SendEventMouseReleased |
458 | | static inline void vout_display_SendEventViewpointMoved(vout_display_t *vd, |
459 | | const vlc_viewpoint_t *vp) |
460 | 0 | { |
461 | 0 | if (vd->owner.viewpoint_moved) |
462 | 0 | vd->owner.viewpoint_moved(vd->owner.sys, vp); |
463 | 0 | } Unexecuted instantiation: input.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: player.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: aout.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: vout.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: osd.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: resource.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: video_output.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: vout_subpictures.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: video_window.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: vout_intf.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: vout_wrapper.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: filter.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: libvlc-module.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: es_out.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: filters.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: control.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: display.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: interlacing.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: snapshot.c:vout_display_SendEventViewpointMoved Unexecuted instantiation: decoder.c:vout_display_SendEventViewpointMoved |
464 | | |
465 | | /** |
466 | | * Helper function that applies the necessary transforms to the mouse position |
467 | | * and then calls vout_display_SendEventMouseMoved. |
468 | | * |
469 | | * \param vd vout_display_t. |
470 | | * \param m_x Mouse x position (relative to place, origin is top left). |
471 | | * \param m_y Mouse y position (relative to place, origin is top left). |
472 | | */ |
473 | | static inline void vout_display_SendMouseMovedDisplayCoordinates(vout_display_t *vd, int m_x, int m_y) |
474 | 0 | { |
475 | 0 | vlc_window_ReportMouseMoved(vd->cfg->window, m_x, m_y); |
476 | 0 | } Unexecuted instantiation: input.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: player.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: aout.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: vout.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: osd.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: resource.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: video_output.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: vout_subpictures.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: video_window.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: vout_intf.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: vout_wrapper.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: filter.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: libvlc-module.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: es_out.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: filters.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: control.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: display.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: interlacing.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: snapshot.c:vout_display_SendMouseMovedDisplayCoordinates Unexecuted instantiation: decoder.c:vout_display_SendMouseMovedDisplayCoordinates |
477 | | |
478 | | static inline bool vout_display_cfg_IsWindowed(const vout_display_cfg_t *cfg) |
479 | 0 | { |
480 | 0 | return cfg->window->type != VLC_WINDOW_TYPE_DUMMY; |
481 | 0 | } Unexecuted instantiation: input.c:vout_display_cfg_IsWindowed Unexecuted instantiation: player.c:vout_display_cfg_IsWindowed Unexecuted instantiation: aout.c:vout_display_cfg_IsWindowed Unexecuted instantiation: vout.c:vout_display_cfg_IsWindowed Unexecuted instantiation: osd.c:vout_display_cfg_IsWindowed Unexecuted instantiation: resource.c:vout_display_cfg_IsWindowed Unexecuted instantiation: video_output.c:vout_display_cfg_IsWindowed Unexecuted instantiation: vout_subpictures.c:vout_display_cfg_IsWindowed Unexecuted instantiation: video_window.c:vout_display_cfg_IsWindowed Unexecuted instantiation: vout_intf.c:vout_display_cfg_IsWindowed Unexecuted instantiation: vout_wrapper.c:vout_display_cfg_IsWindowed Unexecuted instantiation: filter.c:vout_display_cfg_IsWindowed Unexecuted instantiation: libvlc-module.c:vout_display_cfg_IsWindowed Unexecuted instantiation: es_out.c:vout_display_cfg_IsWindowed Unexecuted instantiation: filters.c:vout_display_cfg_IsWindowed Unexecuted instantiation: control.c:vout_display_cfg_IsWindowed Unexecuted instantiation: display.c:vout_display_cfg_IsWindowed Unexecuted instantiation: interlacing.c:vout_display_cfg_IsWindowed Unexecuted instantiation: snapshot.c:vout_display_cfg_IsWindowed Unexecuted instantiation: decoder.c:vout_display_cfg_IsWindowed |
482 | | |
483 | | /** |
484 | | * Computes the default display size given the source and |
485 | | * the display configuration. |
486 | | * |
487 | | * This assumes that the picture is already cropped. |
488 | | */ |
489 | | VLC_API |
490 | | void vout_display_GetDefaultDisplaySize(unsigned *width, unsigned *height, |
491 | | const video_format_t *source, |
492 | | const struct vout_display_placement *); |
493 | | |
494 | | /** |
495 | | * Video placement. |
496 | | * |
497 | | * This structure stores the result of a vout_display_PlacePicture() call. |
498 | | */ |
499 | | typedef struct { |
500 | | int x; /*< Relative pixel offset from the display left edge */ |
501 | | int y; /*< Relative pixel offset from the display top edge */ |
502 | | unsigned width; /*< Picture pixel width */ |
503 | | unsigned height; /*< Picture pixel height */ |
504 | | } vout_display_place_t; |
505 | | |
506 | | /** |
507 | | * Compares two \ref vout_display_place_t. |
508 | | */ |
509 | | static inline bool vout_display_PlaceEquals(const vout_display_place_t *p1, |
510 | | const vout_display_place_t *p2) |
511 | 0 | { |
512 | 0 | return p1->x == p2->x && p1->width == p2->width && |
513 | 0 | p1->y == p2->y && p1->height == p2->height; |
514 | 0 | } Unexecuted instantiation: input.c:vout_display_PlaceEquals Unexecuted instantiation: player.c:vout_display_PlaceEquals Unexecuted instantiation: aout.c:vout_display_PlaceEquals Unexecuted instantiation: vout.c:vout_display_PlaceEquals Unexecuted instantiation: osd.c:vout_display_PlaceEquals Unexecuted instantiation: resource.c:vout_display_PlaceEquals Unexecuted instantiation: video_output.c:vout_display_PlaceEquals Unexecuted instantiation: vout_subpictures.c:vout_display_PlaceEquals Unexecuted instantiation: video_window.c:vout_display_PlaceEquals Unexecuted instantiation: vout_intf.c:vout_display_PlaceEquals Unexecuted instantiation: vout_wrapper.c:vout_display_PlaceEquals Unexecuted instantiation: filter.c:vout_display_PlaceEquals Unexecuted instantiation: libvlc-module.c:vout_display_PlaceEquals Unexecuted instantiation: es_out.c:vout_display_PlaceEquals Unexecuted instantiation: filters.c:vout_display_PlaceEquals Unexecuted instantiation: control.c:vout_display_PlaceEquals Unexecuted instantiation: display.c:vout_display_PlaceEquals Unexecuted instantiation: interlacing.c:vout_display_PlaceEquals Unexecuted instantiation: snapshot.c:vout_display_PlaceEquals Unexecuted instantiation: decoder.c:vout_display_PlaceEquals |
515 | | |
516 | | /** |
517 | | * Computes the intended picture placement inside the display. |
518 | | * |
519 | | * This function computes where to show a picture inside the display with |
520 | | * respect to the provided parameters, and returns the result |
521 | | * in a \ref vout_display_place_t structure. |
522 | | * |
523 | | * This assumes that cropping is done by an external mean. |
524 | | * |
525 | | * \param place Storage space for the picture placement [OUT] |
526 | | * \param source Video source format |
527 | | * \param cfg Display configuration |
528 | | */ |
529 | | VLC_API |
530 | | void vout_display_PlacePicture(vout_display_place_t *restrict place, |
531 | | const video_format_t *restrict source, |
532 | | const struct vout_display_placement *cfg); |
533 | | |
534 | | /** |
535 | | * Translates coordinates. |
536 | | * |
537 | | * This translates coordinates from window pixel coordinate space to |
538 | | * original video sample coordinate space. |
539 | | * |
540 | | * \param x pointer to abscissa to be translated |
541 | | * \param y pointer to ordinate to be translated |
542 | | * \param fmt video format |
543 | | * \param dp display configuration |
544 | | */ |
545 | | void vout_display_TranslateCoordinates(int *x, int *y, |
546 | | const video_format_t *fmt, |
547 | | const struct vout_display_placement *dp); |
548 | | |
549 | | /** @} */ |
550 | | #endif /* VLC_VOUT_DISPLAY_H */ |