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

xine-lib 1.2.12

Data Structures | Macros | Functions | Variables
video_out_pgx32.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <pthread.h>`
`#include <fcntl.h>`
`#include <unistd.h>`
`#include <sys/fbio.h>`
`#include <sys/visual_io.h>`
`#include <sys/mman.h>`
`#include <X11/Xlib.h>`
`#include <X11/Xutil.h>`
`#include <X11/Xatom.h>`
`#include <dga/dga.h>`
`#include <xine/xine_internal.h>`
`#include "bswap.h"`
`#include <xine/vo_scale.h>`
`#include <xine/xineutils.h>`

## Data Structures
struct | pgx32_driver_class_t
struct | pgx32_frame_t
struct | pgx32_driver_t

## Macros
#define | GFXP_VRAM_MMAPLEN 0x00800000
#define | GFXP_REGS_MMAPLEN 0x00020000
#define | GFXP_REGSBASE 0x00800000
#define | FIFO_SPACE 0x0003
#define | RASTERISER_MODE 0x1014
#define | RECT_ORIGIN 0x101A
#define | RECT_SIZE 0x101B
#define | SCISSOR_MODE 0x1030
#define | SCISSOR_MIN_XY 0x1031
#define | SCISSOR_MAX_XY 0x1032
#define | AREA_STIPPLE_MODE 0x1034
#define | WINDOW_ORIGIN 0x1039
#define | DY 0x1005
#define | TEXTURE_ADDR_MODE 0x1070
#define | SSTART 0x1071
#define | DSDX 0x1072
#define | DSDY_DOM 0x1073
#define | TSTART 0x1074
#define | DTDX 0x1075
#define | DTDY_DOM 0x1076
#define | TEXTURE_BASE_ADDR 0x10B0
#define | TEXTURE_MAP_FORMAT 0x10B1
#define | TEXTURE_DATA_FORMAT 0x10B2
#define | TEXTURE_READ_MODE 0x10CE
#define | TEXTURE_COLOUR_MODE 0x10D0
#define | SHADING_MODE 0x10FC
#define | ALPHA_BLENDING_MODE 0x1102
#define | DITHERING_MODE 0x1103
#define | LOGICAL_OP_MODE 0x1105
#define | STENCIL_MODE 0x1131
#define | WRITE_MODE 0x1157
#define | WRITE_MASK 0x1158
#define | YUV_MODE 0x11E0
#define | RENDER 0x1007
#define | RENDER_BEGIN 0x00000000006020C0L
#define | blend(a, b, trans) (((a)*(trans) + (b)*(15-(trans))) / 15)

## Functions
static int | setup_dga (pgx32_driver_t *this)
static void | cleanup_dga (pgx32_driver_t *this)
static void | dispose_frame_internals (pgx32_frame_t *frame)
static uint32_t * | convert_yuy2 (uint32_t *src, int width, int pitch, int height, uint32_t *dst)
static uint32_t * | convert_yv12 (uint16_t *ysrc, uint8_t *usrc, uint8_t *vsrc, int width, int pitch, int height, uint32_t *dst)
static void | pgx32_frame_proc_frame (vo_frame_t *frame_gen)
static void | pgx32_frame_proc_slice (vo_frame_t *frame_gen, uint8_t **src)
static void | pgx32_frame_field (vo_frame_t *frame_gen, int which_field)
static void | pgx32_frame_dispose (vo_frame_t *frame_gen)
static uint32_t | pgx32_get_capabilities (vo_driver_t *this_gen)
static vo_frame_t * | pgx32_alloc_frame (vo_driver_t *this_gen)
static void | pgx32_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 | pgx32_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
static void | pgx32_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay)
static int | pgx32_get_property (vo_driver_t *this_gen, int property)
static int | pgx32_set_property (vo_driver_t *this_gen, int property, int value)
static void | pgx32_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max)
static int | pgx32_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data)
static int | pgx32_redraw_needed (vo_driver_t *this_gen)
static void | pgx32_dispose (vo_driver_t *this_gen)
static vo_driver_t * | pgx32_init_driver (video_driver_class_t *class_gen, const void *visual_gen)
static void * | pgx32_init_class (xine_t *xine, const void *visual_gen)

## Variables
static const int | pitch_code_table [33][2]
static const vo_info_t | vo_info_pgx32
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ ALPHA_BLENDING_MODE

#define ALPHA_BLENDING_MODE 0x1102

## ◆ AREA_STIPPLE_MODE

#define AREA_STIPPLE_MODE 0x1034

## ◆ blend

#define blend | ( |  | a,
|  |  | b,
|  |  | trans
| ) |  | (((a)*(trans) + (b)*(15-(trans))) / 15)

