FFmpeg
Data Structures | Functions | Variables
dts2pts_bsf.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/fifo.h"
#include "libavutil/tree.h"
#include "bsf.h"
#include "bsf_internal.h"
#include "cbs.h"
#include "cbs_h264.h"
#include "h264_parse.h"
#include "h264_ps.h"

Go to the source code of this file.

Data Structures

struct  DTS2PTSNode
 
struct  DTS2PTSFrame
 
struct  DTS2PTSH264Context
 
struct  DTS2PTSContext
 

Functions

static int cmp_insert (const void *key, const void *node)
 
static int cmp_find (const void *key, const void *node)
 
static int dec_poc (void *opaque, void *elem)
 
static int free_node (void *opaque, void *elem)
 
static int alloc_and_insert_node (AVBSFContext *ctx, int64_t ts, int64_t duration, int poc, int poc_diff, int gop)
 
static int h264_init (AVBSFContext *ctx)
 
static int get_mmco_reset (const H264RawSliceHeader *header)
 
static int h264_queue_frame (AVBSFContext *ctx, AVPacket *pkt, int poc, int *queued)
 
static int h264_filter (AVBSFContext *ctx)
 
static void h264_flush (AVBSFContext *ctx)
 
static int dts2pts_init (AVBSFContext *ctx)
 
static int dts2pts_filter (AVBSFContext *ctx, AVPacket *out)
 
static void dts2pts_flush (AVBSFContext *ctx)
 
static void dts2pts_close (AVBSFContext *ctx)
 

Variables

static const CodedBitstreamUnitType h264_decompose_unit_types []
 
struct {
   enum AVCodecID   id
 
   int(*   init )(AVBSFContext *ctx)
 
   int(*   filter )(AVBSFContext *ctx)
 
   void(*   flush )(AVBSFContext *ctx)
 
   size_t   fifo_size
 
func_tab []
 
static enum AVCodecID dts2pts_codec_ids []
 
const FFBitStreamFilter ff_dts2pts_bsf
 

Detailed Description

Derive PTS by reordering DTS from supported streams

Definition in file dts2pts_bsf.c.

Function Documentation

◆ cmp_insert()

static int cmp_insert ( const void *  key,
const void *  node 
)
static

Definition at line 83 of file dts2pts_bsf.c.

Referenced by alloc_and_insert_node(), and dts2pts_filter().

◆ cmp_find()

static int cmp_find ( const void *  key,
const void *  node 
)
static

Definition at line 91 of file dts2pts_bsf.c.

Referenced by dts2pts_filter().

◆ dec_poc()

static int dec_poc ( void *  opaque,
void *  elem 
)
static

Definition at line 99 of file dts2pts_bsf.c.

Referenced by h264_filter(), and h264_queue_frame().

◆ free_node()

static int free_node ( void *  opaque,
void *  elem 
)
static

Definition at line 107 of file dts2pts_bsf.c.

Referenced by dts2pts_flush().

◆ alloc_and_insert_node()

static int alloc_and_insert_node ( AVBSFContext ctx,
int64_t  ts,
int64_t  duration,
int  poc,
int  poc_diff,
int  gop 
)
static

Definition at line 115 of file dts2pts_bsf.c.

Referenced by dts2pts_filter(), and h264_queue_frame().

◆ h264_init()

static int h264_init ( AVBSFContext ctx)
static

Definition at line 150 of file dts2pts_bsf.c.

◆ get_mmco_reset()

static int get_mmco_reset ( const H264RawSliceHeader header)
static

Definition at line 164 of file dts2pts_bsf.c.

Referenced by h264_filter().

◆ h264_queue_frame()

static int h264_queue_frame ( AVBSFContext ctx,
AVPacket pkt,
int  poc,
int queued 
)
static

Definition at line 180 of file dts2pts_bsf.c.

Referenced by h264_filter().

◆ h264_filter()

static int h264_filter ( AVBSFContext ctx)
static

Definition at line 220 of file dts2pts_bsf.c.

◆ h264_flush()

static void h264_flush ( AVBSFContext ctx)
static

Definition at line 349 of file dts2pts_bsf.c.

◆ dts2pts_init()

static int dts2pts_init ( AVBSFContext ctx)
static

Definition at line 371 of file dts2pts_bsf.c.

◆ dts2pts_filter()

static int dts2pts_filter ( AVBSFContext ctx,
AVPacket out 
)
static

Definition at line 416 of file dts2pts_bsf.c.

◆ dts2pts_flush()

static void dts2pts_flush ( AVBSFContext ctx)
static

Definition at line 490 of file dts2pts_bsf.c.

Referenced by dts2pts_close().

◆ dts2pts_close()

static void dts2pts_close ( AVBSFContext ctx)
static

Definition at line 512 of file dts2pts_bsf.c.

Variable Documentation

◆ h264_decompose_unit_types

const CodedBitstreamUnitType h264_decompose_unit_types[]
static
Initial value:

Definition at line 143 of file dts2pts_bsf.c.

Referenced by h264_init().

◆ id

enum AVCodecID id

◆ init

int(* init) (AVBSFContext *ctx)

◆ filter

int(* filter) (AVBSFContext *ctx)

Definition at line 364 of file dts2pts_bsf.c.

◆ flush

void(* flush) (AVBSFContext *ctx)

◆ fifo_size

size_t fifo_size

Definition at line 366 of file dts2pts_bsf.c.

Referenced by async_read_internal(), and async_seek().

◆ func_tab

const { ... } func_tab[]
Initial value:

Referenced by dts2pts_init().

◆ dts2pts_codec_ids

enum AVCodecID dts2pts_codec_ids[]
static
Initial value:

Definition at line 523 of file dts2pts_bsf.c.

◆ ff_dts2pts_bsf

const FFBitStreamFilter ff_dts2pts_bsf
Initial value:
= {
.p.name = "dts2pts",
.p.codec_ids = dts2pts_codec_ids,
.priv_data_size = sizeof(DTS2PTSContext),
.close = dts2pts_close,
}

Definition at line 528 of file dts2pts_bsf.c.

dts2pts_init
static int dts2pts_init(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:371
DTS2PTSContext
Definition: dts2pts_bsf.c:60
h264_filter
static int h264_filter(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:220
dts2pts_close
static void dts2pts_close(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:512
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:363
H264_MAX_DPB_FRAMES
@ H264_MAX_DPB_FRAMES
Definition: h264.h:76
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:79
dts2pts_codec_ids
static enum AVCodecID dts2pts_codec_ids[]
Definition: dts2pts_bsf.c:523
dts2pts_flush
static void dts2pts_flush(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:490
filter
int(* filter)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:364
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
H264_NAL_SLICE
@ H264_NAL_SLICE
Definition: h264.h:35
H264_NAL_SPS
@ H264_NAL_SPS
Definition: h264.h:41
dts2pts_filter
static int dts2pts_filter(AVBSFContext *ctx, AVPacket *out)
Definition: dts2pts_bsf.c:416
h264_flush
static void h264_flush(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:349
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
H264_NAL_IDR_SLICE
@ H264_NAL_IDR_SLICE
Definition: h264.h:39
H264_NAL_PPS
@ H264_NAL_PPS
Definition: h264.h:42
h264_init
static int h264_init(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:150