1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
//
// libavg - Media Playback Engine.
// Copyright (C) 2003-2014 Ulrich von Zadow
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Current versions can be found at www.libavg.de
//
#ifndef _VDPAUDecoder_H_
#define _VDPAUDecoder_H_
#include "../avgconfigwrapper.h"
#include "../base/GLMHelper.h"
#include "WrapFFMpeg.h"
#include <vdpau/vdpau.h>
#include <libavcodec/vdpau.h>
namespace avg {
class VDPAUDecoder
{
public:
VDPAUDecoder();
~VDPAUDecoder();
AVCodec* openCodec(AVCodecContext* pCodec);
static bool isAvailable();
private:
// Callbacks
static int getBuffer(AVCodecContext* pContext, AVFrame* pFrame);
static void releaseBuffer(struct AVCodecContext* pContext, AVFrame* pFrame);
static void drawHorizBand(AVCodecContext* pContext, const AVFrame* pFrame,
int offset[4], int y, int type, int height);
static AVPixelFormat getFormat(AVCodecContext* pContext, const AVPixelFormat* pFmt);
vdpau_render_state* getFreeRenderState();
int getBufferInternal(AVCodecContext* pContext, AVFrame* pFrame);
void render(AVCodecContext* pContext, const AVFrame* pFrame);
void setupDecoder(AVCodecContext* pContext);
VdpDecoder m_VDPDecoder;
VdpVideoMixer m_VDPMixer;
AVPixelFormat m_PixFmt;
IntPoint m_Size;
std::vector<vdpau_render_state*> m_RenderStates;
};
}
#endif
|