gnash-commit
[Top][All Lists]
Advanced

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

Re: [Gnash-commit] gnash ChangeLog backend/render_handler_ogl.cpp ...


From: strk
Subject: Re: [Gnash-commit] gnash ChangeLog backend/render_handler_ogl.cpp ...
Date: Sun, 14 Jan 2007 00:05:47 +0100

On Sat, Jan 13, 2007 at 08:06:18PM +0000, Tomas Groth wrote:

Since the following seems basically an interface duplication from
curl_adaptar.cpp, wouldn't it be better to wrap the common part in yet
another class for use by both tu_file adapter *and* NetConnection ?

--strk;

> +     /// Opens the connection to char_url
> +     bool openConnection(const char* char_url, as_object* ns, bool local);
> +
> +     /// Put read pointer at given position
> +     bool seek(size_t pos);
> +
> +     /// Read 'bytes' bytes into the given buffer.
> +     //
> +     /// Return number of actually read bytes
> +     ///
> +     size_t read(void *dst, size_t bytes);
> +
> +     /// Return true if EOF has been reached
> +     bool eof();
> +
> +     /// Report global position within the file
> +     size_t tell();
> +
> +private:
> +     // Use this file to cache data
> +     FILE* _cache;
> +
> +     // _cache file descriptor
> +     int _cachefd;
> +
> +     // we keep a copy here to be sure the char*
> +     // is alive for the whole CurlStreamFile lifetime
> +     // TODO: don't really do this :)
> +     std::string _url;
> +
> +     // the libcurl easy handle
> +     CURL *_handle;
> +
> +     // the libcurl multi handle
> +     CURLM *_mhandle;
> +
> +     // transfer in progress
> +     int _running;
> +
> +     // Attempt at filling the cache up to the given size.
> +     // Will call libcurl routines to fetch data.
> +     void fill_cache(off_t size);
> +
> +     // Append sz bytes to the cache
> +     size_t cache(void *from, size_t sz);
> +
> +     void printInfo();
> +
> +     // Callback for libcurl, will be called
> +     // by fill_cache() and will call cache() 
> +     static size_t recv(void *buf, size_t  size, 
> +             size_t  nmemb, void *userp);




reply via email to

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