2001-02-24 20:28:24 +00:00
|
|
|
/*
|
2009-02-08 03:27:30 +00:00
|
|
|
* Copyright (C) Aaron Holtzman - Aug 1999
|
|
|
|
* Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
|
|
|
|
* (C) MPlayer developers
|
2001-02-24 20:28:24 +00:00
|
|
|
*
|
2009-02-08 03:27:30 +00:00
|
|
|
* This file is part of MPlayer.
|
2001-02-24 20:28:24 +00:00
|
|
|
*
|
2009-02-08 03:27:30 +00:00
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* 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
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2001-02-24 20:28:24 +00:00
|
|
|
*/
|
2009-02-08 03:27:30 +00:00
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#ifndef MPLAYER_VIDEO_OUT_H
|
|
|
|
#define MPLAYER_VIDEO_OUT_H
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
#include <inttypes.h>
|
2009-09-17 14:52:09 +00:00
|
|
|
#include <stdbool.h>
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2012-11-09 00:06:43 +00:00
|
|
|
#include "video/img_format.h"
|
2013-08-06 20:41:30 +00:00
|
|
|
#include "mpvcore/mp_common.h"
|
|
|
|
#include "mpvcore/options.h"
|
2009-10-14 01:12:10 +00:00
|
|
|
|
2001-03-03 21:46:39 +00:00
|
|
|
#define VO_EVENT_EXPOSE 1
|
|
|
|
#define VO_EVENT_RESIZE 2
|
|
|
|
|
2011-08-22 20:24:07 +00:00
|
|
|
enum mp_voctrl {
|
|
|
|
/* signal a device reset seek */
|
2012-11-04 15:24:18 +00:00
|
|
|
VOCTRL_RESET = 1,
|
2013-05-15 16:17:18 +00:00
|
|
|
/* Handle input and redraw events, called by vo_check_events() */
|
|
|
|
VOCTRL_CHECK_EVENTS,
|
2011-08-22 20:24:07 +00:00
|
|
|
/* used to switch to fullscreen */
|
|
|
|
VOCTRL_FULLSCREEN,
|
|
|
|
/* signal a device pause */
|
|
|
|
VOCTRL_PAUSE,
|
|
|
|
/* start/resume playback */
|
|
|
|
VOCTRL_RESUME,
|
2012-11-06 14:27:44 +00:00
|
|
|
|
2011-08-22 20:24:07 +00:00
|
|
|
VOCTRL_GET_PANSCAN,
|
|
|
|
VOCTRL_SET_PANSCAN,
|
2013-06-07 23:35:44 +00:00
|
|
|
VOCTRL_SET_EQUALIZER, // struct voctrl_set_equalizer_args*
|
|
|
|
VOCTRL_GET_EQUALIZER, // struct voctrl_get_equalizer_args*
|
2011-08-22 20:24:07 +00:00
|
|
|
|
video: add vaapi decode and output support
This is based on the MPlayer VA API patches. To be exact it's based on
a very stripped down version of commit f1ad459a263f8537f6c from
git://gitorious.org/vaapi/mplayer.git.
This doesn't contain useless things like benchmarking hacks and the
demo code for GLX interop. Also, unlike in the original patch, decoding
and video output are split into separate source files (the separation
between decoding and display also makes pixel format hacks unnecessary).
On the other hand, some features not present in the original patch were
added, like screenshot support.
VA API is rather bad for actual video output. Dealing with older libva
versions or the completely broken vdpau backend doesn't help. OSD is
low quality and should be rather slow. In some cases, only either OSD
or subtitles can be shown at the same time (because OSD is drawn first,
OSD is prefered).
Also, libva can't decide whether it accepts straight or premultiplied
alpha for OSD sub-pictures: the vdpau backend seems to assume
premultiplied, while a native vaapi driver uses straight. So I picked
straight alpha. It doesn't matter much, because the blending code for
straight alpha I added to img_convert.c is probably buggy, and ASS
subtitles might be blended incorrectly.
Really good video output with VA API would probably use OpenGL and the
GL interop features, but at this point you might just use vo_opengl.
(Patches for making HW decoding with vo_opengl have a chance of being
accepted.)
Despite these issues, decoding seems to work ok. I still got tearing
on the Intel system I tested (Intel(R) Core(TM) i3-2350M). It was also
tested with the vdpau vaapi wrapper on a nvidia system; however this
was rather broken. (Fortunately, there is no reason to use mpv's VAAPI
support over native VDPAU.)
2013-08-09 12:01:30 +00:00
|
|
|
/* for hardware decoding */
|
vdpau: split off decoder parts, use "new" libavcodec vdpau hwaccel API
Move the decoder parts from vo_vdpau.c to a new file vdpau_old.c. This
file is named so because because it's written against the "old"
libavcodec vdpau pseudo-decoder (e.g. "h264_vdpau").
Add support for the "new" libavcodec vdpau support. This was recently
added and replaces the "old" vdpau parts. (In fact, Libav is about to
deprecate and remove the "old" API without deprecation grace period,
so we have to support it now. Moreover, there will probably be no Libav
release which supports both, so the transition is even less smooth than
we could hope, and we have to support both the old and new API.)
Whether the old or new API is used is checked by a configure test: if
the new API is found, it is used, otherwise the old API is assumed.
Some details might be handled differently. Especially display preemption
is a bit problematic with the "new" libavcodec vdpau support: it wants
to keep a pointer to a specific vdpau API function (which can be driver
specific, because preemption might switch drivers). Also, surface IDs
are now directly stored in AVFrames (and mp_images), so they can't be
forced to VDP_INVALID_HANDLE on preemption. (This changes even with
older libavcodec versions, because mp_image always uses the newer
representation to make vo_vdpau.c simpler.)
Decoder initialization in the new code tries to deal with codec
profiles, while the old code always uses the highest profile per codec.
Surface allocation changes. Since the decoder won't call config() in
vo_vdpau.c on video size change anymore, we allow allocating surfaces
of arbitrary size instead of locking it to what the VO was configured.
The non-hwdec code also has slightly different allocation behavior now.
Enabling the old vdpau special decoders via e.g. --vd=lavc:h264_vdpau
doesn't work anymore (a warning suggesting the --hwdec option is
printed instead).
2013-07-27 23:49:45 +00:00
|
|
|
VOCTRL_GET_HWDEC_INFO, // struct mp_hwdec_info*
|
2012-11-04 16:17:11 +00:00
|
|
|
|
2011-12-04 16:10:17 +00:00
|
|
|
VOCTRL_NEWFRAME,
|
|
|
|
VOCTRL_SKIPFRAME,
|
2011-12-05 03:24:18 +00:00
|
|
|
VOCTRL_REDRAW_FRAME,
|
2011-08-22 20:24:07 +00:00
|
|
|
|
|
|
|
VOCTRL_ONTOP,
|
|
|
|
VOCTRL_BORDER,
|
2013-06-15 17:04:20 +00:00
|
|
|
VOCTRL_UPDATE_WINDOW_TITLE, // char*
|
2011-08-22 20:24:07 +00:00
|
|
|
|
2013-06-07 23:35:44 +00:00
|
|
|
VOCTRL_SET_CURSOR_VISIBILITY, // bool*
|
2013-05-16 21:17:46 +00:00
|
|
|
|
2013-06-13 22:03:32 +00:00
|
|
|
VOCTRL_KILL_SCREENSAVER,
|
|
|
|
VOCTRL_RESTORE_SCREENSAVER,
|
|
|
|
|
2011-08-22 20:24:07 +00:00
|
|
|
VOCTRL_SET_DEINTERLACE,
|
|
|
|
VOCTRL_GET_DEINTERLACE,
|
|
|
|
|
|
|
|
VOCTRL_UPDATE_SCREENINFO,
|
input: handle mouse movement differently
Before this commit, mouse movement events emitted a special command
("set_mouse_pos"), which was specially handled in command.c. This was
once special-cased to the dvdnav and menu code, and did nothing after
libmenu and dvdnav were removed.
Change it so that mouse movement triggers a pseudo-key ("MOUSE_MOVE"),
which then can be bound to an arbitrary command. The mouse position is
now managed in input.c. A command which actually needs the mouse
position can use either mp_input_get_mouse_pos() or mp_get_osd_mouse_pos()
to query it. The former returns raw window-space coordinates, while the
latter returns coordinates transformed to OSD- space. (Both are the same
for most VOs, except vo_xv and vo_x11, which can't render OSD in
window-space. These require extra code for mapping mouse position.)
As of this commit, there is still nothing that uses mouse movement, so
MOUSE_MOVE is mapped to "ignore" to silence warnings when moving the
mouse (much like MOUSE_BTN0).
Extend the concept of input sections. Allow multiple sections to be
active at once, and organize them as stack. Bindings from the top of
the stack are preferred to lower ones.
Each section has a mouse input section associated, inside which mouse
events are associated with the bindings. If the mouse pointer is
outside of a section's mouse area, mouse events will be dispatched to
an input section lower on the stack of active sections. This is intended
for scripting, which is to be added later. Two scripts could occupy
different areas of the screen without conflicting with each other. (If
it turns out that this mechanism is useless, we'll just remove it
again.)
2013-04-26 00:13:30 +00:00
|
|
|
VOCTRL_WINDOW_TO_OSD_COORDS, // float[2] (x/y)
|
2011-08-22 20:24:07 +00:00
|
|
|
|
2013-06-07 23:35:44 +00:00
|
|
|
VOCTRL_SET_YUV_COLORSPACE, // struct mp_csp_details*
|
|
|
|
VOCTRL_GET_YUV_COLORSPACE, // struct mp_csp_details*
|
2011-10-06 18:46:01 +00:00
|
|
|
|
2013-06-07 23:35:44 +00:00
|
|
|
VOCTRL_SCREENSHOT, // struct voctrl_screenshot_args*
|
2012-07-31 23:06:59 +00:00
|
|
|
|
2013-06-07 23:35:44 +00:00
|
|
|
VOCTRL_SET_COMMAND_LINE, // char**
|
2011-08-22 20:24:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// VOCTRL_SET_EQUALIZER
|
2008-04-02 15:51:38 +00:00
|
|
|
struct voctrl_set_equalizer_args {
|
|
|
|
const char *name;
|
|
|
|
int value;
|
|
|
|
};
|
2011-08-22 20:24:07 +00:00
|
|
|
|
|
|
|
// VOCTRL_GET_EQUALIZER
|
2008-04-02 15:51:38 +00:00
|
|
|
struct voctrl_get_equalizer_args {
|
|
|
|
const char *name;
|
|
|
|
int *valueptr;
|
|
|
|
};
|
2006-11-17 18:16:21 +00:00
|
|
|
|
2011-10-06 18:46:01 +00:00
|
|
|
// VOCTRL_SCREENSHOT
|
|
|
|
struct voctrl_screenshot_args {
|
2011-10-06 18:46:01 +00:00
|
|
|
// 0: Save image of the currently displayed video frame, in original
|
|
|
|
// resolution.
|
|
|
|
// 1: Save full screenshot of the window. Should contain OSD, EOSD, and the
|
|
|
|
// scaled video.
|
|
|
|
// The value of this variable can be ignored if only a single method is
|
|
|
|
// implemented.
|
|
|
|
int full_window;
|
2011-10-06 18:46:01 +00:00
|
|
|
// Will be set to a newly allocated image, that contains the screenshot.
|
2012-12-22 20:46:22 +00:00
|
|
|
// The caller has to free the image with talloc_free().
|
2011-10-06 18:46:01 +00:00
|
|
|
// 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;
|
2012-10-20 21:32:45 +00:00
|
|
|
// Whether the VO rendered OSD/subtitles into out_image
|
|
|
|
bool has_osd;
|
2011-10-06 18:46:01 +00:00
|
|
|
};
|
|
|
|
|
2013-06-15 16:59:52 +00:00
|
|
|
#define VO_TRUE true
|
|
|
|
#define VO_FALSE false
|
2002-02-09 00:47:26 +00:00
|
|
|
#define VO_ERROR -1
|
|
|
|
#define VO_NOTAVAIL -2
|
|
|
|
#define VO_NOTIMPL -3
|
|
|
|
|
2002-02-17 03:06:38 +00:00
|
|
|
#define VOFLAG_FLIPPING 0x08
|
2010-02-04 22:08:23 +00:00
|
|
|
#define VOFLAG_HIDDEN 0x10 //< Use to create a hidden window
|
2010-11-10 22:48:41 +00:00
|
|
|
#define VOFLAG_STEREO 0x20 //< Use to create a stereo-capable window
|
2012-10-02 23:54:13 +00:00
|
|
|
#define VOFLAG_GL_DEBUG 0x40 // Hint to request debug OpenGL context
|
2013-03-28 20:44:27 +00:00
|
|
|
#define VOFLAG_ALPHA 0x80 // Hint to request alpha framebuffer
|
2002-02-17 03:06:38 +00:00
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
typedef struct vo_info_s
|
|
|
|
{
|
2009-09-17 14:52:09 +00:00
|
|
|
/* driver name ("Matrox Millennium G200/G400" */
|
|
|
|
const char *name;
|
libvo, libao: remove useless video and audio output drivers
Some of these have only limited use, and some of these have no use at
all. Remove them. They make maintainance harder and nobody needs them.
It's possible that many of the removed drivers were very useful a dozen
of years ago, but now it's 2012.
Note that some of these could be added back, in case they were more
useful than I thought. But right now, they are just a burden.
Reason for removal for each module:
vo_3dfx, vo_dfbmga, vo_dxr3, vo_ivtv, vo_mga, vo_s3fb,
vo_tdfxfb, vo_xmga, vo_tdfx_vid:
All of these are for very specific and outdated hardware. Some
of them require non-standard kernel drivers or do direct HW
access.
vo_dga: the most crappy and ancient way to get fast output on X.
vo_aa: there's vo_caca for the same purpose.
vo_ggi: this never lived, and is entirely useless.
vo_mpegpes: for DVB cards, I can't test this and it's crappy.
vo_fbdev, vo_fbdev2: there's vo_directfb2
vo_bl: what is this even? But it's neither important, nor alive.
vo_svga, vo_vesa: you want to use this? You can't be serious.
vo_wii: I can't test this, and who the hell uses this?
vo_xvr100: some Sun thing.
vo_xover: only useful in connection with xvr100.
ao_nas: still alive, but I doubt it has any meaning today.
ao_sun: Sun.
ao_win32: use ao_dsound or ao_portaudio instead.
ao_ivtv: removed along vo_ivtv.
Also get rid of anything SDL related. SDL 1.x is total crap for video
output, and will be replaced with SDL 2.x soon (perhaps), so if you
want to use SDL, write output drivers for SDL 2.x.
Additionally, I accidentally damaged Sun support, which made me
completely remove Sun/Solaris support. Nobody cares about this anyway.
Some left overs from previous commits removing modules were cleaned up.
2012-07-28 18:20:17 +00:00
|
|
|
/* short name (for config strings) ("vdpau") */
|
2009-09-17 14:52:09 +00:00
|
|
|
const char *short_name;
|
|
|
|
/* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
|
|
|
|
const char *author;
|
|
|
|
/* any additional comments */
|
|
|
|
const char *comment;
|
2001-02-24 20:28:24 +00:00
|
|
|
} vo_info_t;
|
|
|
|
|
2008-04-03 03:25:41 +00:00
|
|
|
struct vo;
|
2008-06-23 22:53:58 +00:00
|
|
|
struct osd_state;
|
2009-09-18 13:27:55 +00:00
|
|
|
struct mp_image;
|
2013-06-07 23:35:44 +00:00
|
|
|
struct mp_image_params;
|
2008-04-03 03:25:41 +00:00
|
|
|
|
|
|
|
struct vo_driver {
|
2009-09-18 13:27:55 +00:00
|
|
|
// Driver buffers or adds (deinterlace) frames and will keep track
|
|
|
|
// of pts values itself
|
|
|
|
bool buffer_frames;
|
2009-09-17 14:52:09 +00:00
|
|
|
|
2013-02-06 21:54:03 +00:00
|
|
|
// Encoding functionality, which can be invoked via --o only.
|
|
|
|
bool encode;
|
|
|
|
|
2009-09-17 14:52:09 +00:00
|
|
|
const vo_info_t *info;
|
|
|
|
/*
|
|
|
|
* returns: zero on successful initialization, non-zero on error.
|
|
|
|
*/
|
2013-07-22 20:52:42 +00:00
|
|
|
int (*preinit)(struct vo *vo);
|
2012-11-04 15:24:18 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Whether the given image format is supported and config() will succeed.
|
video: decouple internal pixel formats from FourCCs
mplayer's video chain traditionally used FourCCs for pixel formats. For
example, it used IMGFMT_YV12 for 4:2:0 YUV, which was defined to the
string 'YV12' interpreted as unsigned int. Additionally, it used to
encode information into the numeric values of some formats. The RGB
formats had their bit depth and endian encoded into the least
significant byte. Extended planar formats (420P10 etc.) had chroma
shift, endian, and component bit depth encoded. (This has been removed
in recent commits.)
Replace the FourCC mess with a simple enum. Remove all the redundant
formats like YV12/I420/IYUV. Replace some image format names by
something more intuitive, most importantly IMGFMT_YV12 -> IMGFMT_420P.
Add img_fourcc.h, which contains the old IDs for code that actually uses
FourCCs. Change the way demuxers, that output raw video, identify the
video format: they set either MP_FOURCC_RAWVIDEO or MP_FOURCC_IMGFMT to
request the rawvideo decoder, and sh_video->imgfmt specifies the pixel
format. Like the previous hack, this is supposed to avoid the need for
a complete codecs.cfg entry per format, or other lookup tables. (Note
that the RGB raw video FourCCs mostly rely on ffmpeg's mappings for NUT
raw video, but this is still considered better than adding a raw video
decoder - even if trivial, it would be full of annoying lookup tables.)
The TV code has not been tested.
Some corrective changes regarding endian and other image format flags
creep in.
2012-12-23 19:03:30 +00:00
|
|
|
* format: one of IMGFMT_*
|
2012-11-04 15:24:18 +00:00
|
|
|
* returns: 0 on not supported, otherwise a bitmask of VFCAP_* values
|
|
|
|
*/
|
|
|
|
int (*query_format)(struct vo *vo, uint32_t format);
|
|
|
|
|
2009-09-17 14:52:09 +00:00
|
|
|
/*
|
2013-06-07 23:35:44 +00:00
|
|
|
* Initialize or reconfigure the display driver.
|
2009-09-17 14:52:09 +00:00
|
|
|
* width,height: image source size
|
2013-06-07 23:35:44 +00:00
|
|
|
* d_width,d_height: requested window size, just a hint
|
|
|
|
* flags: combination of VOFLAG_ values
|
2009-09-17 14:52:09 +00:00
|
|
|
* title: window title, if available
|
|
|
|
* format: fourcc of pixel format
|
|
|
|
* returns : zero on successful initialization, non-zero on error.
|
|
|
|
*/
|
|
|
|
int (*config)(struct vo *vo, uint32_t width, uint32_t height,
|
2013-06-07 23:35:44 +00:00
|
|
|
uint32_t d_width, uint32_t d_height, uint32_t flags,
|
2011-12-06 19:23:54 +00:00
|
|
|
uint32_t format);
|
2009-09-17 14:52:09 +00:00
|
|
|
|
2013-06-07 23:35:44 +00:00
|
|
|
/*
|
|
|
|
* Initialize or reconfigure the display driver. Alternative to config(),
|
|
|
|
* and can carry more image parameters.
|
|
|
|
* params: video parameters, like pixel format and frame size
|
|
|
|
* flags: combination of VOFLAG_ values
|
|
|
|
* returns: < 0 on error, >= 0 on success
|
|
|
|
*/
|
|
|
|
int (*reconfig)(struct vo *vo, struct mp_image_params *params, int flags);
|
|
|
|
|
2009-09-17 14:52:09 +00:00
|
|
|
/*
|
|
|
|
* Control interface
|
|
|
|
*/
|
|
|
|
int (*control)(struct vo *vo, uint32_t request, void *data);
|
|
|
|
|
2012-11-04 14:56:04 +00:00
|
|
|
void (*draw_image)(struct vo *vo, struct mp_image *mpi);
|
2009-09-18 13:27:55 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Get extra frames from the VO, such as those added by VDPAU
|
|
|
|
* deinterlace. Preparing the next such frame if any could be done
|
|
|
|
* automatically by the VO after a previous flip_page(), but having
|
|
|
|
* it as a separate step seems to allow making code more robust.
|
|
|
|
*/
|
|
|
|
void (*get_buffered_frame)(struct vo *vo, bool eof);
|
|
|
|
|
2009-09-17 14:52:09 +00:00
|
|
|
/*
|
|
|
|
* Draws OSD to the screen buffer
|
|
|
|
*/
|
|
|
|
void (*draw_osd)(struct vo *vo, struct osd_state *osd);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Blit/Flip buffer to the screen. Must be called after each frame!
|
2013-05-25 16:31:06 +00:00
|
|
|
* pts_us is the frame presentation time, linked to mp_time_us().
|
|
|
|
* pts_us is 0 if the frame should be presented immediately.
|
|
|
|
* duration is estimated time in us until the next frame is shown.
|
|
|
|
* duration is -1 if it is unknown or unset.
|
2009-09-17 14:52:09 +00:00
|
|
|
*/
|
|
|
|
void (*flip_page)(struct vo *vo);
|
2013-05-25 16:31:06 +00:00
|
|
|
void (*flip_page_timed)(struct vo *vo, int64_t pts_us, int duration);
|
2009-09-17 14:52:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Closes driver. Should restore the original state of the system.
|
|
|
|
*/
|
|
|
|
void (*uninit)(struct vo *vo);
|
2012-06-25 20:12:03 +00:00
|
|
|
|
2012-08-06 15:51:53 +00:00
|
|
|
// Size of private struct for automatic allocation (0 doesn't allocate)
|
|
|
|
int priv_size;
|
2012-06-25 20:12:03 +00:00
|
|
|
|
2012-08-06 15:52:17 +00:00
|
|
|
// If not NULL, it's copied into the newly allocated private struct.
|
|
|
|
const void *priv_defaults;
|
|
|
|
|
2012-06-25 20:12:03 +00:00
|
|
|
// List of options to parse into priv struct (requires privsize to be set)
|
|
|
|
const struct m_option *options;
|
2013-03-01 20:19:20 +00:00
|
|
|
|
|
|
|
// Parse these options before parsing user options
|
|
|
|
const char *init_option_string;
|
2008-04-03 03:25:41 +00:00
|
|
|
};
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2008-04-03 03:25:41 +00:00
|
|
|
struct vo {
|
2013-07-31 19:44:21 +00:00
|
|
|
struct {
|
|
|
|
struct mp_log *log; // Using "[vo]" as prefix
|
|
|
|
} vo_log;
|
|
|
|
struct mp_log *log; // Using e.g. "[vo/vdpau]" as prefix
|
|
|
|
int config_ok; // Last config call was successful?
|
|
|
|
int config_count; // Total number of successful config calls
|
2013-10-01 23:15:59 +00:00
|
|
|
struct mp_image_params *params; // Configured parameters (as in vo_reconfig)
|
2009-09-18 13:27:55 +00:00
|
|
|
|
2013-09-10 16:33:43 +00:00
|
|
|
bool probing;
|
|
|
|
|
2012-12-14 11:59:05 +00:00
|
|
|
bool untimed; // non-interactive, don't do sleep calls in playloop
|
|
|
|
|
2009-09-18 13:27:55 +00:00
|
|
|
bool frame_loaded; // Is there a next frame the VO could flip to?
|
2011-12-04 16:10:17 +00:00
|
|
|
struct mp_image *waiting_mpi;
|
2009-09-18 13:27:55 +00:00
|
|
|
double next_pts; // pts value of the next frame if any
|
2009-10-14 01:12:10 +00:00
|
|
|
double next_pts2; // optional pts of frame after that
|
2011-12-05 04:36:20 +00:00
|
|
|
bool want_redraw; // visible frame wrong (window resize), needs refresh
|
2011-12-05 03:24:18 +00:00
|
|
|
bool redrawing; // between redrawing frame and flipping it
|
2012-02-28 01:17:25 +00:00
|
|
|
bool hasframe; // >= 1 frame has been drawn, so redraw is possible
|
2012-12-19 11:58:52 +00:00
|
|
|
double wakeup_period; // if > 0, this sets the maximum wakeup period for event polling
|
2009-09-18 13:27:55 +00:00
|
|
|
|
2010-02-05 18:13:33 +00:00
|
|
|
double flip_queue_offset; // queue flip events at most this much in advance
|
|
|
|
|
2008-04-03 03:25:41 +00:00
|
|
|
const struct vo_driver *driver;
|
|
|
|
void *priv;
|
2013-03-04 21:41:27 +00:00
|
|
|
struct mp_vo_opts *opts;
|
2008-04-20 04:36:34 +00:00
|
|
|
struct vo_x11_state *x11;
|
2012-04-14 11:39:53 +00:00
|
|
|
struct vo_w32_state *w32;
|
2012-09-13 07:32:59 +00:00
|
|
|
struct vo_cocoa_state *cocoa;
|
2013-02-28 18:55:02 +00:00
|
|
|
struct vo_wayland_state *wayland;
|
2012-09-14 15:51:26 +00:00
|
|
|
struct encode_lavc_context *encode_lavc_ctx;
|
2008-04-30 08:06:55 +00:00
|
|
|
struct input_ctx *input_ctx;
|
2010-12-14 19:58:47 +00:00
|
|
|
int event_fd; // check_events() should be called when this has input
|
|
|
|
int registered_fd; // set to event_fd when registered in input system
|
2008-04-20 21:37:12 +00:00
|
|
|
|
2012-10-27 20:10:32 +00:00
|
|
|
// requested position/resolution (usually window position/window size)
|
2008-04-20 20:29:28 +00:00
|
|
|
int dx;
|
|
|
|
int dy;
|
|
|
|
int dwidth;
|
|
|
|
int dheight;
|
2008-05-01 08:02:26 +00:00
|
|
|
|
2013-03-04 16:40:21 +00:00
|
|
|
int xinerama_x;
|
|
|
|
int xinerama_y;
|
|
|
|
|
2008-05-01 08:02:26 +00:00
|
|
|
struct aspect_data {
|
2013-03-14 15:21:37 +00:00
|
|
|
float monitor_par; // out of screen size or from options
|
2008-05-01 08:02:26 +00:00
|
|
|
int orgw; // real width
|
|
|
|
int orgh; // real height
|
|
|
|
int prew; // prescaled width
|
|
|
|
int preh; // prescaled height
|
2012-10-18 15:31:00 +00:00
|
|
|
float par; // pixel aspect ratio out of orgw/orgh and prew/preh
|
2008-05-01 08:02:26 +00:00
|
|
|
} aspdat;
|
2012-08-02 00:36:26 +00:00
|
|
|
|
|
|
|
char *window_title;
|
2008-04-03 03:25:41 +00:00
|
|
|
};
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2013-07-31 19:44:21 +00:00
|
|
|
struct mpv_global;
|
|
|
|
struct vo *init_best_video_out(struct mpv_global *global,
|
2012-09-14 15:51:26 +00:00
|
|
|
struct input_ctx *input_ctx,
|
|
|
|
struct encode_lavc_context *encode_lavc_ctx);
|
2013-06-07 23:35:44 +00:00
|
|
|
int vo_reconfig(struct vo *vo, struct mp_image_params *p, int flags);
|
2002-09-29 21:53:05 +00:00
|
|
|
|
2008-04-03 03:25:41 +00:00
|
|
|
int vo_control(struct vo *vo, uint32_t request, void *data);
|
2013-03-28 20:39:10 +00:00
|
|
|
void vo_queue_image(struct vo *vo, struct mp_image *mpi);
|
2011-12-05 03:24:18 +00:00
|
|
|
int vo_redraw_frame(struct vo *vo);
|
2013-03-01 10:16:01 +00:00
|
|
|
bool vo_get_want_redraw(struct vo *vo);
|
2009-09-18 13:27:55 +00:00
|
|
|
int vo_get_buffered_frame(struct vo *vo, bool eof);
|
2011-03-03 10:54:36 +00:00
|
|
|
void vo_skip_frame(struct vo *vo);
|
2011-12-04 16:10:17 +00:00
|
|
|
void vo_new_frame_imminent(struct vo *vo);
|
2008-06-23 22:53:58 +00:00
|
|
|
void vo_draw_osd(struct vo *vo, struct osd_state *osd);
|
2009-11-15 02:39:22 +00:00
|
|
|
void vo_flip_page(struct vo *vo, unsigned int pts_us, int duration);
|
2008-04-03 03:25:41 +00:00
|
|
|
void vo_check_events(struct vo *vo);
|
2009-09-18 13:27:55 +00:00
|
|
|
void vo_seek_reset(struct vo *vo);
|
2008-04-03 03:25:41 +00:00
|
|
|
void vo_destroy(struct vo *vo);
|
|
|
|
|
2011-12-06 19:23:54 +00:00
|
|
|
const char *vo_get_window_title(struct vo *vo);
|
2008-04-03 03:25:41 +00:00
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
// NULL terminated array of all drivers
|
2008-04-03 03:25:41 +00:00
|
|
|
extern const struct vo_driver *video_out_drivers[];
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2010-04-23 10:22:44 +00:00
|
|
|
struct mp_keymap {
|
2008-12-20 11:52:11 +00:00
|
|
|
int from;
|
|
|
|
int to;
|
|
|
|
};
|
2010-04-23 10:22:44 +00:00
|
|
|
int lookup_keymap_table(const struct mp_keymap *map, int key);
|
2012-10-27 20:10:32 +00:00
|
|
|
|
2010-04-26 16:22:56 +00:00
|
|
|
void vo_mouse_movement(struct vo *vo, int posx, int posy);
|
2008-12-20 11:52:11 +00:00
|
|
|
|
2012-10-27 20:10:32 +00:00
|
|
|
struct mp_osd_res;
|
|
|
|
void vo_get_src_dst_rects(struct vo *vo, struct mp_rect *out_src,
|
|
|
|
struct mp_rect *out_dst, struct mp_osd_res *out_osd);
|
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#endif /* MPLAYER_VIDEO_OUT_H */
|