30 #define DSS_HEAD_OFFSET_AUTHOR 0xc 31 #define DSS_AUTHOR_SIZE 16 33 #define DSS_HEAD_OFFSET_START_TIME 0x26 34 #define DSS_HEAD_OFFSET_END_TIME 0x32 35 #define DSS_TIME_SIZE 12 37 #define DSS_HEAD_OFFSET_ACODEC 0x2a4 38 #define DSS_ACODEC_DSS_SP 0x0 39 #define DSS_ACODEC_G723_1 0x2 41 #define DSS_HEAD_OFFSET_COMMENT 0x31e 42 #define DSS_COMMENT_SIZE 64 44 #define DSS_BLOCK_SIZE 512 45 #define DSS_HEADER_SIZE (DSS_BLOCK_SIZE * 2) 46 #define DSS_AUDIO_BLOCK_HEADER_SIZE 6 47 #define DSS_FRAME_SIZE 42 72 int y, month, d, h, minute, sec;
81 sscanf(
string,
"%2d%2d%2d%2d%2d%2d", &y, &month, &d, &h, &minute, &sec);
84 snprintf(datetime,
sizeof(datetime),
"%.4d-%.2d-%.2dT%.2d:%.2d:%.2d",
85 y + 2000, month, d, h, minute, sec);
90 unsigned int size,
const char *key)
195 for (i = 0; i < DSS_FRAME_SIZE - 2; i += 2)
212 int read_size, ret, offset = 0, buff_offset = 0;
235 int size2 = ctx->
counter + read_size;
239 if (ret < size2 - offset)
248 if (ret < read_size - offset)
253 if (pkt->
data[0] == 0xff)
266 int size, byte, ret, offset;
296 if (ret < size2 - offset) {
306 if (ret < size - offset) {
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t pos
byte position in stream, -1 if unknown
AVInputFormat ff_dss_demuxer
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define DSS_AUDIO_BLOCK_HEADER_SIZE
static void dss_skip_audio_header(AVFormatContext *s, AVPacket *pkt)
Macro definitions for various function/variable attributes.
#define DSS_HEAD_OFFSET_AUTHOR
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
static int dss_723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
static int dss_read_close(AVFormatContext *s)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
static int dss_read_header(AVFormatContext *s)
#define AVERROR_EOF
End of file.
static av_cold int read_close(AVFormatContext *ctx)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
uint64_t channel_layout
Audio only.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
AVDictionary * metadata
Metadata that applies to the whole file.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
static int dss_sp_read_packet(AVFormatContext *s, AVPacket *pkt)
static int dss_read_packet(AVFormatContext *s, AVPacket *pkt)
int avio_r8(AVIOContext *s)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
audio channel layout utility functions
#define DSS_HEAD_OFFSET_END_TIME
static int dss_probe(AVProbeData *p)
static void dss_sp_byte_swap(DSSDemuxContext *ctx, uint8_t *dst, const uint8_t *src)
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
#define DSS_HEAD_OFFSET_COMMENT
static int dss_read_metadata_string(AVFormatContext *s, unsigned int offset, unsigned int size, const char *key)
static int read_header(FFV1Context *f)
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
AVIOContext * pb
I/O context.
#define DSS_HEAD_OFFSET_ACODEC
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
static const uint8_t frame_size[4]
This structure contains the data a format has to probe a file.
int sample_rate
Audio only.
#define DSS_ACODEC_G723_1
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
#define DSS_ACODEC_DSS_SP
void * priv_data
Format private data.
static int dss_read_metadata_date(AVFormatContext *s, unsigned int offset, const char *key)
AVCodecParameters * codecpar
#define AV_CH_LAYOUT_MONO
#define MKTAG(a, b, c, d)
This structure stores compressed data.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...