xine-lib: xine-lib-1.2.13/src/input/vcd/vcdplayer.c File Reference

xine-lib 1.2.13-20230125hg15249

Macros | Functions
vcdplayer.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <sys/types.h>`
`#include <unistd.h>`
`#include <time.h>`
`#include <string.h>`
`#include <errno.h>`
`#include "libvcd/files.h"`
`#include "cdio/iso9660.h"`
`#include "vcdplayer.h"`
`#include "vcdio.h"`

## Macros
#define | LOG_ERR(p_vcdplayer, s, args...)
#define | dbg_print(p_vcdplayer, mask, s, args...)
#define | add_format_str_info(val)
#define | add_format_num_info(val, fmt)
#define | TEMP_STR_SIZE 256
#define | TEMP_STR_LEN (TEMP_STR_SIZE-1)
#define | RETURN_NULL_STILL

## Functions
void | vcdinfo_get_seg_resolution (const vcdinfo_obj_t *p_vcdinfo, segnum_t i_seg, uint16_t *max_x, uint16_t *max_y)
static void | _vcdplayer_set_origin (vcdplayer_t *p_vcdplayer)
bool | vcdplayer_pbc_is_on (const vcdplayer_t *p_vcdplayer)
static size_t | _vcdplayer_get_item_size (vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
char * | vcdplayer_format_str (vcdplayer_t *p_vcdplayer, const char format_str[])
static void | _vcdplayer_update_entry (vcdinfo_obj_t *p_vcdinfo, uint16_t ofs, uint16_t *entry, const char *label)
void | vcdplayer_update_nav (vcdplayer_t *p_vcdplayer)
static void | _vcdplayer_set_track (vcdplayer_t *p_vcdplayer, unsigned int i_track)
static void | _vcdplayer_set_entry (vcdplayer_t *p_vcdplayer, unsigned int num)
static void | _vcdplayer_set_segment (vcdplayer_t *p_vcdplayer, unsigned int num)
static void | vcdplayer_play_single_item (vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
static bool | _vcdplayer_inc_play_item (vcdplayer_t *p_vcdplayer)
void | vcdplayer_play (vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
static vcdplayer_read_status_t | vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf)
static vcdplayer_read_status_t | vcdplayer_non_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf)
vcdplayer_read_status_t | vcdplayer_read (vcdplayer_t *p_vcdplayer, uint8_t *p_buf, const off_t i_len)
void | vcdplayer_send_button_update (vcdplayer_t *p_vcdplayer, const int mode)

## Macro Definition Documentation

## ◆ add_format_num_info

#define add_format_num_info | ( |  | val,
|  |  | fmt )

Value:
{ \
char num_str[10]; \
unsigned int len; \
snprintf(num_str, sizeof(num_str), fmt, val); \
len=strlen(num_str); \
if (len != 0) { \
strncat(tp, num_str, TEMP_STR_LEN-(tp-temp_str)); \
tp += len; \
} \
saw_control_prefix = false; \
}
TEMP_STR_LEN
#define TEMP_STR_LEN

Referenced by vcdplayer_format_str().

## ◆ add_format_str_info

#define add_format_str_info | ( |  | val | ) |

Value:
{ \
const char *str = val; \
unsigned int len; \
if (val != NULL) { \
len=strlen(str); \
if (len != 0) { \
strncat(tp, str, TEMP_STR_LEN-(tp-temp_str)); \
tp += len; \
} \
saw_control_prefix = false; \
} \
}
NULL
NULL
Definition xine_plugin.c:78

Referenced by vcdplayer_format_str().

## ◆ dbg_print

#define dbg_print | ( |  | p_vcdplayer,
|  |  | mask,
|  |  | s,
|  |  | args... )

Value:
if (p_vcdplayer->log_msg) \
p_vcdplayer->log_msg (p_vcdplayer->user_data, mask, "input_vcd: %s: "s, __func__ , ##args)

Referenced by _vcdplayer_inc_play_item(), _vcdplayer_set_entry(), _vcdplayer_set_origin(), _vcdplayer_set_segment(), _vcdplayer_set_track(), vcdplayer_pbc_nav(), vcdplayer_play(), vcdplayer_play_single_item(), and vcdplayer_read().

## ◆ LOG_ERR

#define LOG_ERR | ( |  | p_vcdplayer,
|  |  | s,
|  |  | args... )

