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

xine-lib 1.2.12

Data Structures | Macros | Typedefs | Functions | Variables
video_out_mmal.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <inttypes.h>`
`#include <bcm_host.h>`
`#include <interface/mmal/mmal.h>`
`#include <interface/mmal/util/mmal_util.h>`
`#include <interface/mmal/util/mmal_default_components.h>`
`#include <interface/vmcs_host/vc_dispmanx.h>`
`#include "xine.h"`
`#include <xine/xine_internal.h>`
`#include <xine/video_out.h>`
`#include <xine/xineutils.h>`

## Data Structures
struct | mmal_frame_t
struct | mmal_overlay_s
struct | mmal_driver_t
struct | mmal_class_t

## Macros
#define | LOG_MODULE "video_out_mmal"
#define | LOG_VERBOSE
#define | FRAME_ALLOC /* allocate buffer based on frame size. if not defined, all buffers are suitable for 1920x1088 YUY2. */
#define | HW_OVERLAY /* draw overlay using HW. if undefined, draw in software. */
#define | MAX_VIDEO_WIDTH (2*1920)
#define | MAX_VIDEO_HEIGHT (2*1088)
#define | MAX_VIDEO_FRAMES 20
#define | LOG_STATUS(msg)

## Typedefs
typedef struct mmal_overlay_s | mmal_overlay_t

## Functions
static int | update_tv_resolution (mmal_driver_t *this)
static int | config_display (mmal_driver_t *this, int src_x, int src_y, int src_w, int src_h)
static void | control_port_cb (MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
static void | input_port_cb (MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
static void | disable_renderer (mmal_driver_t *this)
static int | configure_renderer (mmal_driver_t *this, int format, int width, int height, int crop_x, int crop_y, int crop_w, int crop_h, double ratio)
static uint32_t | mmal_get_capabilities (vo_driver_t *this_gen)
static void | mmal_frame_field (vo_frame_t *vo_img, int which_field)
static void | mmal_frame_dispose (vo_frame_t *vo_img)
static vo_frame_t * | mmal_alloc_frame (vo_driver_t *this_gen)
static void | mmal_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 | overlay_free (mmal_overlay_t *ovl, DISPMANX_UPDATE_HANDLE_T update)
static void | overlay_update (mmal_overlay_t *ovl, DISPMANX_UPDATE_HANDLE_T update, uint32_t *argb)
static mmal_overlay_t * | overlay_new (mmal_driver_t *this, DISPMANX_UPDATE_HANDLE_T update, int src_width, int src_height, int src_pitch, int x, int y, int width, int height, int layer, uint32_t *argb)
static void | close_overlays (mmal_driver_t *this, mmal_overlay_t *ovls)
static void | mmal_overlay_begin (vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed)
static void | mmal_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame, vo_overlay_t *overlay)
static void | mmal_overlay_end (vo_driver_t *this_gen, vo_frame_t *frame_gen)
static int | mmal_redraw_needed (vo_driver_t *this_gen)
static void | mmal_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
static int | mmal_get_property (vo_driver_t *this_gen, int property)
static int | mmal_set_property (vo_driver_t *this_gen, int property, int value)
static void | mmal_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max)
static int | mmal_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data)
static void | mmal_dispose (vo_driver_t *this_gen)
static vo_driver_t * | open_plugin (video_driver_class_t *class_gen, const void *visual_gen)
static void * | init_class (xine_t *xine, const void *visual_gen)

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

## Macro Definition Documentation

## ◆ FRAME_ALLOC

#define FRAME_ALLOC /* allocate buffer based on frame size. if not defined, all buffers are suitable for 1920x1088 YUY2. */

## ◆ HW_OVERLAY

#define HW_OVERLAY /* draw overlay using HW. if undefined, draw in software. */

## ◆ LOG_MODULE

#define LOG_MODULE "video_out_mmal"

## ◆ LOG_STATUS

#define LOG_STATUS | ( |  | msg | ) |

Value:
xprintf(this->xine, XINE_VERBOSITY_LOG, LOG_MODULE": " msg ": %s (%d)\n", \
mmal_status_to_string(status), status)
LOG_MODULE
#define LOG_MODULE
Definition: video_out_mmal.c:38
XINE_VERBOSITY_LOG
#define XINE_VERBOSITY_LOG
Definition: xine.h:429
xprintf
#define xprintf(xine, verbose,...)
Definition: xineutils.h:684

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## ◆ MAX_VIDEO_FRAMES

#define MAX_VIDEO_FRAMES 20

## ◆ MAX_VIDEO_HEIGHT

#define MAX_VIDEO_HEIGHT (2*1088)

## ◆ MAX_VIDEO_WIDTH

#define MAX_VIDEO_WIDTH (2*1920)

## Typedef Documentation

## ◆ mmal_overlay_t

typedef struct mmal_overlay_s mmal_overlay_t

