xine-lib 1.2.13-20230125hg15249
|
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include "group_video.h"
#include <xine/xine_internal.h>
#include <xine/demux.h>
#include <xine/xineutils.h>
#include "bswap.h"
Data Structures | |
struct | demux_mpeg_s |
Macros | |
#define | LOG_MODULE "demux_mpeg" |
#define | LOG_VERBOSE |
#define | NUM_PREVIEW_BUFFERS 150 |
#define | SCRATCH_SIZE 256 |
#define | WRAP_THRESHOLD 120000 |
#define | PTS_AUDIO 0 |
#define | PTS_VIDEO 1 |
#define | QT_ATOM BE_FOURCC |
#define | FREE_ATOM QT_ATOM('f', 'r', 'e', 'e') |
#define | JUNK_ATOM QT_ATOM('j', 'u', 'n', 'k') |
#define | MDAT_ATOM QT_ATOM('m', 'd', 'a', 't') |
#define | MOOV_ATOM QT_ATOM('m', 'o', 'o', 'v') |
#define | PNOT_ATOM QT_ATOM('p', 'n', 'o', 't') |
#define | SKIP_ATOM QT_ATOM('s', 'k', 'i', 'p') |
#define | WIDE_ATOM QT_ATOM('w', 'i', 'd', 'e') |
#define | ATOM_PREAMBLE_SIZE 8 |
#define | FOURCC_TAG BE_FOURCC |
#define | RIFF_TAG FOURCC_TAG('R', 'I', 'F', 'F') |
#define | WAVE_TAG FOURCC_TAG('W', 'A', 'V', 'E') |
#define | AVI_TAG FOURCC_TAG('A', 'V', 'I', ' ') |
#define | FOURXM_TAG FOURCC_TAG('4', 'X', 'M', 'V') |
#define | RIFF_CHECK_KILOBYTES 1024 |
#define | MPEG_MARKER FOURCC_TAG( 0x00, 0x00, 0x01, 0xBA ) |
#define | abs(x) ( ((x)<0) ? -(x) : (x) ) |
Typedefs | |
typedef struct demux_mpeg_s | demux_mpeg_t |
Functions | |
static void | find_mdat_atom (input_plugin_t *input, off_t *mdat_offset, int64_t *mdat_size) |
static void | reset_track_map (fifo_buffer_t *fifo) |
static uint32_t | read_bytes (demux_mpeg_t *this, uint32_t n) |
static void | check_newpts (demux_mpeg_t *this, int64_t pts, int video) |
static int | mpeg1_read_pts (demux_mpeg_t *this, int64_t *pts, uint32_t leadbyte) |
static int | mpeg2_read_pts (demux_mpeg_t *this, int64_t *pts) |
static int64_t | mpeg_get_pts (const uint8_t *p) |
static void | parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr) |
static void | parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, int64_t scr) |
static uint32_t | parse_pack (demux_mpeg_t *this) |
static uint32_t | parse_pack_preview (demux_mpeg_t *this, int *num_buffers) |
static void | demux_mpeg_resync (demux_mpeg_t *this, uint32_t buf) |
static int | demux_mpeg_send_chunk (demux_plugin_t *this_gen) |
static int | demux_mpeg_get_status (demux_plugin_t *this_gen) |
static void | demux_mpeg_send_headers (demux_plugin_t *this_gen) |
static int | demux_mpeg_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing) |
static int | demux_mpeg_get_stream_length (demux_plugin_t *this_gen) |
static uint32_t | demux_mpeg_get_capabilities (demux_plugin_t *this_gen) |
static int | demux_mpeg_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_mpeg_init_class (xine_t *xine, const void *data) |
#define abs | ( | x | ) | ( ((x)<0) ? -(x) : (x) ) |
Referenced by check_newpts().
#define ATOM_PREAMBLE_SIZE 8 |
Referenced by find_mdat_atom().
#define AVI_TAG FOURCC_TAG('A', 'V', 'I', ' ') |
Referenced by open_plugin().
#define FOURCC_TAG BE_FOURCC |
#define FOURXM_TAG FOURCC_TAG('4', 'X', 'M', 'V') |
Referenced by open_plugin().
#define FREE_ATOM QT_ATOM('f', 'r', 'e', 'e') |
Referenced by find_mdat_atom().
#define JUNK_ATOM QT_ATOM('j', 'u', 'n', 'k') |
Referenced by find_mdat_atom().
#define LOG_MODULE "demux_mpeg" |
#define LOG_VERBOSE |
#define MDAT_ATOM QT_ATOM('m', 'd', 'a', 't') |
Referenced by find_mdat_atom().
Referenced by find_mdat_atom().
#define MPEG_MARKER FOURCC_TAG( 0x00, 0x00, 0x01, 0xBA ) |
Referenced by open_plugin().
#define NUM_PREVIEW_BUFFERS 150 |
Referenced by demux_mpeg_send_headers().
#define PNOT_ATOM QT_ATOM('p', 'n', 'o', 't') |
Referenced by find_mdat_atom().
#define PTS_AUDIO 0 |
Referenced by parse_mpeg1_packet(), and parse_mpeg2_packet().
#define PTS_VIDEO 1 |
Referenced by parse_mpeg1_packet(), and parse_mpeg2_packet().
#define QT_ATOM BE_FOURCC |
#define RIFF_CHECK_KILOBYTES 1024 |
Referenced by open_plugin().
#define RIFF_TAG FOURCC_TAG('R', 'I', 'F', 'F') |
Referenced by open_plugin().
#define SCRATCH_SIZE 256 |
Referenced by open_plugin().
#define SKIP_ATOM QT_ATOM('s', 'k', 'i', 'p') |
Referenced by find_mdat_atom().
#define WAVE_TAG FOURCC_TAG('W', 'A', 'V', 'E') |
Referenced by open_plugin().
#define WIDE_ATOM QT_ATOM('w', 'i', 'd', 'e') |
Referenced by find_mdat_atom().
#define WRAP_THRESHOLD 120000 |
Referenced by check_newpts().
typedef struct demux_mpeg_s demux_mpeg_t |
|
static |
References _x_demux_control_newpts(), abs, BUF_FLAG_SEEK, and WRAP_THRESHOLD.
Referenced by parse_mpeg1_packet(), and parse_mpeg2_packet().
|
static |
References DEMUX_CAP_AUDIOLANG, and DEMUX_CAP_SPULANG.
Referenced by open_plugin().
|
static |
References DEMUX_OPTIONAL_DATA_AUDIOLANG, DEMUX_OPTIONAL_DATA_SPULANG, DEMUX_OPTIONAL_SUCCESS, DEMUX_OPTIONAL_UNSUPPORTED, and NULL.
Referenced by open_plugin().
|
static |
Referenced by open_plugin().
|
static |
References input().
Referenced by open_plugin().
void * demux_mpeg_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 DEMUX_FINISHED, DEMUX_OK, input(), INPUT_IS_SEEKABLE, and read_bytes().
Referenced by demux_mpeg_seek(), demux_mpeg_send_chunk(), and demux_mpeg_send_headers().
|
static |
References _x_demux_flush_engine(), demux_mpeg_resync(), DEMUX_OK, input(), INPUT_IS_SEEKABLE, read_bytes(), and demux_plugin_s::seek.
Referenced by open_plugin().
|
static |
References demux_mpeg_resync(), and parse_pack().
Referenced by open_plugin().
|
static |
|
static |
|
static |
References DEMUX_FINISHED, input(), and v.
Referenced by parse_mpeg1_packet().
|
static |
References DEMUX_FINISHED, input(), and v.
Referenced by parse_mpeg1_packet().
|
static |
Referenced by parse_mpeg2_packet().
|
static |
References _X_BE_32, _x_demux_read_header(), AVI_TAG, xine_stream_s::content_detection_method, default_demux_plugin_dispose, DEMUX_FINISHED, demux_mpeg_get_capabilities(), demux_mpeg_get_optional_data(), demux_mpeg_get_status(), demux_mpeg_get_stream_length(), demux_mpeg_seek(), demux_mpeg_send_chunk(), demux_mpeg_send_headers(), find_mdat_atom(), FOURXM_TAG, input(), INPUT_CAP_BLOCK, INPUT_IS_SEEKABLE, lprintf, METHOD_BY_CONTENT, METHOD_BY_MRL, METHOD_EXPLICIT, MPEG_MARKER, NULL, RIFF_CHECK_KILOBYTES, RIFF_TAG, SCRATCH_SIZE, input_plugin_s::seek, and WAVE_TAG.
Referenced by demux_mpeg_init_class().
|
static |
References BUF_AUDIO_MPEG, BUF_FLAG_FRAME_END, BUF_FLAG_PREVIEW, BUF_VIDEO_MPEG, check_newpts(), buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, DEMUX_FINISHED, DEMUX_OK, buf_element_s::extra_info, buf_element_s::free_buffer, input(), extra_info_s::input_normpos, extra_info_s::input_time, lprintf, buf_element_s::max_size, mpeg1_read_pts(), mpeg2_read_pts(), buf_element_s::pts, PTS_AUDIO, PTS_VIDEO, read_bytes(), reset_track_map(), buf_element_s::size, and buf_element_s::type.
Referenced by parse_pack(), and parse_pack_preview().
|
static |
References _X_BE_16, BUF_AUDIO_A52, BUF_AUDIO_DTS, BUF_AUDIO_LPCM_BE, BUF_AUDIO_MPEG, BUF_FLAG_FRAME_END, BUF_FLAG_PREVIEW, BUF_FLAG_SPECIAL, BUF_SPECIAL_LPCM_CONFIG, BUF_SPECIAL_SPU_DVD_SUBTYPE, BUF_SPU_CVD, BUF_SPU_DVD, BUF_SPU_SVCD, BUF_VIDEO_MPEG, BUF_VIDEO_VC1, check_newpts(), buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, DEMUX_FINISHED, buf_element_s::extra_info, buf_element_s::free_buffer, input(), extra_info_s::input_normpos, extra_info_s::input_time, lprintf, buf_element_s::max_size, mpeg_get_pts(), buf_element_s::pts, PTS_AUDIO, PTS_VIDEO, reset_track_map(), buf_element_s::size, SPU_DVD_SUBTYPE_PACKAGE, buf_element_s::type, and type.
Referenced by parse_pack(), and parse_pack_preview().
|
static |
References _X_BE_32, DEMUX_FINISHED, DEMUX_OK, input(), lprintf, parse_mpeg1_packet(), parse_mpeg2_packet(), and read_bytes().
Referenced by demux_mpeg_send_chunk().
|
static |
References _X_BE_32, DEMUX_FINISHED, DEMUX_OK, input(), lprintf, parse_mpeg1_packet(), parse_mpeg2_packet(), and read_bytes().
Referenced by demux_mpeg_send_headers().
|
static |
References _x_assert, DEMUX_FINISHED, and input().
Referenced by demux_mpeg_resync(), demux_mpeg_seek(), http_plugin_read_int(), parse_mpeg1_packet(), parse_pack(), and parse_pack_preview().
|
static |
References BUF_CONTROL_RESET_TRACK_MAP, fifo_buffer_s::buffer_pool_alloc, buf_element_s::decoder_info, fifo_buffer_s::put, and buf_element_s::type.
Referenced by parse_mpeg1_packet(), and parse_mpeg2_packet().