xine-lib 1.2.11
Data Structures | Macros | Functions | Variables
video_out_vdpau.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include <errno.h>
#include <ctype.h>
#include <pthread.h>
#include <xine.h>
#include <xine/video_out.h>
#include <xine/vo_scale.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <vdpau/vdpau_x11.h>
#include "accel_vdpau.h"
#include "color_matrix.c"

Data Structures

struct  vdpau_output_surface_t
 
struct  vdpau_grab_video_frame_t
 
struct  vdpau_frame_t
 
struct  vdpau_overlay_t
 
struct  vdpau_func_t
 
struct  vdpau_driver_t
 
struct  vdpau_class_t
 

Macros

#define LOG_MODULE   "video_out_vdpau"
 
#define NUM_FRAMES_BACK   1
 
#define LOCKDISPLAY   /*define this if you have a buggy libX11/xcb*/
 
#define DEINT_BOB   1
 
#define DEINT_HALF_TEMPORAL   2
 
#define DEINT_HALF_TEMPORAL_SPATIAL   3
 
#define DEINT_TEMPORAL   4
 
#define DEINT_TEMPORAL_SPATIAL   5
 
#define NUMBER_OF_DEINTERLACERS   5
 
#define NOUTPUTSURFACEBUFFER   25
 
#define NOUTPUTSURFACE   8
 
#define CM_LUT
 
#define CM_HAVE_YCGCO_SUPPORT   1
 
#define CM_DRIVER_T   vdpau_driver_t
 
#define DO_LOCKDISPLAY(this)   XLockDisplay (this->display)
 
#define DO_UNLOCKDISPLAY(this)   XUnlockDisplay (this->display)
 
#define VDPAU_IF_ERROR(msg)
 
#define VDPAU_ERROR(msg)    xprintf (this->xine, XINE_VERBOSITY_LOG, "vo_vdpau: " msg ": %s.\n", this->a.b.vdp_get_error_string (st))
 
#define VDPAU_BAIL_REINIT(msg)
 
#define VDPAU_INIT_BAIL(text)
 

Functions

static void vdpau_lockdisplay (vo_frame_t *frame)
 
static void vdpau_unlockdisplay (vo_frame_t *frame)
 
static VdpStatus vdpau_get_output_surface (vdpau_driver_t *this, uint32_t width, uint32_t height, vdpau_output_surface_t *r)
 
static void vdpau_free_output_surface (vdpau_driver_t *this, vdpau_output_surface_t *os)
 
static void vdpau_overlay_begin (vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed)
 
static void vdpau_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *voovl)
 
static void vdpau_overlay_end (vo_driver_t *this_gen, vo_frame_t *frame_gen)
 
static void vdpau_process_overlays (vdpau_driver_t *this)
 
static void vdpau_frame_proc_slice (vo_frame_t *vo_img, uint8_t **src)
 
static void vdpau_frame_field (vo_frame_t *vo_img, int which_field)
 
static void vdpau_frame_dispose (vo_frame_t *vo_img)
 
static vo_frame_tvdpau_alloc_frame (vo_driver_t *this_gen)
 
static void vdpau_provide_standard_frame_data (vo_frame_t *frame, xine_current_frame_data_t *data)
 
static void vdpau_duplicate_frame_data (vo_frame_t *frame_gen, vo_frame_t *original)
 
static void vdpau_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, double ratio, int format, int flags)
 
static int vdpau_redraw_needed (vo_driver_t *this_gen)
 
static int vdpau_release_back_frames (vdpau_driver_t *this)
 
static void vdpau_backup_frame (vdpau_driver_t *this, vdpau_frame_t *frame)
 
static void vdpau_set_deinterlace (vdpau_driver_t *this)
 
static void vdpau_set_inverse_telecine (vdpau_driver_t *this)
 
static void vdpau_update_deinterlace_method_sd (void *this_gen, xine_cfg_entry_t *entry)
 
