25 #define MARKER_16LE 0x72F81F4E 26 #define MARKER_20LE 0x20876FF0E154 27 #define MARKER_24LE 0x72F8961F4EA5 29 #define IS_16LE_MARKER(state) ((state & 0xFFFFFFFF) == MARKER_16LE) 30 #define IS_20LE_MARKER(state) ((state & 0xF0FFFFF0FFFF) == MARKER_20LE) 31 #define IS_24LE_MARKER(state) ((state & 0xFFFFFFFFFFFF) == MARKER_24LE) 32 #define IS_LE_MARKER(state) (IS_16LE_MARKER(state) || IS_20LE_MARKER(state) || IS_24LE_MARKER(state)) 36 int data_type,
int data_size,
52 if ((data_type & 0x1F) != 0x1C) {
61 switch (data_size / word_bits) {
81 *offset *= (word_bits + 7 >> 3) * 2;
88 int markers[3] = { 0 };
89 int i, pos, sum, max, data_type, data_size,
offset;
92 for (pos = 0; pos < p->
buf_size; pos++) {
93 state = (state << 8) | p->
buf[pos];
97 buf = p->
buf + pos + 1;
120 if (markers[max] < markers[i])
124 if (markers[max] > 3 && markers[max] * 4 > sum * 3)
140 for (i = 0; i < size / 3; i++, data += 3)
148 int ret, data_type, data_size,
offset;
153 state = (state << 8) |
avio_r8(pb);
int64_t pos
byte position in stream, -1 if unknown
static void bswap_buf24(uint8_t *data, int size)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
void ff_spdif_bswap_buf16(uint16_t *dst, const uint16_t *src, int w)
int ctx_flags
Flags signalling stream properties.
#define IS_16LE_MARKER(state)
#define IS_LE_MARKER(state)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
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.
AVCodecID
Identify the syntax and semantics of the bitstream.
static int s337m_read_header(AVFormatContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int s337m_get_offset_and_codec(AVFormatContext *s, uint64_t state, int data_type, int data_size, int *offset, enum AVCodecID *codec)
enum AVMediaType codec_type
General type of the encoded data.
static const uint8_t offset[127][2]
int avio_r8(AVIOContext *s)
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
#define FF_ARRAY_ELEMS(a)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
AVIOContext * pb
I/O context.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
AVInputFormat ff_s337m_demuxer
This structure contains the data a format has to probe a file.
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
static int s337m_probe(AVProbeData *p)
static int s337m_read_packet(AVFormatContext *s, AVPacket *pkt)
unsigned int avio_rl16(AVIOContext *s)
#define IS_20LE_MARKER(state)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
#define FFSWAP(type, a, b)
unsigned int avio_rl24(AVIOContext *s)
This structure stores compressed data.