Value:
if (p_vcdplayer->log_err) \
p_vcdplayer->log_err (p_vcdplayer->user_data, ~0, "input_vcd: %s: "s, __func__ , ##args)

Referenced by _vcdplayer_get_item_size(), _vcdplayer_set_entry(), _vcdplayer_set_segment(), vcdplayer_non_pbc_nav(), vcdplayer_pbc_nav(), and vcdplayer_play_single_item().

## ◆ RETURN_NULL_STILL

#define RETURN_NULL_STILL

Value:
p_vcdplayer->i_still = 127; \
memset (p_buf, 0, M2F2_SECTOR_SIZE); \
p_buf[0] = 0; p_buf[1] = 0; p_buf[2] = 0x01; \
return READ_STILL_FRAME
READ_STILL_FRAME
@ READ_STILL_FRAME
Definition vcdplayer.h:225

Referenced by vcdplayer_non_pbc_nav(), and vcdplayer_pbc_nav().

## ◆ TEMP_STR_LEN

#define TEMP_STR_LEN (TEMP_STR_SIZE-1)

Referenced by vcdplayer_format_str().

## ◆ TEMP_STR_SIZE

#define TEMP_STR_SIZE 256

Referenced by vcdplayer_format_str().

## Function Documentation

## ◆ _vcdplayer_get_item_size()

static size_t _vcdplayer_get_item_size | ( | vcdplayer_t * | p_vcdplayer,
|  | vcdinfo_itemid_t | itemid )
| static

References _, vcdplayer_s::entry, LOG_ERR, vcdplayer_s::segment, vcdplayer_play_item_info_t::size, and vcdplayer_s::track.

Referenced by _vcdplayer_set_origin().

## ◆ _vcdplayer_inc_play_item()

static bool _vcdplayer_inc_play_item | ( | vcdplayer_t * | p_vcdplayer | ) |
| static

References dbg_print, INPUT_DBG_CALL, INPUT_DBG_PBC, NULL, vcdplayer_s::pdi, vcdplayer_s::pxd, and vcdplayer_play_single_item().

Referenced by vcdplayer_pbc_nav(), and vcdplayer_play().

## ◆ _vcdplayer_set_entry()

static void _vcdplayer_set_entry | ( | vcdplayer_t * | p_vcdplayer,
|  | unsigned int | num )
| static

Set reading to play an entry

References _, _vcdplayer_set_origin(), dbg_print, vcdplayer_s::i_lsn, vcdplayer_s::i_still, vcdplayer_s::i_track, INPUT_DBG_LSN, INPUT_DBG_PBC, LOG_ERR, vcdplayer_s::play_item, vcdplayer_play_item_info_t::size, vcdplayer_s::track, vcdplayer_s::track_end_lsn, vcdplayer_s::track_lsn, and vcdplayer_s::vcd.

Referenced by vcdplayer_play_single_item().

## ◆ _vcdplayer_set_origin()

static void _vcdplayer_set_origin | ( | vcdplayer_t * | p_vcdplayer | ) |
| static

References _vcdplayer_get_item_size(), dbg_print, vcdplayer_s::end_lsn, vcdplayer_s::i_lsn, INPUT_DBG_CALL, INPUT_DBG_LSN, vcdplayer_s::origin_lsn, and vcdplayer_s::play_item.

Referenced by _vcdplayer_set_entry(), _vcdplayer_set_segment(), _vcdplayer_set_track(), and vcdplayer_update_nav().

## ◆ _vcdplayer_set_segment()

static void _vcdplayer_set_segment | ( | vcdplayer_t * | p_vcdplayer,
|  | unsigned int | num )
| static

Set reading to play an segment (e.g. still frame)

References _, _vcdplayer_set_origin(), dbg_print, vcdplayer_s::i_lsn, vcdplayer_s::i_track, INPUT_DBG_LSN, LOG_ERR, vcdplayer_s::play_item, and vcdplayer_s::vcd.

Referenced by vcdplayer_play_single_item().

## ◆ _vcdplayer_set_track()

static void _vcdplayer_set_track | ( | vcdplayer_t * | p_vcdplayer,
|  | unsigned int | i_track )
| static

Set reading to play an entire track.

References _vcdplayer_set_origin(), dbg_print, vcdplayer_s::i_lsn, vcdplayer_s::i_still, vcdplayer_s::i_track, vcdplayer_s::i_tracks, INPUT_DBG_LSN, vcdplayer_s::play_item, vcdplayer_s::track_lsn, and vcdplayer_s::vcd.

Referenced by vcdplayer_play_single_item().

## ◆ _vcdplayer_update_entry()

static void _vcdplayer_update_entry | ( | vcdinfo_obj_t * | p_vcdinfo,
|  | uint16_t | ofs,
|  | uint16_t * | entry,
|  | const char * | label )
| static

References NULL.

Referenced by vcdplayer_update_nav().

## ◆ vcdinfo_get_seg_resolution()

void vcdinfo_get_seg_resolution | ( | const vcdinfo_obj_t * | p_vcdinfo,
|  | segnum_t | i_seg,
|  | uint16_t * | max_x,
|  | uint16_t * | max_y )

Referenced by vcdplayer_play_single_item().

## ◆ vcdplayer_format_str()

char * vcdplayer_format_str | ( | vcdplayer_t * | p_vcdplayer,
|  | const char | format_str[] )

Take a format string and expand escape sequences, that is sequences that begin with %, with information from the current VCD. The expanded string is returned. Here is a list of escape sequences:

A : The album information C : The VCD volume count - the number of CD's in the collection. c : The VCD volume num - the number of the CD in the collection. F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT... L : The playlist ID prefixed with " LID" if it exists N : The current number of the above - a decimal number P : The publisher ID p : The preparer ID S : If we are in a segment (menu), the kind of segment T : The track number V : The volume set ID v : The volume ID A number between 1 and the volume count. %% : a %

References add_format_num_info, add_format_str_info, vcdplayer_s::i_lid, vcdplayer_s::i_track, vcdplayer_s::play_item, TEMP_STR_LEN, TEMP_STR_SIZE, vcdplayer_s::vcd, and vcdplayer_pbc_is_on().

Referenced by vcd_set_meta_info(), and vcd_update_title_display().

## ◆ vcdplayer_non_pbc_nav()

static vcdplayer_read_status_t vcdplayer_non_pbc_nav | ( | vcdplayer_t * | p_vcdplayer,
|  | uint8_t * | p_buf )
| static

References vcdplayer_s::autoadvance, LOG_ERR, vcdplayer_s::next_entry, vcdplayer_s::play_item, READ_BLOCK, READ_END, RETURN_NULL_STILL, and vcdplayer_update_nav().

Referenced by vcdplayer_read().

## ◆ vcdplayer_pbc_is_on()

bool vcdplayer_pbc_is_on | ( | const vcdplayer_t * | p_vcdplayer | ) |

Return true if playback control (PBC) is on

References vcdplayer_s::i_lid.

Referenced by vcd_handle_events(), vcd_plugin_get_mrl(), vcdio_seek(), vcdplayer_format_str(), vcdplayer_play(), vcdplayer_read(), and vcdplayer_update_nav().

## ◆ vcdplayer_pbc_nav()

static vcdplayer_read_status_t vcdplayer_pbc_nav | ( | vcdplayer_t * | p_vcdplayer,
|  | uint8_t * | p_buf )
| static

References _vcdplayer_inc_play_item(), dbg_print, vcdplayer_s::force_redisplay, vcdplayer_s::i_lid, vcdplayer_s::i_loop, vcdplayer_s::i_lsn, vcdplayer_s::i_still, INPUT_DBG_LSN, INPUT_DBG_PBC, LOG_ERR, vcdplayer_s::loop_item, vcdplayer_s::next_entry, NULL, vcdplayer_s::play_item, vcdplayer_s::pxd, READ_BLOCK, READ_END, READ_STILL_FRAME, RETURN_NULL_STILL, STILL_INDEFINITE_WAIT, STILL_READING, vcdplayer_s::track_end_lsn, vcdplayer_s::update_title, vcdplayer_s::user_data, vcdplayer_s::vcd, vcdplayer_play(), and vcdplayer_play_single_item().

Referenced by vcdplayer_read().

## ◆ vcdplayer_play()

void vcdplayer_play | ( | vcdplayer_t * | p_vcdplayer,
|  | vcdinfo_itemid_t | itemid )

Play title part. If part is -1, use the first title.

References _vcdplayer_inc_play_item(), dbg_print, vcdplayer_s::i_lid, vcdplayer_s::i_loop, INPUT_DBG_CALL, vcdplayer_s::loop_item, NULL, vcdplayer_s::pdi, vcdplayer_s::pxd, vcdplayer_s::vcd, vcdplayer_pbc_is_on(), and vcdplayer_play_single_item().

Referenced by vcd_class_get_instance(), vcd_handle_events(), and vcdplayer_pbc_nav().

## ◆ vcdplayer_play_single_item()

static void vcdplayer_play_single_item | ( | vcdplayer_t * | p_vcdplayer,
|  | vcdinfo_itemid_t | itemid )
| static

References _, _vcdplayer_set_entry(), _vcdplayer_set_segment(), _vcdplayer_set_track(), dbg_print, vcdplayer_s::end_lsn, vcdplayer_s::i_lsn, vcdplayer_s::i_still, vcdplayer_s::i_tracks, INPUT_DBG_CALL, INPUT_DBG_PBC, LOG_ERR, vcdplayer_s::max_x, vcdplayer_s::max_y, vcdplayer_s::play_item, vcdplayer_s::set_aspect_ratio, STILL_READING, vcdplayer_s::user_data, vcdplayer_s::vcd, vcdplayer_s::vcd_format, vcdinfo_get_seg_resolution(), and vcdplayer_update_nav().

Referenced by _vcdplayer_inc_play_item(), vcdplayer_pbc_nav(), and vcdplayer_play().

## ◆ vcdplayer_read()

vcdplayer_read_status_t vcdplayer_read | ( | vcdplayer_t * | p_vcdplayer,
|  | uint8_t * | p_buf,
|  | const off_t | i_len )

Read i_len bytes into buf and return the status back.

This routine is a bit complicated because on reaching the end of a track or entry we may automatically advance to the item, or interpret the next item in the playback-control list.

References dbg_print, vcdplayer_s::end_lsn, vcdplayer_s::i_lsn, vcdplayer_s::i_still, INPUT_DBG_LSN, INPUT_DBG_PBC, READ_BLOCK, READ_ERROR, READ_STILL_FRAME, vcdplayer_s::vcd, vcdplayer_non_pbc_nav(), vcdplayer_pbc_is_on(), and vcdplayer_pbc_nav().

Referenced by vcd_plugin_read_block().

## ◆ vcdplayer_send_button_update()

void vcdplayer_send_button_update | ( | vcdplayer_t * | p_vcdplayer,
|  | int | mode )

Get the number of tracks or titles of the VCD. The result is stored in "titles".

References mode().

Referenced by vcd_handle_events().

## ◆ vcdplayer_update_nav()

void vcdplayer_update_nav | ( | vcdplayer_t * | p_vcdplayer | ) |

Update next/prev/return/default navigation buttons (via p_vcdplayer->i_lid). Update size of play-item (via p_vcdplayer->play_item).

References _vcdplayer_set_origin(), _vcdplayer_update_entry(), vcdplayer_s::default_entry, vcdplayer_s::end_lsn, vcdplayer_s::i_entries, vcdplayer_s::i_lid, vcdplayer_s::i_lsn, vcdplayer_s::i_segments, vcdplayer_s::i_track, vcdplayer_s::i_tracks, vcdplayer_s::next_entry, NULL, vcdplayer_s::origin_lsn, vcdplayer_s::play_item, vcdplayer_s::prev_entry, vcdplayer_s::pxd, vcdplayer_s::return_entry, vcdplayer_s::track_lsn, vcdplayer_s::update_title, vcdplayer_s::user_data, vcdplayer_s::vcd, and vcdplayer_pbc_is_on().

Referenced by vcdplayer_non_pbc_nav(), and vcdplayer_play_single_item().