Drop extra semicolon
[gnash.git] / libmedia / ffmpeg / VideoDecoderFfmpegVaapi.h
blob70fb6a7fbaedb5360ca292f3a7f32b2440d5b1f9
1 // vaapi.h: VA API acceleration.
2 //
3 // Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef GNASH_MEDIA_VIDEODECODERFFMPEGVAAPI_H
20 #define GNASH_MEDIA_VIDEODECODERFFMPEGVAAPI_H
22 #include "VaapiContext.h"
23 #include "VaapiSurface.h"
24 #include "VaapiSurfaceProxy.h"
26 extern "C" {
27 #include <libavcodec/avcodec.h>
28 #include <libavcodec/vaapi.h>
31 namespace gnash {
32 namespace media {
33 namespace ffmpeg {
35 /// VA surface implementation for FFmpeg
36 class VaapiSurfaceFfmpeg : public VaapiSurfaceProxy {
37 unsigned int _pic_num;
39 public:
40 VaapiSurfaceFfmpeg(boost::shared_ptr<VaapiSurface> surface,
41 boost::shared_ptr<VaapiContext> context)
42 : VaapiSurfaceProxy(surface, context), _pic_num(0)
43 { }
45 unsigned int getPicNum() const
46 { return _pic_num; }
48 void setPicNum(unsigned int pic_num)
49 { _pic_num = pic_num; }
52 void vaapi_set_surface(AVFrame *pic, VaapiSurfaceFfmpeg *surface);
54 static inline VaapiSurfaceFfmpeg *vaapi_get_surface(const AVFrame *pic)
56 return reinterpret_cast<VaapiSurfaceFfmpeg *>(pic->data[0]);
59 /// VA context implementation for FFmpeg
60 class VaapiContextFfmpeg : public vaapi_context {
61 boost::shared_ptr<VaapiContext> _context;
63 public:
64 VaapiContextFfmpeg(enum CodecID codec_id);
66 bool initDecoder(unsigned int width, unsigned int height);
68 VaapiSurfaceFfmpeg *getSurface()
69 { return new VaapiSurfaceFfmpeg(_context->acquireSurface(), _context); }
71 static VaapiContextFfmpeg *create(enum CodecID codec_id);
74 } // gnash.media.ffmpeg namespace
75 } // gnash.media namespace
76 } // gnash namespace
78 #endif /* GNASH_MEDIA_VIDEODECODERFFMPEGVAAPI_H */