FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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"
#include "audiointerleave.h"

Go to the source code of this file.

Data Structures

struct  GXFTimecode
 
struct  GXFStreamContext
 
struct  GXFContext
 

Macros

#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_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)
 
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 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, AVPacket *next, 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 []
 
static const int GXF_samples_per_frame [] = { 32768, 0 }
 
AVOutputFormat ff_gxf_muxer
 

Macro Definition Documentation

#define GXF_AUDIO_PACKET_SIZE   65536

Definition at line 32 of file gxfenc.c.

Referenced by gxf_write_packet().

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

Definition at line 34 of file gxfenc.c.

Referenced by gxf_write_timecode_auxiliary(), and gxf_write_umf_material_description().

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

Definition at line 118 of file gxfenc.c.

Referenced by gxf_write_material_data_section().

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

Definition at line 119 of file gxfenc.c.

Referenced by gxf_write_track_description(), and gxf_write_umf_media_description().

Function Documentation

static int gxf_find_lines_index ( AVStream st)
static

Definition at line 121 of file gxfenc.c.

Referenced by gxf_write_header().

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().

static int64_t updatePacketSize ( AVIOContext pb,
int64_t  pos 
)
static
static int64_t updateSize ( AVIOContext pb,
int64_t  pos 
)
static
static void gxf_write_packet_header ( AVIOContext pb,
GXFPktType  type 
)
static
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().

static int gxf_write_timecode_auxiliary ( AVIOContext pb,
GXFContext gxf 
)
static

Definition at line 220 of file gxfenc.c.

Referenced by gxf_write_track_description().

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

Definition at line 232 of file gxfenc.c.

Referenced by gxf_write_track_description_section().

static int gxf_write_material_data_section ( AVFormatContext s)
static

Definition at line 289 of file gxfenc.c.

Referenced by gxf_write_map_packet().

static int gxf_write_track_description_section ( AVFormatContext s)
static

Definition at line 340 of file gxfenc.c.

Referenced by gxf_write_map_packet().

static int gxf_write_map_packet ( AVFormatContext s,
int  rewrite 
)
static

Definition at line 357 of file gxfenc.c.

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

static int gxf_write_flt_packet ( AVFormatContext s)
static

Definition at line 388 of file gxfenc.c.

Referenced by gxf_write_header(), and gxf_write_trailer().

static int gxf_write_umf_material_description ( AVFormatContext s)
static

Definition at line 413 of file gxfenc.c.

Referenced by gxf_write_umf_packet().

static int gxf_write_umf_payload ( AVFormatContext s)
static

Definition at line 461 of file gxfenc.c.

Referenced by gxf_write_umf_packet().

static int gxf_write_umf_track_description ( AVFormatContext s)
static

Definition at line 481 of file gxfenc.c.

Referenced by gxf_write_umf_packet().

static int gxf_write_umf_media_mpeg ( AVIOContext pb,
AVStream st 
)
static

Definition at line 501 of file gxfenc.c.

Referenced by gxf_write_umf_media_description().

static int gxf_write_umf_media_timecode ( AVIOContext pb,
int  drop 
)
static

Definition at line 524 of file gxfenc.c.

Referenced by gxf_write_umf_media_description().

static int gxf_write_umf_media_dv ( AVIOContext pb,
GXFStreamContext sc 
)
static

Definition at line 537 of file gxfenc.c.

Referenced by gxf_write_umf_media_description().

static int gxf_write_umf_media_audio ( AVIOContext pb,
GXFStreamContext sc 
)
static

Definition at line 547 of file gxfenc.c.

Referenced by gxf_write_umf_media_description().

static int gxf_write_umf_media_description ( AVFormatContext s)
static

Definition at line 558 of file gxfenc.c.

Referenced by gxf_write_umf_packet().

static int gxf_write_umf_packet ( AVFormatContext s)
static

Definition at line 620 of file gxfenc.c.

Referenced by gxf_write_header(), and gxf_write_trailer().

static void gxf_init_timecode_track ( GXFStreamContext sc,
GXFStreamContext vsc 
)
static

