xine-lib: xine-lib-1.2.12/src/xine-engine/video_overlay.c File Reference

xine-lib 1.2.12

Data Structures | Macros | Typedefs | Functions
video_overlay.c File Reference
`#include <stdlib.h>`
`#include <string.h>`
`#include <unistd.h>`
`#include <pthread.h>`
`#include <sys/types.h>`
`#include <xine/buffer.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/video_overlay.h>`
`#include "bswap.h"`

## Data Structures
struct | video_overlay_events_s
struct | video_overlay_showing_s
struct | video_overlay_s

## Macros
#define | LUT_SIZE (sizeof(overlay->color)/sizeof(overlay->color[0]))
#define | GET_DIM(dest, src, max) dest = src; if (dest < 0) dest = 0; else if (dest > max) dest = max;
#define | MAKE_LINE(offs)

## Typedefs
typedef struct video_overlay_events_s | video_overlay_events_t
typedef struct video_overlay_showing_s | video_overlay_showing_t
typedef struct video_overlay_s | video_overlay_t

## Functions
static void | add_showing_handle (video_overlay_t *this, int32_t handle)
static void | remove_showing_handle (video_overlay_t *this, int32_t handle)
static void | remove_events_handle (video_overlay_t *this, int32_t handle, int lock)
static int32_t | video_overlay_get_handle (video_overlay_manager_t *this_gen, int object_type)
static void | internal_video_overlay_free_handle (video_overlay_t *this, int32_t handle)
static void | video_overlay_free_handle (video_overlay_manager_t *this_gen, int32_t handle)
static void | video_overlay_reset (video_overlay_t *this)
static void | video_overlay_init (video_overlay_manager_t *this_gen)
static int32_t | video_overlay_add_event (video_overlay_manager_t *this_gen, void *event_gen)
static int | video_overlay_event (video_overlay_t *this, int64_t vpts)
void | _x_overlay_clut_yuv2rgb (vo_overlay_t *overlay, int video_color_matrix)
static void | clut_to_argb (const uint32_t *color, const uint8_t *trans, int num_items, uint32_t *argb, const char *format)
void | _x_overlay_to_argb32 (const vo_overlay_t *overlay, uint32_t *rgba_buf, int stride, const char *format)
static void | video_overlay_multiple_overlay_blend (video_overlay_manager_t *this_gen, int64_t vpts, vo_driver_t *output, vo_frame_t *vo_img, int enabled)
static void | video_overlay_flush_events (video_overlay_manager_t *this_gen)
static int | video_overlay_redraw_needed (video_overlay_manager_t *this_gen, int64_t vpts)
static void | video_overlay_dispose (video_overlay_manager_t *this_gen)
video_overlay_manager_t * | _x_video_overlay_new_manager (xine_t *xine)

## Macro Definition Documentation

## ◆ GET_DIM

#define GET_DIM | ( |  | dest,
|  |  | src,
|  |  | max
| ) |  | dest = src; if (dest < 0) dest = 0; else if (dest > max) dest = max;

## ◆ LUT_SIZE

#define LUT_SIZE (sizeof(overlay->color)/sizeof(overlay->color[0]))

## ◆ MAKE_LINE

#define MAKE_LINE | ( |  | offs | ) |

Value:
while (1) { \
int pleft = prest > pixels ? pixels : prest; \
pixels -= pleft; \
prest -= pleft; \
while (pleft > 0) { \
*rgba++ = color; \
pleft--; \
} \
if (pixels <= 0) \
break; \
if (rle >= rle_end) \
goto _fill; \
color = colors[rle->color + offs]; \
prest = rle->len; \
rle++; \
}
_fill
static void _fill(crypto_input_plugin_t *this)
Definition: input_crypto.c:82

## Typedef Documentation

## ◆ video_overlay_events_t

typedef struct video_overlay_events_s video_overlay_events_t

## ◆ video_overlay_showing_t

typedef struct video_overlay_showing_s video_overlay_showing_t

## ◆ video_overlay_t

typedef struct video_overlay_s video_overlay_t

## Function Documentation

## ◆ _x_overlay_clut_yuv2rgb()

void _x_overlay_clut_yuv2rgb | ( | vo_overlay_t * | overlay,
|  | int | video_color_matrix
| ) |  |

References _x_clut_yuv2rgb(), vo_overlay_s::color, vo_overlay_s::hili_color, vo_overlay_s::hili_rgb_clut, and vo_overlay_s::rgb_clut.

Referenced by mmal_overlay_blend(), opengl2_overlay_blend(), raw_overlay_blend(), vaapi_overlay_end(), and vdpau_overlay_end().

## ◆ _x_overlay_to_argb32()

void _x_overlay_to_argb32 | ( | const vo_overlay_t * | overlay,
|  | uint32_t * | rgba_buf,
|  | int | stride,
|  | const char * | format
| ) |  |

References _fill(), clut_to_argb(), rle_elem_s::color, vo_overlay_s::color, GET_DIM, 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, LUT_SIZE, MAKE_LINE, vo_overlay_s::num_rle, vo_overlay_s::rle, vo_overlay_s::trans, and vo_overlay_s::width.

Referenced by mmal_overlay_blend(), opengl2_upload_overlay(), raw_process_ovl(), vaapi_overlay_end(), and vdpau_overlay_end().

## ◆ _x_video_overlay_new_manager()

video_overlay_manager_t * _x_video_overlay_new_manager | ( | xine_t * | xine | ) |

