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
00021 #ifndef GNASH_VIDEO_H
00022 #define GNASH_VIDEO_H
00023
00024 #include <boost/intrusive_ptr.hpp>
00025 #include "DisplayObject.h"
00026
00027
00028 namespace gnash {
00029 class NetStream_as;
00030 class GnashImage;
00031 struct ObjectURI;
00032 namespace SWF {
00033 class DefineVideoStreamTag;
00034 }
00035 namespace media {
00036 class VideoDecoder;
00037 }
00038 }
00039
00040 namespace gnash {
00041
00043
00048 class Video : public DisplayObject
00049 {
00050
00051 public:
00052
00053 Video(as_object* object, const SWF::DefineVideoStreamTag* def,
00054 DisplayObject* parent);
00055
00056 ~Video();
00057
00058 virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const
00059 {
00060
00061 return pointInBounds(x, y);
00062 }
00063
00064 virtual SWFRect getBounds() const;
00065
00067 virtual void construct(as_object* init = 0);
00068
00069 void display(Renderer& renderer);
00070
00071 void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);
00072
00074 void setStream(NetStream_as* ns);
00075
00076 void clear();
00077
00079
00084 int height() const;
00085
00087
00092 int width() const;
00093
00095 bool smoothing() const { return _smoothing; }
00096
00098 void setSmoothing(bool b) { _smoothing = b; }
00099
00100 protected:
00101
00103
00107 virtual void markOwnResources() const;
00108
00109 private:
00110
00112 GnashImage* getVideoFrame();
00113
00114 const boost::intrusive_ptr<const SWF::DefineVideoStreamTag> m_def;
00115
00116
00117 NetStream_as* _ns;
00118
00120 bool _embeddedStream;
00121
00123 boost::int32_t _lastDecodedVideoFrameNum;
00124
00126 std::auto_ptr<GnashImage> _lastDecodedVideoFrame;
00127
00129 std::auto_ptr<media::VideoDecoder> _decoder;
00130
00132 bool _smoothing;
00133 };
00134
00136
00139 as_object* createVideoObject(Global_as& gl);
00140
00141 void video_class_init(as_object& global, const ObjectURI& uri);
00142
00143 void registerVideoNative(as_object& global);
00144
00145 }
00146
00147
00148 #endif // GNASH_VIDEO_STREAM_INSTANCE_H