FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
h264_mp4toannexb_bsf.c File Reference
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "bsf.h"
#include "bsf_internal.h"
#include "bytestream.h"
#include "defs.h"
#include "h264.h"

Go to the source code of this file.

Data Structures

struct  H264BSFContext
 

Macros

#define LOG_ONCE(...)
 

Enumerations

enum  PsSource { PS_OUT_OF_BAND = -1, PS_NONE = 0, PS_IN_BAND = 1 }
 

Functions

static void count_or_copy (uint8_t **out, uint64_t *out_size, const uint8_t *in, int in_size, enum PsSource ps, int copy)
 
static int h264_extradata_to_annexb (AVBSFContext *ctx, uint8_t *extradata, int extradata_size)
 
static int h264_mp4toannexb_save_ps (uint8_t **dst, int *dst_size, unsigned *dst_buf_size, const uint8_t *nal, uint32_t nal_size, int first)
 
static int h264_mp4toannexb_init (AVBSFContext *ctx)
 
static int h264_mp4toannexb_filter (AVBSFContext *ctx, AVPacket *opkt)
 
static void h264_mp4toannexb_close (AVBSFContext *ctx)
 
static void h264_mp4toannexb_flush (AVBSFContext *ctx)
 

Variables

static enum AVCodecID codec_ids []
 
const FFBitStreamFilter ff_h264_mp4toannexb_bsf
 

Macro Definition Documentation

◆ LOG_ONCE

#define LOG_ONCE (   ...)
Value:
if (j) \
av_log(__VA_ARGS__)

Enumeration Type Documentation

◆ PsSource

enum PsSource
Enumerator
PS_OUT_OF_BAND 
PS_NONE 
PS_IN_BAND 

Definition at line 48 of file h264_mp4toannexb_bsf.c.

Function Documentation

◆ count_or_copy()

static void count_or_copy ( uint8_t **  out,
uint64_t *  out_size,
const uint8_t *  in,
int  in_size,
enum PsSource  ps,
int  copy 
)
static

Definition at line 54 of file h264_mp4toannexb_bsf.c.

Referenced by h264_mp4toannexb_filter().

◆ h264_extradata_to_annexb()

static int h264_extradata_to_annexb ( AVBSFContext ctx,
uint8_t *  extradata,
int  extradata_size 
)
static

Definition at line 83 of file h264_mp4toannexb_bsf.c.

Referenced by h264_mp4toannexb_filter(), and h264_mp4toannexb_init().

◆ h264_mp4toannexb_save_ps()

static int h264_mp4toannexb_save_ps ( uint8_t **  dst,
int dst_size,
unsigned *  dst_buf_size,
const uint8_t *  nal,
uint32_t  nal_size,
int  first 
)
static

Definition at line 182 of file h264_mp4toannexb_bsf.c.

Referenced by h264_mp4toannexb_filter().

◆ h264_mp4toannexb_init()

static int h264_mp4toannexb_init ( AVBSFContext ctx)
static

Definition at line 211 of file h264_mp4toannexb_bsf.c.

◆ h264_mp4toannexb_filter()

static int h264_mp4toannexb_filter ( AVBSFContext ctx,
AVPacket opkt 
)
static

Definition at line 233 of file h264_mp4toannexb_bsf.c.

◆ h264_mp4toannexb_close()

static void h264_mp4toannexb_close ( AVBSFContext ctx)
static

Definition at line 394 of file h264_mp4toannexb_bsf.c.

◆ h264_mp4toannexb_flush()

static void h264_mp4toannexb_flush ( AVBSFContext ctx)
static

Definition at line 402 of file h264_mp4toannexb_bsf.c.

Variable Documentation

◆ codec_ids

enum AVCodecID codec_ids[]
static
Initial value:

Definition at line 411 of file h264_mp4toannexb_bsf.c.

◆ ff_h264_mp4toannexb_bsf

const FFBitStreamFilter ff_h264_mp4toannexb_bsf
Initial value:
= {
.p.name = "h264_mp4toannexb",
.p.codec_ids = codec_ids,
.priv_data_size = sizeof(H264BSFContext),
}

Definition at line 415 of file h264_mp4toannexb_bsf.c.

h264_mp4toannexb_filter
static int h264_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *opkt)
Definition: h264_mp4toannexb_bsf.c:233
filter
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
Definition: filter_design.txt:228
h264_mp4toannexb_flush
static void h264_mp4toannexb_flush(AVBSFContext *ctx)
Definition: h264_mp4toannexb_bsf.c:402
codec_ids
static enum AVCodecID codec_ids[]
Definition: h264_mp4toannexb_bsf.c:411
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
H264BSFContext
Definition: h264_mp4toannexb_bsf.c:34
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:79
h264_mp4toannexb_init
static int h264_mp4toannexb_init(AVBSFContext *ctx)
Definition: h264_mp4toannexb_bsf.c:211
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:367
h264_mp4toannexb_close
static void h264_mp4toannexb_close(AVBSFContext *ctx)
Definition: h264_mp4toannexb_bsf.c:394