static void vdpau_update_deinterlace_method_hd (void *this_gen, xine_cfg_entry_t *entry)
 
static void vdpau_set_scaling_level (vdpau_driver_t *this)
 
static void vdpau_update_scaling_level (void *this_gen, xine_cfg_entry_t *entry)
 
static void vdpau_update_enable_inverse_telecine (void *this_gen, xine_cfg_entry_t *entry)
 
static void vdpau_honor_progressive_flag (void *this_gen, xine_cfg_entry_t *entry)
 
static void vdpau_update_noise (vdpau_driver_t *this)
 
static void vdpau_update_sharpness (vdpau_driver_t *this)
 
static void vdpau_update_sd_only_properties (void *this_gen, xine_cfg_entry_t *entry)
 
static void vdpau_update_csc_matrix (vdpau_driver_t *this, vdpau_frame_t *frame)
 
static void vdpau_update_skip_chroma (vdpau_driver_t *this)
 
static void vdpau_set_skip_chroma (void *this_gen, xine_cfg_entry_t *entry)
 
static void vdpau_update_background (vdpau_driver_t *this)
 
static void vdpau_set_background (void *this_gen, xine_cfg_entry_t *entry)
 
static void vdpau_shift_queue (vdpau_driver_t *this)
 
static void vdpau_check_output_size (vdpau_driver_t *this)
 
static void vdpau_grab_current_output_surface (vdpau_driver_t *this, int64_t vpts)
 
static VdpStatus vdpau_new_video_mixer (vdpau_driver_t *this)
 
static void vdpau_update_display_dimension (vdpau_driver_t *this)
 
static void vdp_preemption_callback (VdpDevice device, void *context)
 
static void vdpau_reinit (vdpau_driver_t *this)
 
static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
 
static int vdpau_get_property (vo_driver_t *this_gen, int property)
 
static int vdpau_set_property (vo_driver_t *this_gen, int property, int value)
 
static void vdpau_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max)
 
static void vdpau_dispose_grab_video_frame (xine_grab_video_frame_t *frame_gen)
 
static int vdpau_grab_grab_video_frame (xine_grab_video_frame_t *frame_gen)
 
static xine_grab_video_frame_tvdpau_new_grab_video_frame (vo_driver_t *this)
 
static int vdpau_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data)
 
static uint32_t vdpau_get_capabilities (vo_driver_t *this_gen)
 
static void vdpau_dispose (vo_driver_t *this_gen)
 
static int vdpau_get_funcs (vdpau_driver_t *this)
 
static vo_driver_tvdpau_open_plugin (video_driver_class_t *class_gen, const void *visual_gen)
 
static void * vdpau_init_class (xine_t *xine, const void *visual_gen)
 

Variables

static const char *const vdpau_deinterlacer_name []
 
static const char *const vdpau_deinterlacer_description []
 
static const char *const vdpau_sd_only_properties []
 
static const VdpOutputSurfaceRenderBlendState blend
 
static const vdpau_func_t vdpau_funcs []
 
static const vo_info_t vo_info_vdpau
 
const plugin_info_t xine_plugin_info[] EXPORTED
 

Macro Definition Documentation

◆ CM_DRIVER_T

#define CM_DRIVER_T   vdpau_driver_t

◆ CM_HAVE_YCGCO_SUPPORT

#define CM_HAVE_YCGCO_SUPPORT   1

◆ CM_LUT

#define CM_LUT

◆ DEINT_BOB

#define DEINT_BOB   1

◆ DEINT_HALF_TEMPORAL

#define DEINT_HALF_TEMPORAL   2

◆ DEINT_HALF_TEMPORAL_SPATIAL

#define DEINT_HALF_TEMPORAL_SPATIAL   3

◆ DEINT_TEMPORAL

#define DEINT_TEMPORAL   4

◆ DEINT_TEMPORAL_SPATIAL

#define DEINT_TEMPORAL_SPATIAL   5

