xine-lib 1.2.13-20230125hg15249
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
spuhdmv_decoder.c File Reference
#include <inttypes.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <xine/xine_internal.h>
#include <xine/buffer.h>
#include <xine/xineutils.h>
#include <xine/video_out.h>
#include <xine/video_overlay.h>

Data Structures

struct  subtitle_clut_s
 
struct  subtitle_object_s
 
struct  window_def_s
 
struct  composition_object_s
 
struct  composition_descriptor_s
 
struct  presentation_segment_s
 
struct  segment_buffer_t
 
struct  spuhdmv_decoder_s
 

Macros

#define LOG_MODULE   "spu_hdmv"
 
#define XINE_HDMV_TRACE   lprintf
 
#define MAX(a, b)   (a>b)?(a):(b)
 
#define LIST_REPLACE(list, obj, FREE_FUNC)
 
#define LIST_DESTROY(list, FREE_FUNC)
 

Typedefs

typedef struct subtitle_clut_s subtitle_clut_t
 
typedef struct subtitle_object_s subtitle_object_t
 
typedef struct window_def_s window_def_t
 
typedef struct composition_object_s composition_object_t
 
typedef struct composition_descriptor_s composition_descriptor_t
 
typedef struct presentation_segment_s presentation_segment_t
 
typedef struct spuhdmv_decoder_s spuhdmv_decoder_t
 

Enumerations

enum  {
  SEGTYPE_PALETTE = 0x14 , SEGTYPE_OBJECT = 0x15 , SEGTYPE_PRESENTATION_SEGMENT = 0x16 , SEGTYPE_WINDOW_DEFINITION = 0x17 ,
  SEGTYPE_INTERACTIVE = 0x18 , SEGTYPE_END_OF_DISPLAY = 0x80
}
 

Functions

static void free_subtitle_object (void *ptr)
 
static void free_presentation_segment (void *ptr)
 
static segment_buffer_tsegbuf_init (void)
 
static void segbuf_dispose (segment_buffer_t *buf)
 
static void segbuf_reset (segment_buffer_t *buf)
 
static void segbuf_parse_segment_header (segment_buffer_t *buf)
 
static void segbuf_fill (segment_buffer_t *buf, uint8_t *data, size_t len)
 
static int segbuf_segment_complete (segment_buffer_t *buf)
 
static void segbuf_skip_segment (segment_buffer_t *buf)
 
static uint8_t segbuf_segment_type (segment_buffer_t *buf)
 
static size_t segbuf_data_length (segment_buffer_t *buf)
 
static uint8_t segbuf_get_u8 (segment_buffer_t *buf)
 
static uint16_t segbuf_get_u16 (segment_buffer_t *buf)
 
static uint32_t segbuf_get_u24 (segment_buffer_t *buf)
 
static subtitle_clut_tsegbuf_decode_palette (segment_buffer_t *buf)
 
static int segbuf_decode_rle (segment_buffer_t *buf, subtitle_object_t *obj)
 
static subtitle_object_tsegbuf_decode_object (segment_buffer_t *buf, subtitle_object_t *objects)
 
static window_def_tsegbuf_decode_window_definition (segment_buffer_t *buf)
 
static int segbuf_decode_video_descriptor (segment_buffer_t *buf)
 
static int segbuf_decode_composition_descriptor (segment_buffer_t *buf, composition_descriptor_t *descr)
 
static composition_object_tsegbuf_decode_composition_object (segment_buffer_t *buf)
 
static presentation_segment_tsegbuf_decode_presentation_segment (segment_buffer_t *buf)
 
static rle_elem_tcopy_crop_rle (subtitle_object_t *obj, composition_object_t *cobj)
 
static void free_objs (spuhdmv_decoder_t *this)
 
static int decode_palette (spuhdmv_decoder_t *this)
 
static int decode_object (spuhdmv_decoder_t *this)
 
static int decode_window_definition (spuhdmv_decoder_t *this)
 
static int decode_presentation_segment (spuhdmv_decoder_t *this)
 
static int show_overlay (spuhdmv_decoder_t *this, composition_object_t *cobj, unsigned int palette_id_ref, int overlay_index, int64_t pts, int force_update)
 
static void hide_overlays (spuhdmv_decoder_t *this, int64_t pts)
 
static void update_overlays (spuhdmv_decoder_t *this)
 
