FFmpeg
Data Structures | Macros | Functions | Variables
pcm_rechunk_bsf.c File Reference
#include "bsf.h"
#include "bsf_internal.h"
#include "libavutil/avassert.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  PCMContext
 

Macros

#define OFFSET(x)   offsetof(PCMContext, x)
 
#define FLAGS   (AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_BSF_PARAM)
 

Functions

static int init (AVBSFContext *ctx)
 
static void uninit (AVBSFContext *ctx)
 
static void flush (AVBSFContext *ctx)
 
static int send_packet (PCMContext *s, int nb_samples, AVPacket *pkt)
 
static void drain_packet (AVPacket *pkt, int drain_data, int drain_samples)
 
static int get_next_nb_samples (AVBSFContext *ctx)
 
static int rechunk_filter (AVBSFContext *ctx, AVPacket *pkt)
 

Variables

static const AVOption options []
 
static const AVClass pcm_rechunk_class
 
static enum AVCodecID codec_ids []
 
const FFBitStreamFilter ff_pcm_rechunk_bsf
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(PCMContext, x)

Definition at line 176 of file pcm_rechunk_bsf.c.

◆ FLAGS

Definition at line 177 of file pcm_rechunk_bsf.c.

Function Documentation

◆ init()

static int init ( AVBSFContext ctx)
static

Definition at line 39 of file pcm_rechunk_bsf.c.

◆ uninit()

static void uninit ( AVBSFContext ctx)
static

Definition at line 68 of file pcm_rechunk_bsf.c.

◆ flush()

static void flush ( AVBSFContext ctx)
static

Definition at line 75 of file pcm_rechunk_bsf.c.

◆ send_packet()

static int send_packet ( PCMContext s,
int  nb_samples,
AVPacket pkt 
)
static

Definition at line 83 of file pcm_rechunk_bsf.c.

Referenced by rechunk_filter().

◆ drain_packet()

static void drain_packet ( AVPacket pkt,
int  drain_data,
int  drain_samples 
)
static

Definition at line 90 of file pcm_rechunk_bsf.c.

Referenced by rechunk_filter().

◆ get_next_nb_samples()

static int get_next_nb_samples ( AVBSFContext ctx)
static

Definition at line 100 of file pcm_rechunk_bsf.c.

Referenced by rechunk_filter().

◆ rechunk_filter()

static int rechunk_filter ( AVBSFContext ctx,
AVPacket pkt 
)
static

Definition at line 111 of file pcm_rechunk_bsf.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "nb_out_samples", "set the number of per-packet output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
{ "n", "set the number of per-packet output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
{ "pad", "pad last packet with zeros", OFFSET(pad), AV_OPT_TYPE_BOOL, {.i64=1} , 0, 1, FLAGS },
{ "p", "pad last packet with zeros", OFFSET(pad), AV_OPT_TYPE_BOOL, {.i64=1} , 0, 1, FLAGS },
{ "frame_rate", "set number of packets per second", OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, FLAGS },
{ "r", "set number of packets per second", OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, FLAGS },
{ NULL },
}

Definition at line 178 of file pcm_rechunk_bsf.c.

◆ pcm_rechunk_class

const AVClass pcm_rechunk_class
static
Initial value:
= {
.class_name = "pcm_rechunk_bsf",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 188 of file pcm_rechunk_bsf.c.

◆ codec_ids

enum AVCodecID codec_ids[]
static

◆ ff_pcm_rechunk_bsf

const FFBitStreamFilter ff_pcm_rechunk_bsf
Initial value:
= {
.p.name = "pcm_rechunk",
.p.codec_ids = codec_ids,
.p.priv_class = &pcm_rechunk_class,
.priv_data_size = sizeof(PCMContext),
.init = init,
.close = uninit,
}

Definition at line 214 of file pcm_rechunk_bsf.c.

AV_CODEC_ID_PCM_S16LE
@ AV_CODEC_ID_PCM_S16LE
Definition: codec_id.h:330
AV_CODEC_ID_PCM_F32BE
@ AV_CODEC_ID_PCM_F32BE
Definition: codec_id.h:350
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk_bsf.c:68
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
AV_OPT_TYPE_RATIONAL
@ AV_OPT_TYPE_RATIONAL
Definition: opt.h:230
AV_CODEC_ID_PCM_S64LE
@ AV_CODEC_ID_PCM_S64LE
Definition: codec_id.h:361
FLAGS
#define FLAGS
Definition: pcm_rechunk_bsf.c:177
AV_CODEC_ID_PCM_S16BE
@ AV_CODEC_ID_PCM_S16BE
Definition: codec_id.h:331
rechunk_filter
static int rechunk_filter(AVBSFContext *ctx, AVPacket *pkt)
Definition: pcm_rechunk_bsf.c:111
OFFSET
#define OFFSET(x)
Definition: pcm_rechunk_bsf.c:176
flush
static void flush(AVBSFContext *ctx)
Definition: pcm_rechunk_bsf.c:75
AV_CODEC_ID_PCM_S8
@ AV_CODEC_ID_PCM_S8
Definition: codec_id.h:334
AV_CODEC_ID_PCM_F24LE
@ AV_CODEC_ID_PCM_F24LE
Definition: codec_id.h:364
init
static int init(AVBSFContext *ctx)
Definition: pcm_rechunk_bsf.c:39
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_CODEC_ID_PCM_S64BE
@ AV_CODEC_ID_PCM_S64BE
Definition: codec_id.h:362
AV_CODEC_ID_PCM_S24LE
@ AV_CODEC_ID_PCM_S24LE
Definition: codec_id.h:342
PCMContext
Definition: pcm_rechunk_bsf.c:26
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
pcm_rechunk_class
static const AVClass pcm_rechunk_class
Definition: pcm_rechunk_bsf.c:188
AV_CODEC_ID_PCM_F64BE
@ AV_CODEC_ID_PCM_F64BE
Definition: codec_id.h:352
AV_CODEC_ID_PCM_S32BE
@ AV_CODEC_ID_PCM_S32BE
Definition: codec_id.h:339
AV_CODEC_ID_PCM_F16LE
@ AV_CODEC_ID_PCM_F16LE
Definition: codec_id.h:363
codec_ids
static enum AVCodecID codec_ids[]
Definition: pcm_rechunk_bsf.c:195
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AV_CODEC_ID_PCM_S32LE
@ AV_CODEC_ID_PCM_S32LE
Definition: codec_id.h:338
options
static const AVOption options[]
Definition: pcm_rechunk_bsf.c:178
AV_CODEC_ID_PCM_F64LE
@ AV_CODEC_ID_PCM_F64LE
Definition: codec_id.h:353
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
AV_CODEC_ID_PCM_F32LE
@ AV_CODEC_ID_PCM_F32LE
Definition: codec_id.h:351
AV_CODEC_ID_PCM_S24BE
@ AV_CODEC_ID_PCM_S24BE
Definition: codec_id.h:343