rlm@1
|
1 // CoderMixer2MT.h
|
rlm@1
|
2
|
rlm@1
|
3 #ifndef __CODER_MIXER2_MT_H
|
rlm@1
|
4 #define __CODER_MIXER2_MT_H
|
rlm@1
|
5
|
rlm@1
|
6 #include "CoderMixer2.h"
|
rlm@1
|
7 #include "../../../Common/MyCom.h"
|
rlm@1
|
8 #include "../../Common/StreamBinder.h"
|
rlm@1
|
9 #include "../../Common/VirtThread.h"
|
rlm@1
|
10
|
rlm@1
|
11 namespace NCoderMixer {
|
rlm@1
|
12
|
rlm@1
|
13 struct CCoder2: public CCoderInfo2, public CVirtThread
|
rlm@1
|
14 {
|
rlm@1
|
15 HRESULT Result;
|
rlm@1
|
16 CObjectVector< CMyComPtr<ISequentialInStream> > InStreams;
|
rlm@1
|
17 CObjectVector< CMyComPtr<ISequentialOutStream> > OutStreams;
|
rlm@1
|
18 CRecordVector<ISequentialInStream*> InStreamPointers;
|
rlm@1
|
19 CRecordVector<ISequentialOutStream*> OutStreamPointers;
|
rlm@1
|
20
|
rlm@1
|
21 CCoder2(UInt32 numInStreams, UInt32 numOutStreams);
|
rlm@1
|
22 void SetCoderInfo(const UInt64 **inSizes, const UInt64 **outSizes);
|
rlm@1
|
23 virtual void Execute();
|
rlm@1
|
24 void Code(ICompressProgressInfo *progress);
|
rlm@1
|
25 };
|
rlm@1
|
26
|
rlm@1
|
27
|
rlm@1
|
28 /*
|
rlm@1
|
29 SetBindInfo()
|
rlm@1
|
30 for each coder
|
rlm@1
|
31 AddCoder[2]()
|
rlm@1
|
32 SetProgressIndex(UInt32 coderIndex);
|
rlm@1
|
33
|
rlm@1
|
34 for each file
|
rlm@1
|
35 {
|
rlm@1
|
36 ReInit()
|
rlm@1
|
37 for each coder
|
rlm@1
|
38 SetCoderInfo
|
rlm@1
|
39 Code
|
rlm@1
|
40 }
|
rlm@1
|
41 */
|
rlm@1
|
42
|
rlm@1
|
43 class CCoderMixer2MT:
|
rlm@1
|
44 public ICompressCoder2,
|
rlm@1
|
45 public CCoderMixer2,
|
rlm@1
|
46 public CMyUnknownImp
|
rlm@1
|
47 {
|
rlm@1
|
48 CBindInfo _bindInfo;
|
rlm@1
|
49 CObjectVector<CStreamBinder> _streamBinders;
|
rlm@1
|
50 int _progressCoderIndex;
|
rlm@1
|
51
|
rlm@1
|
52 void AddCoderCommon();
|
rlm@1
|
53 HRESULT Init(ISequentialInStream **inStreams, ISequentialOutStream **outStreams);
|
rlm@1
|
54 HRESULT ReturnIfError(HRESULT code);
|
rlm@1
|
55 public:
|
rlm@1
|
56 CObjectVector<CCoder2> _coders;
|
rlm@1
|
57 MY_UNKNOWN_IMP
|
rlm@1
|
58
|
rlm@1
|
59 STDMETHOD(Code)(ISequentialInStream **inStreams,
|
rlm@1
|
60 const UInt64 **inSizes,
|
rlm@1
|
61 UInt32 numInStreams,
|
rlm@1
|
62 ISequentialOutStream **outStreams,
|
rlm@1
|
63 const UInt64 **outSizes,
|
rlm@1
|
64 UInt32 numOutStreams,
|
rlm@1
|
65 ICompressProgressInfo *progress);
|
rlm@1
|
66
|
rlm@1
|
67 HRESULT SetBindInfo(const CBindInfo &bindInfo);
|
rlm@1
|
68 void AddCoder(ICompressCoder *coder);
|
rlm@1
|
69 void AddCoder2(ICompressCoder2 *coder);
|
rlm@1
|
70 void SetProgressCoderIndex(int coderIndex) { _progressCoderIndex = coderIndex; }
|
rlm@1
|
71
|
rlm@1
|
72 void ReInit();
|
rlm@1
|
73 void SetCoderInfo(UInt32 coderIndex, const UInt64 **inSizes, const UInt64 **outSizes)
|
rlm@1
|
74 { _coders[coderIndex].SetCoderInfo(inSizes, outSizes); }
|
rlm@1
|
75 UInt64 GetWriteProcessedSize(UInt32 binderIndex) const
|
rlm@1
|
76 { return _streamBinders[binderIndex].ProcessedSize; }
|
rlm@1
|
77 };
|
rlm@1
|
78
|
rlm@1
|
79 }
|
rlm@1
|
80 #endif
|