2011-10-06 18:46:01 +00:00
|
|
|
/*
|
2015-04-13 07:36:54 +00:00
|
|
|
* This file is part of mpv.
|
2011-10-06 18:46:01 +00:00
|
|
|
*
|
2015-04-13 07:36:54 +00:00
|
|
|
* mpv is free software; you can redistribute it and/or modify
|
2011-10-06 18:46:01 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2015-04-13 07:36:54 +00:00
|
|
|
* mpv is distributed in the hope that it will be useful,
|
2011-10-06 18:46:01 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
2015-04-13 07:36:54 +00:00
|
|
|
* with mpv. If not, see <http://www.gnu.org/licenses/>.
|
2011-10-06 18:46:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MPLAYER_SCREENSHOT_H
|
|
|
|
#define MPLAYER_SCREENSHOT_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
struct MPContext;
|
|
|
|
|
screenshot: make screenshot filenames configurable
This adds the --screenshot-template option, which specifies a template
for the filename used for a screenshot. The '%' character is parsed as
format specifier. These format specifiers insert metadata into the
filename. For example, '%f' is replaced with the filename of the
currently played file.
The following format specifiers are available:
%n Insert sequence number (padded with 4 zeros), e.g. "0002".
%0Nn Like %n, but pad to N zeros (N = 0 to 9).
%n behaves like %04n.
%#n Like %n, but reset the sequence counter on every screenshot.
(Useful if other parts in the template make the resulting
filename already mostly unique.)
%#0Nn Use %0Nn and %#n at the same time.
%f Insert filename of the currently played video.
%F Like %f, but with stripped file extension ("." and rest).
%p Insert current playback time, in HH:MM:SS format.
%P Like %p, but adds milliseconds: HH:MM:SS.mmmm
%tX Insert the current local date/time, using the date format X.
X is a single letter and is passed to strftime() as "%X".
E.g. "%td" inserts the number of the current day.
%{prop} Insert the value of the slave property 'prop'.
E.g. %{filename} is the same as %f. If the property doesn't
exist or is not available, nothing is inserted, unless a
fallback is specified as in %{prop:fallback text}.
%% Insert the character '%'.
The strings inserted by format specifiers will be checked for
characters not allowed in filenames (including '/' and '\'), and
replaced with the placeholder '_'. (This doesn't happen for text that
was passed with the --screenshot-template option, and allows specifying
a screenshot target directory by prefixing the template with a relative
or absolute path.)
2012-02-29 02:46:25 +00:00
|
|
|
// One time initialization at program start.
|
|
|
|
void screenshot_init(struct MPContext *mpctx);
|
|
|
|
|
2011-10-06 18:46:01 +00:00
|
|
|
// Request a taking & saving a screenshot of the currently displayed frame.
|
2012-10-20 21:58:02 +00:00
|
|
|
// mode: 0: -, 1: save the actual output window contents, 2: with subtitles.
|
2011-10-06 18:46:01 +00:00
|
|
|
// each_frame: If set, this toggles per-frame screenshots, exactly like the
|
|
|
|
// screenshot slave command (MP_CMD_SCREENSHOT).
|
2013-02-24 21:52:47 +00:00
|
|
|
// osd: show status on OSD
|
|
|
|
void screenshot_request(struct MPContext *mpctx, int mode, bool each_frame,
|
|
|
|
bool osd);
|
2011-10-06 18:46:01 +00:00
|
|
|
|
2013-07-08 18:34:26 +00:00
|
|
|
// filename: where to store the screenshot; doesn't try to find an alternate
|
|
|
|
// name if the file already exists
|
|
|
|
// mode, osd: same as in screenshot_request()
|
|
|
|
void screenshot_to_file(struct MPContext *mpctx, const char *filename, int mode,
|
|
|
|
bool osd);
|
|
|
|
|
2011-10-06 18:46:01 +00:00
|
|
|
// Called by the playback core code when a new frame is displayed.
|
|
|
|
void screenshot_flip(struct MPContext *mpctx);
|
|
|
|
|
|
|
|
#endif /* MPLAYER_SCREENSHOT_H */
|