xine-lib: xine-lib-1.2.13/src/video_out/video_out_directfb.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Typedefs | Functions | Variables
video_out_directfb.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "xine.h"`
`#include <xine/xine_internal.h>`
`#include <xine/video_out.h>`
`#include <xine/xineutils.h>`
`#include <xine/vo_scale.h>`
`#include <directfb.h>`
`#include <directfb_version.h>`

## Data Structures
struct | directfb_frame_s
struct | directfb_driver_s
struct | directfb_class_t

## Macros
#define | LOG_MODULE "video_out_directfb"
#define | LOG_VERBOSE
#define | VERSION_CODE(M, m, r) (((M) * 1000) + ((m) * 100) + (r))
#define | DIRECTFB_VERSION_CODE
#define | DEFAULT_COLORKEY 0x202040
#define | DIRECTFB_OPTIONS
#define | XDIRECTFB_OPTIONS
#define | YCBCR_TO_RGB(y, cb, cr, r, g, b)
#define | LOCK_DISPLAY()
#define | UNLOCK_DISPLAY()
#define | MAX_RECTS 100

## Typedefs
typedef struct directfb_frame_s | directfb_frame_t
typedef struct directfb_driver_s | directfb_driver_t

## Functions
static uint32_t | directfb_get_capabilities (vo_driver_t *this_gen)
static void | directfb_frame_field (vo_frame_t *vo_img, int which_field)
static void | directfb_frame_dispose (vo_frame_t *vo_img)
static vo_frame_t * | directfb_alloc_frame (vo_driver_t *this_gen)
static void | directfb_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, double ratio, int fmt, int flags)
static void | directfb_clean_output_area (directfb_driver_t *this)
static void | directfb_overlay_begin (vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed)
static void | directfb_subpicture_paint (directfb_driver_t *this, vo_overlay_t *overlay)
static void | directfb_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay)
static void | directfb_overlay_end (vo_driver_t *this_gen, vo_frame_t *frame_gen)
static int | directfb_redraw_needed (vo_driver_t *this_gen)
static void | directfb_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
static void | directfb_display_frame2 (vo_driver_t *this_gen, vo_frame_t *frame_gen)
static int | directfb_get_property (vo_driver_t *this_gen, int property)
static int | directfb_set_property (vo_driver_t *this_gen, int property, int value)
static void | directfb_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max)
static int | directfb_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data)
static void | directfb_dispose (vo_driver_t *this_gen)
static void | update_config_cb (void *data, xine_cfg_entry_t *entry)
static void | init_config (directfb_driver_t *this)
static DFBEnumerationResult | find_overlay (DFBDisplayLayerID id, DFBDisplayLayerDescription dsc, void *ctx)
static DFBEnumerationResult | find_underlay (DFBDisplayLayerID id, DFBDisplayLayerDescription dsc, void *ctx)
static void | init_subpicture (directfb_driver_t *this)
static DFBResult | init_device (directfb_driver_t *this)
static void | directfb_frame_output_cb (void *user_data, int video_width, int video_height, double video_pixel_aspect, int *dest_x, int *dest_y, int *dest_width, int *dest_height, double *dest_pixel_aspect, int *win_x, int *win_y)
static int | convert_caps (DFBDisplayLayerCapabilities caps)
static vo_driver_t * | open_plugin_fb (video_driver_class_t *class_gen, const void *visual_gen)
static void * | init_class_fb (xine_t *xine, const void *visual_gen)

## Variables
static const vo_info_t | vo_info_directfb_fb
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ DEFAULT_COLORKEY

#define DEFAULT_COLORKEY 0x202040

Referenced by open_plugin_fb().

## ◆ DIRECTFB_OPTIONS

#define DIRECTFB_OPTIONS

Value:
"no-banner,"\
"bg-colour=00000000,"\
"no-vt-switch,"\
"no-vt-switching,"\
"no-sighandler,"\
"no-deinit-check,"\
"disable-module=linux_input,"\
"disable-module=keyboard"

Referenced by open_plugin_fb().

## ◆ DIRECTFB_VERSION_CODE

#define DIRECTFB_VERSION_CODE

