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 namespace image {
00031 class GnashImage;
00032 }
00033 struct ObjectURI;
00034 namespace SWF {
00035 class DefineVideoStreamTag;
00036 }
00037 namespace media {
00038 class VideoDecoder;
00039 }
00040 }
00041
00042 namespace gnash {
00043
00045
00050 class Video : public DisplayObject
00051 {
00052
00053 public:
00054
00055 Video(as_object* object, const SWF::DefineVideoStreamTag* def,
00056 DisplayObject* parent);
00057
00058 ~Video();
00059
00060 virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const
00061 {
00062
00063 return pointInBounds(x, y);
00064 }
00065
00066 virtual SWFRect getBounds() const;
00067
00069 virtual void construct(as_object* init = 0);
00070
00071 virtual void display(Renderer& renderer, const Transform& xform);
00072
00073 void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);
00074
00076 void setStream(NetStream_as* ns);
00077
00078 void clear();
00079
00081
00086 int height() const;
00087
00089
00094 int width() const;
00095
00097 bool smoothing() const { return _smoothing; }
00098
00100 void setSmoothing(bool b) { _smoothing = b; }
00101
00102 protected:
00103
00105
00109 virtual void markOwnResources() const;
00110
00111 private:
00112
00114 image::GnashImage* getVideoFrame();
00115
00116 const boost::intrusive_ptr<const SWF::DefineVideoStreamTag> m_def;
00117
00118
00119 NetStream_as* _ns;
00120
00122 bool _embeddedStream;
00123
00125 boost::int32_t _lastDecodedVideoFrameNum;
00126
00128 std::auto_ptr<image::GnashImage> _lastDecodedVideoFrame;
00129
00131 std::auto_ptr<media::VideoDecoder> _decoder;
00132
00134 bool _smoothing;
00135 };
00136
00138
00141 as_object* createVideoObject(Global_as& gl);
00142
00143 void video_class_init(as_object& global, const ObjectURI& uri);
00144
00145 void registerVideoNative(as_object& global);
00146
00147 }
00148
00149
00150 #endif // GNASH_VIDEO_STREAM_INSTANCE_H