FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
nutenc.c File Reference
#include <stdint.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/tree.h"
#include "libavutil/dict.h"
#include "libavutil/avassert.h"
#include "libavutil/time.h"
#include "libavutil/opt.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/mpegaudiodata.h"
#include "nut.h"
#include "internal.h"
#include "avio_internal.h"
#include "riff.h"

Go to the source code of this file.

Macros

#define OFFSET(x)   offsetof(NUTContext, x)
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int find_expected_header (AVCodecContext *c, int size, int key_frame, uint8_t out[64])
 
static int find_header_idx (AVFormatContext *s, AVCodecContext *c, int size, int frame_type)
 
static void build_elision_headers (AVFormatContext *s)
 
static void build_frame_code (AVFormatContext *s)
 
static void put_tt (NUTContext *nut, AVRational *time_base, AVIOContext *bc, uint64_t val)
 
static void put_str (AVIOContext *bc, const char *string)
 Store a string as vb.
 
static void put_s (AVIOContext *bc, int64_t val)
 
static void put_packet (NUTContext *nut, AVIOContext *bc, AVIOContext *dyn_bc, int calculate_checksum, uint64_t startcode)
 
static void write_mainheader (NUTContext *nut, AVIOContext *bc)
 
static int write_streamheader (AVFormatContext *avctx, AVIOContext *bc, AVStream *st, int i)
 
static int add_info (AVIOContext *bc, const char *type, const char *value)
 
static int write_globalinfo (NUTContext *nut, AVIOContext *bc)
 
static int write_streaminfo (NUTContext *nut, AVIOContext *bc, int stream_id)
 
static int write_chapter (NUTContext *nut, AVIOContext *bc, int id)
 
static int write_index (NUTContext *nut, AVIOContext *bc)
 
static int write_headers (AVFormatContext *avctx, AVIOContext *bc)
 
static int nut_write_header (AVFormatContext *s)
 
static int get_needed_flags (NUTContext *nut, StreamContext *nus, FrameCode *fc, AVPacket *pkt)
 
static int find_best_header_idx (NUTContext *nut, AVPacket *pkt)
 
static int write_sm_data (AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int is_meta)
 
static int nut_write_packet (AVFormatContext *s, AVPacket *pkt)
 
static int nut_write_trailer (AVFormatContext *s)
 

Variables

static const AVOption options []
 
class {
      class_name = "nutenc"
 
      item_name = av_default_item_name
 
      option = options
 
      version = LIBAVUTIL_VERSION_INT
 
}; 
 
AVOutputFormat ff_nut_muxer
 

Macro Definition Documentation

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

Definition at line 1199 of file nutenc.c.

Definition at line 1200 of file nutenc.c.

Function Documentation

static int find_expected_header ( AVCodecContext c,
int  size,
int  key_frame,
uint8_t  out[64] 
)
static

Definition at line 38 of file nutenc.c.

Referenced by find_header_idx().

static int find_header_idx ( AVFormatContext s,
AVCodecContext c,
int  size,
int  frame_type 
)
static

Definition at line 105 of file nutenc.c.

Referenced by build_frame_code().

static void build_elision_headers ( AVFormatContext s)
static

Definition at line 121 of file nutenc.c.

Referenced by nut_write_header().

static void build_frame_code ( AVFormatContext s)
static

Definition at line 143 of file nutenc.c.

Referenced by nut_write_header().

static void put_tt ( NUTContext nut,
AVRational time_base,
AVIOContext bc,
uint64_t  val 
)
static

Definition at line 272 of file nutenc.c.

Referenced by nut_write_packet(), write_chapter(), and write_index().

static void put_str ( AVIOContext bc,
const char *  string 
)
static

Store a string as vb.

Definition at line 281 of file nutenc.c.

Referenced by add_info(), and write_sm_data().

static void put_s ( AVIOContext bc,
int64_t  val 
)
static

Definition at line 289 of file nutenc.c.

Referenced by add_info(), write_chapter(), write_mainheader(), and write_sm_data().

static void put_packet ( NUTContext nut,
AVIOContext bc,
AVIOContext dyn_bc,
int  calculate_checksum,
uint64_t  startcode 
)
static