## Function Documentation

## ◆ close_overlays()

static void close_overlays | ( | mmal_driver_t * | this,
|  | mmal_overlay_t * | ovls
| ) |  |
| static

References mmal_overlay_s::next, overlay_free(), and overlay_update().

Referenced by mmal_dispose(), and mmal_overlay_end().

## ◆ config_display()

static int config_display | ( | mmal_driver_t * | this,
|  | int | src_x,
|  | int | src_y,
|  | int | src_w,
|  | int | src_h
| ) |  |
| static

References LOG_STATUS.

Referenced by mmal_display_frame(), and open_plugin().

## ◆ configure_renderer()

static int configure_renderer | ( | mmal_driver_t * | this,
|  | int | format,
|  | int | width,
|  | int | height,
|  | int | crop_x,
|  | int | crop_y,
|  | int | crop_w,
|  | int | crop_h,
|  | double | ratio
| ) |  |
| static

References control_port_cb(), disable_renderer(), height, input(), input_port_cb(), LOG_MODULE, LOG_STATUS, MAX_VIDEO_FRAMES, MAX_VIDEO_HEIGHT, MAX_VIDEO_WIDTH, width, XINE_IMGFMT_YV12, XINE_VERBOSITY_LOG, and xprintf.

Referenced by mmal_display_frame(), and open_plugin().

## ◆ control_port_cb()

static void control_port_cb | ( | MMAL_PORT_T * | port,
|  | MMAL_BUFFER_HEADER_T * | buffer
| ) |  |
| static

References LOG_STATUS.

Referenced by configure_renderer().

## ◆ disable_renderer()

static void disable_renderer | ( | mmal_driver_t * | this | ) |
| static

Referenced by configure_renderer(), and mmal_dispose().

## ◆ init_class()

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

Class Functions

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

## ◆ input_port_cb()

static void input_port_cb | ( | MMAL_PORT_T * | port,
|  | MMAL_BUFFER_HEADER_T * | buffer
| ) |  |
| static

Referenced by configure_renderer().

## ◆ mmal_alloc_frame()

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

References vo_frame_s::dispose, vo_frame_s::field, mmal_frame_t::input, mmal_frame_dispose(), mmal_frame_field(), vo_frame_s::mutex, NULL, vo_frame_s::proc_frame, vo_frame_s::proc_slice, mmal_frame_t::vo_frame, and xine_container_of.

Referenced by open_plugin().

## ◆ mmal_display_frame()

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

References mmal_frame_t::buffer, config_display(), configure_renderer(), vo_frame_s::crop_bottom, vo_frame_s::crop_left, vo_frame_s::crop_right, vo_frame_s::crop_top, mmal_frame_t::displayed, mmal_frame_t::format, vo_frame_s::free, vo_frame_s::height, mmal_frame_t::height, input(), LOG_STATUS, vo_frame_s::ratio, vo_frame_s::width, mmal_frame_t::width, and xine_container_of.

Referenced by open_plugin().

## ◆ mmal_dispose()

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

References _x_alphablend_free(), close_overlays(), disable_renderer(), input(), NULL, overlay_update(), and xine_container_of.

Referenced by open_plugin().

## ◆ mmal_frame_dispose()

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

References mmal_frame_t::buffer, mmal_frame_t::input, NULL, and xine_container_of.

Referenced by mmal_alloc_frame().

## ◆ mmal_frame_field()

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

Referenced by mmal_alloc_frame().

## ◆ mmal_get_capabilities()

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

References VO_CAP_CROP, VO_CAP_CUSTOM_EXTENT_OVERLAY, VO_CAP_UNSCALED_OVERLAY, VO_CAP_YUY2, and VO_CAP_YV12.

Referenced by open_plugin().

## ◆ mmal_get_property()

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

References MAX_VIDEO_FRAMES, MAX_VIDEO_HEIGHT, MAX_VIDEO_WIDTH, VO_PROP_MAX_NUM_FRAMES, VO_PROP_MAX_VIDEO_HEIGHT, VO_PROP_MAX_VIDEO_WIDTH, VO_PROP_WINDOW_HEIGHT, VO_PROP_WINDOW_WIDTH, and xine_container_of.

Referenced by open_plugin().

## ◆ mmal_get_property_min_max()

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

Referenced by open_plugin().

## ◆ mmal_gui_data_exchange()

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

Referenced by open_plugin().

## ◆ mmal_overlay_begin()

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

References NULL, overlay_update(), and xine_container_of.

Referenced by open_plugin().

## ◆ mmal_overlay_blend()

static void mmal_overlay_blend | ( | vo_driver_t * | this_gen,
|  | vo_frame_t * | frame,
|  | vo_overlay_t * | overlay
| ) |  |
| static