◆ DO_LOCKDISPLAY

#define DO_LOCKDISPLAY (   this)    XLockDisplay (this->display)

◆ DO_UNLOCKDISPLAY

#define DO_UNLOCKDISPLAY (   this)    XUnlockDisplay (this->display)

◆ LOCKDISPLAY

#define LOCKDISPLAY   /*define this if you have a buggy libX11/xcb*/

◆ LOG_MODULE

#define LOG_MODULE   "video_out_vdpau"

◆ NOUTPUTSURFACE

#define NOUTPUTSURFACE   8

◆ NOUTPUTSURFACEBUFFER

#define NOUTPUTSURFACEBUFFER   25

◆ NUM_FRAMES_BACK

#define NUM_FRAMES_BACK   1

◆ NUMBER_OF_DEINTERLACERS

#define NUMBER_OF_DEINTERLACERS   5

◆ VDPAU_BAIL_REINIT

#define VDPAU_BAIL_REINIT (   msg)
Value:
if (st != VDP_STATUS_OK) { \
xprintf (this->xine, XINE_VERBOSITY_LOG, "vo_vdpau: %s: %s.\n", msg, this->a.b.vdp_get_error_string (st)); \
DO_UNLOCKDISPLAY (this); \
}
#define XINE_VERBOSITY_LOG
Definition: xine.h:425

◆ VDPAU_ERROR

#define VDPAU_ERROR (   msg)     xprintf (this->xine, XINE_VERBOSITY_LOG, "vo_vdpau: " msg ": %s.\n", this->a.b.vdp_get_error_string (st))

◆ VDPAU_IF_ERROR

#define VDPAU_IF_ERROR (   msg)
Value:
if (st != VDP_STATUS_OK) \
xprintf (this->xine, XINE_VERBOSITY_LOG, "vo_vdpau: " msg ": %s.\n", this->a.b.vdp_get_error_string (st))

◆ VDPAU_INIT_BAIL

#define VDPAU_INIT_BAIL (   text)
Value:
if (st != VDP_STATUS_OK) { \
xprintf (this->xine, XINE_VERBOSITY_LOG, "vo_vdpau: %s: %s.\n", text, this->a.b.vdp_get_error_string (st)); \
this->vo_driver.dispose (&this->vo_driver); \
return NULL; \
}
NULL
Definition: xine_plugin.c:78

Function Documentation

◆ vdp_preemption_callback()

static void vdp_preemption_callback ( VdpDevice  device,
void *  context 
)
static

References XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by vdpau_open_plugin(), and vdpau_reinit().

◆ vdpau_alloc_frame()

static vo_frame_t * vdpau_alloc_frame ( vo_driver_t this_gen)
static

◆ vdpau_backup_frame()

static void vdpau_backup_frame ( vdpau_driver_t this,
vdpau_frame_t frame 
)
static

References NUM_FRAMES_BACK.

Referenced by vdpau_display_frame().

◆ vdpau_check_output_size()

static void vdpau_check_output_size ( vdpau_driver_t this)
static

◆ vdpau_display_frame()

static void vdpau_display_frame ( vo_driver_t this_gen,
vo_frame_t frame_gen 
)
static

◆ vdpau_dispose()

static void vdpau_dispose ( vo_driver_t this_gen)
static

◆ vdpau_dispose_grab_video_frame()

static void vdpau_dispose_grab_video_frame ( xine_grab_video_frame_t frame_gen)
static

◆ vdpau_duplicate_frame_data()

static void vdpau_duplicate_frame_data ( vo_frame_t frame_gen,
vo_frame_t original 
)
static

◆ vdpau_frame_dispose()

static void vdpau_frame_dispose ( vo_frame_t vo_img)
static

◆ vdpau_frame_field()

static void vdpau_frame_field ( vo_frame_t vo_img,
int  which_field 
)
static

◆ vdpau_frame_proc_slice()

