FFmpeg
Files | Data Structures | Macros | Enumerations | Functions
Stereo3D types and functions

Files

file  stereo3d.h
 

Data Structures

struct  AVStereo3D
 Stereo 3D type: this structure describes how two videos are packed within a single video surface, with additional information as needed. More...
 

Macros

#define AV_STEREO3D_FLAG_INVERT   (1 << 0)
 Inverted views, Right/Bottom represents the left view. More...
 

Enumerations

enum  AVStereo3DType {
  AV_STEREO3D_2D, AV_STEREO3D_SIDEBYSIDE, AV_STEREO3D_TOPBOTTOM, AV_STEREO3D_FRAMESEQUENCE,
  AV_STEREO3D_CHECKERBOARD, AV_STEREO3D_SIDEBYSIDE_QUINCUNX, AV_STEREO3D_LINES, AV_STEREO3D_COLUMNS,
  AV_STEREO3D_UNSPEC
}
 List of possible 3D Types. More...
 
enum  AVStereo3DView { AV_STEREO3D_VIEW_PACKED, AV_STEREO3D_VIEW_LEFT, AV_STEREO3D_VIEW_RIGHT, AV_STEREO3D_VIEW_UNSPEC }
 List of possible view types. More...
 
enum  AVStereo3DPrimaryEye { AV_PRIMARY_EYE_NONE, AV_PRIMARY_EYE_LEFT, AV_PRIMARY_EYE_RIGHT }
 List of possible primary eyes. More...
 

Functions

AVStereo3Dav_stereo3d_alloc (void)
 Allocate an AVStereo3D structure and set its fields to default values. More...
 
AVStereo3Dav_stereo3d_alloc_size (size_t *size)
 Allocate an AVStereo3D structure and set its fields to default values. More...
 
AVStereo3Dav_stereo3d_create_side_data (AVFrame *frame)
 Allocate a complete AVFrameSideData and add it to the frame. More...
 
const char * av_stereo3d_type_name (unsigned int type)
 Provide a human-readable name of a given stereo3d type. More...
 
int av_stereo3d_from_name (const char *name)
 Get the AVStereo3DType form a human-readable name. More...
 
const char * av_stereo3d_view_name (unsigned int view)
 Provide a human-readable name of a given stereo3d view. More...
 
int av_stereo3d_view_from_name (const char *name)
 Get the AVStereo3DView form a human-readable name. More...
 
const char * av_stereo3d_primary_eye_name (unsigned int eye)
 Provide a human-readable name of a given stereo3d primary eye. More...
 
int av_stereo3d_primary_eye_from_name (const char *name)
 Get the AVStereo3DPrimaryEye form a human-readable name. More...
 

Detailed Description

A stereoscopic video file consists in multiple views embedded in a single frame, usually describing two views of a scene. This file describes all possible codec-independent view arrangements.

Macro Definition Documentation

◆ AV_STEREO3D_FLAG_INVERT

#define AV_STEREO3D_FLAG_INVERT   (1 << 0)

Inverted views, Right/Bottom represents the left view.

Definition at line 194 of file stereo3d.h.

Enumeration Type Documentation

◆ AVStereo3DType

List of possible 3D Types.

Enumerator
AV_STEREO3D_2D 

Video is not stereoscopic (and metadata has to be there).

AV_STEREO3D_SIDEBYSIDE 

Views are next to each other.

LLLLRRRR
LLLLRRRR
LLLLRRRR
...
AV_STEREO3D_TOPBOTTOM 

Views are on top of each other.

LLLLLLLL
LLLLLLLL
RRRRRRRR
RRRRRRRR
AV_STEREO3D_FRAMESEQUENCE 

Views are alternated temporally.

frame0 frame1 frame2 ...
LLLLLLLL RRRRRRRR LLLLLLLL
LLLLLLLL RRRRRRRR LLLLLLLL
LLLLLLLL RRRRRRRR LLLLLLLL
... ... ...
AV_STEREO3D_CHECKERBOARD 

Views are packed in a checkerboard-like structure per pixel.

LRLRLRLR
RLRLRLRL
LRLRLRLR
...
AV_STEREO3D_SIDEBYSIDE_QUINCUNX 

Views are next to each other, but when upscaling apply a checkerboard pattern.

LLLLRRRR L L L L R R R R
LLLLRRRR => L L L L R R R R
LLLLRRRR L L L L R R R R
LLLLRRRR L L L L R R R R
AV_STEREO3D_LINES 

Views are packed per line, as if interlaced.

LLLLLLLL
RRRRRRRR
LLLLLLLL
...
AV_STEREO3D_COLUMNS 

