xine-lib 1.2.13-20230125hg15249
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
video_out_xv.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <math.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/time.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
#include <time.h>
#include "xine.h"
#include <xine/video_out.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <xine/vo_scale.h>
#include "x11osd.h"
#include "xv_common.h"
#include "color_matrix.c"

Data Structures

struct  xv_property_t
 
struct  xv_frame_t
 
struct  xv_driver_s
 
struct  xv_class_t
 

Macros

#define LOG_MODULE   "video_out_xv"
 
#define LOG_VERBOSE
 
#define DEBUG_EMU
 
#define XV_PROPS
 
#define LOCK_DISPLAY(this)   this->lock_display (this->ld_user_data)
 
#define UNLOCK_DISPLAY(this)   this->unlock_display (this->ud_user_data);
 
#define CM_LUT
 
#define CM_DRIVER_T   xv_driver_t
 

Typedefs

typedef struct xv_driver_s xv_driver_t
 

Enumerations

enum  xv_prefertype { xv_prefer_none , xv_prefer_overlay , xv_prefer_textured , xv_prefer_blitter }
 

Functions

static uint32_t xv_get_capabilities (vo_driver_t *this_gen)
 
static void xv_frame_field (vo_frame_t *vo_img, int which_field)
 
static void xv_rem_yuy2_emu (xv_frame_t *f)
 
static void xv_frame_dispose (vo_frame_t *vo_img)
 
static vo_frame_txv_alloc_frame (vo_driver_t *this_gen)
 
static int HandleXError (Display *display, XErrorEvent *xevent)
 
static void x11_InstallXErrorHandler (xv_driver_t *this)
 
static void x11_DeInstallXErrorHandler (xv_driver_t *this)
 
static XvImage * create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo, int width, int height, int format)
 
static void dispose_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo, XvImage *myimage)
 
static void xv_slice_yuy2_emu (vo_frame_t *vo_img, uint8_t **src)
 
static int xv_add_yuy2_emu (xv_frame_t *f)
 
static void xv_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 void xv_clean_output_area (xv_driver_t *this)
 
static void xv_compute_ideal_size (xv_driver_t *this)
 
static void xv_compute_output_size (xv_driver_t *this)
 
static void xv_overlay_begin (vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed)
 
static void xv_overlay_end (vo_driver_t *this_gen, vo_frame_t *vo_img)
 
static void xv_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay)
 
static void xv_add_recent_frame (xv_driver_t *this, xv_frame_t *frame)
 
static int xv_flush_recent_frames (xv_driver_t *this)
 
static int xv_redraw_needed (vo_driver_t *this_gen)
 
static double timeOfDay ()
 
static void xv_new_color (xv_driver_t *this, int cm)
 
static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
 
static int xv_get_property (vo_driver_t *this_gen, int property)
 
static int xv_set_property (vo_driver_t *this_gen, int property, int value)
 
static void xv_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max)
 
static int xv_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data)
 
static void xv_restore_port_attributes (xv_driver_t *this)
 
static void xv_dispose (vo_driver_t *this_gen)
 
static void xv_prop_init (xv_driver_t *this, const xv_prop_list_t *l, const XvAttribute attr)
 
static void xv_prop_update_int (xv_property_t *prop, int value)
 
static void xv_prop_update (void *prop_gen, xine_cfg_entry_t *entry)
 
static void xv_prop_conf (xv_driver_t *this, int property, const char *config_name, const char *config_desc, const char *config_help)
 
static void xv_update_xv_pitch_alignment (void *this_gen, xine_cfg_entry_t *entry)
 
static void xv_fullrange_cb_config (void *this_gen, xine_cfg_entry_t *entry)
 
static void xv_debug_emu_cb_config (void *this_gen, xine_cfg_entry_t *entry)
 
static int xv_open_port (xv_driver_t *this, XvPortID port)
 
static unsigned int xv_find_adaptor_by_port (int port, unsigned int adaptors, XvAdaptorInfo *adaptor_info)
 
static XvPortID xv_autodetect_port (xv_driver_t *this, unsigned int adaptors, XvAdaptorInfo *adaptor_info, unsigned int *adaptor_num, XvPortID base, xv_prefertype prefer_type)
 
