|
xine-lib
1.2.9
|
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <errno.h>#include <signal.h>#include <basedir.h>#include <xine/xine_internal.h>#include <xine/xineutils.h>#include <xine/input_plugin.h>#include "../xine-engine/bswap.h"#include "media_helper.h"Data Structures | |
| struct | _cdrom_toc_entry |
| struct | _cdrom_toc |
| struct | sha160_t |
| struct | trackinfo_t |
| struct | cdda_input_plugin_t |
| struct | cdda_input_class_t |
Macros | |
| #define | LOG_MODULE "input_cdda" |
| #define | LOG_VERBOSE |
| #define | DEFAULT_CDDA_DEVICE "/dev/cdrom" |
| #define | CDDB_SERVER "freedb.freedb.org" |
| #define | CDDB_PORT 8880 |
| #define | CDDB_PROTOCOL 6 |
| #define | CDDB_TIMEOUT 5000 |
| #define | CD_SECONDS_PER_MINUTE 60 |
| #define | CD_FRAMES_PER_SECOND 75 |
| #define | CD_RAW_FRAME_SIZE 2352 |
| #define | CD_LEADOUT_TRACK 0xAA |
| #define | CD_BLOCK_OFFSET 150 |
| #define | sha160_digest_len 20 |
| #define | MAX_TRACKS 99 |
| #define | CACHED_FRAMES 100 |
| #define | _BUFSIZ 300 |
Typedefs | |
| typedef struct _cdrom_toc_entry | cdrom_toc_entry |
| typedef struct _cdrom_toc | cdrom_toc |
Functions | |
| static void | sha160_init (sha160_t *s) |
| static void | sha160_trans (sha160_t *s) |
| static void | sha160_update (sha160_t *s, const uint8_t *data, size_t len) |
| static void | sha160_final (sha160_t *s, uint8_t *dest) |
| static cdrom_toc * | init_cdrom_toc (void) |
| static void | free_cdrom_toc (cdrom_toc *toc) |
| static int | read_cdrom_toc (int fd, cdrom_toc *toc) |
| static int | read_cdrom_frames (cdda_input_plugin_t *this_gen, int frame, int num_frames, unsigned char *data) |
| static int | parse_url (char *urlbuf, char **host, int *port) |
| static int | XINE_FORMAT_PRINTF (4, 5) |
| static int | network_connect (xine_stream_t *stream, const char *got_url) |
| static int | network_read_cdrom_toc (xine_stream_t *stream, int fd, cdrom_toc *toc) |
| static int | network_read_cdrom_frames (xine_stream_t *stream, int fd, int first_frame, int num_frames, unsigned char data[2352]) |
| static void | cdda_device_cb (void *data, xine_cfg_entry_t *cfg) |
| static void | enable_cddb_changed_cb (void *data, xine_cfg_entry_t *cfg) |
| static void | server_changed_cb (void *data, xine_cfg_entry_t *cfg) |
| static void | port_changed_cb (void *data, xine_cfg_entry_t *cfg) |
| static int | _cdda_is_cd_changed (cdda_input_plugin_t *this) |
| static void | _cdda_mkdir_safe (xine_t *xine, char *path) |
| static void | _cdda_mkdir_recursive_safe (xine_t *xine, char *path) |
| static int | _cdda_cddb_socket_read (cdda_input_plugin_t *this, char *str, int size) |
| static int | _cdda_cddb_send_command (cdda_input_plugin_t *this, char *cmd) |
| static int | _cdda_cddb_handle_code (char *buf) |
| static char * | _cdda_append (char *first, const char *second) |
| static void | _cdda_parse_cddb_info (cdda_input_plugin_t *this, char *buffer, char **dtitle) |
| static int | _cdda_load_cached_cddb_infos (cdda_input_plugin_t *this) |
| static void | _cdda_save_cached_cddb_infos (cdda_input_plugin_t *this, char *filecontent) |
| static int | _cdda_cddb_socket_open (cdda_input_plugin_t *this) |
| static void | _cdda_cddb_socket_close (cdda_input_plugin_t *this) |
| static int | _cdda_cddb_retrieve (cdda_input_plugin_t *this) |
| static unsigned int | _cdda_cddb_sum (int n) |
| static uint32_t | _cdda_calc_cddb_id (cdda_input_plugin_t *this) |
| static void | _cdda_cdindex (cdda_input_plugin_t *this, cdrom_toc *toc) |
| static uint32_t | _cdda_get_cddb_id (cdda_input_plugin_t *this) |
| static void | _cdda_free_cddb_info (cdda_input_plugin_t *this) |
| static int | cdda_open (cdda_input_plugin_t *this_gen, const char *cdda_device, cdrom_toc *toc, int *fdd) |
| static int | cdda_close (cdda_input_plugin_t *this_gen) |
| static uint32_t | cdda_plugin_get_capabilities (input_plugin_t *this_gen) |
| static off_t | cdda_plugin_read (input_plugin_t *this_gen, void *buf, off_t len) |
| static buf_element_t * | cdda_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, off_t nlen) |
| static off_t | cdda_plugin_seek (input_plugin_t *this_gen, off_t offset, int origin) |
| static off_t | cdda_plugin_get_current_pos (input_plugin_t *this_gen) |
| static off_t | cdda_plugin_get_length (input_plugin_t *this_gen) |
| static uint32_t | cdda_plugin_get_blocksize (input_plugin_t *this_gen) |
| static const char * | cdda_plugin_get_mrl (input_plugin_t *this_gen) |
| static int | cdda_plugin_get_optional_data (input_plugin_t *this_gen, void *data, int data_type) |
| static void | cdda_plugin_dispose (input_plugin_t *this_gen) |
| static int | cdda_plugin_open (input_plugin_t *this_gen) |
| static void | free_autoplay_list (cdda_input_class_t *this) |
| static const char *const * | cdda_class_get_autoplay_list (input_class_t *this_gen, int *num_files) |
| static input_plugin_t * | cdda_class_get_instance (input_class_t *cls_gen, xine_stream_t *stream, const char *mrl) |
| static void | cdda_class_dispose (input_class_t *this_gen) |
| static int | cdda_class_eject_media (input_class_t *this_gen) |
| static void * | init_plugin (xine_t *xine, void *data) |
Variables | |
| const plugin_info_t xine_plugin_info [] | EXPORTED |
| #define _BUFSIZ 300 |
Referenced by network_read_cdrom_toc(), and XINE_FORMAT_PRINTF().
| #define CACHED_FRAMES 100 |
Referenced by cdda_plugin_read().
| #define CD_BLOCK_OFFSET 150 |
| #define CD_FRAMES_PER_SECOND 75 |
Referenced by _cdda_calc_cddb_id(), cdda_plugin_open(), and network_read_cdrom_toc().
| #define CD_LEADOUT_TRACK 0xAA |
Referenced by network_read_cdrom_toc().
| #define CD_RAW_FRAME_SIZE 2352 |
Referenced by cdda_plugin_get_current_pos(), cdda_plugin_get_length(), cdda_plugin_read(), and cdda_plugin_seek().
| #define CD_SECONDS_PER_MINUTE 60 |
Referenced by cdda_plugin_open(), and network_read_cdrom_toc().
| #define CDDB_PORT 8880 |
Referenced by init_plugin().
| #define CDDB_PROTOCOL 6 |
Referenced by _cdda_cddb_retrieve().
| #define CDDB_SERVER "freedb.freedb.org" |
Referenced by init_plugin().
| #define CDDB_TIMEOUT 5000 |
Referenced by _cdda_cddb_socket_open().
| #define DEFAULT_CDDA_DEVICE "/dev/cdrom" |
Referenced by init_plugin().
| #define LOG_MODULE "input_cdda" |
Referenced by _cdda_cddb_socket_open().
| #define LOG_VERBOSE |
| #define MAX_TRACKS 99 |
Referenced by cdda_class_get_autoplay_list().
| #define sha160_digest_len 20 |
| typedef struct _cdrom_toc cdrom_toc |
| typedef struct _cdrom_toc_entry cdrom_toc_entry |
|
inlinestatic |
Referenced by _cdda_parse_cddb_info().
|
static |
References _cdda_cddb_sum(), CD_FRAMES_PER_SECOND, and NULL.
Referenced by _cdda_get_cddb_id().
|
static |
Referenced by _cdda_cddb_retrieve().
|
static |
References _, _cdda_cddb_handle_code(), _cdda_cddb_send_command(), _cdda_cddb_socket_close(), _cdda_cddb_socket_open(), _cdda_cddb_socket_read(), _cdda_load_cached_cddb_infos(), _cdda_parse_cddb_info(), _cdda_save_cached_cddb_infos(), cdda_input_class_t::cddb_error, CDDB_PROTOCOL, NULL, VERSION, xine_strsep, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by cdda_plugin_open().
|
static |
References _x_io_tcp_write(), NULL, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by _cdda_cddb_retrieve().
|
static |
References NULL.
Referenced by _cdda_cddb_retrieve().
|
static |
References _, _x_io_tcp_connect(), _x_io_tcp_connect_finish(), CDDB_TIMEOUT, LOG_MODULE, lprintf, xine_log(), XINE_LOG_MSG, and XIO_READY.
Referenced by _cdda_cddb_retrieve().
|
static |
References _x_io_tcp_read_line(), XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by _cdda_cddb_retrieve().
|
static |
Referenced by _cdda_calc_cddb_id().
|
static |
References _x_meta_info_set_utf8(), _cdrom_toc_entry::first_frame, _cdrom_toc::first_track, _cdrom_toc::ignore_last_track, _cdrom_toc::last_track, _cdrom_toc::leadout_track, sha160_final(), sha160_init(), sha160_update(), _cdrom_toc::toc_entries, xine_base64_encode(), and XINE_META_INFO_CDINDEX_DISCID.
Referenced by cdda_plugin_open().
|
static |
Referenced by cdda_plugin_dispose(), and cdda_plugin_open().
|
static |
References _cdda_calc_cddb_id(), and NULL.
Referenced by cdda_plugin_open().
|
static |
References NULL, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by cdda_plugin_open().
|
static |
References _cdda_parse_cddb_info(), NULL, PACKAGE, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by _cdda_cddb_retrieve().
|
static |
References _cdda_mkdir_safe().
Referenced by _cdda_save_cached_cddb_infos().
|
static |
References NULL, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by _cdda_mkdir_recursive_safe().
|
static |
References _cdda_append(), and _x_asprintf().
Referenced by _cdda_cddb_retrieve(), and _cdda_load_cached_cddb_infos().
|
static |
References _cdda_mkdir_recursive_safe(), NULL, PACKAGE, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by _cdda_cddb_retrieve().
|
static |
References free_autoplay_list(), MRL_ZERO, and config_values_s::unregister_callback.
Referenced by init_plugin().
|
static |
References media_eject_media().
Referenced by init_plugin().
|
static |
References _x_asprintf(), cdda_input_class_t::autoplaylist, cdda_close(), cdda_input_class_t::cdda_device, cdda_open(), cdda_input_plugin_t::fd, _cdrom_toc::first_track, free_autoplay_list(), free_cdrom_toc(), _cdrom_toc::ignore_last_track, init_cdrom_toc(), cdda_input_class_t::ip, _cdrom_toc::last_track, lprintf, MAX_TRACKS, cdda_input_plugin_t::net_fd, network_connect(), network_read_cdrom_toc(), NULL, read_cdrom_toc(), and cdda_input_plugin_t::stream.
Referenced by init_plugin().
|
static |
References cdda_input_class_t::cdda_device, cdda_plugin_dispose(), cdda_plugin_get_blocksize(), cdda_plugin_get_capabilities(), cdda_plugin_get_current_pos(), cdda_plugin_get_length(), cdda_plugin_get_mrl(), cdda_plugin_get_optional_data(), cdda_plugin_open(), cdda_plugin_read(), cdda_plugin_read_block(), cdda_plugin_seek(), cdda_input_class_t::cddb_error, enable_cddb_changed_cb(), lprintf, NULL, port_changed_cb(), server_changed_cb(), xine_stream_s::xine, and xine_config_lookup_entry().
Referenced by init_plugin().
|
static |
References xine_s::config, cdda_input_plugin_t::fd, FreeLibrary(), config_values_s::lookup_entry, cdda_input_plugin_t::net_fd, NULL, cfg_entry_s::num_value, cdda_input_plugin_t::stream, xine_stream_s::xine, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by cdda_class_get_autoplay_list(), cdda_plugin_dispose(), and cdda_plugin_open().
|
static |
References cdda_input_class_t::cdda_device, and xine_cfg_entry_s::str_value.
Referenced by init_plugin().
|
static |
References xine_s::config, cdda_input_plugin_t::fd, FreeLibrary(), GetProcAddress(), config_values_s::lookup_entry, lprintf, NULL, cfg_entry_s::num_value, cdda_input_plugin_t::stream, xine_stream_s::xine, xine_open_cloexec(), XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by cdda_class_get_autoplay_list(), and cdda_plugin_open().
|
static |
References _cdda_free_cddb_info(), cdda_close(), cdda_input_class_t::ip, and NULL.
Referenced by cdda_class_get_instance().
|
static |
Referenced by cdda_class_get_instance().
|
static |
References INPUT_CAP_SEEKABLE.
Referenced by cdda_class_get_instance().
|
static |
References CD_RAW_FRAME_SIZE.
Referenced by cdda_class_get_instance().
|
static |
References CD_RAW_FRAME_SIZE.
Referenced by cdda_class_get_instance().
|
static |
Referenced by cdda_class_get_instance().
|
static |
Referenced by cdda_class_get_instance().
|
static |
References _cdda_cddb_retrieve(), _cdda_cdindex(), _cdda_free_cddb_info(), _cdda_get_cddb_id(), _cdda_is_cd_changed(), _x_meta_info_set_utf8(), CD_FRAMES_PER_SECOND, CD_SECONDS_PER_MINUTE, cdda_close(), cdda_input_class_t::cdda_device, cdda_open(), _cdrom_toc_entry::first_frame, _cdrom_toc_entry::first_frame_frame, _cdrom_toc_entry::first_frame_minute, _cdrom_toc_entry::first_frame_second, _cdrom_toc::first_track, free_cdrom_toc(), init_cdrom_toc(), input_plugin_s::input_class, _cdrom_toc::last_track, _cdrom_toc::leadout_track, lprintf, network_connect(), network_read_cdrom_toc(), NULL, read_cdrom_toc(), _cdrom_toc::toc_entries, _cdrom_toc::total_tracks, XINE_META_INFO_ALBUM, XINE_META_INFO_ARTIST, XINE_META_INFO_GENRE, XINE_META_INFO_TITLE, XINE_META_INFO_TRACK_NUMBER, and XINE_META_INFO_YEAR.
Referenced by cdda_class_get_instance().
|
static |
References CACHED_FRAMES, CD_RAW_FRAME_SIZE, network_read_cdrom_frames(), and read_cdrom_frames().
Referenced by cdda_class_get_instance(), and cdda_plugin_read_block().
|
static |
|
static |
References CD_RAW_FRAME_SIZE.
Referenced by cdda_class_get_instance().
|
static |
References cdda_input_plugin_t::enabled, and xine_cfg_entry_s::num_value.
Referenced by cdda_class_get_instance(), and init_plugin().
|
static |
References cdda_input_class_t::autoplaylist, and NULL.
Referenced by cdda_class_dispose(), and cdda_class_get_autoplay_list().
|
static |
References _cdrom_toc::toc_entries.
Referenced by cdda_class_get_autoplay_list(), and cdda_plugin_open().
|
static |
References _cdrom_toc::first_track, _cdrom_toc::last_track, NULL, _cdrom_toc::toc_entries, and _cdrom_toc::total_tracks.
Referenced by cdda_class_get_autoplay_list(), and cdda_plugin_open().
|
static |
References _, cdda_class_dispose(), cdda_class_eject_media(), cdda_class_get_autoplay_list(), cdda_class_get_instance(), cdda_device_cb(), CDDB_PORT, CDDB_SERVER, xine_s::config, DEFAULT_CDDA_DEVICE, enable_cddb_changed_cb(), N_, NULL, port_changed_cb(), config_values_s::register_bool, config_values_s::register_filename, config_values_s::register_num, config_values_s::register_string, server_changed_cb(), XINE_CONFIG_SECURITY, and XINE_CONFIG_STRING_IS_DEVICE_NAME.
|
static |
References _x_io_tcp_connect(), lprintf, NULL, parse_url(), xine_stream_s::xine, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by cdda_class_get_autoplay_list(), and cdda_plugin_open().
|
static |
Referenced by cdda_plugin_read().
|
static |
References _BUFSIZ, CD_FRAMES_PER_SECOND, CD_LEADOUT_TRACK, CD_SECONDS_PER_MINUTE, _cdrom_toc_entry::first_frame, _cdrom_toc_entry::first_frame_frame, _cdrom_toc_entry::first_frame_minute, _cdrom_toc_entry::first_frame_second, _cdrom_toc::first_track, _cdrom_toc::last_track, _cdrom_toc::leadout_track, _cdrom_toc::toc_entries, _cdrom_toc::total_tracks, _cdrom_toc_entry::track_mode, xine_stream_s::xine, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by cdda_class_get_autoplay_list(), and cdda_plugin_open().
|
static |
References NULL.
Referenced by network_connect().
|
static |
References xine_cfg_entry_s::num_value, and cdda_input_plugin_t::port.
Referenced by cdda_class_get_instance(), and init_plugin().
|
static |
Referenced by cdda_plugin_read().
|
static |
Referenced by cdda_class_get_autoplay_list(), and cdda_plugin_open().
|
static |
References cdda_input_plugin_t::cddb, cdda_input_plugin_t::server, and xine_cfg_entry_s::str_value.
Referenced by cdda_class_get_instance(), and init_plugin().
|
static |
References sha160_t::buf, sha160_t::n, sha160_trans(), and sha160_t::state.
Referenced by _cdda_cdindex().
|
static |
References sha160_t::n, and sha160_t::state.
Referenced by _cdda_cdindex().
|
static |
References _X_BE_32, sha160_t::buf, and sha160_t::state.
Referenced by sha160_final(), and sha160_update().
|
static |
References sha160_t::buf, sha160_t::n, and sha160_trans().
Referenced by _cdda_cdindex().
|
static |
References _BUFSIZ, _x_io_tcp_read(), _x_io_tcp_read_line(), _x_io_tcp_write(), XINE_VERBOSITY_DEBUG, and xprintf.
| const plugin_info_t xine_plugin_info [] EXPORTED |
1.8.14