Views are packed per column.

LRLRLRLR
LRLRLRLR
LRLRLRLR
...
AV_STEREO3D_UNSPEC 

Video is stereoscopic but the packing is unspecified.

Definition at line 48 of file stereo3d.h.

◆ AVStereo3DView

List of possible view types.

Enumerator
AV_STEREO3D_VIEW_PACKED 

Frame contains two packed views.

AV_STEREO3D_VIEW_LEFT 

Frame contains only the left view.

AV_STEREO3D_VIEW_RIGHT 

Frame contains only the right view.

AV_STEREO3D_VIEW_UNSPEC 

Content is unspecified.

Definition at line 149 of file stereo3d.h.

◆ AVStereo3DPrimaryEye

List of possible primary eyes.

Enumerator
AV_PRIMARY_EYE_NONE 

Neither eye.

AV_PRIMARY_EYE_LEFT 

Left eye.

AV_PRIMARY_EYE_RIGHT 

Right eye.

Definition at line 174 of file stereo3d.h.

Function Documentation

◆ av_stereo3d_alloc()

AVStereo3D* av_stereo3d_alloc ( void  )

Allocate an AVStereo3D structure and set its fields to default values.

The resulting struct can be freed using av_freep().

Returns
An AVStereo3D filled with default values or NULL on failure.

Definition at line 35 of file stereo3d.c.

Referenced by mjpeg_decode_app().

◆ av_stereo3d_alloc_size()

AVStereo3D* av_stereo3d_alloc_size ( size_t *  size)

Allocate an AVStereo3D structure and set its fields to default values.

The resulting struct can be freed using av_freep().

Returns
An AVStereo3D filled with default values or NULL on failure.

Definition at line 40 of file stereo3d.c.

Referenced by av_stereo3d_alloc(), mov_parse_uuid_spherical(), mov_read_eyes(), mov_read_hfov(), and mov_read_st3d().

◆ av_stereo3d_create_side_data()

AVStereo3D* av_stereo3d_create_side_data ( AVFrame frame)

Allocate a complete AVFrameSideData and add it to the frame.

Parameters
frameThe frame which side data is added to.
Returns
The AVStereo3D structure to be filled by caller.

Definition at line 54 of file stereo3d.c.

Referenced by alloc_frame(), ff_h2645_sei_to_frame(), ff_mjpeg_decode_frame_from_buf(), mpeg_field_start(), output_frame(), and try_push_frame().

◆ av_stereo3d_type_name()

const char* av_stereo3d_type_name ( unsigned int  type)

Provide a human-readable name of a given stereo3d type.

Parameters
typeThe input stereo3d type value.
Returns
The name of the stereo3d value, or "unknown".

Definition at line 93 of file stereo3d.c.

Referenced by dump_stereo3d(), mov_write_st3d_tag(), and print_pkt_side_data().

◆ av_stereo3d_from_name()

int av_stereo3d_from_name ( const char *  name)

Get the AVStereo3DType form a human-readable name.

Parameters
nameThe input string.
Returns
The AVStereo3DType value, or -1 if not found.

Definition at line 101 of file stereo3d.c.

◆ av_stereo3d_view_name()

const char* av_stereo3d_view_name ( unsigned int  view)

Provide a human-readable name of a given stereo3d view.

Parameters
typeThe input stereo3d view value.
Returns
The name of the stereo3d view value, or "unknown".

Definition at line 113 of file stereo3d.c.

Referenced by dump_stereo3d(), multiview_setup(), and print_pkt_side_data().

◆ av_stereo3d_view_from_name()

int av_stereo3d_view_from_name ( const char *  name)

Get the AVStereo3DView form a human-readable name.

Parameters
nameThe input string.
Returns
The AVStereo3DView value, or -1 if not found.

Definition at line 121 of file stereo3d.c.

◆ av_stereo3d_primary_eye_name()

const char* av_stereo3d_primary_eye_name ( unsigned int  eye)

Provide a human-readable name of a given stereo3d primary eye.

Parameters
typeThe input stereo3d primary eye value.
Returns
The name of the stereo3d primary eye value, or "unknown".

Definition at line 133 of file stereo3d.c.

Referenced by dump_stereo3d(), and print_pkt_side_data().

◆ av_stereo3d_primary_eye_from_name()

int av_stereo3d_primary_eye_from_name ( const char *  name)

Get the AVStereo3DPrimaryEye form a human-readable name.

Parameters
nameThe input string.
Returns
The AVStereo3DPrimaryEye value, or -1 if not found.

Definition at line 141 of file stereo3d.c.