FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
matroskaenc.c File Reference
#include <stdint.h>
#include "av1.h"
#include "avc.h"
#include "hevc.h"
#include "avformat.h"
#include "avio_internal.h"
#include "avlanguage.h"
#include "flacenc.h"
#include "internal.h"
#include "isom.h"
#include "matroska.h"
#include "riff.h"
#include "vorbiscomment.h"
#include "wv.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
#include "libavutil/dict.h"
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/lfg.h"
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "libavutil/rational.h"
#include "libavutil/samplefmt.h"
#include "libavutil/stereo3d.h"
#include "libavcodec/xiph.h"
#include "libavcodec/mpeg4audio.h"

Go to the source code of this file.

Data Structures

struct  ebml_master
 
struct  ebml_stored_master
 
struct  mkv_seekhead_entry
 
struct  mkv_seekhead
 
struct  mkv_cuepoint
 
struct  mkv_cues
 
struct  mkv_track
 
struct  MatroskaMuxContext
 

Macros

#define MAX_SEEKHEAD_ENTRIES   7
 
#define IS_SEEKABLE(pb, mkv)
 
#define MODE_MATROSKAv2   0x01
 
#define MODE_WEBM   0x02
 
#define MAX_EBML_HEADER_SIZE   35
 2 bytes * 7 for EBML IDs, 7 1-byte EBML lengths, 6 1-byte uint, 8 byte for "matroska" doctype string More...
 
#define MAX_SEEKENTRY_SIZE   21
 2 bytes * 3 for EBML IDs, 3 1-byte EBML lengths, 8 bytes for 64 bit offset, 4 bytes for target EBML ID More...
 
#define MAX_CUETRACKPOS_SIZE   40
 4 * (1-byte EBML ID, 1-byte EBML size, 8-byte uint max) More...
 
#define OPUS_SEEK_PREROLL   80000000
 Seek preroll value for opus. More...
 
#define CASE(type, variable)
 
#define OFFSET(x)   offsetof(MatroskaMuxContext, x)
 
#define FLAGS   AV_OPT_FLAG_ENCODING_PARAM
 

Enumerations

enum  { DEFAULT_MODE_INFER, DEFAULT_MODE_INFER_NO_SUBS, DEFAULT_MODE_PASSTHROUGH }
 

Functions

static int ebml_id_size (uint32_t id)
 
static void put_ebml_id (AVIOContext *pb, uint32_t id)
 
static void put_ebml_size_unknown (AVIOContext *pb, int bytes)
 Write an EBML size meaning "unknown size". More...
 
static int ebml_num_size (uint64_t num)
 Returns how many bytes are needed to represent a number as EBML variable length integer. More...
 
static int ebml_length_size (uint64_t length)
 Calculate how many bytes are needed to represent the length field of an EBML element whose payload has a given length. More...
 
static void put_ebml_num (AVIOContext *pb, uint64_t num, int bytes)
 Write a number as EBML variable length integer on bytes bytes. More...
 
static void put_ebml_length (AVIOContext *pb, uint64_t length, int bytes)
 Write a length as EBML variable length integer. More...
 
static void put_ebml_uid (AVIOContext *pb, uint32_t elementid, uint64_t uid)
 Write a (random) UID with fixed size to make the output more deterministic. More...
 
static void put_ebml_uint (AVIOContext *pb, uint32_t elementid, uint64_t val)
 
static void put_ebml_sint (AVIOContext *pb, uint32_t elementid, int64_t val)
 
static void put_ebml_float (AVIOContext *pb, uint32_t elementid, double val)
 
static void put_ebml_binary (AVIOContext *pb, uint32_t elementid, const void *buf, int size)
 
static void put_ebml_string (AVIOContext *pb, uint32_t elementid, const char *str)
 
static void put_ebml_void (AVIOContext *pb, int size)
 Write a void element of a given size. More...
 
static ebml_master start_ebml_master (AVIOContext *pb, uint32_t elementid, uint64_t expectedsize)
 
static void end_ebml_master (AVIOContext *pb, ebml_master master)
 
static void mkv_add_seekhead_entry (MatroskaMuxContext *mkv, uint32_t elementid, uint64_t filepos)
 
static int start_ebml_master_crc32 (AVIOContext **dyn_cp, MatroskaMuxContext *mkv)
 
