Go to the documentation of this file.
94 "Left and right sizes differ (%dx%d vs %dx%d).\n",
100 "Left and right time bases differ (%d/%d vs %d/%d).\n",
101 time_base.
num, time_base.
den,
107 "Left and right framerates differ (%d/%d vs %d/%d).\n",
108 frame_rate.
num, frame_rate.
den,
110 ctx->inputs[
RIGHT]->frame_rate.den);
160 int lines =
out->height;
167 for (
i = 0;
i < lines;
i++) {
174 for (j = 0; j <
length; j++) {
176 if ((
s->pix_desc->log2_chroma_w ||
177 s->pix_desc->log2_chroma_h) &&
179 *
dstp++ = (*leftp + *rightp) / 2;
180 *
dstp++ = (*leftp + *rightp) / 2;
191 for (
i = 0;
i < 2;
i++) {
194 int sub_w =
s->input_views[
i]->width >>
s->pix_desc->log2_chroma_w;
196 src[0] =
s->input_views[
i]->data[0];
197 src[1] =
s->input_views[
i]->data[1];
198 src[2] =
s->input_views[
i]->data[2];
200 dst[0] =
out->data[0] +
i *
s->input_views[
i]->width;
201 dst[1] =
out->data[1] +
i * sub_w;
202 dst[2] =
out->data[2] +
i * sub_w;
205 s->input_views[
i]->format,
206 s->input_views[
i]->width,
207 s->input_views[
i]->height);
220 for (
i = 0;
i < 2;
i++) {
224 int sub_h =
s->input_views[
i]->height >>
s->pix_desc->log2_chroma_h;
226 src[0] =
s->input_views[
i]->data[0];
227 src[1] =
s->input_views[
i]->data[1];
228 src[2] =
s->input_views[
i]->data[2];
230 dst[0] =
out->data[0] +
i *
out->linesize[0] *
231 (interleaved +
s->input_views[
i]->height * (1 - interleaved));
232 dst[1] =
out->data[1] +
i *
out->linesize[1] *
233 (interleaved + sub_h * (1 - interleaved));
234 dst[2] =
out->data[2] +
i *
out->linesize[2] *
235 (interleaved + sub_h * (1 - interleaved));
237 linesizes[0] =
out->linesize[0] +
238 interleaved *
out->linesize[0];
239 linesizes[1] =
out->linesize[1] +
240 interleaved *
out->linesize[1];
241 linesizes[2] =
out->linesize[2] +
242 interleaved *
out->linesize[2];
245 s->input_views[
i]->format,
246 s->input_views[
i]->width,
247 s->input_views[
i]->height);
295 for (
i = 0;
i < 2;
i++) {
296 if (!
s->input_views[
i]) {
312 if (!(
s->input_views[0] &&
s->input_views[1]))
316 s->double_pts =
s->input_views[
LEFT]->pts;
318 for (
i = 0;
i < 2;
i++) {
320 s->input_views[
i]->pts =
s->double_pts++;
326 stereo->
type =
s->format;
351 for (
i = 0;
i < 2;
i++)
360 stereo->
type =
s->format;
366 #define OFFSET(x) offsetof(FramepackContext, x)
367 #define V AV_OPT_FLAG_VIDEO_PARAM
416 .priv_class = &framepack_class,
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
AVPixelFormat
Pixel format.
@ AV_STEREO3D_VIEW_LEFT
Frame contains only the left view.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static av_always_inline void spatial_frame_pack(AVFilterLink *outlink, AVFrame *dst)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
static const AVFilterPad framepack_outputs[]
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
static int try_push_frame(AVFilterContext *ctx)
const char * name
Filter name.
A link between two filters.
@ AV_STEREO3D_VIEW_RIGHT
Frame contains only the right view.
static int filter_frame_right(AVFilterLink *inlink, AVFrame *frame)
@ AV_STEREO3D_SIDEBYSIDE
Views are next to each other.
void * priv
private data for use by the filter
A filter pad used for either input or output.
static int filter_frame_left(AVFilterLink *inlink, AVFrame *frame)
@ AV_STEREO3D_FRAMESEQUENCE
Views are alternated temporally.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void vertical_frame_pack(AVFilterLink *outlink, AVFrame *out, int interleaved)
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
@ AV_STEREO3D_LINES
Views are packed per line, as if interlaced.
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
#define AV_CEIL_RSHIFT(a, b)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
static const AVFilterPad outputs[]
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
AVFILTER_DEFINE_CLASS(framepack)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
static int query_formats(AVFilterContext *ctx)
Describe the class of an AVClass context structure.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
AVFrame * input_views[2]
input frames
Rational number (pair of numerator and denominator).
static void horizontal_frame_pack(AVFilterLink *outlink, AVFrame *out, int interleaved)
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
int64_t double_pts
new pts for frameseq mode
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int format
agreed upon media format
#define AV_NOPTS_VALUE
Undefined timestamp value.
enum AVStereo3DType format
frame pack type output
AVFilterContext * src
source filter
#define i(width, name, range_min, range_max)
static int config_output(AVFilterLink *outlink)
int w
agreed upon image width
@ AV_STEREO3D_TOPBOTTOM
Views are on top of each other.
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
const char * name
Pad name.
static av_cold void framepack_uninit(AVFilterContext *ctx)
static const AVOption framepack_options[]
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
@ AV_STEREO3D_COLUMNS
Views are packed per column.
enum AVStereo3DType type
How views are packed within the video.
const AVPixFmtDescriptor * pix_desc
agreed pixel format
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], const uint8_t *src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height)
Copy image in src_data to dst_data.
int h
agreed upon image height
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static int request_frame(AVFilterLink *outlink)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
AVStereo3D * av_stereo3d_create_side_data(AVFrame *frame)
Allocate a complete AVFrameSideData and add it to the frame.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
enum AVStereo3DView view
Determines which views are packed.
static const AVFilterPad framepack_inputs[]
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
AVStereo3DType
List of possible 3D Types.
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static av_cold int uninit(AVCodecContext *avctx)
Stereo 3D type: this structure describes how two videos are packed within a single video surface,...
static enum AVPixelFormat formats_supported[]