Definition at line 643 of file gxfenc.c.

Referenced by gxf_write_header().

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

Definition at line 658 of file gxfenc.c.

Referenced by gxf_write_header().

static int gxf_write_header ( AVFormatContext s)
static

Definition at line 677 of file gxfenc.c.

static int gxf_write_eos_packet ( AVIOContext pb)
static

Definition at line 814 of file gxfenc.c.

Referenced by gxf_write_trailer().

static int gxf_write_trailer ( AVFormatContext s)
static

Definition at line 822 of file gxfenc.c.

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

Definition at line 854 of file gxfenc.c.

Referenced by gxf_write_media_preamble().

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

Definition at line 866 of file gxfenc.c.

Referenced by gxf_write_packet().

static int gxf_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 913 of file gxfenc.c.

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

Definition at line 958 of file gxfenc.c.

Referenced by gxf_interleave_packet().

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

Definition at line 980 of file gxfenc.c.

Variable Documentation

int height
Examples:
doc/examples/muxing.c, and doc/examples/scaling_video.c.

Definition at line 89 of file gxfenc.c.

Referenced by add_rect_clamped_c(), apply_loop_filter(), apply_unsharp(), av_image_copy(), av_image_fill_pointers(), av_image_get_buffer_size(), av_parse_video_size(), avcodec_set_dimensions(), avfilter_graph_dump_to_buf(), avfilter_transform(), avg_tpel_pixels_mc01_c(), avg_tpel_pixels_mc02_c(), avg_tpel_pixels_mc10_c(), avg_tpel_pixels_mc11_c(), avg_tpel_pixels_mc12_c(), avg_tpel_pixels_mc20_c(), avg_tpel_pixels_mc21_c(), avg_tpel_pixels_mc22_c(), avpriv_dv_codec_profile(), bfi_decode_frame(), bitplane_decoding(), biweight_h264_W_altivec(), bktr_init(), bmp_decode_frame(), bmp_encode_frame(), build_feed_streams(), calculate_display_rect(), calculate_visual_weight(), cdxl_read_packet(), codec_reinit(), config(), copy_block(), copy_frame(), copy_output(), copy_picture_attributes(), copy_rectangles(), count_usage(), dc1394_read_common(), decode_cblk(), decode_clnpass(), decode_colskip(), decode_copy(), decode_dds1(), decode_dsw1(), decode_finish_row(), decode_frame(), decode_frame_header(), decode_frame_headers(), decode_i2_frame(), decode_i_frame(), decode_p_frame(), decode_refpass(), decode_region(), decode_region_intra(), decode_region_masked(), decode_rowskip(), decode_seq_header(), decode_sigpass(), decode_slice(), decode_subband_internal(), decode_tsw1(), decode_vol_header(), decode_wdlt(), DEFINE_BLEND(), device_init(), dirac_hpel_filter(), draw_edges(), draw_n_color(), duplicate_right_border_pixels(), encode_cblk(), encode_clnpass(), encode_frame(), encode_picture_lossless(), encode_refpass(), encode_sigpass(), encode_slice(), execute_code(), ff_ccitt_unpack(), ff_flv_decode_picture_header(), ff_gmc_c(), ff_h263_decode_picture_header(), ff_jpegls_decode_picture(), ff_mjpeg_decode_sof(), ff_print_debug_info2(), ff_rtjpeg_decode_init(), ff_spatial_idwt(), ff_spatial_idwt_init2(), ff_vda_create_decoder(), ff_vf_next_config(), fill_yuv_image(), fillPlane(), fillPlane16(), filter(), get_lowest_part_list_y(), gif_image_write_image(), gif_read_header(), gif_read_image(), gif_write_header(), idcin_read_header(), img_read_header(), init_sizes(), inter_predict(), interleaveBytes_c(), interleaveBytes_TMPL(), INTERPOLATE_METHOD(), ir2_decode_plane(), ir2_decode_plane_inter(), jpeg_parse_packet(), lag_decode_arith_plane(), left_predict(), libopenjpeg_copy_unpacked16(), libopenjpeg_copy_unpacked8(), libopenjpeg_decode_frame(), loco_decode_plane(), main(), mangle_rgb_planes(), mc_part_weighted(), mca(), median_predict(), mem2agpcpy_pic(), memcpy_pic2(), mimic_decode_frame(), motion_compensation(), mov_read_tkhd(), mpeg1_decode_sequence(), msnwc_tcp_probe(), mss4_decode_frame(), mvc_decode_init(), noise(), nuv_header(), old_codec1(), old_codec37(), old_codec47(), optimum_block_height(), paint_mouse_pointer(), parse_picture(), parse_picture_segment(), planarCopyWrapper(), postProcess_TMPL(), pp_postprocess(), process_frame_uyvy422(), process_frame_yuv420p(), process_frame_yuv422p(), process_ipmovie_chunk(), put_pixel(), put_signed_rect_clamped_c(), put_tpel_pixels_mc01_c(), put_tpel_pixels_mc02_c(), put_tpel_pixels_mc10_c(), put_tpel_pixels_mc11_c(), put_tpel_pixels_mc12_c(), put_tpel_pixels_mc20_c(), put_tpel_pixels_mc21_c(), put_tpel_pixels_mc22_c(), qpeg_decode_inter(), qpeg_decode_intra(), qtrle_decode_frame(), rawvideo_read_header(), rawvideo_read_packet(), read_header(), restore_median(), restore_median_il(), restore_rgb_planes(), rgb24_to_yuv420p(), rgb24toyv12_c(), rv34_mc(), siff_parse_vbv1(), smc_decode_stream(), smush_read_header(), spatial_compose53i_dy_buffered(), spatial_compose_fidelity(), spatial_decompose53i(), spatial_decompose97i(), store_slice2_mmx(), store_slice_c(), store_slice_mmx(), sunrast_image_write_image(), super2xsai(), svq1_decode_block_intra(), svq1_decode_block_non_intra(), svq1_decode_frame(), svq1_decode_frame_header(), svq1_encode_plane(), svq3_mc_dir_part(), swf_read_packet(), swf_write_header(), swScale(), theora_header(), to_meta_with_crop(), unpack(), utvideo_encode_frame(), uyvytoyuv420_c(), uyvytoyuv420_TMPL(), uyvytoyuv422_c(), uyvytoyuv422_TMPL(), uyvytoyv12_c(), uyvytoyv12_TMPL(), vble_restore_plane(), vc1_mc_4mv_luma(), vcr1_decode_frame(), weight_h264_W_altivec(), write_huff_codes(), write_plane(), xan_wc3_decode_frame(), xsub_encode(), yuv422ptouyvy_TMPL(), yuv422ptoyuy2_TMPL(), yuv4_read_header(), yuv4_read_packet(), yuvPlanartouyvy_c(), yuvPlanartouyvy_TMPL(), yuvPlanartoyuy2_c(), yuvPlanartoyuy2_TMPL(), yuy2toyv12_c(), yuy2toyv12_TMPL(), yuyvtoyuv420_c(), yuyvtoyuv420_TMPL(), yuyvtoyuv422_c(), yuyvtoyuv422_TMPL(), yv12touyvy_TMPL(), yv12touyvy_unscaled_altivec(), yv12toyuy2_TMPL(), yv12toyuy2_unscaled_altivec(), yvu9_to_yuy2_c(), and yvu9_to_yuy2_TMPL().