static int end_ebml_master_crc32 (AVIOContext *pb, AVIOContext **dyn_cp, MatroskaMuxContext *mkv, uint32_t id, int length_size, int keep_buffer, int add_seekentry)
 
static int end_ebml_master_crc32_tentatively (AVIOContext *pb, ebml_stored_master *elem, MatroskaMuxContext *mkv, uint32_t id)
 Output EBML master. More...
 
static void put_xiph_size (AVIOContext *pb, int size)
 
static void mkv_deinit (AVFormatContext *s)
 Free the members allocated in the mux context. More...
 
static void mkv_start_seekhead (MatroskaMuxContext *mkv, AVIOContext *pb)
 Initialize the SeekHead element to be ready to index level 1 Matroska elements. More...
 
static int mkv_write_seekhead (AVIOContext *pb, MatroskaMuxContext *mkv, int error_on_seek_failure, int64_t destpos)
 Write the SeekHead to the file at the location reserved for it and seek to destpos afterwards. More...
 
static int mkv_add_cuepoint (MatroskaMuxContext *mkv, int stream, int64_t ts, int64_t cluster_pos, int64_t relative_pos, int64_t duration)
 
static int mkv_assemble_cues (AVStream **streams, AVIOContext *dyn_cp, mkv_cues *cues, mkv_track *tracks, int num_tracks)
 
static int put_xiph_codecpriv (AVFormatContext *s, AVIOContext *pb, const AVCodecParameters *par)
 
static int put_wv_codecpriv (AVIOContext *pb, const AVCodecParameters *par)
 
static int put_flac_codecpriv (AVFormatContext *s, AVIOContext *pb, const AVCodecParameters *par)
 
static int get_aac_sample_rates (AVFormatContext *s, MatroskaMuxContext *mkv, const uint8_t *extradata, int extradata_size, int *sample_rate, int *output_sample_rate)
 
static int mkv_write_native_codecprivate (AVFormatContext *s, AVIOContext *pb, const AVCodecParameters *par, AVIOContext *dyn_cp)
 
static int mkv_write_codecprivate (AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int native_id, int qt_id)
 
static void mkv_write_video_color (AVIOContext *pb, const AVStream *st, const AVCodecParameters *par)
 
static void mkv_write_video_projection (AVFormatContext *s, AVIOContext *pb, const AVStream *st)
 
static void mkv_write_field_order (AVIOContext *pb, int mode, enum AVFieldOrder field_order)
 
static int mkv_write_stereo_mode (AVFormatContext *s, AVIOContext *pb, AVStream *st, int mode, int *h_width, int *h_height)
 
static int mkv_write_track (AVFormatContext *s, MatroskaMuxContext *mkv, AVStream *st, mkv_track *track, AVIOContext *pb, int is_default)
 
static int mkv_write_tracks (AVFormatContext *s)
 
static int mkv_write_simpletag (AVIOContext *pb, const AVDictionaryEntry *t)
 
static int mkv_write_tag_targets (MatroskaMuxContext *mkv, AVIOContext **pb, ebml_master *tag, uint32_t elementid, uint64_t uid)
 
static int mkv_check_tag_name (const char *name, uint32_t elementid)
 
static int mkv_write_tag (MatroskaMuxContext *mkv, const AVDictionary *m, AVIOContext **pb, ebml_master *tag, uint32_t elementid, uint64_t uid)
 
static int mkv_check_tag (const AVDictionary *m, uint32_t elementid)
 
static int mkv_write_tags (AVFormatContext *s)
 
static int mkv_write_chapters (AVFormatContext *s)
 
static const char * get_mimetype (const AVStream *st)
 
static int mkv_write_attachments (AVFormatContext *s)
 
static int64_t get_metadata_duration (AVFormatContext *s)
 
static int mkv_write_header (AVFormatContext *s)
 
static int mkv_blockgroup_size (int pkt_size, int track_num_size)
 
static int mkv_strip_wavpack (const uint8_t *src, uint8_t **pdst, int *size)
 
static int mkv_write_block (AVFormatContext *s, AVIOContext *pb, uint32_t blockid, const AVPacket *pkt, int keyframe)
 
static int mkv_write_vtt_blocks (AVFormatContext *s, AVIOContext *pb, const AVPacket *pkt)
 
