- Timestamp:
- 02/27/09 18:00:28 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
r9818 r9826 14 14 namespace osgFFmpeg { 15 15 16 class FramePtr 17 { 18 public: 19 20 typedef AVFrame T; 21 22 explicit FramePtr() : _ptr(0) {} 23 explicit FramePtr(T* ptr) : _ptr(ptr) {} 24 25 ~FramePtr() 26 { 27 cleanup(); 28 } 29 30 T* get() { return _ptr; } 16 31 32 T * operator-> () const // never throws 33 { 34 return _ptr; 35 } 36 37 void reset(T* ptr) 38 { 39 if (ptr==_ptr) return; 40 cleanup(); 41 _ptr = ptr; 42 } 43 44 void cleanup() 45 { 46 if (_ptr) av_free(_ptr); 47 _ptr = 0; 48 } 49 50 51 52 protected: 53 54 T* _ptr; 55 }; 17 56 18 57 class FFmpegDecoderVideo : public OpenThreads::Thread … … 41 80 private: 42 81 43 typedef boost::shared_ptr<AVFrame> FramePtr;44 82 typedef std::vector<uint8_t> Buffer; 45 83
