summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf.h
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2011-10-06 20:46:01 +0200
committerUoti Urpala <uau@mplayer2.org>2011-11-25 23:56:28 +0200
commit01cf896a2f0d8be92c6d6633095fa2719a8c0e58 (patch)
tree674e4a00ffc236651bc1035fb411541cc55efede /libmpcodecs/vf.h
parente3f5043233336d8b4b0731c6a8b42a8fda5535ac (diff)
downloadmpv-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 'libmpcodecs/vf.h')
-rw-r--r--libmpcodecs/vf.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h
index 11ee5eaf8e..e1df715551 100644
--- a/libmpcodecs/vf.h
+++ b/libmpcodecs/vf.h
@@ -95,6 +95,12 @@ typedef struct vf_seteq_s
int value;
} vf_equalizer_t;
+struct vf_ctrl_screenshot {
+ // When the screenshot is complete, pass it to this callback.
+ void (*image_callback)(void *, mp_image_t *);
+ void *image_callback_ctx;
+};
+
#define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
#define VFCTRL_SET_PP_LEVEL 5 /* set postprocessing level */
#define VFCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */
@@ -104,7 +110,7 @@ typedef struct vf_seteq_s
#define VFCTRL_DUPLICATE_FRAME 11 /* For encoding - encode zero-change frame */
#define VFCTRL_SKIP_NEXT_FRAME 12 /* For encoding - drop the next frame that passes thru */
#define VFCTRL_FLUSH_FRAMES 13 /* For encoding - flush delayed frames */
-#define VFCTRL_SCREENSHOT 14 /* Make a screenshot */
+#define VFCTRL_SCREENSHOT 14 // Take screenshot, arg is vf_ctrl_screenshot
#define VFCTRL_INIT_EOSD 15 /* Select EOSD renderer */
#define VFCTRL_DRAW_EOSD 16 /* Render EOSD */
#define VFCTRL_SET_DEINTERLACE 18 /* Set deinterlacing status */