May 10, 2000
Yuntai Kyong (yuntaikyong@ieee.org)

- Task description:
MPEGJ used to be associated with a fake video node. The task was to remove
this fake video node.

- Overview
* MPEGJ ES can be inside InitialObjectDescriptor or OD in the UPDATE OD command, so
the cares need to be taken in three parts: InitOD, UpdateOD and RemoveOD handling.

* Channel and stream handling is done in StreamConsumer class in IM1Core.
and this class is inherited from MediaObject

* So, MPEGJ ES has to be assoicated with MediaObject(e.g. video node) to establish
channel and handle MPEGJ stream
- Use InlineImp as an fake node
see (4)

* The initiation of channel establishment for normal media node(e.g. 2d texture) 
was done from BIFS part or rendering thread.
- changed to estalbish channel and start MPEGJ stream as soon as MPEGJ ES found.
see (4)

* All MPEGJ ES's ODs and the fake InlineImp objects are associated in the root InlineImp's
StreamAssociation table. Because InlineImp can be a sub node of another node and if its 
sub nodes are deleted, all the associated streams are deleted, and which is not desirable to 
MEPGJ stream which is not supposed to be associated with any node.

* Cleanup fake InlineImps for the case(in the destructor of root InlineImp) when those objects are not cleaned up by 
by REMOVE OD command.

- Test
1. MPEGJ ES in InitialObjectDescriptor - done
2. MPEGJ ES in UPDATE OD - done
3. Fake InlineImp's destructors are called - done
4. REMOVE OD - done

- Limitation
1. Handle only one MPEGJ ES in one OD
2. Doesn't handle UPDATE ES or REMOVE ES
(should work but not tested)

- Possible works to be done
* A new class who doesn't inherit from MediaObject(Pure stream consumer)
* Global MPEGJ stream table

- The list of modified parts:
* search "//*** YUNTAI" to find these parts
(1),(2)
File: Executive.cpp
Class: Executive
Function: Start()
- Move location of InitializeMPEGJ()
- When MPEGJ ES is inside an InitialObjectDescriptor,
initialization of MPEGJ subsystem must precede IM1Core4 
initialization part.

(3)
File: Inline.cpp
Class: InlineImp
Function: ~InlineImp()
- Cleanup InlineImp objects associated with MPEGJ streams
- Instead of fake video node InlineImps are associated
with MPEGJ Streams.
Since all other Meidia (audio,video) are cleaned up by
scene cleaning procedures, there should be online InlineImp 
objects to be cleaned up from StreamAssociation table.
* Fake InlineImp node for MPEGJ streams are registered only to
root InlineImp.

(4)
File: Inline.cpp
Class: InlineImp
Function: UpdateOD(ObjectDescriptorImp* pOD)
- Check ObjectDescriptor(OD) contains MPEGJ ES. If it does, create
a new InlineImp node and associate OD with it in the root InlineImp's
StreamAssociation table. If OD doesn't contain MPEGJ ES, register OD to 
current InlineImp's StreamAssociation table

(5)
File: ODImp.h
Class: ES_DescriptorImp
Function "Decoder *CreateMPEGJDecoder()" is added
Subroutine returning MPEGJDec object

(6)
File: OpenStr.cpp
Class: ES_DescriptorImp
Function: SetDecoder(ObjectDescriptorImp *pOD,
			StreamConsumer *pNode)
Check that streamType of DecoderConfigDescriptor 
is MPEGJ Stream. If it is, create MPEGJ decoder

(7) File: OpenStr.cpp
Class: ES_DescriptorImp
See (5)


(8) File: Inline.cpp
Class: InlineImp
Function: CreateDecoder
MPEGJ decoder is not created by InlineImp, but make it not set error
to Executive

(9) Inline.cpp
InlineImp :: RemoveOD()
Search MPEGJ stream to remove.
If an MPEGJ stream is found cleanup mpegj stream and delete the fake 
InlineImp node assoicated with the mpegj stream

(10) Inline.cpp
InlineImp :: RemoveOD()
make root inlineImp remove MPEGJ stream
