FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
hdsenc.c File Reference
#include "config.h"
#include <float.h>
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
#include "os_support.h"
#include "libavutil/avstring.h"
#include "libavutil/base64.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  Fragment
 
struct  OutputStream
 
struct  HDSContext
 

Macros

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

Functions

static int parse_header (OutputStream *os, const uint8_t *buf, int buf_size)
 
static int hds_write (void *opaque, uint8_t *buf, int buf_size)
 
static void hds_free (AVFormatContext *s)
 
static int write_manifest (AVFormatContext *s, int final)
 
static void update_size (AVIOContext *out, int64_t pos)
 
static int write_abst (AVFormatContext *s, OutputStream *os, int final)
 
static int init_file (AVFormatContext *s, OutputStream *os, int64_t start_ts)
 
static void close_file (AVFormatContext *s, OutputStream *os)
 
static int hds_write_header (AVFormatContext *s)
 
static int add_fragment (OutputStream *os, const char *file, int64_t start_time, int64_t duration)
 
static int hds_flush (AVFormatContext *s, OutputStream *os, int final, int64_t end_ts)
 
static int hds_write_packet (AVFormatContext *s, AVPacket *pkt)
 
static int hds_write_trailer (AVFormatContext *s)
 

Variables

static const AVOption options []
 
static const AVClass hds_class
 
AVOutputFormat ff_hds_muxer
 

Macro Definition Documentation

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

Definition at line 566 of file hdsenc.c.

Definition at line 567 of file hdsenc.c.

Function Documentation

static int parse_header ( OutputStream os,
const uint8_t buf,
int  buf_size 
)
static

Definition at line 79 of file hdsenc.c.

Referenced by hds_write().

static int hds_write ( void opaque,
uint8_t buf,
int  buf_size 
)
static

Definition at line 118 of file hdsenc.c.

Referenced by hds_write_header().

static void hds_free ( AVFormatContext s)
static

Definition at line 135 of file hdsenc.c.

Referenced by hds_write_header(), and hds_write_trailer().

static int write_manifest ( AVFormatContext s,
int  final 
)
static

Definition at line 161 of file hdsenc.c.

Referenced by hds_write_header(), and hds_write_trailer().

static void update_size ( AVIOContext out,
int64_t  pos 
)
static

Definition at line 209 of file hdsenc.c.

Referenced by write_abst().

static int write_abst ( AVFormatContext s,
OutputStream os,
int  final 
)
static

Definition at line 220 of file hdsenc.c.

Referenced by hds_flush(), and hds_write_header().

static int init_file ( AVFormatContext s,
OutputStream os,
int64_t  start_ts 
)
static

Definition at line 289 of file hdsenc.c.

Referenced by hds_flush(), and hds_write_header().

static void close_file ( AVFormatContext s,
OutputStream os 
)
static

Definition at line 305 of file hdsenc.c.

Referenced by hds_flush().

static int hds_write_header ( AVFormatContext s)
static

Definition at line 314 of file hdsenc.c.

static int add_fragment ( OutputStream os,
const char *  file,
int64_t  start_time,
int64_t  duration 
)
static

Definition at line 436 of file hdsenc.c.

Referenced by hds_flush().

static int hds_flush ( AVFormatContext s,
OutputStream os,
int  final,
int64_t  end_ts 
)
static

Definition at line 464 of file hdsenc.c.

Referenced by hds_write_packet(), and hds_write_trailer().

static int hds_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 512 of file hdsenc.c.

static int hds_write_trailer ( AVFormatContext s)
static

Definition at line 542 of file hdsenc.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "window_size", "number of fragments kept in the manifest", OFFSET(window_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, E },
{ "extra_window_size", "number of fragments kept outside of the manifest before removing from disk", OFFSET(extra_window_size), AV_OPT_TYPE_INT, { .i64 = 5 }, 0, INT_MAX, E },
{ "min_frag_duration", "minimum fragment duration (in microseconds)", OFFSET(min_frag_duration), AV_OPT_TYPE_INT64, { .i64 = 10000000 }, 0, INT_MAX, E },
{ "remove_at_exit", "remove all fragments when finished", OFFSET(remove_at_exit), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define E
Definition: hdsenc.c:567
#define OFFSET(x)
Definition: hdsenc.c:566

Definition at line 568 of file hdsenc.c.

const AVClass hds_class
static
Initial value:
= {
.class_name = "HDS muxer",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
av_default_item_name
static const AVOption options[]
Definition: hdsenc.c:568

Definition at line 576 of file hdsenc.c.

AVOutputFormat ff_hds_muxer
Initial value:
= {
.name = "hds",
.long_name = NULL_IF_CONFIG_SMALL("HDS Muxer"),
.priv_data_size = sizeof(HDSContext),
.audio_codec = AV_CODEC_ID_AAC,
.video_codec = AV_CODEC_ID_H264,
.priv_class = &hds_class,
}
static int hds_write_header(AVFormatContext *s)
Definition: hdsenc.c:314
static const AVClass hds_class
Definition: hdsenc.c:576
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static int hds_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: hdsenc.c:512
static int hds_write_trailer(AVFormatContext *s)
Definition: hdsenc.c:542
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:94
#define AVFMT_GLOBALHEADER
Format wants global header.
Definition: avformat.h:485
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
Definition: ffmpeg.c:645
static int flags
Definition: cpu.c:47
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:478
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:344

Definition at line 583 of file hdsenc.c.