FFmpeg
Loading...
Searching...
No Matches
dss.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include "avio_internal.h"

Go to the source code of this file.

Data Structures

struct  DSSDemuxContext
 

Macros

#define DSS_HEAD_OFFSET_AUTHOR   0xc
 
#define DSS_AUTHOR_SIZE   16
 
#define DSS_HEAD_OFFSET_START_TIME   0x26
 
#define DSS_HEAD_OFFSET_END_TIME   0x32
 
#define DSS_TIME_SIZE   12
 
#define DSS_HEAD_OFFSET_ACODEC   0x2a4
 
#define DSS_ACODEC_DSS_SP   0x0 /* SP mode */
 
#define DSS_ACODEC_DSS_SP_VR   0x1 /* SP mode, variable rate */
 
#define DSS_ACODEC_G723_1   0x2 /* LP mode */
 
#define DSS_HEAD_OFFSET_COMMENT   0x31e
 
#define DSS_COMMENT_SIZE   64
 
#define DSS_BLOCK_SIZE   512
 
#define DSS_AUDIO_BLOCK_HEADER_SIZE   6
 
#define DSS_BLOCK_KEEP_BEFORE   2
 
#define DSS_FRAME_SIZE   42
 
#define DSS_SP_SHORT_FRAME_SIZE   9
 

Functions

static int dss_block_frames (const uint8_t *header)
 
static int dss_probe (const AVProbeData *p)
 
static int dss_read_metadata_date (AVFormatContext *s, unsigned int offset, const char *key)
 
static int dss_read_metadata_string (AVFormatContext *s, unsigned int offset, unsigned int size, const char *key)
 
static int dss_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int dss_rewind (AVFormatContext *s)
 
static int64_t dss_count_frames (AVFormatContext *s)
 
static int dss_read_header (AVFormatContext *s)
 
static int dss_seek_to (AVIOContext *pb, int64_t pos)
 
static int dss_seek_block (AVFormatContext *s, int64_t pos)
 
static int dss_read_payload (AVFormatContext *s, uint8_t *buf, int size)
 
static int dss_next_block (AVFormatContext *s)
 
static int64_t dss_frame_pos (AVFormatContext *s)
 
static void dss_sp_byte_swap (DSSDemuxContext *ctx, uint8_t *data, int size)
 
static int dss_sp_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int dss_723_1_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int dss_read_next_packet (AVFormatContext *s, AVPacket *pkt)
 
static int dss_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 
static int dss_read_close (AVFormatContext *s)
 

Variables

static const uint8_t frame_size [4] = { 24, 20, 4, 1 }
 
const FFInputFormat ff_dss_demuxer
 

Macro Definition Documentation

◆ DSS_HEAD_OFFSET_AUTHOR

#define DSS_HEAD_OFFSET_AUTHOR   0xc

Definition at line 31 of file dss.c.

Referenced by dss_read_header().

◆ DSS_AUTHOR_SIZE

#define DSS_AUTHOR_SIZE   16

Definition at line 32 of file dss.c.

Referenced by dss_read_header().

◆ DSS_HEAD_OFFSET_START_TIME

#define DSS_HEAD_OFFSET_START_TIME   0x26

Definition at line 34 of file dss.c.

◆ DSS_HEAD_OFFSET_END_TIME

#define DSS_HEAD_OFFSET_END_TIME   0x32

Definition at line 35 of file dss.c.

Referenced by dss_read_header().

◆ DSS_TIME_SIZE

#define DSS_TIME_SIZE   12

Definition at line 36 of file dss.c.

Referenced by dss_read_metadata_date().

◆ DSS_HEAD_OFFSET_ACODEC

#define DSS_HEAD_OFFSET_ACODEC   0x2a4

Definition at line 38 of file dss.c.

Referenced by dss_read_header().

◆ DSS_ACODEC_DSS_SP

#define DSS_ACODEC_DSS_SP   0x0 /* SP mode */

Definition at line 39 of file dss.c.

Referenced by dss_read_header().

◆ DSS_ACODEC_DSS_SP_VR

#define DSS_ACODEC_DSS_SP_VR   0x1 /* SP mode, variable rate */

Definition at line 40 of file dss.c.

◆ DSS_ACODEC_G723_1

#define DSS_ACODEC_G723_1   0x2 /* LP mode */

Definition at line 41 of file dss.c.

Referenced by dss_read_header(), and dss_read_packet().

◆ DSS_HEAD_OFFSET_COMMENT

#define DSS_HEAD_OFFSET_COMMENT   0x31e

Definition at line 43 of file dss.c.

Referenced by dss_read_header().

◆ DSS_COMMENT_SIZE

#define DSS_COMMENT_SIZE   64

Definition at line 44 of file dss.c.

Referenced by dss_read_header().

◆ DSS_BLOCK_SIZE

#define DSS_BLOCK_SIZE   512

◆ DSS_AUDIO_BLOCK_HEADER_SIZE

#define DSS_AUDIO_BLOCK_HEADER_SIZE   6

Definition at line 47 of file dss.c.

Referenced by dss_frame_pos(), dss_next_block(), and dss_read_payload().

◆ DSS_BLOCK_KEEP_BEFORE

#define DSS_BLOCK_KEEP_BEFORE   2

Definition at line 48 of file dss.c.

Referenced by dss_seek_block().

◆ DSS_FRAME_SIZE

#define DSS_FRAME_SIZE   42

