24 #include "libavcodec/avcodec.h"
26 #include "libavutil/opt.h"
39 {
"smc-interval",
"StreamMuxConfig interval.",
136 uint8_t loas_header[] =
"\x56\xe0\x00";
139 if (pkt->
size > 2 && pkt->
data[0] == 0xff && (pkt->
data[1] >> 4) == 0xf) {
140 av_log(s,
AV_LOG_ERROR,
"ADTS header detected - ADTS will not be incorrectly muxed into LATM\n");
153 for (i = 0; i <= pkt->
size-255; i+=255)
161 for (i = 0; i < pkt->
size; i++)
169 loas_header[1] |= (len >> 8) & 0x1f;
170 loas_header[2] |= len & 0xff;
183 .mime_type =
"audio/MP4A-LATM",
184 .extensions =
"latm",
190 .priv_class = &latm_muxer_class,
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const AVOption options[]
static int latm_decode_extradata(LATMContext *ctx, uint8_t *buf, int size)
static void skip_bits_long(GetBitContext *s, int n)
AVCodecContext * codec
Codec context associated with this stream.
void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
Copy the content of src to the bitstream.
void avpriv_align_put_bits(PutBitContext *s)
Pad the bitstream with zeros up to the next byte boundary.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static const AVClass latm_muxer_class
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
bitstream reader API header.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
void * priv_data
Format private data.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static void put_bits(PutBitContext *s, int n, unsigned int value)
Write up to 31 bits into a bitstream.
static int put_bits_count(PutBitContext *s)
AVStream ** streams
A list of all streams in the file.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int latm_write_packet(AVFormatContext *s, AVPacket *pkt)
static int latm_write_frame_header(AVFormatContext *s, PutBitContext *bs)
main external API structure.
AVIOContext * pb
I/O context.
static int latm_write_header(AVFormatContext *s)
Describe the class of an AVClass context structure.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Y Spectral Band Replication.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int bit_size, int sync_extension)
Parse MPEG-4 systems extradata to retrieve audio configuration.
AVOutputFormat ff_latm_muxer
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
int avpriv_copy_pce_data(PutBitContext *pb, GetBitContext *gb)
static void write_header(FFV1Context *f)
av_default_item_name
Return the context name.
This structure stores compressed data.