xine-lib: xine-lib-1.2.12/src/video_out/video_out_directx.c File Reference

xine-lib 1.2.12

Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
video_out_directx.c File Reference
`#include <windows.h>`
`#include <ddraw.h>`
`#include <pthread.h>`
`#include "xine.h"`
`#include <xine/video_out.h>`
`#include <xine/xine_internal.h>`
`#include "yuv2rgb.h"`

## Data Structures
struct | win32_frame_t
struct | win32_driver_t
struct | directx_class_t

## Macros
#define | XINE_NEED_WIN32_VISUAL
#define | LOG_MODULE "video_out_directx"
#define | LOG_VERBOSE
#define | RGB_SUPPORT 0
#define | BORDER_SIZE 8
#define | IMGFMT_NATIVE 4
#define | IID_IDirectDraw xine_IID_IDirectDraw

## Typedefs
typedef unsigned char | boolean

## Enumerations
enum | vo_directx_hwaccel_enum { VO_DIRECTX_HWACCEL_FULL = 0 , VO_DIRECTX_HWACCEL_SCALE = 1 , VO_DIRECTX_HWACCEL_NONE = 2 }

## Functions
static void | Error (HWND hwnd, LPCSTR szfmt,...)
static void | UpdateRect (HWND WndHnd, RECT *rect, const win32_visual_t *win32_visual)
static boolean | CreatePrimary (win32_driver_t *win32_driver)
static boolean | CreateSecondary (win32_driver_t *win32_driver, int width, int height, int format)
static void | Destroy (win32_driver_t *win32_driver)
static boolean | CheckPixelFormat (win32_driver_t *win32_driver)
static boolean | Overlay (LPDIRECTDRAWSURFACE src_surface, RECT *src_rect, LPDIRECTDRAWSURFACE dst_surface, RECT *dst_rect, COLORREF color_key)
static boolean | BltCopy (LPDIRECTDRAWSURFACE src_surface, RECT *src_rect, LPDIRECTDRAWSURFACE dst_surface, RECT *dst_rect)
static boolean | DisplayFrame (win32_driver_t *win32_driver)
static void * | Lock (win32_driver_t *win32_driver, void *surface)
static void | Unlock (void *surface)
static uint32_t | win32_get_capabilities (vo_driver_t *vo_driver)
static void | win32_frame_field (vo_frame_t *vo_frame, int which_field)
static void | win32_free_framedata (vo_frame_t *vo_frame)
static void | win32_frame_dispose (vo_frame_t *vo_frame)
static vo_frame_t * | win32_alloc_frame (vo_driver_t *vo_driver)
static void | win32_update_frame_format (vo_driver_t *vo_driver, vo_frame_t *vo_frame, uint32_t width, uint32_t height, double ratio, int format, int flags)
static void | win32_display_frame (vo_driver_t *vo_driver, vo_frame_t *vo_frame)
static void | win32_overlay_blend (vo_driver_t *vo_driver, vo_frame_t *vo_frame, vo_overlay_t *vo_overlay)
static int | win32_get_property (vo_driver_t *vo_driver, int property)
static int | win32_set_property (vo_driver_t *vo_driver, int property, int value)
static void | win32_get_property_min_max (vo_driver_t *vo_driver, int property, int *min, int *max)
static int | win32_gui_data_exchange (vo_driver_t *vo_driver, int data_type, void *data)
static int | win32_redraw_needed (vo_driver_t *this_gen)
static void | win32_exit (vo_driver_t *vo_driver)
static vo_driver_t * | open_plugin (video_driver_class_t *class_gen, const void *visual)
static void * | init_class (xine_t *xine, const void *visual_gen)

## Variables
static const GUID | xine_IID_IDirectDraw
static const vo_info_t | vo_info_win32
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ BORDER_SIZE

#define BORDER_SIZE 8

## ◆ IID_IDirectDraw

#define IID_IDirectDraw xine_IID_IDirectDraw

## ◆ IMGFMT_NATIVE

#define IMGFMT_NATIVE 4

## ◆ LOG_MODULE

#define LOG_MODULE "video_out_directx"

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## ◆ RGB_SUPPORT

#define RGB_SUPPORT 0

## ◆ XINE_NEED_WIN32_VISUAL

#define XINE_NEED_WIN32_VISUAL

## Typedef Documentation

## ◆ boolean

