3 #ifndef __CODER_MIXER2_MT_H
4 #define __CODER_MIXER2_MT_H
6 #include "CoderMixer2.h"
7 #include "../../../Common/MyCom.h"
8 #include "../../Common/StreamBinder.h"
9 #include "../../Common/VirtThread.h"
11 namespace NCoderMixer {
13 struct CCoder2: public CCoderInfo2, public CVirtThread
16 CObjectVector< CMyComPtr<ISequentialInStream> > InStreams;
17 CObjectVector< CMyComPtr<ISequentialOutStream> > OutStreams;
18 CRecordVector<ISequentialInStream*> InStreamPointers;
19 CRecordVector<ISequentialOutStream*> OutStreamPointers;
21 CCoder2(UInt32 numInStreams, UInt32 numOutStreams);
22 void SetCoderInfo(const UInt64 **inSizes, const UInt64 **outSizes);
23 virtual void Execute();
24 void Code(ICompressProgressInfo *progress);
32 SetProgressIndex(UInt32 coderIndex);
44 public ICompressCoder2,
49 CObjectVector<CStreamBinder> _streamBinders;
50 int _progressCoderIndex;
52 void AddCoderCommon();
53 HRESULT Init(ISequentialInStream **inStreams, ISequentialOutStream **outStreams);
54 HRESULT ReturnIfError(HRESULT code);
56 CObjectVector<CCoder2> _coders;
59 STDMETHOD(Code)(ISequentialInStream **inStreams,
60 const UInt64 **inSizes,
62 ISequentialOutStream **outStreams,
63 const UInt64 **outSizes,
65 ICompressProgressInfo *progress);
67 HRESULT SetBindInfo(const CBindInfo &bindInfo);
68 void AddCoder(ICompressCoder *coder);
69 void AddCoder2(ICompressCoder2 *coder);
70 void SetProgressCoderIndex(int coderIndex) { _progressCoderIndex = coderIndex; }
73 void SetCoderInfo(UInt32 coderIndex, const UInt64 **inSizes, const UInt64 **outSizes)
74 { _coders[coderIndex].SetCoderInfo(inSizes, outSizes); }
75 UInt64 GetWriteProcessedSize(UInt32 binderIndex) const
76 { return _streamBinders[binderIndex].ProcessedSize; }