xine-lib: xine-lib-1.2.13/src/spu_dec/spudec.c File Reference

xine-lib 1.2.13-20230125hg15249

Macros | Functions | Variables
spudec.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <errno.h>`
`#include <unistd.h>`
`#include <pthread.h>`
`#include <string.h>`
`#include <inttypes.h>`
`#include <sys/types.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/buffer.h>`
`#include "xine-engine/bswap.h"`
`#include "nav_read.h"`
`#include "nav_print.h"`
`#include "spudec.h"`

## Macros
#define | CMD_SPU_FORCE_DISPLAY 0x00
#define | CMD_SPU_SHOW 0x01
#define | CMD_SPU_HIDE 0x02
#define | CMD_SPU_SET_PALETTE 0x03
#define | CMD_SPU_SET_ALPHA 0x04
#define | CMD_SPU_SET_SIZE 0x05
#define | CMD_SPU_SET_PXD_OFFSET 0x06
#define | CMD_SPU_WIPE 0x07 /* Not currently implemented */
#define | CMD_SPU_EOF 0xff
#define | MINFOUND 20

## Functions
static void | spudec_do_commands (xine_t *xine, spudec_state_t *state, spudec_seq_t *seq, vo_overlay_t *ovl)
static void | spudec_draw_picture (xine_t *xine, spudec_state_t *state, spudec_seq_t *seq, vo_overlay_t *ovl)
static void | spudec_discover_clut (xine_t *xine, spudec_state_t *state, vo_overlay_t *ovl)
void | spudec_decode_nav (spudec_decoder_t *this, buf_element_t *buf)
void | spudec_clear_nav_list (spudec_decoder_t *this)
void | spudec_update_nav (spudec_decoder_t *this)
void | spudec_process_nav (spudec_decoder_t *this)
void | spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, unsigned int pkt_len)
void | spudec_process (spudec_decoder_t *this, int stream_id)
static unsigned int | get_bits (unsigned int bits)
static int | spudec_next_line (vo_overlay_t *spu)
int | spudec_copy_nav_to_overlay (xine_t *xine, pci_t *nav_pci, uint32_t *clut, int32_t button, int32_t mode, vo_overlay_t *overlay, vo_overlay_t *base)

## Variables
static uint8_t * | bit_ptr [2]
static int | field
static int | put_x
static int | put_y

## Macro Definition Documentation

## ◆ CMD_SPU_EOF

#define CMD_SPU_EOF 0xff

Referenced by spudec_do_commands().

## ◆ CMD_SPU_FORCE_DISPLAY

#define CMD_SPU_FORCE_DISPLAY 0x00

Referenced by spudec_do_commands().

## ◆ CMD_SPU_HIDE

#define CMD_SPU_HIDE 0x02

Referenced by spudec_do_commands().

## ◆ CMD_SPU_SET_ALPHA

#define CMD_SPU_SET_ALPHA 0x04

Referenced by spudec_do_commands().

## ◆ CMD_SPU_SET_PALETTE

#define CMD_SPU_SET_PALETTE 0x03

Referenced by spudec_do_commands().

## ◆ CMD_SPU_SET_PXD_OFFSET

#define CMD_SPU_SET_PXD_OFFSET 0x06

Referenced by spudec_do_commands().

## ◆ CMD_SPU_SET_SIZE

#define CMD_SPU_SET_SIZE 0x05

Referenced by spudec_do_commands().

## ◆ CMD_SPU_SHOW

#define CMD_SPU_SHOW 0x01

Referenced by spudec_do_commands().

## ◆ CMD_SPU_WIPE

#define CMD_SPU_WIPE 0x07 /* Not currently implemented */

Referenced by spudec_do_commands().

## ◆ MINFOUND

#define MINFOUND 20

Referenced by spudec_discover_clut().

## Function Documentation

## ◆ get_bits()

static unsigned int get_bits | ( | unsigned int | bits | ) |
| static

References bit_ptr, bits, and field.

Referenced by spudec_draw_picture(), spudec_next_line(), and video_object_plane().

## ◆ spudec_clear_nav_list()

void spudec_clear_nav_list | ( | spudec_decoder_t * | this | ) |

References pci_node_s::next, and pci_node_s::pci.

Referenced by spudec_decode_nav(), spudec_discontinuity(), spudec_dispose(), and spudec_reset().

## ◆ spudec_copy_nav_to_overlay()

int spudec_copy_nav_to_overlay | ( | xine_t * | xine,
|  | pci_t * | nav_pci,
|  | uint32_t * | clut,
|  | int32_t | button,
|  | int32_t | mode,
|  | vo_overlay_t * | overlay,
|  | vo_overlay_t * | base )

References vo_overlay_s::color, 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, mode(), NULL, vo_overlay_s::trans, vo_overlay_s::x, XINE_VERBOSITY_DEBUG, xprintf, and vo_overlay_s::y.

Referenced by spudec_process(), and spudec_set_button().

## ◆ spudec_decode_nav()

void spudec_decode_nav | ( | spudec_decoder_t * | this,
|  | buf_element_t * | buf )

References video_overlay_manager_s::add_event, buf_element_s::content, video_overlay_manager_s::get_handle, pci_node_s::next, NULL, xine_ui_data_t::num_buttons, OVERLAY_EVENT_HIDE, pci_node_s::pci, buf_element_s::pts, spudec_clear_nav_list(), spudec_process_nav(), spudec_update_nav(), pci_node_s::vpts, xine_event_send(), XINE_EVENT_UI_NUM_BUTTONS, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by spudec_decode_data().

## ◆ spudec_discover_clut()

static void spudec_discover_clut | ( | xine_t * | xine,
|  | spudec_state_t * | state,
|  | vo_overlay_t * | ovl )
| static

