libgpac
Documentation of the core library of GPAC
Loading...
Searching...
No Matches
vcrop.c File Reference
#include <gpac/filters.h>
#include <gpac/list.h>
#include <gpac/constants.h>
#include <gpac/network.h>

Data Structures

struct  GF_VCropCtx
 
struct  GF_VCropFrame
 

Macros

#define GET_DIM(_dst, _i, _s)
 
#define ROUND_IT(_a)   { if ((ctx->round==0) || (ctx->round==2)) { (_a)++; } else { (_a)--; } }
 
#define OFFS(_n)   #_n, offsetof(GF_VCropCtx, _n)
 

Functions

GF_Err vcrop_frame_get_plane (GF_FilterFrameInterface *frame, u32 plane_idx, const u8 **outPlane, u32 *outStride)
 
void vcrop_packet_destruct (GF_Filter *filter, GF_FilterPid *pid, GF_FilterPacket *pck)
 
static GF_Err vcrop_process (GF_Filter *filter)
 
static Bool parse_crop_props (GF_VCropCtx *ctx, u32 src_w, u32 src_h, GF_PixelFormat pfmt)
 
static GF_Err vcrop_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
void vcrop_finalize (GF_Filter *filter)
 
const GF_FilterRegister * vcrop_register (GF_FilterSession *session)
 

Variables

static GF_FilterArgs VCropArgs []
 
static const GF_FilterCapability VCropCaps []
 
GF_FilterRegister VCropRegister
 

Data Structure Documentation

◆ GF_VCropCtx

struct GF_VCropCtx
Data Fields
const char * wnd
Bool copy
u32 round
Bool initialized
GF_FilterPid * ipid
GF_FilterPid * opid
u32 w
u32 h
u32 stride
u32 s_pfmt
GF_Fraction ar
Bool passthrough
u32 dst_stride[5]
u32 src_stride[5]
u32 nb_planes
u32 nb_src_planes
u32 out_size
u32 out_src_size
u32 src_uv_height
u32 dst_uv_height
Bool use_reference
u32 dst_width
u32 dst_height
s32 src_x
s32 src_y
Bool packed_422
GF_List * frames
GF_List * frames_res

◆ GF_VCropFrame

struct GF_VCropFrame
Data Fields
GF_FilterFrameInterface frame_ifce
GF_FilterPacket * pck
u8 * planes[5]
u32 stride[5]
GF_VCropCtx * ctx

Macro Definition Documentation

◆ GET_DIM

#define GET_DIM (   _dst,
  _i,
  _s 
)
Value:
if (dim_pc[_i]) \
_dst = (dim[_i] * (s32) _s / 100) + dim_off[_i]; \
else \
_dst = dim[_i] + dim_off[_i]; \
int32_t s32
Definition setup.h:325

◆ ROUND_IT

#define ROUND_IT (   _a)    { if ((ctx->round==0) || (ctx->round==2)) { (_a)++; } else { (_a)--; } }

◆ OFFS

#define OFFS (   _n)    #_n, offsetof(GF_VCropCtx, _n)

Function Documentation

◆ vcrop_frame_get_plane()

GF_Err vcrop_frame_get_plane ( GF_FilterFrameInterface frame,
u32  plane_idx,
const u8 **  outPlane,
u32 outStride 
)

◆ vcrop_packet_destruct()

void vcrop_packet_destruct ( GF_Filter *  filter,
GF_FilterPid *  pid,
GF_FilterPacket *  pck 
)

◆ vcrop_process()

static GF_Err vcrop_process ( GF_Filter *  filter)
static

◆ parse_crop_props()

static Bool parse_crop_props ( GF_VCropCtx ctx,
u32  src_w,
u32  src_h,
GF_PixelFormat  pfmt 
)
static

◆ vcrop_configure_pid()

static GF_Err vcrop_configure_pid ( GF_Filter *  filter,
GF_FilterPid *  pid,
Bool  is_remove 
)
static

◆ vcrop_finalize()

void vcrop_finalize ( GF_Filter *  filter)

◆ vcrop_register()

const GF_FilterRegister * vcrop_register ( GF_FilterSession *  session)

Variable Documentation

◆ VCropArgs

GF_FilterArgs VCropArgs[]
static
Initial value:
=
{
{ OFFS(wnd), "size of output to crop, indicated as TxLxWxH. If % is indicated after a number, the value is in percent of the source width (for L and W) or height (for T and H). An absolute offset (+x, -x) can be added after percent", GF_PROP_STRING, NULL, NULL, 0},
{ OFFS(copy), "copy the source pixels. By default the filter will try to forward crop frames by adjusting offsets and strides of the source if possible (window contained in frame)", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(round), "adjust dimension to be a multiple of 2\n"
"- up: up rounding\n"
"- down: down rounding\n"
"- allup: up rounding on formats that do not require it (RGB, YUV444)\n"
"- alldown: down rounding on formats that do not require it (RGB, YUV444)", GF_PROP_UINT, "up", "up|down|allup|alldown", GF_FS_ARG_HINT_ADVANCED},
{0}
}
@ GF_FS_ARG_HINT_ADVANCED
Definition filters.h:1887
@ GF_PROP_BOOL
Definition filters.h:767
@ GF_PROP_STRING
Definition filters.h:785
@ GF_PROP_UINT
Definition filters.h:761
#define OFFS(_n)
Definition vcrop.c:589

◆ VCropCaps

const GF_FilterCapability VCropCaps[]
static
Initial value:
=
{
}
@ GF_CODECID_RAW
Definition constants.h:577
@ GF_STREAM_VISUAL
Definition constants.h:64
#define GF_CAPS_OUTPUT
Definition filters.h:2013
#define CAP_UINT(_f, _a, _b)
Definition filters.h:1955
#define GF_CAPS_INPUT
Definition filters.h:2001
@ GF_PROP_PID_CODECID
Definition filters.h:1020
@ GF_PROP_PID_STREAM_TYPE
Definition filters.h:1016

◆ VCropRegister

GF_FilterRegister VCropRegister
Initial value:
= {
.name = "vcrop",
.private_size = sizeof(GF_VCropCtx),
.configure_pid = vcrop_configure_pid,
.process = vcrop_process,
.finalize = vcrop_finalize,
}
#define SETCAPS(__struct)
Definition filters.h:2144
@ GF_FS_REG_ALLOW_CYCLIC
Definition filters.h:2180
@ GF_FS_REG_EXPLICIT_ONLY
Definition filters.h:2173
attribute Array args
Definition jsf.idl:24
static GF_Err vcrop_process(GF_Filter *filter)
Definition vcrop.c:94
static const GF_FilterCapability VCropCaps[]
Definition vcrop.c:602
static GF_FilterArgs VCropArgs[]
Definition vcrop.c:590
static GF_Err vcrop_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
Definition vcrop.c:447
void vcrop_finalize(GF_Filter *filter)
Definition vcrop.c:569
Definition vcrop.c:32