xine-lib 1.2.13-20230125hg15249
|
#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) |
Functions | |
static void | check_newpts (demux_flv_t *this, int64_t pts, int video) |
static _k_t | key_num (const char *key, uint32_t klen) |
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) ) |
Referenced by check_newpts(), and seek_flv_file().
#define BE_F64 | ( | buf | ) |
Referenced by parse_amf().
#define FLV_FLAG_HAS_AUDIO 0x04 |
Referenced by demux_flv_send_headers(), and open_plugin().
#define FLV_FLAG_HAS_VIDEO 0x01 |
Referenced by demux_flv_send_headers(), and open_plugin().
#define FLV_TAG_TYPE_AUDIO 0x08 |
Referenced by read_flv_packet(), and seek_flv_file().
#define FLV_TAG_TYPE_NOTIFY 0x12 |
Referenced by read_flv_packet().
#define FLV_TAG_TYPE_VIDEO 0x09 |
Referenced by read_flv_packet(), and seek_flv_file().
#define GETBYTES | ( | n | ) |
Referenced by read_flv_packet().
#define gettimestamp | ( | p, | |
o ) (((((((uint32_t)p[o+3]<<8)|p[o])<<8)|p[o+1])<<8)|p[o+2]) |
Referenced by read_flv_packet(), and seek_flv_file().
#define IS_PCM | ( | id | ) | ((((1<<AF_PCM_BE)|(1<<AF_ADPCM)|(1<<AF_PCM_LE)|(1<<AF_ALAW)|(1<<AF_MULAW))>>(id))&1) |
Referenced by read_flv_packet().
#define LOG_MODULE "demux_flv" |
#define LOG_VERBOSE |
#define MAX_AMF_LEVELS 10 |
Referenced by parse_amf().
#define NEEDBYTES | ( | n | ) | if ((unsigned long int)(end - p) < n) return 0 |
Referenced by parse_amf().
#define PTS_AUDIO 0 |
#define PTS_VIDEO 1 |
#define SPC (space + 2 * (MAX_AMF_LEVELS - level)) |
Referenced by parse_amf().
#define TEMPBUFSIZE 4096 |
Referenced by open_plugin(), and seek_flv_file().
#define WRAP_THRESHOLD 220000 |
Referenced by check_newpts().
enum _k_t |
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 demux_plugin_s::dispose, 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 _K_audiocodecid, _K_audiodatarate, _K_audiodelay, _K_audiosamplerate, _K_audiosamplesize, _K_duration, _K_filepositions, _K_filesize, _K_height, _K_NONE, _K_onMetaData, _K_stereo, _K_times, _K_videocodecid, _K_videodatarate, _K_videoframerate, _K_width, and 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, input_plugin_s::seek, TEMPBUFSIZE, xine_stream_s::xine, XINE_VERBOSITY_LOG, and xprintf.
Referenced by demux_flv_init_class().
|
static |
References _K_audiocodecid, _K_audiodatarate, _K_audiodelay, _K_audiosamplerate, _K_audiosamplesize, _K_duration, _K_filepositions, _K_filesize, _K_height, _K_NONE, _K_stereo, _K_times, _K_videocodecid, _K_videodatarate, _K_videoframerate, _K_width, _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, type, 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().