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_VAAPISURFACE_H
00021 #define GNASH_VAAPISURFACE_H
00022
00023 #include "vaapi_common.h"
00024 #include <vector>
00025
00026 namespace gnash {
00027
00028
00029 class VaapiContext;
00030 class VaapiSubpicture;
00031
00033 struct VaapiRectangle : public VARectangle {
00034 VaapiRectangle(unsigned int w = 0, unsigned int h = 0)
00035 { x = 0; y = 0; width = w; height = h; }
00036
00037 VaapiRectangle(int x_, int y_, unsigned int w, unsigned int h)
00038 { x = x_; y = y_; width = w; height = h; }
00039 };
00040
00042 class VaapiSurfaceImplBase {
00043 uintptr_t _surface;
00044 unsigned int _width;
00045 unsigned int _height;
00046
00047 protected:
00048 void reset(uintptr_t surface) { _surface = surface; }
00049
00050 public:
00051 VaapiSurfaceImplBase(unsigned int width, unsigned int height);
00052 virtual ~VaapiSurfaceImplBase() { }
00053
00055 uintptr_t surface() const { return _surface; }
00056
00058 unsigned int width() const { return _width; }
00059
00061 unsigned int height() const { return _height; }
00062 };
00063
00065 class VaapiSurface {
00066 std::auto_ptr<VaapiSurfaceImplBase> _impl;
00067 std::vector< boost::shared_ptr<VaapiSubpicture> > _subpictures;
00068
00069 friend class VaapiContext;
00070 VaapiContext *_context;
00071
00073 void setContext(VaapiContext *context) { _context = context; }
00074
00075 public:
00076 VaapiSurface(unsigned int width, unsigned int height);
00077
00079 VaapiContext *getContext() const { return _context; }
00080
00082 VASurfaceID get() const { return static_cast<VASurfaceID>(_impl->surface()); }
00083
00085 unsigned int width() const { return _impl->width(); }
00086
00088 unsigned int height() const { return _impl->height(); }
00089
00091 void clear();
00092
00094 bool associateSubpicture(boost::shared_ptr<VaapiSubpicture> subpicture,
00095 VaapiRectangle const & src_rect,
00096 VaapiRectangle const & dst_rect);
00097
00099 bool deassociateSubpicture(boost::shared_ptr<VaapiSubpicture> subpicture);
00100 };
00101
00102 }
00103
00104 #endif // GNASH_VAAPISURFACE_H
00105
00106
00107
00108
00109
00110