xine-lib 1.2.11
|
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include "group_video.h"
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <xine/compat.h>
#include <xine/demux.h>
#include "bswap.h"
Data Structures | |
struct | flv_index_entry_t |
struct | demux_flv_t |
Macros | |
#define | LOG_MODULE "demux_flv" |
#define | LOG_VERBOSE |
#define | TEMPBUFSIZE 4096 |
#define | gettimestamp(p, o) (((((((uint32_t)p[o+3]<<8)|p[o])<<8)|p[o+1])<<8)|p[o+2]) |
#define | FLV_FLAG_HAS_VIDEO 0x01 |
#define | FLV_FLAG_HAS_AUDIO 0x04 |
#define | FLV_TAG_TYPE_AUDIO 0x08 |
#define | FLV_TAG_TYPE_VIDEO 0x09 |
#define | FLV_TAG_TYPE_NOTIFY 0x12 |
#define | IS_PCM(id) ((((1<<AF_PCM_BE)|(1<<AF_ADPCM)|(1<<AF_PCM_LE)|(1<<AF_ALAW)|(1<<AF_MULAW))>>(id))&1) |
#define | abs(x) ( ((x)<0) ? -(x) : (x) ) |
#define | WRAP_THRESHOLD 220000 |
#define | PTS_AUDIO 0 |
#define | PTS_VIDEO 1 |
#define | BE_F64(buf) |
#define | MAX_AMF_LEVELS 10 |
#define | SPC (space + 2 * (MAX_AMF_LEVELS - level)) |
#define | NEEDBYTES(n) if ((unsigned long int)(end - p) < n) return 0 |
#define | GETBYTES(n) |
Enumerations | |
enum | af_t { AF_PCM_BE , AF_ADPCM , AF_MP3 , AF_PCM_LE , AF_NELLY16 , AF_NELLY8 , AF_NELLY , AF_ALAW , AF_MULAW , AF_reserved9 , AF_AAC , AF_SPEEX , AF_reserved12 , AF_reserved13 , AF_MP38 , AF_DS } |
enum | vf_t { VF_reserved0 , VF_JPEG , VF_FLV1 , VF_SCREEN , VF_VP6 , VF_VP6A , VF_SCREEN2 , VF_H264 , VF_H263 , VF_MP4 , VF_reserved10 , VF_reserved11 , VF_HEVC } |
enum | amf_type_t { AMF0_NUMBER = 0x00 , AMF0_BOOLEAN = 0x01 , AMF0_STRING = 0x02 , AMF0_OBJECT = 0x03 , AMF0_MOVIECLIP = 0x04 , AMF0_NULL_VALUE = 0x05 , AMF0_UNDEFINED = 0x06 , AMF0_REFERENCE = 0x07 , AMF0_ECMA_ARRAY = 0x08 , AMF0_OBJECT_END = 0x09 , AMF0_STRICT_ARRAY = 0x0a , AMF0_DATE = 0x0b , AMF0_LONG_STRING = 0x0c , AMF0_UNSUPPORTED = 0x0d , AMF0_RECORD_SET = 0x0e , AMF0_XML_OBJECT = 0x0f , AMF0_TYPED_OBJECT = 0x10 , AMF0_AMF3 = 0x11 } |
Functions | |
static void | check_newpts (demux_flv_t *this, int64_t pts, int video) |
static unsigned int | key_num (const char *key) |
static int | parse_amf (demux_flv_t *this, unsigned char *buf, int size) |
static int | read_flv_packet (demux_flv_t *this, int preview) |
static void | seek_flv_file (demux_flv_t *this, off_t seek_pos, int seek_pts) |
static int | demux_flv_send_chunk (demux_plugin_t *this_gen) |
static void | demux_flv_send_headers (demux_plugin_t *this_gen) |
static int | demux_flv_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing) |
static void | demux_flv_dispose (demux_plugin_t *this_gen) |
static int | demux_flv_get_status (demux_plugin_t *this_gen) |
static int | demux_flv_get_stream_length (demux_plugin_t *this_gen) |
static uint32_t | demux_flv_get_capabilities (demux_plugin_t *this_gen) |
static int | demux_flv_get_optional_data (demux_plugin_t *this_gen, void *data, int data_type) |
static demux_plugin_t * | open_plugin (demux_class_t *class_gen, xine_stream_t *stream, input_plugin_t *input) |
void * | demux_flv_init_class (xine_t *xine, const void *data) |
#define abs | ( | x | ) | ( ((x)<0) ? -(x) : (x) ) |
#define BE_F64 | ( | buf | ) |
#define FLV_FLAG_HAS_AUDIO 0x04 |
#define FLV_FLAG_HAS_VIDEO 0x01 |
#define FLV_TAG_TYPE_AUDIO 0x08 |
#define FLV_TAG_TYPE_NOTIFY 0x12 |
#define FLV_TAG_TYPE_VIDEO 0x09 |
#define GETBYTES | ( | n | ) |
#define gettimestamp | ( | p, | |
o | |||
) | (((((((uint32_t)p[o+3]<<8)|p[o])<<8)|p[o+1])<<8)|p[o+2]) |
#define IS_PCM | ( | id | ) | ((((1<<AF_PCM_BE)|(1<<AF_ADPCM)|(1<<AF_PCM_LE)|(1<<AF_ALAW)|(1<<AF_MULAW))>>(id))&1) |
#define LOG_MODULE "demux_flv" |
#define LOG_VERBOSE |
#define MAX_AMF_LEVELS 10 |
#define NEEDBYTES | ( | n | ) | if ((unsigned long int)(end - p) < n) return 0 |
#define PTS_AUDIO 0 |
#define PTS_VIDEO 1 |
#define SPC (space + 2 * (MAX_AMF_LEVELS - level)) |
#define TEMPBUFSIZE 4096 |
#define WRAP_THRESHOLD 220000 |
enum af_t |
enum amf_type_t |
enum vf_t |
|
static |
References _x_demux_control_newpts(), abs, BUF_FLAG_SEEK, lprintf, and WRAP_THRESHOLD.
Referenced by read_flv_packet().
|
static |
Referenced by open_plugin().
|
static |
References DEMUX_CAP_AUDIOLANG, and DEMUX_CAP_VIDEO_TIME.
Referenced by open_plugin().
|
static |
References DEMUX_OPTIONAL_DATA_AUDIOLANG, DEMUX_OPTIONAL_DATA_VIDEO_TIME, DEMUX_OPTIONAL_SUCCESS, DEMUX_OPTIONAL_UNSUPPORTED, and NULL.
Referenced by open_plugin().
|
static |
Referenced by open_plugin().
|
static |
Referenced by open_plugin().
void * demux_flv_init_class | ( | xine_t * | xine, |
const void * | data | ||
) |
References N_, NULL, open_plugin(), and demux_class_s::open_plugin.
|
static |
References _x_demux_control_newpts(), _x_demux_flush_engine(), DEMUX_OK, input(), INPUT_IS_SEEKABLE, and seek_flv_file().
Referenced by open_plugin().
|
static |
References read_flv_packet().
Referenced by open_plugin().
|
static |
References _x_demux_control_start(), _x_stream_info_set(), DEMUX_OK, FLV_FLAG_HAS_AUDIO, FLV_FLAG_HAS_VIDEO, lprintf, read_flv_packet(), XINE_STREAM_INFO_HAS_AUDIO, and XINE_STREAM_INFO_HAS_VIDEO.
Referenced by open_plugin().
|
static |
References key.
Referenced by parse_amf().
|
static |
References _, _X_BE_32, _x_demux_read_header(), xine_stream_s::content_detection_method, DEMUX_FINISHED, demux_flv_dispose(), demux_flv_get_capabilities(), demux_flv_get_optional_data(), demux_flv_get_status(), demux_flv_get_stream_length(), demux_flv_seek(), demux_flv_send_chunk(), demux_flv_send_headers(), FLV_FLAG_HAS_AUDIO, FLV_FLAG_HAS_VIDEO, input(), lprintf, METHOD_BY_CONTENT, METHOD_BY_MRL, METHOD_EXPLICIT, NULL, TEMPBUFSIZE, xine_stream_s::xine, XINE_VERBOSITY_LOG, and xprintf.
Referenced by demux_flv_init_class().
|
static |
References _X_BE_16, _X_BE_32, _x_stream_info_set(), AF_AAC, AMF0_BOOLEAN, AMF0_DATE, AMF0_ECMA_ARRAY, AMF0_LONG_STRING, AMF0_NULL_VALUE, AMF0_NUMBER, AMF0_OBJECT, AMF0_OBJECT_END, AMF0_REFERENCE, AMF0_STRICT_ARRAY, AMF0_STRING, AMF0_UNDEFINED, AMF0_XML_OBJECT, BE_F64, height, key_num(), MAX_AMF_LEVELS, name, NEEDBYTES, NULL, SPC, VF_H264, width, XINE_STREAM_INFO_AUDIO_BITRATE, XINE_STREAM_INFO_AUDIO_BITS, XINE_STREAM_INFO_AUDIO_CHANNELS, XINE_STREAM_INFO_AUDIO_SAMPLERATE, XINE_STREAM_INFO_FRAME_DURATION, XINE_STREAM_INFO_VIDEO_BITRATE, XINE_STREAM_INFO_VIDEO_HEIGHT, XINE_STREAM_INFO_VIDEO_WIDTH, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by read_flv_packet().
|
static |
References _X_BE_32, _x_keyframes_add(), AF_AAC, AF_ADPCM, AF_ALAW, AF_MP3, AF_MP38, AF_MULAW, AF_NELLY, AF_NELLY16, AF_NELLY8, AF_PCM_BE, AF_PCM_LE, AF_SPEEX, xine_bmiheader::biHeight, xine_bmiheader::biSize, xine_bmiheader::biWidth, BUF_AUDIO_AAC, BUF_AUDIO_ALAW, BUF_AUDIO_FLVADPCM, BUF_AUDIO_LPCM_BE, BUF_AUDIO_LPCM_LE, BUF_AUDIO_MPEG, BUF_AUDIO_MULAW, BUF_AUDIO_SPEEX, BUF_AUDIO_UNKNOWN, BUF_FLAG_FRAME_END, BUF_FLAG_FRAME_START, BUF_FLAG_FRAMERATE, BUF_FLAG_HEADER, BUF_FLAG_KEYFRAME, BUF_FLAG_SPECIAL, BUF_FLAG_STDHEADER, BUF_SPECIAL_DECODER_CONFIG, buf_type, BUF_VIDEO_FLV1, BUF_VIDEO_H263, BUF_VIDEO_H264, BUF_VIDEO_HEVC, BUF_VIDEO_JPEG, BUF_VIDEO_MPEG4, BUF_VIDEO_UNKNOWN, BUF_VIDEO_VP6F, fifo_buffer_s::buffer_pool_alloc, fifo_buffer_s::buffer_pool_size_alloc, check_newpts(), buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, buf_element_s::decoder_info_ptr, DEMUX_FINISHED, DEMUX_OK, buf_element_s::extra_info, FLV_TAG_TYPE_AUDIO, FLV_TAG_TYPE_NOTIFY, FLV_TAG_TYPE_VIDEO, buf_element_s::free_buffer, GETBYTES, gettimestamp, height, input(), extra_info_s::input_normpos, extra_info_s::input_time, IS_PCM, lprintf, buf_element_s::max_size, buf_element_s::mem, xine_keyframes_entry_t::msecs, xine_keyframes_entry_t::normpos, NULL, parse_amf(), buf_element_s::pts, fifo_buffer_s::put, buf_element_s::size, buf_element_s::type, VF_FLV1, VF_H263, VF_H264, VF_HEVC, VF_JPEG, VF_MP4, VF_VP6, VF_VP6A, width, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by demux_flv_send_chunk(), and demux_flv_send_headers().
|
static |
References _, _X_BE_32, abs, FLV_TAG_TYPE_AUDIO, FLV_TAG_TYPE_VIDEO, gettimestamp, input(), now(), flv_index_entry_t::offset, flv_index_entry_t::pts, TEMPBUFSIZE, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by demux_flv_seek().