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 72 int y, month,
d,
h, minute, sec;
81 if (sscanf(
string,
"%2d%2d%2d%2d%2d%2d", &y, &month, &d, &h, &minute, &sec) != 6)
85 snprintf(datetime,
sizeof(datetime),
"%.4d-%.2d-%.2dT%.2d:%.2d:%.2d",
86 y + 2000, month, d, h, minute, sec);
91 unsigned int size,
const char *
key)
190 data[i] = data[i + 4];
207 int read_size,
ret,
offset = 0, buff_offset = 0;
227 if (ctx->
counter < read_size) {
241 if (ret < read_size - offset)
319 int64_t timestamp,
int flags)
327 seekto = timestamp / 264 * 41 / 506 * 512;
329 seekto = timestamp / 240 * ctx->
packet_size / 506 * 512;
341 ctx->
swap = !!(header[0] & 0x80);
342 offset = 2*header[1] + 2*ctx->
swap;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
ptrdiff_t const GLvoid * data
int64_t pos
byte position in stream, -1 if unknown
#define avpriv_request_sample(...)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
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.
int64_t bit_rate
Total stream bitrate in bit/s, 0 if not available.
#define DSS_AUDIO_BLOCK_HEADER_SIZE
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static void dss_skip_audio_header(AVFormatContext *s, AVPacket *pkt)
#define DSS_HEAD_OFFSET_AUTHOR
static int dss_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int dss_723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
GLsizei GLboolean const GLfloat * value
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
static int dss_read_header(AVFormatContext *s)
#define AVERROR_EOF
End of file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static const uint8_t header[24]
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.
#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
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
#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 FFmpeg, patches welcome.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static void dss_sp_byte_swap(DSSDemuxContext *ctx, uint8_t *data)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_WB16 unsigned int_TMPL byte
AVIOContext * pb
I/O context.
#define DSS_HEAD_OFFSET_ACODEC
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.
#define flags(name, subs,...)
int sample_rate
Audio only.
#define DSS_ACODEC_G723_1
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
static int dss_probe(const AVProbeData *p)
#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
Codec parameters associated with this stream.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
#define AV_CH_LAYOUT_MONO
#define MKTAG(a, b, c, d)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.