## ◆ DITHERING_MODE

#define DITHERING_MODE 0x1103

## ◆ DSDX

#define DSDX 0x1072

## ◆ DSDY_DOM

#define DSDY_DOM 0x1073

## ◆ DTDX

#define DTDX 0x1075

## ◆ DTDY_DOM

#define DTDY_DOM 0x1076

## ◆ DY

#define DY 0x1005

## ◆ FIFO_SPACE

#define FIFO_SPACE 0x0003

## ◆ GFXP_REGS_MMAPLEN

#define GFXP_REGS_MMAPLEN 0x00020000

## ◆ GFXP_REGSBASE

#define GFXP_REGSBASE 0x00800000

## ◆ GFXP_VRAM_MMAPLEN

#define GFXP_VRAM_MMAPLEN 0x00800000

## ◆ LOGICAL_OP_MODE

#define LOGICAL_OP_MODE 0x1105

## ◆ RASTERISER_MODE

#define RASTERISER_MODE 0x1014

## ◆ RECT_ORIGIN

#define RECT_ORIGIN 0x101A

## ◆ RECT_SIZE

#define RECT_SIZE 0x101B

## ◆ RENDER

#define RENDER 0x1007

## ◆ RENDER_BEGIN

#define RENDER_BEGIN 0x00000000006020C0L

## ◆ SCISSOR_MAX_XY

#define SCISSOR_MAX_XY 0x1032

## ◆ SCISSOR_MIN_XY

#define SCISSOR_MIN_XY 0x1031

## ◆ SCISSOR_MODE

#define SCISSOR_MODE 0x1030

## ◆ SHADING_MODE

#define SHADING_MODE 0x10FC

## ◆ SSTART

#define SSTART 0x1071

## ◆ STENCIL_MODE

#define STENCIL_MODE 0x1131

## ◆ TEXTURE_ADDR_MODE

#define TEXTURE_ADDR_MODE 0x1070

## ◆ TEXTURE_BASE_ADDR

#define TEXTURE_BASE_ADDR 0x10B0

## ◆ TEXTURE_COLOUR_MODE

#define TEXTURE_COLOUR_MODE 0x10D0

## ◆ TEXTURE_DATA_FORMAT

#define TEXTURE_DATA_FORMAT 0x10B2

## ◆ TEXTURE_MAP_FORMAT

#define TEXTURE_MAP_FORMAT 0x10B1

## ◆ TEXTURE_READ_MODE

#define TEXTURE_READ_MODE 0x10CE

## ◆ TSTART

#define TSTART 0x1074

## ◆ WINDOW_ORIGIN

#define WINDOW_ORIGIN 0x1039

## ◆ WRITE_MASK

#define WRITE_MASK 0x1158

## ◆ WRITE_MODE

#define WRITE_MODE 0x1157

## ◆ YUV_MODE

#define YUV_MODE 0x11E0

## Function Documentation

## ◆ cleanup_dga()

static void cleanup_dga | ( | pgx32_driver_t * | this | ) |
| static

Referenced by pgx32_dispose(), pgx32_gui_data_exchange(), and pgx32_init_driver().

## ◆ convert_yuy2()

static uint32_t * convert_yuy2 | ( | uint32_t * | src,
|  | int | width,
|  | int | pitch,
|  | int | height,
|  | uint32_t * | dst
| ) |  |
| static

References height, and width.

Referenced by pgx32_frame_proc_frame(), and pgx32_frame_proc_slice().

## ◆ convert_yv12()

static uint32_t * convert_yv12 | ( | uint16_t * | ysrc,
|  | uint8_t * | usrc,
|  | uint8_t * | vsrc,
|  | int | width,
|  | int | pitch,
|  | int | height,
|  | uint32_t * | dst
| ) |  |
| static

References height, v, and width.

Referenced by pgx32_frame_proc_frame(), and pgx32_frame_proc_slice().

## ◆ dispose_frame_internals()

static void dispose_frame_internals | ( | pgx32_frame_t * | frame | ) |
| static

References vo_frame_s::base, NULL, pgx32_frame_t::packedbuf, and pgx32_frame_t::vo_frame.

Referenced by pgx32_frame_dispose(), and pgx32_update_frame_format().

## ◆ pgx32_alloc_frame()

static vo_frame_t * pgx32_alloc_frame | ( | vo_driver_t * | this_gen | ) |
| static

References vo_frame_s::dispose, vo_frame_s::field, vo_frame_s::mutex, NULL, pgx32_frame_dispose(), pgx32_frame_field(), pgx32_frame_proc_frame(), pgx32_frame_proc_slice(), vo_frame_s::proc_frame, vo_frame_s::proc_slice, and pgx32_frame_t::vo_frame.

