gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog gui/Player.cpp gui/gnash.cpp li...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog gui/Player.cpp gui/gnash.cpp li...
Date: Mon, 09 Jun 2008 14:31:57 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/06/09 14:31:56

Modified files:
        .              : ChangeLog 
        gui            : Player.cpp gnash.cpp 
        libbase        : IOChannel.cpp IOChannel.h LoadThread.cpp 
                         LoadThread.h curl_adapter.cpp curl_adapter.h 
                         image.cpp image.h jpeg.cpp jpeg.h 
                         noseek_fd_adapter.cpp noseek_fd_adapter.h 
                         zlib_adapter.cpp zlib_adapter.h 
        libmedia       : FLVParser.cpp FLVParser.h MediaHandler.cpp 
                         MediaHandler.h MediaParser.h 
        libmedia/ffmpeg: AudioDecoderFfmpeg.cpp MediaHandlerFfmpeg.cpp 
                         MediaHandlerFfmpeg.h MediaParserFfmpeg.cpp 
                         MediaParserFfmpeg.h 
        libmedia/gst   : MediaHandlerGst.cpp MediaHandlerGst.h 
        server         : LoadVariablesThread.cpp LoadVariablesThread.h 
                         StreamProvider.cpp StreamProvider.h font.cpp 
                         gnash.h impl.cpp stream.cpp stream.h 
        server/asobj   : LoadVars.cpp NetConnection.cpp NetConnection.h 
                         NetStreamFfmpeg.h xml.cpp xml.h 
        server/parser  : movie_def_impl.cpp movie_def_impl.h 
                         movie_definition.h 
        testsuite      : MovieTester.cpp 
        utilities      : processor.cpp 

Log message:
        use IOChannel instead of tu_file for input.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6863&r2=1.6864
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.118&r2=1.119
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gnash.cpp?cvsroot=gnash&r1=1.123&r2=1.124
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/IOChannel.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/IOChannel.h?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/LoadThread.cpp?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/LoadThread.h?cvsroot=gnash&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/curl_adapter.cpp?cvsroot=gnash&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/curl_adapter.h?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/image.cpp?cvsroot=gnash&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/image.h?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/jpeg.cpp?cvsroot=gnash&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/jpeg.h?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/noseek_fd_adapter.cpp?cvsroot=gnash&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/noseek_fd_adapter.h?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/zlib_adapter.cpp?cvsroot=gnash&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/zlib_adapter.h?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/FLVParser.cpp?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/FLVParser.h?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/MediaHandler.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/MediaHandler.h?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/MediaParser.h?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/MediaHandlerFfmpeg.cpp?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/MediaHandlerFfmpeg.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/MediaParserFfmpeg.cpp?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/MediaParserFfmpeg.h?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/MediaHandlerGst.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/MediaHandlerGst.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/LoadVariablesThread.cpp?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/server/LoadVariablesThread.h?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/server/StreamProvider.cpp?cvsroot=gnash&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/gnash/server/StreamProvider.h?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.cpp?cvsroot=gnash&r1=1.69&r2=1.70
http://cvs.savannah.gnu.org/viewcvs/gnash/server/gnash.h?cvsroot=gnash&r1=1.125&r2=1.126
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.153&r2=1.154
http://cvs.savannah.gnu.org/viewcvs/gnash/server/stream.cpp?cvsroot=gnash&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/gnash/server/stream.h?cvsroot=gnash&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/LoadVars.cpp?cvsroot=gnash&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetConnection.cpp?cvsroot=gnash&r1=1.63&r2=1.64
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetConnection.h?cvsroot=gnash&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.h?cvsroot=gnash&r1=1.74&r2=1.75
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xml.cpp?cvsroot=gnash&r1=1.82&r2=1.83
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xml.h?cvsroot=gnash&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.118&r2=1.119
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.h?cvsroot=gnash&r1=1.81&r2=1.82
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_definition.h?cvsroot=gnash&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/MovieTester.cpp?cvsroot=gnash&r1=1.73&r2=1.74
http://cvs.savannah.gnu.org/viewcvs/gnash/utilities/processor.cpp?cvsroot=gnash&r1=1.101&r2=1.102

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6863
retrieving revision 1.6864
diff -u -b -r1.6863 -r1.6864
--- ChangeLog   9 Jun 2008 12:37:00 -0000       1.6863
+++ ChangeLog   9 Jun 2008 14:31:51 -0000       1.6864
@@ -1,3 +1,7 @@
+2008-06-09 Sandro Santilli <address@hidden>
+
+       * lots of files: use IOChannel instead of tu_file for input.
+
 2008-06-09 Benjamin Wolsey <address@hidden>
 
        * testsuite/actionscript.all/Matrix.as: test non-numerical values

