FFmpeg
Loading...
Searching...
No Matches
pdvenc.c File Reference
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/rational.h"
#include "avformat.h"
#include "avio_internal.h"
#include "mux.h"

Go to the source code of this file.

Data Structures

struct  PDVMuxContext
 

Macros

#define PDV_MAGIC   "Playdate VID\x00\x00\x00\x00"
 
#define PDV_MAX_FRAMES   UINT16_MAX
 
#define PDV_MAX_OFFSET   ((1U << 30) - 1)
 
#define OFFSET(x)
 
#define ENC   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static void pdv_deinit (AVFormatContext *s)
 
static int pdv_get_fps (AVFormatContext *s, AVStream *st, uint32_t *fps_bits)
 
static int pdv_write_header (AVFormatContext *s)
 
static int pdv_write_packet (AVFormatContext *s, AVPacket *pkt)
 
static int pdv_write_trailer (AVFormatContext *s)
 

Variables

static const AVOption options []
 
static const AVClass pdv_muxer_class
 
const FFOutputFormat ff_pdv_muxer
 

Macro Definition Documentation

◆ PDV_MAGIC

#define PDV_MAGIC   "Playdate VID\x00\x00\x00\x00"

Definition at line 30 of file pdvenc.c.

◆ PDV_MAX_FRAMES

#define PDV_MAX_FRAMES   UINT16_MAX

Definition at line 31 of file pdvenc.c.

Referenced by pdv_write_header().

◆ PDV_MAX_OFFSET

#define PDV_MAX_OFFSET   ((1U << 30) - 1)

Definition at line 32 of file pdvenc.c.

Referenced by pdv_write_packet(), and pdv_write_trailer().

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(PDVMuxContext, x)

Definition at line 191 of file pdvenc.c.

◆ ENC

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 192 of file pdvenc.c.

Function Documentation

◆ pdv_deinit()

static void pdv_deinit ( AVFormatContext * s)
static

Definition at line 44 of file pdvenc.c.

◆ pdv_get_fps()

static int pdv_get_fps ( AVFormatContext * s,
AVStream * st,
uint32_t * fps_bits )
static

Definition at line 51 of file pdvenc.c.

Referenced by pdv_write_header().

◆ pdv_write_header()

static int pdv_write_header ( AVFormatContext * s)
static

Definition at line 72 of file pdvenc.c.

◆ pdv_write_packet()

static int pdv_write_packet ( AVFormatContext * s,
AVPacket * pkt )
static

Definition at line 123 of file pdvenc.c.

◆ pdv_write_trailer()

static int pdv_write_trailer ( AVFormatContext * s)
static

Definition at line 156 of file pdvenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "max_frames", "maximum number of frames reserved in table (mandatory)",
OFFSET(max_frames), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, PDV_MAX_FRAMES, ENC },
{ NULL },
}
#define ENC
Definition caca.c:198
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
#define PDV_MAX_FRAMES
Definition pdvenc.c:31

Definition at line 193 of file pdvenc.c.

◆ pdv_muxer_class

const AVClass pdv_muxer_class
static
Initial value:
= {
.class_name = "PDV muxer",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
@ AV_CLASS_CATEGORY_MUXER
Definition log.h:32

Definition at line 199 of file pdvenc.c.

◆ ff_pdv_muxer

const FFOutputFormat ff_pdv_muxer
Initial value:
= {
.p.name = "pdv",
.p.long_name = NULL_IF_CONFIG_SMALL("PlayDate Video"),
.p.extensions = "pdv",
.p.priv_class = &pdv_muxer_class,
.p.audio_codec = AV_CODEC_ID_NONE,
.p.video_codec = AV_CODEC_ID_PDV,
.p.subtitle_codec = AV_CODEC_ID_NONE,
.priv_data_size = sizeof(PDVMuxContext),
.p.flags = AVFMT_NOTIMESTAMPS,
.flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
.write_header = pdv_write_header,
.write_packet = pdv_write_packet,
.write_trailer = pdv_write_trailer,
.deinit = pdv_deinit,
}
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition avformat.h:498
@ AV_CODEC_ID_PDV
Definition codec_id.h:315
@ AV_CODEC_ID_NONE
Definition codec_id.h:48
static const AVClass pdv_muxer_class
Definition pdvenc.c:199
static int pdv_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition pdvenc.c:123
static int pdv_write_header(AVFormatContext *s)
Definition pdvenc.c:72
static void pdv_deinit(AVFormatContext *s)
Definition pdvenc.c:44
static int pdv_write_trailer(AVFormatContext *s)
Definition pdvenc.c:156
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
#define FF_OFMT_FLAG_MAX_ONE_OF_EACH
If this flag is set, it indicates that for each codec type whose corresponding default codec (i....
Definition mux.h:50
#define FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
If this flag is set, then the only permitted audio/video/subtitle codec ids are AVOutputFormat....
Definition mux.h:59

Definition at line 207 of file pdvenc.c.