annotate ffmpeg/libavcodec/vdpau.h @ 13:844d341cf643 tip

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