xine-lib 1.2.13-20230125hg15249
|
#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_t * | xv_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_t * | open_plugin_2 (video_driver_class_t *class_gen, const void *visual_gen) |
static vo_driver_t * | open_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 |
#define CM_DRIVER_T xv_driver_t |
#define CM_LUT |
#define DEBUG_EMU |
#define LOCK_DISPLAY | ( | this | ) | this->lock_display (this->ld_user_data) |
Referenced by open_plugin_2(), xv_clean_output_area(), xv_display_frame(), xv_dispose(), xv_frame_dispose(), xv_gui_data_exchange(), xv_new_color(), xv_open_port(), xv_overlay_begin(), xv_overlay_blend(), xv_overlay_end(), xv_prop_update_int(), xv_restore_port_attributes(), xv_set_property(), and xv_update_frame_format().
#define LOG_MODULE "video_out_xv" |
#define LOG_VERBOSE |
#define UNLOCK_DISPLAY | ( | this | ) | this->unlock_display (this->ud_user_data); |
Referenced by open_plugin_2(), xv_clean_output_area(), xv_display_frame(), xv_dispose(), xv_frame_dispose(), xv_gui_data_exchange(), xv_new_color(), xv_open_port(), xv_overlay_begin(), xv_overlay_blend(), xv_overlay_end(), xv_prop_update_int(), xv_restore_port_attributes(), xv_set_property(), and xv_update_frame_format().
#define XV_PROPS |
typedef struct xv_driver_s xv_driver_t |
enum xv_prefertype |
|
static |
References _, gX11Fail, height, LOG_MODULE, lprintf, NULL, width, x11_DeInstallXErrorHandler(), x11_InstallXErrorHandler(), XINE_IMGFMT_YUY2, XINE_IMGFMT_YV12, xine_malloc_aligned(), XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by open_plugin_2(), and xv_update_frame_format().
|
static |
References xine_free_aligned().
Referenced by open_plugin_2(), and xv_update_frame_format().
|
static |
References gX11Fail.
Referenced by x11_InstallXErrorHandler().
|
static |
|
static |
|
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().
|
static |
|
static |
References NULL.
Referenced by xv_display_frame().
|
static |
References NULL.
Referenced by create_ximage(), and xv_open_port().
|
static |
References HandleXError().
Referenced by create_ximage(), and xv_open_port().
|
static |
References VO_NUM_RECENT_FRAMES.
Referenced by xv_display_frame().
|
static |
|
static |
References xv_frame_t::base, vo_frame_s::dispose, vo_frame_s::driver, vo_frame_s::field, xv_frame_t::format, xv_frame_t::height, xv_frame_t::image, vo_frame_s::mutex, NULL, vo_frame_s::proc_frame, vo_frame_s::proc_slice, xv_frame_t::req_height, xv_frame_t::req_width, xv_frame_t::vo_frame, xv_frame_t::width, xv_frame_dispose(), xv_frame_field(), and xv_frame_t::xvformat.
Referenced by open_plugin_2().
|
static |
References name, prefer_substrings, type, xv_open_port(), and xv_prefer_none.
Referenced by open_plugin_2().
|
static |
References LOCK_DISPLAY, UNLOCK_DISPLAY, VO_PROP_AUTOPAINT_COLORKEY, VO_PROP_COLORKEY, and x11osd_resize().
Referenced by xv_redraw_needed().
|
static |
References _x_vo_scale_compute_ideal_size().
Referenced by xv_redraw_needed(), and xv_set_property().
|
static |
References _x_vo_scale_compute_output_size().
Referenced by xv_redraw_needed().
|
static |
References xine_cfg_entry_s::num_value.
Referenced by open_plugin_2().
|
static |
References user_data().
Referenced by open_plugin_2().
|
static |
References user_data().
Referenced by open_plugin_2().
|
static |
References vo_frame_s::crop_bottom, vo_frame_s::crop_left, vo_frame_s::crop_right, vo_frame_s::crop_top, xv_frame_t::height, LOCK_DISPLAY, LOG_MODULE, lprintf, xv_frame_t::ratio, timeOfDay(), UNLOCK_DISPLAY, xv_frame_t::vo_frame, xv_frame_t::width, xv_add_recent_frame(), xv_new_color(), and xv_redraw_needed().
Referenced by open_plugin_2().
|
static |
References _x_alphablend_free(), _x_vo_scale_cleanup(), LOCK_DISPLAY, LOG_MODULE, NULL, UNLOCK_DISPLAY, VO_NUM_RECENT_FRAMES, x11osd_destroy(), XINE_VERBOSITY_DEBUG, xprintf, and xv_restore_port_attributes().
Referenced by open_plugin_2().
|
static |
References type.
Referenced by open_plugin_2().
|
static |
References vo_frame_s::free, NULL, xv_frame_t::vo_frame, and VO_NUM_RECENT_FRAMES.
Referenced by xv_set_property().
|
static |
References vo_frame_s::driver, xv_frame_t::image, LOCK_DISPLAY, vo_frame_s::mutex, NULL, xv_frame_t::shminfo, UNLOCK_DISPLAY, xv_frame_t::vo_frame, xine_free_aligned(), and xv_rem_yuy2_emu().
Referenced by xv_alloc_frame().
|
static |
Referenced by xv_alloc_frame().
|
static |
References xine_cfg_entry_s::num_value, and VO_CAP_FULLRANGE.
Referenced by open_plugin_2().
|
static |
Referenced by open_plugin_2().
|
static |
References LOG_MODULE, lprintf, VO_NUM_PROPERTIES, VO_PROP_OUTPUT_HEIGHT, VO_PROP_OUTPUT_WIDTH, VO_PROP_OUTPUT_XOFFSET, VO_PROP_OUTPUT_YOFFSET, VO_PROP_WINDOW_HEIGHT, and VO_PROP_WINDOW_WIDTH.
Referenced by open_plugin_2().
|
static |
References VO_NUM_PROPERTIES.
Referenced by open_plugin_2().
|
static |
References _x_vo_scale_translate_gui2video(), x11_rectangle_t::h, LOCK_DISPLAY, NULL, UNLOCK_DISPLAY, x11_rectangle_t::w, x11_rectangle_t::x, x11osd_drawable_changed(), x11osd_expose(), XINE_GUI_SEND_COMPLETION_EVENT, XINE_GUI_SEND_DRAWABLE_CHANGED, XINE_GUI_SEND_EXPOSE_EVENT, XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO, and x11_rectangle_t::y.
Referenced by open_plugin_2().
|
static |
References cm_names, LOCK_DISPLAY, UNLOCK_DISPLAY, VO_PROP_BRIGHTNESS, VO_PROP_CONTRAST, VO_PROP_SATURATION, XINE_VERBOSITY_LOG, and xprintf.
Referenced by xv_display_frame().
|
static |
References _, LOCK_DISPLAY, LOG_MODULE, lprintf, UNLOCK_DISPLAY, VO_CAP_YUY2, VO_CAP_YV12, x11_DeInstallXErrorHandler(), x11_InstallXErrorHandler(), XINE_IMGFMT_YUY2, XINE_IMGFMT_YV12, XINE_VERBOSITY_LOG, and xprintf.
Referenced by open_plugin_2(), and xv_autodetect_port().
|
static |
References LOCK_DISPLAY, vo_frame_s::overlay_offset_x, vo_frame_s::overlay_offset_y, UNLOCK_DISPLAY, and x11osd_clear().
Referenced by open_plugin_2().
|
static |
References _x_blend_yuv(), _x_blend_yuy2(), vo_frame_s::base, xv_frame_t::format, xv_frame_t::height, LOCK_DISPLAY, vo_frame_s::pitches, vo_overlay_s::rle, UNLOCK_DISPLAY, vo_overlay_s::unscaled, xv_frame_t::vo_frame, xv_frame_t::width, x11osd_blend(), and XINE_IMGFMT_YV12.
Referenced by open_plugin_2().
|
static |
References LOCK_DISPLAY, UNLOCK_DISPLAY, and x11osd_expose().
Referenced by open_plugin_2().
|
static |
References xv_property_t::entry, config_values_s::lookup_entry, xv_property_t::max, xv_property_t::min, cfg_entry_s::num_value, config_values_s::register_bool, config_values_s::register_range, xv_property_t::value, xv_prop_update(), xv_prop_update_int(), and xv_set_property().
Referenced by open_plugin_2().
|
static |
References xv_property_t::atom, xv_property_t::initial_value, LOG_MODULE, xv_property_t::max, xv_property_t::min, xv_property_t::name, xv_property_t::value, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by open_plugin_2().
|
static |
References xine_cfg_entry_s::num_value, and xv_prop_update_int().
Referenced by open_plugin_2(), and xv_prop_conf().
|
static |
References xv_property_t::atom, LOCK_DISPLAY, LOG_MODULE, xv_property_t::name, xv_property_t::this, UNLOCK_DISPLAY, xv_property_t::value, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by open_plugin_2(), xv_prop_conf(), and xv_prop_update().
|
static |
References _x_vo_scale_redraw_needed(), xv_clean_output_area(), xv_compute_ideal_size(), and xv_compute_output_size().
Referenced by open_plugin_2(), and xv_display_frame().
|
static |
References vo_frame_s::base, xv_frame_t::base, xv_frame_t::format, NULL, vo_frame_s::pitches, xv_frame_t::pitches, vo_frame_s::proc_slice, xv_frame_t::vo_frame, xine_free_aligned(), and XINE_IMGFMT_YV12.
Referenced by xv_frame_dispose(), and xv_update_frame_format().
|
static |
References xv_property_t::atom, xv_property_t::defer, xv_property_t::initial_value, LOCK_DISPLAY, UNLOCK_DISPLAY, and xv_property_t::value.
Referenced by xv_dispose().
|
static |
References LOCK_DISPLAY, LOG_MODULE, UNLOCK_DISPLAY, VO_NUM_PROPERTIES, VO_PROP_ASPECT_RATIO, VO_PROP_DISCARD_FRAMES, VO_PROP_ZOOM_X, VO_PROP_ZOOM_Y, XINE_VERBOSITY_LOG, XINE_VO_ASPECT_AUTO, XINE_VO_ASPECT_NUM_RATIOS, XINE_VO_ZOOM_MAX, XINE_VO_ZOOM_MIN, XINE_VO_ZOOM_STEP, xprintf, xv_compute_ideal_size(), and xv_flush_recent_frames().
Referenced by open_plugin_2(), and xv_prop_conf().
|
static |
References vo_frame_s::base, xv_frame_t::base, xv_frame_t::height, vo_frame_s::pitches, xv_frame_t::pitches, vo_frame_s::proc_called, xv_frame_t::vo_frame, xv_frame_t::width, and yuy2_to_yv12.
Referenced by xv_add_yuy2_emu().
|
static |
References vo_frame_s::base, create_ximage(), dispose_ximage(), xv_frame_t::format, vo_frame_s::height, height, xv_frame_t::height, xv_frame_t::image, LOCK_DISPLAY, NULL, vo_frame_s::pitches, xv_frame_t::ratio, xv_frame_t::req_height, xv_frame_t::req_width, xv_frame_t::shminfo, UNLOCK_DISPLAY, xv_frame_t::vo_frame, vo_frame_s::width, width, xv_frame_t::width, XINE_IMGFMT_YUY2, XINE_IMGFMT_YV12, xv_add_yuy2_emu(), xv_rem_yuy2_emu(), and xv_frame_t::xvformat.
Referenced by open_plugin_2().
|
static |
References xine_cfg_entry_s::num_value.
Referenced by open_plugin_2().
|
static |
Referenced by open_plugin_2().
const plugin_info_t xine_plugin_info [] EXPORTED |
|
static |
Referenced by create_ximage(), and HandleXError().
|
static |
Referenced by open_plugin_2().
|
static |
Referenced by xv_autodetect_port().
|
static |
|
static |