xine-lib 1.2.11
Data Structures | Macros | Typedefs | Functions | Variables
xine_ogg_demuxer.c File Reference
#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_tanx_open_plugin (demux_class_t *class_gen, xine_stream_t *stream, input_plugin_t *input)
 
static demux_plugin_togg_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 []
 

Macro Definition Documentation

◆ abs

#define abs (   x)    ( ((x)<0) ? -(x) : (x) )

◆ ANNODEX_SIGNATURE_SEARCH

#define ANNODEX_SIGNATURE_SEARCH   128

◆ CHUNKSIZE

#define CHUNKSIZE   8500

◆ DEBUG_PACKETS

#define DEBUG_PACKETS   0

◆ DEBUG_PREVIEWS

#define DEBUG_PREVIEWS   0

◆ DEBUG_PTS

#define DEBUG_PTS   0

◆ DEBUG_VIDEO_PACKETS

#define DEBUG_VIDEO_PACKETS   0

◆ LOG_MODULE

#define LOG_MODULE   "demux_ogg"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ MAX_STREAMS

#define MAX_STREAMS   32

◆ OGG_META

#define OGG_META (   TAG,
  APPEND 
)    { #TAG"=", XINE_META_INFO_##TAG, APPEND }

◆ OGG_META_L

#define OGG_META_L (   TAG,
  APPEND,
  META 
)    { #TAG"=", XINE_META_INFO_##META, APPEND }

◆ PACKET_IS_SYNCPOINT

#define PACKET_IS_SYNCPOINT   0x08

◆ PACKET_LEN_BITS01

#define PACKET_LEN_BITS01   0xc0

◆ PACKET_LEN_BITS2

#define PACKET_LEN_BITS2   0x02

◆ PACKET_TYPE_BITS

#define PACKET_TYPE_BITS   0x07

◆ PACKET_TYPE_CODEBOOK

#define PACKET_TYPE_CODEBOOK   0x05

◆ PACKET_TYPE_COMMENT

#define PACKET_TYPE_COMMENT   0x03

◆ PACKET_TYPE_HEADER

#define PACKET_TYPE_HEADER   0x01

◆ PTS_AUDIO

#define PTS_AUDIO   0

◆ PTS_VIDEO

#define PTS_VIDEO   1

◆ SUB_BUFSIZE

#define SUB_BUFSIZE   1024

◆ WRAP_THRESHOLD

#define WRAP_THRESHOLD   900000

Typedef Documentation

◆ chapter_entry_t

◆ chapter_info_t

◆ demux_ogg_t

typedef struct demux_ogg_s demux_ogg_t

◆ stream_info_t

typedef struct stream_info_s stream_info_t

Function Documentation

◆ anx_init_class()

void * anx_init_class ( xine_t xine,
const void *  data 
)

◆ anx_open_plugin()

static demux_plugin_t * anx_open_plugin ( demux_class_t class_gen,
xine_stream_t stream,
input_plugin_t input 
)
static

◆ check_newpts()

static void check_newpts ( demux_ogg_t this,
int64_t  pts,
int  video,
int  preview 
)
static

◆ decode_annodex_header()

static void decode_annodex_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ decode_anxdata_header()

static void decode_anxdata_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ decode_audio_header()

static void decode_audio_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ decode_cmml_header()

static void decode_cmml_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

References _X_LE_64, and BUF_SPU_CMML.

Referenced by send_header().

◆ decode_dshow_header()

static void decode_dshow_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ decode_flac_header()

static void decode_flac_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ decode_opus_header()

static void decode_opus_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ decode_speex_header()

static void decode_speex_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ decode_text_header()

static void decode_text_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ decode_theora_header()

static void decode_theora_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ decode_video_header()

static void decode_video_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ decode_vorbis_header()

static void decode_vorbis_header ( demux_ogg_t this,
const int  stream_num,
ogg_packet *  op 
)
static

◆ demux_ogg_dispose()

static void demux_ogg_dispose ( demux_plugin_t this_gen)
static

◆ demux_ogg_get_capabilities()

static uint32_t demux_ogg_get_capabilities ( demux_plugin_t this_gen)
static

◆ demux_ogg_get_optional_data()

static int demux_ogg_get_optional_data ( demux_plugin_t this_gen,
void *  data,
int  data_type 
)
static

◆ demux_ogg_get_status()

static int demux_ogg_get_status ( demux_plugin_t this_gen)
static

Referenced by anx_open_plugin(), and ogg_open_plugin().

◆ demux_ogg_get_stream_length()

static int demux_ogg_get_stream_length ( demux_plugin_t this_gen)
static

References input().

Referenced by anx_open_plugin(), and ogg_open_plugin().

◆ demux_ogg_seek()

static int demux_ogg_seek ( demux_plugin_t this_gen,
off_t  start_pos,
int  start_time,
int  playing 
)
static

◆ demux_ogg_send_chunk()

static int demux_ogg_send_chunk ( demux_plugin_t this_gen)
static

◆ demux_ogg_send_headers()

static void demux_ogg_send_headers ( demux_plugin_t this_gen)
static

◆ detect_anx_content()

static int detect_anx_content ( int  detection_method,
input_plugin_t input 
)
static

◆ detect_ogg_content()

static int detect_ogg_content ( int  detection_method,
input_plugin_t input 
)
static

◆ format_lang_string()

static int format_lang_string ( demux_ogg_t this,
uint32_t  buf_mask,
uint32_t  buf_type,
int  channel,
char *  str 
)
static

◆ get_pts()

static int64_t get_pts ( demux_ogg_t this,
int  stream_num,
int64_t  granulepos 
)
static

◆ get_stream()

static int get_stream ( demux_ogg_t this,
int  serno 
)
static

◆ get_stream_length()

static void get_stream_length ( demux_ogg_t this)
static

◆ new_stream_info()

static int new_stream_info ( demux_ogg_t this,
const int  cur_serno 
)
static

◆ ogg_handle_event()

static void ogg_handle_event ( demux_ogg_t this)
static

◆ ogg_init_class()

void * ogg_init_class ( xine_t xine,
const void *  data 
)

◆ ogg_open_plugin()

static demux_plugin_t * ogg_open_plugin ( demux_class_t class_gen,
xine_stream_t stream,
input_plugin_t input 
)
static

◆ read_chapter_comment()

static void read_chapter_comment ( demux_ogg_t this,
ogg_packet *  op 
)
static

References lprintf, NULL, and read_comments().

Referenced by send_ogg_buf().

◆ read_comments()

static int read_comments ( demux_ogg_t this,
const char *  comment 
)
static

◆ read_language_comment()

static void read_language_comment ( demux_ogg_t this,
ogg_packet *  op,
int  stream_num 
)
static

References read_comments().

Referenced by send_ogg_buf().

◆ read_ogg_packet()

static int read_ogg_packet ( demux_ogg_t this)
static

◆ send_header()

static void send_header ( demux_ogg_t this)
static

◆ send_ogg_buf()

static void send_ogg_buf ( demux_ogg_t this,
ogg_packet *  op,
int  stream_num,
uint32_t  decoder_flags 
)
static

◆ update_chapter_display()

static void update_chapter_display ( demux_ogg_t this,
int  stream_num,
ogg_packet *  op 
)
static

Variable Documentation

◆ metadata

const struct ogg_meta metadata[]
static
Initial value:
= {
{ "ALBUM""=", XINE_META_INFO_ALBUM , 0 },
{ "ARTIST""=", XINE_META_INFO_ARTIST , 0 },
{ "PUBLISHER""=", XINE_META_INFO_PUBLISHER , 0 },
{ "COPYRIGHT""=", XINE_META_INFO_COPYRIGHT , 0 },
{ "DISCNUMBER""=", XINE_META_INFO_DISCNUMBER , 0 },
{ "LICENSE""=", XINE_META_INFO_LICENSE , 0 },
{ "TITLE""=", XINE_META_INFO_TITLE , 0 },
{ "TRACKNUMBER""=", XINE_META_INFO_TRACK_NUMBER , 0 },
{ "COMPOSER""=", XINE_META_INFO_COMPOSER , 1 },
{ "ARRANGER""=", XINE_META_INFO_ARRANGER , 1 },
{ "LYRICIST""=", XINE_META_INFO_LYRICIST , 1 },
{ "AUTHOR""=", XINE_META_INFO_AUTHOR , 1 },
{ "CONDUCTOR""=", XINE_META_INFO_CONDUCTOR , 1 },
{ "PERFORMER""=", XINE_META_INFO_PERFORMER , 1 },
{ "ENSEMBLE""=", XINE_META_INFO_ENSEMBLE , 1 },
{ "OPUS""=", XINE_META_INFO_OPUS , 0 },
{ "PART""=", XINE_META_INFO_PART , 0 },
{ "PARTNUMBER""=", XINE_META_INFO_PARTNUMBER , 0 },
{ "GENRE""=", XINE_META_INFO_GENRE , 1 },
{ "DATE""=", XINE_META_INFO_YEAR , 1 },
{ "LOCATION""=", XINE_META_INFO_LOCATION , 0 },
{ "COMMENT""=", XINE_META_INFO_COMMENT , 0 },
}
#define XINE_META_INFO_ARTIST
Definition: xine.h:1064
#define XINE_META_INFO_AUTHOR
Definition: xine.h:1081
#define XINE_META_INFO_COPYRIGHT
Definition: xine.h:1077
#define XINE_META_INFO_COMMENT
Definition: xine.h:1063
#define XINE_META_INFO_LOCATION
Definition: xine.h:1088
#define XINE_META_INFO_PARTNUMBER
Definition: xine.h:1087
#define XINE_META_INFO_CONDUCTOR
Definition: xine.h:1082
#define XINE_META_INFO_TRACK_NUMBER
Definition: xine.h:1073
#define XINE_META_INFO_LICENSE
Definition: xine.h:1078
#define XINE_META_INFO_OPUS
Definition: xine.h:1085
#define XINE_META_INFO_ALBUM
Definition: xine.h:1066
#define XINE_META_INFO_LYRICIST
Definition: xine.h:1080
#define XINE_META_INFO_PART
Definition: xine.h:1086
#define XINE_META_INFO_ARRANGER
Definition: xine.h:1079
#define XINE_META_INFO_COMPOSER
Definition: xine.h:1074
#define XINE_META_INFO_PERFORMER
Definition: xine.h:1083
#define XINE_META_INFO_TITLE
Definition: xine.h:1062
#define XINE_META_INFO_DISCNUMBER
Definition: xine.h:1090
#define XINE_META_INFO_YEAR
Definition: xine.h:1067
#define XINE_META_INFO_PUBLISHER
Definition: xine.h:1076
#define XINE_META_INFO_GENRE
Definition: xine.h:1065
#define XINE_META_INFO_ENSEMBLE
Definition: xine.h:1084

Referenced by flac_metadata_callback(), and read_comments().