FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
mpegenc.c File Reference
#include <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/fifo.h"
#include "libavutil/log.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavcodec/put_bits.h"
#include "avformat.h"
#include "internal.h"
#include "mpeg.h"

Go to the source code of this file.

Data Structures

struct  PacketDesc
 
struct  StreamInfo
 
struct  MpegMuxContext
 

Macros

#define MAX_PAYLOAD_SIZE   4096
 
#define VCD_PADDING_BITRATE_DEN   (2279 * 2294)
 
#define OFFSET(x)   offsetof(MpegMuxContext, x)
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 
#define MPEGENC_CLASS(flavor)
 

Functions

static int put_pack_header (AVFormatContext *ctx, uint8_t *buf, int64_t timestamp)
 
static int put_system_header (AVFormatContext *ctx, uint8_t *buf, int only_for_stream_id)
 
static int get_system_header_size (AVFormatContext *ctx)
 
static av_cold int mpeg_mux_init (AVFormatContext *ctx)
 
static void put_timestamp (AVIOContext *pb, int id, int64_t timestamp)
 
static int get_vcd_padding_size (AVFormatContext *ctx, int64_t pts)
 
static void put_padding_packet (AVFormatContext *ctx, AVIOContext *pb, int packet_bytes)
 
static int get_nb_frames (AVFormatContext *ctx, StreamInfo *stream, int len)
 
static int flush_packet (AVFormatContext *ctx, int stream_index, int64_t pts, int64_t dts, int64_t scr, int trailer_size)
 
static void put_vcd_padding_sector (AVFormatContext *ctx)
 
static int remove_decoded_packets (AVFormatContext *ctx, int64_t scr)
 
static int output_packet (AVFormatContext *ctx, int flush)
 
static int mpeg_mux_write_packet (AVFormatContext *ctx, AVPacket *pkt)
 
static int mpeg_mux_end (AVFormatContext *ctx)
 

Variables

AVOutputFormat ff_mpeg1vcd_muxer
 
AVOutputFormat ff_mpeg2dvd_muxer
 
AVOutputFormat ff_mpeg2svcd_muxer
 
AVOutputFormat ff_mpeg2vob_muxer
 
static const AVOption options []
 

Macro Definition Documentation

#define MAX_PAYLOAD_SIZE   4096

Definition at line 36 of file mpegenc.c.

#define VCD_PADDING_BITRATE_DEN   (2279 * 2294)

Referenced by get_vcd_padding_size().

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

Definition at line 1210 of file mpegenc.c.

Definition at line 1211 of file mpegenc.c.

#define MPEGENC_CLASS (   flavor)
Value:
static const AVClass flavor ## _class = { \
.class_name = #flavor " muxer", \
.item_name = av_default_item_name, \
.version = LIBAVUTIL_VERSION_INT, \
.option = options, \
};
static const AVOption options[]
Definition: mpegenc.c:1212
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:72
av_default_item_name
Describe the class of an AVClass context structure.
Definition: log.h:67

Definition at line 1218 of file mpegenc.c.

Function Documentation

static int put_pack_header ( AVFormatContext ctx,
uint8_t buf,
int64_t  timestamp 
)
static

Definition at line 91 of file mpegenc.c.

Referenced by flush_packet().

static int put_system_header ( AVFormatContext ctx,
uint8_t buf,
int  only_for_stream_id 
)
static

Definition at line 125 of file mpegenc.c.

Referenced by flush_packet().

static int get_system_header_size ( AVFormatContext ctx)
static

Definition at line 274 of file mpegenc.c.

Referenced by mpeg_mux_init().

static av_cold int mpeg_mux_init ( AVFormatContext ctx)
static

Definition at line 297 of file mpegenc.c.

static void put_timestamp ( AVIOContext pb,
int  id,
int64_t  timestamp 
)
inlinestatic

Definition at line 530 of file mpegenc.c.

Referenced by flush_packet().

static int get_vcd_padding_size ( AVFormatContext ctx,
int64_t  pts 
)
static

Definition at line 539 of file mpegenc.c.

Referenced by output_packet().

static void put_padding_packet ( AVFormatContext ctx,
AVIOContext pb,
int  packet_bytes 
)
static

Definition at line 562 of file mpegenc.c.

Referenced by flush_packet().

static int get_nb_frames ( AVFormatContext ctx,
StreamInfo stream,
int  len 
)
static

Definition at line 580 of file mpegenc.c.

Referenced by flush_packet().

static int flush_packet ( AVFormatContext ctx,
int  stream_index,
int64_t  pts,
int64_t  dts,
int64_t  scr,
int  trailer_size 
)
static

Definition at line 596 of file mpegenc.c.

Referenced by output_packet().

static void put_vcd_padding_sector ( AVFormatContext ctx)
static

Definition at line 909 of file mpegenc.c.

Referenced by output_packet().

static int remove_decoded_packets ( AVFormatContext ctx,
int64_t  scr 
)
static

Definition at line 934 of file mpegenc.c.

Referenced by output_packet().

static int output_packet ( AVFormatContext ctx,
int  flush 
)
static

Definition at line 961 of file mpegenc.c.

Referenced by mpeg_mux_end(), and mpeg_mux_write_packet().

static int mpeg_mux_write_packet ( AVFormatContext ctx,
AVPacket pkt 
)
static

Definition at line 1107 of file mpegenc.c.

static int mpeg_mux_end ( AVFormatContext ctx)
static

Definition at line 1182 of file mpegenc.c.

Variable Documentation

AVOutputFormat ff_mpeg1vcd_muxer

Referenced by mpeg_mux_init().

AVOutputFormat ff_mpeg2dvd_muxer

Referenced by mpeg_mux_init().

AVOutputFormat ff_mpeg2svcd_muxer

Referenced by mpeg_mux_init().

AVOutputFormat ff_mpeg2vob_muxer

Referenced by mpeg_mux_init().

const AVOption options[]
static
Initial value:
= {
{ "muxrate", NULL, OFFSET(user_mux_rate), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, ((1<<22) - 1) * (8 * 50), E },
{ "preload", "Initial demux-decode delay in microseconds.", OFFSET(preload), AV_OPT_TYPE_INT, { .i64 = 500000 }, 0, INT_MAX, E },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define E
Definition: mpegenc.c:1211
#define OFFSET(x)
Definition: mpegenc.c:1210

Definition at line 1212 of file mpegenc.c.