annotate lib/libavcodec/vdpau.h @ 2236:3c802b5e026a

_4B254D_SkillMasteryTeacher getting rid of uninitialized var use
author Grumpy7
date Sun, 23 Feb 2014 12:55:01 +0100
parents 992d2e6f907d
children
rev   line source
2134
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2 * The Video Decode and Presentation API for UNIX (VDPAU) is used for
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3 * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
5 * Copyright (C) 2008 NVIDIA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
6 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
7 * This file is part of FFmpeg.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
8 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
9 * FFmpeg is free software; you can redistribute it and/or
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
10 * modify it under the terms of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
11 * License as published by the Free Software Foundation; either
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
12 * version 2.1 of the License, or (at your option) any later version.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
13 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
14 * FFmpeg is distributed in the hope that it will be useful,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
17 * Lesser General Public License for more details.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
18 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
19 * You should have received a copy of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
20 * License along with FFmpeg; if not, write to the Free Software
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
22 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
23
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
24 #ifndef AVCODEC_VDPAU_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
25 #define AVCODEC_VDPAU_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
26
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
27 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
28 * @file
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
29 * @ingroup lavc_codec_hwaccel_vdpau
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
30 * Public libavcodec VDPAU header.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
31 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
32
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
33
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
34 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
35 * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
36 * @ingroup lavc_codec_hwaccel
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
37 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
38 * VDPAU hardware acceleration has two modules
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
39 * - VDPAU decoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
40 * - VDPAU presentation
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
41 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
42 * The VDPAU decoding module parses all headers using FFmpeg
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
43 * parsing mechanisms and uses VDPAU for the actual decoding.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
44 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
45 * As per the current implementation, the actual decoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
46 * and rendering (API calls) are done as part of the VDPAU
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
47 * presentation (vo_vdpau.c) module.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
48 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
49 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
50 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
51
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
52 #include <vdpau/vdpau.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
53 #include <vdpau/vdpau_x11.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
54 #include "libavutil/avconfig.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
55
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
56 union FFVdpPictureInfo {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
57 VdpPictureInfoH264 h264;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
58 VdpPictureInfoMPEG1Or2 mpeg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
59 VdpPictureInfoVC1 vc1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
60 VdpPictureInfoMPEG4Part2 mpeg4;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
61 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
62
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
63 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
64 * This structure is used to share data between the libavcodec library and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
65 * the client video application.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
66 * The user shall zero-allocate the structure and make it available as
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
67 * AVCodecContext.hwaccel_context. Members can be set by the user once
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
68 * during initialization or through each AVCodecContext.get_buffer()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
69 * function call. In any case, they must be valid prior to calling
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
70 * decoding functions.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
71 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
72 typedef struct AVVDPAUContext {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
73 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
74 * VDPAU decoder handle
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
75 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
76 * Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
77 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
78 VdpDecoder decoder;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
79
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
80 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
81 * VDPAU decoder render callback
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
82 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
83 * Set by the user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
84 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
85 VdpDecoderRender *render;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
86
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
87 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
88 * VDPAU picture information
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
89 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
90 * Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
91 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
92 union FFVdpPictureInfo info;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
93
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
94 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
95 * Allocated size of the bitstream_buffers table.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
96 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
97 * Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
98 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
99 int bitstream_buffers_allocated;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
100
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
101 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
102 * Useful bitstream buffers in the bitstream buffers table.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
103 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
104 * Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
105 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
106 int bitstream_buffers_used;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
107
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
108 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
109 * Table of bitstream buffers.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
110 * The user is responsible for freeing this buffer using av_freep().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
111 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
112 * Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
113 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
114 VdpBitstreamBuffer *bitstream_buffers;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
115 } AVVDPAUContext;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
116
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
117
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
118 /** @brief The videoSurface is used for rendering. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
119 #define FF_VDPAU_STATE_USED_FOR_RENDER 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
120
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
121 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
122 * @brief The videoSurface is needed for reference/prediction.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
123 * The codec manipulates this.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
124 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
125 #define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
126
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
127 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
128 * @brief This structure is used as a callback between the FFmpeg
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
129 * decoder (vd_) and presentation (vo_) module.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
130 * This is used for defining a video frame containing surface,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
131 * picture parameter, bitstream information etc which are passed
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
132 * between the FFmpeg decoder and its clients.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
133 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
134 struct vdpau_render_state {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
135 VdpVideoSurface surface; ///< Used as rendered surface, never changed.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
136
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
137 int state; ///< Holds FF_VDPAU_STATE_* values.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
138
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
139 #if AV_HAVE_INCOMPATIBLE_FORK_ABI
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
140 /** picture parameter information for all supported codecs */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
141 union FFVdpPictureInfo info;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
142 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
143
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
144 /** Describe size/location of the compressed video data.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
145 Set to 0 when freeing bitstream_buffers. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
146 int bitstream_buffers_allocated;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
147 int bitstream_buffers_used;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
148 /** The user is responsible for freeing this buffer using av_freep(). */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
149 VdpBitstreamBuffer *bitstream_buffers;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
150
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
151 #if !AV_HAVE_INCOMPATIBLE_FORK_ABI
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
152 /** picture parameter information for all supported codecs */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
153 union FFVdpPictureInfo info;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
154 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
155 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
156
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
157 /* @}*/
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
158
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
159 #endif /* AVCODEC_VDPAU_H */