diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-09-19 00:28:17 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-09-19 00:28:17 +0300 |
commit | 3f215c9f8e4d5d95ac9b45376460391669906236 (patch) | |
tree | 1f675ef31908400c3411ace5182ca015c57000aa /libvo/video_out.h | |
parent | 82bbf1a1ab1affc675e9b69b93e33accfa2ed0b8 (diff) | |
parent | c2d0a9c8a78b20ed8e96ff5a7d3e8c936b82cae1 (diff) | |
download | mpv-3f215c9f8e4d5d95ac9b45376460391669906236.tar.bz2 mpv-3f215c9f8e4d5d95ac9b45376460391669906236.tar.xz |
Merge branch 'vdpau' into build
* vdpau: (22 commits)
VO: Prefer vo_vdpau over vo_xv again
vo_vdpau: Fix X event handling bugs
vo_vdpau: Fix memory corruption bug with MP_IMGTYPE_NUMBERED
core/VO: Allow VO drivers to add/modify frames
video_out.h: Cosmetics
VO interface: Remove obsolete draw_frame() from new interface
vo_vdpau: Support recovering from VDPAU display preemption
vo_vdpau: Support updating OSD while paused
vo_vdpau.c: Reindent control() switch statement
vo_vdpau: Allocate one large surface for EOSD content
vo_vdpau.c: cosmetics
vo_vdpau: reindent after GUI code removal
vo_vpdau: Clean up uninit logic
vo_vdpau: Make CHECK_ST macro safer
vo_vdpau: Move all remaining static/global variables to context
vo_vdpau: Move things to context struct
vo_vdpau: Make info struct const
vo_vdpau: Replace global function table with context variable
vo_vdpau: Move VDPAU interface pointers into one struct
vo_vdpau: Add template file for VDPAU functions
...
Diffstat (limited to 'libvo/video_out.h')
-rw-r--r-- | libvo/video_out.h | 174 |
1 files changed, 94 insertions, 80 deletions
diff --git a/libvo/video_out.h b/libvo/video_out.h index a55a2f87be..9bbfd3dc41 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -24,7 +24,7 @@ #define MPLAYER_VIDEO_OUT_H #include <inttypes.h> -#include <stdarg.h> +#include <stdbool.h> //#include "font_load.h" #include "libmpcodecs/img_format.h" @@ -117,91 +117,98 @@ typedef struct { typedef struct vo_info_s { - /* driver name ("Matrox Millennium G200/G400" */ - const char *name; - /* short name (for config strings) ("mga") */ - const char *short_name; - /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */ - const char *author; - /* any additional comments */ - const char *comment; + /* driver name ("Matrox Millennium G200/G400" */ + const char *name; + /* short name (for config strings) ("mga") */ + const char *short_name; + /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */ + const char *author; + /* any additional comments */ + const char *comment; } vo_info_t; struct vo; struct osd_state; +struct mp_image; struct vo_driver { - // Driver uses new API - int is_new; - - // This is set if the driver is not new and contains pointers to - // old-API functions to be used instead of the ones below. - struct vo_old_functions *old_functions; - - const vo_info_t *info; - /* - * Preinitializes driver (real INITIALIZATION) - * arg - currently it's vo_subdevice - * returns: zero on successful initialization, non-zero on error. - */ - int (*preinit)(struct vo *vo, const char *arg); - /* - * Initialize (means CONFIGURE) the display driver. - * params: - * width,height: image source size - * d_width,d_height: size of the requested window size, just a hint - * fullscreen: flag, 0=windowd 1=fullscreen, just a hint - * 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, - uint32_t d_width, uint32_t d_height, uint32_t fullscreen, - char *title, uint32_t format); - - /* - * Control interface - */ - int (*control)(struct vo *vo, uint32_t request, void *data); - - /* - * Display a new RGB/BGR frame of the video to the screen. - * params: - * src[0] - pointer to the image - */ - int (*draw_frame)(struct vo *vo, uint8_t *src[]); - - /* - * Draw a planar YUV slice to the buffer: - * params: - * src[3] = source image planes (Y,U,V) - * stride[3] = source image planes line widths (in bytes) - * w,h = width*height of area to be copied (in Y pixels) - * x,y = position at the destination image (in Y pixels) - */ - int (*draw_slice)(struct vo *vo, uint8_t *src[], int stride[], int w, - int h, int x, int y); - - /* - * 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! - */ - void (*flip_page)(struct vo *vo); - - /* - * This func is called after every frames to handle keyboard and - * other events. It's called in PAUSE mode too! - */ - void (*check_events)(struct vo *vo); - - /* - * Closes driver. Should restore the original state of the system. - */ - void (*uninit)(struct vo *vo); + // Driver uses new API + bool is_new; + // Driver buffers or adds (deinterlace) frames and will keep track + // of pts values itself + bool buffer_frames; + + // This is set if the driver is not new and contains pointers to + // old-API functions to be used instead of the ones below. + struct vo_old_functions *old_functions; + + const vo_info_t *info; + /* + * Preinitializes driver (real INITIALIZATION) + * arg - currently it's vo_subdevice + * returns: zero on successful initialization, non-zero on error. + */ + int (*preinit)(struct vo *vo, const char *arg); + /* + * Initialize (means CONFIGURE) the display driver. + * params: + * width,height: image source size + * d_width,d_height: size of the requested window size, just a hint + * fullscreen: flag, 0=windowd 1=fullscreen, just a hint + * 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, + uint32_t d_width, uint32_t d_height, uint32_t fullscreen, + char *title, uint32_t format); + + /* + * Control interface + */ + int (*control)(struct vo *vo, uint32_t request, void *data); + + void (*draw_image)(struct vo *vo, struct mp_image *mpi, double pts); + + /* + * 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); + + /* + * Draw a planar YUV slice to the buffer: + * params: + * src[3] = source image planes (Y,U,V) + * stride[3] = source image planes line widths (in bytes) + * w,h = width*height of area to be copied (in Y pixels) + * x,y = position at the destination image (in Y pixels) + */ + int (*draw_slice)(struct vo *vo, uint8_t *src[], int stride[], int w, + int h, int x, int y); + + /* + * 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! + */ + void (*flip_page)(struct vo *vo); + + /* + * This func is called after every frames to handle keyboard and + * other events. It's called in PAUSE mode too! + */ + void (*check_events)(struct vo *vo); + + /* + * Closes driver. Should restore the original state of the system. + */ + void (*uninit)(struct vo *vo); }; struct vo_old_functions { @@ -221,6 +228,10 @@ struct vo_old_functions { struct vo { int config_ok; // Last config call was successful? int config_count; // Total number of successful config calls + + bool frame_loaded; // Is there a next frame the VO could flip to? + double next_pts; // pts value of the next frame if any + const struct vo_driver *driver; void *priv; struct MPOpts *opts; @@ -258,11 +269,14 @@ int vo_config(struct vo *vo, uint32_t width, uint32_t height, void list_video_out(void); int vo_control(struct vo *vo, uint32_t request, void *data); +int vo_draw_image(struct vo *vo, struct mp_image *mpi, double pts); +int vo_get_buffered_frame(struct vo *vo, bool eof); int vo_draw_frame(struct vo *vo, uint8_t *src[]); int vo_draw_slice(struct vo *vo, uint8_t *src[], int stride[], int w, int h, int x, int y); void vo_draw_osd(struct vo *vo, struct osd_state *osd); void vo_flip_page(struct vo *vo); void vo_check_events(struct vo *vo); +void vo_seek_reset(struct vo *vo); void vo_destroy(struct vo *vo); |