static int mkv_end_cluster (AVFormatContext *s)
 
static int mkv_check_new_extra_data (AVFormatContext *s, const AVPacket *pkt)
 
static int mkv_write_packet_internal (AVFormatContext *s, const AVPacket *pkt)
 
static int mkv_write_packet (AVFormatContext *s, const AVPacket *pkt)
 
static int mkv_write_flush_packet (AVFormatContext *s, AVPacket *pkt)
 
static int mkv_write_trailer (AVFormatContext *s)
 
static int mkv_query_codec (enum AVCodecID codec_id, int std_compliance)
 
static int webm_query_codec (enum AVCodecID codec_id, int std_compliance)
 
static uint64_t mkv_get_uid (const mkv_track *tracks, int i, AVLFG *c)
 
static int mkv_init (struct AVFormatContext *s)
 
static int mkv_check_bitstream (struct AVFormatContext *s, const AVPacket *pkt)
 

Variables

static const AVCodecTag additional_audio_tags []
 
static const AVCodecTag additional_video_tags []
 
static const AVCodecTag additional_subtitle_tags []
 
static const AVOption options []
 

Macro Definition Documentation

#define MAX_SEEKHEAD_ENTRIES   7

Definition at line 59 of file matroskaenc.c.

Referenced by mkv_add_seekhead_entry(), and mkv_start_seekhead().

#define IS_SEEKABLE (   pb,
  mkv 
)
Value:
(((pb)->seekable & AVIO_SEEKABLE_NORMAL) && \
!(mkv)->is_live)
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition: avio.h:40

Definition at line 61 of file matroskaenc.c.

Referenced by end_ebml_master_crc32_tentatively(), get_aac_sample_rates(), mkv_write_header(), mkv_write_packet_internal(), mkv_write_tags(), and mkv_write_trailer().

#define MODE_MATROSKAv2   0x01

Definition at line 120 of file matroskaenc.c.

Referenced by mkv_init().

#define MODE_WEBM   0x02
#define MAX_EBML_HEADER_SIZE   35

2 bytes * 7 for EBML IDs, 7 1-byte EBML lengths, 6 1-byte uint, 8 byte for "matroska" doctype string

Definition at line 164 of file matroskaenc.c.

Referenced by mkv_write_header().

#define MAX_SEEKENTRY_SIZE   21

2 bytes * 3 for EBML IDs, 3 1-byte EBML lengths, 8 bytes for 64 bit offset, 4 bytes for target EBML ID

Definition at line 168 of file matroskaenc.c.

Referenced by mkv_start_seekhead(), and mkv_write_seekhead().

#define MAX_CUETRACKPOS_SIZE   40

4 * (1-byte EBML ID, 1-byte EBML size, 8-byte uint max)

Definition at line 171 of file matroskaenc.c.

Referenced by mkv_assemble_cues().

#define OPUS_SEEK_PREROLL   80000000

Seek preroll value for opus.

Definition at line 174 of file matroskaenc.c.

Referenced by mkv_write_track().

#define CASE (   type,
  variable 
)
Value:
case AVMEDIA_TYPE_ ## type: \
variable ## _idx = i; \
if (st->disposition & AV_DISPOSITION_DEFAULT) \
variable ## _default_idx = i; \
break;
GLint GLenum type
Definition: opengl_enc.c:104
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
if(ret)
#define AV_DISPOSITION_DEFAULT
Definition: avformat.h:821

Referenced by mkv_write_tracks().

#define OFFSET (   x)    offsetof(MatroskaMuxContext, x)

Definition at line 2780 of file matroskaenc.c.

#define FLAGS   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 2781 of file matroskaenc.c.

Enumeration Type Documentation

anonymous enum
Enumerator
DEFAULT_MODE_INFER 
DEFAULT_MODE_INFER_NO_SUBS 
DEFAULT_MODE_PASSTHROUGH 

Definition at line 64 of file matroskaenc.c.

Function Documentation

static int ebml_id_size ( uint32_t  id)
static

Definition at line 176 of file matroskaenc.c.

Referenced by mkv_write_seekhead(), and put_ebml_id().

static void put_ebml_id ( AVIOContext pb,
uint32_t  id 
)
static
static void put_ebml_size_unknown ( AVIOContext pb,
int  bytes 
)
static

