FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
fifo.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "libavutil/thread.h"
#include "libavutil/threadmessage.h"
#include "avformat.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  FifoContext
 
struct  FifoThreadContext
 
struct  FifoMessage
 

Macros

#define FIFO_DEFAULT_QUEUE_SIZE   60
 
#define FIFO_DEFAULT_MAX_RECOVERY_ATTEMPTS   0
 
#define FIFO_DEFAULT_RECOVERY_WAIT_TIME_USEC   5000000
 
#define OFFSET(x)   offsetof(FifoContext, x)
 

Enumerations

enum  FifoMessageType { FIFO_WRITE_HEADER, FIFO_WRITE_PACKET, FIFO_FLUSH_OUTPUT }
 

Functions

static int fifo_thread_write_header (FifoThreadContext *ctx)
 
static int fifo_thread_flush_output (FifoThreadContext *ctx)
 
static int fifo_thread_write_packet (FifoThreadContext *ctx, AVPacket *pkt)
 
static int fifo_thread_write_trailer (FifoThreadContext *ctx)
 
static int fifo_thread_dispatch_message (FifoThreadContext *ctx, FifoMessage *msg)
 
static int is_recoverable (const FifoContext *fifo, int err_no)
 
static void free_message (void *msg)
 
static int fifo_thread_process_recovery_failure (FifoThreadContext *ctx, AVPacket *pkt, int err_no)
 
static int fifo_thread_attempt_recovery (FifoThreadContext *ctx, FifoMessage *msg, int err_no)
 
static int fifo_thread_recover (FifoThreadContext *ctx, FifoMessage *msg, int err_no)
 
static voidfifo_consumer_thread (void *data)
 
static int fifo_mux_init (AVFormatContext *avf, AVOutputFormat *oformat)
 
static int fifo_init (AVFormatContext *avf)
 
static int fifo_write_header (AVFormatContext *avf)
 
static int fifo_write_packet (AVFormatContext *avf, AVPacket *pkt)
 
static int fifo_write_trailer (AVFormatContext *avf)
 
static void fifo_deinit (AVFormatContext *avf)
 

Variables

static const AVOption options []
 
static const AVClass fifo_muxer_class
 
AVOutputFormat ff_fifo_muxer
 

Macro Definition Documentation

#define FIFO_DEFAULT_QUEUE_SIZE   60

Definition at line 30 of file fifo.c.

#define FIFO_DEFAULT_MAX_RECOVERY_ATTEMPTS   0

Definition at line 31 of file fifo.c.

#define FIFO_DEFAULT_RECOVERY_WAIT_TIME_USEC   5000000

Definition at line 32 of file fifo.c.

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

Definition at line 613 of file fifo.c.

Enumeration Type Documentation

Enumerator
FIFO_WRITE_HEADER 
FIFO_WRITE_PACKET 
FIFO_FLUSH_OUTPUT 

Definition at line 104 of file fifo.c.

Function Documentation

static int fifo_thread_write_header ( FifoThreadContext ctx)
static

Definition at line 115 of file fifo.c.

Referenced by fifo_thread_dispatch_message().

static int fifo_thread_flush_output ( FifoThreadContext ctx)
static

Definition at line 154 of file fifo.c.

Referenced by fifo_thread_dispatch_message().

static int fifo_thread_write_packet ( FifoThreadContext ctx,
AVPacket pkt 
)
static

Definition at line 163 of file fifo.c.

Referenced by fifo_thread_dispatch_message().

static int fifo_thread_write_trailer ( FifoThreadContext ctx)
static

Definition at line 193 of file fifo.c.

Referenced by fifo_consumer_thread(), and fifo_thread_attempt_recovery().

static int fifo_thread_dispatch_message ( FifoThreadContext ctx,
FifoMessage msg 
)
static

Definition at line 209 of file fifo.c.

Referenced by fifo_consumer_thread(), and fifo_thread_attempt_recovery().

static int is_recoverable ( const FifoContext fifo,
int  err_no 
)
static

Definition at line 233 of file fifo.c.

Referenced by fifo_thread_attempt_recovery().

static void free_message ( void msg)
static

Definition at line 252 of file fifo.c.

Referenced by fifo_init(), and fifo_thread_attempt_recovery().

static int fifo_thread_process_recovery_failure ( FifoThreadContext ctx,
AVPacket pkt,
int  err_no 
)
static

Definition at line 260 of file fifo.c.

Referenced by fifo_thread_attempt_recovery().

static int fifo_thread_attempt_recovery ( FifoThreadContext ctx,
FifoMessage msg,
int  err_no 
)
static

Definition at line 292 of file fifo.c.

Referenced by fifo_thread_recover().

static int fifo_thread_recover ( FifoThreadContext ctx,
FifoMessage msg,
int  err_no 
)
static

Definition at line 363 of file fifo.c.

Referenced by fifo_consumer_thread().

static void* fifo_consumer_thread ( void data)
static

Definition at line 389 of file fifo.c.

Referenced by fifo_write_header().

static int fifo_mux_init ( AVFormatContext avf,
AVOutputFormat oformat 
)
static

Definition at line 445 of file fifo.c.

Referenced by fifo_init().

static int fifo_init ( AVFormatContext avf)
static

Definition at line 480 of file fifo.c.

static int fifo_write_header ( AVFormatContext avf)
static

Definition at line 527 of file fifo.c.

static int fifo_write_packet ( AVFormatContext avf,
AVPacket pkt 
)
static

Definition at line 542 of file fifo.c.

static int fifo_write_trailer ( AVFormatContext avf)
static

Definition at line 584 of file fifo.c.

static void fifo_deinit ( AVFormatContext avf)
static

Definition at line 602 of file fifo.c.

Variable Documentation

const AVOption options[]
static

Definition at line 614 of file fifo.c.

const AVClass fifo_muxer_class
static
Initial value:
= {
.class_name = "Fifo muxer",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
static const AVOption options[]
Definition: fifo.c:614
av_default_item_name

Definition at line 648 of file fifo.c.

AVOutputFormat ff_fifo_muxer
Initial value:
= {
.name = "fifo",
.long_name = NULL_IF_CONFIG_SMALL("FIFO queue pseudo-muxer"),
.priv_data_size = sizeof(FifoContext),
.deinit = fifo_deinit,
.priv_class = &fifo_muxer_class,
}
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
Definition: ffmpeg.c:672
static av_cold int init(AVFilterContext *ctx)
Definition: fifo.c:54
static const AVClass fifo_muxer_class
Definition: fifo.c:648
#define AVFMT_ALLOW_FLUSH
Format allows flushing.
Definition: avformat.h:495
static void fifo_deinit(AVFormatContext *avf)
Definition: fifo.c:602
static int flags
Definition: log.c:57
static int fifo_init(AVFormatContext *avf)
Definition: fifo.c:480
static int fifo_write_header(AVFormatContext *avf)
Definition: fifo.c:527
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:94
static int fifo_write_packet(AVFormatContext *avf, AVPacket *pkt)
Definition: fifo.c:542
static int fifo_write_trailer(AVFormatContext *avf)
Definition: fifo.c:584
#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:337
#define AVFMT_TS_NEGATIVE
Format allows muxing negative timestamps.
Definition: avformat.h:501

Definition at line 655 of file fifo.c.