Definition at line 49 of file dss.c.

Referenced by dss_sp_byte_swap(), and dss_sp_read_packet().

◆ DSS_SP_SHORT_FRAME_SIZE

#define DSS_SP_SHORT_FRAME_SIZE   9

Definition at line 50 of file dss.c.

Referenced by dss_sp_read_packet().

Function Documentation

◆ dss_block_frames()

static int dss_block_frames ( const uint8_t * header)
static

Definition at line 70 of file dss.c.

Referenced by dss_next_block().

◆ dss_probe()

static int dss_probe ( const AVProbeData * p)
static

Definition at line 77 of file dss.c.

◆ dss_read_metadata_date()

static int dss_read_metadata_date ( AVFormatContext * s,
unsigned int offset,
const char * key )
static

Definition at line 86 of file dss.c.

Referenced by dss_read_header().

◆ dss_read_metadata_string()

static int dss_read_metadata_string ( AVFormatContext * s,
unsigned int offset,
unsigned int size,
const char * key )
static

Definition at line 109 of file dss.c.

Referenced by dss_read_header().

◆ dss_read_packet()

static int dss_read_packet ( AVFormatContext * s,
AVPacket * pkt )
static

Definition at line 536 of file dss.c.

Referenced by dss_count_frames(), dss_read_next_packet(), and dss_read_seek().

◆ dss_rewind()

static int dss_rewind ( AVFormatContext * s)
static

Definition at line 134 of file dss.c.

Referenced by dss_count_frames(), dss_read_header(), and dss_read_seek().

◆ dss_count_frames()

static int64_t dss_count_frames ( AVFormatContext * s)
static

Definition at line 156 of file dss.c.

Referenced by dss_read_header().

◆ dss_read_header()

static int dss_read_header ( AVFormatContext * s)
static

Definition at line 186 of file dss.c.

◆ dss_seek_to()

static int dss_seek_to ( AVIOContext * pb,
int64_t pos )
static

Definition at line 257 of file dss.c.

Referenced by dss_next_block(), dss_read_payload(), and dss_seek_block().

◆ dss_seek_block()

static int dss_seek_block ( AVFormatContext * s,
int64_t pos )
static

Definition at line 274 of file dss.c.

Referenced by dss_next_block().

◆ dss_read_payload()

static int dss_read_payload ( AVFormatContext * s,
uint8_t * buf,
int size )
static

Definition at line 294 of file dss.c.

Referenced by dss_723_1_read_packet(), and dss_sp_read_packet().

◆ dss_next_block()

static int dss_next_block ( AVFormatContext * s)
static

Definition at line 336 of file dss.c.

Referenced by dss_723_1_read_packet(), and dss_sp_read_packet().

◆ dss_frame_pos()

static int64_t dss_frame_pos ( AVFormatContext * s)
static

Definition at line 400 of file dss.c.

Referenced by dss_723_1_read_packet(), and dss_sp_read_packet().

◆ dss_sp_byte_swap()

static void dss_sp_byte_swap ( DSSDemuxContext * ctx,
uint8_t * data,
int size )
static

Definition at line 413 of file dss.c.

Referenced by dss_sp_read_packet().

◆ dss_sp_read_packet()

static int dss_sp_read_packet ( AVFormatContext * s,
AVPacket * pkt )
static

Definition at line 432 of file dss.c.

Referenced by dss_read_packet().

◆ dss_723_1_read_packet()

static int dss_723_1_read_packet ( AVFormatContext * s,
AVPacket * pkt )
static

Definition at line 494 of file dss.c.

Referenced by dss_read_packet().

◆ dss_read_next_packet()

static int dss_read_next_packet ( AVFormatContext * s,
AVPacket * pkt )
static

Definition at line 548 of file dss.c.

◆ dss_read_seek()

static int dss_read_seek ( AVFormatContext * s,
int stream_index,
int64_t timestamp,
int flags )
static

Definition at line 572 of file dss.c.

◆ dss_read_close()

static int dss_read_close ( AVFormatContext * s)
static

Definition at line 616 of file dss.c.

Variable Documentation

◆ frame_size

const uint8_t frame_size[4] = { 24, 20, 4, 1 }
static

Definition at line 52 of file dss.c.

◆ ff_dss_demuxer

const FFInputFormat ff_dss_demuxer
Initial value:
= {
.p.name = "dss",
.p.long_name = NULL_IF_CONFIG_SMALL("Digital Speech Standard (DSS)"),
.p.extensions = "dss",
.p.flags = AVFMT_NO_BYTE_SEEK,
.priv_data_size = sizeof(DSSDemuxContext),
}
#define AVFMT_NO_BYTE_SEEK
Format does not allow seeking by bytes.
Definition avformat.h:508
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_probe(const AVProbeData *p)
Definition cdg.c:30
static int dss_probe(const AVProbeData *p)
Definition dss.c:77
static int dss_read_header(AVFormatContext *s)
Definition dss.c:186
static int dss_read_close(AVFormatContext *s)
Definition dss.c:616
static int dss_read_next_packet(AVFormatContext *s, AVPacket *pkt)
Definition dss.c:548
static int dss_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition dss.c:572
static int read_header(FFV1Context *f, RangeCoder *c)
Definition ffv1dec.c:580
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:97
static av_cold int read_close(AVFormatContext *ctx)
Definition libcdio.c:143
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition libcdio.c:151

Definition at line 624 of file dss.c.