Referenced by pgx32_init_driver().

## ◆ pgx32_display_frame()

static void pgx32_display_frame | ( | vo_driver_t * | this_gen,
|  | vo_frame_t * | frame_gen
| ) |  |
| static

References _x_vo_scale_compute_ideal_size(), _x_vo_scale_compute_output_size(), _x_vo_scale_redraw_needed(), ALPHA_BLENDING_MODE, AREA_STIPPLE_MODE, DITHERING_MODE, DSDX, DSDY_DOM, DTDX, DTDY_DOM, DY, FIFO_SPACE, pgx32_frame_t::format, GFXP_VRAM_MMAPLEN, pgx32_frame_t::height, le2me_64, LOGICAL_OP_MODE, NULL, pgx32_frame_t::packedbuf, pgx32_frame_t::packedlen, pgx32_frame_t::pitch, pgx32_frame_t::pitch_code, RASTERISER_MODE, pgx32_frame_t::ratio, RECT_ORIGIN, RECT_SIZE, RENDER, RENDER_BEGIN, SCISSOR_MODE, SHADING_MODE, SSTART, STENCIL_MODE, TEXTURE_ADDR_MODE, TEXTURE_BASE_ADDR, TEXTURE_COLOUR_MODE, TEXTURE_DATA_FORMAT, TEXTURE_MAP_FORMAT, TEXTURE_READ_MODE, TSTART, pgx32_frame_t::width, WINDOW_ORIGIN, WRITE_MASK, WRITE_MODE, and YUV_MODE.

Referenced by pgx32_init_driver().

## ◆ pgx32_dispose()

static void pgx32_dispose | ( | vo_driver_t * | this_gen | ) |
| static

References _x_alphablend_free(), _x_vo_scale_cleanup(), cleanup_dga(), GFXP_REGS_MMAPLEN, and GFXP_VRAM_MMAPLEN.

Referenced by pgx32_init_driver().

## ◆ pgx32_frame_dispose()

static void pgx32_frame_dispose | ( | vo_frame_t * | frame_gen | ) |
| static

References dispose_frame_internals().

Referenced by pgx32_alloc_frame().

## ◆ pgx32_frame_field()

static void pgx32_frame_field | ( | vo_frame_t * | frame_gen,
|  | int | which_field
| ) |  |
| static

Referenced by pgx32_alloc_frame().

## ◆ pgx32_frame_proc_frame()

static void pgx32_frame_proc_frame | ( | vo_frame_t * | frame_gen | ) |
| static

References vo_frame_s::base, convert_yuy2(), convert_yv12(), pgx32_frame_t::format, pgx32_frame_t::height, pgx32_frame_t::pitch, vo_frame_s::proc_called, pgx32_frame_t::stripe_dst, pgx32_frame_t::vo_frame, pgx32_frame_t::width, XINE_IMGFMT_YUY2, and XINE_IMGFMT_YV12.

Referenced by pgx32_alloc_frame().

## ◆ pgx32_frame_proc_slice()

static void pgx32_frame_proc_slice | ( | vo_frame_t * | frame_gen,
|  | uint8_t ** | src
| ) |  |
| static

References convert_yuy2(), convert_yv12(), pgx32_frame_t::format, pgx32_frame_t::lines_remaining, pgx32_frame_t::pitch, vo_frame_s::proc_called, pgx32_frame_t::stripe_dst, pgx32_frame_t::vo_frame, pgx32_frame_t::width, XINE_IMGFMT_YUY2, and XINE_IMGFMT_YV12.

Referenced by pgx32_alloc_frame().

## ◆ pgx32_get_capabilities()

static uint32_t pgx32_get_capabilities | ( | vo_driver_t * | this_gen | ) |
| static

References VO_CAP_YUY2, and VO_CAP_YV12.

Referenced by pgx32_init_driver().

## ◆ pgx32_get_property()

static int pgx32_get_property | ( | vo_driver_t * | this_gen,
|  | int | property
| ) |  |
| static

References VO_PROP_ASPECT_RATIO, and VO_PROP_INTERLACED.

Referenced by pgx32_init_driver().

## ◆ pgx32_get_property_min_max()

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

Referenced by pgx32_init_driver().

## ◆ pgx32_gui_data_exchange()

static int pgx32_gui_data_exchange | ( | vo_driver_t * | this_gen,
|  | int | data_type,
|  | void * | data
| ) |  |
| static