Write an EBML size meaning "unknown size".

Parameters
bytesThe number of bytes the size should occupy (maximum: 8).

Definition at line 193 of file matroskaenc.c.

Referenced by mkv_write_header(), and start_ebml_master().

static int ebml_num_size ( uint64_t  num)
static

Returns how many bytes are needed to represent a number as EBML variable length integer.

Definition at line 204 of file matroskaenc.c.

Referenced by ebml_length_size(), and mkv_init().

static int ebml_length_size ( uint64_t  length)
static

Calculate how many bytes are needed to represent the length field of an EBML element whose payload has a given length.

Definition at line 217 of file matroskaenc.c.

Referenced by mkv_blockgroup_size(), mkv_write_trailer(), put_ebml_length(), and start_ebml_master().

static void put_ebml_num ( AVIOContext pb,
uint64_t  num,
int  bytes 
)
static

Write a number as EBML variable length integer on bytes bytes.

bytes is taken literally without checking.

Definition at line 226 of file matroskaenc.c.

Referenced by mkv_write_block(), mkv_write_vtt_blocks(), and put_ebml_length().

static void put_ebml_length ( AVIOContext pb,
uint64_t  length,
int  bytes 
)
static

Write a length as EBML variable length integer.

Parameters
bytesThe number of bytes that need to be used to write the number. If zero, the minimal number of bytes will be used.

Definition at line 239 of file matroskaenc.c.

Referenced by end_ebml_master(), end_ebml_master_crc32(), end_ebml_master_crc32_tentatively(), mkv_write_block(), mkv_write_seekhead(), mkv_write_trailer(), mkv_write_vtt_blocks(), put_ebml_binary(), put_ebml_float(), put_ebml_sint(), put_ebml_uid(), put_ebml_uint(), and put_ebml_void().

static void put_ebml_uid ( AVIOContext pb,
uint32_t  elementid,
uint64_t  uid 
)
static

Write a (random) UID with fixed size to make the output more deterministic.

Definition at line 257 of file matroskaenc.c.

Referenced by mkv_write_attachments(), mkv_write_tag_targets(), and mkv_write_track().

static void put_ebml_uint ( AVIOContext pb,
uint32_t  elementid,
uint64_t  val 
)
static
static void put_ebml_sint ( AVIOContext pb,
uint32_t  elementid,
int64_t  val 
)
static

Definition at line 277 of file matroskaenc.c.

Referenced by mkv_write_block().

static void put_ebml_float ( AVIOContext pb,
uint32_t  elementid,
double  val 
)
static
static void put_ebml_binary ( AVIOContext pb,
uint32_t  elementid,
const void buf,
int  size 
)
static
static void put_ebml_string ( AVIOContext pb,
uint32_t  elementid,
const char *  str 
)
static
static void put_ebml_void ( AVIOContext pb,
int  size 
)
static

Write a void element of a given size.

Useful for reserving space in the file to be written to later.

Parameters
sizeThe number of bytes to reserve, which must be at least 2.

Definition at line 318 of file matroskaenc.c.

Referenced by mkv_check_new_extra_data(), mkv_start_seekhead(), mkv_write_header(), mkv_write_native_codecprivate(), mkv_write_seekhead(), mkv_write_tags(), mkv_write_trailer(), and start_ebml_master_crc32().

static ebml_master start_ebml_master ( AVIOContext pb,
uint32_t  elementid,
uint64_t  expectedsize 
)
static
static void end_ebml_master ( AVIOContext pb,
ebml_master  master 
)
static
static void mkv_add_seekhead_entry ( MatroskaMuxContext mkv,
uint32_t  elementid,
uint64_t  filepos 
)
static

Definition at line 356 of file matroskaenc.c.

Referenced by end_ebml_master_crc32(), and end_ebml_master_crc32_tentatively().

static int start_ebml_master_crc32 ( AVIOContext **  dyn_cp,
MatroskaMuxContext mkv 
)
static
static int end_ebml_master_crc32 ( AVIOContext pb,
AVIOContext **  dyn_cp,
MatroskaMuxContext mkv,
uint32_t  id,
int  length_size,
int  keep_buffer,
int  add_seekentry 
)
static
static int end_ebml_master_crc32_tentatively ( AVIOContext pb,
ebml_stored_master elem,
MatroskaMuxContext mkv,
uint32_t  id 
)
static