static void decode_segment (spuhdmv_decoder_t *this)
 
static void close_osd (spuhdmv_decoder_t *this)
 
static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf)
 
static void spudec_reset (spu_decoder_t *this_gen)
 
static void spudec_discontinuity (spu_decoder_t *this_gen)
 
static void spudec_dispose (spu_decoder_t *this_gen)
 
static spu_decoder_topen_plugin (spu_decoder_class_t *class_gen, xine_stream_t *stream)
 
static void * init_plugin (xine_t *xine, const void *data)
 

Variables

enum { ... }  eSegmentType
 
static const uint32_t supported_types [] = { BUF_SPU_HDMV, 0 }
 
static const decoder_info_t dec_info_data
 
const plugin_info_t xine_plugin_info[] EXPORTED
 

Macro Definition Documentation

◆ LIST_DESTROY

#define LIST_DESTROY ( list,
FREE_FUNC )
Value:
while (list) { \
void *tmp = (void*)list; \
list = list->next; \
FREE_FUNC(tmp); \
}

Referenced by decode_presentation_segment(), free_objs(), and free_presentation_segment().

◆ LIST_REPLACE

#define LIST_REPLACE ( list,
obj,
FREE_FUNC )
Value:
do { \
unsigned int id = obj->id; \
\
/* insert to list */ \
obj->next = list; \
list = obj; \
\
/* remove old */ \
while (obj->next && obj->next->id != id) \
obj = obj->next; \
if (obj->next) { \
void *tmp = (void*)obj->next; \
obj->next = obj->next->next; \
FREE_FUNC(tmp); \
} \
} while (0);

Referenced by decode_object(), decode_palette(), and decode_window_definition().

◆ LOG_MODULE

#define LOG_MODULE   "spu_hdmv"

Referenced by decode_segment(), and update_overlays().

◆ MAX

#define MAX ( a,
b )   (a>b)?(a):(b)

Referenced by segbuf_decode_object().

◆ XINE_HDMV_TRACE

#define XINE_HDMV_TRACE   lprintf

Typedef Documentation

◆ composition_descriptor_t

◆ composition_object_t

◆ presentation_segment_t

◆ spuhdmv_decoder_t

◆ subtitle_clut_t

◆ subtitle_object_t

◆ window_def_t

typedef struct window_def_s window_def_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEGTYPE_PALETTE 
SEGTYPE_OBJECT 
SEGTYPE_PRESENTATION_SEGMENT 
SEGTYPE_WINDOW_DEFINITION 
SEGTYPE_INTERACTIVE 
SEGTYPE_END_OF_DISPLAY 

Function Documentation

◆ close_osd()

static void close_osd ( spuhdmv_decoder_t * this)
static

◆ copy_crop_rle()

static rle_elem_t * copy_crop_rle ( subtitle_object_t * obj,
composition_object_t * cobj )
static

◆ decode_object()

static int decode_object ( spuhdmv_decoder_t * this)
static

◆ decode_palette()

static int decode_palette ( spuhdmv_decoder_t * this)
static

References LIST_REPLACE, and segbuf_decode_palette().

Referenced by decode_segment().

◆ decode_presentation_segment()

static int decode_presentation_segment ( spuhdmv_decoder_t * this)
static

◆ decode_segment()

static void decode_segment ( spuhdmv_decoder_t * this)
static

◆ decode_window_definition()

static int decode_window_definition ( spuhdmv_decoder_t * this)
static

◆ free_objs()

static void free_objs ( spuhdmv_decoder_t * this)
static

◆ free_presentation_segment()

static void free_presentation_segment ( void * ptr)
static

◆ free_subtitle_object()

static void free_subtitle_object ( void * ptr)
static

◆ hide_overlays()

static void hide_overlays ( spuhdmv_decoder_t * this,
int64_t pts )
static

◆ init_plugin()

static void * init_plugin ( xine_t * xine,
const void * data )
static

◆ open_plugin()

static spu_decoder_t * open_plugin ( spu_decoder_class_t * class_gen,
xine_stream_t * stream )
static

◆ segbuf_data_length()

static size_t segbuf_data_length ( segment_buffer_t * buf)
static

◆ segbuf_decode_composition_descriptor()

static int segbuf_decode_composition_descriptor ( segment_buffer_t * buf,
composition_descriptor_t * descr )
static

