FFmpeg
Data Structures | Macros | Functions | Variables
gxfenc.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/intfloat.h"
#include "libavutil/opt.h"
#include "libavutil/mathematics.h"
#include "libavutil/timecode.h"
#include "avformat.h"
#include "internal.h"
#include "gxf.h"

Go to the source code of this file.

Data Structures

struct  GXFTimecode
 
struct  GXFStreamContext
 
struct  GXFContext
 

Macros

#define GXF_SAMPLES_PER_FRAME   32768
 
#define GXF_AUDIO_PACKET_SIZE   65536
 
#define GXF_TIMECODE(c, d, h, m, s, f)   ((c) << 30 | (d) << 29 | (h) << 24 | (m) << 16 | (s) << 8 | (f))
 
#define SERVER_PATH   "EXT:/PDR/default/"
 
#define ES_NAME_PATTERN   "EXT:/PDR/default/ES."
 

Functions

static int gxf_find_lines_index (AVStream *st)
 
static void gxf_write_padding (AVIOContext *pb, int64_t to_pad)
 
static int64_t updatePacketSize (AVIOContext *pb, int64_t pos)
 
static int64_t updateSize (AVIOContext *pb, int64_t pos)
 
static void gxf_write_packet_header (AVIOContext *pb, GXFPktType type)
 
static int gxf_write_mpeg_auxiliary (AVIOContext *pb, AVStream *st)
 
static int gxf_write_dv_auxiliary (AVIOContext *pb, AVStream *st)
 
static int gxf_write_timecode_auxiliary (AVIOContext *pb, GXFContext *gxf)
 
static int gxf_write_track_description (AVFormatContext *s, GXFStreamContext *sc, int index)
 
static int gxf_write_material_data_section (AVFormatContext *s)
 
static int gxf_write_track_description_section (AVFormatContext *s)
 
static int gxf_write_map_packet (AVFormatContext *s, int rewrite)
 
static int gxf_write_flt_packet (AVFormatContext *s)
 
static int gxf_write_umf_material_description (AVFormatContext *s)
 
static int gxf_write_umf_payload (AVFormatContext *s)
 
static int gxf_write_umf_track_description (AVFormatContext *s)
 
static int gxf_write_umf_media_mpeg (AVIOContext *pb, AVStream *st)
 
static int gxf_write_umf_media_timecode (AVIOContext *pb, int drop)
 
static int gxf_write_umf_media_dv (AVIOContext *pb, GXFStreamContext *sc, AVStream *st)
 
static int gxf_write_umf_media_audio (AVIOContext *pb, GXFStreamContext *sc)
 
static int gxf_write_umf_media_description (AVFormatContext *s)
 
static int gxf_write_umf_packet (AVFormatContext *s)
 
static void gxf_init_timecode_track (GXFStreamContext *sc, GXFStreamContext *vsc)
 
static int gxf_init_timecode (AVFormatContext *s, GXFTimecode *tc, const char *tcstr, int fields)
 
static int gxf_write_header (AVFormatContext *s)
 
static int gxf_write_eos_packet (AVIOContext *pb)
 
static int gxf_write_trailer (AVFormatContext *s)
 
static void gxf_deinit (AVFormatContext *s)
 
static int gxf_parse_mpeg_frame (GXFStreamContext *sc, const uint8_t *buf, int size)
 
static int gxf_write_media_preamble (AVFormatContext *s, AVPacket *pkt, int size)
 
static int gxf_write_packet (AVFormatContext *s, AVPacket *pkt)
 
static int gxf_compare_field_nb (AVFormatContext *s, const AVPacket *next, const AVPacket *cur)
 
static int gxf_interleave_packet (AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush)
 

Variables

struct {
   int   height
 
   int   index
 
gxf_lines_tab []
 
static const AVCodecTag gxf_media_types []
 
const AVOutputFormat ff_gxf_muxer
 

Macro Definition Documentation

◆ GXF_SAMPLES_PER_FRAME

#define GXF_SAMPLES_PER_FRAME   32768

Definition at line 31 of file gxfenc.c.

◆ GXF_AUDIO_PACKET_SIZE

#define GXF_AUDIO_PACKET_SIZE   65536

Definition at line 32 of file gxfenc.c.

◆ GXF_TIMECODE

#define GXF_TIMECODE (   c,
  d,
  h,
  m,
  s,
  f 
)    ((c) << 30 | (d) << 29 | (h) << 24 | (m) << 16 | (s) << 8 | (f))

Definition at line 34 of file gxfenc.c.

◆ SERVER_PATH

#define SERVER_PATH   "EXT:/PDR/default/"

Definition at line 118 of file gxfenc.c.

◆ ES_NAME_PATTERN

#define ES_NAME_PATTERN   "EXT:/PDR/default/ES."

