diff options
author | wm4 <wm4@mplayer2.org> | 2011-10-06 20:46:01 +0200 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-11-25 23:56:28 +0200 |
commit | 01cf896a2f0d8be92c6d6633095fa2719a8c0e58 (patch) | |
tree | 674e4a00ffc236651bc1035fb411541cc55efede /libvo | |
parent | e3f5043233336d8b4b0731c6a8b42a8fda5535ac (diff) | |
download | mpv-01cf896a2f0d8be92c6d6633095fa2719a8c0e58.tar.bz2 mpv-01cf896a2f0d8be92c6d6633095fa2719a8c0e58.tar.xz |
core: add infrastructure to get screenshots from VOs
Add a VO command (VOCTRL_SCREENSHOT) which requests a screenshot
directly from the VO. If VO support is available, screenshots will be
taken instantly (no more 1 or 2 frames delay). Taking screenshots when
hardware decoding is in use will also work (vdpau). Additionally, the
screenshots will now use the same colorspace as the video display.
Change the central MPContext to be allocated with talloc so that it
can be used as a talloc parent context.
This commit does not yet implement the functionality for any VO (added
in subsequent commits).
The old screenshot video filter is not needed anymore if VO support is
present, and in that case will not be used even if it is present in
the filter chain. If VO support is not available then the filter is
used like before. Note that the filter still has some of the old
problems, such as delaying the screenshot by at least 1 frame.
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/video_out.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libvo/video_out.h b/libvo/video_out.h index d1a2a7f65a..fd61d9c1a1 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -78,6 +78,8 @@ enum mp_voctrl { VOCTRL_SET_YUV_COLORSPACE, // struct mp_csp_details VOCTRL_GET_YUV_COLORSPACE, // struct mp_csp_details + + VOCTRL_SCREENSHOT, // struct voctrl_screenshot_args }; // VOCTRL_SET_EQUALIZER @@ -104,6 +106,16 @@ typedef struct mp_eosd_res { int mt, mb, ml, mr; // borders (top, bottom, left, right) } mp_eosd_res_t; +// VOCTRL_SCREENSHOT +struct voctrl_screenshot_args { + // Will be set to a newly allocated image, that contains the screenshot. + // The caller has to free the pointer with free_mp_image(). + // It is not specified whether the image data is a copy or references the + // image data directly. + // Is never NULL. (Failure has to be indicated by returning VO_FALSE.) + struct mp_image *out_image; +}; + typedef struct { int x,y; int w,h; |