#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"
#include <assert.h>
Go to the source code of this file.
Data Structures | |
struct | PacketDesc |
struct | StreamInfo |
struct | MpegMuxContext |
Defines | |
#define | MAX_PAYLOAD_SIZE 4096 |
#define | OFFSET(x) offsetof(MpegMuxContext, x) |
#define | E AV_OPT_FLAG_ENCODING_PARAM |
#define | MPEGENC_CLASS(flavor) |
Typedefs | |
typedef struct PacketDesc | PacketDesc |
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 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 [] |
AVOutputFormat | ff_mpeg1system_muxer |
#define MPEGENC_CLASS | ( | flavor | ) |
static const AVClass flavor ## _class = {\ .class_name = #flavor " muxer",\ .item_name = av_default_item_name,\ .version = LIBAVUTIL_VERSION_INT,\ .option = options,\ };
#define OFFSET | ( | x | ) | offsetof(MpegMuxContext, x) |
typedef struct PacketDesc PacketDesc |
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 656 of file mpegenc.c.
Referenced by output_packet().
static int get_nb_frames | ( | AVFormatContext * | ctx, | |
StreamInfo * | stream, | |||
int | len | |||
) | [static] |
Definition at line 641 of file mpegenc.c.
Referenced by flush_packet().
static int get_system_header_size | ( | AVFormatContext * | ctx | ) | [static] |
Definition at line 272 of file mpegenc.c.
Referenced by mpeg_mux_init().
static int get_vcd_padding_size | ( | AVFormatContext * | ctx, | |
int64_t | pts | |||
) | [static] |
Definition at line 515 of file mpegenc.c.
Referenced by output_packet().
static int mpeg_mux_end | ( | AVFormatContext * | ctx | ) | [static] |
static int mpeg_mux_init | ( | AVFormatContext * | ctx | ) | [static] |
static int mpeg_mux_write_packet | ( | AVFormatContext * | ctx, | |
AVPacket * | pkt | |||
) | [static] |
static int output_packet | ( | AVFormatContext * | ctx, | |
int | flush | |||
) | [static] |
Definition at line 1032 of file mpegenc.c.
Referenced by mpeg_mux_end(), and mpeg_mux_write_packet().
static int put_pack_header | ( | AVFormatContext * | ctx, | |
uint8_t * | buf, | |||
int64_t | timestamp | |||
) | [static] |
Definition at line 89 of file mpegenc.c.
Referenced by flush_packet().
static void put_padding_packet | ( | AVFormatContext * | ctx, | |
AVIOContext * | pb, | |||
int | packet_bytes | |||
) | [static] |
Definition at line 624 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 void put_timestamp | ( | AVIOContext * | pb, | |
int | id, | |||
int64_t | timestamp | |||
) | [inline, static] |
Definition at line 502 of file mpegenc.c.
Referenced by flush_packet().
static void put_vcd_padding_sector | ( | AVFormatContext * | ctx | ) | [static] |
Definition at line 957 of file mpegenc.c.
Referenced by output_packet().
static int remove_decoded_packets | ( | AVFormatContext * | ctx, | |
int64_t | scr | |||
) | [static] |
Definition at line 1004 of file mpegenc.c.
Referenced by output_packet().
{ .name = "mpeg", .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 System format"), .mime_type = "video/mpeg", .extensions = "mpg,mpeg", .priv_data_size = sizeof(MpegMuxContext), .audio_codec = CODEC_ID_MP2, .video_codec = CODEC_ID_MPEG1VIDEO, .write_header = mpeg_mux_init, .write_packet = mpeg_mux_write_packet, .write_trailer = mpeg_mux_end, .priv_class = &mpeg_class, }
{ .name = "vcd", .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 System format (VCD)"), .mime_type = "video/mpeg", .priv_data_size = sizeof(MpegMuxContext), .audio_codec = CODEC_ID_MP2, .video_codec = CODEC_ID_MPEG1VIDEO, .write_header = mpeg_mux_init, .write_packet = mpeg_mux_write_packet, .write_trailer = mpeg_mux_end, .priv_class = &vcd_class, }
{ .name = "dvd", .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS format (DVD VOB)"), .mime_type = "video/mpeg", .extensions = "dvd", .priv_data_size = sizeof(MpegMuxContext), .audio_codec = CODEC_ID_MP2, .video_codec = CODEC_ID_MPEG2VIDEO, .write_header = mpeg_mux_init, .write_packet = mpeg_mux_write_packet, .write_trailer = mpeg_mux_end, .priv_class = &dvd_class, }
{ .name = "svcd", .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS format (VOB)"), .mime_type = "video/mpeg", .extensions = "vob", .priv_data_size = sizeof(MpegMuxContext), .audio_codec = CODEC_ID_MP2, .video_codec = CODEC_ID_MPEG2VIDEO, .write_header = mpeg_mux_init, .write_packet = mpeg_mux_write_packet, .write_trailer = mpeg_mux_end, .priv_class = &svcd_class, }
{ .name = "vob", .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS format (VOB)"), .mime_type = "video/mpeg", .extensions = "vob", .priv_data_size = sizeof(MpegMuxContext), .audio_codec = CODEC_ID_MP2, .video_codec = CODEC_ID_MPEG2VIDEO, .write_header = mpeg_mux_init, .write_packet = mpeg_mux_write_packet, .write_trailer = mpeg_mux_end, .priv_class = &vob_class, }