29 #define ALP_TAG MKTAG('A', 'L', 'P', ' ')
30 #define ALP_MAX_READ_SIZE 4096
52 #if CONFIG_ALP_DEMUXER
62 if (
i != 8 &&
i != 12)
65 if (strncmp(
"ADPCM", p->
buf + 8, 6) != 0)
89 else if (ret !=
sizeof(hdr->
adpcm))
92 if (strncmp(
"ADPCM", hdr->
adpcm,
sizeof(hdr->
adpcm)) != 0)
191 if (
s->nb_streams != 1) {
196 par =
s->streams[0]->codecpar;
239 static const AVOption alp_options[] = {
242 .help =
"set file type",
253 .help =
"autodetect based on file extension",
264 .help =
"force .tun, used for music",
275 .help =
"force .pcm, used for sfx",
287 static const AVClass alp_muxer_class = {
290 .option = alp_options,
297 .extensions =
"tun,pcm",
300 .init = alp_write_init,
301 .write_header = alp_write_header,
303 .priv_class = &alp_muxer_class,
#define ALP_MAX_READ_SIZE
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
void avio_wl32(AVIOContext *s, unsigned int val)
void avio_w8(AVIOContext *s, int b)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
unsigned int avio_rl32(AVIOContext *s)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
int avio_r8(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
static int read_header(FFV1Context *f)
#define AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_STEREO
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
@ AV_CODEC_ID_ADPCM_IMA_ALP
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
int av_match_ext(const char *filename, const char *extensions)
Return a positive value if the given filename has one of the given extensions, 0 otherwise.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_SAMPLE_FMT_S16
signed 16 bits
#define LIBAVUTIL_VERSION_INT
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)
#define AV_OPT_FLAG_AUDIO_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Describe the class of an AVClass context structure.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
This struct describes the properties of an encoded stream.
uint64_t channel_layout
Audio only.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
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.
int block_align
Audio only.
int bits_per_raw_sample
This is the number of valid bits in each output sample.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
Audio only.
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 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.
#define avpriv_request_sample(...)