wvencoderstream.h

00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Tunnel Vision Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  *
00005  * An stream wrapper for encoders.
00006  */
00007 #ifndef __WVENCODERSTREAM_H
00008 #define __WVENCODERSTREAM_H
00009 
00010 #include "wvstream.h"
00011 #include "wvstreamclone.h"
00012 #include "wvencoder.h"
00013 
00037 class WvEncoderStream : public WvStreamClone
00038 {
00039     bool is_closing;
00040     WvDynBuf readinbuf;
00041     WvDynBuf readoutbuf;
00042     WvDynBuf writeinbuf;
00043     //WvDynBuf writeoutbuf;
00044 
00045 public:
00047     WvEncoderChain readchain;
00048 
00050     WvEncoderChain writechain;
00051 
00073     size_t min_readsize;
00074 
00080     WvEncoderStream(WvStream *cloned);
00081     virtual ~WvEncoderStream();
00082 
00093     virtual void close();
00094 
00102     bool flush_read();
00103 
00117     bool flush_write();
00118 
00124     bool finish_read();
00125 
00133     bool finish_write();
00134 
00144     virtual bool isok() const;
00145 
00146     virtual size_t uread(void *buf, size_t size);
00147     virtual size_t uwrite(const void *buf, size_t size);
00148     
00149 protected:
00150     bool pre_select(SelectInfo &si);
00151     virtual bool flush_internal(time_t msec_timeout);
00152 
00153 private:
00154     void checkreadisok();
00155     void checkwriteisok();
00156     
00157     // pulls a chunk of specified size from the underlying stream
00158     void pull(size_t size);
00159 
00160     // pushes a chunk to the underlying stream
00161     bool push(bool flush, bool finish);
00162 };
00163 
00164 #endif // __WVENCODERSTREAM_H

Generated on Sun Sep 24 20:10:50 2006 for WvStreams by  doxygen 1.4.7