Index: gui/Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -b -r1.118 -r1.119
--- gui/Player.cpp      3 Jun 2008 14:48:52 -0000       1.118
+++ gui/Player.cpp      9 Jun 2008 14:31:52 -0000       1.119
@@ -255,7 +255,7 @@
     try {
         if ( _infile == "-" )
         {
-            std::auto_ptr<tu_file> in ( 
noseek_fd_adapter::make_stream(fileno(stdin)) );
+            std::auto_ptr<IOChannel> in ( 
noseek_fd_adapter::make_stream(fileno(stdin)) );
             md = gnash::create_movie(in, _url, false);
         }
         else

Index: gui/gnash.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gnash.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -b -r1.123 -r1.124
--- gui/gnash.cpp       27 May 2008 16:54:47 -0000      1.123
+++ gui/gnash.cpp       9 Jun 2008 14:31:52 -0000       1.124
@@ -26,6 +26,7 @@
 #include "rc.h" // for use of rcfile
 #include "debugger.h"
 #include "arg_parser.h"
+#include "utility.h" // for clamp
 
 #ifdef HAVE_FFMPEG_AVCODEC_H
 extern "C" {

Index: libbase/IOChannel.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/IOChannel.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- libbase/IOChannel.cpp       9 Jun 2008 11:20:59 -0000       1.1
+++ libbase/IOChannel.cpp       9 Jun 2008 14:31:52 -0000       1.2
@@ -20,6 +20,8 @@
 
 #include "IOChannel.h"
 
+#include <boost/static_assert.hpp>
+
 namespace gnash
 {
 
@@ -102,7 +104,7 @@
         boost::uint32_t        i;
     } u;
 
-    compiler_assert(sizeof(alias) == sizeof(boost::uint32_t));
+    BOOST_STATIC_ASSERT(sizeof(alias) == sizeof(boost::uint32_t));
     
     u.f = value;
     write_le32(u.i);
@@ -116,7 +118,7 @@
         boost::uint32_t        i;
     } u;
 
-    compiler_assert(sizeof(u) == sizeof(u.i));
+    BOOST_STATIC_ASSERT(sizeof(u) == sizeof(u.i));
     
     u.i = read_le32();
     return u.f;

Index: libbase/IOChannel.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/IOChannel.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- libbase/IOChannel.h 9 Jun 2008 11:20:59 -0000       1.1
+++ libbase/IOChannel.h 9 Jun 2008 14:31:52 -0000       1.2
@@ -21,11 +21,10 @@
 #define GNASH_IOCHANNEL_H
 
 #include "dsodefs.h" // DSOEXPORT
-#include "utility.h"
 
-#include <cstdio>
+#include "GnashException.h" // for IOException inheritance
 
-//class membuf;
+#include <boost/cstdint.hpp> // for boost int types
 
 // temp hack to avoid changing all callers
 // TODO: update all callers ...
@@ -41,6 +40,13 @@
 
 namespace gnash {
 
+/// Exception signalling an IO error
+class IOException : public GnashException {
+
+       IOException(const std::string& s) : GnashException(s) {}
+       IOException() : GnashException("IO error") {}
+};
+
 /// A virtual IO channel
 class DSOEXPORT IOChannel
 {
@@ -51,73 +57,64 @@
        /// \brief Read a 32-bit word from a little-endian stream.
        ///     returning it as a native-endian word.
        //
-       /// TODO: define what happens when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        boost::uint32_t read_le32();
 
        /// \brief Read a 64-bit word from a little-ending stream,
        /// returning it as a native-endian word.
        //
-       /// TODO: define what happens when the stream is in
-       ///       error condition, see get_error().
+       /// Throw IOException on premature EOF
+       ///
        /// TODO: define a platform-neutral type for 64 bits.
        ///
        long double read_le_double64();
 
        /// Read a 16-bit word from a little-endian stream.
        //
-       /// TODO: define what happens when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        boost::uint16_t read_le16();
 
        /// Write a 32-bit word to a little-endian stream.
        //
-       /// TODO: define what happens when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        void write_le32(boost::uint32_t u);
 
        /// \brief Write a 16-bit word to a little-endian stream.
        //
-       /// TODO: define what happens when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        void write_le16(boost::uint16_t u);
 
        /// Read a single byte from the stream
        //
-       /// TODO: define what happens when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        virtual boost::uint8_t read_byte() =0;
 
        /// write a single byte to the stream
        //
-       /// TODO: define what happens when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        virtual void write_byte(boost::uint8_t u)=0;
 
        /// Read the given number of bytes from the stream
        //
-       /// TODO: define what happens when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        virtual int read_bytes(void* dst, int num)=0;
 
        /// \brief Write the given number of bytes to the stream
        //
-       /// TODO: define what happens when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        virtual int write_bytes(const void* src, int num)=0;
 
        /// \brief Write a 0-terminated string to a stream.
        //
-       /// TODO: define what happens when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        void write_string(const char* src);
 
@@ -132,8 +129,7 @@
        /// @return the number of characters read, or -1 no null-termination
        ///         was found within max_length
        ///
-       /// TODO: define what to return when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        int     read_string(char* dst, int max_length);
 
@@ -142,8 +138,7 @@
        /// NOTE: this currently relies on host FP format being the same as the 
Flash one
        ///       (presumably IEEE 754).
        ///
-       /// TODO: define what to return when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        void    write_float32(float value);
 
@@ -152,23 +147,20 @@
        /// NOTE: this currently relies on host FP format being the same as the 
Flash one
        /// (presumably IEEE 754).
        ///
-       /// TODO: define what to return when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        float   read_float32();
 
        /// Return current stream position
        //
-       /// TODO: define what to return when the stream
-       ///       is in error condition, see get_error().
+       /// Throw IOException on error
        ///
        virtual int get_position() const=0;
 
        /// Seek to the specified position
        //
        /// 
-       /// TODO: define what happens when an error occurs, or
-       ///       when we're already in an error condition
+       /// Throw IOException on error
        ///
        /// @return 0 on success, or -1 on failure.
        ///
@@ -176,14 +168,13 @@
 
        /// Seek to the end of the stream
        //
-       /// TODO: define what happens when an error occurs
+       /// Throw IOException on error
        ///
        virtual void go_to_end()=0;
 
        /// Return true if the end of the stream has been reached.
        //
-       /// TODO: define what to return when in error condition
-       /// see get_error().
+       /// Throw IOException on error
        ///
        virtual bool get_eof() const=0;
     

Index: libbase/LoadThread.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/LoadThread.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- libbase/LoadThread.cpp      28 Apr 2008 10:35:04 -0000      1.22
+++ libbase/LoadThread.cpp      9 Jun 2008 14:31:52 -0000       1.23
@@ -102,7 +102,7 @@
     return _cancelRequested;
 }
 
-bool LoadThread::setStream(std::auto_ptr<tu_file> stream)
+bool LoadThread::setStream(std::auto_ptr<gnash::IOChannel> stream)
 {
        _stream = stream;
        if (_stream.get() != NULL) {

Index: libbase/LoadThread.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/LoadThread.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- libbase/LoadThread.h        21 Jan 2008 20:55:43 -0000      1.19
+++ libbase/LoadThread.h        9 Jun 2008 14:31:52 -0000       1.20
@@ -20,7 +20,7 @@
 #define __LOADTHREAD_H__
 
 
-#include "tu_file.h"
+#include "IOChannel.h"
 
 #include <boost/thread/thread.hpp>
 #include <boost/thread/mutex.hpp>
@@ -40,8 +40,8 @@
 /// or stream using a thread, without having to block.
 ///
 /// When the object is created it starts a thread which seeks forward
-/// in the tu_file given as an argument to the constructor, which will
-/// make cause the tu_file backend to download the amount of data needed
+/// in the IOCHannel given as an argument to the constructor, which will
+/// make cause the IOChannel backend to download the amount of data needed
 /// to complete the seek. This is repeated until the complete file is
 /// downloaded. It is possible
 /// for the object owner to query for data, position, loaded data,
@@ -49,7 +49,7 @@
 /// not been downloaded enough data to accomendate a request (seek/read)
 /// it will block until the data is present (curl_adaptor behavoir).
 ///
-/// When using the LoadThread, all access to the tu_file should be
+/// When using the LoadThread, all access to the gnash::IOChannel should be
 /// done through LoadThread, or it will likely break.
 ///
 /// @todo When we read from a real movie stream (rtmp) we might
@@ -67,7 +67,7 @@
 
        /// Sets the stream used for the connection, and starts the download
        /// is the stream is valid. Returns true is the stream is valid, and 
else false.
-       bool setStream(std::auto_ptr<tu_file> str);
+       bool setStream(std::auto_ptr<gnash::IOChannel> str);
 
        /// Put read pointer at given position
        /// Will block if there is not enough data buffered,
@@ -135,7 +135,7 @@
        void fillCache();
 
        /// The stream/file we want to access
-       std::auto_ptr<tu_file> _stream;
+       std::auto_ptr<gnash::IOChannel> _stream;
 
        volatile bool _completed;
 

Index: libbase/curl_adapter.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/curl_adapter.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- libbase/curl_adapter.cpp    29 May 2008 12:26:43 -0000      1.61
+++ libbase/curl_adapter.cpp    9 Jun 2008 14:31:52 -0000       1.62
@@ -82,8 +82,8 @@
 //#define GNASH_CURL_WARN_SEEKSBACK 1
 
 
-namespace curl_adapter
-{
+namespace gnash {
+namespace curl_adapter {
 
 /***********************************************************************
  *
@@ -1166,7 +1166,7 @@
 // Exported interfaces
 //-------------------------------------------
 
-tu_file*
+IOChannel*
 make_stream(const char* url)
 {
 #ifdef GNASH_CURL_VERBOSE
@@ -1197,7 +1197,7 @@
                close);
 }
 
-tu_file*
+IOChannel*
 make_stream(const char* url, const std::string& postdata)
 {
 #ifdef GNASH_CURL_VERBOSE
@@ -1229,6 +1229,7 @@
 }
 
 } // namespace curl_adapter
+} // namespace gnash
 
 #endif // def USE_CURL
 

Index: libbase/curl_adapter.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/curl_adapter.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- libbase/curl_adapter.h      27 Mar 2008 16:12:34 -0000      1.11
+++ libbase/curl_adapter.h      9 Jun 2008 14:31:52 -0000       1.12
@@ -24,12 +24,12 @@
 #include <string>
 
 
-class tu_file;
+namespace gnash {
+class IOChannel;
 
 
 /// Code to wrap libcurl around a tu_file stream.
-namespace curl_adapter
-{
+namespace curl_adapter {
 
 /// \brief
 /// Returns a read-only tu_file stream that fetches data
@@ -37,7 +37,7 @@
 //
 /// The caller owns the returned tu_file*.  
 ///
-DSOEXPORT tu_file* make_stream(const char* url);
+DSOEXPORT IOChannel* make_stream(const char* url);
 
 /// \brief
 /// Returns a read-only tu_file stream that fetches data
@@ -51,9 +51,10 @@
 /// @param postdata
 ///    The url-encoded post data
 ///
-DSOEXPORT tu_file* make_stream(const char* url, const std::string& postdata);
+DSOEXPORT IOChannel* make_stream(const char* url, const std::string& postdata);
 
-}
+} // namespace gnash::curl_adaptar
+} // namespace gnash
 
 #endif // CURL_ADAPTER_H
 

Index: libbase/image.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/image.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- libbase/image.cpp   27 Jan 2008 07:18:17 -0000      1.27
+++ libbase/image.cpp   9 Jun 2008 14:31:52 -0000       1.28
@@ -9,7 +9,9 @@
 
 #include "utility.h"
 #include "jpeg.h"
-#include "tu_file.h"
+#include "IOChannel.h"
+#include "tu_file.h" // some functions take a filename, tu_file is created in 
that case..
+
 #include <cstring>
 #include <memory>              // for auto_ptr
 #include <boost/scoped_array.hpp>
@@ -456,7 +458,7 @@
 
 
        // Write the given image to the given out stream, in jpeg format.
-       void    write_jpeg(tu_file* out, rgb* image, int quality)
+       void    write_jpeg(gnash::IOChannel* out, rgb* image, int quality)
        {
                size_t height = image->height();
 
@@ -489,7 +491,7 @@
        //
        // TODO: return by auto_ptr !
        //
-       rgb*    read_jpeg(tu_file* in)
+       rgb*    read_jpeg(gnash::IOChannel* in)
        {
                std::auto_ptr<jpeg::input> j_in ( jpeg::input::create(in) );
                if (!j_in.get()) return 0;
@@ -531,7 +533,7 @@
        //
        // TODO: return by auto_ptr !
        //
-       rgba*   read_swf_jpeg3(tu_file* in)
+       rgba*   read_swf_jpeg3(gnash::IOChannel* in)
        {
                std::auto_ptr<jpeg::input> j_in ( 
jpeg::input::create_swf_jpeg2_header_only(in, false) );
                if ( ! j_in.get() ) return 0;
@@ -563,7 +565,7 @@
 
 
        // Write a 32-bit Targa format bitmap.  Dead simple, no compression.
-       void    write_tga(tu_file* out, rgba* im)
+       void    write_tga(gnash::IOChannel* out, rgba* im)
        {
                size_t imWidth = im->width();
                size_t imHeight = im->height();

Index: libbase/image.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/image.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- libbase/image.h     22 Apr 2008 03:15:00 -0000      1.22
+++ libbase/image.h     9 Jun 2008 14:31:52 -0000       1.23
@@ -14,8 +14,9 @@
 #include <boost/scoped_array.hpp>
 #include <memory> // for auto_ptr
 
-class tu_file;
+// Forward declarations
 namespace jpeg { class input; }
+namespace gnash { class IOChannel; }
 
 
 /// Handy image utilities for RGB surfaces.
@@ -304,10 +305,10 @@
                         rgba* in, float in_x0, float in_y0, float in_x1, float 
in_y1);
 
        /// Write the given image to the given out stream, in jpeg format.
-       DSOEXPORT void  write_jpeg(tu_file* out, rgb* image, int quality);
+       DSOEXPORT void  write_jpeg(gnash::IOChannel* out, rgb* image, int 
quality);
 
        /// Write a 32-bit Targa format bitmap.  Dead simple, no compression.
-       DSOEXPORT void  write_tga(tu_file* out, rgba* image);
+       DSOEXPORT void  write_tga(gnash::IOChannel* out, rgba* image);
 
        /// Create and read a new image from the given filename, if possible.
        DSOEXPORT rgb*  read_jpeg(const char* filename);
@@ -318,12 +319,12 @@
        ///     Stream to read from. Ownership to the caller,
        ///     not needed after return.
        ///
-       DSOEXPORT rgb*  read_jpeg(tu_file* in);
+       DSOEXPORT rgb*  read_jpeg(gnash::IOChannel* in);
 
        /// \brief
        /// For reading SWF JPEG2-style image data (slight variation on
        /// ordinary JPEG).
-       DSOEXPORT rgb*  read_swf_jpeg2(tu_file* in);
+       DSOEXPORT rgb*  read_swf_jpeg2(gnash::IOChannel* in);
 
        /// \brief
        /// For reading SWF JPEG2-style image data, using pre-loaded
@@ -333,7 +334,7 @@
        /// \brief
        /// For reading SWF JPEG3-style image data, like ordinary JPEG, 
        /// but stores the data in rgba format.
-       DSOEXPORT rgba* read_swf_jpeg3(tu_file* in);
+       DSOEXPORT rgba* read_swf_jpeg3(gnash::IOChannel* in);
 }
 
 

Index: libbase/jpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/jpeg.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- libbase/jpeg.cpp    27 May 2008 07:49:46 -0000      1.24
+++ libbase/jpeg.cpp    9 Jun 2008 14:31:52 -0000       1.25
@@ -33,16 +33,16 @@
 static void    setup_jpeg_err(jpeg_error_mgr* jerr);
 
 
-/// input/output wrappers for tu_file
-namespace tu_file_wrappers
+/// input/output wrappers for IOChannel
+namespace IOChannel_wrappers
 {
 
        // Helper object for reading jpeg image data.  Basically a thin
        static const int        IO_BUF_SIZE = 4096;
 
-       // A jpeglib source manager that reads from a tu_file.  Paraphrased
+       // A jpeglib source manager that reads from a IOChannel.  Paraphrased
        // from IJG jpeglib jdatasrc.c.
-       class rw_source_tu_file
+       class rw_source_IOChannel
        {
        public:
                struct jpeg_source_mgr  m_pub;          /* public fields */
@@ -50,7 +50,7 @@
                // Constructor.  The caller is responsible for closing the 
input stream
                // after it's done using us.
                //
-               rw_source_tu_file(tu_file* in)
+               rw_source_IOChannel(gnash::IOChannel* in)
                        :
                        _ownSourceStream(false),
                        m_in_stream(in),
@@ -64,7 +64,7 @@
                        _ownSourceStream=true;
                }
 
-               ~rw_source_tu_file()
+               ~rw_source_IOChannel()
                {
                        if ( _ownSourceStream )
                        {
@@ -74,7 +74,7 @@
 
                static void init_source(j_decompress_ptr cinfo)
                {
-                       rw_source_tu_file*      src = (rw_source_tu_file*) 
cinfo->src;
+                       rw_source_IOChannel*    src = (rw_source_IOChannel*) 
cinfo->src;
                        src->m_start_of_file = true;
                }
 
@@ -82,7 +82,7 @@
                // when it needs more data from the file.
                static boolean fill_input_buffer(j_decompress_ptr cinfo)
                {
-                       rw_source_tu_file*      src = (rw_source_tu_file*) 
cinfo->src;
+                       rw_source_IOChannel*    src = (rw_source_IOChannel*) 
cinfo->src;
 
                        // TODO: limit read as requested by caller
                        size_t  bytes_read = 
src->m_in_stream->read_bytes(src->m_buffer, IO_BUF_SIZE);
@@ -129,7 +129,7 @@
                // uninteresting data.
                static void     skip_input_data(j_decompress_ptr cinfo, long 
num_bytes)
                {
-                       rw_source_tu_file*      src = (rw_source_tu_file*) 
cinfo->src;
+                       rw_source_IOChannel*    src = (rw_source_IOChannel*) 
cinfo->src;
 
                        // According to jpeg docs, large skips are
                        // infrequent.  So let's just do it the simple
@@ -148,7 +148,7 @@
                static void term_source(j_decompress_ptr /* cinfo */)
                // Terminate the source.  Make sure we get deleted.
                {
-                       /*rw_source_tu_file*    src = (rw_source_tu_file*) 
cinfo->src;
+                       /*rw_source_IOChannel*  src = (rw_source_IOChannel*) 
cinfo->src;
                        assert(src);
 
                        // @@ it's kind of bogus to be deleting here
@@ -179,11 +179,11 @@
                ///     If false, ownership of the stream 
                ///     is left to caller, otherwise we take it.
                //
-               static void setup(jpeg_decompress_struct* cinfo, tu_file* 
instream,
+               static void setup(jpeg_decompress_struct* cinfo, 
gnash::IOChannel* instream,
                        bool takeOwnership=false)
                {
                        // assert(cinfo->src == NULL);
-                       rw_source_tu_file* source = new 
rw_source_tu_file(instream);
+                       rw_source_IOChannel* source = new 
rw_source_IOChannel(instream);
                        if ( takeOwnership ) source->takeStreamOwnership();
                        cinfo->src = (jpeg_source_mgr*)source;
                }
@@ -203,7 +203,7 @@
                }
 
                bool _ownSourceStream;
-               tu_file*        m_in_stream;            /* source stream */
+               gnash::IOChannel*       m_in_stream;            /* source 
stream */
                bool    m_start_of_file;                /* have we gotten any 
data yet? */
                JOCTET  m_buffer[IO_BUF_SIZE];          /* start of buffer */
 
@@ -213,9 +213,9 @@
        
 
 
-       // A jpeglib destination manager that writes to a tu_file.
+       // A jpeglib destination manager that writes to a gnash::IOChannel.
        // Paraphrased from IJG jpeglib jdatadst.c.
-       class rw_dest_tu_file
+       class rw_dest_IOChannel
        {
        public:
                struct jpeg_destination_mgr     m_pub;  /* public fields */
@@ -228,7 +228,7 @@
                /// @param out
                ///     The output stream, externally owned.
                ///
-               rw_dest_tu_file(tu_file* out)
+               rw_dest_IOChannel(gnash::IOChannel* out)
                        :
                        m_out_stream(out)
                {
@@ -243,7 +243,7 @@
 
                static void init_destination(j_compress_ptr cinfo)
                {
-                       rw_dest_tu_file*        dest = (rw_dest_tu_file*) 
cinfo->dest;
+                       rw_dest_IOChannel*      dest = (rw_dest_IOChannel*) 
cinfo->dest;
                        assert(dest);
 
                        dest->m_pub.next_output_byte = dest->m_buffer;
@@ -252,22 +252,22 @@
 
                // Set up the given compress object to write to the given
                // output stream.
-               static void setup(j_compress_ptr cinfo, tu_file* outstream)
+               static void setup(j_compress_ptr cinfo, gnash::IOChannel* 
outstream)
                {
-                       cinfo->dest = (jpeg_destination_mgr*) (new 
rw_dest_tu_file(outstream));
+                       cinfo->dest = (jpeg_destination_mgr*) (new 
rw_dest_IOChannel(outstream));
                }
 
                /// Write the output buffer into the stream.
                static boolean  empty_output_buffer(j_compress_ptr cinfo)
                {
-                       rw_dest_tu_file*        dest = (rw_dest_tu_file*) 
cinfo->dest;
+                       rw_dest_IOChannel*      dest = (rw_dest_IOChannel*) 
cinfo->dest;
                        assert(dest);
 
                        if (dest->m_out_stream->write_bytes(dest->m_buffer, 
IO_BUF_SIZE) != IO_BUF_SIZE)
                        {
                                // Error.
                                // @@ bah, exceptions suck.  TODO consider 
alternatives.
-                               gnash::log_error("jpeg::rw_dest_tu_file 
couldn't write data.");
+                               gnash::log_error("jpeg::rw_dest_IOChannel 
couldn't write data.");
                                return false;
                        }
 
@@ -283,7 +283,7 @@
                ///
                static void term_destination(j_compress_ptr cinfo)
                {
-                       rw_dest_tu_file*        dest = (rw_dest_tu_file*) 
cinfo->dest;
+                       rw_dest_IOChannel*      dest = (rw_dest_IOChannel*) 
cinfo->dest;
                        assert(dest);
 
                        // Write any remaining data.
@@ -292,7 +292,7 @@
                                if 
(dest->m_out_stream->write_bytes(dest->m_buffer, datacount) != datacount)
                                {
                                        // Error.
-                                       
gnash::log_error("jpeg::rw_dest_tu_file::term_destination couldn't write 
data.");
+                                       
gnash::log_error("jpeg::rw_dest_IOChannel::term_destination couldn't write 
data.");
                                }
                        }
 
@@ -304,14 +304,14 @@
        private:        
 
                // source stream, externally owned
-               tu_file*        m_out_stream;   
+               gnash::IOChannel*       m_out_stream;   
 
                JOCTET  m_buffer[IO_BUF_SIZE];          /* start of buffer */
 
        };
 
        /// Bascially this is a thin wrapper around jpeg_decompress object.
-       class input_tu_file : public input
+       class input_IOChannel : public input
        {
        public:
                // State needed for input.
@@ -333,7 +333,7 @@
                /// @param takeOwnership
                ///     If true, we take ownership of the input stream. 
                ///
-               input_tu_file(tu_file* in, bool takeOwnership=false)
+               input_IOChannel(gnash::IOChannel* in, bool takeOwnership=false)
                        :
                        m_compressor_opened(false)
                {
@@ -344,7 +344,7 @@
                        // Initialize decompression object.
                        jpeg_create_decompress(&m_cinfo);
 
-                       rw_source_tu_file::setup(&m_cinfo, in, takeOwnership);
+                       rw_source_IOChannel::setup(&m_cinfo, in, takeOwnership);
 
                }
 
@@ -393,11 +393,11 @@
                }
 
                // Destructor.  Clean up our jpeg reader state.
-               ~input_tu_file()
+               ~input_IOChannel()
                {
                        finish_image();
 
-                       rw_source_tu_file* src = (rw_source_tu_file*) 
m_cinfo.src;
+                       rw_source_IOChannel* src = (rw_source_IOChannel*) 
m_cinfo.src;
                        delete src;
                        m_cinfo.src = NULL;
 
@@ -410,7 +410,7 @@
                // data, to avoid screwing up future reads.
                void    discard_partial_buffer()
                {
-                       rw_source_tu_file* src = (rw_source_tu_file*) 
m_cinfo.src;
+                       rw_source_IOChannel* src = (rw_source_IOChannel*) 
m_cinfo.src;
 
                        // We only have to discard the input buffer after 
reading the tables.
                        if (src)
@@ -543,7 +543,7 @@
 
        // Basically this is a thin wrapper around jpeg_compress
        // object.
-       class output_tu_file : public output
+       class output_IOChannel : public output
        {
        public:
                // State needed for output.
@@ -554,14 +554,14 @@
                //
                /// Read the header data from in, and
                ///  prepare to read data.
-               output_tu_file(tu_file* out, int width, int height, int quality)
+               output_IOChannel(gnash::IOChannel* out, int width, int height, 
int quality)
                {
                        m_cinfo.err = jpeg_std_error(&m_jerr);
 
                        // Initialize decompression object.
                        jpeg_create_compress(&m_cinfo);
 
-                       rw_dest_tu_file::setup(&m_cinfo, out);
+                       rw_dest_IOChannel::setup(&m_cinfo, out);
                        m_cinfo.image_width = width;
                        m_cinfo.image_height = height;
                        m_cinfo.input_components = 3;
@@ -573,12 +573,12 @@
                }
 
 
-               ~output_tu_file()
+               ~output_IOChannel()
                // Destructor.  Clean up our jpeg reader state.
                {
                        jpeg_finish_compress(&m_cinfo);
 /*
-                       rw_dest_tu_file* src = (rw_source_tu_file*) 
m_cinfo.dest;
+                       rw_dest_IOChannel* src = (rw_source_IOChannel*) 
m_cinfo.dest;
                        delete dest;
                        m_cinfo.dest = NULL;
 */
@@ -595,7 +595,7 @@
 
 
 
-} // namespace tu_file_wrappers
+} // namespace IOChannel_wrappers
 
 
 // Set up some error handlers for the jpeg lib.
@@ -636,20 +636,20 @@
 
 /*static*/
 input*
-input::create(tu_file* in, bool takeOwnership)
+input::create(gnash::IOChannel* in, bool takeOwnership)
 {
-       using tu_file_wrappers::input_tu_file;
-       std::auto_ptr<input_tu_file> ret ( new input_tu_file(in, takeOwnership) 
);
+       using IOChannel_wrappers::input_IOChannel;
+       std::auto_ptr<input_IOChannel> ret ( new input_IOChannel(in, 
takeOwnership) );
        if ( ret.get() ) ret->start_image(); // might throw an exception (I 
guess)
        return ret.release();
 }
 
 /*static*/
 input*
-input::create_swf_jpeg2_header_only(tu_file* in, unsigned int maxHeaderBytes, 
bool takeOwnership)
+input::create_swf_jpeg2_header_only(gnash::IOChannel* in, unsigned int 
maxHeaderBytes, bool takeOwnership)
 {
-       using tu_file_wrappers::input_tu_file;
-       std::auto_ptr<input_tu_file> ret ( new input_tu_file(in, takeOwnership) 
);
+       using IOChannel_wrappers::input_IOChannel;
+       std::auto_ptr<input_IOChannel> ret ( new input_IOChannel(in, 
takeOwnership) );
        if ( ret.get() ) ret->readHeader(maxHeaderBytes); // might throw an 
exception
        return ret.release();
 }
@@ -657,9 +657,9 @@
 
 /*static*/
 output*
-output::create(tu_file* in, int width, int height, int quality)
+output::create(gnash::IOChannel* in, int width, int height, int quality)
 {
-       return new tu_file_wrappers::output_tu_file(in, width, height, quality);
+       return new IOChannel_wrappers::output_IOChannel(in, width, height, 
quality);
 }
 
 } // namespace jpeg

Index: libbase/jpeg.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/jpeg.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- libbase/jpeg.h      27 Mar 2008 16:12:34 -0000      1.12
+++ libbase/jpeg.h      9 Jun 2008 14:31:52 -0000       1.13
@@ -12,9 +12,8 @@
 #include "dsodefs.h"
 #include <csetjmp> // for jmp_buf
 
-struct jpeg_decompress_struct;
-struct jpeg_compress_struct;
-class tu_file;
+// Forward declarations
+namespace gnash { class IOChannel; }
 
 /// Wrapper for jpeg file operations. 
 //
@@ -54,7 +53,7 @@
                ///
                /// @return NULL on error
                ///
-               DSOEXPORT static input* create(tu_file* in, bool 
takeOwnership=false);
+               DSOEXPORT static input* create(gnash::IOChannel* in, bool 
takeOwnership=false);
 
                /// Read SWF JPEG2-style header. 
                //
@@ -63,7 +62,7 @@
                /// bracketing within start_image()/finish_image() pairs.
                ///
                /// @param in
-               ///     The tu_file to use for input. Ownership specified
+               ///     The gnash::IOChannel to use for input. Ownership 
specified
                ///     by last arg.
                ///
                /// @param maxHeaderBytes
@@ -78,7 +77,7 @@
                ///
                /// @return NULL on error
                ///
-               DSOEXPORT static input* create_swf_jpeg2_header_only(tu_file* 
in,
+               DSOEXPORT static input* 
create_swf_jpeg2_header_only(gnash::IOChannel* in,
                                unsigned int maxHeaderBytes, bool 
takeOwnership=false);
 
                /// Discard existing bytes in our buffer.
@@ -109,12 +108,12 @@
        class output
        {
        public:
-               /// Create an output object bount to a tu_file
+               /// Create an output object bount to a gnash::IOChannel
                //
                /// @param quality
                ///     Quality goes from 1-100.
                ///
-               DSOEXPORT static output*        create(tu_file* out, int width, 
int height, int quality);
+               DSOEXPORT static output*        create(gnash::IOChannel* out, 
int width, int height, int quality);
 
                virtual ~output() {}
 

Index: libbase/noseek_fd_adapter.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/noseek_fd_adapter.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- libbase/noseek_fd_adapter.cpp       18 May 2008 20:36:13 -0000      1.26
+++ libbase/noseek_fd_adapter.cpp       9 Jun 2008 14:31:52 -0000       1.27
@@ -49,8 +49,8 @@
 #include <string>
 #include <boost/format.hpp>
 
-namespace noseek_fd_adapter
-{
+namespace gnash {
+namespace noseek_fd_adapter {
 
 
 /***********************************************************************
@@ -464,7 +464,7 @@
 }
 
 // this is the only exported interface
-tu_file*
+IOChannel*
 make_stream(int fd, const char* cachefilename)
 {
 #ifdef GNASH_NOSEEK_FD_VERBOSE
@@ -494,7 +494,8 @@
                close);
 }
 
-} // namespace noseek_fd_adapter
+} // namespace gnash::noseek_fd_adapter
+} // namespace gnash
 
 
 

Index: libbase/noseek_fd_adapter.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/noseek_fd_adapter.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- libbase/noseek_fd_adapter.h 27 Mar 2008 16:12:35 -0000      1.9
+++ libbase/noseek_fd_adapter.h 9 Jun 2008 14:31:52 -0000       1.10
@@ -24,7 +24,8 @@
 #include <string>
 
 
-class tu_file;
+namespace gnash {
+class IOChannel;
 
 
 /// Code to use volatile (non-back-seekable) streams as tu_files
@@ -41,9 +42,11 @@
 /// Specify a cachefilename if you want to be able to access
 /// the full cache after deletion of the returned tu_file.
 ///
-DSOEXPORT tu_file* make_stream(int fd, const char* cachefilename=NULL);
+DSOEXPORT IOChannel* make_stream(int fd, const char* cachefilename=NULL);
+
+} // namespace gnash::noseek_fd_adapter
+} // namespace gnash
 
-}
 
 #endif // STDIN_ADAPTER_H
 

Index: libbase/zlib_adapter.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/zlib_adapter.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- libbase/zlib_adapter.cpp    27 May 2008 07:49:46 -0000      1.24
+++ libbase/zlib_adapter.cpp    9 Jun 2008 14:31:52 -0000       1.25
@@ -3,12 +3,13 @@
 // This source code has been donated to the Public Domain.  Do
 // whatever you want with it.
 
-// Code to wrap zlib compression/decompression around a tu_file
+// Code to wrap zlib compression/decompression around a IOChannel
 // stream.
 
 
 #include "zlib_adapter.h"
 #include "tu_file.h"
+#include "IOChannel.h"
 #include "log.h"
 #include "GnashException.h"
 #include <algorithm> // std::min
@@ -16,7 +17,8 @@
 #include <sstream>
 #include <memory>
 
-using namespace gnash;
+namespace gnash {
+
 
 #ifndef HAVE_ZLIB_H
 
@@ -24,12 +26,13 @@
 // Stubs, in case client doesn't want to link to zlib.
 namespace zlib_adapter
 {
-       std::auto_ptr<tu_file> make_inflater(std::auto_ptr<tu_file> /*in*/)
+       std::auto_ptr<IOChannel> make_inflater(std::auto_ptr<IOChannel> /*in*/)
        {
                abort(); // callers should check this themselves
-               return std::auto_ptr<tu_file>(NULL);
+               return std::auto_ptr<IOChannel>(NULL);
        }
-       tu_file* make_deflater(tu_file* /*out*/)
+
+       IOChannel* make_deflater(IOChannel* /*out*/)
        {
                abort(); // callers should check this themselves
                return NULL;
@@ -50,7 +53,7 @@
        class inflater_impl
        {
        private:
-               std::auto_ptr<tu_file>  m_in;
+               std::auto_ptr<IOChannel>        m_in;
                int             m_initial_stream_pos;   // position of the 
input stream where we started inflating.
                unsigned char   m_rawdata[ZBUF_SIZE];
 
@@ -64,7 +67,7 @@
                bool            m_at_eof;
                int             m_error;
                
-               inflater_impl(std::auto_ptr<tu_file> in)
+               inflater_impl(std::auto_ptr<IOChannel> in)
                // Constructor.
                        :
                        m_in(in),
@@ -367,12 +370,12 @@
        }
 
 
-       std::auto_ptr<tu_file> make_inflater(std::auto_ptr<tu_file> in)
+       std::auto_ptr<IOChannel> make_inflater(std::auto_ptr<IOChannel> in)
        {
                assert(in.get());
 
                inflater_impl*  inflater = new inflater_impl(in);
-               return std::auto_ptr<tu_file> (
+               return std::auto_ptr<IOChannel> (
                        new tu_file(
                                inflater,
                                inflate_read,
@@ -389,11 +392,12 @@
 
 
        // @@ TODO
-       // tu_file*     make_deflater(tu_file* out) { ... }
+       // IOChannel*   make_deflater(IOChannel* out) { ... }
 }
 
 #endif // HAVE_ZLIB_H
 
+} // namespace gnash 
 
 // Local Variables:
 // mode: C++

Index: libbase/zlib_adapter.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/zlib_adapter.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- libbase/zlib_adapter.h      27 Mar 2008 16:12:36 -0000      1.6
+++ libbase/zlib_adapter.h      9 Jun 2008 14:31:52 -0000       1.7
@@ -12,31 +12,35 @@
 
 #include <memory>
 
-class tu_file;
+namespace gnash {
 
+class IOChannel;
 
-/// Code to wrap zlib compression/decompression around a tu_file stream.
+
+/// Code to wrap zlib compression/decompression around an IOChannel stream.
 namespace zlib_adapter
 {
        // NOTE: these functions will return NULL if
        // HAVE_ZLIB_H is not defined
 
        /// \brief
-       /// Returns a read-only tu_file stream that inflates the remaining
+       /// Returns a read-only IOChannel stream that inflates the remaining
        /// content of the given input stream, as you read data from the
        /// new stream.
        //
        ///
-       DSOEXPORT std::auto_ptr<tu_file> make_inflater(std::auto_ptr<tu_file> 
in);
+       DSOEXPORT std::auto_ptr<IOChannel> 
make_inflater(std::auto_ptr<IOChannel> in);
 
        /// \brief
-       /// Returns a write-only tu_file stream that deflates the remaining
+       /// Returns a write-only IOChannel stream that deflates the remaining
        /// content of the given input stream.
        //
        /// TODO: take and return by auto_ptr
        ///
-       DSOEXPORT tu_file*      make_deflater(tu_file* out);
-}
+       DSOEXPORT IOChannel*    make_deflater(IOChannel* out);
+
+} // namespace gnash.zlib_adapter
+} // namespace gnash
 
 
 #endif // ZLIB_ADAPTER_H

Index: libmedia/FLVParser.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/FLVParser.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- libmedia/FLVParser.cpp      6 Jun 2008 16:45:08 -0000       1.13
+++ libmedia/FLVParser.cpp      9 Jun 2008 14:31:53 -0000       1.14
@@ -23,6 +23,7 @@
 #include "log.h"
 #include "utility.h"
 #include "GnashException.h"
+#include "IOChannel.h"
 
 #include <string>
 #include <iosfwd>
@@ -38,7 +39,7 @@
 namespace gnash {
 namespace media {
 
-FLVParser::FLVParser(std::auto_ptr<tu_file> lt)
+FLVParser::FLVParser(std::auto_ptr<IOChannel> lt)
        :
        MediaParser(lt),
        _lastParsedPosition(0),
@@ -308,7 +309,7 @@
 std::auto_ptr<EncodedAudioFrame>
 FLVParser::readAudioFrame(boost::uint32_t dataSize, boost::uint32_t timestamp)
 {
-       tu_file& in = *_stream;
+       IOChannel& in = *_stream;
 
        //log_debug("Reading the %dth audio frame, with data size %d, from 
position %d", _audioFrames.size()+1, dataSize, in.get_position());
 
@@ -336,7 +337,7 @@
 std::auto_ptr<EncodedVideoFrame>
 FLVParser::readVideoFrame(boost::uint32_t dataSize, boost::uint32_t timestamp)
 {
-       tu_file& in = *_stream;
+       IOChannel& in = *_stream;
 
        std::auto_ptr<EncodedVideoFrame> frame;
 

Index: libmedia/FLVParser.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/FLVParser.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- libmedia/FLVParser.h        6 Jun 2008 16:45:08 -0000       1.15
+++ libmedia/FLVParser.h        9 Jun 2008 14:31:53 -0000       1.16
@@ -164,13 +164,13 @@
 
        /// \brief
        /// Create an FLV parser reading input from
-       /// the given tu_file
+       /// the given IOChannel
        //
        /// @param lt
-       ///     tu_file to use for input.
+       ///     IOChannel to use for input.
        ///     Ownership transferred.
        ///
-       FLVParser(std::auto_ptr<tu_file> lt);
+       FLVParser(std::auto_ptr<IOChannel> lt);
 
        /// Kills the parser...
        ~FLVParser();

Index: libmedia/MediaHandler.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/MediaHandler.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- libmedia/MediaHandler.cpp   4 Jun 2008 10:06:28 -0000       1.2
+++ libmedia/MediaHandler.cpp   9 Jun 2008 14:31:53 -0000       1.3
@@ -20,7 +20,7 @@
 
 #include "MediaHandler.h"
 #include "FLVParser.h"
-#include "tu_file.h"
+#include "IOChannel.h"
 #include "log.h"
 
 namespace gnash {
@@ -30,7 +30,7 @@
 
 /* public static */
 bool
-MediaHandler::isFLV(tu_file& stream)
+MediaHandler::isFLV(IOChannel& stream)
 {
        char head[4] = {0, 0, 0, 0};
        stream.set_position(0);
@@ -48,7 +48,7 @@
 }
 
 std::auto_ptr<MediaParser>
-MediaHandler::createMediaParser(std::auto_ptr<tu_file> stream)
+MediaHandler::createMediaParser(std::auto_ptr<IOChannel> stream)
 {
        std::auto_ptr<MediaParser> parser;
 

Index: libmedia/MediaHandler.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/MediaHandler.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- libmedia/MediaHandler.h     6 Jun 2008 19:55:49 -0000       1.5
+++ libmedia/MediaHandler.h     9 Jun 2008 14:31:53 -0000       1.6
@@ -30,8 +30,8 @@
 #include <memory>
 
 // Forward declarations
-class tu_file;
 namespace gnash {
+       class IOChannel;
        namespace media {
                class VideoDecoder;
                class AudioDecoder;
@@ -72,7 +72,7 @@
        /// NOTE: the default implementation returns an FLVParser for FLV input
        ///       or 0 for others.
        ///
-       virtual std::auto_ptr<MediaParser> 
createMediaParser(std::auto_ptr<tu_file> stream);
+       virtual std::auto_ptr<MediaParser> 
createMediaParser(std::auto_ptr<IOChannel> stream);
 
        /// Create a VideoDecoder for the specified codec_type
        //
@@ -100,7 +100,7 @@
 protected:
 
        /// Return true if input stream is an FLV
-       bool isFLV(tu_file& stream);
+       bool isFLV(IOChannel& stream);
 
        MediaHandler() {}
 

Index: libmedia/MediaParser.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/MediaParser.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- libmedia/MediaParser.h      7 Jun 2008 01:54:20 -0000       1.21
+++ libmedia/MediaParser.h      9 Jun 2008 14:31:53 -0000       1.22
@@ -24,7 +24,7 @@
 #include "gnashconfig.h"
 #endif
 
-#include "tu_file.h" // for inlines
+#include "IOChannel.h" // for inlines
 #include "dsodefs.h" // DSOEXPORT
 
 #include <boost/scoped_array.hpp>
@@ -220,13 +220,13 @@
 /// and fetching frames from there on, sequentially.
 /// See seek(), nextVideoFrame(), nextAudioFrame() 
 ///
-/// Input is received from a tu_file object.
+/// Input is received from a IOChannel object.
 ///
 class MediaParser
 {
 public:
 
-       MediaParser(std::auto_ptr<tu_file> stream)
+       MediaParser(std::auto_ptr<IOChannel> stream)
                :
                _isAudioMp3(false),
                _isAudioNellymoser(false),
@@ -418,7 +418,7 @@
        bool _isAudioNellymoser;
 
        /// The stream used to access the file
-       std::auto_ptr<tu_file> _stream;
+       std::auto_ptr<IOChannel> _stream;
 
        /// Whether the parsing is complete or not
        bool _parsingComplete;

Index: libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- libmedia/ffmpeg/AudioDecoderFfmpeg.cpp      6 Jun 2008 10:19:59 -0000       
1.8
+++ libmedia/ffmpeg/AudioDecoderFfmpeg.cpp      9 Jun 2008 14:31:53 -0000       
1.9
@@ -19,6 +19,7 @@
 
 
 #include "AudioDecoderFfmpeg.h"
+#include <cmath> // for std::ceil
 
 //#define GNASH_DEBUG_AUDIO_DECODING
 
@@ -262,7 +263,7 @@
                bool stereo = _audioCodecCtx->channels > 1 ? true : false;
                int samples = stereo ? outSize >> 2 : outSize >> 1;
 
-               int resampledFrameSize = int(ceil(outSize*resampleFactor));
+               int resampledFrameSize = int(std::ceil(outSize*resampleFactor));
 
                // Allocate just the required amount of bytes
                boost::uint8_t* resampledOutput = new boost::uint8_t[bufsize]; 
// be safe for now, but should be resampledFrameSize;

Index: libmedia/ffmpeg/MediaHandlerFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/MediaHandlerFfmpeg.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- libmedia/ffmpeg/MediaHandlerFfmpeg.cpp      5 Jun 2008 07:19:02 -0000       
1.4
+++ libmedia/ffmpeg/MediaHandlerFfmpeg.cpp      9 Jun 2008 14:31:53 -0000       
1.5
@@ -25,14 +25,14 @@
 #include "GnashException.h"
 #include "FLVParser.h"
 
-#include "tu_file.h" // for visibility of destructor
+#include "IOChannel.h" // for visibility of destructor
 #include "MediaParser.h" // for visibility of destructor
 
 namespace gnash { 
 namespace media {
 
 std::auto_ptr<MediaParser>
-MediaHandlerFfmpeg::createMediaParser(std::auto_ptr<tu_file> stream)
+MediaHandlerFfmpeg::createMediaParser(std::auto_ptr<IOChannel> stream)
 {
        std::auto_ptr<MediaParser> parser;
 

Index: libmedia/ffmpeg/MediaHandlerFfmpeg.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/MediaHandlerFfmpeg.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- libmedia/ffmpeg/MediaHandlerFfmpeg.h        7 Jun 2008 02:20:42 -0000       
1.3
+++ libmedia/ffmpeg/MediaHandlerFfmpeg.h        9 Jun 2008 14:31:53 -0000       
1.4
@@ -35,7 +35,7 @@
 {
 public:
 
-       virtual std::auto_ptr<MediaParser> 
createMediaParser(std::auto_ptr<tu_file> stream);
+       virtual std::auto_ptr<MediaParser> 
createMediaParser(std::auto_ptr<IOChannel> stream);
 
        virtual std::auto_ptr<VideoDecoder> createVideoDecoder(VideoInfo& info);
 

Index: libmedia/ffmpeg/MediaParserFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/MediaParserFfmpeg.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- libmedia/ffmpeg/MediaParserFfmpeg.cpp       6 Jun 2008 23:55:16 -0000       
1.9
+++ libmedia/ffmpeg/MediaParserFfmpeg.cpp       9 Jun 2008 14:31:53 -0000       
1.10
@@ -21,6 +21,7 @@
 #include "MediaParserFfmpeg.h"
 #include "GnashException.h"
 #include "log.h"
+#include "IOChannel.h" // for use
 
 using namespace std;
 
@@ -270,7 +271,7 @@
        return _lastParsedPosition;
 }
 
-MediaParserFfmpeg::MediaParserFfmpeg(std::auto_ptr<tu_file> stream)
+MediaParserFfmpeg::MediaParserFfmpeg(std::auto_ptr<IOChannel> stream)
        :
        MediaParser(stream),
        _nextVideoFrame(0),
@@ -400,7 +401,7 @@
        log_debug("readPacket(%d)", buf_size);
 
        assert( _stream.get() );
-       tu_file& in = *_stream;
+       IOChannel& in = *_stream;
 
        size_t ret = in.read_bytes(static_cast<void*>(buf), buf_size);
 
@@ -414,7 +415,7 @@
        GNASH_REPORT_FUNCTION;
 
        assert(_stream.get());
-       tu_file& in = *(_stream);
+       IOChannel& in = *(_stream);
 
        // Offset is absolute new position in the file
        if (whence == SEEK_SET)

Index: libmedia/ffmpeg/MediaParserFfmpeg.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/MediaParserFfmpeg.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- libmedia/ffmpeg/MediaParserFfmpeg.h 6 Jun 2008 19:53:30 -0000       1.8
+++ libmedia/ffmpeg/MediaParserFfmpeg.h 9 Jun 2008 14:31:53 -0000       1.9
@@ -43,7 +43,9 @@
 #endif
 
 // Forward declaration
-class tu_file;
+namespace gnash {
+       class IOChannel;
+}
 
 namespace gnash {
 namespace media {
@@ -58,7 +60,7 @@
        //
        /// Can throw a GnashException if input format couldn't be detected
        ///
-       MediaParserFfmpeg(std::auto_ptr<tu_file> stream);
+       MediaParserFfmpeg(std::auto_ptr<IOChannel> stream);
 
        ~MediaParserFfmpeg();
 

Index: libmedia/gst/MediaHandlerGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/gst/MediaHandlerGst.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- libmedia/gst/MediaHandlerGst.cpp    3 Jun 2008 16:11:45 -0000       1.2
+++ libmedia/gst/MediaHandlerGst.cpp    9 Jun 2008 14:31:54 -0000       1.3
@@ -22,14 +22,14 @@
 #include "VideoDecoderGst.h"
 #include "AudioDecoderGst.h"
 
-#include "tu_file.h" // for visibility of destructor
+#include "IOChannel.h" // for visibility of destructor
 #include "MediaParser.h" // for visibility of destructor
 
 namespace gnash { 
 namespace media {
 
 std::auto_ptr<MediaParser>
-MediaHandlerGst::createMediaParser(std::auto_ptr<tu_file> stream)
+MediaHandlerGst::createMediaParser(std::auto_ptr<IOChannel> stream)
 {
        // TODO: support more then just FLV...
        return MediaHandler::createMediaParser(stream);

Index: libmedia/gst/MediaHandlerGst.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/gst/MediaHandlerGst.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- libmedia/gst/MediaHandlerGst.h      6 Jun 2008 19:08:38 -0000       1.3
+++ libmedia/gst/MediaHandlerGst.h      9 Jun 2008 14:31:54 -0000       1.4
@@ -36,7 +36,7 @@
 {
 public:
 
-       virtual std::auto_ptr<MediaParser> 
createMediaParser(std::auto_ptr<tu_file> stream);
+       virtual std::auto_ptr<MediaParser> 
createMediaParser(std::auto_ptr<IOChannel> stream);
 
        virtual std::auto_ptr<VideoDecoder> createVideoDecoder(VideoInfo& info);
 

Index: server/LoadVariablesThread.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/LoadVariablesThread.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- server/LoadVariablesThread.cpp      21 Apr 2008 11:27:42 -0000      1.12
+++ server/LoadVariablesThread.cpp      9 Jun 2008 14:31:54 -0000       1.13
@@ -21,7 +21,7 @@
 #endif
 
 #include "LoadVariablesThread.h"
-#include "tu_file.h"
+#include "IOChannel.h"
 #include "log.h"
 #include "GnashException.h"
 #include "utf8.h"

Index: server/LoadVariablesThread.h
===================================================================
RCS file: /sources/gnash/gnash/server/LoadVariablesThread.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- server/LoadVariablesThread.h        27 Mar 2008 10:50:13 -0000      1.8
+++ server/LoadVariablesThread.h        9 Jun 2008 14:31:54 -0000       1.9
@@ -23,13 +23,15 @@
 #include "StreamProvider.h" // for inlines
 #include "URL.h" // for inlines
 
+#include "log.h"
+#include "IOChannel.h"
+
 #include <string>
 #include <map>
 #include <memory>
 #include <boost/thread/thread.hpp>
 #include <boost/thread/mutex.hpp>
 #include <boost/bind.hpp> 
-#include "log.h"
 
 // Forward declarations
 namespace gnash {
@@ -195,7 +197,7 @@
 
        size_t _bytesTotal;
 
-       std::auto_ptr<tu_file> _stream;
+       std::auto_ptr<IOChannel> _stream;
 
        std::auto_ptr<boost::thread> _thread;
 

Index: server/StreamProvider.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/StreamProvider.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- server/StreamProvider.cpp   21 Jan 2008 20:55:47 -0000      1.24
+++ server/StreamProvider.cpp   9 Jun 2008 14:31:54 -0000       1.25
@@ -55,7 +55,7 @@
        return inst;
 }
 
-tu_file*
+IOChannel*
 StreamProvider::getStream(const URL& url)
 {
 //    GNASH_REPORT_FUNCTION;
@@ -104,7 +104,7 @@
        }
 }
 
-tu_file*
+IOChannel*
 StreamProvider::getStream(const URL& url, const std::string& postdata)
 {
 //    GNASH_REPORT_FUNCTION;

Index: server/StreamProvider.h
===================================================================
RCS file: /sources/gnash/gnash/server/StreamProvider.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- server/StreamProvider.h     27 Mar 2008 10:50:14 -0000      1.8
+++ server/StreamProvider.h     9 Jun 2008 14:31:54 -0000       1.9
@@ -21,15 +21,15 @@
 #include <string>
 
 // Forward declarations
-class tu_file;
 namespace gnash {
        class URL;
+       class IOChannel;
 }
 
 
 namespace gnash {
 
-/// Provide tu_file streams for network or filesystem resources
+/// Provide IOChannel streams for network or filesystem resources
 class StreamProvider
 {
 
@@ -46,7 +46,7 @@
        /// On error NULL is returned
        /// Derive from this for a CachingStreamProvider
        ///
-       virtual tu_file* getStream(const URL& url);
+       virtual IOChannel* getStream(const URL& url);
 
        /// Get a stream from the response of a POST operation
        //
@@ -62,7 +62,7 @@
        ///     Post data in url-encoded form.
        ///
        ///
-       virtual tu_file* getStream(const URL& url, const std::string& postdata);
+       virtual IOChannel* getStream(const URL& url, const std::string& 
postdata);
        
 };
 

Index: server/font.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/font.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- server/font.cpp     9 Jun 2008 10:18:21 -0000       1.69
+++ server/font.cpp     9 Jun 2008 14:31:54 -0000       1.70
@@ -28,6 +28,7 @@
 #include "shape_character_def.h"
 #include "swf.h"
 #include "GnashException.h"
+#include "utility.h" // for UNUSED
 
 #include <utility> // for std::make_pair
 

Index: server/gnash.h
===================================================================
RCS file: /sources/gnash/gnash/server/gnash.h,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -b -r1.125 -r1.126
--- server/gnash.h      2 Jun 2008 09:52:53 -0000       1.125
+++ server/gnash.h      9 Jun 2008 14:31:54 -0000       1.126
@@ -28,9 +28,8 @@
 #include <memory> // for auto_ptr
 #include <string>
 
-class tu_file;
-
 namespace gnash {
+       class IOChannel;
        class sprite_instance; // for fscommand_callback typedef
        class movie_definition; // for create_movie
        class render_handler; // for set_render_handler 
@@ -138,7 +137,7 @@
 /// @param url
 /// The url to use as the _url member of the resulting
 /// movie definition. This is required as it can not be
-/// derived from the tu_file.
+/// derived from the IOChannel.
 ///
 /// @param startLoaderThread
 /// If false only the header will be read, and you'll need to call completeLoad
@@ -147,7 +146,7 @@
 /// Initializing the VirtualMachine requires a target SWF version, which can
 /// be found in the SWF header.
 ///
-DSOEXPORT movie_definition* create_movie(std::auto_ptr<tu_file> in, const 
std::string& url, bool startLoaderThread=true);
+DSOEXPORT movie_definition* create_movie(std::auto_ptr<IOChannel> in, const 
std::string& url, bool startLoaderThread=true);
 
 /// \brief
 /// Create a gnash::movie_definition from the given URL

Index: server/impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/impl.cpp,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -b -r1.153 -r1.154
--- server/impl.cpp     4 Jun 2008 19:47:49 -0000       1.153
+++ server/impl.cpp     9 Jun 2008 14:31:54 -0000       1.154
@@ -19,7 +19,7 @@
 
 
 #include "smart_ptr.h" // GNASH_USE_GC
-#include "tu_file.h"
+#include "IOChannel.h"
 #include "utility.h"
 #include "action.h"
 #include "impl.h"
@@ -254,7 +254,7 @@
 // Create a movie_definition from a jpeg stream
 // NOTE: this method assumes this *is* a jpeg stream
 static movie_definition*
-create_jpeg_movie(std::auto_ptr<tu_file> in, const std::string& url)
+create_jpeg_movie(std::auto_ptr<IOChannel> in, const std::string& url)
 {
   // FIXME: temporarly disabled
   //log_unimpl(_("Loading of jpegs"));
@@ -278,7 +278,7 @@
 // Create a movie_definition from a png stream
 // NOTE: this method assumes this *is* a png stream
 static movie_definition*
-create_png_movie(std::auto_ptr<tu_file> /*in*/, const std::string& /*url*/)
+create_png_movie(std::auto_ptr<IOChannel> /*in*/, const std::string& /*url*/)
 {
   log_unimpl(_("Loading of png"));
   return NULL;
@@ -311,7 +311,7 @@
 };
 
 FileType
-getFileType(tu_file* in)
+getFileType(IOChannel* in)
 {
   in->set_position(0);
 
@@ -377,7 +377,7 @@
 // NOTE: this method assumes this *is* an SWF stream
 //
 static SWFMovieDefinition*
-create_swf_movie(std::auto_ptr<tu_file> in, const std::string& url, bool 
startLoaderThread)
+create_swf_movie(std::auto_ptr<IOChannel> in, const std::string& url, bool 
startLoaderThread)
 {
 
   // Avoid leaks on error 
@@ -397,7 +397,7 @@
 }
 
 movie_definition*
-create_movie(std::auto_ptr<tu_file> in, const std::string& url, bool 
startLoaderThread)
+create_movie(std::auto_ptr<IOChannel> in, const std::string& url, bool 
startLoaderThread)
 {
   assert(in.get());
 
@@ -439,7 +439,7 @@
 
   const std::string swfurl = url.str();
 
-  std::auto_ptr<tu_file> in;
+  std::auto_ptr<IOChannel> in;
   if ( postdata ) in.reset( globals::streamProvider.getStream(url, *postdata) 
);
   else in.reset( globals::streamProvider.getStream(url) );
   if ( ! in.get() )

Index: server/stream.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/stream.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- server/stream.cpp   9 Jun 2008 10:18:22 -0000       1.54
+++ server/stream.cpp   9 Jun 2008 14:31:54 -0000       1.55
@@ -21,9 +21,10 @@
 
 #include "log.h"
 #include "types.h"
-#include "tu_file.h"
+#include "IOChannel.h"
 #include "swf.h"
 #include "Property.h"
+
 #include <cstring>
 #include <climits>
 //#include <iostream> // debugging only
@@ -32,7 +33,7 @@
 
 namespace gnash {
     
-SWFStream::SWFStream(tu_file* input)
+SWFStream::SWFStream(IOChannel* input)
     :
     m_input(input),
     m_current_byte(0),
@@ -484,7 +485,7 @@
     }
 
     // Do the seek.
-    if ( m_input->set_position(pos) == TU_FILE_SEEK_ERROR )
+    if ( m_input->set_position(pos) == -1 )
     {
         // TODO: should we throw an exception ?
         //       we might be called from an exception handler
@@ -541,7 +542,7 @@
     // Check end position doesn't overflow a signed int - that makes
     // zlib adapter's inflate_seek(int pos, void* appdata) unhappy.
     // The cast stops compiler warnings. We know it's a positive number.
-    // TODO: make tu_file take a long instead of an int.
+    // TODO: make IOChannel take a long instead of an int.
     // TODO: check against stream length.
     if (tagEnd > static_cast<unsigned int>(std::numeric_limits<signed 
int>::max()))
     {
@@ -593,7 +594,7 @@
 
     //log_debug("Close tag called at %d, stream size: %d", endPos);
 
-    if ( m_input->set_position(endPos) == TU_FILE_SEEK_ERROR )
+    if ( m_input->set_position(endPos) == -1 )
     {
         // We'll go on reading right past the end of the stream
         // if we don't throw an exception.

Index: server/stream.h
===================================================================
RCS file: /sources/gnash/gnash/server/stream.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- server/stream.h     9 Jun 2008 10:18:23 -0000       1.45
+++ server/stream.h     9 Jun 2008 14:31:54 -0000       1.46
@@ -39,7 +39,9 @@
 //
 //#define GNASH_TRUST_SWF_INPUT
 
-class tu_file;
+namespace gnash {
+       class IOChannel;
+}
 
 namespace gnash {
 
@@ -55,7 +57,7 @@
 class DSOEXPORT SWFStream
 {
 public:
-       SWFStream(tu_file* input);
+       SWFStream(IOChannel* input);
        ~SWFStream();
 
        /// \brief
@@ -393,7 +395,7 @@
 
 private:
 
-       tu_file*        m_input;
+       IOChannel*      m_input;
        boost::uint8_t  m_current_byte;
        boost::uint8_t  m_unused_bits;
 

Index: server/asobj/LoadVars.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/LoadVars.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- server/asobj/LoadVars.cpp   21 Apr 2008 11:27:44 -0000      1.48
+++ server/asobj/LoadVars.cpp   9 Jun 2008 14:31:55 -0000       1.49
@@ -28,7 +28,7 @@
 #include "StreamProvider.h"
 #include "URL.h"
 #include "gnash.h" // for get_base_url
-#include "tu_file.h"
+#include "IOChannel.h"
 #include "timers.h"
 #include "VM.h"
 #include "Object.h" // for getObjectInterface
@@ -330,7 +330,7 @@
 
        URL url(urlstr, get_base_url());
 
-       std::auto_ptr<tu_file> str;
+       std::auto_ptr<IOChannel> str;
        if ( postdata ) str.reset ( 
StreamProvider::getDefaultInstance().getStream(url, std::string(postdata)) );
        else str.reset ( StreamProvider::getDefaultInstance().getStream(url) );
 

Index: server/asobj/NetConnection.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetConnection.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- server/asobj/NetConnection.cpp      3 Jun 2008 12:39:54 -0000       1.63
+++ server/asobj/NetConnection.cpp      9 Jun 2008 14:31:55 -0000       1.64
@@ -51,8 +51,7 @@
 
 NetConnection::NetConnection()
        :
-       as_object(getNetConnectionInterface()),
-       _loader()
+       as_object(getNetConnectionInterface())
 {
        attachProperties();
 }

Index: server/asobj/NetConnection.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetConnection.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- server/asobj/NetConnection.h        3 Jun 2008 12:39:54 -0000       1.44
+++ server/asobj/NetConnection.h        9 Jun 2008 14:31:55 -0000       1.45
@@ -19,7 +19,7 @@
 #ifndef __NETCONNECTION_H__
 #define __NETCONNECTION_H__
 
-#include "tu_file.h"
+#include "IOChannel.h"
 
 #include <stdexcept>
 #include <cstdio>
@@ -169,7 +169,7 @@
        //
        /// TODO: drop
        ///
-       std::auto_ptr<tu_file> _loader;
+       std::auto_ptr<IOChannel> _loader;
 
        /// Attach ActionScript instance properties
        void attachProperties();

Index: server/asobj/NetStreamFfmpeg.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- server/asobj/NetStreamFfmpeg.h      6 Jun 2008 16:45:09 -0000       1.74
+++ server/asobj/NetStreamFfmpeg.h      9 Jun 2008 14:31:55 -0000       1.75
@@ -58,6 +58,7 @@
 
 // Forward declarations
 namespace gnash {
+       class IOChannel;
        namespace media {
                class sound_handler;
                class MediaHandler;
@@ -301,7 +302,7 @@
        /// This should just be a temporary variable, transferred
        /// to MediaParser constructor.
        ///
-       std::auto_ptr<tu_file> _inputStream;
+       std::auto_ptr<IOChannel> _inputStream;
 
         typedef std::deque<media::raw_mediadata_t*> AudioQueue;
 

Index: server/asobj/xml.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xml.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -b -r1.82 -r1.83
--- server/asobj/xml.cpp        25 May 2008 10:05:23 -0000      1.82
+++ server/asobj/xml.cpp        9 Jun 2008 14:31:55 -0000       1.83
@@ -35,7 +35,7 @@
 #include "debugger.h"
 #include "StreamProvider.h"
 #include "URLAccessManager.h"
-#include "tu_file.h"
+#include "IOChannel.h"
 #include "URL.h"
 #include "VM.h"
 #include "namedStrings.h"
@@ -418,7 +418,7 @@
 }
 
 void
-XML::queueLoad(std::auto_ptr<tu_file> str)
+XML::queueLoad(std::auto_ptr<IOChannel> str)
 {
     //GNASH_REPORT_FUNCTION;
 
@@ -577,7 +577,7 @@
   
     //log_debug(_("%s: mem is %d"), __FUNCTION__, mem);
 
-    std::auto_ptr<tu_file> str ( 
StreamProvider::getDefaultInstance().getStream(url) );
+    std::auto_ptr<IOChannel> str ( 
StreamProvider::getDefaultInstance().getStream(url) );
     if ( ! str.get() ) 
     {
         log_error(_("Can't load XML file: %s (security?)"), url.str().c_str());
@@ -651,7 +651,7 @@
   
     //log_debug(_("%s: mem is %d"), __FUNCTION__, mem);
 
-    std::auto_ptr<tu_file> str ( 
StreamProvider::getDefaultInstance().getStream(url, data) );
+    std::auto_ptr<IOChannel> str ( 
StreamProvider::getDefaultInstance().getStream(url, data) );
     if ( ! str.get() ) 
     {
         log_error(_("Can't load XML file: %s (security?)"), url.str().c_str());

Index: server/asobj/xml.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xml.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- server/asobj/xml.h  27 Apr 2008 18:13:16 -0000      1.34
+++ server/asobj/xml.h  9 Jun 2008 14:31:55 -0000       1.35
@@ -206,7 +206,7 @@
     void initParser();
 
     /// Queue a load request from the given stream
-    void queueLoad(std::auto_ptr<tu_file> str);
+    void queueLoad(std::auto_ptr<IOChannel> str);
 
     //static void _xmlErrorHandler(void *ctx, const char* fmt, ...);
 

Index: server/parser/movie_def_impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -b -r1.118 -r1.119
--- server/parser/movie_def_impl.cpp    9 Jun 2008 10:18:25 -0000       1.118
+++ server/parser/movie_def_impl.cpp    9 Jun 2008 14:31:55 -0000       1.119
@@ -25,8 +25,8 @@
 #include "movie_def_impl.h"
 #include "movie_definition.h" // for inheritance
 #include "sprite_instance.h" // for ??
-#include "tu_file.h"
 #include "zlib_adapter.h"
+#include "IOChannel.h" // for use
 #include "stream.h"
 #include "jpeg.h"
 #include "fontlib.h"
@@ -317,7 +317,7 @@
 
 // Read header and assign url
 bool
-SWFMovieDefinition::readHeader(std::auto_ptr<tu_file> in, const std::string& 
url)
+SWFMovieDefinition::readHeader(std::auto_ptr<IOChannel> in, const std::string& 
url)
 {
 
        _in = in;
@@ -467,7 +467,7 @@
 
 // Read a .SWF movie.
 bool
-SWFMovieDefinition::read(std::auto_ptr<tu_file> in, const std::string& url)
+SWFMovieDefinition::read(std::auto_ptr<IOChannel> in, const std::string& url)
 {
 
        if ( ! readHeader(in, url) ) return false;

Index: server/parser/movie_def_impl.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.h,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- server/parser/movie_def_impl.h      9 Jun 2008 10:18:25 -0000       1.81
+++ server/parser/movie_def_impl.h      9 Jun 2008 14:31:55 -0000       1.82
@@ -30,7 +30,7 @@
 #include "fontlib.h"
 #include "font.h"
 #include "jpeg.h"
-#include "tu_file.h"
+#include "IOChannel.h"
 #include "movie_definition.h" // for inheritance
 #include "character_def.h" // for boost::intrusive_ptr visibility of dtor
 #include "bitmap_character_def.h" // for boost::intrusive_ptr visibility of 
dtor
@@ -346,7 +346,7 @@
        ///     see description of readHeader() and completeLoad()
        ///     for possible reasons of failures
        ///
-       bool read(std::auto_ptr<tu_file> in, const std::string& url);
+       bool read(std::auto_ptr<IOChannel> in, const std::string& url);
 
        /// Read the header of the SWF file
        //
@@ -354,12 +354,12 @@
        /// stream and assigns the movie an URL.
        /// Call completeLoad() to fire up the loader thread.
        ///
-       /// @param in the tu_file from which to read SWF
+       /// @param in the IOChannel from which to read SWF
        /// @param url the url associated with the input
        ///
        /// @return false if SWF header could not be parsed
        ///
-       bool readHeader(std::auto_ptr<tu_file> in, const std::string& url);
+       bool readHeader(std::auto_ptr<IOChannel> in, const std::string& url);
 
        /// Complete load of the SWF file
        //
@@ -530,7 +530,7 @@
 
        std::auto_ptr<SWFStream> _str;
 
-       std::auto_ptr<tu_file> _in;
+       std::auto_ptr<IOChannel> _in;
 
        /// swf end position (as read from header)
        unsigned int _swf_end_pos;

Index: server/parser/movie_definition.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_definition.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- server/parser/movie_definition.h    4 Jun 2008 13:57:55 -0000       1.48
+++ server/parser/movie_definition.h    9 Jun 2008 14:31:56 -0000       1.49
@@ -54,7 +54,6 @@
 #include "character_def.h" // for inheritance
 #include "fontlib.h"
 #include "jpeg.h"
-#include "tu_file.h"
 
 #include <string>
 #include <memory> // for auto_ptr

Index: testsuite/MovieTester.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/MovieTester.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -b -r1.73 -r1.74
--- testsuite/MovieTester.cpp   4 Jun 2008 12:39:57 -0000       1.73
+++ testsuite/MovieTester.cpp   9 Jun 2008 14:31:56 -0000       1.74
@@ -80,7 +80,7 @@
 
        if ( url == "-" )
        {
-               std::auto_ptr<tu_file> in (
+               std::auto_ptr<IOChannel> in (
                                noseek_fd_adapter::make_stream(fileno(stdin))
                                );
                _movie_def = gnash::create_movie(in, url, false);

Index: utilities/processor.cpp
===================================================================
RCS file: /sources/gnash/gnash/utilities/processor.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -b -r1.101 -r1.102
--- utilities/processor.cpp     3 Jun 2008 05:12:47 -0000       1.101
+++ utilities/processor.cpp     9 Jun 2008 14:31:56 -0000       1.102
@@ -46,6 +46,7 @@
 #include "ManualClock.h"
 #include "StringPredicates.h"
 #include "smart_ptr.h"
+#include "IOChannel.h" // for proper dtor call
 
 extern "C"{
        #include <unistd.h>
@@ -365,7 +366,7 @@
     {
       if ( ! strcmp(filename, "-") )
       {
-         std::auto_ptr<tu_file> in ( 
noseek_fd_adapter::make_stream(fileno(stdin)) );
+         std::auto_ptr<IOChannel> in ( 
noseek_fd_adapter::make_stream(fileno(stdin)) );
          md = gnash::create_movie(in, filename, false);
       }
       else




reply via email to

[Prev in Thread] Current Thread [Next in Thread]