author | sheepluva |
Thu, 12 Jun 2014 14:11:22 +0200 | |
changeset 10284 | e9c85a0acdd2 |
parent 7813 | 7ac83d79b897 |
permissions | -rw-r--r-- |
7813
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
1 |
/* |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
2 |
* The Video Decode and Presentation API for UNIX (VDPAU) is used for |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
3 |
* hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
4 |
* |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
5 |
* Copyright (C) 2008 NVIDIA |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
6 |
* |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
7 |
* This file is part of Libav. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
8 |
* |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
9 |
* Libav is free software; you can redistribute it and/or |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
10 |
* modify it under the terms of the GNU Lesser General Public |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
11 |
* License as published by the Free Software Foundation; either |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
12 |
* version 2.1 of the License, or (at your option) any later version. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
13 |
* |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
14 |
* Libav is distributed in the hope that it will be useful, |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
17 |
* Lesser General Public License for more details. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
18 |
* |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
19 |
* You should have received a copy of the GNU Lesser General Public |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
20 |
* License along with Libav; if not, write to the Free Software |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
21 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
22 |
*/ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
23 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
24 |
#ifndef AVCODEC_VDPAU_H |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
25 |
#define AVCODEC_VDPAU_H |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
26 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
27 |
/** |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
28 |
* @file |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
29 |
* @ingroup lavc_codec_hwaccel_vdpau |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
30 |
* Public libavcodec VDPAU header. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
31 |
*/ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
32 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
33 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
34 |
/** |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
35 |
* @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
36 |
* @ingroup lavc_codec_hwaccel |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
37 |
* |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
38 |
* VDPAU hardware acceleration has two modules |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
39 |
* - VDPAU decoding |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
40 |
* - VDPAU presentation |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
41 |
* |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
42 |
* The VDPAU decoding module parses all headers using Libav |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
43 |
* parsing mechanisms and uses VDPAU for the actual decoding. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
44 |
* |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
45 |
* As per the current implementation, the actual decoding |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
46 |
* and rendering (API calls) are done as part of the VDPAU |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
47 |
* presentation (vo_vdpau.c) module. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
48 |
* |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
49 |
* @{ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
50 |
*/ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
51 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
52 |
#include <vdpau/vdpau.h> |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
53 |
#include <vdpau/vdpau_x11.h> |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
54 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
55 |
/** @brief The videoSurface is used for rendering. */ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
56 |
#define FF_VDPAU_STATE_USED_FOR_RENDER 1 |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
57 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
58 |
/** |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
59 |
* @brief The videoSurface is needed for reference/prediction. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
60 |
* The codec manipulates this. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
61 |
*/ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
62 |
#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2 |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
63 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
64 |
/** |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
65 |
* @brief This structure is used as a callback between the Libav |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
66 |
* decoder (vd_) and presentation (vo_) module. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
67 |
* This is used for defining a video frame containing surface, |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
68 |
* picture parameter, bitstream information etc which are passed |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
69 |
* between the Libav decoder and its clients. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
70 |
*/ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
71 |
struct vdpau_render_state { |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
72 |
VdpVideoSurface surface; ///< Used as rendered surface, never changed. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
73 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
74 |
int state; ///< Holds FF_VDPAU_STATE_* values. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
75 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
76 |
/** picture parameter information for all supported codecs */ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
77 |
union VdpPictureInfo { |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
78 |
VdpPictureInfoH264 h264; |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
79 |
VdpPictureInfoMPEG1Or2 mpeg; |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
80 |
VdpPictureInfoVC1 vc1; |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
81 |
VdpPictureInfoMPEG4Part2 mpeg4; |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
82 |
} info; |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
83 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
84 |
/** Describe size/location of the compressed video data. |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
85 |
Set to 0 when freeing bitstream_buffers. */ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
86 |
int bitstream_buffers_allocated; |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
87 |
int bitstream_buffers_used; |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
88 |
/** The user is responsible for freeing this buffer using av_freep(). */ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
89 |
VdpBitstreamBuffer *bitstream_buffers; |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
90 |
}; |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
91 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
92 |
/* @}*/ |
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
93 |
|
7ac83d79b897
support video recording on windows with automation and headers
koda
parents:
diff
changeset
|
94 |
#endif /* AVCODEC_VDPAU_H */ |