FFmpeg
Data Structures | Macros | Functions | Variables
fifo_muxer.c File Reference
#include <stdlib.h>
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "libavutil/avassert.h"
#include "libavformat/avformat.h"
#include "libavformat/url.h"
#include "libavformat/network.h"

Go to the source code of this file.

Data Structures

struct  FailingMuxerPacketData
 
struct  TestCase
 

Macros

#define MAX_TST_PACKETS   128
 
#define SLEEPTIME_50_MS   50000
 
#define SLEEPTIME_10_MS   10000
 
#define BUFFER_SIZE   64
 

Functions

static int prepare_packet (AVPacket *pkt, const FailingMuxerPacketData *pkt_data, int64_t pts)
 
static int initialize_fifo_tst_muxer_chain (AVFormatContext **oc)
 
static int fifo_basic_test (AVFormatContext *oc, AVDictionary **opts, const FailingMuxerPacketData *pkt_data)
 
static int fifo_overflow_drop_test (AVFormatContext *oc, AVDictionary **opts, const FailingMuxerPacketData *data)
 
static int run_test (const TestCase *test)
 
int main (int argc, char *argv[])
 

Variables

const TestCase tests []
 

Macro Definition Documentation

◆ MAX_TST_PACKETS

#define MAX_TST_PACKETS   128

Definition at line 30 of file fifo_muxer.c.

◆ SLEEPTIME_50_MS

#define SLEEPTIME_50_MS   50000

Definition at line 31 of file fifo_muxer.c.

◆ SLEEPTIME_10_MS

#define SLEEPTIME_10_MS   10000

Definition at line 32 of file fifo_muxer.c.

◆ BUFFER_SIZE

#define BUFFER_SIZE   64

Definition at line 200 of file fifo_muxer.c.

Function Documentation

◆ prepare_packet()

static int prepare_packet ( AVPacket pkt,
const FailingMuxerPacketData pkt_data,
int64_t  pts 
)
static

Definition at line 42 of file fifo_muxer.c.

Referenced by fifo_basic_test(), and fifo_overflow_drop_test().

◆ initialize_fifo_tst_muxer_chain()

static int initialize_fifo_tst_muxer_chain ( AVFormatContext **  oc)
static

Definition at line 58 of file fifo_muxer.c.

Referenced by run_test().

◆ fifo_basic_test()

static int fifo_basic_test ( AVFormatContext oc,
AVDictionary **  opts,
const FailingMuxerPacketData pkt_data 
)
static

Definition at line 80 of file fifo_muxer.c.

◆ fifo_overflow_drop_test()

static int fifo_overflow_drop_test ( AVFormatContext oc,
AVDictionary **  opts,
const FailingMuxerPacketData data 
)
static

Definition at line 133 of file fifo_muxer.c.

◆ run_test()

static int run_test ( const TestCase test)
static

Definition at line 202 of file fifo_muxer.c.

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 273 of file fifo_muxer.c.

Variable Documentation

◆ tests

const TestCase tests[]
Initial value:
= {
{fifo_basic_test, "nonfail test", NULL,1, 0, 0, {0, 0, 0}},
{fifo_basic_test, "recovery test", "attempt_recovery=1:recovery_wait_time=0",
0, 0, 0, {AVERROR(ETIMEDOUT), 3, 0}},
{fifo_basic_test, "overflow without packet dropping","queue_size=3",
1, 0, 0, {0, 0, SLEEPTIME_10_MS}},
{fifo_overflow_drop_test, "overflow with packet dropping", "queue_size=3:drop_pkts_on_overflow=1",
0, 0, 0, {0, 0, SLEEPTIME_50_MS}},
{NULL}
}

Definition at line 245 of file fifo_muxer.c.

Referenced by checkasm_check_h264pred(), and main().

AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
fifo_overflow_drop_test
static int fifo_overflow_drop_test(AVFormatContext *oc, AVDictionary **opts, const FailingMuxerPacketData *data)
Definition: fifo_muxer.c:133
SLEEPTIME_10_MS
#define SLEEPTIME_10_MS
Definition: fifo_muxer.c:32
NULL
#define NULL
Definition: coverity.c:32
fifo_basic_test
static int fifo_basic_test(AVFormatContext *oc, AVDictionary **opts, const FailingMuxerPacketData *pkt_data)
Definition: fifo_muxer.c:80
SLEEPTIME_50_MS
#define SLEEPTIME_50_MS
Definition: fifo_muxer.c:31