FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
h264_mp4toannexb.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_filter_ps (H264BSFContext *s, const uint8_t *buf, const uint8_t *buf_end)
 
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.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.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.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.c.

Referenced by h264_mp4toannexb_filter_ps().

◆ h264_mp4toannexb_filter_ps()

static int h264_mp4toannexb_filter_ps ( H264BSFContext s,
const uint8_t *  buf,
const uint8_t *  buf_end 
)
static

Definition at line 211 of file h264_mp4toannexb.c.

Referenced by h264_mp4toannexb_filter().

◆ h264_mp4toannexb_init()

static int h264_mp4toannexb_init ( AVBSFContext ctx)
static

Definition at line 254 of file h264_mp4toannexb.c.

◆ h264_mp4toannexb_filter()

static int h264_mp4toannexb_filter ( AVBSFContext ctx,
AVPacket opkt 
)
static

Definition at line 276 of file h264_mp4toannexb.c.

◆ h264_mp4toannexb_close()

static void h264_mp4toannexb_close ( AVBSFContext ctx)
static

Definition at line 427 of file h264_mp4toannexb.c.

◆ h264_mp4toannexb_flush()

static void h264_mp4toannexb_flush ( AVBSFContext ctx)
static

Definition at line 435 of file h264_mp4toannexb.c.

Variable Documentation

◆ codec_ids

enum AVCodecID codec_ids[]
static
Initial value:

Definition at line 444 of file h264_mp4toannexb.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 448 of file h264_mp4toannexb.c.

filter
void(* filter)(uint8_t *src, int stride, int qscale)
Definition: h263dsp.c:29
codec_ids
static enum AVCodecID codec_ids[]
Definition: h264_mp4toannexb.c:444
h264_mp4toannexb_init
static int h264_mp4toannexb_init(AVBSFContext *ctx)
Definition: h264_mp4toannexb.c:254
H264BSFContext
Definition: h264_mp4toannexb.c:34
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:79
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts.c:368
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:366
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
h264_mp4toannexb_close
static void h264_mp4toannexb_close(AVBSFContext *ctx)
Definition: h264_mp4toannexb.c:427
h264_mp4toannexb_filter
static int h264_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *opkt)
Definition: h264_mp4toannexb.c:276
h264_mp4toannexb_flush
static void h264_mp4toannexb_flush(AVBSFContext *ctx)
Definition: h264_mp4toannexb.c:435