xine-lib 1.2.12
|
#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 |
struct | xine_fast_text_s |
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) |
#define | XFST_ALIGN (16) |
#define | XFST_MIN_SIZE ((XFST_ALIGN + 2 + XFST_ALIGN - 1) & ~(XFST_ALIGN - 1)) |
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) |
size_t | xine_fast_string_need (size_t max_strlen) |
char * | xine_fast_string_init (char *buf, size_t bsize) |
size_t | xine_fast_string_max (char *fast_string) |
char * | xine_fast_string_set (char *fast_string, const char *text, size_t tsize) |
int | xine_fast_string_cmp (char *fast_string1, char *fast_string2) |
void | xine_fast_string_free (char **fast_string) |
xine_fast_text_t * | xine_fast_text_load (const char *filename, size_t max_size) |
char * | xine_fast_text_line (xine_fast_text_t *xft, size_t *linesize) |
void | xine_fast_text_unload (xine_fast_text_t **xft) |
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,} |
union { | |
uint8_t z [4] | |
uint32_t v | |
} | _xine_fast_string_mask [8] |
#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 XFST_ALIGN (16) |
#define XFST_MIN_SIZE ((XFST_ALIGN + 2 + XFST_ALIGN - 1) & ~(XFST_ALIGN - 1)) |
#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(), 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.
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, tab_crc16_ansi, and v.
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, tab_crc32_ieee, and v.
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().
int xine_fast_string_cmp | ( | char * | fast_string1, |
char * | fast_string2 | ||
) |
fast strcmp (). BTW: XINE_PROTECTED does not link on some systems when doing xine_sarray_new (size, (xine_sarray_comparator_t)xine_fast_string_cmp);.
References _xine_fast_string_mask, and v.
Referenced by _config_fat_entry_cmp(), and _fat_node_file_cmp().
void xine_fast_string_free | ( | char ** | fast_string | ) |
free a fast string if it is not application supplied.
References NULL.
char * xine_fast_string_init | ( | char * | buf, |
size_t | bsize | ||
) |
set up a fast string inside an application supplied buffer.
References NULL, XFST_ALIGN, and XFST_MIN_SIZE.
Referenced by _config_fat_entry_cmp(), _x_scan_plugins(), config_insert(), and load_plugin_list().
size_t xine_fast_string_max | ( | char * | fast_string | ) |
return the actual max strlen.
size_t xine_fast_string_need | ( | size_t | max_strlen | ) |
return the byte size needed for an application supplied buffer.
References XFST_ALIGN.
char * xine_fast_string_set | ( | char * | fast_string, |
const char * | text, | ||
size_t | tsize | ||
) |
set or change the contents of a fast string. fast_text may be NULL, to allocate a new one. you can even edit the string manually, then apply the new size with text == NULL.
References _xine_fast_string_mask, NULL, v, and XFST_ALIGN.
Referenced by _config_fat_entry_cmp(), collect_plugins(), config_insert(), and load_plugin_list().
char * xine_fast_text_line | ( | xine_fast_text_t * | xft, |
size_t * | linesize | ||
) |
get next line. you may modify return[0] ... return[filesize]. it all stays valid until xine_fast_text_unload ().
References xine_fast_text_s::dummy, xine_fast_text_s::flags, xine_fast_text_s::line_start, NULL, xine_fast_text_s::scan_here, xine_fast_text_s::text_len, and v.
Referenced by load_plugin_list(), and xine_config_load().
xine_fast_text_t * xine_fast_text_load | ( | const char * | filename, |
size_t | max_size | ||
) |
load fast text from file.
References xine_fast_text_s::dummy, xine_fast_text_s::flags, xine_fast_text_s::line_start, NULL, xine_fast_text_s::scan_here, and xine_fast_text_s::text_len.
Referenced by load_plugin_list(), and xine_config_load().
void xine_fast_text_unload | ( | xine_fast_text_t ** | xft | ) |
void xine_free_aligned | ( | void * | ptr | ) |
Referenced by _x_ao_new_port(), _x_yv12_to_nv12(), aa_dispose_frame(), caca_dispose_frame(), dispose_ximage(), ff_audio_dispose(), ff_audio_open_plugin(), fifo_buffer_dispose(), opengl_frame_dispose(), raw_frame_dispose(), raw_update_frame_format(), rgb2yv12_slice(), xshm_frame_dispose(), xv_frame_dispose(), xv_rem_yuy2_emu(), and yuv2rgb_dispose().
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(), 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 _x_yv12_to_nv12(), create_ximage(), ff_audio_open_plugin(), mem_frame_update_frame_format(), rgb2yv12_slice(), vdpau_duplicate_frame_data(), vdpau_update_frame_format(), xshm_update_frame_format(), xv_add_yuy2_emu(), and yuv2rgb_configure().
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(), and raw_update_frame_format().
void * xine_memdup | ( | const void * | src, |
size_t | length | ||
) |
References NULL, and xine_fast_memcpy.
Referenced by rmff_new_mdpr().
void * xine_memdup0 | ( | const void * | src, |
size_t | length | ||
) |
References NULL, and xine_fast_memcpy.
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(), and type.
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 _opensles_write(), _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(), vaapi_x11_wait_event(), vdpau_h264_alter_frame_ready(), 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().
const union { ... } _xine_fast_string_mask[8] |
Referenced by xine_fast_string_cmp(), and xine_fast_string_set().
|
static |
Referenced by _get_first_lang_locale().
|
static |
Referenced by xine_crc16_ansi().
|
static |
Referenced by xine_crc32_ieee().
uint32_t v |
Referenced by _get_hex(), _mad_fixed_2_db(), _mad_scale(), _vdec_hw_h264_unescape(), _x_clut_yuv2rgb(), _x_url_parse2(), _xine_str2secs(), _xine_stree_load_json(), _xine_stree_load_xml(), XineOpenGLView::acceptsFirstResponder, ao_esd_set_property(), ao_oss_get_property(), ao_oss_set_property(), asmrp_set_id(), audio_filter_equalize(), bebf_get(), bebf_skip(), bebf_sniff(), bebf_sync(), bits_read(), bits_set_buf(), bits_valid_left(), build_frame_table(), config_update_string_e(), convert_yv12(), create_lut(), demux_qt_load_fragment_index(), demux_ts_parse_pat(), demux_ts_parse_pes_header(), demux_ts_parse_pmt(), detect_ts(), downmix_lfe_2(), draw_ifs(), dvd_parse_mrl(), faad_decode_audio(), fade(), fade_out_yuv(), ff_aac_mode_parse(), ff_audio_decode(), ff_audio_decode_data(), find_embedded_atoms(), flac_get_frame(), flac_init_frame_head(), flac_parse_frame_head(), flac_test_frame_head(), float_to_int(), frametype_h264(), frametype_h265(), frametype_mpeg(), frametype_vc1(), hexstr2uint32(), hls_bump_find(), hscale_chroma_line(), iatan(), ifs_update(), init_plugin(), isqr(), lineNoise_C(), load_plugin_list(), mad_decode_data(), mpd_input_open(), mpd_str2time(), mpeg1_read_pts(), mpeg2_read_pts(), mpeg_get_pts(), opengl2_open_plugin(), pgx64_overlay_key_blend(), put32le(), recalculate_trans(), rgb2yuy2_palette(), rgb2yuy2_slice(), saturate(), scale_int_do(), sha160_final(), simplify(), str2uint32(), str2uint64(), str2usec(), tdaan_downmix16_4(), tdaan_levels_get(), test_make(), uint64_2str(), uint_sqrt(), unescape(), unixscr_adjust(), unixscr_get_current(), unixscr_init(), unixscr_set_pivot(), unixscr_set_speed(), unixscr_start(), vdec_hw_h264_put_frame(), vo_get_property(), vo_set_property(), vobsub_parse_palette(), w32v_decode_data(), x11osd_blend(), xcbosd_blend(), xine_base64_decode(), xine_base64_encode(), xine_crc16_ansi(), xine_crc32_ieee(), xine_fast_string_cmp(), xine_fast_string_set(), xine_fast_text_line(), xine_init(), xine_int32_2str(), xine_refs_add(), xine_refs_get(), xine_refs_sub(), xine_str2int32(), xine_str2uint32(), xine_str2uint64(), xine_stree_find(), xine_string_unampersand(), xine_string_unbackslash(), xine_string_unpercent(), xine_uint32_2str(), xine_uint64_2str(), xml_parser_get_property_bool(), xml_parser_get_property_int(), yuv2rgb_single_pixel_16(), yuv2rgb_single_pixel_24_bgr(), yuv2rgb_single_pixel_24_rgb(), yuv2rgb_single_pixel_32(), yuv2rgb_single_pixel_8(), yuv2rgb_single_pixel_gray(), yuv2rgb_single_pixel_palette(), and yuv444_to_yuy2_c().
uint8_t z[4] |
Referenced by _x_mrl_unescape(), _x_tag32_me2str(), _x_url_parse2(), _xine_str2secs(), _xine_stree_load_json(), _xine_stree_load_url(), _xine_stree_load_xml(), cdda_class_get_instance(), COutputPin_SetFramePointer(), COutputPin_SetFrameSizePointer(), dvd_parse_mrl(), grid3d_draw(), hexstr2uint32(), hls_bump_find(), hls_bump_guess(), hls_bump_inc(), iconv_internal(), mpd_str2time(), mpd_strcasestr(), open_internal(), render_setup_torus(), str2uint32(), str2uint64(), str2usec(), tdaan_draw_text(), tentacle_new(), unsharp(), unsharp_draw(), v3d_to_v2d(), xine_init(), xine_str2int32(), xine_str2uint32(), xine_str2uint64(), xine_stree_find(), xine_string_unampersand(), xine_string_unbackslash(), and xine_string_unpercent().