FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_framepack.c File Reference

Generate a frame packed video, by combining two views in a single surface. More...

#include <string.h>
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/rational.h"
#include "libavutil/stereo3d.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  FramepackContext
 

Macros

#define LEFT   0
 
#define RIGHT   1
 
#define OFFSET(x)   offsetof(FramepackContext, x)
 
#define V   AV_OPT_FLAG_VIDEO_PARAM
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static av_cold void framepack_uninit (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static void horizontal_frame_pack (FramepackContext *s, AVFrame *dst, int interleaved)
 
static void vertical_frame_pack (FramepackContext *s, AVFrame *dst, int interleaved)
 
static av_always_inline void spatial_frame_pack (FramepackContext *s, AVFrame *dst)
 
static int filter_frame_left (AVFilterLink *inlink, AVFrame *frame)
 
static int filter_frame_right (AVFilterLink *inlink, AVFrame *frame)
 
static int request_frame (AVFilterLink *outlink)
 

Variables

static enum AVPixelFormat formats_supported []
 
static const AVOption options []
 
static const AVClass framepack_class
 
static const AVFilterPad framepack_inputs []
 
static const AVFilterPad framepack_outputs []
 
AVFilter ff_vf_framepack
 

Detailed Description

Generate a frame packed video, by combining two views in a single surface.

Definition in file vf_framepack.c.

Macro Definition Documentation

#define LEFT   0

Definition at line 39 of file vf_framepack.c.

#define RIGHT   1
#define OFFSET (   x)    offsetof(FramepackContext, x)

Definition at line 314 of file vf_framepack.c.

#define V   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 315 of file vf_framepack.c.

Function Documentation

static int query_formats ( AVFilterContext ctx)
static

Definition at line 61 of file vf_framepack.c.

static av_cold void framepack_uninit ( AVFilterContext ctx)
static

Definition at line 68 of file vf_framepack.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 77 of file vf_framepack.c.

static void horizontal_frame_pack ( FramepackContext s,
AVFrame dst,
int  interleaved 
)
static

Definition at line 144 of file vf_framepack.c.

Referenced by spatial_frame_pack().

static void vertical_frame_pack ( FramepackContext s,
AVFrame dst,
int  interleaved 
)
static

Definition at line 187 of file vf_framepack.c.

Referenced by spatial_frame_pack().

static av_always_inline void spatial_frame_pack ( FramepackContext s,
AVFrame dst 
)
static

Definition at line 216 of file vf_framepack.c.

Referenced by request_frame().

static int filter_frame_left ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 234 of file vf_framepack.c.

static int filter_frame_right ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 241 of file vf_framepack.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 248 of file vf_framepack.c.

Variable Documentation

enum AVPixelFormat formats_supported[]
static
const AVOption options[]
static
Initial value:
= {
{ "format", "Frame pack output format", OFFSET(format), AV_OPT_TYPE_INT,
{ .i64 = AV_STEREO3D_SIDEBYSIDE }, 0, INT_MAX, .flags = V, .unit = "format" },
{ "sbs", "Views are packed next to each other", 0, AV_OPT_TYPE_CONST,
{ .i64 = AV_STEREO3D_SIDEBYSIDE }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
{ "tab", "Views are packed on top of each other", 0, AV_OPT_TYPE_CONST,
{ .i64 = AV_STEREO3D_TOPBOTTOM }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
{ "frameseq", "Views are one after the other", 0, AV_OPT_TYPE_CONST,
{ .i64 = AV_STEREO3D_FRAMESEQUENCE }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
{ "lines", "Views are interleaved by lines", 0, AV_OPT_TYPE_CONST,
{ .i64 = AV_STEREO3D_LINES }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
{ "columns", "Views are interleaved by columns", 0, AV_OPT_TYPE_CONST,
{ .i64 = AV_STEREO3D_COLUMNS }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
{ NULL },
}

Definition at line 316 of file vf_framepack.c.

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

Definition at line 332 of file vf_framepack.c.

const AVFilterPad framepack_inputs[]
static
Initial value:
= {
{
.name = "left",
.filter_frame = filter_frame_left,
.needs_fifo = 1,
},
{
.name = "right",
.filter_frame = filter_frame_right,
.needs_fifo = 1,
},
{ NULL }
}

Definition at line 339 of file vf_framepack.c.

const AVFilterPad framepack_outputs[]
static
Initial value:
= {
{
.name = "packed",
.config_props = config_output,
.request_frame = request_frame,
},
{ NULL }
}

Definition at line 355 of file vf_framepack.c.

AVFilter ff_vf_framepack
Initial value:
= {
.name = "framepack",
.description = NULL_IF_CONFIG_SMALL("Generate a frame packed stereoscopic video."),
.priv_size = sizeof(FramepackContext),
.priv_class = &framepack_class,
}

Definition at line 365 of file vf_framepack.c.