36 #define MAX_FILENAME_SIZE 1024 215 return (ret < 0) ? ret : 0;
282 #define OFFSET(x) offsetof(WebMChunkContext, x) 299 .
name =
"webm_chunk",
301 .mime_type =
"video/webm",
311 .priv_class = &webm_chunk_class,
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
int(* io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options)
A callback for opening new IO streams.
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
static void flush(AVCodecContext *avctx)
int flush_packets
Flush the I/O context after each packet.
int av_write_frame(AVFormatContext *s, AVPacket *pkt)
Write a packet to an output media file.
static int chunk_start(AVFormatContext *s)
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
const char * av_default_item_name(void *ptr)
Return the context name.
AVFormatInternal * internal
An opaque field for libavformat internal usage.
uint64_t duration_written
#define AVIO_FLAG_WRITE
write-only
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
int strict_std_compliance
Allow non-standard and experimental extension.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define MAX_FILENAME_SIZE
static void webm_chunk_deinit(AVFormatContext *s)
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.
int flags
Flags modifying the (de)muxer behaviour.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
static const AVOption options[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
char * url
input or output URL.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
enum AVMediaType codec_type
General type of the encoded data.
int flags
A combination of AV_PKT_FLAG values.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
av_warn_unused_result int avformat_write_header(AVFormatContext *s, AVDictionary **options)
Allocate the stream private data and write the stream header to an output media file.
static int write_trailer(AVFormatContext *s1)
int avoid_negative_ts
Avoid negative timestamps during muxing.
static int webm_chunk_write_packet(AVFormatContext *s, AVPacket *pkt)
av_warn_unused_result int avformat_init_output(AVFormatContext *s, AVDictionary **options)
Allocate the stream private data and initialize the codec, but do not write the header.
int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
static const AVClass webm_chunk_class
AVIOContext * pb
I/O context.
static int webm_chunk_write_header(AVFormatContext *s)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Describe the class of an AVClass context structure.
ff_const59 AVOutputFormat * av_guess_format(const char *short_name, const char *filename, const char *mime_type)
Return the output format in the list of registered output formats which best matches the provided par...
Rational number (pair of numerator and denominator).
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
static int get_chunk_filename(AVFormatContext *s, char filename[MAX_FILENAME_SIZE])
AVOutputFormat ff_webm_chunk_muxer
static int webm_chunk_write_trailer(AVFormatContext *s)
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set that converts the value to a string and stores it...
int disposition
AV_DISPOSITION_* bit field.
int pts_wrap_bits
number of bits in pts (used for wrapping control)
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
static int chunk_end(AVFormatContext *s, int flush)
int av_write_trailer(AVFormatContext *s)
Write the stream trailer to an output media file and free the file private data.
#define AVERROR_MUXER_NOT_FOUND
Muxer not found.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
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
static int webm_chunk_init(AVFormatContext *s)
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.