static void xv_default_lock_display (void *user_data)
 
static void xv_default_unlock_display (void *user_data)
 
static vo_driver_topen_plugin_2 (video_driver_class_t *class_gen, const void *visual_gen)
 
static vo_driver_topen_plugin_old (video_driver_class_t *class_gen, const void *visual_gen)
 
static void * init_class (xine_t *xine, const void *visual_gen)
 
static void * init_class_2 (xine_t *xine, const void *visual_gen)
 

Variables

static int gX11Fail
 
static const char *const bicubic_types [] = { "Off", "On", "Auto", NULL }
 
static const char *const prefer_labels [] = { "Any", "Overlay", "Textured Video", "Blitter", NULL }
 
static const char prefer_substrings [][8] = { "", "Overlay", "Texture", "Blitter" }
 
static const vo_info_t vo_info_xv
 
static const vo_info_t vo_info_xv_2
 
const plugin_info_t xine_plugin_info[] EXPORTED
 

Macro Definition Documentation

◆ CM_DRIVER_T

#define CM_DRIVER_T   xv_driver_t

◆ CM_LUT

#define CM_LUT

◆ DEBUG_EMU

#define DEBUG_EMU

◆ LOCK_DISPLAY

#define LOCK_DISPLAY ( this)    this->lock_display (this->ld_user_data)

◆ LOG_MODULE

#define LOG_MODULE   "video_out_xv"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ UNLOCK_DISPLAY

#define UNLOCK_DISPLAY ( this)    this->unlock_display (this->ud_user_data);

◆ XV_PROPS

#define XV_PROPS

Typedef Documentation

◆ xv_driver_t

typedef struct xv_driver_s xv_driver_t

Enumeration Type Documentation

◆ xv_prefertype

Enumerator
xv_prefer_none 
xv_prefer_overlay 
xv_prefer_textured 
xv_prefer_blitter 

Function Documentation

◆ create_ximage()

static XvImage * create_ximage ( xv_driver_t * this,
XShmSegmentInfo * shminfo,
int width,
int height,
int format )
static

◆ dispose_ximage()

static void dispose_ximage ( xv_driver_t * this,
XShmSegmentInfo * shminfo,
XvImage * myimage )
static

◆ HandleXError()

static int HandleXError ( Display * display,
XErrorEvent * xevent )
static

References gX11Fail.

Referenced by x11_InstallXErrorHandler().

◆ init_class()

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

◆ init_class_2()

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

◆ open_plugin_2()

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

References _, _x_alphablend_init(), _x_vo_scale_init(), bicubic_types, xine_s::config, create_ximage(), x11_visual_t::d, x11_visual_t::display, vo_frame_s::dispose, dispose_ximage(), x11_visual_t::frame_output_cb, height, LOCK_DISPLAY, x11_visual_t::lock_display, LOG_MODULE, name, NULL, prefer_labels, x11_visual_t::screen, UNLOCK_DISPLAY, x11_visual_t::unlock_display, x11_visual_t::user_data, VIDEO_DEVICE_XV_AUTOPAINT_COLORKEY_HELP, VIDEO_DEVICE_XV_BICUBIC_HELP, VIDEO_DEVICE_XV_COLORKEY_HELP, VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP, VIDEO_DEVICE_XV_FILTER_HELP, VIDEO_DEVICE_XV_PITCH_ALIGNMENT_HELP, VIDEO_DEVICE_XV_PORT_HELP, VIDEO_DEVICE_XV_PREFER_TYPE_HELP, VO_CAP_CROP, VO_CAP_FULLRANGE, VO_CAP_UNSCALED_OVERLAY, VO_CAP_ZOOM_X, VO_CAP_ZOOM_Y, VO_PROP_ASPECT_RATIO, VO_PROP_AUTOPAINT_COLORKEY, VO_PROP_BRIGHTNESS, VO_PROP_COLORKEY, VO_PROP_CONTRAST, VO_PROP_HUE, VO_PROP_MAX_VIDEO_HEIGHT, VO_PROP_MAX_VIDEO_WIDTH, VO_PROP_SATURATION, VO_PROP_ZOOM_X, VO_PROP_ZOOM_Y, width, x11osd_colorkey(), X11OSD_COLORKEY, x11osd_create(), X11OSD_SHAPED, config_values_s::xine, xv_class_t::xine, XINE_IMGFMT_YUY2, XINE_IMGFMT_YV12, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, XINE_VERBOSITY_NONE, XINE_VO_ASPECT_AUTO, xprintf, xv_alloc_frame(), xv_autodetect_port(), xv_debug_emu_cb_config(), xv_default_lock_display(), xv_default_unlock_display(), xv_display_frame(), xv_dispose(), xv_find_adaptor_by_port(), xv_fullrange_cb_config(), xv_get_capabilities(), xv_get_property(), xv_get_property_min_max(), xv_gui_data_exchange(), xv_open_port(), xv_overlay_begin(), xv_overlay_blend(), xv_overlay_end(), xv_prefer_none, xv_prop_conf(), xv_prop_init(), xv_prop_update(), xv_prop_update_int(), xv_redraw_needed(), xv_set_property(), xv_update_frame_format(), and xv_update_xv_pitch_alignment().

