summaryrefslogtreecommitdiffstats
path: root/mplayer.c
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 /mplayer.c
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 'mplayer.c')
-rw-r--r--mplayer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mplayer.c b/mplayer.c
index 7030a50da0..70ad4d04e0 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -73,6 +73,7 @@
#include "mp_osd.h"
#include "libvo/video_out.h"
+#include "screenshot.h"
#include "sub/font_load.h"
#include "sub/sub.h"
@@ -791,6 +792,8 @@ void exit_player_with_rc(struct MPContext *mpctx, enum exit_reason how, int rc)
m_config_free(mpctx->mconfig);
mpctx->mconfig = NULL;
+ talloc_free(mpctx);
+
exit(rc);
}
@@ -3711,6 +3714,7 @@ static void run_playloop(struct MPContext *mpctx)
get_relative_time(mpctx);
}
print_status(mpctx, MP_NOPTS_VALUE, true);
+ screenshot_flip(mpctx);
} else
print_status(mpctx, MP_NOPTS_VALUE, false);
@@ -3943,7 +3947,8 @@ int main(int argc, char *argv[])
int opt_exit = 0;
int i;
- struct MPContext *mpctx = &(struct MPContext){
+ struct MPContext *mpctx = talloc(NULL, MPContext);
+ *mpctx = (struct MPContext){
.osd_function = OSD_PLAY,
.begin_skip = MP_NOPTS_VALUE,
.play_tree_step = 1,