Value:
VERSION_CODE( DIRECTFB_MAJOR_VERSION,\
DIRECTFB_MINOR_VERSION,\
DIRECTFB_MICRO_VERSION )
VERSION_CODE
#define VERSION_CODE(M, m, r)
Definition video_out_directfb.c:54

## ◆ LOCK_DISPLAY

#define LOCK_DISPLAY | ( |  | ) |

Value:
do { \
if (this->lock_display) \
this->lock_display (this->user_data); \
else \
XLockDisplay (this->display); \
} while (0)
user_data
static void user_data(vdpau_mpeg4_decoder_t *this_gen, uint8_t *buffer, int len)
Definition vdpau_mpeg4.c:695

Referenced by directfb_clean_output_area(), directfb_dispose(), directfb_gui_data_exchange(), directfb_overlay_begin(), directfb_overlay_blend(), and directfb_overlay_end().

## ◆ LOG_MODULE

#define LOG_MODULE "video_out_directfb"

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## ◆ MAX_RECTS

#define MAX_RECTS 100

Referenced by directfb_subpicture_paint().

## ◆ UNLOCK_DISPLAY

#define UNLOCK_DISPLAY | ( |  | ) |

Value:
do { \
if (this->unlock_display) \
this->unlock_display (this->user_data); \
else \
XUnlockDisplay (this->display); \
} while (0)

Referenced by directfb_clean_output_area(), directfb_dispose(), directfb_gui_data_exchange(), directfb_overlay_begin(), directfb_overlay_blend(), and directfb_overlay_end().

## ◆ VERSION_CODE

#define VERSION_CODE | ( |  | M,
|  |  | m,
|  |  | r ) (((M) * 1000) + ((m) * 100) + (r))

## ◆ XDIRECTFB_OPTIONS

#define XDIRECTFB_OPTIONS

Value:
"no-banner,"\
"no-sighandler,"\
"no-deinit-check"

## ◆ YCBCR_TO_RGB

#define YCBCR_TO_RGB | ( |  | y,
|  |  | cb,
|  |  | cr,
|  |  | r,
|  |  | g,
|  |  | b )

Value:
do { \
int _y, _cb, _cr, _r, _g, _b; \
_y = ((y) - 16) * 76309; \
_cb = (cb) - 128; \
_cr = (cr) - 128; \
_r = (_y + _cr * 104597 + 0x8000) >> 16; \
_g = (_y - _cb * 25675 - _cr * 53279 + 0x8000) >> 16; \
_b = (_y + _cb * 132201 + 0x8000) >> 16; \
(r) = (_r < 0) ? 0 : ((_r > 255) ? 255 : _r); \
(g) = (_g < 0) ? 0 : ((_g > 255) ? 255 : _g); \
(b) = (_b < 0) ? 0 : ((_b > 255) ? 255 : _b); \
} while (0)

Referenced by directfb_subpicture_paint().

## Typedef Documentation

## ◆ directfb_driver_t

typedef struct directfb_driver_s directfb_driver_t

## ◆ directfb_frame_t

typedef struct directfb_frame_s directfb_frame_t

## Function Documentation

## ◆ convert_caps()

static int convert_caps | ( | DFBDisplayLayerCapabilities | caps | ) |
| inlinestatic

References VO_CAP_BRIGHTNESS, VO_CAP_CONTRAST, VO_CAP_CROP, VO_CAP_HUE, VO_CAP_SATURATION, VO_CAP_YUY2, VO_CAP_YV12, VO_CAP_ZOOM_X, and VO_CAP_ZOOM_Y.

Referenced by open_plugin_fb().

## ◆ directfb_alloc_frame()

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

References directfb_frame_dispose(), directfb_frame_field(), vo_frame_s::dispose, vo_frame_s::driver, vo_frame_s::field, vo_frame_s::mutex, NULL, vo_frame_s::proc_frame, vo_frame_s::proc_slice, directfb_frame_s::vo_frame, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by open_plugin_fb().

## ◆ directfb_clean_output_area()

static void directfb_clean_output_area | ( | directfb_driver_t * | this | ) |
| static