Referenced by init_class_2(), and open_plugin_old().

◆ open_plugin_old()

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

◆ timeOfDay()

static double timeOfDay ( )
static

References NULL.

Referenced by xv_display_frame().

◆ x11_DeInstallXErrorHandler()

static void x11_DeInstallXErrorHandler ( xv_driver_t * this)
static

References NULL.

Referenced by create_ximage(), and xv_open_port().

◆ x11_InstallXErrorHandler()

static void x11_InstallXErrorHandler ( xv_driver_t * this)
static

References HandleXError().

Referenced by create_ximage(), and xv_open_port().

◆ xv_add_recent_frame()

static void xv_add_recent_frame ( xv_driver_t * this,
xv_frame_t * frame )
static

References VO_NUM_RECENT_FRAMES.

Referenced by xv_display_frame().

◆ xv_add_yuy2_emu()

static int xv_add_yuy2_emu ( xv_frame_t * f)
static

◆ xv_alloc_frame()

static vo_frame_t * xv_alloc_frame ( vo_driver_t * this_gen)
static

◆ xv_autodetect_port()

static XvPortID xv_autodetect_port ( xv_driver_t * this,
unsigned int adaptors,
XvAdaptorInfo * adaptor_info,
unsigned int * adaptor_num,
XvPortID base,
xv_prefertype prefer_type )
static

◆ xv_clean_output_area()

static void xv_clean_output_area ( xv_driver_t * this)
static

◆ xv_compute_ideal_size()

static void xv_compute_ideal_size ( xv_driver_t * this)
static

◆ xv_compute_output_size()

static void xv_compute_output_size ( xv_driver_t * this)
static

◆ xv_debug_emu_cb_config()

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

References xine_cfg_entry_s::num_value.

Referenced by open_plugin_2().

◆ xv_default_lock_display()

static void xv_default_lock_display ( void * user_data)
static

References user_data().

Referenced by open_plugin_2().

◆ xv_default_unlock_display()

static void xv_default_unlock_display ( void * user_data)
static

References user_data().

Referenced by open_plugin_2().

◆ xv_display_frame()

static void xv_display_frame ( vo_driver_t * this_gen,
vo_frame_t * frame_gen )
static

◆ xv_dispose()

static void xv_dispose ( vo_driver_t * this_gen)
static

◆ xv_find_adaptor_by_port()

static unsigned int xv_find_adaptor_by_port ( int port,
unsigned int adaptors,
XvAdaptorInfo * adaptor_info )
static

References type.

Referenced by open_plugin_2().

◆ xv_flush_recent_frames()

static int xv_flush_recent_frames ( xv_driver_t * this)
static

◆ xv_frame_dispose()

static void xv_frame_dispose ( vo_frame_t * vo_img)
static

◆ xv_frame_field()

static void xv_frame_field ( vo_frame_t * vo_img,
int which_field )
static