int index

Definition at line 89 of file gxfenc.c.

Referenced by aac_encode_init(), adpcm_decode_frame(), alac_linear_predictor(), alloc_table(), allocStuff(), ape_read_seek(), apply_dependent_coupling(), apply_independent_coupling(), asf_read_seek(), asv1_encode_block(), asv1_put_level(), asv2_encode_block(), asv2_put_level(), av_get_standard_channel_layout(), av_parser_parse2(), av_shr_i(), avfilter_graph_parse2(), avformat_match_stream_specifier(), avi_read_idx1(), avi_read_seek(), band_delta_factor(), build_basis(), build_def_list(), build_frame_code(), build_table(), callback(), categorize(), cdxl_decode_ham6(), cdxl_decode_ham8(), check_4block_inter(), check_block(), check_format(), codec2subblock(), comp_block(), comp_interp_index(), compute_scale_factors(), copy_TMPL(), decode(), decode_cabac_luma_residual(), decode_cabac_residual_internal(), decode_fixed_sparse(), decode_gain_info(), decode_i2_frame(), decode_init(), decode_luma_residual(), decode_p_block(), decode_q_branch(), decode_vectors(), direct_search(), dnxhd_encode_init(), dnxhd_init_vlc(), draw_glyph(), dv_decode_ac(), encode_dc(), encode_q_branch(), encode_q_branch2(), enqueue_buffer(), execute_code(), ff_add_index_entry(), ff_fft_lut_init(), ff_gmc_c(), ff_h261_reorder_mb_index(), ff_h264_decode_mb_cabac(), ff_h264_decode_mb_cavlc(), ff_h264_decode_ref_pic_list_reordering(), ff_huffyuv_generate_bits_table(), ff_init_ff_cos_tabs(), ff_mjpeg_decode_dht(), ff_mjpeg_decode_dqt(), ff_mjpeg_decode_frame(), ff_mjpeg_decode_sos(), ff_mov_init_hinting(), ff_mpeg1_encode_init(), ff_seek_frame_binary(), ff_srtp_decrypt(), ff_srtp_encrypt(), filter(), finish_file(), gather_data_for_cel(), gen_fcb_excitation(), get(), get_bits1(), get_block_bits(), get_block_rate(), get_dc(), get_mvdata_interlaced(), get_rl_index(), get_sample_rate(), heap_bubble_down(), heap_bubble_up(), hpel_motion_search(), idct_put(), init_pass2(), init_uni_h263_rl_tab(), init_uni_mpeg4_rl_tab(), interpolate_delay(), iterative_me(), lag_decode_line(), libAVMemInputPin_Receive(), libopenjpeg_copy_to_packed16(), libopenjpeg_copy_to_packed8(), libopenjpeg_copyto16(), libopenjpeg_copyto8(), libopenjpeg_guess_pix_fmt(), lsp2lpc(), matroska_add_index_entries(), matroska_read_seek(), mov_create_timecode_track(), mov_write_stsc_tag(), mov_write_stss_tag(), mov_write_tfrf_tag(), mpc8_read_seek(), mpc_read_seek(), mpeg4_encode_block(), mpeg4_get_block_length(), mv_read_packet(), mxf_compute_ptses_fake_index(), mxf_decrypt_triplet(), mxf_edit_unit_absolute_offset(), mxf_read_packet_old(), nsv_read_seek(), nut_write_packet(), open_output_file(), output_client_manifest(), paf_vid_decode(), parse_forced_key_frames(), probe(), process_block(), qpel_motion_search(), quantize(), read_seek(), rematrix_channels(), resample(), resample_one(), resampleCubic(), resampleLinear(), rl2_read_seek(), rpza_decode_stream(), rtsp_send_reply(), sad_hpel_motion_search(), scalar_dequant_float(), seek_frame_generic(), set(), set_blocks(), small_diamond_search(), snow_set_blocks(), store_table(), svq3_decode_block(), svq3_decode_mb(), swri_resample_TMPL(), synthfilt_build_sb_samples(), tak_parse(), truemotion1_decode_16bit(), truemotion1_decode_24bit(), tta_read_seek(), update_palette_index(), value_string(), vc1_decode_ac_coeff(), vc1_decode_b_mb(), vc1_decode_p_mb(), vqa_decode_chunk(), wma_decode_block(), write_manifest(), wv_read_seek(), and xan_wc3_output_pixel_run().

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

Referenced by gxf_find_lines_index().

const AVCodecTag gxf_media_types[]
static
Initial value:

Definition at line 99 of file gxfenc.c.

const int GXF_samples_per_frame[] = { 32768, 0 }
static

Definition at line 641 of file gxfenc.c.

Referenced by gxf_write_header().

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,
}

Definition at line 988 of file gxfenc.c.