References LOCK_DISPLAY, MAX, NULL, UNLOCK_DISPLAY, x11osd_resize(), XINE_VISUAL_TYPE_X11, and XINE_VISUAL_TYPE_X11_2.

Referenced by directfb_gui_data_exchange(), directfb_redraw_needed(), directfb_set_property(), and update_config_cb().

## ◆ directfb_display_frame()

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

References vo_frame_s::base, vo_frame_s::crop_bottom, vo_frame_s::crop_left, vo_frame_s::crop_right, vo_frame_s::crop_top, directfb_redraw_needed(), directfb_frame_s::format, vo_frame_s::free, directfb_frame_s::height, directfb_frame_s::locked, lprintf, NULL, vo_frame_s::pitches, directfb_frame_s::ratio, directfb_frame_s::surface, vo_frame_s::top_field_first, type, directfb_frame_s::vo_frame, and directfb_frame_s::width.

Referenced by open_plugin_fb().

## ◆ directfb_display_frame2()

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

References vo_frame_s::base, directfb_redraw_needed(), directfb_frame_s::format, vo_frame_s::free, directfb_frame_s::height, height, directfb_frame_s::locked, lprintf, NULL, vo_frame_s::pitches, directfb_frame_s::ratio, directfb_frame_s::surface, vo_frame_s::top_field_first, type, directfb_frame_s::vo_frame, directfb_frame_s::width, and width.

Referenced by open_plugin_fb().

## ◆ directfb_dispose()

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

References _x_alphablend_free(), _x_vo_scale_cleanup(), LOCK_DISPLAY, UNLOCK_DISPLAY, x11osd_destroy(), XINE_VISUAL_TYPE_X11, and XINE_VISUAL_TYPE_X11_2.

Referenced by open_plugin_fb().

## ◆ directfb_frame_dispose()

static void directfb_frame_dispose | ( | vo_frame_t * | vo_img | ) |
| static

References directfb_frame_s::locked, and directfb_frame_s::surface.

Referenced by directfb_alloc_frame().

## ◆ directfb_frame_field()

static void directfb_frame_field | ( | vo_frame_t * | vo_img,
|  | int | which_field )
| static

Referenced by directfb_alloc_frame().

## ◆ directfb_frame_output_cb()

static void directfb_frame_output_cb | ( | void * | user_data,
|  | int | video_width,
|  | int | video_height,
|  | double | video_pixel_aspect,
|  | int * | dest_x,
|  | int * | dest_y,
|  | int * | dest_width,
|  | int * | dest_height,
|  | double * | dest_pixel_aspect,
|  | int * | win_x,
|  | int * | win_y )
| static

References user_data().

Referenced by open_plugin_fb().

## ◆ directfb_get_capabilities()

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

Referenced by open_plugin_fb().

## ◆ directfb_get_property()

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

References type, VO_PROP_ASPECT_RATIO, VO_PROP_BRIGHTNESS, VO_PROP_COLORKEY, VO_PROP_CONTRAST, VO_PROP_HUE, VO_PROP_INTERLACED, VO_PROP_MAX_NUM_FRAMES, VO_PROP_SATURATION, VO_PROP_WINDOW_HEIGHT, VO_PROP_WINDOW_WIDTH, VO_PROP_ZOOM_X, VO_PROP_ZOOM_Y, and XINE_VO_ZOOM_STEP.

Referenced by open_plugin_fb().

## ◆ directfb_get_property_min_max()

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

References VO_PROP_ASPECT_RATIO, VO_PROP_BRIGHTNESS, VO_PROP_COLORKEY, VO_PROP_CONTRAST, VO_PROP_HUE, VO_PROP_INTERLACED, VO_PROP_SATURATION, VO_PROP_ZOOM_X, VO_PROP_ZOOM_Y, XINE_VO_ASPECT_NUM_RATIOS, XINE_VO_ZOOM_MAX, and XINE_VO_ZOOM_MIN.

Referenced by open_plugin_fb().

## ◆ directfb_gui_data_exchange()

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