Definition at line 314 of file nutenc.c.

Referenced by nut_write_packet(), nut_write_trailer(), and write_headers().

static void write_mainheader ( NUTContext nut,
AVIOContext bc 
)
static

Definition at line 337 of file nutenc.c.

Referenced by write_headers().

static int write_streamheader ( AVFormatContext avctx,
AVIOContext bc,
AVStream st,
int  i 
)
static

Definition at line 417 of file nutenc.c.

Referenced by write_headers().

static int add_info ( AVIOContext bc,
const char *  type,
const char *  value 
)
static

Definition at line 473 of file nutenc.c.

Referenced by write_chapter(), write_globalinfo(), and write_streaminfo().

static int write_globalinfo ( NUTContext nut,
AVIOContext bc 
)
static

Definition at line 481 of file nutenc.c.

Referenced by write_headers().

static int write_streaminfo ( NUTContext nut,
AVIOContext bc,
int  stream_id 
)
static

Definition at line 508 of file nutenc.c.

Referenced by write_headers().

static int write_chapter ( NUTContext nut,
AVIOContext bc,
int  id 
)
static

Definition at line 550 of file nutenc.c.

Referenced by write_headers().

static int write_index ( NUTContext nut,
AVIOContext bc 
)
static

Definition at line 578 of file nutenc.c.

Referenced by ffm_is_avail_data(), and nut_write_trailer().

static int write_headers ( AVFormatContext avctx,
AVIOContext bc 
)
static

Definition at line 630 of file nutenc.c.

Referenced by nut_write_header(), nut_write_packet(), and nut_write_trailer().

static int nut_write_header ( AVFormatContext s)
static

Definition at line 690 of file nutenc.c.

static int get_needed_flags ( NUTContext nut,
StreamContext nus,
FrameCode fc,
AVPacket pkt 
)
static

Definition at line 782 of file nutenc.c.

Referenced by nut_write_packet().

static int find_best_header_idx ( NUTContext nut,
AVPacket pkt 
)
static

Definition at line 810 of file nutenc.c.

Referenced by nut_write_packet().

static int write_sm_data ( AVFormatContext s,
AVIOContext bc,
AVPacket pkt,
int  is_meta 
)
static

Definition at line 829 of file nutenc.c.

Referenced by nut_write_packet().

static int nut_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 951 of file nutenc.c.

static int nut_write_trailer ( AVFormatContext s)
static

Definition at line 1172 of file nutenc.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "syncpoints", "NUT syncpoint behaviour", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, E, "syncpoints" },
{ "default", "", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, E, "syncpoints" },
{ "none", "Disable syncpoints, low overhead and unseekable", 0, AV_OPT_TYPE_CONST, {.i64 = NUT_PIPE}, INT_MIN, INT_MAX, E, "syncpoints" },
{ "timestamped", "Extend syncpoints with a wallclock timestamp", 0, AV_OPT_TYPE_CONST, {.i64 = NUT_BROADCAST}, INT_MIN, INT_MAX, E, "syncpoints" },
{ "write_index", "Write index", OFFSET(write_index), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E, },
{ NULL },
}

Definition at line 1201 of file nutenc.c.

class_name = "nutenc"

Definition at line 1211 of file nutenc.c.

item_name = av_default_item_name

Definition at line 1212 of file nutenc.c.

option = options

Definition at line 1213 of file nutenc.c.

Definition at line 1214 of file nutenc.c.

const { ... }
AVOutputFormat ff_nut_muxer
Initial value:
= {
.name = "nut",
.long_name = NULL_IF_CONFIG_SMALL("NUT"),
.mime_type = "video/x-nut",
.extensions = "nut",
.priv_data_size = sizeof(NUTContext),
.audio_codec = CONFIG_LIBVORBIS ? AV_CODEC_ID_VORBIS :
CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_MP2,
.video_codec = AV_CODEC_ID_MPEG4,
.codec_tag = ff_nut_codec_tags,
.priv_class = &class,
}

Definition at line 1217 of file nutenc.c.