FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
stereo3d.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Vittorio Giovara <vittorio.giovara@gmail.com>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVUTIL_STEREO3D_H
22 #define AVUTIL_STEREO3D_H
23 
24 #include <stdint.h>
25 
26 #include "frame.h"
27 
28 /**
29  * List of possible 3D Types
30  */
32  /**
33  * Video is not stereoscopic (and metadata has to be there).
34  */
36 
37  /**
38  * Views are next to each other.
39  *
40  * LLLLRRRR
41  * LLLLRRRR
42  * LLLLRRRR
43  * ...
44  */
46 
47  /**
48  * Views are on top of each other.
49  *
50  * LLLLLLLL
51  * LLLLLLLL
52  * RRRRRRRR
53  * RRRRRRRR
54  */
56 
57  /**
58  * Views are alternated temporally.
59  *
60  * frame0 frame1 frame2 ...
61  * LLLLLLLL RRRRRRRR LLLLLLLL
62  * LLLLLLLL RRRRRRRR LLLLLLLL
63  * LLLLLLLL RRRRRRRR LLLLLLLL
64  * ... ... ...
65  */
67 
68  /**
69  * Views are packed in a checkerboard-like structure per pixel.
70  *
71  * LRLRLRLR
72  * RLRLRLRL
73  * LRLRLRLR
74  * ...
75  */
77 
78  /**
79  * Views are next to each other, but when upscaling
80  * apply a checkerboard pattern.
81  *
82  * LLLLRRRR L L L L R R R R
83  * LLLLRRRR => L L L L R R R R
84  * LLLLRRRR L L L L R R R R
85  * LLLLRRRR L L L L R R R R
86  */
88 
89  /**
90  * Views are packed per line, as if interlaced.
91  *
92  * LLLLLLLL
93  * RRRRRRRR
94  * LLLLLLLL
95  * ...
96  */
98 
99  /**
100  * Views are packed per column.
101  *
102  * LRLRLRLR
103  * LRLRLRLR
104  * LRLRLRLR
105  * ...
106  */
108 };
109 
110 
111 /**
112  * Inverted views, Right/Bottom represents the left view.
113  */
114 #define AV_STEREO3D_FLAG_INVERT (1 << 0)
115 
116 /**
117  * Stereo 3D type: this structure describes how two videos are packed
118  * within a single video surface, with additional information as needed.
119  *
120  * @note The struct must be allocated with av_stereo3d_alloc() and
121  * its size is not a part of the public ABI.
122  */
123 typedef struct AVStereo3D {
124  /**
125  * How views are packed within the video.
126  */
128 
129  /**
130  * Additional information about the frame packing.
131  */
132  int flags;
133 } AVStereo3D;
134 
135 /**
136  * Allocate an AVStereo3D structure and set its fields to default values.
137  * The resulting struct can be freed using av_freep().
138  *
139  * @return An AVStereo3D filled with default values or NULL on failure.
140  */
142 
143 /**
144  * Allocate a complete AVFrameSideData and add it to the frame.
145  *
146  * @param frame The frame which side data is added to.
147  *
148  * @return The AVStereo3D structure to be filled by caller.
149  */
151 
152 /**
153  * Provide a human-readable name of a given stereo3d type.
154  *
155  * @param type The input stereo3d type value.
156  *
157  * @return The name of the stereo3d value, or "unknown".
158  */
159 const char *av_stereo3d_type_name(unsigned int type);
160 
161 /**
162  * Get the AVStereo3DType form a human-readable name.
163  *
164  * @param type The input string.
165  *
166  * @return The AVStereo3DType value, or -1 if not found.
167  */
168 int av_stereo3d_from_name(const char *name);
169 
170 #endif /* AVUTIL_STEREO3D_H */
This structure describes decoded (raw) audio or video data.
Definition: frame.h:184
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
Definition: stereo3d.c:57
int av_stereo3d_from_name(const char *name)
Get the AVStereo3DType form a human-readable name.
Definition: stereo3d.c:65
Views are next to each other.
Definition: stereo3d.h:45
Stereo 3D type: this structure describes how two videos are packed within a single video surface...
Definition: stereo3d.h:123
static AVFrame * frame
Views are alternated temporally.
Definition: stereo3d.h:66
int flags
Additional information about the frame packing.
Definition: stereo3d.h:132
reference-counted frame API
Views are packed per line, as if interlaced.
Definition: stereo3d.h:97
Views are packed per column.
Definition: stereo3d.h:107
enum AVStereo3DType type
How views are packed within the video.
Definition: stereo3d.h:127
Views are next to each other, but when upscaling apply a checkerboard pattern.
Definition: stereo3d.h:87
GLint GLenum type
Definition: opengl_enc.c:105
AVStereo3D * av_stereo3d_create_side_data(AVFrame *frame)
Allocate a complete AVFrameSideData and add it to the frame.
Definition: stereo3d.c:33
AVStereo3DType
List of possible 3D Types.
Definition: stereo3d.h:31
AVStereo3D * av_stereo3d_alloc(void)
Allocate an AVStereo3D structure and set its fields to default values.
Definition: stereo3d.c:28
Video is not stereoscopic (and metadata has to be there).
Definition: stereo3d.h:35
Views are packed in a checkerboard-like structure per pixel.
Definition: stereo3d.h:76
Views are on top of each other.
Definition: stereo3d.h:55
const char * name
Definition: opengl_enc.c:103