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