typedef unsigned char boolean

## Enumeration Type Documentation

## ◆ vo_directx_hwaccel_enum

enum vo_directx_hwaccel_enum

Enumerator
VO_DIRECTX_HWACCEL_FULL |
VO_DIRECTX_HWACCEL_SCALE |
VO_DIRECTX_HWACCEL_NONE |

## Function Documentation

## ◆ BltCopy()

static boolean BltCopy | ( | LPDIRECTDRAWSURFACE | src_surface,
|  | RECT * | src_rect,
|  | LPDIRECTDRAWSURFACE | dst_surface,
|  | RECT * | dst_rect
| ) |  |
| static

References Error().

Referenced by DisplayFrame().

## ◆ CheckPixelFormat()

static boolean CheckPixelFormat | ( | win32_driver_t * | win32_driver | ) |
| static

References win32_driver_t::bytespp, Error(), lprintf, win32_driver_t::mode, MODE_15_BGR, MODE_15_RGB, MODE_16_BGR, MODE_16_RGB, MODE_24_BGR, MODE_24_RGB, MODE_32_BGR, MODE_32_RGB, win32_driver_t::primary, and win32_driver_t::primary_pixel_format.

Referenced by open_plugin().

## ◆ CreatePrimary()

static boolean CreatePrimary | ( | win32_driver_t * | win32_driver | ) |
| static

References win32_driver_t::ddclipper, win32_driver_t::ddobj, Error(), IID_IDirectDraw, win32_driver_t::primary, UpdateRect(), win32_driver_t::win32_visual, win32_driver_t::WndHnd, win32_driver_t::WndRect, win32_driver_t::xine, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by open_plugin().

## ◆ CreateSecondary()

static boolean CreateSecondary | ( | win32_driver_t * | win32_driver,
|  | int | width,
|  | int | height,
|  | int | format
| ) |  |
| static

References win32_driver_t::act_format, win32_driver_t::ddobj, Error(), height, win32_driver_t::height, win32_driver_t::hwaccel, IMGFMT_NATIVE, lprintf, mmioFOURCC, win32_driver_t::primary_pixel_format, win32_driver_t::req_format, win32_driver_t::secondary, VO_DIRECTX_HWACCEL_FULL, VO_DIRECTX_HWACCEL_SCALE, width, win32_driver_t::width, win32_driver_t::xine, XINE_IMGFMT_YUY2, XINE_IMGFMT_YV12, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by win32_display_frame().

## ◆ Destroy()

static void Destroy | ( | win32_driver_t * | win32_driver | ) |
| static

References _x_alphablend_free(), win32_driver_t::alphablend_extra_data, win32_driver_t::ddclipper, win32_driver_t::ddobj, yuv2rgb_factory_s::dispose, yuv2rgb_s::dispose, win32_driver_t::primary, win32_driver_t::secondary, win32_driver_t::yuv2rgb, and win32_driver_t::yuv2rgb_factory.

Referenced by open_plugin(), and win32_exit().

## ◆ DisplayFrame()

static boolean DisplayFrame | ( | win32_driver_t * | win32_driver | ) |
| static

References win32_driver_t::act_format, BltCopy(), BORDER_SIZE, win32_driver_t::height, Overlay(), win32_driver_t::primary, win32_driver_t::ratio, win32_driver_t::secondary, win32_driver_t::width, win32_driver_t::win32_visual, win32_driver_t::WndRect, XINE_IMGFMT_YUY2, and XINE_IMGFMT_YV12.

Referenced by win32_display_frame(), and win32_gui_data_exchange().

## ◆ Error()

static void Error | ( | HWND | hwnd,
|  | LPCSTR | szfmt,
|  |  | ...
| ) |  |
| static

Referenced by BltCopy(), CheckPixelFormat(), CreatePrimary(), CreateSecondary(), Lock(), open_plugin(), Overlay(), and win32_gui_data_exchange().

## ◆ init_class()

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

References default_video_driver_class_dispose, video_driver_class_s::description, video_driver_class_s::dispose, directx_class_t::driver_class, video_driver_class_s::identifier, N_, NULL, open_plugin(), video_driver_class_s::open_plugin, and directx_class_t::xine.

## ◆ Lock()

static void * Lock | ( | win32_driver_t * | win32_driver,
|  | void * | surface
| ) |  |
| static