static void vdpau_frame_proc_slice ( vo_frame_t vo_img,
uint8_t **  src 
)
static

References vo_frame_s::proc_called.

Referenced by vdpau_alloc_frame().

◆ vdpau_free_output_surface()

static void vdpau_free_output_surface ( vdpau_driver_t this,
vdpau_output_surface_t os 
)
static

◆ vdpau_get_capabilities()

static uint32_t vdpau_get_capabilities ( vo_driver_t this_gen)
static

Referenced by vdpau_open_plugin().

◆ vdpau_get_funcs()

static int vdpau_get_funcs ( vdpau_driver_t this)
static

◆ vdpau_get_output_surface()

static VdpStatus vdpau_get_output_surface ( vdpau_driver_t this,
uint32_t  width,
uint32_t  height,
vdpau_output_surface_t r 
)
static

◆ vdpau_get_property()

static int vdpau_get_property ( vo_driver_t this_gen,
int  property 
)
static

◆ vdpau_get_property_min_max()

static void vdpau_get_property_min_max ( vo_driver_t this_gen,
int  property,
int *  min,
int *  max 
)
static

◆ vdpau_grab_current_output_surface()

static void vdpau_grab_current_output_surface ( vdpau_driver_t this,
int64_t  vpts 
)
static

◆ vdpau_grab_grab_video_frame()

static int vdpau_grab_grab_video_frame ( xine_grab_video_frame_t frame_gen)
static

◆ vdpau_gui_data_exchange()

static int vdpau_gui_data_exchange ( vo_driver_t this_gen,
int  data_type,
void *  data 
)
static

◆ vdpau_honor_progressive_flag()

static void vdpau_honor_progressive_flag ( void *  this_gen,
xine_cfg_entry_t entry 
)
static

References lprintf, and xine_cfg_entry_s::num_value.

Referenced by vdpau_open_plugin().

◆ vdpau_init_class()

static void * vdpau_init_class ( xine_t xine,
const void *  visual_gen 
)
static

◆ vdpau_lockdisplay()

static void vdpau_lockdisplay ( vo_frame_t frame)
static

References vo_frame_s::driver.

Referenced by vdpau_alloc_frame().

◆ vdpau_new_grab_video_frame()

static xine_grab_video_frame_t * vdpau_new_grab_video_frame ( vo_driver_t this)
static

◆ vdpau_new_video_mixer()

static VdpStatus vdpau_new_video_mixer ( vdpau_driver_t this)
static

◆ vdpau_open_plugin()

static vo_driver_t * vdpau_open_plugin ( video_driver_class_t class_gen,
const void *  visual_gen 
)
static

