Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GNASH_VAAPICONTEXT_H
00021 #define GNASH_VAAPICONTEXT_H
00022
00023
00024 #include <queue>
00025
00026 #include "log.h"
00027 #include "vaapi_common.h"
00028
00029 namespace gnash {
00030
00031
00032 class VaapiSurface;
00033
00035 enum VaapiCodec {
00036 VAAPI_CODEC_UNKNOWN,
00037 VAAPI_CODEC_MPEG2,
00038 VAAPI_CODEC_MPEG4,
00039 VAAPI_CODEC_H264,
00040 VAAPI_CODEC_VC1
00041 };
00042
00044 class VaapiContextData {
00045 public:
00046 virtual ~VaapiContextData()
00047 { }
00048 };
00049
00051 class DSOEXPORT VaapiContext {
00052 typedef boost::shared_ptr<VaapiSurface> VaapiSurfaceSP;
00053
00054 VADisplay _display;
00055 VAConfigID _config;
00056 VAContextID _context;
00057 VaapiCodec _codec;
00058 VAProfile _profile;
00059 VAEntrypoint _entrypoint;
00060 std::queue<VaapiSurfaceSP> _surfaces;
00061 unsigned int _picture_width;
00062 unsigned int _picture_height;
00063 std::auto_ptr<VaapiContextData> _user_data;
00064
00065 bool construct();
00066 void destruct();
00067 bool createContext(unsigned int width, unsigned int height);
00068 void destroyContext();
00069
00070 public:
00071 VaapiContext(VAProfile profile, VAEntrypoint entrypoint);
00072 ~VaapiContext();
00073
00075 bool initDecoder(unsigned int width, unsigned int height);
00076
00078 VAContextID get() const { return _context; }
00079
00081 boost::shared_ptr<VaapiSurface> acquireSurface();
00082
00084 void releaseSurface(boost::shared_ptr<VaapiSurface> surface);
00085
00087 void setData(std::auto_ptr<VaapiContextData> user_data) { _user_data = user_data; }
00088
00090 VaapiContextData *getData() const { return _user_data.get(); }
00091 };
00092
00093 }
00094
00095 #endif // GNASH_VAAPICONTEXT_H
00096
00097
00098
00099
00100
00101
00102