References win32_driver_t::ddsd, and Error().

Referenced by win32_display_frame().

## ◆ open_plugin()

static vo_driver_t * open_plugin | ( | video_driver_class_t * | class_gen,
|  | const void * | visual
| ) |  |
| static

References _, _x_alphablend_init(), CheckPixelFormat(), xine_s::config, CreatePrimary(), Destroy(), Error(), LOG_MODULE, NULL, config_values_s::register_enum, win32_alloc_frame(), win32_display_frame(), win32_exit(), win32_get_capabilities(), win32_get_property(), win32_get_property_min_max(), win32_gui_data_exchange(), win32_overlay_blend(), win32_redraw_needed(), win32_set_property(), win32_update_frame_format(), config_values_s::xine, XINE_VERBOSITY_LOG, xprintf, and yuv2rgb_factory_init().

Referenced by init_class().

## ◆ Overlay()

static boolean Overlay | ( | LPDIRECTDRAWSURFACE | src_surface,
|  | RECT * | src_rect,
|  | LPDIRECTDRAWSURFACE | dst_surface,
|  | RECT * | dst_rect,
|  | COLORREF | color_key
| ) |  |
| static

References Error().

Referenced by DisplayFrame().

## ◆ Unlock()

static void Unlock | ( | void * | surface | ) |
| static

Referenced by win32_display_frame().

## ◆ UpdateRect()

static void UpdateRect | ( | HWND | WndHnd,
|  | RECT * | rect,
|  | const win32_visual_t * | win32_visual
| ) |  |
| static

Referenced by CreatePrimary(), and win32_gui_data_exchange().

## ◆ win32_alloc_frame()

static vo_frame_t * win32_alloc_frame | ( | vo_driver_t * | vo_driver | ) |
| static

References vo_frame_s::dispose, vo_frame_s::field, win32_frame_t::format, vo_frame_s::mutex, NULL, vo_frame_s::proc_frame, vo_frame_s::proc_slice, win32_frame_t::vo_frame, win32_frame_dispose(), and win32_frame_field().

Referenced by open_plugin().

## ◆ win32_display_frame()

static void win32_display_frame | ( | vo_driver_t * | vo_driver,
|  | vo_frame_t * | vo_frame
| ) |  |
| static

References win32_driver_t::act_format, vo_frame_s::base, win32_driver_t::bytespp, yuv2rgb_s::configure, win32_driver_t::contents, CreateSecondary(), win32_driver_t::current, win32_driver_t::ddsd, DisplayFrame(), win32_frame_t::format, vo_frame_s::free, vo_frame_s::height, win32_frame_t::height, win32_driver_t::height, IMGFMT_NATIVE, Lock(), NULL, vo_frame_s::pitches, win32_frame_t::ratio, win32_driver_t::ratio, win32_driver_t::req_format, win32_driver_t::secondary, Unlock(), win32_frame_t::vo_frame, vo_frame_s::width, win32_frame_t::width, win32_driver_t::width, xine_fast_memcpy, XINE_IMGFMT_YUY2, XINE_IMGFMT_YV12, win32_driver_t::yuv2rgb, yuv2rgb_s::yuv2rgb_fun, and yuv2rgb_s::yuy22rgb_fun.

Referenced by open_plugin().

## ◆ win32_exit()

static void win32_exit | ( | vo_driver_t * | vo_driver | ) |
| static

References Destroy().

Referenced by open_plugin().

## ◆ win32_frame_dispose()

static void win32_frame_dispose | ( | vo_frame_t * | vo_frame | ) |
| static

References win32_frame_t::buffer, and win32_free_framedata().

Referenced by win32_alloc_frame().

## ◆ win32_frame_field()

static void win32_frame_field | ( | vo_frame_t * | vo_frame,
|  | int | which_field
| ) |  |
| static

Referenced by win32_alloc_frame().

## ◆ win32_free_framedata()

static void win32_free_framedata | ( | vo_frame_t * | vo_frame | ) |
| static

References vo_frame_s::base, NULL, and win32_frame_t::vo_frame.

Referenced by win32_frame_dispose(), and win32_update_frame_format().

## ◆ win32_get_capabilities()

static uint32_t win32_get_capabilities | ( | vo_driver_t * | vo_driver | ) |
| static

References VO_CAP_YUY2, and VO_CAP_YV12.

