• 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     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                 // video DisplayObject shape is always a rectangle..
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     // Who owns this ? Should it be an intrusive ptr ?
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 }       // end namespace gnash
00146 
00147 
00148 #endif // GNASH_VIDEO_STREAM_INSTANCE_H

Generated on Fri Mar 16 2012 15:46:13 for Gnash by  doxygen 1.7.1