◆ segbuf_decode_composition_object()

static composition_object_t * segbuf_decode_composition_object ( segment_buffer_t * buf)
static

◆ segbuf_decode_object()

static subtitle_object_t * segbuf_decode_object ( segment_buffer_t * buf,
subtitle_object_t * objects )
static

◆ segbuf_decode_palette()

static subtitle_clut_t * segbuf_decode_palette ( segment_buffer_t * buf)
static

◆ segbuf_decode_presentation_segment()

static presentation_segment_t * segbuf_decode_presentation_segment ( segment_buffer_t * buf)
static

◆ segbuf_decode_rle()

static int segbuf_decode_rle ( segment_buffer_t * buf,
subtitle_object_t * obj )
static

◆ segbuf_decode_video_descriptor()

static int segbuf_decode_video_descriptor ( segment_buffer_t * buf)
static

◆ segbuf_decode_window_definition()

static window_def_t * segbuf_decode_window_definition ( segment_buffer_t * buf)
static

◆ segbuf_dispose()

static void segbuf_dispose ( segment_buffer_t * buf)
static

References _x_freep(), and segment_buffer_t::buf.

Referenced by spudec_dispose().

◆ segbuf_fill()

static void segbuf_fill ( segment_buffer_t * buf,
uint8_t * data,
size_t len )
static

◆ segbuf_get_u16()

static uint16_t segbuf_get_u16 ( segment_buffer_t * buf)
static

◆ segbuf_get_u24()

static uint32_t segbuf_get_u24 ( segment_buffer_t * buf)
static

References segbuf_get_u8().

Referenced by segbuf_decode_object().

◆ segbuf_get_u8()

static uint8_t segbuf_get_u8 ( segment_buffer_t * buf)
static

◆ segbuf_init()

static segment_buffer_t * segbuf_init ( void )
static

Referenced by open_plugin().

◆ segbuf_parse_segment_header()

static void segbuf_parse_segment_header ( segment_buffer_t * buf)
static

◆ segbuf_reset()

static void segbuf_reset ( segment_buffer_t * buf)
static

◆ segbuf_segment_complete()

static int segbuf_segment_complete ( segment_buffer_t * buf)
static

◆ segbuf_segment_type()

static uint8_t segbuf_segment_type ( segment_buffer_t * buf)
static

◆ segbuf_skip_segment()

static void segbuf_skip_segment ( segment_buffer_t * buf)
static

◆ show_overlay()

static int show_overlay ( spuhdmv_decoder_t * this,
composition_object_t * cobj,
unsigned int palette_id_ref,
int overlay_index,
int64_t pts,
int force_update )
static

◆ spudec_decode_data()

static void spudec_decode_data ( spu_decoder_t * this_gen,
buf_element_t * buf )
static

◆ spudec_discontinuity()

static void spudec_discontinuity ( spu_decoder_t * this_gen)
static

References close_osd().

Referenced by open_plugin().

◆ spudec_dispose()

static void spudec_dispose ( spu_decoder_t * this_gen)
static

References close_osd(), free_objs(), and segbuf_dispose().

Referenced by open_plugin().

◆ spudec_reset()

static void spudec_reset ( spu_decoder_t * this_gen)
static

References close_osd(), free_objs(), and segbuf_reset().

Referenced by open_plugin().

◆ update_overlays()

static void update_overlays ( spuhdmv_decoder_t * this)
static

Variable Documentation

◆ dec_info_data

const decoder_info_t dec_info_data
static
Initial value:
= {
.supported_types = supported_types,
.priority = 5,
}
static const uint32_t supported_types[]
Definition spuhdmv_decoder.c:1112

◆ []

enum { ... } eSegmentType

◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED
Initial value:
= {
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
static const decoder_info_t dec_info_data
Definition spuhdmv_decoder.c:1114
static void * init_plugin(xine_t *xine, const void *data)
Definition spuhdmv_decoder.c:1097
#define XINE_VERSION_CODE
Definition xine_internal.h:57
NULL
Definition xine_plugin.c:78
#define PLUGIN_NONE
Definition xine_plugin.h:29
#define PLUGIN_SPU_DECODER
Definition xine_plugin.h:34

◆ supported_types

const uint32_t supported_types[] = { BUF_SPU_HDMV, 0 }
static