Output EBML master.

Keep the buffer if seekable, allowing for later updates. Furthermore always add a SeekHead Entry for this element.

Definition at line 417 of file matroskaenc.c.

Referenced by mkv_write_header(), mkv_write_tags(), and mkv_write_tracks().

static void put_xiph_size ( AVIOContext pb,
int  size 
)
static

Definition at line 440 of file matroskaenc.c.

Referenced by put_xiph_codecpriv().

static void mkv_deinit ( AVFormatContext s)
static

Free the members allocated in the mux context.

Definition at line 449 of file matroskaenc.c.

static void mkv_start_seekhead ( MatroskaMuxContext mkv,
AVIOContext pb 
)
static

Initialize the SeekHead element to be ready to index level 1 Matroska elements.

Enough space to write MAX_SEEKHEAD_ENTRIES SeekHead entries will be reserved at the current file location.

Definition at line 469 of file matroskaenc.c.

Referenced by mkv_write_header().

static int mkv_write_seekhead ( AVIOContext pb,
MatroskaMuxContext mkv,
int  error_on_seek_failure,
int64_t  destpos 
)
static

Write the SeekHead to the file at the location reserved for it and seek to destpos afterwards.

When error_on_seek_failure is not set, failure to seek to the position designated for the SeekHead is not considered an error and it is presumed that destpos is the current position; failure to seek to destpos afterwards is always an error.

Returns
0 on success, < 0 on error.

Definition at line 489 of file matroskaenc.c.

Referenced by mkv_write_header(), and mkv_write_trailer().

static int mkv_add_cuepoint ( MatroskaMuxContext mkv,
int  stream,
int64_t  ts,
int64_t  cluster_pos,
int64_t  relative_pos,
int64_t  duration 
)
static

Definition at line 530 of file matroskaenc.c.

Referenced by mkv_write_packet_internal().

static int mkv_assemble_cues ( AVStream **  streams,
AVIOContext dyn_cp,
mkv_cues cues,
mkv_track tracks,
int  num_tracks 
)
static

Definition at line 553 of file matroskaenc.c.

Referenced by mkv_write_trailer().

static int put_xiph_codecpriv ( AVFormatContext s,
AVIOContext pb,
const AVCodecParameters par 
)
static

Definition at line 602 of file matroskaenc.c.

Referenced by mkv_write_native_codecprivate().

static int put_wv_codecpriv ( AVIOContext pb,
const AVCodecParameters par 
)
static

Definition at line 632 of file matroskaenc.c.

Referenced by mkv_write_native_codecprivate().

static int put_flac_codecpriv ( AVFormatContext s,
AVIOContext pb,
const AVCodecParameters par 
)
static

Definition at line 641 of file matroskaenc.c.

Referenced by mkv_write_native_codecprivate().

static int get_aac_sample_rates ( AVFormatContext s,
MatroskaMuxContext mkv,
const uint8_t extradata,
int  extradata_size,
int sample_rate,
int output_sample_rate 
)
static

Definition at line 677 of file matroskaenc.c.

Referenced by mkv_check_new_extra_data(), and mkv_write_track().

static int mkv_write_native_codecprivate ( AVFormatContext s,
AVIOContext pb,
const AVCodecParameters par,
AVIOContext dyn_cp 
)
static

Definition at line 710 of file matroskaenc.c.

Referenced by mkv_write_codecprivate().

static int mkv_write_codecprivate ( AVFormatContext s,
AVIOContext pb,
AVCodecParameters par,
int  native_id,
int  qt_id 
)
static

Definition at line 762 of file matroskaenc.c.

Referenced by mkv_check_new_extra_data(), and mkv_write_track().

static void mkv_write_video_color ( AVIOContext pb,
const AVStream st,
const AVCodecParameters par 
)
static

Definition at line 831 of file matroskaenc.c.

Referenced by mkv_write_track().

static void mkv_write_video_projection ( AVFormatContext s,
AVIOContext pb,
const AVStream st 
)
static

Definition at line 916 of file matroskaenc.c.

Referenced by mkv_write_track().