References MAX_EVENTS, MAX_OBJECTS, MAX_SHOWING, NULL, video_overlay_add_event(), video_overlay_dispose(), video_overlay_flush_events(), video_overlay_free_handle(), video_overlay_get_handle(), video_overlay_init(), video_overlay_multiple_overlay_blend(), and video_overlay_redraw_needed().

Referenced by _x_vo_new_port().

## ◆ add_showing_handle()

static void add_showing_handle | ( | video_overlay_t * | this,
|  | int32_t | handle
| ) |  |
| static

References MAX_SHOWING, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by video_overlay_event().

## ◆ clut_to_argb()

static void clut_to_argb | ( | const uint32_t * | color,
|  | const uint8_t * | trans,
|  | int | num_items,
|  | uint32_t * | argb,
|  | const char * | format
| ) |  |
| static

References clut_s::cb.

Referenced by _x_overlay_to_argb32().

## ◆ internal_video_overlay_free_handle()

static void internal_video_overlay_free_handle | ( | video_overlay_t * | this,
|  | int32_t | handle
| ) |  |
| static

References _x_freep(), NULL, and set_argb_layer_ptr().

Referenced by video_overlay_dispose(), video_overlay_event(), video_overlay_free_handle(), and video_overlay_reset().

## ◆ remove_events_handle()

static void remove_events_handle | ( | video_overlay_t * | this,
|  | int32_t | handle,
|  | int | lock
| ) |  |
| static

References _x_freep(), and OVERLAY_EVENT_NULL.

Referenced by video_overlay_event(), and video_overlay_free_handle().

## ◆ remove_showing_handle()

static void remove_showing_handle | ( | video_overlay_t * | this,
|  | int32_t | handle
| ) |  |
| static

References MAX_SHOWING.

Referenced by video_overlay_event(), and video_overlay_free_handle().

## ◆ video_overlay_add_event()

static int32_t video_overlay_add_event | ( | video_overlay_manager_t * | this_gen,
|  | void * | event_gen
| ) |  |
| static

References MAX_EVENTS, NULL, OVL_MAX_OPACITY, OVL_PALETTE_SIZE, xine_fast_memcpy, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by _x_video_overlay_new_manager().

## ◆ video_overlay_dispose()

static void video_overlay_dispose | ( | video_overlay_manager_t * | this_gen | ) |
| static

References _x_freep(), internal_video_overlay_free_handle(), MAX_EVENTS, MAX_OBJECTS, and NULL.

Referenced by _x_video_overlay_new_manager().

## ◆ video_overlay_event()

static int video_overlay_event | ( | video_overlay_t * | this,
|  | int64_t | vpts
| ) |  |
| static

References _x_assert, _x_freep(), add_showing_handle(), vo_overlay_s::hili_bottom, vo_overlay_s::hili_color, vo_overlay_s::hili_left, vo_overlay_s::hili_rgb_clut, vo_overlay_s::hili_right, vo_overlay_s::hili_top, vo_overlay_s::hili_trans, internal_video_overlay_free_handle(), NULL, OVERLAY_EVENT_FREE_HANDLE, OVERLAY_EVENT_HIDE, OVERLAY_EVENT_MENU_BUTTON, OVERLAY_EVENT_SHOW, remove_events_handle(), remove_showing_handle(), set_argb_layer_ptr(), XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by video_overlay_flush_events(), video_overlay_multiple_overlay_blend(), and video_overlay_redraw_needed().

## ◆ video_overlay_flush_events()

static void video_overlay_flush_events | ( | video_overlay_manager_t * | this_gen | ) |
| static

References video_overlay_event().

Referenced by _x_video_overlay_new_manager().

## ◆ video_overlay_free_handle()

static void video_overlay_free_handle | ( | video_overlay_manager_t * | this_gen,
|  | int32_t | handle
| ) |  |
| static

References internal_video_overlay_free_handle(), remove_events_handle(), and remove_showing_handle().

Referenced by _x_video_overlay_new_manager().

## ◆ video_overlay_get_handle()

static int32_t video_overlay_get_handle | ( | video_overlay_manager_t * | this_gen,
|  | int | object_type
| ) |  |
| static

References MAX_OBJECTS.

Referenced by _x_video_overlay_new_manager().

## ◆ video_overlay_init()

static void video_overlay_init | ( | video_overlay_manager_t * | this_gen | ) |
| static

References NULL, and video_overlay_reset().

Referenced by _x_video_overlay_new_manager().

## ◆ video_overlay_multiple_overlay_blend()

static void video_overlay_multiple_overlay_blend | ( | video_overlay_manager_t * | this_gen,
|  | int64_t | vpts,
|  | vo_driver_t * | output,
|  | vo_frame_t * | vo_img,
|  | int | enabled
| ) |  |
| static

References enabled, MAX_SHOWING, and video_overlay_event().

Referenced by _x_video_overlay_new_manager().

## ◆ video_overlay_redraw_needed()

static int video_overlay_redraw_needed | ( | video_overlay_manager_t * | this_gen,
|  | int64_t | vpts
| ) |  |
| static

References video_overlay_event().

Referenced by _x_video_overlay_new_manager().

## ◆ video_overlay_reset()

static void video_overlay_reset | ( | video_overlay_t * | this | ) |
| static

References internal_video_overlay_free_handle(), MAX_EVENTS, MAX_OBJECTS, MAX_SHOWING, and NULL.

Referenced by video_overlay_init().