References spudec_state_t::clut, CLUT_Y_CR_CB_INIT, rle_elem_s::color, vo_overlay_s::color, spudec_state_t::cur_colors, MINFOUND, spudec_state_t::need_clut, vo_overlay_s::num_rle, and vo_overlay_s::rle.

Referenced by spudec_process().

## ◆ spudec_do_commands()

static void spudec_do_commands | ( | xine_t * | xine,
|  | spudec_state_t * | state,
|  | spudec_seq_t * | seq,
|  | vo_overlay_t * | ovl )
| static

References spudec_seq_t::broken, spudec_seq_t::buf, spudec_state_t::clut, spudec_state_t::cmd_ptr, CMD_SPU_EOF, CMD_SPU_FORCE_DISPLAY, CMD_SPU_HIDE, CMD_SPU_SET_ALPHA, CMD_SPU_SET_PALETTE, CMD_SPU_SET_PXD_OFFSET, CMD_SPU_SET_SIZE, CMD_SPU_SHOW, CMD_SPU_WIPE, vo_overlay_s::color, spudec_state_t::cur_colors, spudec_state_t::delay, spudec_clut_struct::entry0, spudec_clut_struct::entry1, spudec_clut_struct::entry2, spudec_clut_struct::entry3, spudec_state_t::field_offs, spudec_seq_t::finished, spudec_state_t::forced_display, vo_overlay_s::height, vo_overlay_s::hili_bottom, vo_overlay_s::hili_left, vo_overlay_s::hili_right, vo_overlay_s::hili_top, spudec_state_t::modified, OVERLAY_EVENT_HIDE, OVERLAY_EVENT_SHOW, spudec_seq_t::seq_len, vo_overlay_s::trans, spudec_state_t::visible, vo_overlay_s::width, vo_overlay_s::x, XINE_VERBOSITY_DEBUG, xprintf, and vo_overlay_s::y.

Referenced by spudec_process().

## ◆ spudec_draw_picture()

static void spudec_draw_picture | ( | xine_t * | xine,
|  | spudec_state_t * | state,
|  | spudec_seq_t * | seq,
|  | vo_overlay_t * | ovl )
| static

References bit_ptr, spudec_seq_t::buf, spudec_seq_t::cmd_offs, rle_elem_s::color, vo_overlay_s::data_size, field, spudec_state_t::field_offs, get_bits(), rle_elem_s::len, spudec_state_t::modified, vo_overlay_s::num_rle, put_x, put_y, vo_overlay_s::rgb_clut, vo_overlay_s::rle, spudec_next_line(), vo_overlay_s::unscaled, vo_overlay_s::width, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by spudec_process().

## ◆ spudec_next_line()

static int spudec_next_line | ( | vo_overlay_t * | spu | ) |
| static

References field, get_bits(), vo_overlay_s::height, put_x, and put_y.

Referenced by spudec_draw_picture().

## ◆ spudec_process()

void spudec_process | ( | spudec_decoder_t * | this,
|  | int | stream_id )

References video_overlay_manager_s::add_event, spudec_seq_t::broken, spudec_seq_t::buf, spudec_seq_t::cmd_offs, spudec_seq_t::finished, video_overlay_manager_s::get_handle, height, pci_node_s::next, NULL, OVERLAY_EVENT_HIDE, OVERLAY_EVENT_SHOW, pci_node_s::pci, spudec_copy_nav_to_overlay(), spudec_discover_clut(), spudec_do_commands(), spudec_draw_picture(), width, XINE_EVENT_INPUT_BUTTON_FORCE, xine_event_send(), xine_fast_memcpy, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by spudec_decode_data().

## ◆ spudec_process_nav()

void spudec_process_nav | ( | spudec_decoder_t * | this | ) |

References xine_ui_data_t::num_buttons, xine_event_send(), and XINE_EVENT_UI_NUM_BUTTONS.

Referenced by spudec_decode_nav(), and spudec_update_nav().

## ◆ spudec_reassembly()

void spudec_reassembly | ( | xine_t * | xine,
|  | spudec_seq_t * | seq,
|  | uint8_t * | pkt_data,
|  | unsigned int | pkt_len )

References spudec_seq_t::broken, spudec_seq_t::buf, spudec_seq_t::buf_len, spudec_seq_t::cmd_offs, spudec_seq_t::complete, spudec_seq_t::finished, spudec_seq_t::ra_offs, spudec_seq_t::seq_len, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by spudec_decode_data().

## ◆ spudec_update_nav()

void spudec_update_nav | ( | spudec_decoder_t * | this | ) |

References metronom_clock_s::get_current_time, pci_node_s::next, and spudec_process_nav().

Referenced by spudec_decode_data(), spudec_decode_nav(), spudec_get_interact_info(), and spudec_set_button().

## Variable Documentation

## ◆ bit_ptr

uint8_t* bit_ptr[2]
| static

Referenced by get_bits(), and spudec_draw_picture().

## ◆ field

int field
| static

Referenced by _vovl_bits_set(), _vovl_bits_test(), calc_response(), calc_response_string(), convert_overlay(), decode_picture(), extract_channel_from_string_internal(), get_bits(), gsl_add_struct_field(), gsl_new_struct(), gsl_new_struct_field(), gsl_new_struct_field_struct(), hash(), meta_info_assign(), motion_fr_field(), motion_fr_field(), spudec_draw_picture(), and spudec_next_line().

## ◆ put_x

int put_x
| static

Referenced by spudec_draw_picture(), and spudec_next_line().

## ◆ put_y

int put_y
| static

Referenced by spudec_draw_picture(), and spudec_next_line().