References _x_vo_scale_translate_gui2video(), directfb_clean_output_area(), x11_rectangle_t::h, LOCK_DISPLAY, lprintf, NULL, UNLOCK_DISPLAY, x11_rectangle_t::w, x11_rectangle_t::x, x11osd_drawable_changed(), x11osd_expose(), XINE_GUI_SEND_DRAWABLE_CHANGED, XINE_GUI_SEND_EXPOSE_EVENT, XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO, XINE_VISUAL_TYPE_X11, XINE_VISUAL_TYPE_X11_2, and x11_rectangle_t::y.

Referenced by open_plugin_fb().

## ◆ directfb_overlay_begin()

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

References LOCK_DISPLAY, lprintf, NULL, vo_frame_s::overlay_offset_x, vo_frame_s::overlay_offset_y, UNLOCK_DISPLAY, and x11osd_clear().

Referenced by open_plugin_fb().

## ◆ directfb_overlay_blend()

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

References _x_blend_yuv(), _x_blend_yuy2(), vo_frame_s::base, directfb_subpicture_paint(), directfb_frame_s::format, directfb_frame_s::height, LOCK_DISPLAY, lprintf, vo_frame_s::pitches, vo_overlay_s::rle, UNLOCK_DISPLAY, vo_overlay_s::unscaled, directfb_frame_s::vo_frame, directfb_frame_s::width, and x11osd_blend().

Referenced by open_plugin_fb().

## ◆ directfb_overlay_end()

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

References LOCK_DISPLAY, lprintf, NULL, UNLOCK_DISPLAY, and x11osd_expose().

Referenced by open_plugin_fb().

## ◆ directfb_redraw_needed()

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

References _x_vo_scale_compute_ideal_size(), _x_vo_scale_compute_output_size(), _x_vo_scale_redraw_needed(), vo_frame_s::crop_bottom, vo_frame_s::crop_left, vo_frame_s::crop_right, vo_frame_s::crop_top, directfb_clean_output_area(), directfb_frame_s::height, lprintf, directfb_frame_s::ratio, directfb_frame_s::vo_frame, and directfb_frame_s::width.

Referenced by directfb_display_frame(), directfb_display_frame2(), and open_plugin_fb().

## ◆ directfb_set_property()

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

References _x_vo_scale_aspect_ratio_name_table, _x_vo_scale_compute_ideal_size(), directfb_clean_output_area(), NULL, VO_PROP_ASPECT_RATIO, VO_PROP_BRIGHTNESS, VO_PROP_COLORKEY, VO_PROP_CONTRAST, VO_PROP_DISCARD_FRAMES, VO_PROP_HUE, VO_PROP_INTERLACED, VO_PROP_SATURATION, VO_PROP_ZOOM_X, VO_PROP_ZOOM_Y, XINE_VERBOSITY_DEBUG, XINE_VO_ASPECT_NUM_RATIOS, XINE_VO_ZOOM_MAX, XINE_VO_ZOOM_MIN, XINE_VO_ZOOM_STEP, and xprintf.

Referenced by open_plugin_fb().

## ◆ directfb_subpicture_paint()

static void directfb_subpicture_paint | ( | directfb_driver_t * | this,
|  | vo_overlay_t * | overlay )
| static

References clut_s::cb, rle_elem_s::color, vo_overlay_s::color, clut_s::cr, vo_overlay_s::height, 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, lprintf, MAX_RECTS, vo_overlay_s::num_rle, OVL_PALETTE_SIZE, vo_overlay_s::rle, vo_overlay_s::trans, vo_overlay_s::width, width, vo_overlay_s::x, clut_s::y, vo_overlay_s::y, and YCBCR_TO_RGB.

Referenced by directfb_overlay_blend().

## ◆ directfb_update_frame_format()

static void directfb_update_frame_format | ( | vo_driver_t * | this_gen,
|  | vo_frame_t * | frame_gen,
|  | uint32_t | width,
|  | uint32_t | height,
|  | double | ratio,
|  | int | fmt,
|  | int | flags )
| static

References directfb_frame_s::format, directfb_frame_s::height, height, lprintf, NULL, directfb_frame_s::ratio, directfb_frame_s::surface, directfb_frame_s::width, width, and XINE_IMGFMT_YUY2.

