1 /*
2  * This file is part of mpv.
3  *
4  * mpv is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * mpv is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with mpv.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef MPLAYER_SCREENSHOT_H
19 #define MPLAYER_SCREENSHOT_H
20 
21 #include <stdbool.h>
22 
23 struct MPContext;
24 struct mp_image;
25 struct mp_log;
26 struct mpv_global;
27 
28 // One time initialization at program start.
29 void screenshot_init(struct MPContext *mpctx);
30 
31 // Called by the playback core on each iteration.
32 void handle_each_frame_screenshot(struct MPContext *mpctx);
33 
34 /* Return the image converted to the given format. If the pixel aspect ratio is
35  * not 1:1, the image is scaled as well. Returns NULL on failure.
36  * If global!=NULL, use command line scaler options etc.
37  */
38 struct mp_image *convert_image(struct mp_image *image, int destfmt,
39                                struct mpv_global *global, struct mp_log *log);
40 
41 // Handlers for the user-facing commands.
42 void cmd_screenshot(void *p);
43 void cmd_screenshot_to_file(void *p);
44 void cmd_screenshot_raw(void *p);
45 
46 #endif /* MPLAYER_SCREENSHOT_H */
47