28 #define DSS_HEAD_OFFSET_AUTHOR 0xc
29 #define DSS_AUTHOR_SIZE 16
31 #define DSS_HEAD_OFFSET_START_TIME 0x26
32 #define DSS_HEAD_OFFSET_END_TIME 0x32
33 #define DSS_TIME_SIZE 12
35 #define DSS_HEAD_OFFSET_ACODEC 0x2a4
36 #define DSS_ACODEC_DSS_SP 0x0
37 #define DSS_ACODEC_G723_1 0x2
39 #define DSS_HEAD_OFFSET_COMMENT 0x31e
40 #define DSS_COMMENT_SIZE 64
42 #define DSS_BLOCK_SIZE 512
43 #define DSS_AUDIO_BLOCK_HEADER_SIZE 6
44 #define DSS_FRAME_SIZE 42
73 int y, month, d,
h, minute, sec;
82 if (sscanf(
string,
"%2d%2d%2d%2d%2d%2d", &y, &month, &d, &
h, &minute, &sec) != 6)
86 snprintf(datetime,
sizeof(datetime),
"%.4d-%.2d-%.2dT%.2d:%.2d:%.2d",
87 y + 2000, month, d,
h, minute, sec);
92 unsigned int size,
const char *
key)
165 if (
avio_seek(pb,
ctx->dss_header_size, SEEK_SET) !=
ctx->dss_header_size)
195 dst[1] =
ctx->dss_sp_swap_byte;
210 int read_size, ret,
offset = 0, buff_offset = 0;
213 if (
ctx->counter == 0)
233 if (
ctx->counter < read_size) {
236 if (ret < ctx->counter)
242 ctx->counter -= read_size;
246 if (ret < read_size -
offset)
251 if (
ctx->dss_sp_swap_byte < 0) {
268 if (
ctx->counter == 0)
296 if (ret < ctx->counter)
324 int64_t timestamp,
int flags)
332 seekto = timestamp / 264 * 41 / 506 * 512;
339 seekto +=
ctx->dss_header_size;
357 ctx->dss_sp_swap_byte = -1;
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int avio_r8(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
audio channel layout utility functions
#define MKTAG(a, b, c, d)
AVInputFormat ff_dss_demuxer
#define DSS_ACODEC_G723_1
static int dss_sp_read_packet(AVFormatContext *s, AVPacket *pkt)
static int dss_read_metadata_string(AVFormatContext *s, unsigned int offset, unsigned int size, const char *key)
#define DSS_HEAD_OFFSET_ACODEC
static int dss_probe(const AVProbeData *p)
static void dss_sp_byte_swap(DSSDemuxContext *ctx, uint8_t *dst, const uint8_t *src)
#define DSS_HEAD_OFFSET_END_TIME
static void dss_skip_audio_header(AVFormatContext *s, AVPacket *pkt)
static int dss_read_header(AVFormatContext *s)
#define DSS_HEAD_OFFSET_COMMENT
static int dss_read_packet(AVFormatContext *s, AVPacket *pkt)
static const uint8_t frame_size[4]
#define DSS_HEAD_OFFSET_AUTHOR
static int dss_723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
#define DSS_AUDIO_BLOCK_HEADER_SIZE
#define DSS_ACODEC_DSS_SP
static int dss_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int dss_read_metadata_date(AVFormatContext *s, unsigned int offset, const char *key)
static int read_header(FFV1Context *f)
#define AV_CH_LAYOUT_MONO
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
static const uint8_t header[24]
uint64_t channel_layout
Audio only.
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
Audio only.
AVCodec * audio_codec
Forced audio codec.
This structure stores compressed data.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t pos
byte position in stream, -1 if unknown
This structure contains the data a format has to probe a file.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
int8_t dss_sp_buf[DSS_FRAME_SIZE+1]
#define avpriv_request_sample(...)
static const uint8_t offset[127][2]