References _x_blend_yuv(), _x_blend_yuy2(), _x_overlay_clut_yuv2rgb(), _x_overlay_to_argb32(), vo_overlay_s::argb_layer, vo_frame_s::base, argb_layer_s::buffer, mmal_overlay_s::dst_rect, vo_overlay_s::extent_height, vo_overlay_s::extent_width, vo_frame_s::format, vo_frame_s::height, vo_overlay_s::height, mmal_overlay_s::mem, mmal_overlay_s::next, NULL, overlay_new(), vo_frame_s::overlay_offset_x, vo_frame_s::overlay_offset_y, overlay_update(), vo_frame_s::pitches, vo_overlay_s::rle, mmal_overlay_s::src_height, mmal_overlay_s::src_pitch, mmal_overlay_s::src_width, vo_overlay_s::unscaled, vo_frame_s::width, vo_overlay_s::width, vo_overlay_s::x, xine_container_of, XINE_IMGFMT_YV12, and vo_overlay_s::y.

Referenced by open_plugin().

## ◆ mmal_overlay_end()

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

References close_overlays(), NULL, overlay_update(), and xine_container_of.

Referenced by open_plugin().

## ◆ mmal_redraw_needed()

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

Referenced by open_plugin().

## ◆ mmal_set_property()

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

Referenced by open_plugin().

## ◆ mmal_update_frame_format()

static void mmal_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 vo_frame_s::base, mmal_frame_t::buffer, mmal_frame_t::displayed, mmal_frame_t::format, vo_frame_s::height, height, mmal_frame_t::height, LOG_MODULE, MAX_VIDEO_HEIGHT, MAX_VIDEO_WIDTH, NULL, vo_frame_s::pitches, mmal_frame_t::ratio, mmal_frame_t::vo_frame, vo_frame_s::width, width, mmal_frame_t::width, xine_container_of, XINE_IMGFMT_YUY2, XINE_IMGFMT_YV12, XINE_VERBOSITY_LOG, and xprintf.

Referenced by open_plugin().

## ◆ open_plugin()

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

References _x_alphablend_init(), config_display(), configure_renderer(), LOG_MODULE, LOG_STATUS, mmal_alloc_frame(), mmal_display_frame(), mmal_dispose(), mmal_get_capabilities(), mmal_get_property(), mmal_get_property_min_max(), mmal_gui_data_exchange(), mmal_overlay_begin(), mmal_overlay_blend(), mmal_overlay_end(), mmal_redraw_needed(), mmal_set_property(), mmal_update_frame_format(), NULL, update_tv_resolution(), mmal_class_t::xine, XINE_IMGFMT_YV12, XINE_VERBOSITY_LOG, and xprintf.

Referenced by init_class().

## ◆ overlay_free()

static void overlay_free | ( | mmal_overlay_t * | ovl,
|  | DISPMANX_UPDATE_HANDLE_T | update
| ) |  |
| static

References mmal_overlay_s::element, mmal_overlay_s::mem, and mmal_overlay_s::resource.

Referenced by close_overlays(), and overlay_new().

## ◆ overlay_new()

static mmal_overlay_t * overlay_new | ( | mmal_driver_t * | this,
|  | DISPMANX_UPDATE_HANDLE_T | update,
|  | int | src_width,
|  | int | src_height,
|  | int | src_pitch,
|  | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | int | layer,
|  | uint32_t * | argb
| ) |  |
| static

References mmal_overlay_s::dst_rect, mmal_overlay_s::element, height, LOG_MODULE, NULL, overlay_free(), mmal_overlay_s::resource, mmal_overlay_s::src_height, mmal_overlay_s::src_pitch, mmal_overlay_s::src_rect, mmal_overlay_s::src_width, width, XINE_VERBOSITY_LOG, and xprintf.

Referenced by mmal_overlay_blend().

## ◆ overlay_update()

static void overlay_update | ( | mmal_overlay_t * | ovl,
|  | DISPMANX_UPDATE_HANDLE_T | update,
|  | uint32_t * | argb
| ) |  |
| static

References mmal_overlay_s::element, mmal_overlay_s::resource, mmal_overlay_s::src_pitch, and mmal_overlay_s::src_rect.

Referenced by close_overlays(), mmal_dispose(), mmal_overlay_begin(), mmal_overlay_blend(), and mmal_overlay_end().

## ◆ update_tv_resolution()

static int update_tv_resolution | ( | mmal_driver_t * | this | ) |
| static

References LOG_MODULE, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by open_plugin().

## Variable Documentation

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_VIDEO_OUT, 22, "mmal", XINE_VERSION_CODE, &vo_info_mmal, init_class },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
vo_info_mmal
static const vo_info_t vo_info_mmal
Definition: video_out_mmal.c:924
init_class
static void * init_class(xine_t *xine, const void *visual_gen)
Definition: video_out_mmal.c:907
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_mmal

const vo_info_t vo_info_mmal
| static

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