Definition at line 119 of file gxfenc.c.

Function Documentation

◆ gxf_find_lines_index()

static int gxf_find_lines_index ( AVStream st)
static

Definition at line 121 of file gxfenc.c.

Referenced by gxf_write_header().

◆ gxf_write_padding()

static void gxf_write_padding ( AVIOContext pb,
int64_t  to_pad 
)
static

Definition at line 135 of file gxfenc.c.

Referenced by gxf_write_packet(), and updatePacketSize().

◆ updatePacketSize()

static int64_t updatePacketSize ( AVIOContext pb,
int64_t  pos 
)
static

◆ updateSize()

static int64_t updateSize ( AVIOContext pb,
int64_t  pos 
)
static

◆ gxf_write_packet_header()

static void gxf_write_packet_header ( AVIOContext pb,
GXFPktType  type 
)
static

◆ gxf_write_mpeg_auxiliary()

static int gxf_write_mpeg_auxiliary ( AVIOContext pb,
AVStream st 
)
static

Definition at line 181 of file gxfenc.c.

Referenced by gxf_write_track_description().

◆ gxf_write_dv_auxiliary()

static int gxf_write_dv_auxiliary ( AVIOContext pb,
AVStream st 
)
static

Definition at line 220 of file gxfenc.c.

Referenced by gxf_write_track_description().

◆ gxf_write_timecode_auxiliary()

static int gxf_write_timecode_auxiliary ( AVIOContext pb,
GXFContext gxf 
)
static

Definition at line 233 of file gxfenc.c.

Referenced by gxf_write_track_description().

◆ gxf_write_track_description()

static int gxf_write_track_description ( AVFormatContext s,
GXFStreamContext sc,
int  index 
)
static

Definition at line 247 of file gxfenc.c.

Referenced by gxf_write_track_description_section().

◆ gxf_write_material_data_section()

static int gxf_write_material_data_section ( AVFormatContext s)
static

Definition at line 308 of file gxfenc.c.

Referenced by gxf_write_map_packet().

◆ gxf_write_track_description_section()

static int gxf_write_track_description_section ( AVFormatContext s)
static

Definition at line 359 of file gxfenc.c.

Referenced by gxf_write_map_packet().

◆ gxf_write_map_packet()

static int gxf_write_map_packet ( AVFormatContext s,
int  rewrite 
)
static

Definition at line 376 of file gxfenc.c.

Referenced by gxf_write_header(), gxf_write_packet(), and gxf_write_trailer().

◆ gxf_write_flt_packet()

static int gxf_write_flt_packet ( AVFormatContext s)
static

Definition at line 408 of file gxfenc.c.

Referenced by gxf_write_header(), and gxf_write_trailer().

◆ gxf_write_umf_material_description()

static int gxf_write_umf_material_description ( AVFormatContext s)
static

Definition at line 433 of file gxfenc.c.

Referenced by gxf_write_umf_packet().

◆ gxf_write_umf_payload()

static int gxf_write_umf_payload ( AVFormatContext s)
static

Definition at line 479 of file gxfenc.c.

Referenced by gxf_write_umf_packet().

◆ gxf_write_umf_track_description()

static int gxf_write_umf_track_description ( AVFormatContext s)
static

Definition at line 499 of file gxfenc.c.

Referenced by gxf_write_umf_packet().

◆ gxf_write_umf_media_mpeg()

static int gxf_write_umf_media_mpeg ( AVIOContext pb,
AVStream st 
)
static

Definition at line 519 of file gxfenc.c.

Referenced by gxf_write_umf_media_description().

◆ gxf_write_umf_media_timecode()

static int gxf_write_umf_media_timecode ( AVIOContext pb,
int  drop 
)
static

Definition at line 542 of file gxfenc.c.

Referenced by gxf_write_umf_media_description().

◆ gxf_write_umf_media_dv()

static int gxf_write_umf_media_dv ( AVIOContext pb,
GXFStreamContext sc,
AVStream st 
)
static

Definition at line 555 of file gxfenc.c.

Referenced by gxf_write_umf_media_description().

◆ gxf_write_umf_media_audio()

static int gxf_write_umf_media_audio ( AVIOContext pb,
GXFStreamContext sc 
)
static

Definition at line 572 of file gxfenc.c.

Referenced by gxf_write_umf_media_description().

◆ gxf_write_umf_media_description()

static int gxf_write_umf_media_description ( AVFormatContext s)
static

Definition at line 583 of file gxfenc.c.

Referenced by gxf_write_umf_packet().

◆ gxf_write_umf_packet()

static int gxf_write_umf_packet ( AVFormatContext s)
static

Definition at line 645 of file gxfenc.c.

Referenced by gxf_write_header(), and gxf_write_trailer().

◆ gxf_init_timecode_track()