References _, _x_vo_scale_init(), xine_s::config, contrast, DEINT_BOB, DEINT_HALF_TEMPORAL, DEINT_HALF_TEMPORAL_SPATIAL, DEINT_TEMPORAL, DEINT_TEMPORAL_SPATIAL, DO_LOCKDISPLAY, DO_UNLOCKDISPLAY, noise(), NOUTPUTSURFACE, NOUTPUTSURFACEBUFFER, NULL, NUM_FRAMES_BACK, config_values_s::register_bool, config_values_s::register_enum, config_values_s::register_num, config_values_s::register_range, config_values_s::update_num, vdp_preemption_callback(), vdpau_alloc_frame(), vdpau_deinterlacer_description, vdpau_deinterlacer_name, vdpau_display_frame(), vdpau_dispose(), vdpau_get_capabilities(), vdpau_get_funcs(), vdpau_get_property(), vdpau_get_property_min_max(), vdpau_gui_data_exchange(), vdpau_honor_progressive_flag(), VDPAU_IF_ERROR, VDPAU_INIT_BAIL, vdpau_new_grab_video_frame(), vdpau_new_video_mixer(), vdpau_overlay_begin(), vdpau_overlay_blend(), vdpau_overlay_end(), vdpau_redraw_needed(), vdpau_sd_only_properties, vdpau_set_background(), vdpau_set_property(), vdpau_set_skip_chroma(), vdpau_update_deinterlace_method_hd(), vdpau_update_deinterlace_method_sd(), vdpau_update_display_dimension(), vdpau_update_enable_inverse_telecine(), vdpau_update_frame_format(), vdpau_update_scaling_level(), vdpau_update_sd_only_properties(), VO_CAP_ARGB_LAYER_OVERLAY, VO_CAP_BRIGHTNESS, VO_CAP_COLOR_MATRIX, VO_CAP_CONTRAST, VO_CAP_CROP, VO_CAP_CUSTOM_EXTENT_OVERLAY, VO_CAP_FULLRANGE, VO_CAP_HUE, VO_CAP_NOISE_REDUCTION, VO_CAP_SATURATION, VO_CAP_SHARPNESS, VO_CAP_UNSCALED_OVERLAY, VO_CAP_VDPAU_H264, VO_CAP_VDPAU_MPEG12, VO_CAP_VDPAU_MPEG4, VO_CAP_VDPAU_VC1, VO_CAP_VIDEO_WINDOW_OVERLAY, VO_CAP_YUY2, VO_CAP_YV12, config_values_s::xine, vdpau_class_t::xine, XINE_IMGFMT_YV12, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, XINE_VO_ASPECT_AUTO, and xprintf.

Referenced by vdpau_init_class().

◆ vdpau_overlay_begin()

static void vdpau_overlay_begin ( vo_driver_t this_gen,
vo_frame_t frame_gen,
int  changed 
)
static

References lprintf.

Referenced by vdpau_open_plugin().

◆ vdpau_overlay_blend()

static void vdpau_overlay_blend ( vo_driver_t this_gen,
vo_frame_t frame_gen,
vo_overlay_t voovl 
)
static

◆ vdpau_overlay_end()

static void vdpau_overlay_end ( vo_driver_t this_gen,
vo_frame_t frame_gen 
)
static

◆ vdpau_process_overlays()

static void vdpau_process_overlays ( vdpau_driver_t this)
static

◆ vdpau_provide_standard_frame_data()

static void vdpau_provide_standard_frame_data ( vo_frame_t frame,
xine_current_frame_data_t data 
)
static

◆ vdpau_redraw_needed()

static int vdpau_redraw_needed ( vo_driver_t this_gen)
static

◆ vdpau_reinit()

static void vdpau_reinit ( vdpau_driver_t this)
static

◆ vdpau_release_back_frames()

static int vdpau_release_back_frames ( vdpau_driver_t this)
static

◆ vdpau_set_background()

static void vdpau_set_background ( void *  this_gen,
xine_cfg_entry_t entry 
)
static

◆ vdpau_set_deinterlace()

static void vdpau_set_deinterlace ( vdpau_driver_t this)
static

◆ vdpau_set_inverse_telecine()

static void vdpau_set_inverse_telecine ( vdpau_driver_t this)
static

◆ vdpau_set_property()

static int vdpau_set_property ( vo_driver_t this_gen,
int  property,
int  value 
)
static

◆ vdpau_set_scaling_level()

static void vdpau_set_scaling_level ( vdpau_driver_t this)
static

◆ vdpau_set_skip_chroma()

static void vdpau_set_skip_chroma ( void *  this_gen,
xine_cfg_entry_t entry 
)
static

◆ vdpau_shift_queue()

static void vdpau_shift_queue ( vdpau_driver_t this)
static

Referenced by vdpau_display_frame().

◆ vdpau_unlockdisplay()

static void vdpau_unlockdisplay ( vo_frame_t frame)
static

References vo_frame_s::driver.

Referenced by vdpau_alloc_frame().

◆ vdpau_update_background()

static void vdpau_update_background ( vdpau_driver_t this)
static

◆ vdpau_update_csc_matrix()

