FFmpeg  4.0
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.

Referenced by fifo_overflow_drop_test().

◆ 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.

Referenced by run_test().

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}
}
#define NULL
Definition: coverity.c:32
#define SLEEPTIME_50_MS
Definition: fifo_muxer.c:31
#define AVERROR(e)
Definition: error.h:43
static int fifo_basic_test(AVFormatContext *oc, AVDictionary **opts, const FailingMuxerPacketData *pkt_data)
Definition: fifo_muxer.c:80
#define SLEEPTIME_10_MS
Definition: fifo_muxer.c:32
static int fifo_overflow_drop_test(AVFormatContext *oc, AVDictionary **opts, const FailingMuxerPacketData *data)
Definition: fifo_muxer.c:133

Definition at line 245 of file fifo_muxer.c.

Referenced by checkasm_check_h264pred(), and main().