FFmpeg
vdpau.h
Go to the documentation of this file.
1 /*
2  * The Video Decode and Presentation API for UNIX (VDPAU) is used for
3  * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
4  *
5  * Copyright (C) 2008 NVIDIA
6  *
7  * This file is part of FFmpeg.
8  *
9  * FFmpeg is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * FFmpeg is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with FFmpeg; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 #ifndef AVCODEC_VDPAU_H
25 #define AVCODEC_VDPAU_H
26 
52 #include <vdpau/vdpau.h>
53 
54 #include "libavutil/avconfig.h"
55 #include "libavutil/attributes.h"
56 
57 #include "avcodec.h"
58 #include "version.h"
59 
60 struct AVCodecContext;
61 struct AVFrame;
62 
63 typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *,
64  const VdpPictureInfo *, uint32_t,
65  const VdpBitstreamBuffer *);
66 
81 typedef struct AVVDPAUContext {
87  VdpDecoder decoder;
88 
94  VdpDecoderRender *render;
95 
96  AVVDPAU_Render2 render2;
98 
105 
106 AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *);
107 void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2);
108 
126 int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
127  VdpGetProcAddress *get_proc_address, unsigned flags);
128 
146 int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type,
147  uint32_t *width, uint32_t *height);
148 
155 
156 #if FF_API_VDPAU_PROFILE
157 
170 attribute_deprecated
171 int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile);
172 #endif
173 
174 /* @}*/
175 
176 #endif /* AVCODEC_VDPAU_H */
This structure describes decoded (raw) audio or video data.
Definition: frame.h:218
Macro definitions for various function/variable attributes.
int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type, uint32_t *width, uint32_t *height)
Gets the parameters to create an adequate VDPAU video surface for the codec context using VDPAU hardw...
Definition: vdpau.c:74
attribute_deprecated int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile)
Get a decoder profile that should be used for initializing a VDPAU decoder.
Definition: vdpau.c:393
AVVDPAUContext * av_vdpau_alloc_context(void)
Allocate an AVVDPAUContext.
Definition: vdpau.c:441
VdpDecoder decoder
VDPAU decoder handle.
Definition: vdpau.h:87
Libavcodec version macros.
This structure is used to share data between the libavcodec library and the client video application...
Definition: vdpau.h:81
int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, VdpGetProcAddress *get_proc_address, unsigned flags)
Associate a VDPAU device with a codec context for hardware acceleration.
Definition: vdpau.c:446
Libavcodec external API header.
AVVDPAUContext * av_alloc_vdpaucontext(void)
allocation function for AVVDPAUContext
Definition: vdpau.c:67
main external API structure.
Definition: avcodec.h:1518
VdpDecoderRender * render
VDPAU decoder render callback.
Definition: vdpau.h:94
struct AVVDPAUContext AVVDPAUContext
This structure is used to share data between the libavcodec library and the client video application...