static void mkv_write_field_order ( AVIOContext pb,
int  mode,
enum AVFieldOrder  field_order 
)
static

Definition at line 983 of file matroskaenc.c.

Referenced by mkv_write_track().

static int mkv_write_stereo_mode ( AVFormatContext s,
AVIOContext pb,
AVStream st,
int  mode,
int h_width,
int h_height 
)
static

Definition at line 1022 of file matroskaenc.c.

Referenced by mkv_write_track().

static int mkv_write_track ( AVFormatContext s,
MatroskaMuxContext mkv,
AVStream st,
mkv_track track,
AVIOContext pb,
int  is_default 
)
static

Definition at line 1113 of file matroskaenc.c.

Referenced by mkv_write_tracks().

static int mkv_write_tracks ( AVFormatContext s)
static

Definition at line 1376 of file matroskaenc.c.

Referenced by mkv_write_header().

static int mkv_write_simpletag ( AVIOContext pb,
const AVDictionaryEntry t 
)
static

Definition at line 1434 of file matroskaenc.c.

Referenced by mkv_write_tag().

static int mkv_write_tag_targets ( MatroskaMuxContext mkv,
AVIOContext **  pb,
ebml_master tag,
uint32_t  elementid,
uint64_t  uid 
)
static

Definition at line 1468 of file matroskaenc.c.

Referenced by mkv_write_tag().

static int mkv_check_tag_name ( const char *  name,
uint32_t  elementid 
)
static

Definition at line 1488 of file matroskaenc.c.

Referenced by mkv_check_tag(), and mkv_write_tag().

static int mkv_write_tag ( MatroskaMuxContext mkv,
const AVDictionary m,
AVIOContext **  pb,
ebml_master tag,
uint32_t  elementid,
uint64_t  uid 
)
static

Definition at line 1502 of file matroskaenc.c.

Referenced by mkv_write_chapters(), and mkv_write_tags().

static int mkv_check_tag ( const AVDictionary m,
uint32_t  elementid 
)
static

Definition at line 1528 of file matroskaenc.c.

Referenced by mkv_write_chapters(), and mkv_write_tags().

static int mkv_write_tags ( AVFormatContext s)
static

Definition at line 1539 of file matroskaenc.c.

Referenced by mkv_write_header().

static int mkv_write_chapters ( AVFormatContext s)
static

Definition at line 1612 of file matroskaenc.c.

Referenced by mkv_write_header(), and mkv_write_trailer().

static const char* get_mimetype ( const AVStream st)
static

Definition at line 1699 of file matroskaenc.c.

Referenced by mkv_init(), and mkv_write_attachments().

static int mkv_write_attachments ( AVFormatContext s)
static

Definition at line 1716 of file matroskaenc.c.

Referenced by mkv_write_header().

static int64_t get_metadata_duration ( AVFormatContext s)
static

Definition at line 1760 of file matroskaenc.c.

Referenced by mkv_write_header().

static int mkv_write_header ( AVFormatContext s)
static

Definition at line 1784 of file matroskaenc.c.

static int mkv_blockgroup_size ( int  pkt_size,
int  track_num_size 
)
static

Definition at line 1941 of file matroskaenc.c.

Referenced by mkv_write_packet_internal(), and mkv_write_vtt_blocks().

static int mkv_strip_wavpack ( const uint8_t src,
uint8_t **  pdst,
int size 
)
static

Definition at line 1950 of file matroskaenc.c.

Referenced by mkv_write_block().

static int mkv_write_block ( AVFormatContext s,
AVIOContext pb,
uint32_t  blockid,
const AVPacket pkt,
int  keyframe 
)
static

Definition at line 2003 of file matroskaenc.c.

Referenced by mkv_write_packet_internal().

static int mkv_write_vtt_blocks ( AVFormatContext s,
AVIOContext pb,
const AVPacket pkt 
)
static

Definition at line 2115 of file matroskaenc.c.

Referenced by mkv_write_packet_internal().

static int mkv_end_cluster ( AVFormatContext s)
static
static int mkv_check_new_extra_data ( AVFormatContext s,
const AVPacket pkt 
)
static

Definition at line 2179 of file matroskaenc.c.

Referenced by mkv_write_packet().

static int mkv_write_packet_internal ( AVFormatContext s,
const AVPacket pkt 
)
static

