FFmpeg
Macros | Functions
mux_utils.c File Reference
#include "libavutil/dict.h"
#include "libavutil/dict_internal.h"
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/parseutils.h"
#include "avformat.h"
#include "avio.h"
#include "internal.h"
#include "mux.h"

Go to the source code of this file.

Macros

#define READ_BLOCK
 

Functions

int avformat_query_codec (const AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance)
 Test if the given container can store a codec. More...
 
int ff_format_shift_data (AVFormatContext *s, int64_t read_start, int shift_size)
 Make shift_size amount of space at read_start by shifting data in the output at read_start until the current IO position. More...
 
int ff_format_output_open (AVFormatContext *s, const char *url, AVDictionary **options)
 Utility function to open IO stream of output format. More...
 
int ff_parse_creation_time_metadata (AVFormatContext *s, int64_t *timestamp, int return_seconds)
 Parse creation_time in AVFormatContext metadata if exists and warn if the parsing fails. More...
 
int ff_standardize_creation_time (AVFormatContext *s)
 Standardize creation_time metadata in AVFormatContext to an ISO-8601 timestamp string. More...
 

Macro Definition Documentation

◆ READ_BLOCK

#define READ_BLOCK
Value:
do { \
read_size[read_buf_id] = avio_read(read_pb, read_buf[read_buf_id], shift_size); \
read_buf_id ^= 1; \
} while (0)

Function Documentation

◆ ff_format_shift_data()

int ff_format_shift_data ( AVFormatContext s,
int64_t  read_start,
int  shift_size 
)

Make shift_size amount of space at read_start by shifting data in the output at read_start until the current IO position.

The underlying IO context must be seekable.

Definition at line 72 of file mux_utils.c.

Referenced by mkv_write_trailer(), shift_data(), and write_header().

◆ ff_format_output_open()

int ff_format_output_open ( AVFormatContext s,
const char *  url,
AVDictionary **  options 
)

Utility function to open IO stream of output format.

Parameters
sAVFormatContext
urlURL or file name to open for writing @options optional options which will be passed to io_open callback
Returns
>=0 on success, negative AVERROR in case of failure

Definition at line 128 of file mux_utils.c.

Referenced by fifo_thread_write_header(), and open_slave().

◆ ff_parse_creation_time_metadata()

int ff_parse_creation_time_metadata ( AVFormatContext s,
int64_t timestamp,
int  return_seconds 
)

Parse creation_time in AVFormatContext metadata if exists and warn if the parsing fails.

Parameters
sAVFormatContext
timestampparsed timestamp in microseconds, only set on successful parsing
return_secondsset this to get the number of seconds in timestamp instead of microseconds
Returns
1 if OK, 0 if the metadata was not present, AVERROR(EINVAL) on parse error

Definition at line 138 of file mux_utils.c.

Referenced by asf_write_header1(), dv_init_mux(), ff_standardize_creation_time(), gxf_write_umf_material_description(), mkv_write_info(), mov_write_header(), and mxf_init().

◆ ff_standardize_creation_time()

int ff_standardize_creation_time ( AVFormatContext s)

Standardize creation_time metadata in AVFormatContext to an ISO-8601 timestamp string.

Parameters
sAVFormatContext
Returns
<0 on error

Definition at line 155 of file mux_utils.c.

Referenced by caf_write_header(), ff_ape_write_tag(), ff_id3v2_write_metadata(), lrc_write_header(), smjpeg_write_header(), write_globalinfo(), write_metadata(), and write_table_entries_attrib().

avio_read
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:612