xine-lib 1.2.13-20230125hg15249
|
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ogg/ogg.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <xine/demux.h>
#include "bswap.h"
#include "flacutils.h"
#include "ogg_combined.h"
Data Structures | |
struct | chapter_entry_s |
struct | chapter_info_s |
struct | stream_info_s |
struct | demux_ogg_s |
struct | demux_ogg_class_t |
struct | demux_anx_class_t |
struct | ogg_meta |
Macros | |
#define | LOG_MODULE "demux_ogg" |
#define | LOG_VERBOSE |
#define | DEBUG_PACKETS 0 |
#define | DEBUG_PREVIEWS 0 |
#define | DEBUG_PTS 0 |
#define | DEBUG_VIDEO_PACKETS 0 |
#define | CHUNKSIZE 8500 |
#define | PACKET_TYPE_HEADER 0x01 |
#define | PACKET_TYPE_COMMENT 0x03 |
#define | PACKET_TYPE_CODEBOOK 0x05 |
#define | PACKET_TYPE_BITS 0x07 |
#define | PACKET_LEN_BITS01 0xc0 |
#define | PACKET_LEN_BITS2 0x02 |
#define | PACKET_IS_SYNCPOINT 0x08 |
#define | MAX_STREAMS 32 |
#define | PTS_AUDIO 0 |
#define | PTS_VIDEO 1 |
#define | WRAP_THRESHOLD 900000 |
#define | SUB_BUFSIZE 1024 |
#define | abs(x) ( ((x)<0) ? -(x) : (x) ) |
#define | OGG_META(TAG, APPEND) { #TAG"=", XINE_META_INFO_##TAG, APPEND } |
#define | OGG_META_L(TAG, APPEND, META) { #TAG"=", XINE_META_INFO_##META, APPEND } |
#define | ANNODEX_SIGNATURE_SEARCH 128 |
Typedefs | |
typedef struct chapter_entry_s | chapter_entry_t |
typedef struct chapter_info_s | chapter_info_t |
typedef struct stream_info_s | stream_info_t |
typedef struct demux_ogg_s | demux_ogg_t |
Functions | |
static int | get_stream (demux_ogg_t *this, int serno) |
static int | new_stream_info (demux_ogg_t *this, const int cur_serno) |
static int64_t | get_pts (demux_ogg_t *this, int stream_num, int64_t granulepos) |
static int | read_ogg_packet (demux_ogg_t *this) |
static void | get_stream_length (demux_ogg_t *this) |
static void | check_newpts (demux_ogg_t *this, int64_t pts, int video, int preview) |
static void | ogg_handle_event (demux_ogg_t *this) |
static int | read_comments (demux_ogg_t *this, const char *comment) |
static void | read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream_num) |
static void | read_chapter_comment (demux_ogg_t *this, ogg_packet *op) |
static void | update_chapter_display (demux_ogg_t *this, int stream_num, ogg_packet *op) |
static void | send_ogg_buf (demux_ogg_t *this, ogg_packet *op, int stream_num, uint32_t decoder_flags) |
static void | decode_vorbis_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_speex_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_video_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_audio_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_dshow_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_text_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_theora_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_flac_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_opus_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_annodex_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_anxdata_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | decode_cmml_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) |
static void | send_header (demux_ogg_t *this) |
static int | demux_ogg_send_chunk (demux_plugin_t *this_gen) |
static void | demux_ogg_dispose (demux_plugin_t *this_gen) |
static int | demux_ogg_get_status (demux_plugin_t *this_gen) |
static void | demux_ogg_send_headers (demux_plugin_t *this_gen) |
static int | demux_ogg_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing) |
static int | demux_ogg_get_stream_length (demux_plugin_t *this_gen) |
static uint32_t | demux_ogg_get_capabilities (demux_plugin_t *this_gen) |
static int | format_lang_string (demux_ogg_t *this, uint32_t buf_mask, uint32_t buf_type, int channel, char *str) |
static int | demux_ogg_get_optional_data (demux_plugin_t *this_gen, void *data, int data_type) |
static int | detect_ogg_content (int detection_method, input_plugin_t *input) |
static int | detect_anx_content (int detection_method, input_plugin_t *input) |
static demux_plugin_t * | anx_open_plugin (demux_class_t *class_gen, xine_stream_t *stream, input_plugin_t *input) |
static demux_plugin_t * | ogg_open_plugin (demux_class_t *class_gen, xine_stream_t *stream, input_plugin_t *input) |
void * | anx_init_class (xine_t *xine, const void *data) |
void * | ogg_init_class (xine_t *xine, const void *data) |
Variables | |
static const struct ogg_meta | metadata [] |
#define abs | ( | x | ) | ( ((x)<0) ? -(x) : (x) ) |
#define ANNODEX_SIGNATURE_SEARCH 128 |
#define CHUNKSIZE 8500 |
Referenced by read_ogg_packet().
#define DEBUG_PACKETS 0 |
Referenced by demux_ogg_send_chunk(), and send_ogg_buf().
#define DEBUG_PREVIEWS 0 |
Referenced by send_header().
#define DEBUG_PTS 0 |
Referenced by check_newpts().
#define DEBUG_VIDEO_PACKETS 0 |
Referenced by send_ogg_buf().
#define LOG_MODULE "demux_ogg" |
Referenced by decode_audio_header(), decode_dshow_header(), and decode_video_header().
#define LOG_VERBOSE |
#define MAX_STREAMS 32 |
Referenced by demux_ogg_send_chunk(), open_plugin(), parse_tracks(), send_header(), spudec_dispose(), and spudec_reset().
#define OGG_META | ( | TAG, | |
APPEND ) { #TAG"=", XINE_META_INFO_##TAG, APPEND } |
#define OGG_META_L | ( | TAG, | |
APPEND, | |||
META ) { #TAG"=", XINE_META_INFO_##META, APPEND } |
#define PACKET_IS_SYNCPOINT 0x08 |
Referenced by demux_ogg_send_chunk().
#define PACKET_LEN_BITS01 0xc0 |
Referenced by send_ogg_buf().
#define PACKET_LEN_BITS2 0x02 |
Referenced by send_ogg_buf().
#define PACKET_TYPE_BITS 0x07 |
#define PACKET_TYPE_CODEBOOK 0x05 |
#define PACKET_TYPE_COMMENT 0x03 |
Referenced by send_header(), and send_ogg_buf().
#define PACKET_TYPE_HEADER 0x01 |
Referenced by demux_ogg_send_chunk(), and send_ogg_buf().
#define PTS_AUDIO 0 |
Referenced by demux_ogg_seek(), and send_ogg_buf().
#define PTS_VIDEO 1 |
Referenced by demux_ogg_seek(), and send_ogg_buf().
#define SUB_BUFSIZE 1024 |
#define WRAP_THRESHOLD 900000 |
Referenced by check_newpts().
typedef struct chapter_entry_s chapter_entry_t |
typedef struct chapter_info_s chapter_info_t |
typedef struct demux_ogg_s demux_ogg_t |
typedef struct stream_info_s stream_info_t |
void * anx_init_class | ( | xine_t * | xine, |
const void * | data ) |
References anx_open_plugin(), default_demux_class_dispose, N_, and NULL.
|
static |
References xine_stream_s::content_detection_method, DEMUX_FINISHED, demux_ogg_dispose(), demux_ogg_get_capabilities(), demux_ogg_get_optional_data(), demux_ogg_get_status(), demux_ogg_get_stream_length(), demux_ogg_seek(), demux_ogg_send_chunk(), demux_ogg_send_headers(), detect_anx_content(), input(), NULL, input_plugin_s::seek, xine_event_new_queue(), and XINE_STREAM_INFO_MAX.
Referenced by anx_init_class().
|
static |
References _x_demux_control_newpts(), abs, BUF_FLAG_SEEK, DEBUG_PTS, input(), llprintf, WRAP_THRESHOLD, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by send_ogg_buf().
|
static |
References _x_meta_info_set(), BUF_CONTROL_NOP, lprintf, and XINE_META_INFO_SYSTEMLAYER.
Referenced by send_header().
|
static |
References _X_LE_32, _X_LE_64, BUF_AUDIO_SPEEX, BUF_AUDIO_VORBIS, BUF_CONTROL_NOP, BUF_SPU_CMML, BUF_VIDEO_THEORA, and lprintf.
Referenced by send_header().
|
static |
References _x_formattag_to_buf_audio(), _X_LE_16, _X_LE_32, _X_LE_64, _x_report_audio_format_tag(), _x_stream_info_set(), BUF_AUDIO_UNKNOWN, BUF_CONTROL_NOP, BUF_FLAG_FRAME_END, BUF_FLAG_HEADER, BUF_FLAG_STDHEADER, buf_element_s::decoder_flags, buf_element_s::decoder_info, LOG_MODULE, lprintf, NULL, buf_element_s::type, xine_hexdump(), XINE_STREAM_INFO_AUDIO_BITRATE, XINE_STREAM_INFO_AUDIO_BITS, XINE_STREAM_INFO_AUDIO_CHANNELS, XINE_STREAM_INFO_AUDIO_FOURCC, and XINE_STREAM_INFO_AUDIO_SAMPLERATE.
Referenced by send_header().
|
static |
References _X_LE_64, and BUF_SPU_CMML.
Referenced by send_header().
|
static |
References _x_fourcc_to_buf_video(), _X_LE_16, _X_LE_32, _x_report_video_fourcc(), _x_stream_info_set(), xine_bmiheader::biBitCount, xine_bmiheader::biClrImportant, xine_bmiheader::biClrUsed, xine_bmiheader::biCompression, xine_bmiheader::biHeight, xine_bmiheader::biPlanes, xine_bmiheader::biSize, xine_bmiheader::biSizeImage, xine_bmiheader::biWidth, xine_bmiheader::biXPelsPerMeter, xine_bmiheader::biYPelsPerMeter, BUF_CONTROL_NOP, BUF_FLAG_FRAME_END, BUF_FLAG_FRAMERATE, BUF_FLAG_HEADER, BUF_FLAG_STDHEADER, BUF_VIDEO_UNKNOWN, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, LOG_MODULE, lprintf, buf_element_s::size, buf_element_s::type, xine_hexdump(), XINE_STREAM_INFO_FRAME_DURATION, XINE_STREAM_INFO_VIDEO_HEIGHT, XINE_STREAM_INFO_VIDEO_WIDTH, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by send_header().
|
static |
References _x_assert, _X_BE_32, _x_parse_flac_metadata_header(), _x_parse_flac_streaminfo_block(), _x_stream_info_set(), xine_flac_streaminfo_block::bits_per_sample, xine_flac_metadata_header::blocktype, BUF_AUDIO_FLAC, BUF_FLAG_FRAME_END, BUF_FLAG_HEADER, BUF_FLAG_STDHEADER, xine_waveformatex::cbSize, xine_flac_streaminfo_block::channels, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, FLAC_BLOCKTYPE_STREAMINFO, FLAC_STREAMINFO_SIZE, xine_flac_metadata_header::length, ME_FOURCC, xine_flac_streaminfo_block::samplerate, buf_element_s::size, buf_element_s::type, xine_hexdump(), XINE_STREAM_INFO_AUDIO_BITS, XINE_STREAM_INFO_AUDIO_CHANNELS, and XINE_STREAM_INFO_AUDIO_SAMPLERATE.
Referenced by send_header().
|
static |
References _X_BE_32, _x_stream_info_set(), BUF_AUDIO_OPUS, BUF_FLAG_FRAME_END, BUF_FLAG_HEADER, BUF_FLAG_STDHEADER, xine_waveformatex::cbSize, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, buf_element_s::size, buf_element_s::type, XINE_STREAM_INFO_AUDIO_CHANNELS, and XINE_STREAM_INFO_AUDIO_SAMPLERATE.
Referenced by send_header().
|
static |
References _x_stream_info_set(), BUF_AUDIO_SPEEX, BUF_CONTROL_NOP, lprintf, mode(), XINE_STREAM_INFO_AUDIO_BITRATE, XINE_STREAM_INFO_AUDIO_SAMPLERATE, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by send_header().
|
static |
References BUF_SPU_OGM, buf_element_s::content, lprintf, buf_element_s::pts, and buf_element_s::type.
Referenced by send_header().
|
static |
References _x_meta_info_set(), _x_stream_info_set(), BUF_CONTROL_NOP, BUF_VIDEO_THEORA, lprintf, XINE_META_INFO_VIDEOCODEC, XINE_STREAM_INFO_FRAME_DURATION, XINE_STREAM_INFO_VIDEO_HEIGHT, XINE_STREAM_INFO_VIDEO_RATIO, XINE_STREAM_INFO_VIDEO_WIDTH, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by send_header().
|
static |
References _x_fourcc_to_buf_video(), _X_LE_16, _X_LE_32, _X_LE_64, _x_report_video_fourcc(), _x_stream_info_set(), xine_bmiheader::biBitCount, xine_bmiheader::biClrImportant, xine_bmiheader::biClrUsed, xine_bmiheader::biCompression, xine_bmiheader::biHeight, xine_bmiheader::biPlanes, xine_bmiheader::biSize, xine_bmiheader::biSizeImage, xine_bmiheader::biWidth, xine_bmiheader::biXPelsPerMeter, xine_bmiheader::biYPelsPerMeter, BUF_FLAG_FRAME_END, BUF_FLAG_FRAMERATE, BUF_FLAG_HEADER, BUF_FLAG_STDHEADER, BUF_VIDEO_UNKNOWN, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, LOG_MODULE, lprintf, buf_element_s::size, buf_element_s::type, xine_hexdump(), XINE_STREAM_INFO_FRAME_DURATION, XINE_STREAM_INFO_VIDEO_FOURCC, XINE_STREAM_INFO_VIDEO_HEIGHT, and XINE_STREAM_INFO_VIDEO_WIDTH.
Referenced by send_header().
|
static |
References _, _x_stream_info_set(), BUF_AUDIO_VORBIS, xine_log(), XINE_LOG_MSG, XINE_STREAM_INFO_AUDIO_BITRATE, and XINE_STREAM_INFO_AUDIO_SAMPLERATE.
Referenced by send_header().
|
static |
References xine_event_dispose_queue(), and XINE_STREAM_INFO_MAX.
Referenced by anx_open_plugin(), and ogg_open_plugin().
|
static |
References DEMUX_CAP_AUDIOLANG, DEMUX_CAP_CHAPTERS, and DEMUX_CAP_SPULANG.
Referenced by anx_open_plugin(), and ogg_open_plugin().
|
static |
References BUF_AUDIO_BASE, BUF_SPU_OGM, DEMUX_OPTIONAL_DATA_AUDIOLANG, DEMUX_OPTIONAL_DATA_SPULANG, DEMUX_OPTIONAL_SUCCESS, DEMUX_OPTIONAL_UNSUPPORTED, format_lang_string(), and lprintf.
Referenced by anx_open_plugin(), and ogg_open_plugin().
|
static |
Referenced by anx_open_plugin(), and ogg_open_plugin().
|
static |
References input().
Referenced by anx_open_plugin(), and ogg_open_plugin().
|
static |
References _x_demux_flush_engine(), DEMUX_OK, input(), INPUT_IS_SEEKABLE, lprintf, PTS_AUDIO, and PTS_VIDEO.
Referenced by anx_open_plugin(), and ogg_open_plugin().
|
static |
References _x_demux_control_end(), _x_demux_control_start(), BUF_AUDIO_FLAC, BUF_AUDIO_SPEEX, BUF_SPU_BASE, BUF_VIDEO_BASE, BUF_VIDEO_THEORA, DEBUG_PACKETS, DEMUX_FINISHED, get_pts(), get_stream(), llprintf, lprintf, MAX_STREAMS, new_stream_info(), ogg_handle_event(), PACKET_IS_SYNCPOINT, PACKET_TYPE_HEADER, read_ogg_packet(), send_header(), send_ogg_buf(), XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by anx_open_plugin(), and ogg_open_plugin().
|
static |
|
static |
References _x_demux_read_header(), ANNODEX_SIGNATURE_SEARCH, detect_ogg_content(), input(), METHOD_BY_CONTENT, METHOD_BY_MRL, and METHOD_EXPLICIT.
Referenced by anx_open_plugin().
|
static |
References _x_demux_read_header(), input(), ME_FOURCC, METHOD_BY_CONTENT, METHOD_BY_MRL, and METHOD_EXPLICIT.
Referenced by detect_anx_content(), and ogg_open_plugin().
|
static |
References buf_type, DEMUX_OPTIONAL_SUCCESS, DEMUX_OPTIONAL_UNSUPPORTED, and XINE_LANG_MAX.
Referenced by demux_ogg_get_optional_data().
|
static |
References BUF_SPU_CMML, and BUF_VIDEO_THEORA.
Referenced by demux_ogg_send_chunk(), get_stream_length(), send_ogg_buf(), update_chapter_display(), and vdr_execute_rpc_command().
|
static |
Referenced by demux_ogg_send_chunk(), get_stream_length(), and send_header().
|
static |
References _x_stream_info_set(), get_pts(), get_stream(), input(), INPUT_CAP_SEEKABLE, read_ogg_packet(), and XINE_STREAM_INFO_BITRATE.
Referenced by send_header().
|
static |
Referenced by demux_ogg_send_chunk(), and send_header().
|
static |
References xine_event_t::type, xine_event_free(), xine_event_get(), XINE_EVENT_INPUT_NEXT, and XINE_EVENT_INPUT_PREVIOUS.
Referenced by demux_ogg_send_chunk().
void * ogg_init_class | ( | xine_t * | xine, |
const void * | data ) |
References default_demux_class_dispose, N_, NULL, and ogg_open_plugin().
|
static |
References xine_stream_s::content_detection_method, DEMUX_FINISHED, demux_ogg_dispose(), demux_ogg_get_capabilities(), demux_ogg_get_optional_data(), demux_ogg_get_status(), demux_ogg_get_stream_length(), demux_ogg_seek(), demux_ogg_send_chunk(), demux_ogg_send_headers(), detect_ogg_content(), input(), NULL, input_plugin_s::seek, xine_event_new_queue(), and XINE_STREAM_INFO_MAX.
Referenced by ogg_init_class().
|
static |
References _x_freep(), lprintf, NULL, and read_comments().
Referenced by send_ogg_buf().
|
static |
References _x_meta_info_set_utf8(), ogg_meta::meta, and metadata.
Referenced by read_chapter_comment(), and read_language_comment().
|
static |
References read_comments().
Referenced by send_ogg_buf().
|
static |
References CHUNKSIZE, input(), and lprintf.
Referenced by demux_ogg_send_chunk(), get_stream_length(), and send_header().
|
static |
References BUF_CONTROL_NOP, BUF_FLAG_HEADER, xine_event_t::data_length, DEBUG_PREVIEWS, decode_annodex_header(), decode_anxdata_header(), decode_audio_header(), decode_cmml_header(), decode_dshow_header(), decode_flac_header(), decode_opus_header(), decode_speex_header(), decode_text_header(), decode_theora_header(), decode_video_header(), decode_vorbis_header(), DEMUX_FINISHED, get_stream(), get_stream_length(), llprintf, lprintf, MAX_STREAMS, new_stream_info(), PACKET_TYPE_COMMENT, read_ogg_packet(), send_ogg_buf(), xine_event_t::type, xine_event_send(), XINE_EVENT_UI_CHANNELS_CHANGED, xine_hexdump(), XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by demux_mpgaudio_next(), demux_ogg_send_chunk(), and demux_ogg_send_headers().
|
static |
References _x_demux_send_data(), BUF_AUDIO_BASE, BUF_AUDIO_FLAC, BUF_AUDIO_OPUS, BUF_AUDIO_SPEEX, BUF_AUDIO_VORBIS, BUF_FLAG_HEADER, BUF_SPU_BASE, BUF_SPU_CMML, BUF_VIDEO_BASE, BUF_VIDEO_THEORA, check_newpts(), buf_element_s::content, DEBUG_PACKETS, DEBUG_VIDEO_PACKETS, get_pts(), input(), llprintf, lprintf, PACKET_LEN_BITS01, PACKET_LEN_BITS2, PACKET_TYPE_COMMENT, PACKET_TYPE_HEADER, buf_element_s::pts, PTS_AUDIO, PTS_VIDEO, read_chapter_comment(), read_language_comment(), buf_element_s::size, buf_element_s::type, and update_chapter_display().
Referenced by demux_ogg_send_chunk(), and send_header().
|
static |
References _x_meta_info_set(), get_pts(), lprintf, xine_ui_data_t::str, xine_ui_data_t::str_len, xine_event_t::type, xine_event_send(), XINE_EVENT_UI_SET_TITLE, and XINE_META_INFO_TITLE.
Referenced by send_ogg_buf().
|
static |
Referenced by flac_metadata_callback(), flac_metadata_callback(), and read_comments().