FFmpeg
Data Structures | Functions | Variables
dts2pts.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.c.

Function Documentation

◆ cmp_insert()

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

Definition at line 83 of file dts2pts.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.c.

Referenced by dts2pts_filter().

◆ dec_poc()

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

Definition at line 101 of file dts2pts.c.

Referenced by h264_filter(), and h264_queue_frame().

◆ free_node()

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

Definition at line 109 of file dts2pts.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 117 of file dts2pts.c.

Referenced by dts2pts_filter(), and h264_queue_frame().

◆ h264_init()

static int h264_init ( AVBSFContext ctx)
static

Definition at line 152 of file dts2pts.c.

◆ get_mmco_reset()

static int get_mmco_reset ( const H264RawSliceHeader header)
static

Definition at line 166 of file dts2pts.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 182 of file dts2pts.c.

Referenced by h264_filter().

◆ h264_filter()

static int h264_filter ( AVBSFContext ctx)
static

Definition at line 222 of file dts2pts.c.

◆ h264_flush()

static void h264_flush ( AVBSFContext ctx)
static

Definition at line 351 of file dts2pts.c.

◆ dts2pts_init()

static int dts2pts_init ( AVBSFContext ctx)
static

Definition at line 373 of file dts2pts.c.

◆ dts2pts_filter()

static int dts2pts_filter ( AVBSFContext ctx,
AVPacket out 
)
static

Definition at line 418 of file dts2pts.c.

◆ dts2pts_flush()

static void dts2pts_flush ( AVBSFContext ctx)
static

Definition at line 494 of file dts2pts.c.

Referenced by dts2pts_close().

◆ dts2pts_close()

static void dts2pts_close ( AVBSFContext ctx)
static

Definition at line 516 of file dts2pts.c.

Variable Documentation

◆ h264_decompose_unit_types

const CodedBitstreamUnitType h264_decompose_unit_types[]
static
Initial value:

Definition at line 145 of file dts2pts.c.

Referenced by h264_init().

◆ id

enum AVCodecID id

◆ init

int(* init) (AVBSFContext *ctx)

◆ filter

int(* filter) (AVBSFContext *ctx)

Definition at line 366 of file dts2pts.c.

◆ flush

void(* flush) (AVBSFContext *ctx)

◆ fifo_size

size_t fifo_size

Definition at line 368 of file dts2pts.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 527 of file dts2pts.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 532 of file dts2pts.c.

H264_NAL_PPS
@ H264_NAL_PPS
Definition: h264.h:42
H264_NAL_SLICE
@ H264_NAL_SLICE
Definition: h264.h:35
dts2pts_flush
static void dts2pts_flush(AVBSFContext *ctx)
Definition: dts2pts.c:494
DTS2PTSContext
Definition: dts2pts.c:60
dts2pts_filter
static int dts2pts_filter(AVBSFContext *ctx, AVPacket *out)
Definition: dts2pts.c:418
h264_init
static int h264_init(AVBSFContext *ctx)
Definition: dts2pts.c:152
H264_NAL_SPS
@ H264_NAL_SPS
Definition: h264.h:41
filter
int(* filter)(AVBSFContext *ctx)
Definition: dts2pts.c:366
h264_flush
static void h264_flush(AVBSFContext *ctx)
Definition: dts2pts.c:351
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:79
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts.c:367
dts2pts_init
static int dts2pts_init(AVBSFContext *ctx)
Definition: dts2pts.c:373
dts2pts_codec_ids
static enum AVCodecID dts2pts_codec_ids[]
Definition: dts2pts.c:527
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
H264_NAL_IDR_SLICE
@ H264_NAL_IDR_SLICE
Definition: h264.h:39
H264_MAX_DPB_FRAMES
@ H264_MAX_DPB_FRAMES
Definition: h264.h:76
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
h264_filter
static int h264_filter(AVBSFContext *ctx)
Definition: dts2pts.c:222
dts2pts_close
static void dts2pts_close(AVBSFContext *ctx)
Definition: dts2pts.c:516