• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

Video.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
00003 //   Foundation, Inc
00004 // 
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019 // 
00020 
00021 #ifndef GNASH_VIDEO_H
00022 #define GNASH_VIDEO_H
00023 
00024 #include <boost/intrusive_ptr.hpp>
00025 #include "DisplayObject.h" // for inheritance
00026 
00027 // Forward declarations
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                 // video DisplayObject shape is always a rectangle..
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     // Who owns this ? Should it be an intrusive ptr ?
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 }       // end namespace gnash
00148 
00149 
00150 #endif // GNASH_VIDEO_STREAM_INSTANCE_H

Generated on Thu Sep 2 2010 for Gnash by  doxygen 1.7.1