Referenced by open_plugin().

## ◆ win32_get_property()

static int win32_get_property | ( | vo_driver_t * | vo_driver,
|  | int | property
| ) |  |
| static

References lprintf.

Referenced by open_plugin().

## ◆ win32_get_property_min_max()

static void win32_get_property_min_max | ( | vo_driver_t * | vo_driver,
|  | int | property,
|  | int * | min,
|  | int * | max
| ) |  |
| static

Referenced by open_plugin().

## ◆ win32_gui_data_exchange()

static int win32_gui_data_exchange | ( | vo_driver_t * | vo_driver,
|  | int | data_type,
|  | void * | data
| ) |  |
| static

References win32_driver_t::ddclipper, win32_driver_t::ddobj, DisplayFrame(), Error(), UpdateRect(), win32_driver_t::win32_visual, win32_driver_t::WndHnd, win32_driver_t::WndRect, and XINE_GUI_SEND_DRAWABLE_CHANGED.

Referenced by open_plugin(), and win32_redraw_needed().

## ◆ win32_overlay_blend()

static void win32_overlay_blend | ( | vo_driver_t * | vo_driver,
|  | vo_frame_t * | vo_frame,
|  | vo_overlay_t * | vo_overlay
| ) |  |
| static

References _x_blend_yuv(), _x_blend_yuy2(), win32_driver_t::alphablend_extra_data, vo_frame_s::base, vo_frame_s::format, win32_frame_t::height, alphablend_t::offset_x, alphablend_t::offset_y, vo_frame_s::overlay_offset_x, vo_frame_s::overlay_offset_y, vo_frame_s::pitches, vo_overlay_s::rle, win32_frame_t::vo_frame, win32_frame_t::width, and XINE_IMGFMT_YV12.

Referenced by open_plugin().

## ◆ win32_redraw_needed()

static int win32_redraw_needed | ( | vo_driver_t * | this_gen | ) |
| static

References _x_vo_scale_redraw_needed(), and win32_gui_data_exchange().

Referenced by open_plugin().

## ◆ win32_set_property()

static int win32_set_property | ( | vo_driver_t * | vo_driver,
|  | int | property,
|  | int | value
| ) |  |
| static

References win32_driver_t::current, vo_frame_s::free, NULL, win32_frame_t::vo_frame, and VO_PROP_DISCARD_FRAMES.

Referenced by open_plugin().

## ◆ win32_update_frame_format()

static void win32_update_frame_format | ( | vo_driver_t * | vo_driver,
|  | vo_frame_t * | vo_frame,
|  | uint32_t | width,
|  | uint32_t | height,
|  | double | ratio,
|  | int | format,
|  | int | flags
| ) |  |
| static

References vo_frame_s::base, win32_frame_t::buffer, win32_frame_t::format, height, win32_frame_t::height, NULL, vo_frame_s::pitches, win32_frame_t::ratio, win32_frame_t::size, win32_frame_t::vo_frame, width, win32_frame_t::width, win32_free_framedata(), win32_driver_t::xine, XINE_IMGFMT_YUY2, XINE_IMGFMT_YV12, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by open_plugin().

## Variable Documentation

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_VIDEO_OUT, 22, "vo_directx", XINE_VERSION_CODE, &vo_info_win32, init_class },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
vo_info_win32
static const vo_info_t vo_info_win32
Definition: video_out_directx.c:1366
init_class
static void * init_class(xine_t *xine, const void *visual_gen)
Definition: video_out_directx.c:1345
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition: xine_internal.h:57
NULL
NULL
Definition: xine_plugin.c:78
PLUGIN_NONE
#define PLUGIN_NONE
Definition: xine_plugin.h:29
PLUGIN_VIDEO_OUT
#define PLUGIN_VIDEO_OUT
Definition: xine_plugin.h:36

## ◆ vo_info_win32

const vo_info_t vo_info_win32
| static

Initial value:
= {
.priority = 7,
.visual_type = XINE_VISUAL_TYPE_DIRECTX,
}
XINE_VISUAL_TYPE_DIRECTX
#define XINE_VISUAL_TYPE_DIRECTX
Definition: xine.h:161

## ◆ xine_IID_IDirectDraw

const GUID xine_IID_IDirectDraw
| static

Initial value:
= {
0x6C14DB80,0xA733,0x11CE,{0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60}
}