References _x_abort, _x_vo_scale_translate_gui2video(), cleanup_dga(), x11_rectangle_t::h, setup_dga(), x11_rectangle_t::w, x11_rectangle_t::x, XINE_GUI_SEND_DRAWABLE_CHANGED, XINE_GUI_SEND_EXPOSE_EVENT, XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO, and x11_rectangle_t::y.

Referenced by pgx32_init_driver().

## ◆ pgx32_init_class()

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

References default_video_driver_class_dispose, N_, NULL, and pgx32_init_driver().

## ◆ pgx32_init_driver()

static vo_driver_t * pgx32_init_driver | ( | video_driver_class_t * | class_gen,
|  | const void * | visual_gen
| ) |  |
| static

References _x_alphablend_init(), _x_vo_scale_cleanup(), _x_vo_scale_init(), cleanup_dga(), GFXP_REGS_MMAPLEN, GFXP_VRAM_MMAPLEN, NULL, pgx32_alloc_frame(), pgx32_display_frame(), pgx32_dispose(), pgx32_get_capabilities(), pgx32_get_property(), pgx32_get_property_min_max(), pgx32_gui_data_exchange(), pgx32_overlay_blend(), pgx32_redraw_needed(), pgx32_set_property(), pgx32_update_frame_format(), setup_dga(), XINE_VERBOSITY_DEBUG, XINE_VO_ASPECT_AUTO, and xprintf.

Referenced by pgx32_init_class().

## ◆ pgx32_overlay_blend()

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

References blend, clut_s::cb, rle_elem_s::color, vo_overlay_s::color, clut_s::cr, vo_overlay_s::hili_bottom, vo_overlay_s::hili_color, vo_overlay_s::hili_left, vo_overlay_s::hili_right, vo_overlay_s::hili_top, vo_overlay_s::hili_trans, rle_elem_s::len, vo_overlay_s::num_rle, pgx32_frame_t::packedbuf, pgx32_frame_t::pitch, vo_overlay_s::rle, vo_overlay_s::trans, vo_overlay_s::width, width, vo_overlay_s::x, clut_s::y, and vo_overlay_s::y.

Referenced by pgx32_init_driver().

## ◆ pgx32_redraw_needed()

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

References _x_vo_scale_redraw_needed().

Referenced by pgx32_init_driver().

## ◆ pgx32_set_property()

static int pgx32_set_property | ( | vo_driver_t * | this_gen,
|  | int | property,
|  | int | value
| ) |  |
| static

References _x_vo_scale_compute_ideal_size(), VO_PROP_ASPECT_RATIO, VO_PROP_INTERLACED, XINE_VO_ASPECT_AUTO, and XINE_VO_ASPECT_NUM_RATIOS.

Referenced by pgx32_init_driver().

## ◆ pgx32_update_frame_format()

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

References _x_abort, vo_frame_s::base, dispose_frame_internals(), pgx32_frame_t::format, height, pgx32_frame_t::height, pgx32_frame_t::lines_remaining, pgx32_frame_t::packedbuf, pgx32_frame_t::packedlen, pgx32_frame_t::pitch, pgx32_frame_t::pitch_code, pitch_code_table, vo_frame_s::pitches, pgx32_frame_t::ratio, pgx32_frame_t::stripe_dst, pgx32_frame_t::vo_frame, width, pgx32_frame_t::width, XINE_IMGFMT_YUY2, XINE_IMGFMT_YV12, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by pgx32_init_driver().

## ◆ setup_dga()

static int setup_dga | ( | pgx32_driver_t * | this | ) |
| static

References _, NULL, XINE_VERBOSITY_LOG, and xprintf.

Referenced by pgx32_gui_data_exchange(), and pgx32_init_driver().

## Variable Documentation

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{PLUGIN_VIDEO_OUT, 22, "pgx32", XINE_VERSION_CODE, &vo_info_pgx32, pgx32_init_class},
{PLUGIN_NONE, 0, NULL, 0, NULL, NULL}
}
vo_info_pgx32
static const vo_info_t vo_info_pgx32
Definition: video_out_pgx32.c:786
pgx32_init_class
static void * pgx32_init_class(xine_t *xine, const void *visual_gen)
Definition: video_out_pgx32.c:852
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

## ◆ pitch_code_table

const int pitch_code_table[33][2]
| static

Referenced by pgx32_update_frame_format().

## ◆ vo_info_pgx32

const vo_info_t vo_info_pgx32
| static

Initial value:
= {
.priority = 10,
.visual_type = XINE_VISUAL_TYPE_X11,
}
XINE_VISUAL_TYPE_X11
#define XINE_VISUAL_TYPE_X11
Definition: xine.h:154