static void gxf_init_timecode_track ( GXFStreamContext sc,
GXFStreamContext vsc 
)
static

Definition at line 666 of file gxfenc.c.

Referenced by gxf_write_header().

◆ gxf_init_timecode()

static int gxf_init_timecode ( AVFormatContext s,
GXFTimecode tc,
const char *  tcstr,
int  fields 
)
static

Definition at line 681 of file gxfenc.c.

Referenced by gxf_write_header().

◆ gxf_write_header()

static int gxf_write_header ( AVFormatContext s)
static

Definition at line 700 of file gxfenc.c.

◆ gxf_write_eos_packet()

static int gxf_write_eos_packet ( AVIOContext pb)
static

Definition at line 838 of file gxfenc.c.

Referenced by gxf_write_trailer().

◆ gxf_write_trailer()

static int gxf_write_trailer ( AVFormatContext s)
static

Definition at line 846 of file gxfenc.c.

◆ gxf_deinit()

static void gxf_deinit ( AVFormatContext s)
static

Definition at line 874 of file gxfenc.c.

◆ gxf_parse_mpeg_frame()

static int gxf_parse_mpeg_frame ( GXFStreamContext sc,
const uint8_t *  buf,
int  size 
)
static

Definition at line 882 of file gxfenc.c.

Referenced by gxf_write_media_preamble().

◆ gxf_write_media_preamble()

static int gxf_write_media_preamble ( AVFormatContext s,
AVPacket pkt,
int  size 
)
static

Definition at line 894 of file gxfenc.c.

Referenced by gxf_write_packet().

◆ gxf_write_packet()

static int gxf_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 941 of file gxfenc.c.

◆ gxf_compare_field_nb()

static int gxf_compare_field_nb ( AVFormatContext s,
const AVPacket next,
const AVPacket cur 
)
static

Definition at line 988 of file gxfenc.c.

Referenced by gxf_interleave_packet().

◆ gxf_interleave_packet()

static int gxf_interleave_packet ( AVFormatContext s,
AVPacket out,
AVPacket pkt,
int  flush 
)
static

Definition at line 1011 of file gxfenc.c.

Variable Documentation

◆ height

int height

Definition at line 89 of file gxfenc.c.

◆ index

int index

Definition at line 89 of file gxfenc.c.

Referenced by gxf_write_track_description().

◆ gxf_lines_tab

const { ... } gxf_lines_tab[]
Initial value:
= {
{ 480, 1 },
{ 512, 1 },
{ 576, 2 },
{ 608, 2 },
{ 1080, 4 },
{ 720, 6 },
}

Referenced by gxf_find_lines_index().

◆ gxf_media_types

const AVCodecTag gxf_media_types[]
static
Initial value:

Definition at line 99 of file gxfenc.c.

Referenced by gxf_write_header().

◆ ff_gxf_muxer

const AVOutputFormat ff_gxf_muxer
Initial value:
= {
.name = "gxf",
.long_name = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
.extensions = "gxf",
.priv_data_size = sizeof(GXFContext),
.audio_codec = AV_CODEC_ID_PCM_S16LE,
.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.deinit = gxf_deinit,
}

Definition at line 1028 of file gxfenc.c.

AV_CODEC_ID_PCM_S16LE
@ AV_CODEC_ID_PCM_S16LE
Definition: codec_id.h:313
AV_CODEC_ID_AC3
@ AV_CODEC_ID_AC3
Definition: codec_id.h:425
gxf_write_header
static int gxf_write_header(AVFormatContext *s)
Definition: gxfenc.c:700
gxf_write_packet
static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: gxfenc.c:941
interleave_packet
static int interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in, int flush)
Interleave an AVPacket correctly so it can be muxed.
Definition: mux.c:1059
write_trailer
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:98
gxf_interleave_packet
static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush)
Definition: gxfenc.c:1011
AV_CODEC_ID_MPEG1VIDEO
@ AV_CODEC_ID_MPEG1VIDEO
Definition: codec_id.h:51
AV_CODEC_ID_PCM_S24LE
@ AV_CODEC_ID_PCM_S24LE
Definition: codec_id.h:325
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
gxf_write_trailer
static int gxf_write_trailer(AVFormatContext *s)
Definition: gxfenc.c:846
write_packet
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
Definition: ffmpeg.c:731
AV_CODEC_ID_MJPEG
@ AV_CODEC_ID_MJPEG
Definition: codec_id.h:57
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:48
AV_CODEC_ID_DVVIDEO
@ AV_CODEC_ID_DVVIDEO
Definition: codec_id.h:74
GXFContext
Definition: gxfenc.c:65
gxf_deinit
static void gxf_deinit(AVFormatContext *s)
Definition: gxfenc.c:874
write_header
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:347
AV_CODEC_ID_MPEG2VIDEO
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
Definition: codec_id.h:52