Referenced by open_plugin_fb().

## ◆ find_overlay()

static DFBEnumerationResult find_overlay | ( | DFBDisplayLayerID | id,
|  | DFBDisplayLayerDescription | dsc,
|  | void * | ctx )
| static

References lprintf.

Referenced by open_plugin_fb().

## ◆ find_underlay()

static DFBEnumerationResult find_underlay | ( | DFBDisplayLayerID | id,
|  | DFBDisplayLayerDescription | dsc,
|  | void * | ctx )
| static

References lprintf.

Referenced by init_device().

## ◆ init_class_fb()

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

References default_video_driver_class_dispose, video_driver_class_s::description, video_driver_class_s::dispose, directfb_class_t::driver_class, video_driver_class_s::identifier, N_, NULL, video_driver_class_s::open_plugin, open_plugin_fb(), directfb_class_t::xine, XINE_VERBOSITY_LOG, and xprintf.

## ◆ init_config()

static void init_config | ( | directfb_driver_t * | this | ) |
| static

References _, config_values_s::register_bool, config_values_s::register_enum, config_values_s::register_range, and update_config_cb().

Referenced by open_plugin_fb().

## ◆ init_device()

static DFBResult init_device | ( | directfb_driver_t * | this | ) |
| static

References _, find_underlay(), NULL, type, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, XINE_VISUAL_TYPE_FB, and xprintf.

Referenced by open_plugin_fb().

## ◆ init_subpicture()

static void init_subpicture | ( | directfb_driver_t * | this | ) |
| static

References _, lprintf, NULL, XINE_VERBOSITY_LOG, and xprintf.

Referenced by open_plugin_fb().

## ◆ open_plugin_fb()

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

References _, _x_alphablend_init(), _x_vo_scale_init(), xine_s::config, convert_caps(), DEFAULT_COLORKEY, directfb_alloc_frame(), directfb_display_frame(), directfb_display_frame2(), directfb_dispose(), directfb_frame_output_cb(), directfb_get_capabilities(), directfb_get_property(), directfb_get_property_min_max(), directfb_gui_data_exchange(), DIRECTFB_OPTIONS, directfb_overlay_begin(), directfb_overlay_blend(), directfb_overlay_end(), directfb_redraw_needed(), directfb_set_property(), directfb_update_frame_format(), find_overlay(), fb_visual_t::frame_output_cb, init_config(), init_device(), init_subpicture(), NULL, config_values_s::register_num, type, fb_visual_t::user_data, directfb_class_t::visual_type, VO_CAP_UNSCALED_OVERLAY, config_values_s::xine, directfb_class_t::xine, XINE_VERBOSITY_LOG, XINE_VISUAL_TYPE_FB, XINE_VO_ASPECT_AUTO, and xprintf.

Referenced by init_class_fb().

## ◆ update_config_cb()

static void update_config_cb | ( | void * | data,
|  | xine_cfg_entry_t * | entry )
| static

References directfb_clean_output_area(), xine_cfg_entry_s::key, lprintf, xine_cfg_entry_s::num_value, x11osd_colorkey(), XINE_VERBOSITY_LOG, and xprintf.

Referenced by init_config().

## Variable Documentation

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_VIDEO_OUT, VIDEO_OUT_DRIVER_IFACE_VERSION, "DirectFB",
XINE_VERSION_CODE, &vo_info_directfb_fb, init_class_fb },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
VIDEO_OUT_DRIVER_IFACE_VERSION
#define VIDEO_OUT_DRIVER_IFACE_VERSION
Definition video_out.h:369
init_class_fb
static void * init_class_fb(xine_t *xine, const void *visual_gen)
Definition video_out_directfb.c:1931
vo_info_directfb_fb
static const vo_info_t vo_info_directfb_fb
Definition video_out_directfb.c:1961
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_directfb_fb

const vo_info_t vo_info_directfb_fb
| static

Initial value:
= {
.priority = 8,
.visual_type = XINE_VISUAL_TYPE_FB,
}
XINE_VISUAL_TYPE_FB
#define XINE_VISUAL_TYPE_FB
Definition xine.h:157