Referenced by xv_alloc_frame().

◆ xv_fullrange_cb_config()

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

◆ xv_get_capabilities()

static uint32_t xv_get_capabilities ( vo_driver_t * this_gen)
static

Referenced by open_plugin_2().

◆ xv_get_property()

static int xv_get_property ( vo_driver_t * this_gen,
int property )
static

◆ xv_get_property_min_max()

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

References VO_NUM_PROPERTIES.

Referenced by open_plugin_2().

◆ xv_gui_data_exchange()

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

◆ xv_new_color()

static void xv_new_color ( xv_driver_t * this,
int cm )
static

◆ xv_open_port()

static int xv_open_port ( xv_driver_t * this,
XvPortID port )
static

◆ xv_overlay_begin()

static void xv_overlay_begin ( vo_driver_t * this_gen,
vo_frame_t * frame_gen,
int changed )
static

◆ xv_overlay_blend()

static void xv_overlay_blend ( vo_driver_t * this_gen,
vo_frame_t * frame_gen,
vo_overlay_t * overlay )
static

◆ xv_overlay_end()

static void xv_overlay_end ( vo_driver_t * this_gen,
vo_frame_t * vo_img )
static

References LOCK_DISPLAY, UNLOCK_DISPLAY, and x11osd_expose().

Referenced by open_plugin_2().

◆ xv_prop_conf()

static void xv_prop_conf ( xv_driver_t * this,
int property,
const char * config_name,
const char * config_desc,
const char * config_help )
static

◆ xv_prop_init()

static void xv_prop_init ( xv_driver_t * this,
const xv_prop_list_t * l,
const XvAttribute attr )
static

◆ xv_prop_update()

static void xv_prop_update ( void * prop_gen,
xine_cfg_entry_t * entry )
static

◆ xv_prop_update_int()

static void xv_prop_update_int ( xv_property_t * prop,
int value )
static

◆ xv_redraw_needed()

static int xv_redraw_needed ( vo_driver_t * this_gen)
static

◆ xv_rem_yuy2_emu()

static void xv_rem_yuy2_emu ( xv_frame_t * f)
static

◆ xv_restore_port_attributes()

static void xv_restore_port_attributes ( xv_driver_t * this)
static

◆ xv_set_property()

static int xv_set_property ( vo_driver_t * this_gen,
int property,
int value )
static

◆ xv_slice_yuy2_emu()

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

◆ xv_update_frame_format()

static void xv_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

◆ xv_update_xv_pitch_alignment()

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

References xine_cfg_entry_s::num_value.

Referenced by open_plugin_2().

Variable Documentation

◆ bicubic_types

const char* const bicubic_types[] = { "Off", "On", "Auto", NULL }
static

Referenced by open_plugin_2().

◆ 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_xv
Definition video_out_xv.c:1834
static void * init_class(xine_t *xine, const void *visual_gen)
Definition video_out_xv.c:1806
static void * init_class_2(xine_t *xine, const void *visual_gen)
Definition video_out_xv.c:1825
static const vo_info_t vo_info_xv_2
Definition video_out_xv.c:1840
#define XINE_VERSION_CODE
Definition xine_internal.h:57
NULL
Definition xine_plugin.c:78
#define PLUGIN_NONE
Definition xine_plugin.h:29
#define PLUGIN_VIDEO_OUT
Definition xine_plugin.h:36

◆ gX11Fail

int gX11Fail
static

Referenced by create_ximage(), and HandleXError().

◆ prefer_labels

const char* const prefer_labels[] = { "Any", "Overlay", "Textured Video", "Blitter", NULL }
static

Referenced by open_plugin_2().

◆ prefer_substrings

const char prefer_substrings[][8] = { "", "Overlay", "Texture", "Blitter" }
static

Referenced by xv_autodetect_port().

◆ vo_info_xv

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

◆ vo_info_xv_2

const vo_info_t vo_info_xv_2
static
Initial value:
= {
.priority = 9,
.visual_type = XINE_VISUAL_TYPE_X11_2,
}
#define XINE_VISUAL_TYPE_X11_2
Definition xine.h:155