33 if (p->buf_size < 45 || memcmp(p->buf,
"1bit", 4) ||
34 !
AV_RB32(p->buf + 36) || !p->buf[44] ||
35 (p->buf[0] >= 0x10 && (
AV_RB32(p->buf + 20) < 0x80 ||
AV_RB32(p->buf + 24) < 0x80)))
105 uint32_t text_offset, data_offset, channel_assign;
128 av_dict_set(&
s->metadata,
"playback_time", playback_time, 0);
142 if (!(channel_assign & 1)) {
143 uint64_t ch_mask = 0;
145 for (
i = 1;
i < 32;
i++)
146 if ((channel_assign >>
i) & 1)
155 if (
avio_seek(pb, text_offset, SEEK_SET) >= 0) {
168 return avio_seek(pb, data_offset, SEEK_SET);
174 .p.extensions =
"wsd",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rb32(AVIOContext *s)
int avio_r8(AVIOContext *s)
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define i(width, name, range_min, range_max)
#define bit(string, value)
Public libavutil channel layout APIs header.
#define AV_CH_FRONT_RIGHT
#define AV_CH_FRONT_RIGHT_OF_CENTER
#define AV_CH_BACK_CENTER
#define AV_CH_FRONT_LEFT_OF_CENTER
#define AV_CH_FRONT_CENTER
#define AV_CH_LOW_FREQUENCY
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
Initialize a native channel layout from a bitmask indicating which channels are present.
#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_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Memory handling functions.
int nb_channels
Number of channels in this layout.
AVChannelLayout ch_layout
The channel layout and number of channels.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
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
The number of audio samples per second.
This structure contains the data a format has to probe a file.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define avpriv_request_sample(...)
char * av_timecode_make_smpte_tc_string2(char *buf, AVRational rate, uint32_t tcsmpte, int prevent_df, int skip_field)
Get the timecode string from the SMPTE timecode format.
#define AV_TIMECODE_STR_SIZE
static int wsd_probe(const AVProbeData *p)
static int wsd_to_av_channel_layoyt(AVFormatContext *s, int bit)
static int get_metadata(AVFormatContext *s, const char *const tag, const unsigned size)
static int empty_string(const char *buf, unsigned size)
static int wsd_read_header(AVFormatContext *s)