xine-lib 1.2.11
|
#include <xine/xineutils.h>
#include <xine/xineintl.h>
#include "xine_private.h"
#include "../xine-engine/bswap.h"
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <fcntl.h>
#include <ctype.h>
Data Structures | |
struct | lang_locale_t |
Macros | |
#define | _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */ |
#define | O_CLOEXEC 0 |
#define | BUFSIZ 256 |
#define | XINE_MEM_ALIGN 32 |
#define | XINE_MEM_ADD (sizeof (size_t) + XINE_MEM_ALIGN) |
#define | XINE_MEM_MASK ((uintptr_t)XINE_MEM_ALIGN - 1) |
#define | rr 128 /* repeat */ |
#define | ss 64 /* stop */ |
#define | rev32(n) (((n) << 24) | (((n) << 8) & 0xff0000) | (((n) >> 8) & 0xff00) | ((n) >> 24)) |
#define | rev16(n) ((((n) << 8) | ((n) >> 8)) & 0xffff) |
Functions | |
void * | xine_xmalloc (size_t size) |
Allocate and clean memory size_t 'size', then return the pointer to the allocated memory. More... | |
void * | xine_xcalloc (size_t nmemb, size_t size) |
Wrapper around calloc() function. More... | |
void * | xine_memdup (const void *src, size_t length) |
void * | xine_memdup0 (const void *src, size_t length) |
const char * | xine_get_homedir (void) |
char * | xine_chomp (char *str) |
void | xine_usec_sleep (unsigned usec) |
void | xine_hexdump (const void *buf_gen, int length) |
static const lang_locale_t * | _get_first_lang_locale (const char *lcal) |
static char * | _get_lang (void) |
char * | xine_get_system_encoding (void) |
const char * | xine_guess_spu_encoding (void) |
int | xine_monotonic_clock (struct timeval *tv, struct timezone *tz) |
char * | xine_strcat_realloc (char **dest, const char *append) |
char * | _x_asprintf (const char *format,...) |
int | _x_set_file_close_on_exec (int fd) |
Make file descriptors and sockets uninheritable. More... | |
int | _x_set_socket_close_on_exec (int s) |
int | xine_open_cloexec (const char *name, int flags) |
int | xine_create_cloexec (const char *name, int flags, mode_t mode) |
int | xine_socket_cloexec (int domain, int type, int protocol) |
void * | xine_mallocz_aligned (size_t size) |
void * | xine_malloc_aligned (size_t size) |
void | xine_free_aligned (void *ptr) |
void * | xine_realloc_aligned (void *ptr, size_t size) |
size_t | xine_base64_encode (uint8_t *from, char *to, size_t size) |
size_t | xine_base64_decode (const char *from, uint8_t *to) |
uint32_t | xine_crc32_ieee (uint32_t crc, const uint8_t *data, size_t len) |
uint32_t | xine_crc16_ansi (uint32_t crc, const uint8_t *data, size_t len) |
Variables | |
static const lang_locale_t | lang_locales [] |
static uint32_t | tab_crc32_ieee [1280] = {0, 0,} |
static uint16_t | tab_crc16_ansi [768] = {0, 0,} |
#define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */ |
#define BUFSIZ 256 |
#define O_CLOEXEC 0 |
#define rev16 | ( | n | ) | ((((n) << 8) | ((n) >> 8)) & 0xffff) |
#define rev32 | ( | n | ) | (((n) << 24) | (((n) << 8) & 0xff0000) | (((n) >> 8) & 0xff00) | ((n) >> 24)) |
#define rr 128 /* repeat */ |
#define ss 64 /* stop */ |
#define XINE_MEM_ADD (sizeof (size_t) + XINE_MEM_ALIGN) |
#define XINE_MEM_ALIGN 32 |
#define XINE_MEM_MASK ((uintptr_t)XINE_MEM_ALIGN - 1) |
|
static |
References lang_locales, lang_locale_t::modifier, and NULL.
Referenced by xine_get_system_encoding(), and xine_guess_spu_encoding().
|
static |
Referenced by xine_get_system_encoding(), and xine_guess_spu_encoding().
char * _x_asprintf | ( | const char * | format, |
... | |||
) |
References NULL.
Referenced by _cdda_parse_cddb_info(), _connect_data(), _cwd(), _ftp_size(), _get_exports(), _get_files(), _get_servers(), _login(), _read_dir(), _rest(), _retr(), _ssh_connect(), _x_canonicalise_url(), _x_real_codec_open(), bluray_class_get_dir(), config_translate_key(), dvb_class_get_autoplay_list(), file_input_class_get_dir(), get_help(), getdladdr(), make_base_save_name(), make_save_name(), make_temp_name(), mosaico_open_plugin(), rtsp_class_get_instance(), rtsp_connect(), rtsp_read_data(), rtsp_request_describe(), rtsp_request_options(), rtsp_request_play(), rtsp_request_setparameter(), rtsp_schedule_standard(), rtsp_send_request(), save_catalog(), smb_class_get_dir(), test_make(), tuner_init(), vcd_class_get_autoplay_list(), vcd_class_get_dir(), and vdr_plugin_open_fifo_mrl().
int _x_set_file_close_on_exec | ( | int | fd | ) |
Make file descriptors and sockets uninheritable.
Referenced by xine_create_cloexec(), and xine_open_cloexec().
int _x_set_socket_close_on_exec | ( | int | s | ) |
Referenced by manager_loop(), and xine_socket_cloexec().
size_t xine_base64_decode | ( | const char * | from, |
uint8_t * | to | ||
) |
Base64 decoder. from: pointer to input string or line formatted / indented, null terminated text. to: pointer to output buffer. ret: length of output in bytes.
Referenced by config_register_serialized_entry(), sdpplin_parse(), and sdpplin_parse_stream().
size_t xine_base64_encode | ( | uint8_t * | from, |
char * | to, | ||
size_t | size | ||
) |
Base64 encoder. from: pointer to binary input. to: pointer to output string buffer. size: byte length of input. ret: length of output string (without \0). Note that both buffers need 4 writable padding bytes.
References _X_BE_24.
Referenced by _cdda_cdindex(), config_get_serialized_entry(), http_plugin_basicauth(), and rtsp_basicauth().
char * xine_chomp | ( | char * | str | ) |
uint32_t xine_crc16_ansi | ( | uint32_t | crc, |
const uint8_t * | data, | ||
size_t | len | ||
) |
References rev16, and tab_crc16_ansi.
Referenced by xine_a52_parse_data().
uint32_t xine_crc32_ieee | ( | uint32_t | crc, |
const uint8_t * | data, | ||
size_t | len | ||
) |
Checksum calculator.
References rev32, and tab_crc32_ieee.
Referenced by demux_ts_parse_pat(), demux_ts_parse_pmt(), and ts_rewrite_packets().
int xine_create_cloexec | ( | const char * | name, |
int | flags, | ||
mode_t | mode | ||
) |
creates a file, ensuring that the descriptor will be closed automatically after a fork/execute.
References _x_set_file_close_on_exec(), mode(), name, and O_CLOEXEC.
Referenced by ao_file_open(), do_record(), open_plugin(), and pvr_break_rec_page().
void xine_free_aligned | ( | void * | ptr | ) |
Referenced by _x_ao_new_port(), aa_dispose_frame(), caca_dispose_frame(), dispose_ximage(), ff_audio_dispose(), ff_audio_open_plugin(), fifo_buffer_dispose(), opengl2_frame_dispose(), opengl_frame_dispose(), raw_frame_dispose(), raw_update_frame_format(), rgb2yv12_slice(), vo_none_free_framedata(), xshm_frame_dispose(), xv_frame_dispose(), xv_rem_yuy2_emu(), yuv2rgb_dispose(), and yv12_to_nv12().
const char * xine_get_homedir | ( | void | ) |
Referenced by _ssh_connect(), _x_scan_plugins(), config_save_cb(), do_record(), file_input_class_get_dir(), and xine_init().
char * xine_get_system_encoding | ( | void | ) |
get encoding of current locale
References _get_first_lang_locale(), _get_lang(), lang_locale_t::encoding, and NULL.
Referenced by _meta_info_set_encoding(), and osd_set_encoding().
const char * xine_guess_spu_encoding | ( | void | ) |
References _get_first_lang_locale(), _get_lang(), and lang_locale_t::spu_encoding.
Referenced by init_spu_decoder_plugin().
void xine_hexdump | ( | const void * | buf_gen, |
int | length | ||
) |
Referenced by atom_scan(), decode_audio_header(), decode_dshow_header(), decode_flac_header(), decode_video_header(), hash(), init_codec(), pnm_get_chunk(), pnm_get_stream_chunk(), real_get_rdt_chunk(), real_parse_mdpr(), realdec_decode_data(), rmff_scan_header(), select_mlti_data(), send_header(), and vorbis_decode_data().
void * xine_malloc_aligned | ( | size_t | size | ) |
References NULL, XINE_MEM_ADD, and XINE_MEM_MASK.
Referenced by create_ximage(), ff_audio_open_plugin(), opengl2_update_frame_format(), rgb2yv12_slice(), vdpau_duplicate_frame_data(), vdpau_update_frame_format(), vo_none_update_frame_format(), xshm_update_frame_format(), xv_add_yuy2_emu(), yuv2rgb_configure(), and yv12_to_nv12().
void * xine_mallocz_aligned | ( | size_t | size | ) |
References NULL, XINE_MEM_ADD, and XINE_MEM_MASK.
Referenced by _x_ao_new_port(), _x_fifo_buffer_new(), _x_vo_new_port(), aa_update_frame_format(), caca_update_frame_format(), frame_reallocate(), init_yuv_planes(), initNoise(), mpeg2_init(), opengl_update_frame_format(), raw_update_frame_format(), and vaapi_update_frame_format().
void * xine_memdup | ( | const void * | src, |
size_t | length | ||
) |
References NULL, and xine_fast_memcpy.
Referenced by rmff_new_mdpr(), and rmff_scan_mdpr().
void * xine_memdup0 | ( | const void * | src, |
size_t | length | ||
) |
References NULL, and xine_fast_memcpy.
Referenced by rmff_scan_cont(), and rmff_scan_mdpr().
int xine_monotonic_clock | ( | struct timeval * | tv, |
struct timezone * | tz | ||
) |
References lprintf.
Referenced by ao_file_delay(), ao_file_open(), ao_oss_delay(), ao_oss_write(), get_time(), open_plugin(), pvrscr_adjust(), pvrscr_get_current(), pvrscr_set_pivot(), pvrscr_start(), rip_plugin_seek(), stretchscr_adjust(), stretchscr_get_current(), stretchscr_set_pivot(), stretchscr_start(), unixscr_adjust(), unixscr_get_current(), unixscr_set_pivot(), unixscr_start(), and v4l2_input_read_block().
int xine_open_cloexec | ( | const char * | name, |
int | flags | ||
) |
opens a file, ensuring that the descriptor will be closed automatically after a fork/execute.
References _x_set_file_close_on_exec(), name, and O_CLOEXEC.
Referenced by ao_oss_open(), ao_sun_open(), ao_sun_open_plugin(), cdda_open(), dvb_plugin_open(), dxr3_decode_data(), dxr3_open_plugin(), dxr3_overlay_end(), dxr3_scr_init(), dxr3_spudec_open_plugin(), dxr3_update_frame_format(), dxr3_vo_open_plugin(), file_input_open(), media_eject_media(), open_fb_device(), open_plugin(), open_radio_capture_device(), open_video_capture_device(), pvr_event_handler(), pvr_play_file(), pvr_plugin_open(), realtime_samplecounter_available(), setup_dga(), stdin_plugin_open(), switch_channel(), tuner_init(), v4l_class_get_radio_instance(), v4l_class_get_video_instance(), vcd_class_get_autoplay_list(), vcd_class_get_dir(), vcd_plugin_open(), and vdr_plugin_open_fifo_mrl().
void * xine_realloc_aligned | ( | void * | ptr, |
size_t | size | ||
) |
References NULL, xine_fast_memcpy, XINE_MEM_ADD, and XINE_MEM_MASK.
Referenced by ff_audio_ensure_buffer_size().
int xine_socket_cloexec | ( | int | domain, |
int | type, | ||
int | protocol | ||
) |
creates a socket, ensuring that the descriptor will be closed automatically after a fork/execute.
References _x_set_socket_close_on_exec().
Referenced by _x_init_broadcaster(), _x_io_tcp_handshake_connect(), host_connect_attempt(), and vdr_plugin_open_socket().
char * xine_strcat_realloc | ( | char ** | dest, |
const char * | append | ||
) |
append to a string, reallocating normally, updates & returns *dest on error, *dest is unchanged & NULL is returned.
void xine_usec_sleep | ( | unsigned | usec | ) |
Referenced by _x_spu_decoder_sleep(), ao_dx2_write(), ao_file_delay(), ao_jack_write(), ao_none_write(), audio_decoder_loop(), bitplane_decode_data(), buffer_service(), dvb_parse_si(), dvb_plugin_read(), dvd_plugin_read_block(), dxr3_display_frame(), fifos_wait(), handle_libbluray_event(), metronom_handle_discontinuity(), pvr_plugin_read_block(), spudec_decode_data(), vdr_execute_rpc_command(), video_decoder_loop(), wait_secs(), xine_dvd_send_button_update(), xine_exit(), xine_profiler_print_results(), and xxmc_display_frame().
void * xine_xcalloc | ( | size_t | nmemb, |
size_t | size | ||
) |
Wrapper around calloc() function.
nmemb | Number of elements to allocate |
size | Size of each element to allocate |
This is a simple wrapper around calloc(), the only thing it does more than calloc() is outputting an error if the calloc fails (returning NULL).
References __XINE_FUNCTION__, and NULL.
Referenced by open_film_file(), open_mve_file(), open_tta_file(), and parse_vbri_header().
void * xine_xmalloc | ( | size_t | size | ) |
Allocate and clean memory size_t 'size', then return the pointer to the allocated memory.
size | Size of the memory area to allocate. |
The behaviour of this function differs from standard malloc() as xine_xmalloc(0) will not return a NULL pointer, but rather a pointer to a memory area of size 1 byte.
The NULL value is only ever returned in case of an error in malloc(), and is reported to stderr stream.
References __XINE_FUNCTION__, and NULL.
Referenced by fooviz_init_plugin().
|
static |
Referenced by _get_first_lang_locale().
|
static |
Referenced by xine_crc16_ansi().
|
static |
Referenced by xine_crc32_ieee().