FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Enumerations | Functions
Spherical video mapping

A spherical video file contains surfaces that need to be mapped onto a sphere. More...

Data Structures

struct  AVSphericalMapping
 This structure describes how to handle spherical videos, outlining information about projection, initial layout, and any other view modifier. More...
 

Enumerations

enum  AVSphericalProjection { AV_SPHERICAL_EQUIRECTANGULAR, AV_SPHERICAL_CUBEMAP, AV_SPHERICAL_EQUIRECTANGULAR_TILE }
 Projection of the video surface(s) on a sphere. More...
 

Functions

AVSphericalMappingav_spherical_alloc (size_t *size)
 Allocate a AVSphericalVideo structure and initialize its fields to default values. More...
 
void av_spherical_tile_bounds (const AVSphericalMapping *map, size_t width, size_t height, size_t *left, size_t *top, size_t *right, size_t *bottom)
 Convert the bounding fields from an AVSphericalVideo from 0.32 fixed point to pixels. More...
 
const char * av_spherical_projection_name (enum AVSphericalProjection projection)
 Provide a human-readable name of a given AVSphericalProjection. More...
 
int av_spherical_from_name (const char *name)
 Get the AVSphericalProjection form a human-readable name. More...
 

Detailed Description

A spherical video file contains surfaces that need to be mapped onto a sphere.

Depending on how the frame was converted, a different distortion transformation or surface recomposition function needs to be applied before the video should be mapped and displayed.

Enumeration Type Documentation

Projection of the video surface(s) on a sphere.

Enumerator
AV_SPHERICAL_EQUIRECTANGULAR 

Video represents a sphere mapped on a flat surface using equirectangular projection.

AV_SPHERICAL_CUBEMAP 

Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.

Faces are oriented upwards for the front, left, right, and back faces. The up face is oriented so the top of the face is forwards and the down face is oriented so the top of the face is to the back.

AV_SPHERICAL_EQUIRECTANGULAR_TILE 

Video represents a portion of a sphere mapped on a flat surface using equirectangular projection.

The bounding fields indicate the position of the current video in a larger surface.

Definition at line 51 of file spherical.h.

Function Documentation

AVSphericalMapping* av_spherical_alloc ( size_t *  size)

Allocate a AVSphericalVideo structure and initialize its fields to default values.

Returns
the newly allocated struct or NULL on failure

Definition at line 24 of file spherical.c.

Referenced by mkv_parse_video_projection(), mov_parse_uuid_spherical(), and mov_read_sv3d().

void av_spherical_tile_bounds ( const AVSphericalMapping map,
size_t  width,
size_t  height,
size_t *  left,
size_t *  top,
size_t *  right,
size_t *  bottom 
)

Convert the bounding fields from an AVSphericalVideo from 0.32 fixed point to pixels.

Parameters
mapThe AVSphericalVideo map to read bound values from.
widthWidth of the current frame or stream.
heightHeight of the current frame or stream.
leftPixels from the left edge.
topPixels from the top edge.
rightPixels from the right edge.
bottomPixels from the bottom edge.

Definition at line 36 of file spherical.c.

Referenced by dump_spherical(), and print_pkt_side_data().

const char* av_spherical_projection_name ( enum AVSphericalProjection  projection)

Provide a human-readable name of a given AVSphericalProjection.

Parameters
projectionThe input AVSphericalProjection.
Returns
The name of the AVSphericalProjection, or "unknown".

Definition at line 60 of file spherical.c.

Referenced by dump_spherical(), and print_pkt_side_data().

int av_spherical_from_name ( const char *  name)

Get the AVSphericalProjection form a human-readable name.

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

Definition at line 68 of file spherical.c.