static void vdpau_update_csc_matrix ( vdpau_driver_t this,
vdpau_frame_t frame 
)
static

◆ vdpau_update_deinterlace_method_hd()

static void vdpau_update_deinterlace_method_hd ( void *  this_gen,
xine_cfg_entry_t entry 
)
static

◆ vdpau_update_deinterlace_method_sd()

static void vdpau_update_deinterlace_method_sd ( void *  this_gen,
xine_cfg_entry_t entry 
)
static

◆ vdpau_update_display_dimension()

static void vdpau_update_display_dimension ( vdpau_driver_t this)
static

Referenced by vdpau_open_plugin(), and vdpau_reinit().

◆ vdpau_update_enable_inverse_telecine()

static void vdpau_update_enable_inverse_telecine ( void *  this_gen,
xine_cfg_entry_t entry 
)
static

◆ vdpau_update_frame_format()

static void vdpau_update_frame_format ( vo_driver_t this_gen,
vo_frame_t frame_gen,
uint32_t  width,
uint32_t  height,
double  ratio,
int  format,
int  flags 
)
static

◆ vdpau_update_noise()

static void vdpau_update_noise ( vdpau_driver_t this)
static

◆ vdpau_update_scaling_level()

static void vdpau_update_scaling_level ( void *  this_gen,
xine_cfg_entry_t entry 
)
static

◆ vdpau_update_sd_only_properties()

static void vdpau_update_sd_only_properties ( void *  this_gen,
xine_cfg_entry_t entry 
)
static

◆ vdpau_update_sharpness()

static void vdpau_update_sharpness ( vdpau_driver_t this)
static

◆ vdpau_update_skip_chroma()

static void vdpau_update_skip_chroma ( vdpau_driver_t this)
static

Variable Documentation

◆ blend

const VdpOutputSurfaceRenderBlendState blend
static
Initial value:
= {
VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSION,
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE,
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_COLOR,
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE,
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD,
VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD,
{ 0.f, 0.f, 0.f, 0.f }
}

Referenced by vdpau_process_overlays().

◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED
Initial value:
= {
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
static const vo_info_t vo_info_vdpau
Definition: video_out_vdpau.c:3168
static void * vdpau_init_class(xine_t *xine, const void *visual_gen)
Definition: video_out_vdpau.c:3148
#define XINE_VERSION_CODE
Definition: xine_internal.h:57
#define PLUGIN_NONE
Definition: xine_plugin.h:29
#define PLUGIN_VIDEO_OUT
Definition: xine_plugin.h:36

◆ vdpau_deinterlacer_description

const char* const vdpau_deinterlacer_description[]
static
Initial value:
= {
"bob\nBasic deinterlacing, doing 50i->50p.\n\n",
"half temporal\nDisplays first field only, doing 50i->25p\n\n",
"half temporal_spatial\nDisplays first field only, doing 50i->25p\n\n",
"temporal\nVery good, 50i->50p\n\n",
"temporal_spatial\nThe best, but very GPU intensive.\n\n",
}

Referenced by vdpau_open_plugin().

◆ vdpau_deinterlacer_name

const char* const vdpau_deinterlacer_name[]
static
Initial value:
= {
"bob",
"half temporal",
"half temporal_spatial",
"temporal",
"temporal_spatial",
}

Referenced by vdpau_open_plugin().

◆ vdpau_funcs

const vdpau_func_t vdpau_funcs[]
static

Referenced by vdpau_get_funcs().

◆ vdpau_sd_only_properties

const char* const vdpau_sd_only_properties[]
static
Initial value:
= {
"none",
"noise",
"sharpness",
"noise+sharpness",
}

Referenced by vdpau_open_plugin().

◆ vo_info_vdpau

const vo_info_t vo_info_vdpau
static
Initial value:
= {
.priority = 11,
.visual_type = XINE_VISUAL_TYPE_X11,
}
#define XINE_VISUAL_TYPE_X11
Definition: xine.h:154