The list of changes for Task2.

=========================================================================
Overview:
1. MediaStreamImp(buffer implementation) was changed to support
attaching and detaching decoder (108) ~ (116)
2. New methods were added to ES_DescriptorImp to support
attaching and detaching decoder (102), (103), (104), (105), (106), (107), (131)
3. Implemenation of changeDecoder in ResourceManagerIM1 (143)
4. DecoderEvent implementation was changed to associate it with ESID also
(118) ~ (130)
5. Java Interface was chaged to support attaching a decoder
to another stream
6. Make renderer chagnge stream when the decoder is attached to a new ES
(101)
7. Pause() method is added to DecoderImp class to detach a decoder from input
and output buffer (117)
8. implementation of AttachDecoder and DetachDecoder in MPDecoder
(131) ~ (142)
9. Java Part modified files:
* see the comment in the file
MPDecoder.java
MPDecoderImp.java
MpegjEventMulticaster.java
ResourceManager.java
AtlanticDemo.java
DecoderEventFrame.java

=========================================================================
*** File: Inline.cpp *** 
(101) 
Make methods accessible from mpegj.DLL
from:
void LockScene (int nReserve = 0);
void UnlockScene (int nReserve = 0);

to:
virtual void LockScene (int nReserve = 0);
virtual void UnlockScene (int nReserve = 0);

*** File: OdImp.h ***
(102)
Class: ES_DescriptorImp

Two new methods:
virtual void AttachDecoder(DecoderImp* pDecoder);
virtual DecoderImp* DetachDecoder();

(103)
Class: ES_DescriptorImp
Make 
"m_pOutputStream" and "m_pInputStream" public

Need to be accessed from MPDecoder class


*** File: openstr.cpp ***
(104)
ES_DescriptorImp :: SetDecoder()
Setup data channel and buffer for ESs which have been
ignored by IM1Core4(only one ES used to setup for decoding)

(105)
ES_DescriptorImp :: Detach()
Shutdown buffer when an ES is not attached to a decoder

(106)
ES_DescriptorImp :: DetachDecoder() (new function!)
Detach decoder from ES
1. Pause input buffer and output buffer
2. detach

(107)
ES_DescriptorImp :: AttachDecoder() (new function!)
Detach decoder to ES
1. resume input buffer and output buffer
2. attach

*** File: Stream.cpp ***
(108)
MediaStreamImp::MediaStreamImp()
Initialize variables relating to pause and halfclose

(109)
MediaStreamImp::Allocate
if Pause() was called( downstream would be detached )
 and lastblock is fetched
then shutdown upstream(decoder) by returning END_OF_STREAM

(110)
MediaStreamImp::Dispatch
if HalfClose() was called ( upstream is detached )
as soon as new block is dispached from upstream
fetch the last block queued and discard it

(111)
MediaStreamImp::FetchNext 
Return Last block in the queue

(112)
MediaStreamImp :: Release
If puase state, don't discard

(113)
* MediaStreamImp :: Pause
- Pause the stream by receiving peer
- no more dispatch - clear out allocated blocks...
- so replay same screen...(?)

* MediaStreamImp :: HalfClose
- Pause the stream by the sending peer
- no more fetch call - so circulate buffer until reopened

*** File: Stream.h ***
(114)
definition of members of MediaStreamImp class
related to (113)

*** File: StreamCo.h ****
(115)
make GetStream() public

(116)
new function! SetMediaStream()

*** File: decoder.cpp ***
(117)
new function! DecoderImp :: Pause() and DecoderImp::Resume()
Pause or Resume decoder
1. pause or resume input and output buffer
2. if going resume state - start decoder thread

(118)
Retrieve ESID of current decoder also
It will be used to identify the source of decoder event

(119)

Use ESID to make decoderEventQueue
Java side identify the source of event using ESID and OD

*** File: DecoderImp.h ***
(120) 
new function - virtual void Pause (BOOL);

(121)
make SetInputStream and SetOutputStream public

(122)
New Variable! long ESID;

*** File: H263Dec.cpp ***
(123)
get ESID as weel as OSID from the m_streamAssociation

(124)
Use ESID to make decoderEventQueue
Java side identify the source of event using ESID and OD

*** File: MpegjDec.cpp ***
(125)
Find decoderDispatcher function with new signature

(126)
Temporary decoderESID variable

(127)
When dispatching decoder event pass ESID assoicated with the decoder also

(129)
Use ESID to make decoderEventQueue
additional parameter when creating DecoderEventQueue

(130)
get ESID as weel as OSID from the m_streamAssociation

*** File: MediaStream.h ***
(131)
class MediaStream
new functions
Pause() and HalfClose()

*** File: MPDecoderIM1Imp.cpp ***
(132)
implementation of MPDecoder::AttachDecoder()


(133)
implementation of MPDecoder::DetachDecoder()


(134)
MPDecoder::GetStreamConsumer(int odID) 
utility function
return StreamConsumer from OD_ID


(135)
MPDecoder::GetObjectDescriptor(int odID) 
utility function
return ObjectDescriptorImp from OD_ID

(136)
MPDecoder::GetESDescriptor(int odID,int esID) 
utility function
return ES_DescriptorImp from OD_ID and ES_ID

*** File: MPDecoderIM1Imp.h ***
(137)
see the code

(138)
definition of decoderAssociation
remember the refrence to the detached decoder
associate it with ODID and ESID

(139)
array of decoderAssociation 

(140)
utility methods declarations

(141)
decoderEventQueue
ESID is added to the definition of DecoderEventQueue

(142)
decoderEventQueue
Change for new member variable ESID

*** File: ResourceManagerIM1Imp.cpp ***
(143)
changeDecoderImp(long odid, long esid, long old_esid)
change decoder from old_esid to esid

*** File: MPEGJDec.cpp***
(144)
Modify java function signature 

*** File: ResourceManagerIM1Imp.cpp ***
(145)
destuctor of StreamAssociation.
It is also defined in InlineImp.cpp, but I failed to make linker happy so
oops i did it again.

(146)
ES_DescriptorImp* GetESDescriptor(int esID) 
- utility function 
- get ES_DescriptorImp from esID


(147)
MPJErr changeDecoderImp(long odid, long esid, long old_esid)
- change decoder from old_esid to esid

(149)
Three new native side java implementation
changeDecoder()
checkODID()
checkESID()

*** File: ResourceManagerIM1Imp.h ***
(148)
static member pointing to the Executive object