Definition at line 2269 of file matroskaenc.c.

Referenced by mkv_write_packet(), and mkv_write_trailer().

static int mkv_write_packet ( AVFormatContext s,
const AVPacket pkt 
)
static

Definition at line 2361 of file matroskaenc.c.

Referenced by mkv_write_flush_packet().

static int mkv_write_flush_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 2435 of file matroskaenc.c.

static int mkv_write_trailer ( AVFormatContext s)
static

Definition at line 2453 of file matroskaenc.c.

static int mkv_query_codec ( enum AVCodecID  codec_id,
int  std_compliance 
)
static

Definition at line 2609 of file matroskaenc.c.

static int webm_query_codec ( enum AVCodecID  codec_id,
int  std_compliance 
)
static

Definition at line 2626 of file matroskaenc.c.

static uint64_t mkv_get_uid ( const mkv_track tracks,
int  i,
AVLFG c 
)
static

Definition at line 2636 of file matroskaenc.c.

Referenced by mkv_init().

static int mkv_init ( struct AVFormatContext s)
static

Definition at line 2654 of file matroskaenc.c.

static int mkv_check_bitstream ( struct AVFormatContext s,
const AVPacket pkt 
)
static

Definition at line 2735 of file matroskaenc.c.

Variable Documentation

const AVCodecTag additional_audio_tags[]
static
Initial value:

Definition at line 2750 of file matroskaenc.c.

const AVCodecTag additional_video_tags[]
static
Initial value:
= {
{ AV_CODEC_ID_RV10, 0xFFFFFFFF },
{ AV_CODEC_ID_RV20, 0xFFFFFFFF },
{ AV_CODEC_ID_RV30, 0xFFFFFFFF },
{ AV_CODEC_ID_NONE, 0xFFFFFFFF }
}

Definition at line 2766 of file matroskaenc.c.

const AVCodecTag additional_subtitle_tags[]
static
Initial value:

Definition at line 2773 of file matroskaenc.c.

const AVOption options[]
static
Initial value:
= {
{ "reserve_index_space", "Reserve a given amount of space (in bytes) at the beginning of the file for the index (cues).", OFFSET(reserve_cues_space), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
{ "cluster_size_limit", "Store at most the provided amount of bytes in a cluster. ", OFFSET(cluster_size_limit), AV_OPT_TYPE_INT , { .i64 = -1 }, -1, INT_MAX, FLAGS },
{ "cluster_time_limit", "Store at most the provided number of milliseconds in a cluster.", OFFSET(cluster_time_limit), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, FLAGS },
{ "dash", "Create a WebM file conforming to WebM DASH specification", OFFSET(is_dash), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ "dash_track_number", "Track number for the DASH stream", OFFSET(dash_track_number), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, FLAGS },
{ "live", "Write files assuming it is a live stream.", OFFSET(is_live), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ "allow_raw_vfw", "allow RAW VFW mode", OFFSET(allow_raw_vfw), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ "write_crc32", "write a CRC32 element inside every Level 1 element", OFFSET(write_crc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
{ "default_mode", "Controls how a track's FlagDefault is inferred", OFFSET(default_mode), AV_OPT_TYPE_INT, { .i64 = DEFAULT_MODE_INFER }, DEFAULT_MODE_INFER, DEFAULT_MODE_PASSTHROUGH, FLAGS, "default_mode" },
{ "infer", "For each track type, mark the first track of disposition default as default; if none exists, mark the first track as default.", 0, AV_OPT_TYPE_CONST, { .i64 = DEFAULT_MODE_INFER }, 0, 0, FLAGS, "default_mode" },
{ "infer_no_subs", "For each track type, mark the first track of disposition default as default; for audio and video: if none exists, mark the first track as default.", 0, AV_OPT_TYPE_CONST, { .i64 = DEFAULT_MODE_INFER_NO_SUBS }, 0, 0, FLAGS, "default_mode" },
{ "passthrough", "Use the disposition flag as-is", 0, AV_OPT_TYPE_CONST, { .i64 = DEFAULT_MODE_PASSTHROUGH }, 0, 0, FLAGS, "default_mode" },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: matroskaenc.c:2781
#define OFFSET(x)
Definition: matroskaenc.c:2780

Definition at line 2782 of file matroskaenc.c.