From bobclark at helixcommunity.org  Mon May  1 07:32:24 2006
From: bobclark at helixcommunity.org (bobclark@helixcommunity.org)
Date: Mon May  1 09:26:03 2006
Subject: [Datatype-cvs] tools/dtdriver/engine cmuxsrchandler.cpp,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv22837

Modified Files:
	cmuxsrchandler.cpp 
Log Message:
Modified by: bobclark@real.com
Date: 4-29-06

Synopsis: several fixes for OS X

Overview:
  This is a hodgepodge of fixes applicable to OS X on head. There are some BOOL ==> HXBOOL fixes, a crash fix merged from 122iNep, and a gcc4 fix.

Files Modified:
  client/common/util/hxcontexthelper.cpp (BOOL ==> HXBOOL)
  client/common/util/pub/hxcontexthelper.h (BOOL ==> HXBOOL)
  client/include/ihxobjectmanager.h (BOOL ==> HXBOOL)
  common/fileio/platform/unix/mmapdatf.cpp (avoid memmap smb crash)
  datatype/tools/dtdrive/engine/cmuxsrchander.cpp (gcc4)

Image Size and Heap Use impact: Negligible

Platforms and Profiles Affected:
  OS X

Platforms and Profiles Build Verified:
  HEAD macos-gcc4-xcode22

Platforms and Profiles Functionality verified:
  HEAD macos-gcc4-xcode22

Branch: HEAD

Copyright assignment: RealNetworks Employee


Index: cmuxsrchandler.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/cmuxsrchandler.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cmuxsrchandler.cpp	14 Mar 2005 19:24:56 -0000	1.3
+++ cmuxsrchandler.cpp	1 May 2006 14:32:21 -0000	1.4
@@ -754,7 +754,7 @@
         // Set the '01' in the upper two bits of byte 4
         rpBuf[4] |= 0x40;
         // Copy SCR_base[32...30] into place
-        rpBuf[4] |= (BYTE) ((llSCRBase & 0x1C0000000) >> 27);
+        rpBuf[4] |= (BYTE) ((llSCRBase & 0x1C0000000LL) >> 27);
         // Set the marker bit
         rpBuf[4] |= 0x04;
         // Copy SCR_base[29...28] into place


From bobclark at helixcommunity.org  Mon May  1 07:39:54 2006
From: bobclark at helixcommunity.org (bobclark@helixcommunity.org)
Date: Mon May  1 09:33:34 2006
Subject: [Datatype-cvs] tools/dtdriver/engine cmuxsrchandler.cpp, 1.2,
	1.2.6.1
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv24369

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	cmuxsrchandler.cpp 
Log Message:
Modified by: bobclark@real.com
Date: 4-30-06
Synopsis: Fixes for OS X (mostly for Intel Macs) merged from HEAD

Overview:
  These are changes that are already on HEAD, but it turns out that they must be merged to 150Cay as well.
  The bulk of these changes were discussed (for HEAD) at:
  
  These are primarily fixes for Intel (such as removing AltiVec optimizations from OS X builds for the non-powerpc side of the OS X binary) and figuring out whether a plugin can be executed on the current architecture.

Files Modified:
  common/fileio/platform/unix/mmapdatf.cpp
  common/util/hxwinver.cpp
  common/util/platform/mac/maclibrary.cp
  common/util/pub/hxwinver.h
  datatype/tools/dtdriver/engine/cmuxsrchandler.cpp
  video/colconverter/avyuv2yuv.c
  video/colconverter/env.c
  video/colconverter/yuv2yuv.c
  video/sitelib/platform/mac/fauxcodec.cpp
  video/sitelib/platform/mac/macroot.cpp

Image size and heap use impact: negligible

Platforms and Profiles affected:
  OS X

Platforms and Profiles Build Verified:
  OS X (macos-gcc4-xcode22)

Branch:
  hxclient_1_5_0_cayenne

Copyright Assignment: I am a RealNetworks Employee


Index: cmuxsrchandler.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/cmuxsrchandler.cpp,v
retrieving revision 1.2
retrieving revision 1.2.6.1
diff -u -d -r1.2 -r1.2.6.1
--- cmuxsrchandler.cpp	18 Nov 2004 21:44:43 -0000	1.2
+++ cmuxsrchandler.cpp	1 May 2006 14:39:52 -0000	1.2.6.1
@@ -754,7 +754,7 @@
         // Set the '01' in the upper two bits of byte 4
         rpBuf[4] |= 0x40;
         // Copy SCR_base[32...30] into place
-        rpBuf[4] |= (BYTE) ((llSCRBase & 0x1C0000000) >> 27);
+        rpBuf[4] |= (BYTE) ((llSCRBase & 0x1C0000000LL) >> 27);
         // Set the marker bit
         rpBuf[4] |= 0x04;
         // Copy SCR_base[29...28] into place


From marvel at helixcommunity.org  Mon May  1 08:02:12 2006
From: marvel at helixcommunity.org (marvel@helixcommunity.org)
Date: Mon May  1 09:55:51 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp, 1.3.2.22,
	1.3.2.23
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv11152

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfvideoadapter.cpp 
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement 
with RealNetworks, and I am authorized to contribute this code under said agreement." 

Modified by:  gang.1.shen@nokia.com 

Reviewed by: 

Date: 04-26-2006 

Error ID: TSW ID=GSHN-6NSLNJ 

Project: Helix plugin for Symbian 

Synopsis: Helix MDF video fails to guarantee a correct invocation of SetScaleOptionsL() after video initialization. 

In this asynchronized initialization process of MDF Video, control flow does not cover all racing conditions for SetScaleOptionsL(). So, scaled clip size works fine on DSP DevVideo but fails on ARM DevVideo. The reason for this is,  time of initialization complete of a (version of) DevVideo could be quite different.

On DSP(IVA) DevVideo, the sequential calls are: 
        ->AttachSite 
            ->SetupWindow               //Skip. Conditions are not fulfilled 
        ->SetFrameRect          //Get frame size and set m_bFrameRectValid true 
        ->MdvpoInitializeComplete 
            ->SetupWindow               //Ok. Conditions are fulfilled 
                ->SetScaleOptionsL      //Pass down correct scaled size to DevVideo 

On ARM DevVideo, the sequential calls are: 
        ->MdvpoInitializeComplete 
            ->SetupWindow               //Skip. Conditions are not fulfilled 
        ->AttachSite 
            ->SetupWindow               //Ok. Conditions are fulfilled 
                ->SetScaleOptionsL      //No frame size yet so default scaled size is passed down to DevVideo 
        ->SetFrameRect          //Too late! 

The solution is to invoke SetScaleOptionsL inside SetFrameRect because the scaled size would be affected anyway when frame size changes. Also, this action should be protected by condition (m_DevVidInitialized == EInitializedSuccess). This can guarantee the correct scaled clip size be passed down in all cases.



Files Modified: 

datatype/mdf/video/renderer/mdfvideoadapter.cpp 

Files Added: None. 

Image Size and Heap Use impact: minor 

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp, helix-client-s60-mmf-mdf-arm 

Platforms and Profiles Functionality verified: armv5 

Branch: head, hxclient_2_1_0_cayennes 




Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.3.2.22
retrieving revision 1.3.2.23
diff -u -d -r1.3.2.22 -r1.3.2.23
--- mdfvideoadapter.cpp	26 Apr 2006 18:45:18 -0000	1.3.2.22
+++ mdfvideoadapter.cpp	1 May 2006 15:02:07 -0000	1.3.2.23
@@ -1369,8 +1369,26 @@
 		sValue.bottom = 144;
 		m_frameRect = sValue;
     }
+ 
     CalculateScaleFactor();
 
+    if( m_DevVidInitialized == EInitializedSuccess )    //make sure DevVideo is ready
+    {
+        TRAPD( error, m_pDevVideoPlay->SetScaleOptionsL( m_PostProcessorHwDeviceId, m_scaledSize, m_bAntiAlias ) );
+        if (error == KErrNone)
+        {
+            if (SUCCEEDED(Commit()))
+            {
+                retVal = HXR_OK;
+            }
+        }
+        else
+        {
+            retVal = HXR_FAIL;
+        }
+
+    }
+
     MDFVIDEOLOG_LEAVEFN2( "SetFrameRect" );
     return retVal;
 }


From marvel at helixcommunity.org  Mon May  1 08:51:29 2006
From: marvel at helixcommunity.org (marvel@helixcommunity.org)
Date: Mon May  1 10:45:08 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp,1.26,1.27
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv5012

Modified Files:
	mdfvideoadapter.cpp 
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement 
with RealNetworks, and I am authorized to contribute this code under said agreement." 

Modified by:  gang.1.shen@nokia.com 

Reviewed by: 

Date: 04-26-2006 

Error ID: TSW ID=GSHN-6NSLNJ 

Project: Helix plugin for Symbian 

Synopsis: Helix MDF video fails to guarantee a correct invocation of SetScaleOptionsL() after video initialization. 

In this asynchronized initialization process of MDF Video, control flow does not cover all racing conditions for SetScaleOptionsL(). So, scaled clip size works fine on DSP DevVideo but fails on ARM DevVideo. The reason for this is,  time of initialization complete of a (version of) DevVideo could be quite different.

On DSP(IVA) DevVideo, the sequential calls are: 
        ->AttachSite 
            ->SetupWindow               //Skip. Conditions are not fulfilled 
        ->SetFrameRect          //Get frame size and set m_bFrameRectValid true 
        ->MdvpoInitializeComplete 
            ->SetupWindow               //Ok. Conditions are fulfilled 
                ->SetScaleOptionsL      //Pass down correct scaled size to DevVideo 

On ARM DevVideo, the sequential calls are: 
        ->MdvpoInitializeComplete 
            ->SetupWindow               //Skip. Conditions are not fulfilled 
        ->AttachSite 
            ->SetupWindow               //Ok. Conditions are fulfilled 
                ->SetScaleOptionsL      //No frame size yet so default scaled size is passed down to DevVideo 
        ->SetFrameRect          //Too late! 

The solution is to invoke SetScaleOptionsL inside SetFrameRect because the scaled size would be affected anyway when frame size changes. Also, this action should be protected by condition (m_DevVidInitialized == EInitializedSuccess). This can guarantee the correct scaled clip size be passed down in all cases.



Files Modified: 

datatype/mdf/video/renderer/mdfvideoadapter.cpp 

Files Added: None. 

Image Size and Heap Use impact: minor 

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp, helix-client-s60-mmf-mdf-arm 

Platforms and Profiles Functionality verified: armv5 

Branch: head, hxclient_2_1_0_cayennes 




Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- mdfvideoadapter.cpp	26 Apr 2006 18:45:30 -0000	1.26
+++ mdfvideoadapter.cpp	1 May 2006 15:51:24 -0000	1.27
@@ -3,6 +3,7 @@
  * Portions Copyright (c) 2005 RealNetworks, Inc. All Rights Reserved.
  *
  * Version: $Id$
+ *
  * The contents of this file, and the files included with this file,
  * are subject to the current version of the RealNetworks Public
  * Source License (the "RPSL") available at
@@ -607,7 +608,7 @@
         videoInputBufferP = m_pDevVideoPlay->GetBufferL( ulBufferSize );
         if( videoInputBufferP )
         {
-			MDFVIDEOLOG_INOUTFN4( "Start to write to MDF buffer" );
+            MDFVIDEOLOG_INOUTFN4( "Start to write to MDF buffer" );
             CMediaPacket* pMediaPacket = NULL;
             pMediaPacket = (CMediaPacket*) m_BltPacketQueue.RemoveHead();
 
@@ -859,42 +860,42 @@
 STDMETHODIMP CMdfVideoAdapter::OnPaceStart( UINT32 ulId )
 {
     MDFVIDEOLOG_ENTERFN( "OnPaceStart" );
-    
+
     if( ulId == m_ulBltrPacemakerId )
     {
         m_bIsThreadRunning = TRUE;
     }
-    
+
     MDFVIDEOLOG_LEAVEFN( "OnPaceStart" );
-    
+
     return HXR_OK;
 }
 
 STDMETHODIMP CMdfVideoAdapter::OnPace( UINT32 ulId )
 {
     MDFVIDEOLOG_ENTERFN4( "OnPace" );
-    
+
     HX_RESULT retVal = HXR_OK;
     if ( ulId == m_ulBltrPacemakerId )
     {
         retVal = Blt();
     }
     MDFVIDEOLOG_RETURNFN4( "OnPace", retVal );
-    
+
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoAdapter::OnPaceEnd( UINT32 ulId )
 {
     MDFVIDEOLOG_ENTERFN( "OnPaceEnd" );
-    
+
     HX_RESULT retVal = HXR_OK;
     if( ulId == m_ulBltrPacemakerId )
     {
         m_bIsThreadRunning = FALSE;
     }
     MDFVIDEOLOG_RETURNFN( "OnPaceEnd", retVal );
-    
+
     return retVal;
 }
 
@@ -993,7 +994,7 @@
         SetupWindow();
 
         CVideoPaceMaker* pVideoPaceMaker = NULL;
-        
+
         pVideoPaceMaker = new CVideoPaceMaker();
         if( pVideoPaceMaker )
         {
@@ -1004,11 +1005,11 @@
         {
             retVal = HXR_OUTOFMEMORY;
         }
-        
+
         if( SUCCEEDED( retVal ) )
         {
             retVal = pVideoPaceMaker->QueryInterface( IID_IHXPaceMaker, (void**) &m_pBltrPump );
-            
+
             if( SUCCEEDED( retVal ) )
             {
                 MDFVIDEOLOG_INOUTFN( "m_pBltrPump->Start" );
@@ -1364,13 +1365,31 @@
     {
         //Due to problem with IVA we need to scale to QCIF
         //This will be fixed to handle other scaling in future
-		m_bFrameRectValid = TRUE;
-		sValue.right = 176;
-		sValue.bottom = 144;
-		m_frameRect = sValue;
+        m_bFrameRectValid = TRUE;
+        sValue.right = 176;
+        sValue.bottom = 144;
+        m_frameRect = sValue;
     }
+ 
     CalculateScaleFactor();
 
+    if( m_DevVidInitialized == EInitializedSuccess )    //make sure DevVideo is ready
+    {
+        TRAPD( error, m_pDevVideoPlay->SetScaleOptionsL( m_PostProcessorHwDeviceId, m_scaledSize, m_bAntiAlias ) );
+        if (error == KErrNone)
+        {
+            if (SUCCEEDED(Commit()))
+            {
+                retVal = HXR_OK;
+            }
+        }
+        else
+        {
+            retVal = HXR_FAIL;
+        }
+
+    }
+
     MDFVIDEOLOG_LEAVEFN2( "SetFrameRect" );
     return retVal;
 }


From stanb at helixcommunity.org  Mon May  1 13:57:34 2006
From: stanb at helixcommunity.org (stanb@helixcommunity.org)
Date: Mon May  1 15:51:10 2006
Subject: [Datatype-cvs] tools/dtdriver/engine cmuxsrchandler.cpp, 1.2.6.1,
	1.2.6.2
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv12585

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	cmuxsrchandler.cpp 
Log Message:
Build break on Windows VC6 fixed (CR Bob Clark).


Index: cmuxsrchandler.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/cmuxsrchandler.cpp,v
retrieving revision 1.2.6.1
retrieving revision 1.2.6.2
diff -u -d -r1.2.6.1 -r1.2.6.2
--- cmuxsrchandler.cpp	1 May 2006 14:39:52 -0000	1.2.6.1
+++ cmuxsrchandler.cpp	1 May 2006 20:57:29 -0000	1.2.6.2
@@ -754,7 +754,11 @@
         // Set the '01' in the upper two bits of byte 4
         rpBuf[4] |= 0x40;
         // Copy SCR_base[32...30] into place
+#ifdef _MAC_UNIX
         rpBuf[4] |= (BYTE) ((llSCRBase & 0x1C0000000LL) >> 27);
+#else
+	rpBuf[4] |= (BYTE) ((llSCRBase & 0x1C0000000) >> 27);
+#endif
         // Set the marker bit
         rpBuf[4] |= 0x04;
         // Copy SCR_base[29...28] into place


From pankajgupta at helixcommunity.org  Mon May  1 22:09:28 2006
From: pankajgupta at helixcommunity.org (pankajgupta@helixcommunity.org)
Date: Tue May  2 00:02:58 2006
Subject: [Datatype-cvs] common/vidrend/platform - New directory
Message-ID: 

Update of /cvsroot/datatype/common/vidrend/platform
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv12578/platform

Log Message:
Directory /cvsroot/datatype/common/vidrend/platform added to the repository
--> Using per-directory sticky tag `hxclient_1_5_0_cayenne'



From pankajgupta at helixcommunity.org  Mon May  1 22:09:49 2006
From: pankajgupta at helixcommunity.org (pankajgupta@helixcommunity.org)
Date: Tue May  2 00:03:19 2006
Subject: [Datatype-cvs] common/vidrend/platform/symbian - New directory
Message-ID: 

Update of /cvsroot/datatype/common/vidrend/platform/symbian
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv12589/symbian

Log Message:
Directory /cvsroot/datatype/common/vidrend/platform/symbian added to the repository
--> Using per-directory sticky tag `hxclient_1_5_0_cayenne'



From pankajgupta at helixcommunity.org  Mon May  1 22:11:38 2006
From: pankajgupta at helixcommunity.org (pankajgupta@helixcommunity.org)
Date: Tue May  2 00:05:09 2006
Subject: [Datatype-cvs] common/vidrend/platform/symbian/logs - New directory
Message-ID: 

Update of /cvsroot/datatype/common/vidrend/platform/symbian/logs
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv12610/logs

Log Message:
Directory /cvsroot/datatype/common/vidrend/platform/symbian/logs added to the repository
--> Using per-directory sticky tag `hxclient_1_5_0_cayenne'



From pankajgupta at helixcommunity.org  Mon May  1 22:13:06 2006
From: pankajgupta at helixcommunity.org (pankajgupta@helixcommunity.org)
Date: Tue May  2 00:06:37 2006
Subject: [Datatype-cvs] common/vidrend/platform/symbian/logs
	nokia_6600_cayenne_vidrend_log.txt, NONE, 1.1.2.1
Message-ID: 

Update of /cvsroot/datatype/common/vidrend/platform/symbian/logs
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv12841

Added Files:
      Tag: hxclient_1_5_0_cayenne
	nokia_6600_cayenne_vidrend_log.txt 
Log Message:
time stamp log generated on Nokia 6600 device in vidrend.cpp

--- NEW FILE: nokia_6600_cayenne_vidrend_log.txt ---
3484694118l		OnPacket() TimeStamp= 0 TickCount= 1016
3484694180l		OnPacket() TimeStamp= 125 TickCount= 1078
3484694196l		OnPacket() TimeStamp= 250 TickCount= 1094
3484694211l		OnPacket() TimeStamp= 375 TickCount= 1109
3484694211l		OnPacket() TimeStamp= 500 TickCount= 1109
3484694211l		OnPacket() TimeStamp= 625 TickCount= 1109
3484694211l		OnPacket() TimeStamp= 750 TickCount= 1109
3484694211l		OnPacket() TimeStamp= 875 TickCount= 1109
3484694227l		OnPacket() TimeStamp= 1000 TickCount= 1125
3484694227l		OnPacket() TimeStamp= 1125 TickCount= 1125
3484694258l		OnPacket() TimeStamp= 1250 TickCount= 1156
3484694258l		OnPacket() TimeStamp= 1375 TickCount= 1156
3484694274l		OnPacket() TimeStamp= 1501 TickCount= 1172
3484694274l		OnPacket() TimeStamp= 1501 TickCount= 1172
3484694289l		OnPacket() TimeStamp= 1626 TickCount= 1187
3484694289l		OnPacket() TimeStamp= 1751 TickCount= 1187
3484694321l		OnPacket() TimeStamp= 1876 TickCount= 1219
3484694321l		OnPacket() TimeStamp= 2001 TickCount= 1219
3484694321l		OnPacket() TimeStamp= 2001 TickCount= 1219
[...2991 lines suppressed...]
3484750868l		OnTimeSync() AudioTime= 56386 TickCount= 57766
3484750899l		OnTimeSync() AudioTime= 56417 TickCount= 57797
3484750930l		OnTimeSync() AudioTime= 56448 TickCount= 57828
3484750946l		OnTimeSync() AudioTime= 56464 TickCount= 57844
3484750961l		OnTimeSync() AudioTime= 56473 TickCount= 57859
3484750977l		OnTimeSync() AudioTime= 56489 TickCount= 57875
3484750993l		OnTimeSync() AudioTime= 56505 TickCount= 57891
3484751024l		OnTimeSync() AudioTime= 56536 TickCount= 57922
3484751039l		OnTimeSync() AudioTime= 56551 TickCount= 57937
3484751055l		OnTimeSync() AudioTime= 56567 TickCount= 57953
3484751086l		OnTimeSync() AudioTime= 56598 TickCount= 57984
3484751102l		OnTimeSync() AudioTime= 56614 TickCount= 58000
3484751118l		OnTimeSync() AudioTime= 56630 TickCount= 58016
3484751133l		OnTimeSync() AudioTime= 56645 TickCount= 58031
3484751164l		OnTimeSync() AudioTime= 56676 TickCount= 58062
3484751180l		OnTimeSync() AudioTime= 56692 TickCount= 58078
3484751211l		OnTimeSync() AudioTime= 56723 TickCount= 58109
3484751243l		OnTimeSync() AudioTime= 56755 TickCount= 58141
3484751258l		OnTimeSync() AudioTime= 56770 TickCount= 58156
3484751274l		OnTimeSync() AudioTime= 56771 TickCount= 58172


From ehyche at helixcommunity.org  Tue May  2 07:05:16 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue May  2 08:58:41 2006
Subject: [Datatype-cvs] rm/include hxcodec.h,1.18,1.19
Message-ID: 

Update of /cvsroot/datatype/rm/include
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv23281

Modified Files:
	hxcodec.h 
Log Message:
Add additional segment option
HX_SEGMENT_CONTAINS_COLOR_FORMAT. This
was previously approved for checkin,
but I left it out of the commit.
This is needed for the WMV renderer.


Index: hxcodec.h
===================================================================
RCS file: /cvsroot/datatype/rm/include/hxcodec.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- hxcodec.h	18 Apr 2005 15:51:38 -0000	1.18
+++ hxcodec.h	2 May 2006 14:05:13 -0000	1.19
@@ -275,6 +275,7 @@
 #define HX_FRU_FLAG					0x0040
 #define HX_SEGMENT_CONTAINS_OUTPUT_SIZE_FLAG 0x0100
 #define HX_SEGMENT_CONTAINS_OUTPUT_YUVDATA   0x0200
+#define HX_SEGMENT_CONTAINS_COLOR_FORMAT     0x0400
 
 /*
  * IMPORTANT!!


From ehodge at helixcommunity.org  Wed May  3 11:28:09 2006
From: ehodge at helixcommunity.org (ehodge@helixcommunity.org)
Date: Wed May  3 13:21:16 2006
Subject: [Datatype-cvs] smil/renderer/smil2/pub smlelem.h,1.10,1.11
Message-ID: 

Update of /cvsroot/datatype/smil/renderer/smil2/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv15335/pub

Modified Files:
	smlelem.h 
Log Message:
+ This fixes CSmilElement::getCurrentScheduledStartTime() to
return the proper begin delay when pfs:displayWhile is active
on the element.  This prevents an assert from saying the prior
begin delay is in the future when re-starting an element that
has a pfs:displayWhile property after a seek to before its
AddTrack() has happened.  pfs:displayWhile really means the
begin delay is at the syncBase time, not the time the AddTrack
was last made.
+ Fixes a case where the SMILSyncAttributeTag was being assumed
to always be a begin time being parsed.  When it's really an
end time, the element's m_bHasAtLeastOneEventBasedBegin was
erroneously being set.  This only affects whether or not audio
reflush hint is sent for this track so it should only improve
performance and not affect any presentations' timing behavior.

Reviewed by:   ehyche@real.com


Index: smlelem.h
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/pub/smlelem.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- smlelem.h	31 Mar 2006 22:31:02 -0000	1.10
+++ smlelem.h	3 May 2006 18:28:04 -0000	1.11
@@ -169,9 +169,10 @@
     // inserted-into-the-timeline element *actually* begins and ends so
     // that doing such things as freezing and holding can be done:
     virtual HX_RESULT getCurrentScheduledStartTime(
-	    REF(ULONG32) ulActualStartTime);
+            REF(ULONG32) ulActualStartTime,
+            CSmilParser* pSmilParser);
     virtual HX_RESULT getCurrentScheduledStopTime(
-	    REF(ULONG32) ulActualStopTime);
+            REF(ULONG32) ulActualStopTime);
 
     // /Note: pValue, as well as the two lists, is|are filled with either
     // begin or end time|times, depending on the listType value:


From ehodge at helixcommunity.org  Wed May  3 11:28:06 2006
From: ehodge at helixcommunity.org (ehodge@helixcommunity.org)
Date: Wed May  3 13:21:45 2006
Subject: [Datatype-cvs] smil/renderer/smil2 smlelem.cpp, 1.17,
	1.18 smlparse.cpp, 1.35, 1.36
Message-ID: 

Update of /cvsroot/datatype/smil/renderer/smil2
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv15335

Modified Files:
	smlelem.cpp smlparse.cpp 
Log Message:
+ This fixes CSmilElement::getCurrentScheduledStartTime() to
return the proper begin delay when pfs:displayWhile is active
on the element.  This prevents an assert from saying the prior
begin delay is in the future when re-starting an element that
has a pfs:displayWhile property after a seek to before its
AddTrack() has happened.  pfs:displayWhile really means the
begin delay is at the syncBase time, not the time the AddTrack
was last made.
+ Fixes a case where the SMILSyncAttributeTag was being assumed
to always be a begin time being parsed.  When it's really an
end time, the element's m_bHasAtLeastOneEventBasedBegin was
erroneously being set.  This only affects whether or not audio
reflush hint is sent for this track so it should only improve
performance and not affect any presentations' timing behavior.

Reviewed by:   ehyche@real.com


Index: smlparse.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smlparse.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- smlparse.cpp	30 Mar 2006 20:52:03 -0000	1.35
+++ smlparse.cpp	3 May 2006 18:28:02 -0000	1.36
@@ -1775,7 +1775,7 @@
 				ULONG32 ulCurStartTime = 0;
 				if (HXR_OK == pPrevSibling->m_pElement->
 					getCurrentScheduledStartTime(
-					ulCurStartTime)  &&
+					ulCurStartTime, this)  &&
 					ulCurTime > ulCurStartTime)
 				{
 				    ULONG32 ulNewDuration =
@@ -2453,12 +2453,16 @@
 		{
 		    if (SmilTimeEvent == pVal->m_type)
 		    {
-                        //  XXXEH- I think I found a bug here, but don't want
-                        // to change the code at this point as it might break
-                        // existing content; we should not set bHasAtLeast...
-                        // to true if this is an *end* time we're parsing:
-                        HX_ASSERT(SMILSyncAttrBegin == nTag);
-			pElement->m_bHasAtLeastOneEventBasedBegin = TRUE;
+                        //  We should not set bHasAtLeast... to true if
+                        // this is an *end* time we're parsing.  This only
+                        // affects (as of 20060427) whether or not audio
+                        // reflush hint is sent for this track or not so
+                        // it should only improve performance and not affect
+                        // any presentations' timing behavior:
+                        if (SMILSyncAttrBegin == nTag)
+                        {
+                            pElement->m_bHasAtLeastOneEventBasedBegin = TRUE;
+                        }
 		    }
 #if defined(HELIX_FEATURE_PRESENTATION_FEATURE_SELECTION)
 		    else if (SmilTimePfsEvent == pVal->m_type)
@@ -6726,7 +6730,8 @@
 	ULONG32 ulActualStartTime = 0;
 	ULONG32 ulActualStopTime = 0;
         HX_RESULT pnrStart = HXR_OK;
-	pnrStart = pTmpVal->m_pElement->getCurrentScheduledStartTime(ulActualStartTime);
+	pnrStart = pTmpVal->m_pElement->getCurrentScheduledStartTime(ulActualStartTime,
+                this);
 	LONG32 lElementCurBeginTime = (LONG32)ulActualStartTime;
 
 	pTmpVal->m_pElement->getCurrentScheduledStopTime(ulActualStopTime);
@@ -8641,7 +8646,8 @@
 	ULONG32 ulActualStartTime = 0;
 	ULONG32 ulActualStopTime = 0;
 	HX_RESULT pnrStart = HXR_OK;
-	pnrStart = pTmpVal->m_pElement->getCurrentScheduledStartTime(ulActualStartTime);
+	pnrStart = pTmpVal->m_pElement->getCurrentScheduledStartTime(ulActualStartTime,
+                this);
 	LONG32 lElementCurBeginTime = (LONG32)ulActualStartTime;
 
 	HX_RESULT pnrStop = HXR_OK;
@@ -9075,7 +9081,7 @@
 			    {
 				pnrStart = pSyncBaseElement->
 					getCurrentScheduledStartTime(
-					ulAnchorStartTime);
+					ulAnchorStartTime, this);
 			    }
 			    else // /Use end of prior seq sibling as sync base:
 			    {
@@ -9115,7 +9121,8 @@
 				    (pSyncAncestor->m_pElement->m_lBeginOffset);
 			}
 #else
-			pSyncAncestor->m_pElement->getCurrentScheduledStartTime(ulAnchorStartTime);
+			pSyncAncestor->m_pElement->getCurrentScheduledStartTime(ulAnchorStartTime,
+                                this);
 			// /Now, add begin offset, if any, to
 			// sync base's end time:
 			ulAnchorStartTime += ulAnchorBeginOffset;
@@ -9537,7 +9544,8 @@
                         if (pSrcEl)
                         {
                             UINT32    ulStart = 0;
-                            HX_RESULT rv      = pSrcEl->getCurrentScheduledStartTime(ulStart);
+                            HX_RESULT rv = pSrcEl->getCurrentScheduledStartTime(ulStart,
+                                    this);
                             if (SUCCEEDED(rv))
                             {
                                 bKnowNextDelay = TRUE;
@@ -9582,7 +9590,8 @@
                                     pSibling->m_pElement != pElement)
                                 {
                                     UINT32 ulSibStart = 0;
-                                    rv = pSibling->m_pElement->getCurrentScheduledStartTime(ulSibStart);
+                                    rv = pSibling->m_pElement->getCurrentScheduledStartTime(ulSibStart,
+                                            this);
                                     if (SUCCEEDED(rv))
                                     {
                                         if (ulSibStart > ulOurStopTime)
@@ -19876,7 +19885,7 @@
 		{
 		    ULONG32 ulActualStartTime = 0;
 		    ULONG32 ulActualStopTime = 0;
-		    pChild->m_pElement->getCurrentScheduledStartTime(ulActualStartTime);
+		    pChild->m_pElement->getCurrentScheduledStartTime(ulActualStartTime, this);
 		    LONG32 lElementCurBeginTime = (LONG32)ulActualStartTime;
 
 		    // /Using this function instead of delay+dur fixes
@@ -20161,7 +20170,7 @@
 	    if (pSyncBaseElement == pSyncAncestorNode->m_pElement)
 	    {
 		pnrStart = pSyncBaseElement->getCurrentScheduledStartTime(
-			ulSyncBaseTime);
+			ulSyncBaseTime, this);
 	    }
 	    else // /Use end of prior seq sibling as sync base:
 	    {

Index: smlelem.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smlelem.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- smlelem.cpp	31 Mar 2006 22:31:01 -0000	1.17
+++ smlelem.cpp	3 May 2006 18:28:02 -0000	1.18
@@ -1094,11 +1094,21 @@
 // the same value as ((UINT32)-1) which is a possible return value and means
 // that the value is not initialized:
 HX_RESULT
-CSmilElement::getCurrentScheduledStartTime(REF(ULONG32) ulActualStartTime)
+CSmilElement::getCurrentScheduledStartTime(REF(ULONG32) ulActualStartTime,
+                                           CSmilParser* pSmilParser)
 {
     HX_RESULT ret = HXR_OK;
     
-    ulActualStartTime = m_ulDelay;
+#if defined(HELIX_FEATURE_PRESENTATION_FEATURE_SELECTION)
+    if (m_bAtRestartUseClipBeginForDisplayWhile  &&  ((UINT32)-1) != m_ulDelay)
+    {
+        ulActualStartTime = pSmilParser->getSyncBaseTimeInGroupTimeCoords(
+                m_pNode);
+    }
+    else
+#endif //  HELIX_FEATURE_PRESENTATION_FEATURE_SELECTION.
+        ulActualStartTime = m_ulDelay;
+
 
     HXBOOL bIsMediaObject = CSmilParser::isMediaObject(m_pNode);
 


From milko at helixcommunity.org  Wed May  3 17:18:02 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 19:11:08 2006
Subject: [Datatype-cvs] tools/dtdriver/apps/dtdrtest main.cpp,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/apps/dtdrtest
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv9838

Modified Files:
	main.cpp 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


Index: main.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/apps/dtdrtest/main.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- main.cpp	15 Nov 2004 21:41:18 -0000	1.3
+++ main.cpp	4 May 2006 00:17:57 -0000	1.4
@@ -53,6 +53,8 @@
 
 #define WRITE_RM_OPT            'r'
 
+#define USE_MEDIA_PLATFORM	'P'
+
 #ifdef _DEBUG
 
 #define VERSION_MODE_STRING "Debug"
@@ -80,6 +82,7 @@
 #include "hxtypes.h"
 #include "hxcom.h"
 #include "ihxpckts.h"
+#include "ihxmedpltfm.h"
 #include "hxengin.h"
 #include "hxcomm.h"
 #include "hxdtdr.h"
@@ -107,109 +110,218 @@
 /*
  * Option Flags
  */
-BOOL g_bDataAnalysis        = FALSE;
-BOOL g_bDecode          = FALSE;
-BOOL g_bShowProgress        = TRUE;
-BOOL g_bWriteBinary     = TRUE;
-BOOL g_bProcessHeadersOnly  = FALSE;
-BOOL g_bWriteRM         = FALSE;
-BOOL g_bMux             = FALSE;
+HXBOOL g_bDataAnalysis        = FALSE;
+HXBOOL g_bDecode          = FALSE;
+HXBOOL g_bShowProgress        = TRUE;
+HXBOOL g_bWriteBinary     = TRUE;
+HXBOOL g_bUseMediaPlatform    = TRUE;
+HXBOOL g_bProcessHeadersOnly  = FALSE;
+HXBOOL g_bWriteRM         = FALSE;
+HXBOOL g_bMux             = FALSE;
+
 
 /*
  *  main entry point
  */
-int main(int argc, char *argv[])
+HX_RESULT CreateDTDR(IUnknown* &pUnknown, 
+		     IHXMediaPlatform* &pPlatform, 
+		     FPHXMEDIAPLATFORMCLOSE &fpHXMediaPlatformClose,
+		     HINSTANCE &hDTDR)
 {
-    HX_RESULT RetVal            = HXR_OK;
-    IUnknown* pUnk          = NULL;
-    IUnknown* pSourceSink       = NULL;
-    IHXDataTypeDriverResponse* pDTDResponse = NULL;
-    IHXSourceInput* pSourceInput   = NULL;
-    IHXCommonClassFactory* pCCF    = NULL;
     FPCREATEINSTANCE fpCreateInstance = NULL;
-    FPSETDLLACCESSPATH fpSetDLLAccessPath;
-    IHXDataTypeDriver2* g_pDTDriver2 = NULL;
-    IHXValues* g_pOptions       = NULL;
+    FPSETDLLACCESSPATH fpSetDLLAccessPath = NULL;
+    FPHXMEDIAPLATFORMOPEN   fpHXMediaPlatformOpen   = NULL;
+    FPHXCREATEMEDIAPLATFORM fpHXCreateMediaPlatform = NULL;
 
+    HX_RESULT RetVal = HXR_OK;
 
-    // Load the data type driver library
-    HINSTANCE hDTDR = LoadLibrary("dtdr3260.dll");
-    if (!hDTDR)
+    char szPluginModulePath[256];
+
+    const char* pLibName = "hxmedpltfm.dll";
+
+        // Load the data type driver library
+    if (!g_bUseMediaPlatform)
     {
-    fprintf(stderr, "Error: Could not load dtdr3260.dll!\n");
-    RetVal = HXR_FILE_NOT_FOUND;
+	pLibName = "dtdr3260.dll";
     }
 
-    if (RetVal == HXR_OK)
-    {
-    fpCreateInstance = (FPCREATEINSTANCE) GetProcAddress(hDTDR, "RMACreateInstance");
-    fpSetDLLAccessPath = (FPSETDLLACCESSPATH) GetProcAddress(hDTDR, "SetDLLAccessPath");
-    if (!fpCreateInstance || !fpSetDLLAccessPath)
+    hDTDR = 0;
+    fpHXMediaPlatformClose  = NULL;
+    pPlatform = NULL;
+    pUnknown = NULL;
+
+    hDTDR = LoadLibrary(pLibName);
+    if (!hDTDR)
     {
-        fprintf(stderr, "Error: Could not locate entry point!\n");
-        RetVal = HXR_FAIL;
-    }
+	fprintf(stderr, "Error: Could not load %s!\n", pLibName);
+	RetVal = HXR_FILE_NOT_FOUND;
     }
 
     if (RetVal == HXR_OK)
     {
-    // set the plugin and codec path
-    char szModulePath[256];
-    int nLen = GetModuleFileName(NULL, szModulePath, 256);
-    for (; nLen && szModulePath[nLen - 1] != '\\'; nLen--);
-    szModulePath[nLen] = '\0';
-    char szDLLAccessPath[512];
-    memset(szDLLAccessPath, 0, 512);
-    int offset = 0;
-    offset += 1 + sprintf(szDLLAccessPath+offset, "DT_Plugins=%sPLUGINS", szModulePath);
-    offset += 1 + sprintf(szDLLAccessPath+offset, "DT_Codecs=%sCODECS", szModulePath);
-    fpSetDLLAccessPath(szDLLAccessPath);
+	fpSetDLLAccessPath = (FPSETDLLACCESSPATH) GetProcAddress(hDTDR, "SetDLLAccessPath");
+	if (!fpSetDLLAccessPath)
+	{
+	    RetVal = HXR_FAIL;
+	}
+
+	if (RetVal == HXR_OK)
+	{
+	    if (g_bUseMediaPlatform)
+	    {
+		fpHXMediaPlatformOpen = (FPHXMEDIAPLATFORMOPEN) GetProcAddress(hDTDR, "HXMediaPlatformOpen");
+		fpHXCreateMediaPlatform = (FPHXCREATEMEDIAPLATFORM) GetProcAddress(hDTDR, "HXCreateMediaPlatform");
+		fpHXMediaPlatformClose = (FPHXMEDIAPLATFORMCLOSE) GetProcAddress(hDTDR, "HXMediaPlatformClose");
+
+		if (!fpHXMediaPlatformOpen || 
+		    !fpHXCreateMediaPlatform ||
+		    !fpHXMediaPlatformClose)
+		{
+		    RetVal = HXR_FAIL;
+		}
+	    }
+	    else
+	    {
+		fpCreateInstance = (FPCREATEINSTANCE) GetProcAddress(hDTDR, "RMACreateInstance");
+
+		if (!fpCreateInstance)
+		{
+		    RetVal = HXR_FAIL;
+		}
+	    }
+	}
+
+	if (FAILED(RetVal))
+	{
+	    fprintf(stderr, "Error: Could not locate needed dll entry points!\n");
+	}
     }
 
     if (RetVal == HXR_OK)
     {
-    // Parse the command line arguments
-    RetVal = ParseCommandLine(argc, argv);
-    if (RetVal == HXR_PARSE_ERROR)
+	// set the plugin and codec path
+	char szModulePath[256];
+	int nLen = GetModuleFileName(NULL, szModulePath, 256);
+	for (; nLen && szModulePath[nLen - 1] != '\\'; nLen--);
+	szModulePath[nLen] = '\0';
+	char szDLLAccessPath[512];
+	memset(szDLLAccessPath, 0, 512);
+	int offset = 0;
+	offset += 1 + sprintf(szDLLAccessPath+offset, "DT_Plugins=%sPLUGINS", szModulePath);
+	offset += 1 + sprintf(szDLLAccessPath+offset, "DT_Codecs=%sCODECS", szModulePath);
+	fpSetDLLAccessPath(szDLLAccessPath);
+
+	sprintf(szPluginModulePath, "%sPLUGINS", szModulePath);
+    }
+
+    if (g_bUseMediaPlatform)
     {
-        DisplayUsage(argv[0]);
+	IHXCommonClassFactory* pCCF = NULL;
+
+	if (RetVal == HXR_OK)
+	{
+	    RetVal = fpHXMediaPlatformOpen();
+	}
+
+	if (RetVal == HXR_OK)
+	{
+	    RetVal = fpHXCreateMediaPlatform(&pPlatform);
+	}
+
+	if (RetVal == HXR_OK)
+	{
+	    RetVal = pPlatform->AddPluginPath("DTDRTestPath", szPluginModulePath);
+	}
+
+	if (RetVal == HXR_OK)
+	{
+	    RetVal = pPlatform->Init(NULL);
+	}
+
+	if (RetVal == HXR_OK)
+	{
+	    RetVal = pPlatform->QueryInterface(IID_IHXCommonClassFactory,
+					       (void**) &pCCF);
+	}
+
+	if (RetVal == HXR_OK)
+	{
+	    RetVal = pCCF->CreateInstance(CLSID_IHXDataTypeDriver, 
+					  (void**) &pUnknown);
+	}
+
+	HX_RELEASE(pCCF);
     }
+    else
+    {
+	if (RetVal == HXR_OK)
+	{
+	    RetVal = fpCreateInstance(&pUnknown);
+	}
     }
 
-    // create and init the driver object
+    return RetVal;
+}
+
+
+/*
+ *  main entry point
+ */
+int main(int argc, char *argv[])
+{
+    HX_RESULT RetVal            = HXR_OK;
+    IUnknown* pUnk		= NULL;
+    IHXMediaPlatform* pPlatform	= NULL;
+    IUnknown* pSourceSink       = NULL;
+    IHXDataTypeDriverResponse* pDTDResponse = NULL;
+    IHXSourceInput* pSourceInput   = NULL;
+    IHXCommonClassFactory* pCCF    = NULL;
+    IHXDataTypeDriver2* g_pDTDriver2 = NULL;
+    IHXValues* g_pOptions       = NULL;
+    FPHXMEDIAPLATFORMCLOSE fpHXMediaPlatformClose = NULL;
+    HINSTANCE hDTDR = 0;
+
     if (RetVal == HXR_OK)
     {
-    RetVal = fpCreateInstance(&pUnk);
-    if (pUnk == NULL)
-    {
-        fprintf(stderr, "out of memory error\n");
-        RetVal = HXR_OUTOFMEMORY;
+	// Parse the command line arguments
+	RetVal = ParseCommandLine(argc, argv);
+	if (RetVal == HXR_PARSE_ERROR)
+	{
+	    DisplayUsage(argv[0]);
+	}
     }
+
+    if (RetVal == HXR_OK)
+    {
+	RetVal = CreateDTDR(pUnk, 
+			    pPlatform, 
+			    fpHXMediaPlatformClose, 
+			    hDTDR);
     }
 
     // Get a common class factory for use later
     if (RetVal == HXR_OK)
     {
-    RetVal = pUnk->QueryInterface(IID_IHXCommonClassFactory, (void**)&pCCF);
+	RetVal = pUnk->QueryInterface(IID_IHXCommonClassFactory, (void**)&pCCF);
     }
 
     if (RetVal == HXR_OK)
     {
-    // Create an IHXValues instance to hold the driver options.
-    pCCF->CreateInstance(CLSID_IHXValues, (void**)&g_pOptions);
-    if (g_pOptions == NULL)
-    {
-        RetVal = HXR_OUTOFMEMORY;
-    }
+	// Create an IHXValues instance to hold the driver options.
+	pCCF->CreateInstance(CLSID_IHXValues, (void**)&g_pOptions);
+	if (g_pOptions == NULL)
+	{
+	    RetVal = HXR_OUTOFMEMORY;
+	}
 
-    // Set the driver options.
-    SetOptions(g_pOptions, pCCF);
+	// Set the driver options.
+	SetOptions(g_pOptions, pCCF);
     }
 
     // Create a source input to receive messages from the driver
     if (RetVal == HXR_OK)
     {
-    RetVal = CSourceInput::CreateInstance(&pSourceSink, 
+	RetVal = CSourceInput::CreateInstance(&pSourceSink, 
                           g_bWriteBinary, 
                           g_bShowProgress, 
                           g_pOptions,
@@ -218,84 +330,82 @@
 
     if (RetVal == HXR_OK)
     {
-    GUID* pSourceHandlerGUIDs = NULL;
-    int nSourceHandlerGUIDs = 0;
+	GUID* pSourceHandlerGUIDs = NULL;
+	int nSourceHandlerGUIDs = 0;
 
-    if (g_bDataAnalysis)
-    {
-        GUID guid_DataAnalysis = SHID_DATAANALYSIS;
-        pSourceHandlerGUIDs = &guid_DataAnalysis;
-        nSourceHandlerGUIDs = 1;
+	if (g_bDataAnalysis)
+	{
+	    GUID guid_DataAnalysis = SHID_DATAANALYSIS;
+	    pSourceHandlerGUIDs = &guid_DataAnalysis;
+	    nSourceHandlerGUIDs = 1;
 
-        //set the source sink as client context
-        IHXSetClientContext* pSetClientContext = NULL;
-        pUnk->QueryInterface(IID_IHXSetClientContext, (void**)&pSetClientContext);
-        if (pSetClientContext)
-        {
-        pSetClientContext->SetClientContext(pSourceSink);
-        }
-        HX_RELEASE(pSetClientContext);
-    }
+	    //set the source sink as client context
+	    IHXSetClientContext* pSetClientContext = NULL;
+	    pUnk->QueryInterface(IID_IHXSetClientContext, (void**)&pSetClientContext);
+	    if (pSetClientContext)
+	    {
+		pSetClientContext->SetClientContext(pSourceSink);
+	    }
+	    HX_RELEASE(pSetClientContext);
+	}
 
-    // Using IHXDataTypeDriver2 interface
+	// Using IHXDataTypeDriver2 interface
 
-    if (RetVal == HXR_OK)
-    {
-        // QI the driver object for the IHXDataTypeDriver2 interface
-        pUnk->QueryInterface(IID_IHXDataTypeDriver2, (void**)&g_pDTDriver2);
-        if (g_pDTDriver2 == NULL)
-        {
-        fprintf(stderr, "out of memory error\n");
-        RetVal = HXR_OUTOFMEMORY;
-        }
-    }
+	if (RetVal == HXR_OK)
+	{
+	    // QI the driver object for the IHXDataTypeDriver2 interface
+	    pUnk->QueryInterface(IID_IHXDataTypeDriver2, (void**)&g_pDTDriver2);
+	    if (g_pDTDriver2 == NULL)
+	    {
+		fprintf(stderr, "out of memory error\n");
+		RetVal = HXR_OUTOFMEMORY;
+	    }
+	}
 
-    if (RetVal == HXR_OK)
-    {
-        // QI for the source input interface
-        pSourceSink->QueryInterface(IID_IHXDataTypeDriverResponse, 
-                    (void**)&pDTDResponse);
-        // QI for the datatype driver response interface
-        pSourceSink->QueryInterface(IID_IHXSourceInput, 
-                    (void**)&pSourceInput);
-    }
+	if (RetVal == HXR_OK)
+	{
+	    // QI for the source input interface
+	    pSourceSink->QueryInterface(IID_IHXDataTypeDriverResponse, 
+		(void**)&pDTDResponse);
+	    // QI for the datatype driver response interface
+	    pSourceSink->QueryInterface(IID_IHXSourceInput, 
+		(void**)&pSourceInput);
+	}
 
-    if (RetVal == HXR_OK)
-    {
-        RetVal = g_pDTDriver2->Open(NULL, nSourceHandlerGUIDs, pSourceHandlerGUIDs, 0, NULL,
-                    g_pOptions,
-                    pDTDResponse,
-                    g_bDataAnalysis ? NULL : pSourceInput
-                    );
-    }
+	if (RetVal == HXR_OK)
+	{
+	    RetVal = g_pDTDriver2->Open(NULL, nSourceHandlerGUIDs, pSourceHandlerGUIDs, 0, NULL,
+		g_pOptions,
+		pDTDResponse,
+		g_bDataAnalysis ? NULL : pSourceInput
+		);
+	}
 
-    HX_RELEASE(pSourceInput);
-    HX_RELEASE(pDTDResponse);
+	HX_RELEASE(pSourceInput);
+	HX_RELEASE(pDTDResponse);
 
-    if (RetVal == HXR_OK)
-    {
-        RetVal = g_pDTDriver2->Drive(g_pInputFileName, g_bWriteRM?g_pOutputFileName:NULL);
-    }
+	if (RetVal == HXR_OK)
+	{
+	    RetVal = g_pDTDriver2->Drive(g_pInputFileName, g_bWriteRM?g_pOutputFileName:NULL);
+	}
     }
 
-
-
     DWORD t1 = GetTickCount();
 
     if (SUCCEEDED(RetVal))
     {
-    MSG msg;
+	MSG msg;
 
-    // Pump messages until the source sink posts a message
-    // (see dtdrtest.cpp) telling us to terminate.
-    while (GetMessage(&msg, NULL, 0, 0))
-    {
-        if (msg.message == RMAMSG_ON_TERMINATE)
-        {
-        break;
-        }
-        DispatchMessage(&msg);
-    }
+	// Pump messages until the source sink posts a message
+	// (see dtdrtest.cpp) telling us to terminate.
+	while (GetMessage(&msg, NULL, 0, 0))
+	{
+	    if (msg.message == RMAMSG_ON_TERMINATE)
+	    {
+		break;
+	    }
+	    DispatchMessage(&msg);
+	}
     }
 
     // Close the driver
@@ -306,6 +416,15 @@
     HX_RELEASE(g_pOptions);
     HX_RELEASE(pCCF);
     HX_RELEASE(pUnk);
+    if (pPlatform)
+    {
+	pPlatform->Close();
+	HX_RELEASE(pPlatform);
+    }
+    if (fpHXMediaPlatformClose)
+    {
+	(*fpHXMediaPlatformClose)();
+    }
     FreeLibrary(hDTDR);
 
     DWORD t2 = GetTickCount();
@@ -313,7 +432,7 @@
 
     if (FAILED(RetVal))
     {
-    printf("Error: %x!\n", RetVal);
+	printf("Error: %x!\n", RetVal);
     }
 
     return RetVal;
@@ -327,8 +446,8 @@
 {
     HX_RESULT RetVal = HXR_OK;
     int ArgIndex = 0;
-    BOOL bOptionMode = FALSE;
-    BOOL bIsOption = FALSE;
+    HXBOOL bOptionMode = FALSE;
+    HXBOOL bIsOption = FALSE;
 
     /* parse the command line */
     for (ArgIndex = 1; (ArgIndex < argc) && SUCCEEDED(RetVal); ArgIndex++)
@@ -424,6 +543,9 @@
                         case WRITE_BINARY_OPT:
                             g_bWriteBinary = bOptionMode;
                             break;
+			case USE_MEDIA_PLATFORM:
+			    g_bUseMediaPlatform = bOptionMode;
+			    break;
                         case PROCESS_HEADERS_ONLY_OPT:
                             g_bProcessHeadersOnly = bOptionMode;
                             break;
@@ -507,6 +629,7 @@
     printf("      %c = only process headers to check for rights\n", PROCESS_HEADERS_ONLY_OPT);
     printf("      %c = show progress     (default)\n", SHOW_PROGRESS_OPT);
     printf("      %c = write binary file (default) (PCM or raw atrc3)\n", WRITE_BINARY_OPT);
+    printf("      %c = use media platform (default)\n", USE_MEDIA_PLATFORM);
     printf("   Commands:\n");
     printf("      -%s     = place output file into specifed file (PCM if BurnToCD)\n", FILE_OPTION_STRING);
     printf("      -%s  = percentage to stop at\n", KILL_OPTION_STRING);


From milko at helixcommunity.org  Wed May  3 17:24:17 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 19:17:21 2006
Subject: [Datatype-cvs] tools/dtdriver/dtdrplin/pub datatypedr.h,1.8,1.9
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/dtdrplin/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv11364/pub

Modified Files:
	datatypedr.h 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


Index: datatypedr.h
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/pub/datatypedr.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- datatypedr.h	8 Mar 2006 19:18:09 -0000	1.8
+++ datatypedr.h	4 May 2006 00:24:15 -0000	1.9
@@ -39,6 +39,9 @@
 #include "hxplugn.h"
 #include "hxplgns.h"
 #include "hxcommn.h"
+#include "ihxcontextuser.h"
+#include "progsink.h"
+#include "baseobj.h"
 
 /****************************************************************************
  * Constants
@@ -62,12 +65,15 @@
 class FFDriver;
 class DLLAccess;
 class CDRMInfo;
+class HXCommonClassFactory;
 
 class CDataTypeConverter :  public IHXPlugin,
                             public IHXPluginProperties,
 			    public IHXDataTypeDriver2,
 			    public IHXProgressSinkControl,
-			    public IHXSetClientContext
+			    public IHXSetClientContext,
+			    public IHXContextUser,
+			    public CHXBaseCountingObject
 
 {
 public:
@@ -104,6 +110,12 @@
     STDMETHOD_(UINT32, AddRef ) (THIS);
     STDMETHOD_(UINT32, Release) (THIS);
 
+    /************************************************************************
+     *  IHXContextUser Interface Methods                         ref:  rmaplugn.h
+     */
+    STDMETHOD (RegisterContext)(THIS_ IUnknown* pIContext);
+
+
     /*
      * IHXDataTypeDriver2 methods
      */
@@ -226,7 +238,8 @@
     virtual FFDriver* CreateFFDriver(void);
     virtual HX_RESULT LoadSourceHandlers(IUnknown* pContext);
 
-    HXCommonClassFactory* m_pCommonClassFactory;
+    HXCommonClassFactory* m_pCommonClassFactoryObject;
+    IHXCommonClassFactory* m_pCommonClassFactory;
     IHXValues*		m_pOptions;
     BOOL		m_bSuppressWriter;
     IHXSourceHandler**  m_pCustomSourceHandlers;


From milko at helixcommunity.org  Wed May  3 17:24:17 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 19:17:25 2006
Subject: [Datatype-cvs] tools/dtdriver/dtdrplin dtdr_genr_dll, NONE,
	1.1 dtdr_genr_lib, NONE, 1.1 dtdr_platform, NONE,
	1.1 dtdr_platform_dll, NONE, 1.1 dtdr_platform_dll_win.pcf,
	NONE, 1.1 dtdr_platform_lib, NONE, 1.1 dtdr_stdalone, NONE,
	1.1 dtdr_stdalone_dll, NONE, 1.1 dtdr_stdalone_dll_win.pcf,
	NONE, 1.1 dtdr_stdalone_lib, NONE, 1.1 hxmeddtdrpln.cpp, NONE,
	1.1 hxmeddtdrpln.h, NONE, 1.1 Umakefil, 1.2,
	1.3 datatypedr.cpp, 1.16, 1.17 dtdrplin.cpp, 1.3, 1.4 win.pcf,
	1.4, 1.5
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/dtdrplin
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv11364

Modified Files:
	Umakefil datatypedr.cpp dtdrplin.cpp win.pcf 
Added Files:
	dtdr_genr_dll dtdr_genr_lib dtdr_platform dtdr_platform_dll 
	dtdr_platform_dll_win.pcf dtdr_platform_lib dtdr_stdalone 
	dtdr_stdalone_dll dtdr_stdalone_dll_win.pcf dtdr_stdalone_lib 
	hxmeddtdrpln.cpp hxmeddtdrpln.h 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


--- NEW FILE: dtdr_stdalone_lib ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

project.AddDefines("HELIX_CONFIG_DTDRPLIN_LOCAL_CCFACTORY")

execfile("dtdr_genr_lib", globals())

LibraryTarget('dtdr_stdalone_lib')

DependTarget()

Index: dtdrplin.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/dtdrplin.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- dtdrplin.cpp	7 Feb 2006 20:50:52 -0000	1.3
+++ dtdrplin.cpp	4 May 2006 00:24:14 -0000	1.4
@@ -55,8 +55,11 @@
 #include "hxdtdr.h"
 #include "progsink.h"
 
+#include "hxcomm.h"
+
 #include "datatypedr.h"
 
+
 ENABLE_DLLACCESS_PATHS(DatatypeDriverPaths);
 
 /****************************************************************************
@@ -87,3 +90,8 @@
     }
     return HXR_OUTOFMEMORY;
 }
+
+STDAPI ENTRYPOINT(CanUnload2)(void)
+{
+    return (CHXBaseCountingObject::ObjectsActive() ? HXR_FAIL : HXR_OK);
+}

--- NEW FILE: dtdr_genr_dll ---
# -*- python -*-
# 
# ***** BEGIN LICENSE BLOCK *****
# Source last modified: $Id: dtdr_genr_dll,v 1.1 2006/05/04 00:24:14 milko Exp $
# 
# Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
# 
# The contents of this file, and the files included with this file,
# are subject to the current version of the RealNetworks Public
# Source License (the "RPSL") available at
# http://www.helixcommunity.org/content/rpsl unless you have licensed
# the file under the current version of the RealNetworks Community
# Source License (the "RCSL") available at
# http://www.helixcommunity.org/content/rcsl, in which case the RCSL
# will apply. You may also obtain the license terms directly from
# RealNetworks.  You may not use this file except in compliance with
# the RPSL or, if you have a valid RCSL with RealNetworks applicable
# to this file, the RCSL.  Please see the applicable RPSL or RCSL for
# the rights, obligations and limitations governing use of the
# contents of the file.
# 
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL") in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your version of
# this file only under the terms of the GPL, and not to allow others
# to use your version of this file under the terms of either the RPSL
# or RCSL, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient may
# use your version of this file under the terms of any one of the
# RPSL, the RCSL or the GPL.
# 
# This file is part of the Helix DNA Technology. RealNetworks is the
# developer of the Original Code and owns the copyrights in the
# portions it created.
# 
# This file, and the files included with this file, is distributed
# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
# ENJOYMENT OR NON-INFRINGEMENT.
# 
# Technology Compatibility Kit Test Suite(s) Location:
#    http://www.helixcommunity.org/content/tck
# 
# Contributor(s):
# 
# ***** END LICENSE BLOCK *****
# 

project.AddModuleIncludes("common/include",
                          "common/log/logobserverfile/pub",
                          "datatype/tools/dtdriver/engine",
                          "common/system/pub",
                          "common/container/pub",
                          "common/dbgtool/pub",
                          "common/util/pub",
                          "datatype/tools/dtdriver/engine/pub",
                          "client/common/system/pub",
                          "datatype/tools/minicntx/pub",
                          "producersdk/include")

project.AddModuleLibraries( "datatype/tools/dtdriver/loader[SourceHandlerLoader]",
                            "datatype/tools/dtdriver/engine[dtdrengine]",
                            "datatype/tools/dtdriver/common[dtdrcomlib]",
                            "datatype/tools/dtdriver/decoder/common[dtdrdeclib]",
                            "datatype/tools/dtdriver/decoder/audio[dtdrauddec]",
                            "datatype/tools/dtdriver/decoder/video[dtdrviddec]",
                            "client/common/container[contclntlib]",
                            "client/common/system[sysclntlib]",
                            "common/runtime[runtlib]",
                            "common/dbgtool[debuglib]", 
                            "common/util[utillib]", 
                            "common/container[contlib]",
                            "common/system[syslib]",
                            "common/fileio[fileiolib]",
                            "common/lang/xml[xmllib]")

if project.IsDefined("HELIX_FEATURE_MISU"):
	project.AddModuleLibraries( "client/videosvc[vidsvclib]")
	
if project.IsDefined("HELIX_FEATURE_DTDR_MIXER"):
    project.AddModuleLibraries("client/audiosvc[audsvclib]")
    if ('HELIX_FEATURE_GAINTOOL' in project.defines):
	project.AddModuleLibraries("audio/gaintool[audgainlib]" )
    if ('HELIX_FEATURE_CROSSFADE' in project.defines):
	project.AddModuleLibraries("audio/crossfade[audxfadelib]")
    if ('HELIX_FEATURE_LIMITER' in project.defines):
	project.AddModuleLibraries('audio/limiter[audlimiter]')
    if ('HELIX_FEATURE_RESAMPLER' in project.defines):
        if ('HELIX_CONFIG_FIXEDPOINT' in project.defines):
            project.AddModuleLibraries('audio/fixptresampler[fixptresampler]')
        else:
            project.AddModuleLibraries('audio/resampler[audresamplib]')

if project.IsDefined("HELIX_FEATURE_MINICONTEXT_PLAYBACK_NET"):
        project.AddModuleLibraries( "client/netwksvc[netsvclib]",
                                    "common/netio[netiolib]",
                                    "client/common/netio[netioclntlib]",
                                    "protocol/http[httplib]",
                                    "protocol/common/util[protutillib]")

project.AddSources('dlliids.cpp')

# the dtdriver engine relies on Producer headers that require
# deprecated smartpointer implementation
project.AddDefines( 'HELIX_FEATURE_ALLOW_DEPRECATED_SMARTPOINTERS' )

project.ExportFunction("RMACreateInstance",
                       "IUnknown** ppObj",
                       "common/include",
                       "hxcom.h")
project.ExportFunction("SetDLLAccessPath", "const char* pszPath")
project.ExportFunction("CanUnload2", "void")


--- NEW FILE: dtdr_platform_lib ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

project.RemoveDefines("HELIX_CONFIG_DTDRPLIN_LOCAL_CCFACTORY")

execfile("dtdr_genr_lib", globals())

LibraryTarget('dtdr_platform_lib')

DependTarget()


Index: win.pcf
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/win.pcf,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- win.pcf	19 Aug 2005 06:04:11 -0000	1.4
+++ win.pcf	4 May 2006 00:24:14 -0000	1.5
@@ -36,5 +36,6 @@
 # 
 
 project.AddModuleIncludes("datatype/tools/dtdriver/dtdrplin/platform/win")
-project.AddSources("platform/win/thrdcbmgr.cpp",
-                   "platform/win/dllmain.cpp")
+project.AddSources("platform/win/thrdcbmgr.cpp")
+                  
+# "platform/win/dllmain.cpp")

Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/Umakefil,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Umakefil	19 Aug 2005 02:40:54 -0000	1.2
+++ Umakefil	4 May 2006 00:24:14 -0000	1.3
@@ -37,5 +37,5 @@
 
 UmakefileVersion(2,2)
 
-MultiTargetMake("umakelib", "umakedll")
+MultiTargetMake("dtdr_platform", "dtdr_stdalone")
 

--- NEW FILE: dtdr_genr_lib ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

project.AddModuleIncludes("common/include",
                          "common/log/logobserverfile/pub",
                          "datatype/tools/dtdriver/engine",
                          "datatype/tools/dtdriver/loader/pub",
                          "common/system/pub",
                          "common/container/pub",
                          "common/dbgtool/pub",
                          "common/util/pub",
                          "datatype/tools/dtdriver/engine/pub",
                          "client/common/system/pub",
                          "datatype/tools/minicntx/pub")

project.AddSources('datatypedr.cpp')

# the dtdriver engine relies on Producer headers that require
# deprecated smartpointer implementation
project.AddDefines( 'HELIX_FEATURE_ALLOW_DEPRECATED_SMARTPOINTERS' )
--- NEW FILE: dtdr_platform_dll ---
# -*- python -*-
# 
# ***** BEGIN LICENSE BLOCK *****
# Source last modified: $Id: dtdr_platform_dll,v 1.1 2006/05/04 00:24:14 milko Exp $
# 
# Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
# 
# The contents of this file, and the files included with this file,
# are subject to the current version of the RealNetworks Public
# Source License (the "RPSL") available at
# http://www.helixcommunity.org/content/rpsl unless you have licensed
# the file under the current version of the RealNetworks Community
# Source License (the "RCSL") available at
# http://www.helixcommunity.org/content/rcsl, in which case the RCSL
# will apply. You may also obtain the license terms directly from
# RealNetworks.  You may not use this file except in compliance with
# the RPSL or, if you have a valid RCSL with RealNetworks applicable
# to this file, the RCSL.  Please see the applicable RPSL or RCSL for
# the rights, obligations and limitations governing use of the
# contents of the file.
# 
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL") in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your version of
# this file only under the terms of the GPL, and not to allow others
# to use your version of this file under the terms of either the RPSL
# or RCSL, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient may
# use your version of this file under the terms of any one of the
# RPSL, the RCSL or the GPL.
# 
# This file is part of the Helix DNA Technology. RealNetworks is the
# developer of the Original Code and owns the copyrights in the
# portions it created.
# 
# This file, and the files included with this file, is distributed
# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
# ENJOYMENT OR NON-INFRINGEMENT.
# 
# Technology Compatibility Kit Test Suite(s) Location:
#    http://www.helixcommunity.org/content/tck
# 
# Contributor(s):
# 
# ***** END LICENSE BLOCK *****
# 

UmakefileVersion(2,2)

project.AddSources('hxmeddtdrpln.cpp')

execfile("dtdr_genr_dll", globals())

project.AddModuleLibraries("datatype/tools/dtdriver/dtdrplin[dtdr_platform_lib]",
						   "datatype/tools/minicntx[minisubcntx]")

DLLTarget('hxdtdriver')
DependTarget()

--- NEW FILE: hxmeddtdrpln.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: hxmeddtdrpln.h,v 1.1 2006/05/04 00:24:14 milko Exp $
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef _HXMEDDTDRPLN_H_
#define _HXMEDDTDRPLN_H_

#include "unkimp.h"
#include "hxplugn.h"
#include "ihxcontextuser.h"
#include "baseobj.h"

class CHXDatatypeDriverPlugin : public IHXPlugin
			      , public IHXComponentPlugin
			      , public CHXBaseCountingObject
{
protected:
    LONG32		        m_lRefCount;
    static const char* const    zm_pDescription;
    static const char* const    zm_pCopyright;
    static const char* const    zm_pMoreInfoURL;
    IHXCommonClassFactory*	m_pCCF;
    
    virtual ~CHXDatatypeDriverPlugin();

public:
    CHXDatatypeDriverPlugin();

    /*
     * IUnknown methods
     */
    STDMETHOD(QueryInterface)	(THIS_
				REFIID riid,
				void** ppvObj);

    STDMETHOD_(ULONG32,AddRef)	(THIS);

    STDMETHOD_(ULONG32,Release)	(THIS);

    // IHXPlugin
    STDMETHOD(GetPluginInfo)	(THIS_
				REF(HXBOOL)	 /*OUT*/ bMultipleLoad,
				REF(const char*) /*OUT*/ pDescription,
				REF(const char*) /*OUT*/ pCopyright,
				REF(const char*) /*OUT*/ pMoreInfoURL,
				REF(ULONG32)	 /*OUT*/ ulVersionNumber);

    STDMETHOD(InitPlugin)	(THIS_
				IUnknown*   /*IN*/  pContext);

    //	IHXComponentPlugin methods
    STDMETHOD_(UINT32, GetNumComponents)    (THIS);

    STDMETHOD_(char const*, GetPackageName) (THIS) CONSTMETHOD;

    STDMETHOD(GetComponentInfoAtIndex)	    (THIS_
					    UINT32	    /*IN*/  nIndex,
					    REF(IHXValues*) /*OUT*/ pInfo);

    STDMETHOD(CreateComponentInstance)	    (THIS_
					    REFCLSID	    /*IN*/  rclsid,
					    REF(IUnknown*)  /*OUT*/ ppUnknown,
					    IUnknown*	    /*IN*/  pUnkOuter);
};

#endif /* _HXMEDDTDRPLN_H_ */

--- NEW FILE: dtdr_platform ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

MultiTargetMake("dtdr_platform_lib", "dtdr_platform_dll")


Index: datatypedr.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/datatypedr.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- datatypedr.cpp	8 Mar 2006 19:18:09 -0000	1.16
+++ datatypedr.cpp	4 May 2006 00:24:14 -0000	1.17
@@ -96,6 +96,7 @@
 CDataTypeConverter::CDataTypeConverter()
 :
   m_pCommonClassFactory(NULL)
+, m_pCommonClassFactoryObject(NULL)
 , m_pOptions(NULL) 
 , m_bSuppressWriter(FALSE)
 , m_pCustomSourceHandlers(NULL)
@@ -132,11 +133,10 @@
 , m_InitStatus(HXR_FAIL)
 , m_state(State_Closed)
 {
-    m_pCommonClassFactory = new HXCommonClassFactory(NULL);
-    if (m_pCommonClassFactory ) 
-	m_pCommonClassFactory->AddRef();
-
-    CreateInstanceCCF(CLSID_IHXMutex, (void**)&m_pStateMutex, m_pCommonClassFactory);
+#if defined(HELIX_CONFIG_DTDRPLIN_LOCAL_CCFACTORY)
+    m_pCommonClassFactoryObject = new HXCommonClassFactory(NULL);
+    HX_ADDREF(m_pCommonClassFactoryObject);
+#endif	// HELIX_CONFIG_DTDRPLIN_LOCAL_CCFACTORY
 }
 
 CDataTypeConverter::~CDataTypeConverter()
@@ -144,11 +144,16 @@
     CleanUp();
 
     HX_RELEASE(m_pStateMutex);
+    HX_RELEASE(m_pCommonClassFactory);  
 
-    if (m_pCommonClassFactory)
-    	m_pCommonClassFactory->Close();
+#if defined(HELIX_CONFIG_DTDRPLIN_LOCAL_CCFACTORY)
+    if (m_pCommonClassFactoryObject)
+    {
+    	m_pCommonClassFactoryObject->Close();
+    }
 
-    HX_RELEASE(m_pCommonClassFactory);   
+    HX_RELEASE(m_pCommonClassFactoryObject);
+#endif	// HELIX_CONFIG_DTDRPLIN_LOCAL_CCFACTORY
 
     HX_RELEASE(m_pClientContext);
     HX_RELEASE(m_pFFDriverContext);
@@ -158,7 +163,7 @@
 
 
 void*
-ThreadRoutine(void * pArg)
+DTDRThreadRoutine(void * pArg)
 {
     CDataTypeConverter* pDTDR = (CDataTypeConverter*) pArg;
     // Will loop until Close() is called.
@@ -166,7 +171,23 @@
     return (void*) 0;
 }
 
+/************************************************************************
+ *  IHXContextUser Methods
+ */
+STDMETHODIMP
+CDataTypeConverter::RegisterContext(IUnknown* pIContext)
+{
+    HX_RESULT retVal = HXR_UNEXPECTED;
+    
+    if (!m_pContext)
+    {
+	m_pContext = pIContext;
+	HX_ADDREF(m_pContext);
+	retVal = HXR_OK;
+    }
 
+    return retVal;
+}
 
 /*
  * IHXDataTypeDriver2 methods
@@ -203,15 +224,29 @@
 
 {
     HX_RESULT retVal = HXR_OK;
+    IHXScheduler* pClientContextScheduler = NULL;
 
-#ifndef _WINDOWS    
-    if(!m_pClientContext)
+#ifndef _WINDOWS
+    // On non-windows, we need a client context scheduler in order to
+    // marshall call-backs back to the caller's thread.
+    // On windows, windows native messaging is used which is tuned to 
+    // assumed use of windows message loop by the caller.
+    if (m_pClientContext)
     {
-        // On non-windows, we need a client context in order to get
-        // an IHXScheduler
-        return HXR_FAIL;
+	m_pClientContext->QueryInterface(IID_IHXScheduler, 
+					 (void**) &pClientContextScheduler);
     }
-#endif
+    if (!pClientContextScheduler)
+    {
+	retVal = HXR_FAIL;
+
+	if (m_pContext)
+	{
+	    retVal = m_pContext->QueryInterface(IID_IHXScheduler, 
+						(void**) &pClientContextScheduler);
+	}
+    }
+#endif	// _WINDOWS
     
     // Open may be called from any state. The driver is first
     // closed if necessary to clean up from a previous state.
@@ -223,6 +258,38 @@
 	return HXR_UNEXPECTED;
     }
 
+    // We must have common class factory - obtain it or fail
+    if (SUCCEEDED(retVal) && !m_pCommonClassFactory)
+    {
+	retVal = HXR_FAIL;
+
+#if defined(HELIX_CONFIG_DTDRPLIN_LOCAL_CCFACTORY)
+	if (m_pCommonClassFactoryObject)
+	{
+	    retVal = m_pCommonClassFactoryObject->QueryInterface(IID_IHXCommonClassFactory,
+								 (void**) &m_pCommonClassFactory);
+	}
+	else
+#endif	// HELIX_CONFIG_DTDRPLIN_LOCAL_CCFACTORY
+	{
+	    if (m_pClientContext)
+	    {
+		retVal = m_pClientContext->QueryInterface(IID_IHXCommonClassFactory,
+							  (void**) &m_pCommonClassFactory);
+	    }
+	    else if (m_pContext)
+	    {
+		retVal = m_pContext->QueryInterface(IID_IHXCommonClassFactory,
+						    (void**) &m_pCommonClassFactory);
+	    }
+	}
+    }
+
+    if (SUCCEEDED(retVal) && !m_pStateMutex)
+    {
+	CreateInstanceCCF(CLSID_IHXMutex, (void**)&m_pStateMutex, m_pCommonClassFactory);
+    }
+
     if (SUCCEEDED(retVal))
     {
 	retVal = Setup(pCertificate, 
@@ -234,10 +301,15 @@
     // Thread synchronization objects
     if (retVal == HXR_OK)
     {
-	CreateInstanceCCF(CLSID_IHXMutex, (void**)&m_pThrottleMutex, m_pCommonClassFactory);
-	CreateEventCCF((void**)&m_pDriveEvent, m_pCommonClassFactory, NULL, FALSE);
-	CreateEventCCF((void**)&m_pOpenEvent, m_pCommonClassFactory, NULL, FALSE);
-	CreateEventCCF((void**)&m_pStartEvent, m_pCommonClassFactory, NULL, FALSE);
+	retVal = HXR_FAIL;
+
+	if ((CreateInstanceCCF(CLSID_IHXMutex, (void**)&m_pThrottleMutex, m_pCommonClassFactory) == HXR_OK) &&
+	    (CreateEventCCF((void**)&m_pDriveEvent, m_pCommonClassFactory, NULL, FALSE) == HXR_OK) &&
+	    (CreateEventCCF((void**)&m_pOpenEvent, m_pCommonClassFactory, NULL, FALSE) == HXR_OK) &&
+	    (CreateEventCCF((void**)&m_pStartEvent, m_pCommonClassFactory, NULL, FALSE) == HXR_OK))
+	{
+	    retVal = HXR_OK;
+	}
     }
     
     // Create a new driver thread
@@ -249,7 +321,7 @@
 
     if (retVal == HXR_OK)
     {
-        retVal = m_pInternalThread->CreateThread(ThreadRoutine, (void*) this, 0);            
+        retVal = m_pInternalThread->CreateThread(DTDRThreadRoutine, (void*) this, 0);            
     }
 
     // The callback manager will be used by FFDriver in the driver thread
@@ -261,16 +333,9 @@
 
 #ifdef _WINDOWS
         m_pCBMgr = new CThreadCBMgr(this, m_pInternalThread);
-#else
-        IHXScheduler* pScheduler = NULL;
-        
-        retVal = m_pClientContext->QueryInterface(IID_IHXScheduler, (void**) &pScheduler);
-        if (retVal == HXR_OK)
-        {
-            m_pCBMgr = new CThreadCBMgr(this, pScheduler);
-            HX_RELEASE(pScheduler);
-        }
-#endif
+#else	// _WINDOWS
+        m_pCBMgr = new CThreadCBMgr(this, pClientContextScheduler);
+#endif	// _WINDOWS
 
         if (!m_pCBMgr)
         {
@@ -301,6 +366,8 @@
 	}
     }
 
+    HX_RELEASE(pClientContextScheduler);
+
     if (retVal != HXR_OK)
     {
 	CleanUp();
@@ -312,11 +379,11 @@
 
 HX_RESULT 
 CDataTypeConverter::Setup(const char* pCertificate,
-			 int nSourceHandlerGUIDs, GUID* pSourceHandlerGUIDs,
-			 int nSourceHandlerList, IHXSourceHandler** pSourceHandlerList,
-			 IHXValues* pOptions,
-			 IHXDataTypeDriverResponse* pResponse,
-			 IHXSourceInput* pSourceInput
+			  int nSourceHandlerGUIDs, GUID* pSourceHandlerGUIDs,
+			  int nSourceHandlerList, IHXSourceHandler** pSourceHandlerList,
+			  IHXValues* pOptions,
+			  IHXDataTypeDriverResponse* pResponse,
+			  IHXSourceInput* pSourceInput
 		    )
 {
     HX_RESULT retVal = HXR_OK;
@@ -374,29 +441,32 @@
 			  const char* pOutFileName
 			  )
 {
-    HX_RESULT retVal = HXR_OK;
+    HX_RESULT retVal = HXR_UNEXPECTED;
 
     // Stop the driver if necessary.
     retVal = Stop();
 
     // Guard against driving again if a callback already started a new job.
-    m_pStateMutex->Lock();
-    if (m_state != State_Stopping && m_state != State_Stopped)
+    if (m_pStateMutex)
     {
+	retVal = HXR_OK;
+	m_pStateMutex->Lock();
+	if (m_state != State_Stopping && m_state != State_Stopped)
+	{
+	    m_pStateMutex->Unlock();
+	    return HXR_UNEXPECTED;
+	}
 	m_pStateMutex->Unlock();
-	return HXR_UNEXPECTED;
     }
-    m_pStateMutex->Unlock();
 
     if (retVal == HXR_OK)
     {
-	if (!pInFileName)
-	{
-	    retVal = HXR_INVALID_PARAMETER;
-	}
-	else
+	HX_VECTOR_DELETE(m_pInputFileName);
+	// It is valid for pInFileName to be NULL as dtdrive can drive
+	// the source handler chain only.  In such case the first source
+	// handler in the chain needs to act as a data-source.
+	if (pInFileName)
 	{
-	    HX_VECTOR_DELETE(m_pInputFileName);
 	    m_pInputFileName = new_string(pInFileName);
 	    if (!m_pInputFileName)
 	    {
@@ -443,23 +513,27 @@
 STDMETHODIMP
 CDataTypeConverter::Pause()
 {
-    HX_RESULT retVal = HXR_OK;
+    HX_RESULT retVal = HXR_UNEXPECTED;
 
-    m_pStateMutex->Lock();
-    
-    // Make sure we check state before attempting to obtain the
-    // lock. We should never be waiting here.
-    if (m_state == State_Driving)
-    {
-	if (m_pThrottleMutex) m_pThrottleMutex->Lock();
-	m_state = State_Paused;
-	LOG_STRING("State_Paused");
-    }
-    else
+    if (m_pStateMutex)
     {
-	retVal = HXR_UNEXPECTED;
+	retVal = HXR_OK;
+	m_pStateMutex->Lock();
+    
+	// Make sure we check state before attempting to obtain the
+	// lock. We should never be waiting here.
+	if (m_state == State_Driving)
+	{
+	    if (m_pThrottleMutex) m_pThrottleMutex->Lock();
+	    m_state = State_Paused;
+	    LOG_STRING("State_Paused");
+	}
+	else
+	{
+	    retVal = HXR_UNEXPECTED;
+	}
+	m_pStateMutex->Unlock();
     }
-    m_pStateMutex->Unlock();
 
     return retVal;
 }
@@ -473,20 +547,25 @@
 STDMETHODIMP
 CDataTypeConverter::Resume()
 {
-    HX_RESULT retVal = HXR_OK;
+    HX_RESULT retVal = HXR_UNEXPECTED;
 
-    m_pStateMutex->Lock();
-    if (m_state == State_Paused)
-    {
-	if (m_pThrottleMutex) m_pThrottleMutex->Unlock();
-	m_state = State_Driving;
-	LOG_STRING("State_Driving");
-    }
-    else
+    if (m_pStateMutex)
     {
-	retVal = HXR_UNEXPECTED;
+	retVal = HXR_OK;
+
+	m_pStateMutex->Lock();
+	if (m_state == State_Paused)
+	{
+	    if (m_pThrottleMutex) m_pThrottleMutex->Unlock();
+	    m_state = State_Driving;
+	    LOG_STRING("State_Driving");
+	}
+	else
+	{
+	    retVal = HXR_UNEXPECTED;
+	}
+	m_pStateMutex->Unlock();
     }
-    m_pStateMutex->Unlock();
 
     return retVal;
 }
@@ -501,44 +580,49 @@
 STDMETHODIMP
 CDataTypeConverter::Stop()
 {
-    HX_RESULT ret = HXR_OK;
+    HX_RESULT ret = HXR_UNEXPECTED;
 
-    m_pStateMutex->Lock();
-    if (m_state == State_Stopping || m_state == State_Stopped)
-    {
-	m_pStateMutex->Unlock();
-	return HXR_OK;
-    }
-    if (m_state == State_Paused)
-    {
-	// Resume if driver is waiting in the Paused state.
-	if (m_pThrottleMutex) m_pThrottleMutex->Unlock();
-	m_state = State_Driving;
-	LOG_STRING("State_Driving");
-    }
-    if (m_state != State_Driving)
+    if (m_pStateMutex)
     {
+	ret = HXR_OK;
+
+	m_pStateMutex->Lock();
+	if (m_state == State_Stopping || m_state == State_Stopped)
+	{
+	    m_pStateMutex->Unlock();
+	    return HXR_OK;
+	}
+	if (m_state == State_Paused)
+	{
+	    // Resume if driver is waiting in the Paused state.
+	    if (m_pThrottleMutex) m_pThrottleMutex->Unlock();
+	    m_state = State_Driving;
+	    LOG_STRING("State_Driving");
+	}
+	if (m_state != State_Driving)
+	{
+	    m_pStateMutex->Unlock();
+	    return HXR_UNEXPECTED;
+	}
+	m_state = State_Stopping;
+	LOG_STRING("State_Stopping");
 	m_pStateMutex->Unlock();
-	return HXR_UNEXPECTED;
-    }
-    m_state = State_Stopping;
-    LOG_STRING("State_Stopping");
-    m_pStateMutex->Unlock();
 
-    if (m_pFFDriver)
-    {
-	m_pFFDriver->Stop();
-    }
-    else
-    {
-	// Called from invalid state
-	ret = HXR_UNEXPECTED;
-    }
+	if (m_pFFDriver)
+	{
+	    m_pFFDriver->Stop();
+	}
+	else
+	{
+	    // Called from invalid state
+	    ret = HXR_UNEXPECTED;
+	}
 
-    if (ret == HXR_OK)
-    {
-	// Callback to signal that we have stopped.
-	CB_OnTermination(HXR_CLOSED);
+	if (ret == HXR_OK)
+	{
+	    // Callback to signal that we have stopped.
+	    CB_OnTermination(HXR_CLOSED);
+	}
     }
 
     return ret;
@@ -560,36 +644,39 @@
 {
     HX_RESULT ret = HXR_OK;
 
-    m_pStateMutex->Lock();
-    if (m_state == State_Closed)
+    if (m_pStateMutex)
     {
+	m_pStateMutex->Lock();
+	if (m_state == State_Closed)
+	{
+	    m_pStateMutex->Unlock();
+	    return HXR_OK;
+	}
+	m_bClosing = TRUE;
 	m_pStateMutex->Unlock();
-	return HXR_OK;
-    }
-    m_bClosing = TRUE;
-    m_pStateMutex->Unlock();
 
-    // Stop the current operation
-    Stop();
+	// Stop the current operation
+	Stop();
 
-    // Shutdown and cleanup only if we are still closing, since 
-    // the callback in Stop() could have started a new job. For
-    // instance, CB_OnTermination could call the OnTermination
-    // method of the source input, which could in turn call Open()
-    // to start a new job. Open calls Close again to shutdown the
-    // current thread. m_bClosing then gets reset to FALSE in
-    // CleanUp, and a new thread is created in Open. When we return
-    // from Stop, m_bClosing will be FALSE, and the following code
-    // will not get executed since a new thread has already started.
-    if (m_bClosing)
-    {
-	// Shutdown the internal thread - will wait until thread exits.
-	ret = ShutDown();
-	CleanUp();
+	// Shutdown and cleanup only if we are still closing, since 
+	// the callback in Stop() could have started a new job. For
+	// instance, CB_OnTermination could call the OnTermination
+	// method of the source input, which could in turn call Open()
+	// to start a new job. Open calls Close again to shutdown the
+	// current thread. m_bClosing then gets reset to FALSE in
+	// CleanUp, and a new thread is created in Open. When we return
+	// from Stop, m_bClosing will be FALSE, and the following code
+	// will not get executed since a new thread has already started.
+	if (m_bClosing)
+	{
+	    // Shutdown the internal thread - will wait until thread exits.
+	    ret = ShutDown();
+	    CleanUp();
 
-	// Thread has exited. Set state to closed.
-	m_state = State_Closed;
-	LOG_STRING("State_Closed");
+	    // Thread has exited. Set state to closed.
+	    m_state = State_Closed;
+	    LOG_STRING("State_Closed");
+	}
     }
 
     return ret;
@@ -660,6 +747,7 @@
     HX_RELEASE(m_pProgressSink);
     HX_RELEASE(m_pThrottleMutex);
     HX_RELEASE(m_pDriveEvent);
+    HX_RELEASE(m_pCommonClassFactory);
     HX_RELEASE(m_pStartEvent);
     HX_RELEASE(m_pOpenEvent);
     HX_RELEASE(m_pFFDriverContext);
@@ -1344,25 +1432,33 @@
 STDMETHODIMP
 CDataTypeConverter::GetProperties(REF(IHXValues*) pOptions)
 {
-    
-    HX_RESULT res;
     HX_RESULT retVal = HXR_OK;
-    IHXBuffer* pType = NULL;
-    pOptions = NULL;
+    IHXCommonClassFactory* pCFF = NULL;
 
-    CreateValuesCCF(pOptions, m_pCommonClassFactory);
-    CreateStringBufferCCF(pType, "DTDRPlugin", m_pCommonClassFactory);
+    retVal = QueryInterface(IID_IHXCommonClassFactory, 
+			    (void**) &pCFF);
 
-    if (pOptions && SUCCEEDED(res) && pType)
-    {
-        pOptions->SetPropertyCString("PluginType", pType);
-    }
-    else
+    if (SUCCEEDED(retVal))
     {
-        retVal = HXR_OUTOFMEMORY;
+	IHXBuffer* pType = NULL;
+	pOptions = NULL;
+
+	CreateValuesCCF(pOptions, m_pCommonClassFactory);
+	CreateStringBufferCCF(pType, "DTDRPlugin", m_pCommonClassFactory);
+
+	if (pOptions && pType)
+	{
+	    pOptions->SetPropertyCString("PluginType", pType);
+	}
+	else
+	{
+	    retVal = HXR_OUTOFMEMORY;
+	}
+
+	HX_RELEASE(pType);
     }
 
-    HX_RELEASE(pType);
+    HX_RELEASE(pCFF);
     
     return retVal;
 }
@@ -1456,6 +1552,12 @@
 	*ppInterfaceObj = (IHXPluginProperties*)this;
 	return HXR_OK;
     }
+    else if (IsEqualIID(interfaceID, IID_IHXContextUser))
+    {
+	AddRef();
+	*ppInterfaceObj = (IHXContextUser*)this;
+	return HXR_OK;
+    }
     else if (IsEqualIID(interfaceID, IID_IHXDataTypeDriver2))
     {
 	AddRef();
@@ -1474,26 +1576,37 @@
 	*ppInterfaceObj = (IHXSetClientContext*)this;
 	return HXR_OK;
     }
-
-    else if (m_pClientContext &&
-	     m_pClientContext->QueryInterface(interfaceID, ppInterfaceObj) == HXR_OK)
+    // Provide the ffdriver's ihxscheduler to allow caller to schedule any
+    // source handlers on dtdriver's thread
+    else if (IsEqualIID(interfaceID, IID_IHXScheduler) && m_pFFDriver ) 
     {
-	return HXR_OK;
+	return m_pFFDriver->QueryInterface(interfaceID, ppInterfaceObj);
     }
-
-    //we have an internal implementation of CCF
     else if (m_pCommonClassFactory &&
+	     IsEqualIID(interfaceID, IID_IHXCommonClassFactory) &&
              m_pCommonClassFactory->QueryInterface(interfaceID, ppInterfaceObj) == HXR_OK)
     {
         return HXR_OK;
     }
-    
-    // provide the ffdriver's ihxscheduler 
-    else if (IsEqualIID(interfaceID, IID_IHXScheduler) && m_pFFDriver ) 
+#if defined(HELIX_CONFIG_DTDRPLIN_LOCAL_CCFACTORY)
+    else if (m_pCommonClassFactoryObject &&
+	     IsEqualIID(interfaceID, IID_IHXCommonClassFactory) &&
+             m_pCommonClassFactoryObject->QueryInterface(interfaceID, ppInterfaceObj) == HXR_OK)
     {
-	return m_pFFDriver->QueryInterface(interfaceID, ppInterfaceObj);
+        return HXR_OK;
     }
-
+#endif	// HELIX_CONFIG_DTDRPLIN_LOCAL_CCFACTORY
+    else if (m_pClientContext &&
+	     m_pClientContext->QueryInterface(interfaceID, ppInterfaceObj) == HXR_OK)
+    {
+	return HXR_OK;
+    }
+    else if (m_pContext &&
+	     m_pContext->QueryInterface(interfaceID, ppInterfaceObj) == HXR_OK)
+    {
+	return HXR_OK;
+    }
+    
     // No other interfaces are supported
     *ppInterfaceObj = NULL;
     return HXR_NOINTERFACE;

--- NEW FILE: dtdr_stdalone_dll ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

if "win" in sysinfo.family_list:
    # keep the 3260 name mangling stuff on windows
    project.DisableFeature('versioning_off')
    
project.AddSources('dtdrplin.cpp')

execfile("dtdr_genr_dll", globals())

project.AddModuleLibraries("datatype/tools/dtdriver/dtdrplin[dtdr_stdalone_lib]",
						   "datatype/tools/minicntx",
						   "client/medpltfm[hxmedpltfmlib]")

DLLTarget('dtdrplin')
DependTarget()

--- NEW FILE: dtdr_platform_dll_win.pcf ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

project.AddSources("platform/win/dllmain.cpp")


--- NEW FILE: dtdr_stdalone_dll_win.pcf ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

project.AddSources("platform/win/dllmain.cpp")


--- NEW FILE: dtdr_stdalone ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

MultiTargetMake("dtdr_stdalone_lib", "dtdr_stdalone_dll")


--- NEW FILE: hxmeddtdrpln.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: hxmeddtdrpln.cpp,v 1.1 2006/05/04 00:24:14 milko Exp $
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

/************************************************************************
 *  Includes
 */
#include "hxcom.h"
#include "hxtypes.h"
#include "ihxpckts.h"
#include "dllpath.h"
#include "hxmeddtdrpln.h"
#include "hxdtdr.h"
#include "hxver.h"
#include "pckunpck.h"

#include "dtdrplin.ver"

#include "datatypedr.h"


/************************************************************************
 *  Constants
 */
#ifdef _DEBUG
#undef HX_THIS_FILE		
static const char HX_THIS_FILE[] = __FILE__;
#endif

const char* const CHXDatatypeDriverPlugin::zm_pDescription = "Helix Datatype Driver Component Plugin";
const char* const CHXDatatypeDriverPlugin::zm_pCopyright   = HXVER_COPYRIGHT;
const char* const CHXDatatypeDriverPlugin::zm_pMoreInfoURL  = "http://www.real.com";

ENABLE_DLLACCESS_PATHS(HXDatatypeDriverPlugin);


/****************************************************************************
 * 
 *  Function:
 * 
 *	HXCreateInstance()
 * 
 *  Purpose:
 * 
 *	Function implemented by all plugin DLL's to create an instance of 
 *	any of the objects supported by the DLL. This method is similar to 
 *	Window's CoCreateInstance() in its purpose, except that it only 
 *	creates objects from this plugin DLL.
 *
 *	NOTE: Aggregation is never used. Therefore and outer unknown is
 *	not passed to this function, and you do not need to code for this
 *	situation.
 * 
 */

STDAPI ENTRYPOINT(HXCREATEINSTANCE)
(
    IUnknown**  /*OUT*/	ppIUnknown
)
{
    *ppIUnknown = (IUnknown*)(IHXPlugin*)new CHXDatatypeDriverPlugin();
    if (*ppIUnknown)
    {
	(*ppIUnknown)->AddRef();
	return HXR_OK;
    }
    return HXR_OUTOFMEMORY;
}

STDAPI ENTRYPOINT(CanUnload2)(void)
{
    return (CHXBaseCountingObject::ObjectsActive() ? HXR_FAIL : HXR_OK);
}

CHXDatatypeDriverPlugin::CHXDatatypeDriverPlugin()
		       :m_pCCF(NULL)
		       ,m_lRefCount(0)
{
    ;
}

CHXDatatypeDriverPlugin::~CHXDatatypeDriverPlugin()
{
    HX_RELEASE(m_pCCF);
}

STDMETHODIMP
CHXDatatypeDriverPlugin::QueryInterface(REFIID riid, void** ppvObj)
{
    if(IsEqualIID(riid, IID_IUnknown))
    {
	AddRef();
	*ppvObj = (IUnknown*)(IHXPlugin*)this;
	return HXR_OK;
    }
    else if(IsEqualIID(riid, IID_IHXPlugin))
    {
	AddRef();
	*ppvObj = (IHXPlugin*)this;
	return HXR_OK;
    }
    else if(IsEqualIID(riid, IID_IHXComponentPlugin))
    {
	AddRef();
	*ppvObj = (IHXComponentPlugin*)this;
	return HXR_OK;
    }

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}

STDMETHODIMP_(ULONG32)
CHXDatatypeDriverPlugin::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

STDMETHODIMP_(ULONG32)
CHXDatatypeDriverPlugin::Release()
{ 
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}
    
STDMETHODIMP
CHXDatatypeDriverPlugin::InitPlugin(IUnknown* pContext)
{
    return pContext->QueryInterface(IID_IHXCommonClassFactory, (void**) &m_pCCF);
}

STDMETHODIMP
CHXDatatypeDriverPlugin::GetPluginInfo(REF(HXBOOL)      bMultipleLoad,
				      REF(const char*) pDescription,
				      REF(const char*) pCopyright,
				      REF(const char*) pMoreInfoURL,
				      REF(ULONG32)     ulVersionNumber)
{
    bMultipleLoad = TRUE;

    pDescription = zm_pDescription;
    pCopyright   = zm_pCopyright;
    pMoreInfoURL = zm_pMoreInfoURL;
    ulVersionNumber = TARVER_ULONG32_VERSION;

    return HXR_OK;
}

STDMETHODIMP_(UINT32)
CHXDatatypeDriverPlugin::GetNumComponents(void)
{
    // CLSID_IHXDataTypeDriver
    return 1;
}

STDMETHODIMP_(char const*)
CHXDatatypeDriverPlugin::GetPackageName(void) CONSTMETHOD
{
    return zm_pDescription;
}

STDMETHODIMP
CHXDatatypeDriverPlugin::GetComponentInfoAtIndex(UINT32		/*IN*/  nIndex,
						REF(IHXValues*) /*OUT*/ pInfo)
{
    HX_RESULT	rc = HXR_OK;
    IUnknown*	pUnknown = NULL;

    pInfo = NULL;

    if (nIndex != 0 || !m_pCCF)
    {
	return HXR_FAILED;
    }

    rc = m_pCCF->CreateInstance(CLSID_IHXValues, (void**) &pUnknown);

    if (SUCCEEDED(rc))
    {
	rc = pUnknown->QueryInterface(IID_IHXValues, (void**)&pInfo);
    }

    if (SUCCEEDED(rc))
    {
	rc = SetBufferPropertyCCF(pInfo, 
				  PLUGIN_COMPONENT_CLSID, 
				  (BYTE*)&CLSID_IHXDataTypeDriver, 
				  sizeof(GUID),
				  m_pCCF);
    }

exit:
    HX_RELEASE(pUnknown);

    return rc;
}

STDMETHODIMP
CHXDatatypeDriverPlugin::CreateComponentInstance(REFCLSID	    /*IN*/  rclsid,
						REF(IUnknown*)	    /*OUT*/ ppUnknown,
						IUnknown*	    /*IN*/  pUnkOuter)
{
    CDataTypeConverter* pDTConverter = NULL;
    ppUnknown = NULL;

    if (IsEqualCLSID(rclsid, CLSID_IHXDataTypeDriver))
    {
	pDTConverter = new CDataTypeConverter();
	if (!pDTConverter)
	{
	    return HXR_OUTOFMEMORY;
	}

	return pDTConverter->QueryInterface(IID_IUnknown, (void**)&ppUnknown);
    }
    else
    {
	return HXR_NOTIMPL;
    }
}



From milko at helixcommunity.org  Wed May  3 17:28:51 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 19:21:56 2006
Subject: [Datatype-cvs] tools/dtdriver/engine/pub ffdriver.h,1.22,1.23
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/engine/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv11726/pub

Modified Files:
	ffdriver.h 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


Index: ffdriver.h
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/pub/ffdriver.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- ffdriver.h	19 Aug 2005 02:18:14 -0000	1.22
+++ ffdriver.h	4 May 2006 00:28:49 -0000	1.23
@@ -54,6 +54,7 @@
 #define RATEMODEINTERVAL_OPTION_NAME "RateModeInterval"
 #define TIMER_OPTION_NAME	    "Timer"
 #define PASSSWOFFPKTS_OPTION_NAME   "PassSwitchOffPackets"
+#define USETEMPFILES_OPTION_NAME    "UseTempFiles"
 #define QUIET_OPTION_NAME           "Quiet"
 #define JUMPSTART_OPTION_NAME	    "StartTime"
 #define PROCESSUNTIL_OPTION_NAME    "ProcessUntil"
@@ -157,7 +158,7 @@
 		   IHXFileWriter* pFileWriter = NULL,
 		   IHXSourceHandler** pSourceHandlerList = NULL,
 		   IHXFileWriterMonitor* pFileWriterMonitor = NULL);
-    void Close(void);
+    void Close(HXBOOL bCompleteShutdown = TRUE);
     void Stop(void);
     HX_RESULT InitContext(HXBOOL bPersistentContext = FALSE, 
                           char* pCompanyName = 0, 
@@ -423,7 +424,6 @@
     enum ProcState
     {
 	State_Initializing,
-	State_InternalizeSource,
 	State_InitContext,
 	State_FindFileSystem,
 	State_FindFileFormats,
@@ -457,6 +457,9 @@
 	State_DriveDone
     };
 
+    HX_RESULT BuildStubFileHeader(IHXValues* &pHeader, UINT16 uStreamCount = 1);
+    HX_RESULT BuildStubStreamHeader(UINT16 uStream, IHXValues* &pHeader);
+
     HX_RESULT	InternalizeSource(char *pInputFileName);
     HX_RESULT	InternalizeSourceHandlerList(IHXSourceHandler** pSourceHandlerList);
     HX_RESULT	CreateWriterProps(IHXValues* &pWriterProps);
@@ -555,6 +558,7 @@
     ProcState               m_state;
     HX_RESULT               m_status;
     char*		    m_pInputFileName;
+    char*		    m_pInputURL;
     char*		    m_pWriteFileName;
     char*		    m_pTempDirName;
     char*		    m_pInputFileProtocol;


From milko at helixcommunity.org  Wed May  3 17:28:51 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 19:21:56 2006
Subject: [Datatype-cvs] tools/dtdriver/engine ffdriver.cpp,1.28,1.29
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv11726

Modified Files:
	ffdriver.cpp 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


Index: ffdriver.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/ffdriver.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- ffdriver.cpp	10 Feb 2006 17:30:12 -0000	1.28
+++ ffdriver.cpp	4 May 2006 00:28:48 -0000	1.29
@@ -244,6 +244,7 @@
     , m_state(State_Initializing)
     , m_status(HXR_OK)
     , m_pInputFileName(NULL)
+    , m_pInputURL(NULL)
     , m_pWriteFileName(NULL)
     , m_pTempDirName(NULL)
     , m_pInputFileProtocol(NULL)
@@ -283,24 +284,16 @@
 
 FFDriver::~FFDriver()
 {
-    Close();
-
-    HX_RELEASE(m_pClientContext);
-    HX_RELEASE(m_pErrorMessages);
-
-    if (m_pContext)
-    {
-        m_pContext->Close();
-        HX_RELEASE(m_pContext);
-    }
+    Close(TRUE);
 }
 
 
-void FFDriver::Close()
+void FFDriver::Close(HXBOOL bCompleteShutdown)
 {
     HX_VECTOR_DELETE(m_pTempDirName);
     HX_VECTOR_DELETE(m_pWriteFileName);
     HX_VECTOR_DELETE(m_pInputFileName);
+    HX_VECTOR_DELETE(m_pInputURL);
     HX_VECTOR_DELETE(m_pInputFileProtocol);
     HX_VECTOR_DELETE(m_pInputFileSysShortName);
     HX_VECTOR_DELETE(m_pMemProbeArray);
@@ -327,7 +320,6 @@
     HX_RELEASE(m_pOptions);
     HX_RELEASE(m_pFileObject);
     HX_RELEASE(m_pFileSystem);
-    HX_RELEASE(m_pScheduler);
 
     HX_RELEASE(m_pTimerCallback);
 
@@ -346,11 +338,17 @@
     m_ulMediaSize = 0;
 
     // Context must be the last object to close
-    if (m_pContext && !m_bPersistentContext)
+    if (bCompleteShutdown || !m_bPersistentContext)
     {
-        HX_RELEASE(m_pErrorMessages);
-        m_pContext->Close();
-        HX_RELEASE(m_pContext);
+	HX_RELEASE(m_pScheduler);
+	HX_RELEASE(m_pClientContext);
+	HX_RELEASE(m_pErrorMessages);
+
+	if (m_pContext)
+	{
+	    m_pContext->Destruct();
+	    m_pContext = NULL;
+	}
     }
 }
 
@@ -376,7 +374,7 @@
     HX_RESULT RetVal = HXR_OK;
 
     /* Reset */
-    Close();
+    Close(FALSE);
 
     /* open the output file */
     if (pOutputFileName)
@@ -702,6 +700,7 @@
 
     HX_RELEASE(m_pSourceHandlerStack);
     HX_VECTOR_DELETE(m_pInputFileName);
+    HX_VECTOR_DELETE(m_pInputURL);
     HX_VECTOR_DELETE(m_pInputFileProtocol);
     HX_VECTOR_DELETE(m_pInputFileSysShortName);
     HX_RELEASE(m_pFileSystem);
@@ -721,11 +720,6 @@
     m_status = HXR_OK;
     FlushWriterPacketQueue();
 
-    if (pInputFileName == NULL)
-    {
-        return HXR_FAIL;
-    }
-
     if (pWriteFileName)
     {
         HX_VECTOR_DELETE(m_pWriteFileName);
@@ -739,7 +733,7 @@
     }
 
     /* Drive The File Format */
-    m_state = State_InternalizeSource;
+    m_state = State_InitContext;
 
     while ((m_state != State_DriveDone) && SUCCEEDED(m_status))
     {
@@ -767,18 +761,14 @@
                 }
                 break;
 
-            case State_InternalizeSource:
-                m_status = InternalizeSource(pInputFileName);
-                m_state = State_InitContext;
-                LogHeader(FILE_KEY);
+            case State_InitContext:
+		LogHeader(FILE_KEY);
                 LogHeader(  FILE_KEY, "Begin File=%s Protocol=%s ShortName=%s", 
-                    m_pInputFileName,
+                    m_pInputFileName ? m_pInputFileName : "NULL",
                     (m_pInputFileProtocol == NULL) ? DFLT_PROTOCOL_NAME : m_pInputFileProtocol,
                     (m_pInputFileSysShortName == NULL) ? DFLT_SYSSHORT_NAME : m_pInputFileSysShortName);
                 LogHeader(FILE_KEY);
-                break;
 
-            case State_InitContext:
                 MEMPROBE_RESET(MEMPRB_TOTAL);
                 MEMPROBE_RESET(MEMPRB_CONTEXTINIT);
                 status = InitContext(FALSE, // not persistent context
@@ -787,6 +777,12 @@
                                      DTDRIVE_PRODUCT_MAJOR_VER,
                                      DTDRIVE_PRODUCT_MINOR_VER);
 
+		if (SUCCEEDED(status))
+                {
+		    m_status = InternalizeSource(pInputFileName);
+		    m_state = State_InitContext;
+		}
+
                 if (SUCCEEDED(status))
                 {
                     status = ConfigureDecodePosition();
@@ -811,29 +807,35 @@
             case State_FindFileSystem:
                 MEMPROBE_RESET(MEMPRB_FILESYSTOTAL);
                 MEMPROBE_RESET(MEMPRB_FILESYSCREATE);
-                status = m_pContext->FindFileSystem(m_pFileSystem, m_pInputFileProtocol, m_pInputFileSysShortName);
-                if (SUCCEEDED(m_status))
-                {
-                    m_status = status;
-                    if (FAILED(status))
-                    {
-                        ReportError(status, 
-                            "Failed to find file system for designated protocol (%s) and shortname (%s)", 
-                            (m_pInputFileProtocol == NULL) ? DFLT_PROTOCOL_NAME : m_pInputFileProtocol,
-                            (m_pInputFileSysShortName == NULL) ? DFLT_SYSSHORT_NAME : m_pInputFileSysShortName);
-                    }
-                }
+                if (m_pInputFileName)
+		{
+		    status = m_pContext->FindFileSystem(m_pFileSystem, m_pInputFileProtocol, m_pInputFileSysShortName);
+		    if (SUCCEEDED(m_status))
+		    {
+			m_status = status;
+			if (FAILED(status))
+			{
+			    ReportError(status, 
+				"Failed to find file system for designated protocol (%s) and shortname (%s)", 
+				(m_pInputFileProtocol == NULL) ? DFLT_PROTOCOL_NAME : m_pInputFileProtocol,
+				(m_pInputFileSysShortName == NULL) ? DFLT_SYSSHORT_NAME : m_pInputFileSysShortName);
+			}
+		    }
+		}
                 MEMPROBE_FREEZE(MEMPRB_FILESYSCREATE);
                 m_state = State_InitFileSystem;
                 break;
 
             case State_InitFileSystem:
                 MEMPROBE_RESET(MEMPRB_FILESYSINIT);
-                status = m_pContext->InitFileSystem(m_pFileSystem);
-                if (SUCCEEDED(m_status))
-                {
-                    m_status = status;
-                }
+                if (m_pFileSystem)
+		{
+		    status = m_pContext->InitFileSystem(m_pFileSystem);
+		    if (SUCCEEDED(m_status))
+		    {
+			m_status = status;
+		    }
+		}
                 MEMPROBE_FREEZE(MEMPRB_FILESYSINIT);
                 m_state = State_InitFileObject;
                 break;
@@ -847,10 +849,17 @@
                 MEMPROBE_RESET(MEMPRB_FILEOBJTOTAL);
                 MEMPROBE_RESET(MEMPRB_FILEOBJINIT);
                 m_state = State_InitFileObjectDonePending;
-                status = m_pContext->InitFileObject(m_pFileObject,
-                                m_pFileSystem,
-                                (IHXFileResponse *) this,
-                                m_pInputFileName);
+                if (m_pFileSystem)
+		{
+		    status = m_pContext->InitFileObject(m_pFileObject,
+				    m_pFileSystem,
+				    (IHXFileResponse *) this,
+				    m_pInputURL);
+		}
+		else
+		{
+		    status = InitDone(HXR_OK);
+		}
                 if (SUCCEEDED(m_status))
                 {
                     m_status = status;
@@ -865,9 +874,13 @@
             case State_FindFileFormats:
                 MEMPROBE_RESET(MEMPRB_FORMATTOTAL);
                 MEMPROBE_RESET(MEMPRB_FORMATCREATE);
-                status = m_pContext->FindFileFormat(m_pFileFormat, 
-                                m_pInputFileName,
-                                m_ulFormatAttemptCount);
+                status = HXR_OK;
+		if (m_pInputFileName)
+		{
+		    status = m_pContext->FindFileFormat(m_pFileFormat, 
+				    m_pInputURL,
+				    m_ulFormatAttemptCount);
+		}
                 if (SUCCEEDED(m_status))
                 {
                     m_status = status;
@@ -934,10 +947,17 @@
                 MEMPROBE_RESET(MEMPRB_FORMATINIT);
                 m_state = State_InitFileFormatDonePending;
                 SNAPSHOT(pTimePointArray, TIMEPT_FILEINIT_START);
-                status = m_pContext->InitFileFormat(m_pFileFormat, 
-                                m_pFileObject, 
-                                (IHXFormatResponse *) this, 
-                                m_pInputFileName);
+                if (m_pFileFormat)
+		{
+		    status = m_pContext->InitFileFormat(m_pFileFormat, 
+				    m_pFileObject, 
+				    (IHXFormatResponse *) this, 
+				    m_pInputURL);
+		}
+		else
+		{
+		    status = InitDone(HXR_OK);
+		}
                 if (SUCCEEDED(m_status))
                 {
                     if (FAILED(status))
@@ -1005,7 +1025,20 @@
                 MEMPROBE_RESET(MEMPRB_FILEHDR);
                 m_state = State_FileHeaderDonePending;
                 SNAPSHOT(pTimePointArray, TIMEPT_FILEHDR_START);
-                status = m_pFileFormat->GetFileHeader();
+                if (m_pFileFormat)
+		{
+		    status = m_pFileFormat->GetFileHeader();
+		}
+		else
+		{
+		    IHXValues* pHeader = NULL;
+		    status = BuildStubFileHeader(pHeader);
+		    if (SUCCEEDED(status))
+		    {
+			status = FileHeaderReady(HXR_OK, pHeader);
+		    }
+		    HX_RELEASE(pHeader);
+		}
                 if (SUCCEEDED(m_status))
                 {
                     if (FAILED(status))
@@ -1057,7 +1090,20 @@
                 SNAPSHOT(pTimePointArray, TIMEPT_STRMHDRS_START);
                 for (iStream = 0; SUCCEEDED(m_status) && (iStream < m_uStreamCount); iStream++)
                 {
-                    status = m_pFileFormat->GetStreamHeader(iStream);
+		    if (m_pFileFormat)
+		    {
+			status = m_pFileFormat->GetStreamHeader(iStream);
+		    }
+		    else
+		    {
+			IHXValues* pHeader = NULL;
+			status = BuildStubStreamHeader(iStream, pHeader);
+			if (SUCCEEDED(status))
+			{
+			    status = StreamHeaderReady(HXR_OK, pHeader);
+			}
+			HX_RELEASE(pHeader);
+		    }
                     if (SUCCEEDED(m_status))
                     {
                         m_status = status;
@@ -1080,7 +1126,14 @@
 
             case State_Seek:
                 m_state = State_SeekDonePending;
-                status = m_pFileFormat->Seek(m_ulStartTime);
+                if (m_pFileFormat)
+		{
+		    status = m_pFileFormat->Seek(m_ulStartTime);
+		}
+		else
+		{
+		    status = SeekDone(HXR_OK);
+		}
                 if (SUCCEEDED(m_status))
                 {
                     m_status = status;
@@ -1150,7 +1203,11 @@
 
                 HX_RELEASE(m_pFileHeader);
 
-                status = m_pFileFormat->Close();
+		status = HXR_OK;
+		if (m_pFileFormat)
+		{
+		    status = m_pFileFormat->Close();
+		}
                 if (SUCCEEDED(m_status))
                 {
                     m_status = status;
@@ -1172,8 +1229,11 @@
 
                 MEMPROBE_FREEZE(MEMPRB_FORMATTOTAL);
 
-                m_pFileObject->Close();
-                HX_RELEASE(m_pFileObject);
+		if (m_pFileObject)
+		{
+		    m_pFileObject->Close();
+		    HX_RELEASE(m_pFileObject);
+		}
                 MEMPROBE_FREEZE(MEMPRB_FILEOBJTOTAL);
 
                 HX_RELEASE(m_pFileSystem);
@@ -1186,9 +1246,13 @@
                 HX_RELEASE(m_pScheduler);
                 if (MEMORY_TRACKING_NEEDED && !m_bPersistentContext)
                 {
+		    HX_RELEASE(m_pScheduler);
                     HX_RELEASE(m_pErrorMessages);
-                    m_pContext->Close();
-                    HX_RELEASE(m_pContext);
+		    if (m_pContext)
+		    {
+			m_pContext->Destruct();
+			m_pContext = NULL;
+		    }
                 }
 
                 MEMPROBE_FREEZE(MEMPRB_TOTAL);
@@ -1205,7 +1269,7 @@
 
             case State_EndFile:
                 LogHeader(  FILE_KEY, "End File=%s Protocol=%s ShortName=%s", 
-                    m_pInputFileName,
+                    m_pInputFileName ? m_pInputFileName : "NULL",
                     (m_pInputFileProtocol == NULL) ? DFLT_PROTOCOL_NAME : m_pInputFileProtocol,
                     (m_pInputFileSysShortName == NULL) ? DFLT_SYSSHORT_NAME : m_pInputFileSysShortName);
                 LogHeader(FILE_KEY);
@@ -1225,6 +1289,82 @@
 
 
 /****************************************************************************
+ *  Build Stub File and Source header utility method.
+ *  Stub headers are used to kick-off the source handler chain in case when
+ *  file format is not used.
+ */
+ HX_RESULT FFDriver::BuildStubFileHeader(IHXValues* &pHeader, UINT16 uStreamCount)
+{
+    IHXValues* pNewHeader = NULL;
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (m_pContext)
+    {
+        retVal = HXR_OK;
+    }
+
+    retVal = CreateValuesCCF(pNewHeader, (IUnknown*) (IHXPlayer*) m_pContext);
+    
+    if (SUCCEEDED(retVal))
+    {
+        retVal = pNewHeader->SetPropertyULONG32("StreamCount", (ULONG32) uStreamCount);
+    }
+
+    if (SUCCEEDED(retVal))
+    {
+	pHeader = pNewHeader;
+	pNewHeader = NULL;
+    }
+
+    HX_RELEASE(pNewHeader);
+
+    return retVal;
+}
+
+
+/****************************************************************************
+ *  Build Stub File and Source header utility method.
+ *  Stub headers are used to kick-off the source handler chain in case when
+ *  file format is not used.
+ */
+HX_RESULT FFDriver::BuildStubStreamHeader(UINT16 uStream, IHXValues* &pHeader)
+{
+    IHXValues* pNewHeader = NULL;
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (m_pContext)
+    {
+        retVal = HXR_OK;
+    }
+
+    retVal = CreateValuesCCF(pNewHeader, (IUnknown*) (IHXPlayer*) m_pContext);
+
+    if (SUCCEEDED(retVal))
+    {
+        retVal = pNewHeader->SetPropertyULONG32("StreamNumber", (ULONG32) uStream);
+    }
+
+    if (SUCCEEDED(retVal))
+    {
+	retVal = SetCStringPropertyCCF(pNewHeader,
+				       "MimeType",
+				       "application/X-HX-EMPTY-STREAM",
+				       (IUnknown*) (IHXPlayer*) m_pContext);
+    }
+
+    if (SUCCEEDED(retVal))
+    {
+	pHeader = pNewHeader;
+	pNewHeader = NULL;
+    }
+
+    HX_RELEASE(pNewHeader);
+
+    return retVal;
+}
+
+
+/****************************************************************************
  *  Internalize the File protocol name and file name:
  *  Expected input format: [[,]://]
  *  Note: FSName = "short name"
@@ -1238,9 +1378,15 @@
     HX_RESULT retVal = HXR_OK;
 
     HX_VECTOR_DELETE(m_pInputFileName);
+    HX_VECTOR_DELETE(m_pInputURL);
     HX_VECTOR_DELETE(m_pInputFileProtocol);
     HX_VECTOR_DELETE(m_pInputFileSysShortName);
 
+    if (!pInputFileName)
+    {
+	return HXR_OK;
+    }
+
     pChar2 = strchr(pInputFileName, ':');
     
     if (pChar2 == NULL)
@@ -1256,18 +1402,18 @@
         {
             // file:// form
             pChar3 += 2;
-        }
+	}
 
-    pChar1 = strchr(pInputFileName, ',');
+	pChar1 = strchr(pInputFileName, ',');
 
-    if ((pChar1 == NULL) || (pChar1 >= pChar2))
-    {
-        pChar1 = pInputFileName;
-    }
-    else
-    {
-        pChar1++;
-    }
+	if ((pChar1 == NULL) || (pChar1 >= pChar2))
+	{
+	    pChar1 = pInputFileName;
+	}
+	else
+	{
+	    pChar1++;
+	}
     }
 
     // Extract protocol
@@ -1299,6 +1445,25 @@
         strncpy(m_pInputFileSysShortName, pInputFileName, lStringLength); /* Flawfinder: ignore */
         m_pInputFileSysShortName[lStringLength] = '\0';
     }
+    
+    // Extract URL
+    lStringLength = strlen(pChar1);
+
+    if (lStringLength > 0)
+    {
+	m_pInputURL = new char[lStringLength + 1];
+	if (m_pInputURL == NULL)
+	{
+	    return HXR_OUTOFMEMORY;
+	}
+
+	strcpy(m_pInputURL, pChar1); /* Flawfinder: ignore */
+    }
+
+    if (m_pInputURL == NULL)
+    {
+	return HXR_FAIL;
+    }
 
     // Extract File Name
     lStringLength = strlen(pChar3);
@@ -1602,6 +1767,15 @@
 
     if (SUCCEEDED(retVal))
     {
+	ULONG32 ulUseTempFiles = 0;
+	if (SUCCEEDED(m_pOptions->GetPropertyULONG32(USETEMPFILES_OPTION_NAME, ulUseTempFiles)))
+	{
+	    retVal = pNewProps->SetPropertyULONG32("UseTempFiles", ulUseTempFiles);
+	}
+    }
+
+    if (SUCCEEDED(retVal))
+    {
         if (m_pTempDirName)
         {
             IHXBuffer* pTempDirBuffer = NULL;
@@ -1653,14 +1827,19 @@
     //re-use context if we already have one
     if (m_pContext == NULL)    
     {
+	RetVal = HXR_OUTOFMEMORY;
         m_pContext = new MiniContext;
-        if (m_pContext == NULL)
-        {
-            RetVal = HXR_OUTOFMEMORY;
-        }
-        else
+        if (m_pContext)
         {
-            m_pContext->AddRef();
+	    // We must initialize before AddRef to allow
+	    // context to aggregate itself into the client
+	    // context.
+	    RetVal = m_pContext->Construct(m_uServerMode, 
+					   pCompanyName, 
+					   pProductName, 
+					   nMajVer, 
+					   nMinVer,
+					   m_pClientContext);
         }
 
         if (SUCCEEDED(RetVal))
@@ -1668,13 +1847,6 @@
             HX_RELEASE(m_pErrorMessages);
             m_pContext->QueryInterface(IID_IHXErrorMessages,
                                        (void**) &m_pErrorMessages);
-
-            RetVal = m_pContext->Init(m_uServerMode, 
-                                      pCompanyName, 
-                                      pProductName, 
-                                      nMajVer, 
-                                      nMinVer,
-                                      m_pClientContext);
         }
     }
 
@@ -1939,7 +2111,7 @@
         retVal = HXR_OK;
     }
 
-    retVal = HXASMGetSourceBwThresholdInfo(m_pClientContext,
+    retVal = HXASMGetSourceBwThresholdInfo((IUnknown*)(IHXPlayer*) m_pContext,
 					   m_pSourceHeaders,
                                            m_uStreamHeaders + 1,
                                            NULL, 
@@ -1965,7 +2137,7 @@
     
     if (SUCCEEDED(retVal))
     {
-        retVal = HXASMGetSourceBwThresholdInfo(m_pClientContext,
+        retVal = HXASMGetSourceBwThresholdInfo((IUnknown*)(IHXPlayer*) m_pContext,
 					       m_pSourceHeaders,
                                                m_uStreamHeaders + 1,
                                                m_pBwThresholds, 
@@ -1979,7 +2151,7 @@
 
     // Set the bandwidth thresholds index based on set bandwidth
     for (m_lBwThresholdIdx = 1; 
-         m_lBwThresholdIdx < m_ulNumBwThresholds; 
+         ((ULONG32) m_lBwThresholdIdx) < m_ulNumBwThresholds; 
          m_lBwThresholdIdx++)
     {
         if (m_uBandwidth < m_pBwThresholds[m_lBwThresholdIdx])
@@ -2022,7 +2194,7 @@
                         m_lBwThresholdIdx = m_lNextBwThresholdIdx;
                         m_lNextBwThresholdIdx++;
             
-                        if ((m_lNextBwThresholdIdx >= m_ulNumBwThresholds) ||
+                        if ((m_lNextBwThresholdIdx >= ((LONG32) m_ulNumBwThresholds)) ||
                             ((m_ulMaxBwThreshold != 0) &&
                              (m_ulMaxBwThreshold < ((UINT32) m_pBwThresholds[m_lNextBwThresholdIdx]))))
                         {
@@ -2063,7 +2235,7 @@
                             // Change direction
                             m_lNextBwThresholdIdx += 2;
             
-                            if (m_lNextBwThresholdIdx >= m_ulNumBwThresholds)
+                            if (m_lNextBwThresholdIdx >= ((LONG32) m_ulNumBwThresholds))
                             {
                                 m_lNextBwThresholdIdx = m_ulNumBwThresholds - 1;
                             }
@@ -2141,11 +2313,15 @@
             m_ulCurrentBw = ulBandwidth;
         }
 
-        res = HXASMSubscribeSourceToBandwidth(m_pSourceHeaders,
-                              m_uStreamHeaders + 1,
-                              ulBandwidth,
-                              m_pFileFormat,
-                              bSubscribe);
+	if (m_pFileFormat)
+	{
+	    res = HXASMSubscribeSourceToBandwidth((IUnknown*)(IHXPlayer*) m_pContext,
+						  m_pSourceHeaders,
+						  m_uStreamHeaders + 1,
+						  ulBandwidth,
+						  m_pFileFormat,
+						  bSubscribe);
+	}
     }
 
     return res;
@@ -2191,13 +2367,13 @@
         res = pHeader->GetPropertyULONG32("StreamNumber", ulStreamNumber);
     }
 
-    if (SUCCEEDED(res))
+    if (SUCCEEDED(res) && m_pFileFormat)
     {
         res = m_pFileFormat->QueryInterface(IID_IHXASMSource, (void**) &pASMSource);
     }
     
     /* count the number of rules */
-    if (SUCCEEDED(res))
+    if (SUCCEEDED(res) && pASMSource)
     {
         UINT16 uNumRules = 0;
         UINT16 iRule;
@@ -2285,7 +2461,14 @@
             m_pPacketProbeArray[iStream].Reset();
         }
 
-        m_pFileFormat->GetPacket(iStream);
+	if (m_pFileFormat)
+	{
+	    m_pFileFormat->GetPacket(iStream);
+	}
+	else
+	{
+	    StreamDone(iStream);
+	}
     }
 
     return HXR_OK;
@@ -2790,7 +2973,7 @@
 
     LogHeader(TIMING_KEY);
     LogHeader(  TIMING_KEY, "Begin Timing Report (File=%s, Protocol=%s, ShortName=%s)", 
-        m_pInputFileName, 
+        m_pInputFileName ? m_pInputFileName : "NULL",
         (m_pInputFileProtocol == NULL) ? DFLT_PROTOCOL_NAME : m_pInputFileProtocol,
         (m_pInputFileSysShortName == NULL) ? DFLT_SYSSHORT_NAME : m_pInputFileSysShortName);
     LogHeader(TIMING_KEY);
@@ -2837,7 +3020,7 @@
     }
 
     LogHeader( TIMING_KEY, "End Timing Report (File=%s, Protocol=%s, ShortName=%s)", 
-                m_pInputFileName, 
+                m_pInputFileName ? m_pInputFileName : "NULL",
                 (m_pInputFileProtocol == NULL) ? DFLT_PROTOCOL_NAME : m_pInputFileProtocol,
                 (m_pInputFileSysShortName == NULL) ? DFLT_SYSSHORT_NAME : m_pInputFileSysShortName);
     LogHeader(TIMING_KEY);
@@ -2853,7 +3036,7 @@
 
     LogHeader(MEMORY_KEY);
     LogHeader(  MEMORY_KEY, "Begin Heap Usage Report (File=%s, Protocol=%s, ShortName=%s)", 
-                m_pInputFileName, 
+                m_pInputFileName ? m_pInputFileName : "NULL",
                 (m_pInputFileProtocol == NULL) ? DFLT_PROTOCOL_NAME : m_pInputFileProtocol,
                 (m_pInputFileSysShortName == NULL) ? DFLT_SYSSHORT_NAME : m_pInputFileSysShortName);
     LogHeader(MEMORY_KEY);
@@ -2976,7 +3159,7 @@
     }
 
     LogHeader( MEMORY_KEY, "End Heap Usage Report (File=%s, Protocol=%s, ShortName=%s)", 
-                m_pInputFileName, 
+                m_pInputFileName ? m_pInputFileName : "NULL",
                 (m_pInputFileProtocol == NULL) ? DFLT_PROTOCOL_NAME : m_pInputFileProtocol,
                 (m_pInputFileSysShortName == NULL) ? DFLT_SYSSHORT_NAME : m_pInputFileSysShortName);
     LogHeader(MEMORY_KEY);
@@ -2992,7 +3175,7 @@
 
     LogHeader(EVENT_KEY);
     LogHeader(EVENT_KEY, "Event Data (File=%s, Protocol=%s, ShortName=%s)", 
-                m_pInputFileName, 
+                m_pInputFileName ? m_pInputFileName : "NULL",
                 (m_pInputFileProtocol == NULL) ? DFLT_PROTOCOL_NAME : m_pInputFileProtocol,
                 (m_pInputFileSysShortName == NULL) ? DFLT_SYSSHORT_NAME : m_pInputFileSysShortName);
     LogHeader(EVENT_KEY);
@@ -3003,7 +3186,7 @@
     Log("   Get Packet Events |           %10lu\n", m_ulGetPacketEvents);
 
     LogHeader( EVENT_KEY, "End Event Data (File=%s, Protocol=%s, ShortName=%s)", 
-                m_pInputFileName, 
+                m_pInputFileName ? m_pInputFileName : "NULL",
                 (m_pInputFileProtocol == NULL) ? DFLT_PROTOCOL_NAME : m_pInputFileProtocol,
                 (m_pInputFileSysShortName == NULL) ? DFLT_SYSSHORT_NAME : m_pInputFileSysShortName);
     LogHeader(EVENT_KEY);
@@ -3015,17 +3198,14 @@
  */
 STDMETHODIMP FFDriver::InitDone(HX_RESULT status)
 {
-    if (m_pInputFileName == NULL)
-    {
-        return HXR_UNEXPECTED;
-    }
-
     switch (m_state)
     {
         case State_InitFileObjectDonePending:
             if (FAILED(status))
             {
-                ReportError(status, "Failed to open input file: %s", m_pInputFileName);
+                ReportError(status, 
+			    "Failed to open input file: %s",
+			    m_pInputFileName ? m_pInputFileName : "NULL");
                 m_status = status;
             }
             m_state = State_InitFileObjectDone;
@@ -4105,6 +4285,15 @@
         *ppvObj = (IHXFileResponse*)this;
         return HXR_OK;
     }
+    else if (IsEqualIID(riid, IID_IHXScheduler))
+    {
+	if (m_pScheduler)
+	{
+	    AddRef();
+	    *ppvObj = m_pScheduler;
+	    return HXR_OK;
+	}
+    }
     else if (m_pContext && m_pContext->QueryInterface(riid, ppvObj) == HXR_OK)
     {
         return HXR_OK;


From milko at helixcommunity.org  Wed May  3 17:29:39 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 19:22:44 2006
Subject: [Datatype-cvs] tools/minicntx/pub minicntx.h,1.10,1.11
Message-ID: 

Update of /cvsroot/datatype/tools/minicntx/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv11995/pub

Modified Files:
	minicntx.h 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


Index: minicntx.h
===================================================================
RCS file: /cvsroot/datatype/tools/minicntx/pub/minicntx.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- minicntx.h	14 Mar 2005 19:24:56 -0000	1.10
+++ minicntx.h	4 May 2006 00:29:37 -0000	1.11
@@ -43,7 +43,10 @@
 #include "hxcom.h"
 #include "ihxpckts.h"
 #include "hxerror.h"
+#include "ihxmedpltfm.h"
 #include "hxcore.h"
+#include "hxprefs.h"
+#include "unkimp.h"
 
 
 /****************************************************************************
@@ -59,28 +62,15 @@
 typedef _INTERFACE IHXPropertyAdviser	    IHXPropertyAdviser;
 typedef _INTERFACE IHXCommonClassFactory    IHXCommonClassFactory;
 typedef _INTERFACE IHXExternalResourceManager IHXExternalResourceManager;
+typedef _INTERFACE IHXPluginHandler3	    IHXPluginHandler3;
+typedef _INTERFACE IHXScheduler2	    IHXScheduler2;
 
 
-class HXCommonClassFactory;
-class HXPreferences;
 class HXNetworkServices;
-class HXScheduler;
-class HXXMLParser;
 class HXXMLParser;
 class CMiniCtxRegistry;
 
 
-#if defined(_STATICALLY_LINKED) || !defined(HELIX_FEATURE_PLUGINHANDLER2)
-class BaseHandler;    
-#define MCNTX_PLUGIN_HANDLER_TYPE   BaseHandler
-#define MCNTX_PLUGIN_HANDLER_INC    "basehand.h"
-#else	// _STATICALLY_LINKED
-class Plugin2Handler;
-#define MCNTX_PLUGIN_HANDLER_TYPE   Plugin2Handler
-#define MCNTX_PLUGIN_HANDLER_INC    "plghand2.h"
-#endif	// _STATICALLY_LINKED
-
-
 /****************************************************************************
  * 
  *  Class:
@@ -92,7 +82,8 @@
  *	Implementation of a basic context.
  *
  */
-class MiniContext : public IHXErrorMessages,
+class MiniContext : public CUnknownIMP,
+		    public IHXErrorMessages,
 		    public IHXClientEngine,
 		    public IHXPlayer,
 		    public IHXPlayer2
@@ -106,14 +97,15 @@
 
     MiniContext(void);
 
-    virtual HX_RESULT Init  (ULONG32 uServerMode = 0, 
-			     char* pCompanyName = 0, 
-			     char* pProductName = 0, 
-			     int nMajVer = 0, 
-			     int nMinVer = 0,
-			     IUnknown* pClientContext = NULL);
+    // Init must be called before any AddRef-s or other calls
+    virtual HX_RESULT Construct	 (ULONG32 uServerMode = 0, 
+				  char* pCompanyName = 0, 
+				  char* pProductName = 0, 
+				  int nMajVer = 0, 
+				  int nMinVer = 0,
+				  IUnknown* pClientContext = NULL);
 
-    virtual HX_RESULT Close (void);
+    virtual HX_RESULT Destruct	 (void);
 
     virtual HX_RESULT AddPluginHandlerMountPoint(char* pProductName, 
 						 UINT32 ulMajVer, 
@@ -173,6 +165,7 @@
 
     virtual void ResetProcessEventCount(void)	{ m_ulProcessEvents = 0; }
     
+
     /*
      *  IUnknown methods
      */
@@ -348,27 +341,40 @@
 	return HXR_NOTIMPL;
     }
 
+protected:
+    /*
+     *  CUnknownIMP methods
+     */
+    STDMETHOD(_ActualQI)	(REFIID riid, void** ppvObj);
+
 private:
 
     ~MiniContext(void);
 
     LONG32		    m_lRefCount;
-    HXCommonClassFactory*   m_pCommonClassFactory;
-    HXPreferences*	    m_pPreferences;
+    IHXMediaPlatform*	    m_pMediaPlatform;
+    IHXMediaPlatformKicker* m_pPlatformKicker;
+    IHXCommonClassFactory*  m_pPlatformCommonClassFactory;
+    IHXPluginHandler3*	    m_pPluginHandler3;
+    IHXScheduler*	    m_pScheduler;
+    IHXScheduler2*	    m_pScheduler2;
+    IHXScheduler2*	    m_pLocalScheduler2;
+    IHXPreferences*	    m_pPreferences;
+    IHXExternalResourceManager* m_pExternalResource;
+    CMiniCtxRegistry*	    m_pRegistry;
     HXNetworkServices*	    m_pNetworkServices;
-    HXScheduler*            m_pScheduler;
     HXXMLParser*	    m_pXMLParser;
-    CMiniCtxRegistry*       m_pRegistry;
-    MCNTX_PLUGIN_HANDLER_TYPE*   m_pPlugin2Handler;
-    IHXExternalResourceManager* m_pExternalResource;
+
+    UINT32		    m_ulContextThreadId;
+
+    IUnknown*		    m_pClientContext;
+    
     HXBOOL		    m_uServerMode;
     ULONG32		    m_ulProcessInterrupts;
     ULONG32		    m_ulProcessEvents;
 
     ULONG32		    m_ulMinPreroll;
 
-    IUnknown*              m_pClientContext;
-
     HX_RESULT	InitAsServer(void);
     HX_RESULT	BuildEncSDKPluginPath(IHXBuffer* &pPathBuffer);
 };


From milko at helixcommunity.org  Wed May  3 17:29:39 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 19:22:45 2006
Subject: [Datatype-cvs] 
	tools/minicntx Umakefil, 1.1, 1.2 minicntx.cpp, 1.19,
	1.20 minicreg.h, 1.3, 1.4
Message-ID: 

Update of /cvsroot/datatype/tools/minicntx
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv11995

Modified Files:
	Umakefil minicntx.cpp minicreg.h 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


Index: minicreg.h
===================================================================
RCS file: /cvsroot/datatype/tools/minicntx/minicreg.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- minicreg.h	4 May 2004 21:36:26 -0000	1.3
+++ minicreg.h	4 May 2006 00:29:37 -0000	1.4
@@ -45,39 +45,23 @@
 class CMiniCtxRegistry : public IHXRegistry
 {
 public:
-    CMiniCtxRegistry(void)
+    CMiniCtxRegistry()
 	: m_lRefCount(0)
 	, m_pRegistry(NULL)
-	, m_pClientRegistry(NULL)
     {
-#ifdef HELIX_FEATURE_DTDR_REGISTRY
-	m_pClientRegistry = new HXClientRegistry();
-	m_pRegistry = m_pClientRegistry;
-#endif	// HELIX_FEATURE_DTDR_REGISTRY
-	if (m_pRegistry != NULL)
-	{
-	    m_pRegistry->AddRef();
-	}
+	;
     }
 
-    void Init    (IUnknown* pContext)
+    void Init    (IHXRegistry* pRegistry)
     {
-#ifdef HELIX_FEATURE_DTDR_REGISTRY
-	if (m_pClientRegistry)
-	{
-	    m_pClientRegistry->Init(pContext);
-	}
-#endif	// HELIX_FEATURE_DTDR_REGISTRY
+	HX_RELEASE(m_pRegistry);
+	m_pRegistry = pRegistry;
+	HX_ADDREF(m_pRegistry);
     }
 
     void Close   (void)
     {
-#ifdef HELIX_FEATURE_DTDR_REGISTRY
-	if (m_pClientRegistry)
-	{
-	    m_pClientRegistry->Close();
-	}
-#endif	// HELIX_FEATURE_DTDR_REGISTRY
+	HX_RELEASE(m_pRegistry);
     }
 
 
@@ -920,7 +904,6 @@
     }
 
     IHXRegistry*	m_pRegistry;
-    HXClientRegistry*	m_pClientRegistry;
     LONG32		m_lRefCount;
 };
 

Index: minicntx.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/minicntx/minicntx.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- minicntx.cpp	23 Feb 2006 22:33:29 -0000	1.19
+++ minicntx.cpp	4 May 2006 00:29:37 -0000	1.20
@@ -40,9 +40,12 @@
 #define MAX_EXTENSION_LENGTH	128
 #define MAX_IMMEDIATE_EXECS	64
 
+#define MNCTX_EVENT_GRANULARITY	20  // in milliseconds
+
 #define DFLT_CONTENT_INFO_SIZE	0
 
 #define MINISDK_PRODUCT		"MiniHelixSDK"
+#define MINICNTXT_PLUGIN_PATH_NAME  "MiniCntxtPluginPath"
 
 #define ENCSDK_PLUGINS_DIR	    "Plugins"
 #define ENCSDK_PLUGINS_DIR_LENGTH   (sizeof(ENCSDK_PLUGINS_DIR) - 1)
@@ -81,12 +84,14 @@
 #include "hxsched.h"
 #include "hxxml.h"
 #include "hxxrsmg.h"
-#include MCNTX_PLUGIN_HANDLER_INC
 #include "hxrquest.h"
 #include "chxpckts.h"
 #include "hxassert.h"
 #include "hxxmlprs.h"
-#include "hxcore.h"
+#if !defined(HELIX_CONFIG_MINICONTEXT_SUBCONTEXT)
+#include "chxmedpltfm.h"
+#endif	 // HELIX_CONFIG_MINICONTEXT_SUBCONTEXT
+#include "hxslist.h"
 #include "hxresmg.h"
 #include "hxdir.h"
 #include "asmrulep.h"	/* ASMRuleBook */
@@ -116,12 +121,16 @@
  */
 MiniContext::MiniContext()
     : m_lRefCount(0)
-    , m_pCommonClassFactory(NULL)
-    , m_pPreferences(NULL)
-    , m_pNetworkServices(NULL)
+    , m_pMediaPlatform(NULL)
+    , m_pPlatformKicker(NULL)
+    , m_pPlatformCommonClassFactory(NULL)
     , m_pScheduler(NULL)
+    , m_pScheduler2(NULL)
+    , m_pLocalScheduler2(NULL)
+    , m_pPreferences(NULL)
     , m_pRegistry(NULL)
-    , m_pPlugin2Handler(NULL)
+    , m_pNetworkServices(NULL)
+    , m_pPluginHandler3(NULL)
     , m_pXMLParser(NULL)
     , m_pExternalResource(NULL)
     , m_uServerMode(0)
@@ -129,6 +138,7 @@
     , m_ulProcessEvents(0)
     , m_ulMinPreroll(0)
     , m_pClientContext(NULL)
+    , m_ulContextThreadId(0)
 {
     ;
 }
@@ -136,18 +146,18 @@
 
 MiniContext::~MiniContext(void)
 {
-    (void) MiniContext::Close();
+    (void) MiniContext::Destruct();
 }
 
 
-HX_RESULT MiniContext::Init(ULONG32 uServerMode, 
-			    char* pCompanyName, 
-			    char* pProductName, 
-			    int nMajVer, 
-			    int nMinVer,
-			    IUnknown* pClientContext)
+HX_RESULT MiniContext::Construct(ULONG32 uServerMode, 
+				 char* pCompanyName, 
+				 char* pProductName, 
+				 int nMajVer, 
+				 int nMinVer,
+				 IUnknown* pClientContext)
 {
-    HX_RESULT res;
+    HX_RESULT res = HXR_OK;
 
     if (!pCompanyName && !pProductName && !nMajVer && !nMinVer)
     {
@@ -157,81 +167,287 @@
         nMinVer = 0;
     }
 
-    res = SetClientContext(pClientContext);
-    
-    m_uServerMode = uServerMode;
-
-    /* create and open the preferences object */
-    m_pPreferences = new HXPreferences;
-    if (m_pPreferences == NULL)
+    if (SUCCEEDED(res))
     {
-	return HXR_OUTOFMEMORY;
+	res = SetClientContext(pClientContext);
     }
-    m_pPreferences->AddRef();
 
-    /* set dll access paths */
-    ReadUnsetPathsFromPrefs(pClientContext);
-    
-    res = m_pPreferences->Open(pCompanyName, pProductName, nMajVer, nMinVer);
-    if (FAILED(res))
+#if !defined(HELIX_CONFIG_MINICONTEXT_SUBCONTEXT)
+    // We use own media platform
+    if (SUCCEEDED(res) && !m_pMediaPlatform)
     {
-	return res;
+	res = HXR_OUTOFMEMORY;
+	m_pMediaPlatform = (IHXMediaPlatform*) CHXMediaPlatform::CreateInstance();
+
+	if (m_pMediaPlatform)
+	{
+	    m_pMediaPlatform->AddRef();
+	    res = HXR_OK;
+
+	    if (SUCCEEDED(res))
+	    {
+		DLLAccessPath* pDllAccessPath = GetDLLAccessPath();
+
+		if (pDllAccessPath)
+		{
+		    const char* pPluginPath = NULL;
+
+		    pPluginPath = pDllAccessPath->GetPath(DLLTYPE_PLUGIN);
+		    if (pPluginPath)
+		    {
+			res = m_pMediaPlatform->AddPluginPath(MINICNTXT_PLUGIN_PATH_NAME, 
+							      pPluginPath);
+		    }
+		}
+	    }
+
+	    // Obtain common class factory
+	    if (SUCCEEDED(res))
+	    {
+		res = m_pMediaPlatform->QueryInterface(IID_IHXCommonClassFactory, 
+						       (void**) &m_pPlatformCommonClassFactory);
+	    }
+
+	    // To customize location of preferences, we create preferences from the platform
+	    // common cass factory and open them with custom identifiers.
+	    if (SUCCEEDED(res))
+	    {
+		res = m_pPlatformCommonClassFactory->CreateInstance(CLSID_IHXPreferences, 
+								    (void**) &m_pPreferences);
+	    }
+
+	    if (SUCCEEDED(res))
+	    {
+		IHXPreferences3* pPreferences3 = NULL;
+
+		res = m_pPreferences->QueryInterface(IID_IHXPreferences3, (void**) &pPreferences3);
+
+		if (SUCCEEDED(res))
+		{
+		    res = pPreferences3->Open(pCompanyName, pProductName, nMajVer, nMinVer);
+		}
+
+		HX_RELEASE(pPreferences3);
+	    }
+
+	    // Customize registry
+	    if (SUCCEEDED(res))
+	    {
+		IHXRegistry* pRegistry = NULL;
+
+		m_pPlatformCommonClassFactory->CreateInstance(CLSID_IHXRegistry, 
+							      (void**) &pRegistry);
+
+		m_pRegistry = new CMiniCtxRegistry();
+
+		res = HXR_OUTOFMEMORY;
+
+		if (m_pRegistry)
+		{
+		    res = HXR_OK;
+		    m_pRegistry->AddRef();
+		    m_pRegistry->Init(pRegistry);
+		}
+
+		HX_RELEASE(pRegistry);
+	    }
+	}
     }
+#else	// HELIX_CONFIG_MINICONTEXT_SUBCONTEXT
+    // Since this module does not have own media platform implementation, 
+    // media platform should be offered by the client context.
+    // Create a child platform to use for minicontext and extend with own scheduler (override)
+    // and other services specific to this player-like context.
+    if (SUCCEEDED(res))
+    {
+	IHXMediaPlatform* pParentMediaPlatform = NULL;
 
-    /* create and init the registry object */
-    m_pRegistry = new CMiniCtxRegistry();
-    if (NULL == m_pRegistry)
+	if (!pClientContext)
+	{
+	    res = HXR_FAIL;
+	}
+
+	if (SUCCEEDED(res))
+	{
+	    res = pClientContext->QueryInterface(IID_IHXMediaPlatform, 
+						 (void**) &pParentMediaPlatform);
+	}
+
+	if (SUCCEEDED(res) && pParentMediaPlatform)
+	{
+	    res = pParentMediaPlatform->CreateChildContext(&m_pMediaPlatform);
+	}
+
+	if (SUCCEEDED(res) && m_pMediaPlatform)
+	{
+	    res = m_pMediaPlatform->QueryInterface(IID_IHXCommonClassFactory, 
+						   (void**) &m_pPlatformCommonClassFactory);
+	}
+
+	// We will run in our own scheduler thus not requiring client context to run in
+	// the same thread as this context.
+	if (SUCCEEDED(res))
+	{
+	    IHXMutex* pChildPlatformMutex = NULL;
+
+	    res = m_pPlatformCommonClassFactory->CreateInstance(CLSID_IHXScheduler, 
+								(void**) &m_pScheduler);
+
+	    // Create new platform Mutex
+	    if (SUCCEEDED(res))
+	    {
+		res = m_pPlatformCommonClassFactory->CreateInstance(CLSID_IHXMutex, 
+								    (void**) &pChildPlatformMutex);
+	    }
+
+	    // Configure the new scheduler
+	    if (SUCCEEDED(res))
+	    {
+		res = m_pScheduler->QueryInterface(IID_IHXScheduler2, 
+						   (void**) &m_pLocalScheduler2);
+
+		if (SUCCEEDED(res))
+		{
+		    res = m_pLocalScheduler2->SetMutex(pChildPlatformMutex);
+		}
+
+		if (SUCCEEDED(res))
+		{
+		    // Single threaded (non-interrupt) operation is fine
+		    res = m_pLocalScheduler2->SetInterrupt(FALSE);
+		}
+
+		if (SUCCEEDED(res))
+		{
+		    res = m_pLocalScheduler2->StartScheduler();
+		}
+	    }
+
+	    HX_RELEASE(pChildPlatformMutex);
+	}
+
+	// Customize existing registry service
+	if (SUCCEEDED(res))
+	{
+	    IHXRegistry* pRegistry = NULL;
+
+	    m_pPlatformCommonClassFactory->QueryInterface(IID_IHXRegistry, 
+							  (void**) &pRegistry);
+
+	    m_pRegistry = new CMiniCtxRegistry();
+
+	    res = HXR_OUTOFMEMORY;
+
+	    if (m_pRegistry)
+	    {
+		res = HXR_OK;
+		m_pRegistry->AddRef();
+		m_pRegistry->Init(pRegistry);
+	    }
+	}
+
+	HX_RELEASE(pParentMediaPlatform);
+
+	if (FAILED(res))
+	{
+	    HX_RELEASE(m_pScheduler);
+	    HX_RELEASE(m_pPlatformCommonClassFactory);
+	    HX_RELEASE(m_pMediaPlatform);
+	}
+    }
+#endif	// HELIX_CONFIG_MINICONTEXT_SUBCONTEXT
+
+    // Aggregate mini context into the platform
+    if (SUCCEEDED(res))
     {
-	return HXR_OUTOFMEMORY;
+	IUnknown* pControlling = NULL;
+	IUnknown* pOuter = NULL;
+
+	res = m_pMediaPlatform->QueryInterface(IID_IUnknown, (void**) &pOuter);
+
+	if (SUCCEEDED(res))
+	{
+	    res = SetupAggregation(pOuter, &pControlling);
+	}
+
+	HX_RELEASE(pOuter);
+
+	// Initialize the media platform with this context as extension
+	if (SUCCEEDED(res))
+	{
+	    res = m_pMediaPlatform->Init((IUnknown*)(IHXPlayer*) pControlling);
+	}
+
+	HX_RELEASE(pControlling);
     }
-    m_pRegistry->AddRef();
-    m_pRegistry->Init((IUnknown *)(IHXPlayer *) this);
-    
-    /* create the common class factory */
-    m_pCommonClassFactory = new HXCommonClassFactory((IUnknown *)(IHXPlayer *) this);
-    if (m_pCommonClassFactory == NULL)
+
+    m_uServerMode = uServerMode;
+
+    // Obtain platform scheduler's scheduler2 API
+    if (SUCCEEDED(res) && !m_pScheduler2)
     {
-	return HXR_OUTOFMEMORY;
+	res = m_pMediaPlatform->QueryInterface(IID_IHXScheduler2,
+					       (void**) &m_pScheduler2);
     }
-    m_pCommonClassFactory->AddRef();
 
-    /* create and start the scheduler */
-    m_pScheduler = new HXScheduler((IUnknown *)(IHXPlayer *) this);
-    if (m_pScheduler == NULL)
+    // Obtain mini contexts primary thread ID
+    if (SUCCEEDED(res))
     {
-	return HXR_OUTOFMEMORY;
+	m_ulContextThreadId = m_pScheduler2->GetThreadID();
     }
-    m_pScheduler->AddRef();
 
-    res = m_pScheduler->StartScheduler();
-    if (FAILED(res))
+    // Obtain the platform kicker
+    if (SUCCEEDED(res))
     {
-	return res;
+	res = m_pMediaPlatform->QueryInterface(IID_IHXMediaPlatformKicker,
+					       (void**) &m_pPlatformKicker);
     }
 
+    // Obtain plugin handler
+    if (SUCCEEDED(res))
+    {
+	// Ignore errors as plugin handler is not strictly required
+	m_pMediaPlatform->QueryInterface(IID_IHXPluginHandler3,
+					 (void**) &m_pPluginHandler3);
+    }
+    
     /* create network services */
 #if defined(HELIX_FEATURE_MINICONTEXT_PLAYBACK_NET)
-    m_pNetworkServices = new HXNetworkServices((IUnknown *)(IHXPlayer *) this);
-    if (m_pNetworkServices == NULL)
+    if (SUCCEEDED(res))
     {
-	return HXR_OUTOFMEMORY;
+	m_pNetworkServices = new HXNetworkServices((IUnknown *)(IHXPlayer *) this);
+	if (m_pNetworkServices == NULL)
+	{
+	    return HXR_OUTOFMEMORY;
+	}
+	m_pNetworkServices->AddRef();
     }
-    m_pNetworkServices->AddRef();
 #endif	// HELIX_FEATURE_MINICONTEXT_PLAYBACK_NET
 
     /* create and init the plugin handler */
-    m_pPlugin2Handler = new MCNTX_PLUGIN_HANDLER_TYPE;
-    if (m_pPlugin2Handler == NULL)
+#if defined(HELIX_FEATURE_MINICONTEXT_XMLPARSER)
+    if (SUCCEEDED(res))
     {
-	return HXR_OUTOFMEMORY;
+	m_pXMLParser = new HXXMLParser((IUnknown*)(IHXPlayer*)this);
+	if (m_pXMLParser == NULL)
+	{
+	    return HXR_OUTOFMEMORY;
+	}
+	m_pXMLParser->AddRef();
     }
-    m_pPlugin2Handler->AddRef();
-
-    res = m_pPlugin2Handler->Init((IUnknown *)(IHXPlayer *) this);
-    if (FAILED(res))
+#endif	// HELIX_FEATURE_MINICONTEXT_XMLPARSER
+    
+#if defined(HELIX_FEATURE_MINICONTEXT_RESOURCEMGR)
+    /* create the external resource manager. */
+    if (SUCCEEDED(res))
     {
-	return res;
+	m_pExternalResource = HXExternalResourceManager::Instance((IUnknown*)(IHXPlayer *) this);
+	if (m_pExternalResource == NULL)
+	{
+	    return HXR_OUTOFMEMORY;
+	}
     }
+#endif	// HELIX_FEATURE_MINICONTEXT_RESOURCEMGR
 
 #if defined(HELIX_FEATURE_MINICONTEXT_EXTENDEDPLUGINS)
     // Add additional mount points to look for plugins
@@ -257,26 +473,7 @@
     HX_RELEASE(pEncSDKPathBuffer);
 #endif	// HELIX_FEATURE_MINICONTEXT_EXTENDEDPLUGINS
 
-    /* create and init the plugin handler */
-#if defined(HELIX_FEATURE_MINICONTEXT_XMLPARSER)
-    m_pXMLParser = new HXXMLParser((IUnknown*)(IHXPlayer*)this);
-    if (m_pXMLParser == NULL)
-    {
-	return HXR_OUTOFMEMORY;
-    }
-    m_pXMLParser->AddRef();
-#endif	// HELIX_FEATURE_MINICONTEXT_XMLPARSER
-    
-#if defined(HELIX_FEATURE_MINICONTEXT_RESOURCEMGR)
-    /* create the external resource manager. */
-    m_pExternalResource = HXExternalResourceManager::Instance((IUnknown*)(IHXPlayer *) this);
-    if (m_pExternalResource == NULL)
-    {
-	return HXR_OUTOFMEMORY;
-    }
-#endif	// HELIX_FEATURE_MINICONTEXT_RESOURCEMGR
-
-    if (m_uServerMode)
+    if (SUCCEEDED(res) && m_uServerMode)
     {
 	InitAsServer();
     }
@@ -292,8 +489,8 @@
 {
     HX_RESULT res = HXR_FAIL;
     IHXPluginHandler3* pPluginHandler3 = NULL;
-    res = m_pPlugin2Handler->QueryInterface(IID_IHXPluginHandler3, 
-					    (void**) &pPluginHandler3);
+    res = m_pMediaPlatform->QueryInterface(IID_IHXPluginHandler3, 
+					   (void**) &pPluginHandler3);
 
     if (SUCCEEDED(res))
     {
@@ -325,7 +522,7 @@
     {
 	ULONG32 ulRootPathLen = strlen(pPath);
 	ULONG32 ulPathLen = ulRootPathLen + ENCSDK_PLUGINS_DIR_LENGTH + 1;
-	res = m_pCommonClassFactory->CreateInstance(IID_IHXBuffer, 
+	res = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXBuffer, 
 						    (void **) &pEncSDKPluginPathBuffer);
 	
 	if (SUCCEEDED(res))
@@ -374,7 +571,7 @@
 	return HXR_FAIL;
     }
 
-    RetVal = m_pCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
+    RetVal = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
 
     if (SUCCEEDED(RetVal))
     {
@@ -388,7 +585,7 @@
 
     if (SUCCEEDED(RetVal))
     {
-	RetVal = m_pCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
+	RetVal = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
     }
 
     if (SUCCEEDED(RetVal))
@@ -403,7 +600,7 @@
 
     if (SUCCEEDED(RetVal))
     {
-	RetVal = m_pCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
+	RetVal = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
     }
 
     if (SUCCEEDED(RetVal))
@@ -419,7 +616,7 @@
 
     if (SUCCEEDED(RetVal))
     {
-	RetVal = m_pCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
+	RetVal = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
     }
 
     if (SUCCEEDED(RetVal))
@@ -448,7 +645,7 @@
 
     if (SUCCEEDED(RetVal))
     {
-	RetVal = m_pCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
+	RetVal = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
     }
 
     if (SUCCEEDED(RetVal))
@@ -471,12 +668,8 @@
 }
 
 
-HX_RESULT MiniContext::Close(void)
+HX_RESULT MiniContext::Destruct(void)
 {
-    if (m_pPreferences != NULL)
-    {
-	m_pPreferences->Close();
-    }
 #if defined(HELIX_FEATURE_MINICONTEXT_PLAYBACK_NET)
     if (m_pNetworkServices != NULL)
     {
@@ -487,35 +680,48 @@
     {
 	m_pRegistry->Close();
     }
+#if defined(HELIX_FEATURE_MINICONTEXT_XMLPARSER)
     if (m_pXMLParser != NULL)
     {
 	m_pXMLParser->Close();
     }
-    if (m_pScheduler != NULL)
-    {
-	m_pScheduler->StopScheduler();
-    }
-    if (m_pCommonClassFactory != NULL)
-    {
-	m_pCommonClassFactory->Close();
-    }
+#endif	// HELIX_FEATURE_MINICONTEXT_XMLPARSER
 
+#if defined(HELIX_FEATURE_MINICONTEXT_RESOURCEMGR)
     HX_RELEASE(m_pExternalResource);
+#endif	// HELIX_FEATURE_MINICONTEXT_RESOURCEMGR
+#if defined(HELIX_FEATURE_MINICONTEXT_XMLPARSER)
     HX_RELEASE(m_pXMLParser);
+#endif	// HELIX_FEATURE_MINICONTEXT_XMLPARSER
+    if (m_pLocalScheduler2)
+    {
+	m_pLocalScheduler2->StopScheduler();
+	HX_RELEASE(m_pLocalScheduler2);
+    }
+    HX_RELEASE(m_pScheduler2);
     HX_RELEASE(m_pScheduler);
-    HX_RELEASE(m_pRegistry);
     HX_RELEASE(m_pPreferences);
+    HX_RELEASE(m_pRegistry);
 #if defined(HELIX_FEATURE_MINICONTEXT_PLAYBACK_NET)
     HX_RELEASE(m_pNetworkServices);
 #endif	// HELIX_FEATURE_MINICONTEXT_PLAYBACK_NET
-    HX_RELEASE(m_pCommonClassFactory);
-    HX_RELEASE(m_pClientContext);    
-
-    if (m_pPlugin2Handler != NULL)
+    HX_RELEASE(m_pPluginHandler3);
+    HX_RELEASE(m_pPlatformCommonClassFactory);
+    HX_RELEASE(m_pClientContext);
+    HX_RELEASE(m_pPlatformKicker);
+    if (m_pMediaPlatform)
     {
-	m_pPlugin2Handler->Close();
+	IHXMediaPlatform* pMediaPlatform = m_pMediaPlatform;
+	m_pMediaPlatform = NULL;
+
+	// Since we have aggregated ourselves into media platform, 
+	// closing the media platform is isntant death for this object.
+	// For this reason any further processing must be done
+	// on stack variables or we may cause a memory fault.
+
+	pMediaPlatform->Close();
+	pMediaPlatform->Release();
     }
-    HX_RELEASE(m_pPlugin2Handler);
 
     return HXR_OK;
 }
@@ -532,7 +738,7 @@
     char* pPropValArray[2];
     ULONG32 ulPropIdx = 0;
   
-    if (m_pPlugin2Handler == NULL)
+    if (m_pPluginHandler3 == NULL)
     {
 	return HXR_UNEXPECTED;
     }
@@ -561,13 +767,14 @@
     }
 
 
-    res = m_pPlugin2Handler->FindPluginUsingStrings(PLUGIN_CLASS,
+    res = m_pPluginHandler3->FindPluginUsingStrings(PLUGIN_CLASS,
 						    PLUGIN_FILESYSTEM_TYPE,
 						    pPropNameArray[0],
 						    pPropValArray[0],
 						    pPropNameArray[1], 
 						    pPropValArray[1], 
-						    pUnknown);
+						    pUnknown,
+						    NULL);
 
     if (FAILED(res))
     {
@@ -763,7 +970,7 @@
     IUnknown* pPlugin = NULL;
     HX_RESULT  res;
     
-    if (m_pPlugin2Handler == NULL)
+    if (m_pPluginHandler3 == NULL)
     {
 	return HXR_UNEXPECTED;
     }
@@ -790,7 +997,7 @@
     pExtension[ulExtLength] = '\0';
 
     /* find the file format */
-    res = m_pPlugin2Handler->FindGroupOfPluginsUsingStrings(PLUGIN_CLASS,
+    res = m_pPluginHandler3->FindGroupOfPluginsUsingStrings(PLUGIN_CLASS,
 							    pPluginType,
 							    PLUGIN_FILEEXTENSIONS, 
 							    pExtension,
@@ -805,7 +1012,7 @@
 	if ((!strcasecmp(pExtension, "mnd")) ||
 	    (!strcasecmp(pExtension, "mns")))
 	{
-	    res = m_pPlugin2Handler->FindGroupOfPluginsUsingStrings(PLUGIN_CLASS,
+	    res = m_pPluginHandler3->FindGroupOfPluginsUsingStrings(PLUGIN_CLASS,
 								    pPluginType,
 								    PLUGIN_FILEEXTENSIONS, 
 								    "rms",
@@ -942,7 +1149,7 @@
     // Set Properties
     if (SUCCEEDED(res))
     {
-	res = m_pCommonClassFactory->CreateInstance(IID_IHXValues, 
+	res = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXValues, 
 	    (void **) &pFinalProperties);
     }
 
@@ -992,7 +1199,7 @@
     {
 	if (SUCCEEDED(res))
 	{
-	    res = m_pCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
+	    res = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
 	}
 	
 	if (SUCCEEDED(res))
@@ -1166,12 +1373,12 @@
     {
 	IHXBuffer *pBuffer = NULL;
 
-	retVal = m_pCommonClassFactory->CreateInstance(IID_IHXValues, (void **) &pHeader);
+	retVal = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXValues, (void **) &pHeader);
 
 	// Set Default Request Headers 
 	if (SUCCEEDED(retVal))
 	{
-	    retVal = m_pCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
+	    retVal = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
 	}
 	
 	if (SUCCEEDED(retVal))
@@ -1191,7 +1398,7 @@
 	    // Set Server Mode Request Headers
 	    if (SUCCEEDED(retVal))
 	    {
-		retVal = m_pCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
+		retVal = m_pPlatformCommonClassFactory->CreateInstance(IID_IHXBuffer, (void **) &pBuffer);
 	    }
 	    
 	    if (SUCCEEDED(retVal))
@@ -1220,6 +1427,24 @@
 	retVal = pRequest->SetRequestHeaders(pHeader);
     }
 
+    if (SUCCEEDED(retVal) && m_pClientContext)
+    {
+	IHXRequestContext* pRequestContext = NULL;
+
+	retVal = pRequest->QueryInterface(IID_IHXRequestContext, 
+					  (void**) &pRequestContext);
+
+	if (SUCCEEDED(retVal) && pRequestContext)
+	{
+	    retVal = pRequestContext->SetRequester(m_pClientContext);
+	}
+
+	HX_RELEASE(pRequestContext);
+
+	// This is not critically important step - proceed even if not successful
+	retVal = HXR_OK;
+    }
+
     if (SUCCEEDED(retVal))
     {
 	retVal = pRequest->SetURL(pszFileName);
@@ -1235,18 +1460,19 @@
  */
 HX_RESULT MiniContext::Process(PROCESS_MODE ProcessMode)
 {
-#ifdef _WIN32
-    MSG msg;
     ULONG32 ulImmediateExecCounter = 0;
 
     do
     {
-	m_pScheduler->OnTimeSync(FALSE);
+	m_pPlatformKicker->Kick(m_ulContextThreadId);
 	ulImmediateExecCounter++;
     } while ((m_ulProcessInterrupts == 0) &&
-	     m_pScheduler->AreImmediatesPending() && 
+	     m_pScheduler2->AreImmediatesPending() && 
 	     (ulImmediateExecCounter < MAX_IMMEDIATE_EXECS));
 
+#ifdef _WIN32
+    MSG msg;
+
     do
     {
 	while ((m_ulProcessInterrupts == 0) && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
@@ -1257,22 +1483,28 @@
 	    DispatchMessage(&msg);
 	}
     } while ((ProcessMode != MCNTX_BLOCK_NEVER) && 
-	     (!m_pScheduler->AreImmediatesPending()) && 
+	     (!m_pScheduler2->AreImmediatesPending()) && 
 	     (m_ulProcessInterrupts == 0) && 
 	     WaitMessage());
 
-    m_ulProcessInterrupts = 0;
-    
 #elif defined(_UNIX) || defined(_MACINTOSH)
-    Timeline::CallAllTimeSyncs();
+    while ((ProcessMode != MCNTX_BLOCK_NEVER) && 
+	   (!m_pScheduler2->AreImmediatesPending()) && 
+	   (m_ulProcessInterrupts == 0))
+    {
+	m_pScheduler2->WaitForNextEvent(MNCTX_EVENT_GRANULARITY);
+	m_pPlatformKicker->Kick(m_ulContextThreadId);
+    }
 #elif defined(_SYMBIAN)
     SymbianEventHandler* pEventHndlr = new SymbianEventHandler();
-    pEventHndlr->DoEvents(20);
+    pEventHndlr->DoEvents(MNCTX_EVENT_GRANULARITY);
     delete pEventHndlr;
 #else
 #error main event loop undefined on target platform
 #endif
 
+    m_ulProcessInterrupts = 0;
+
     return HXR_OK;
 }
 
@@ -1331,10 +1563,11 @@
     return HXR_OK;
 }
 
+
 /*
- *  IUnknown methods
+ *  CUnknown methods
  */
-STDMETHODIMP MiniContext::QueryInterface(REFIID riid, void** ppvObj)
+STDMETHODIMP MiniContext::_ActualQI(REFIID riid, void** ppvObj)
 {
     if (IsEqualIID(riid, IID_IUnknown))
     {
@@ -1342,54 +1575,67 @@
 	*ppvObj = (IUnknown *)(IHXPlayer *) this;
 	return HXR_OK;
     }
-    else if (IsEqualIID(riid, IID_IHXErrorMessages))
+    else if (IsEqualIID(riid, IID_IHXPlayer))
     {
-	// Client context can be given opportunity to override error
-	// message sink.
-	if ((!m_pClientContext) ||
-	    (m_pClientContext->QueryInterface(riid, ppvObj) != HXR_OK))
+	if (!m_uServerMode)
 	{
 	    AddRef();
-	    *ppvObj = (IHXErrorMessages *) this;
+	    *ppvObj = (IHXPlayer *) this;
+	    return HXR_OK;
 	}
-	return HXR_OK;
     }
-    else if (m_pClientContext &&
-	     (IsEqualIID(riid, IID_IHXPreferences) ||
-	      IsEqualIID(riid, IID_IHXPreferences2) ||
-	      IsEqualIID(riid, IID_IHXPreferences3)) &&
-	     (m_pClientContext->QueryInterface(riid, ppvObj) == HXR_OK))
+    else if (IsEqualIID(riid, IID_IHXPlayer2))
     {
-	// Client context can be given opportunity to override preferences
-	// implementation.
-	return HXR_OK;
+	if (!m_uServerMode)
+	{
+	    AddRef();
+	    *ppvObj = (IHXPlayer2 *) this;
+	    return HXR_OK;
+	}
     }
-    else if (IsEqualIID(riid, IID_IHXPlayer) && (m_uServerMode == 0))
+    else if (IsEqualIID(riid, IID_IHXClientEngine))
     {
-	AddRef();
-	*ppvObj = (IHXPlayer *) this;
-	return HXR_OK;
+	if (!m_uServerMode)
+	{
+	    AddRef();
+	    *ppvObj = (IHXClientEngine *) this;
+	    return HXR_OK;
+	}
     }
-    else if (IsEqualIID(riid, IID_IHXPlayer2) && (m_uServerMode == 0))
+    // If preferences are created here, always use local version.
+    // The local version will also be adopted by the media platform
+    // beacause of this QI support.
+    else if (m_pPreferences &&
+	     IsEqualIID(riid, IID_IHXPreferences) &&
+	     (m_pPreferences->QueryInterface(riid, ppvObj) == HXR_OK))
     {
-	AddRef();
-	*ppvObj = (IHXPlayer2 *) this;
 	return HXR_OK;
     }
-    else if (IsEqualIID(riid, IID_IHXClientEngine) && (m_uServerMode == 0))
+    // If scheduler is created here, always use local version.
+    // The local version will also be adopted by the media platform
+    // because of this QI support.
+    else if (m_pScheduler &&
+	     IsEqualIID(riid, IID_IHXScheduler) &&
+	     (m_pScheduler->QueryInterface(riid, ppvObj) == HXR_OK))
     {
-	AddRef();
-	*ppvObj = (IHXClientEngine *) this;
 	return HXR_OK;
     }
-    else if (m_pCommonClassFactory &&
-	     m_pCommonClassFactory->QueryInterface(riid, ppvObj) == HXR_OK)
+    else if (m_pRegistry &&
+	     IsEqualIID(riid, IID_IHXRegistry) &&
+	     (m_pRegistry->QueryInterface(riid, ppvObj) == HXR_OK))
     {
 	return HXR_OK;
     }
-    else if (m_pPreferences &&
-	     m_pPreferences->QueryInterface(riid, ppvObj) == HXR_OK)
+    else if (m_pClientContext &&
+             m_pClientContext->QueryInterface(riid, ppvObj) == HXR_OK)
+    {
+    	return HXR_OK;
+    }
+    else if (IsEqualIID(riid, IID_IHXErrorMessages))
     {
+	AddRef();
+	*ppvObj = (IHXErrorMessages *) this;
+
 	return HXR_OK;
     }
 #if defined(HELIX_FEATURE_MINICONTEXT_PLAYBACK_NET)
@@ -1399,39 +1645,20 @@
 	return HXR_OK;
     }
 #endif	// HELIX_FEATURE_MINICONTEXT_PLAYBACK_NET
-    else if (m_pScheduler &&
-	     m_pScheduler->QueryInterface(riid, ppvObj) == HXR_OK)
-    {
-	return HXR_OK;
-    }
-    else if (m_pRegistry &&
-	     m_pRegistry->QueryInterface(riid, ppvObj) == HXR_OK)
-    {
-	return HXR_OK;
-    }
-    else if (m_pPlugin2Handler &&
-	     m_pPlugin2Handler->QueryInterface(riid, ppvObj) == HXR_OK)
-    {
-	return HXR_OK;
-    }
+#if defined(HELIX_FEATURE_MINICONTEXT_XMLPARSER)
     else if (m_pXMLParser &&
 	     m_pXMLParser->QueryInterface(riid, ppvObj) == HXR_OK)
     {
 	return HXR_OK;
     }
+#endif	// HELIX_FEATURE_MINICONTEXT_XMLPARSER
+#if defined(HELIX_FEATURE_MINICONTEXT_RESOURCEMGR)
     else if (m_pExternalResource &&
     	     m_pExternalResource->QueryInterface(riid, ppvObj) == HXR_OK)
     {
        return HXR_OK;
     }
-    else if (m_pClientContext &&
-             m_pClientContext->QueryInterface(riid, ppvObj) == HXR_OK)
-    {
-	// Except for few select interfaces, client context can only
-	// extend but not override the interfaces in order to preserve
-	// security for DRM applications.
-    	return HXR_OK;
-    }
+#endif	// HELIX_FEATURE_MINICONTEXT_RESOURCEMGR
 
     *ppvObj = NULL;
 
@@ -1439,19 +1666,23 @@
 }
 
 
+/*
+ *  IUnknown methods
+ */
+STDMETHODIMP MiniContext::QueryInterface(REFIID riid, void** ppvObj)
+{
+    return CUnknownIMP::QueryInterface(riid, ppvObj);
+}
+
+
 STDMETHODIMP_(ULONG32) MiniContext::AddRef()
 {
-    return InterlockedIncrement(&m_lRefCount);
+    return CUnknownIMP::AddRef();
 }
 
 
 STDMETHODIMP_(ULONG32) MiniContext::Release()
 {
-    if (InterlockedDecrement(&m_lRefCount) > 0)
-    {
-	return m_lRefCount;
-    }
-
-    delete this;
-    return 0;
+    return CUnknownIMP::Release();
 }
+

Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/tools/minicntx/Umakefil,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Umakefil	8 Jan 2003 22:56:40 -0000	1.1
+++ Umakefil	4 May 2006 00:29:37 -0000	1.2
@@ -1,58 +1,55 @@
 # 
-# ***** BEGIN LICENSE BLOCK ***** 
-# Version: RCSL 1.0/RPSL 1.0 
-#  
-# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
-#      
-# The contents of this file, and the files included with this file, are 
-# subject to the current version of the RealNetworks Public Source License 
-# Version 1.0 (the "RPSL") available at 
-# http://www.helixcommunity.org/content/rpsl unless you have licensed 
-# the file under the RealNetworks Community Source License Version 1.0 
-# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
-# in which case the RCSL will apply. You may also obtain the license terms 
-# directly from RealNetworks.  You may not use this file except in 
-# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
-# applicable to this file, the RCSL.  Please see the applicable RPSL or 
-# RCSL for the rights, obligations and limitations governing use of the 
-# contents of the file.  
-#  
-# This file is part of the Helix DNA Technology. RealNetworks is the 
-# developer of the Original Code and owns the copyrights in the portions 
-# it created. 
-#  
-# This file, and the files included with this file, is distributed and made 
-# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
-# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
-# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
-# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
+# ***** BEGIN LICENSE BLOCK *****
+# Source last modified: $Id$
 # 
-# Technology Compatibility Kit Test Suite(s) Location: 
-#    http://www.helixcommunity.org/content/tck 
+# Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 # 
-# Contributor(s): 
-#  
-# ***** END LICENSE BLOCK ***** 
+# The contents of this file, and the files included with this file,
+# are subject to the current version of the RealNetworks Public
+# Source License (the "RPSL") available at
+# http://www.helixcommunity.org/content/rpsl unless you have licensed
+# the file under the current version of the RealNetworks Community
+# Source License (the "RCSL") available at
+# http://www.helixcommunity.org/content/rcsl, in which case the RCSL
+# will apply. You may also obtain the license terms directly from
+# RealNetworks.  You may not use this file except in compliance with
+# the RPSL or, if you have a valid RCSL with RealNetworks applicable
+# to this file, the RCSL.  Please see the applicable RPSL or RCSL for
+# the rights, obligations and limitations governing use of the
+# contents of the file.
+# 
+# Alternatively, the contents of this file may be used under the
+# terms of the GNU General Public License Version 2 or later (the
+# "GPL") in which case the provisions of the GPL are applicable
+# instead of those above. If you wish to allow use of your version of
+# this file only under the terms of the GPL, and not to allow others
+# to use your version of this file under the terms of either the RPSL
+# or RCSL, indicate your decision by deleting the provisions above
+# and replace them with the notice and other provisions required by
+# the GPL. If you do not delete the provisions above, a recipient may
+# use your version of this file under the terms of any one of the
+# RPSL, the RCSL or the GPL.
+# 
+# This file is part of the Helix DNA Technology. RealNetworks is the
+# developer of the Original Code and owns the copyrights in the
+# portions it created.
+# 
+# This file, and the files included with this file, is distributed
+# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
+# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
+# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
+# ENJOYMENT OR NON-INFRINGEMENT.
+# 
+# Technology Compatibility Kit Test Suite(s) Location:
+#    http://www.helixcommunity.org/content/tck
+# 
+# Contributor(s):
+# 
+# ***** END LICENSE BLOCK *****
 # 
 
-UmakefileVersion(2,0)
-
-project.AddModuleIncludes( "common/include",
-						   "common/runtime/pub",
-						   "common/dbgtool/pub", 
-						   "common/util/pub", 
-						   "common/container/pub",
-						   "common/system/pub",
-						   "common/fileio/pub", 
-						   "common/netio/pub",
-						   "common/lang/xml/pub",
-						   "client/common/container/pub",
-						   "client/common/system/pub",
-						   "client/common/netio/pub",
-						   "client/netwksvc/pub")
-
-project.AddSources(	'minicntx.cpp')
+UmakefileVersion(2,1)
 
-LibraryTarget('minicntx')
+MultiTargetMake('minicntx', 'minisubcntx')
 
-DependTarget()


From milko at helixcommunity.org  Wed May  3 17:30:22 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 19:23:26 2006
Subject: [Datatype-cvs] mp4/filewriter mp4arch.cpp,1.4,1.5
Message-ID: 

Update of /cvsroot/datatype/mp4/filewriter
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv12139

Modified Files:
	mp4arch.cpp 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


Index: mp4arch.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/filewriter/mp4arch.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mp4arch.cpp	16 Mar 2006 19:19:21 -0000	1.4
+++ mp4arch.cpp	4 May 2006 00:30:20 -0000	1.5
@@ -312,28 +312,7 @@
 {
     HX_RESULT hResult = HXR_OK;
 
-    // Create a new volume name for the file
-    if (m_iFileTime || m_iFileSize)
-    {
-	if ((!m_bRotateAsFallback) || (m_ulVolumeNo != 0))
-	{
-	    m_VolumeName.Format("%s%d", (const char*)m_BaseName, 
-		m_ulVolumeNo);
-	}
-	else
-	{
-	    m_VolumeName.Format("%s", (const char*)m_BaseName);
-	}
-	
-	m_ulVolumeNo++;
-    }
-    else
-    {
-	m_VolumeName.Format("%s", (const char*)m_BaseName);
-    }
-    
-    // Add the extension
-    m_VolumeName += m_AddOnExtension;
+    CreateArchiveVolumeName();
 
     AddRef();
 
@@ -350,7 +329,7 @@
  
 	// Construct temp output filename and convert it to an URL
 	CHXString strTempFilename;
-	strTempFilename.Format("%stemp_%s.tmp", (const char*) m_ArchiveDir, (const char*) m_pVolumeGUIDName);
+	CreateTempVolumeName(strTempFilename);
 	ConvertFilepathToURL(m_ProtocolName, strTempFilename, m_TempOutputFileName);
 
 	// Actually create the file
@@ -359,8 +338,11 @@
 
 	if (HXR_OK == hResult)
 	{
-	    HX_RESULT res2 = NotifyTempFileCreated(strTempFilename);
-	    HX_ASSERT(SUCCEEDED(res2));
+	    if (m_TempOutputFileName != m_OutputFileName)
+	    {
+		HX_RESULT res2 = NotifyTempFileCreated(strTempFilename);
+		HX_ASSERT(SUCCEEDED(res2));
+	    }
 	}
 	else
 	{
@@ -370,7 +352,7 @@
 
     Release();
 
-    return HXR_OK;
+    return hResult;
 }
 
 HX_RESULT 
@@ -476,6 +458,8 @@
 void
 CMP4Archiver::CloseSaveFile()
 {
+    HXBOOL bSkipRename = FALSE;
+
     m_bClosing = TRUE;
 
     if (m_pSaveFile)
@@ -484,46 +468,58 @@
 
 	if (!m_bResolvedOutputConflict)
 	{
-	    
-	    // Create a file with the OutputFilename, 
-	    // so any file which already has that 
-	    // name will be renamed appropriately
-	    hResult = m_pFileCreator->CreateArchiveFile(
-			(const char*) m_OutputFileName);
-
-	    if (SUCCEEDED(hResult))
+	    if (m_TempOutputFileName != m_OutputFileName)
 	    {
-		// We'll be called back once the conflict is resolved
-		return;
+		// Create a file with the OutputFilename,
+		// so any file which already has that
+		// name will be renamed appropriately
+		hResult = m_pFileCreator->CreateArchiveFile(
+				(const char*) m_OutputFileName);
+		
+		if (SUCCEEDED(hResult))
+		{
+		    // We'll be called back once the conflict is resolved
+		    return;
+		}
 	    }
+
+	    // If we are here, temporary file name is the final output file name
+	    // and thus there cannot be any output name conflict.
+	    m_bResolvedOutputConflict = TRUE;
+	    // since temp file name and final output name are the same, 
+	    // no rename is needed
+	    bSkipRename = TRUE;
 	}
 
 	m_pSaveFile->Close();
 	HX_RELEASE(m_pSaveFile);
 
-	if (SUCCEEDED(hResult))
+	if (!bSkipRename)
 	{
-	    hResult = HXR_FAIL;
-	    if (m_pOutputFileRenamer)
+	    if (SUCCEEDED(hResult))
 	    {
-		hResult = HXR_OK;
+		hResult = HXR_FAIL;
+		if (m_pOutputFileRenamer)
+		{
+		    hResult = HXR_OK;
+		}
+	    }
+	    
+	    if (SUCCEEDED(hResult))
+	    {
+		m_pFileCreator->RenameObject(m_pOutputFileRenamer, 
+					     m_OutputFileName,
+					     m_bTempDirUsed);
+	    }
+	    else
+	    {
+		ErrMsg(m_pErrorMessages,
+		       HXR_IGNORE,
+		       1,
+		       "Unable to move \"%s\" out of the way for \"%s\"!\n",
+		       (const char*) m_OutputFileName,
+		       (const char*) m_TempOutputFileName);
 	    }
-	}
-
-	if (SUCCEEDED(hResult))
-	{
-	    m_pFileCreator->RenameObject(m_pOutputFileRenamer, 
-					 m_OutputFileName,
-					 m_bTempDirUsed);
-	}
-	else
-	{
-	    ErrMsg(m_pErrorMessages,
-		   HXR_IGNORE,
-		   1,
-		   "Unable to move \"%s\" out of the way for \"%s\"!\n",
-		   (const char*) m_OutputFileName,
-		   (const char*) m_TempOutputFileName);
 	}
 
 	HX_RELEASE(m_pOutputFileRenamer);


From milko at helixcommunity.org  Wed May  3 17:37:28 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 19:30:32 2006
Subject: [Datatype-cvs] tools/dtdriver/samples/direct_io Umakefil,1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/samples/direct_io
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv12183/direct_io

Modified Files:
	Umakefil 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/samples/direct_io/Umakefil,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Umakefil	18 Apr 2006 00:42:35 -0000	1.1
+++ Umakefil	4 May 2006 00:37:26 -0000	1.2
@@ -12,6 +12,7 @@
 			    "datatype/tools/dtdriver/decoder/audio[dtdrauddec]",
 			    "datatype/tools/dtdriver/decoder/video[dtdrviddec]",
 			    "datatype/tools/minicntx",
+                            "client/medpltfm[hxmedpltfmlib]",
 			    "client/common/container[contclntlib]",
 			    "client/common/system[sysclntlib]",
 			    "common/runtime[runtlib]",
@@ -21,6 +22,7 @@
 			    "common/system[syslib]",
 			    "common/fileio[fileiolib]")
 
+
 if project.IsDefined("HELIX_FEATURE_MINICONTEXT_PLAYBACK_NET"):
 	project.AddModuleLibraries( "client/netwksvc[netsvclib]",
 				    "common/netio[netiolib]",
@@ -176,6 +178,10 @@
 
 project.AddDefines( 'HELIX_FEATURE_VIDREND_UNTIMED_DECODE' )
 
-ProgramTarget('dtdrive')
+# the dtdriver engine relies on Producer headers that require
+# deprecated smartpointer implementation
+project.AddDefines( 'HELIX_FEATURE_ALLOW_DEPRECATED_SMARTPOINTERS' )
+
+ProgramTarget('directio')
 
 DependTarget()


From milko at helixcommunity.org  Wed May  3 17:41:23 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 19:34:28 2006
Subject: [Datatype-cvs] 
	tools/dtdriver/dtdrplin umakedll, 1.14, NONE umakelib, 1.7, NONE
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/dtdrplin
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv15490

Removed Files:
	umakedll umakelib 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


--- umakedll DELETED ---

--- umakelib DELETED ---


From milko at helixcommunity.org  Wed May  3 20:20:14 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Wed May  3 22:13:18 2006
Subject: [Datatype-cvs] 
	tools/minicntx minicntx, NONE, 1.1 minigenrcntx, NONE,
	1.1 minisubcntx, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/tools/minicntx
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv18334

Added Files:
	minicntx minigenrcntx minisubcntx 
Log Message:
Modified by: milko@real.com
Date: 5:02:06
Project: Atlas

Synopsis: Enables use of dtdriver in Atlas
Overview:
The changes here enable dtdriver to be used as a component under
the Atlas framework.  
dtdriver creates a child platform on a separate thread and overrides a
new thread-local scheduler for the childplatform to run on.  It also
aggregates its extended services into the child platform.

dtdrplin component now builds into legacy dtdr3260.dll contains a
media platform instance and can be run without the media platform layer)
and hxdtdriver.dll (smaller in size but relies on media platform being 
available in the passed in client context to create a child platform to 
run in a separate thread).

To support this, datatype/tool/minicntx library is build into minicntx and
minisubcntx for media platform inclusive and media platform child modes
respectively.

datatype/tools/dtdriver/apps/dtdrtest application has been updated to
function with either the hxdtdriver.dll or dtdr3260.dll (-P commoand
line option).


--- NEW FILE: minisubcntx ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,0)

project.AddDefines("HELIX_CONFIG_MINICONTEXT_SUBCONTEXT")

execfile("minigenrcntx", globals())

LibraryTarget('minisubcntx')
	
DependTarget()

--- NEW FILE: minicntx ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,0)

project.RemoveDefines("HELIX_CONFIG_MINICONTEXT_SUBCONTEXT")

execfile("minigenrcntx", globals())

LibraryTarget('minicntx')
	
DependTarget()

--- NEW FILE: minigenrcntx ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,1)

project.AddModuleIncludes( "common/include",
						   "common/runtime/pub",
						   "common/dbgtool/pub", 
						   "common/util/pub", 
						   "common/container/pub",
						   "common/system/pub",
						   "common/fileio/pub", 
						   "common/netio/pub",
						   "common/lang/xml/pub",
						   "client/include",
						   "client/medpltfm",
						   "client/medpltfm/pub",
						   "client/common/container/pub",
						   "client/common/system/pub",
						   "client/common/netio/pub",
						   "client/netwksvc/pub")

project.AddSources(	'minicntx.cpp')



From rishimathew at helixcommunity.org  Thu May  4 10:31:03 2006
From: rishimathew at helixcommunity.org (rishimathew@helixcommunity.org)
Date: Thu May  4 12:23:56 2006
Subject: [Datatype-cvs] CVSROOT avail,1.91,1.92
Message-ID: 

Update of /cvsroot/datatype/CVSROOT
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv5535/CVSROOT

Modified Files:
	avail 
Log Message:
giving dyek write access for the 'datatype' project

Index: avail
===================================================================
RCS file: /cvsroot/datatype/CVSROOT/avail,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- avail	29 Apr 2006 00:37:12 -0000	1.91
+++ avail	4 May 2006 17:31:00 -0000	1.92
@@ -60,7 +60,9 @@
 avail|dmarx
 avail|dmon
 avail|dwalker
+avail|dyek
 avail|ebalala
+avail|dyek
 avail|ebala
 avail|ehayashi
 avail|ehodge


From kliu at helixcommunity.org  Thu May  4 11:49:13 2006
From: kliu at helixcommunity.org (kliu@helixcommunity.org)
Date: Thu May  4 13:42:07 2006
Subject: [Datatype-cvs] CVSROOT avail,1.92,1.93
Message-ID: 

Update of /cvsroot/datatype/CVSROOT
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv22870/CVSROOT

Modified Files:
	avail 
Log Message:
giving jnwong write access for the 'datatype' project

Index: avail
===================================================================
RCS file: /cvsroot/datatype/CVSROOT/avail,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- avail	4 May 2006 17:31:00 -0000	1.92
+++ avail	4 May 2006 18:49:10 -0000	1.93
@@ -118,6 +118,7 @@
 avail|jmevissen
 avail|jnangull
 avail|jniemeyer
+avail|jnwong
 avail|joel_jacobson
 avail|jpreal_sean
 avail|jragon


From ehyche at helixcommunity.org  Thu May  4 13:58:55 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:51:48 2006
Subject: [Datatype-cvs] wm/common - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/common
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv15842/common

Log Message:
Directory /cvsroot/datatype/wm/common added to the repository



From ehyche at helixcommunity.org  Thu May  4 13:59:14 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:52:05 2006
Subject: [Datatype-cvs] wm/common/platform - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/common/platform
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv15940/platform

Log Message:
Directory /cvsroot/datatype/wm/common/platform added to the repository



From ehyche at helixcommunity.org  Thu May  4 13:59:14 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:52:06 2006
Subject: [Datatype-cvs] wm/common/pub - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/common/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv15940/pub

Log Message:
Directory /cvsroot/datatype/wm/common/pub added to the repository



From ehyche at helixcommunity.org  Thu May  4 13:59:25 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:52:16 2006
Subject: [Datatype-cvs] wm/common/platform/win32 - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/common/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv16001/win32

Log Message:
Directory /cvsroot/datatype/wm/common/platform/win32 added to the repository



From ehyche at helixcommunity.org  Thu May  4 13:59:48 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:52:39 2006
Subject: [Datatype-cvs] wm/common/pub/platform - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/common/pub/platform
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv16071/platform

Log Message:
Directory /cvsroot/datatype/wm/common/pub/platform added to the repository



From ehyche at helixcommunity.org  Thu May  4 13:59:58 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:52:49 2006
Subject: [Datatype-cvs] wm/common/pub/platform/win32 - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/common/pub/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv16084/win32

Log Message:
Directory /cvsroot/datatype/wm/common/pub/platform/win32 added to the repository



From ehyche at helixcommunity.org  Thu May  4 14:01:48 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:54:39 2006
Subject: [Datatype-cvs] wm/wmphost - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv20366/wmphost

Log Message:
Directory /cvsroot/datatype/wm/wmphost added to the repository



From ehyche at helixcommunity.org  Thu May  4 14:02:11 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:55:03 2006
Subject: [Datatype-cvs] wm/wmphost/platform - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost/platform
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv21149/platform

Log Message:
Directory /cvsroot/datatype/wm/wmphost/platform added to the repository



From ehyche at helixcommunity.org  Thu May  4 14:02:11 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:55:03 2006
Subject: [Datatype-cvs] wm/wmphost/wmpconsoleapp - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost/wmpconsoleapp
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv21149/wmpconsoleapp

Log Message:
Directory /cvsroot/datatype/wm/wmphost/wmpconsoleapp added to the repository



From ehyche at helixcommunity.org  Thu May  4 14:02:22 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:55:13 2006
Subject: [Datatype-cvs] wm/wmphost/platform/win32 - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv21446/win32

Log Message:
Directory /cvsroot/datatype/wm/wmphost/platform/win32 added to the repository



From ehyche at helixcommunity.org  Thu May  4 14:03:21 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:56:11 2006
Subject: [Datatype-cvs] wm/wmphost/wmpconsoleapp/platform - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost/wmpconsoleapp/platform
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv23191/platform

Log Message:
Directory /cvsroot/datatype/wm/wmphost/wmpconsoleapp/platform added to the repository



From ehyche at helixcommunity.org  Thu May  4 14:03:30 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:56:21 2006
Subject: [Datatype-cvs] wm/wmphost/wmpconsoleapp/platform/win32 - New
	directory
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost/wmpconsoleapp/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv23443/win32

Log Message:
Directory /cvsroot/datatype/wm/wmphost/wmpconsoleapp/platform/win32 added to the repository



From ehyche at helixcommunity.org  Thu May  4 14:04:51 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:57:46 2006
Subject: [Datatype-cvs] 
	wm/common Umakefil, NONE, 1.1 parse_opaque.cpp, NONE,
	1.1 win32.pcf, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/wm/common
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv25349/common

Added Files:
	Umakefil parse_opaque.cpp win32.pcf 
Log Message:
Transfer datatype/asf to datatype/wm

--- NEW FILE: win32.pcf ---
# 
# ***** BEGIN LICENSE BLOCK *****
# Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
# 
# The contents of this file, and the files included with this file,
# are subject to the current version of the RealNetworks Public
# Source License (the "RPSL") available at
# http://www.helixcommunity.org/content/rpsl unless you have licensed
# the file under the current version of the RealNetworks Community
# Source License (the "RCSL") available at
# http://www.helixcommunity.org/content/rcsl, in which case the RCSL
# will apply. You may also obtain the license terms directly from
# RealNetworks.  You may not use this file except in compliance with
# the RPSL or, if you have a valid RCSL with RealNetworks applicable
# to this file, the RCSL.  Please see the applicable RPSL or RCSL for
# the rights, obligations and limitations governing use of the
# contents of the file.
# 
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL") in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your version of
# this file only under the terms of the GPL, and not to allow others
# to use your version of this file under the terms of either the RPSL
# or RCSL, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient may
# use your version of this file under the terms of any one of the
# RPSL, the RCSL or the GPL.
# 
# This file is part of the Helix DNA Technology. RealNetworks is the
# developer of the Original Code and owns the copyrights in the
# portions it created.
# 
# This file, and the files included with this file, is distributed
# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
# ENJOYMENT OR NON-INFRINGEMENT.
# 
# Technology Compatibility Kit Test Suite(s) Location:
#    http://www.helixcommunity.org/content/tck
# 
# Contributor(s):
# 
# ***** END LICENSE BLOCK *****
# 

import os

if project.IsDefined("HELIX_FEATURE_ASF_AUDIO_CODEC_WMA9_DMO") or \
   project.IsDefined("HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO") or \
   project.IsDefined("HELIX_FEATURE_ASF_FILEFORMAT_WMFSDK"):
    project.AddSources("platform/win32/mediabuffer.cpp",
                       "platform/win32/allocmediabuffer.cpp",
                       "platform/win32/hxwmdefs.cpp")
    project.AddIncludes("pub/platform/win32")
    wmfsdk = GetSDKPath("wmfsdk")
    wmfsdk_include = os.path.join(wmfsdk, "include")
    wmfsdk_codec_include = os.path.join(wmfsdk, "codec", "include")
    project.AddIncludes(wmfsdk_include, wmfsdk_codec_include)

--- NEW FILE: parse_opaque.cpp ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#include "hxtypes.h"
#include "hxcom.h"
#include "ihxpckts.h"
#include "rule2flg.h"
#include "pckunpck.h"
#include "parse_opaque.h"


HX_RESULT ParseWMOpaqueData(IUnknown*           pContext,
                            IHXBuffer*          pBuffer,
                            HXWMOpaqueDataInfo* pInfo)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pContext && pBuffer && pInfo)
    {
        // Parse the opaque data
        BYTE*  pBuf  = pBuffer->GetBuffer();
        UINT32 ulLen = pBuffer->GetSize();
        // Get the number of substreams
        UINT16 usNumSubStreams = 0;
        retVal = UnpackUINT16BEInc(&pBuf, &ulLen, &usNumSubStreams);
        if (SUCCEEDED(retVal))
        {
            // Set the return value
            retVal = HXR_OUTOFMEMORY;
            // Create a RuleToFlagMap to hold the rule->substream map
            RuleToFlagMap* pRuleToSubStreamMap = new RuleToFlagMap;
            if (pRuleToSubStreamMap)
            {
                // Allocate an array of IHXBuffer*
                IHXBuffer** ppHdr = new IHXBuffer* [usNumSubStreams];
                if (ppHdr)
                {
                    // NULL out the array
                    memset(ppHdr, 0, sizeof(IHXBuffer*) * usNumSubStreams);
                    // Set the return value
                    retVal = HXR_FAIL;
                    // Unpack the rule to substream map
                    BYTE* pTmp = pRuleToSubStreamMap->unpack(pBuf, ulLen);
                    if (pTmp)
                    {
                        // Update the parsing variables
                        UINT32 ulBytesParsed = pTmp - pBuf;
                        pBuf  += ulBytesParsed;
                        ulLen -= ulBytesParsed;
                        // Clear the return value
                        retVal = HXR_OK;
                        // Now loop through and initialize each decoder with the substream header
                        for (UINT16 i = 0; i < usNumSubStreams && SUCCEEDED(retVal); i++)
                        {
                            // Read the substream header length
                            UINT32 ulSubStreamHdrLen = 0;
                            retVal = UnpackUINT32BEInc(&pBuf, &ulLen, &ulSubStreamHdrLen);
                            if (SUCCEEDED(retVal))
                            {
                                // Set the return value
                                retVal = HXR_FAIL;
                                // Sanity check on the length. This prevents
                                // a malicious substream header length
                                if (ulSubStreamHdrLen <= ulLen)
                                {
                                    // Create a buffer to hold the substream header
                                    retVal = CreateAndSetBufferCCF(ppHdr[i], pBuf, ulSubStreamHdrLen, pContext);
                                    if (SUCCEEDED(retVal))
                                    {
                                        // Advance the parsing variables
                                        pBuf  += ulSubStreamHdrLen;
                                        ulLen -= ulSubStreamHdrLen;
                                    }
                                }
                            }
                        }
                        if (SUCCEEDED(retVal))
                        {
                            // Assign the out parameters
                            pInfo->m_ulNumSubStreams     = (UINT32) usNumSubStreams;
                            pInfo->m_pRuleToSubStreamMap = pRuleToSubStreamMap;
                            pInfo->m_ppSubStreamHdr      = ppHdr;
                        }
                    }
                }
            }
        }
    }

    return retVal;
}

void ClearWMOpaqueDataInfo(HXWMOpaqueDataInfo* pInfo)
{
    if (pInfo)
    {
        HX_DELETE(pInfo->m_pRuleToSubStreamMap);
        if (pInfo->m_ulNumSubStreams && pInfo->m_ppSubStreamHdr)
        {
            for (UINT32 i = 0; i < pInfo->m_ulNumSubStreams; i++)
            {
                HX_RELEASE(pInfo->m_ppSubStreamHdr[i]);
            }
        }
        HX_VECTOR_DELETE(pInfo->m_ppSubStreamHdr);
        pInfo->m_ulNumSubStreams = 0;
    }
}

--- NEW FILE: Umakefil ---
# 
# ***** BEGIN LICENSE BLOCK *****
# Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
# 
# The contents of this file, and the files included with this file,
# are subject to the current version of the RealNetworks Public
# Source License (the "RPSL") available at
# http://www.helixcommunity.org/content/rpsl unless you have licensed
# the file under the current version of the RealNetworks Community
# Source License (the "RCSL") available at
# http://www.helixcommunity.org/content/rcsl, in which case the RCSL
# will apply. You may also obtain the license terms directly from
# RealNetworks.  You may not use this file except in compliance with
# the RPSL or, if you have a valid RCSL with RealNetworks applicable
# to this file, the RCSL.  Please see the applicable RPSL or RCSL for
# the rights, obligations and limitations governing use of the
# contents of the file.
# 
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL") in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your version of
# this file only under the terms of the GPL, and not to allow others
# to use your version of this file under the terms of either the RPSL
# or RCSL, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient may
# use your version of this file under the terms of any one of the
# RPSL, the RCSL or the GPL.
# 
# This file is part of the Helix DNA Technology. RealNetworks is the
# developer of the Original Code and owns the copyrights in the
# portions it created.
# 
# This file, and the files included with this file, is distributed
# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
# ENJOYMENT OR NON-INFRINGEMENT.
# 
# Technology Compatibility Kit Test Suite(s) Location:
#    http://www.helixcommunity.org/content/tck
# 
# Contributor(s):
# 
# ***** END LICENSE BLOCK *****
# 

UmakefileVersion(2,2)

project.AddModuleIncludes("common/include",
                          "common/util/pub",
                          "common/dbgtool/pub",
                          "common/container/pub",
                          "common/system/pub",
                          "common/runtime/pub",
                          "common/log/logutil/pub",
                          "datatype/rm/common/pub",
                          "datatype/rm/include")

project.AddSources("parse_opaque.cpp")

LibraryTarget("asfcomlib")

DependTarget()


From ehyche at helixcommunity.org  Thu May  4 14:04:52 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:57:46 2006
Subject: [Datatype-cvs] wm/common/pub parse_opaque.h,NONE,1.1
Message-ID: 

Update of /cvsroot/datatype/wm/common/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv25349/common/pub

Added Files:
	parse_opaque.h 
Log Message:
Transfer datatype/asf to datatype/wm

--- NEW FILE: parse_opaque.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef PARSE_OPAQUE_H
#define PARSE_OPAQUE_H

// Forward declarations
class RuleToFlagMap;
_INTERFACE IHXBuffer;

typedef struct _HXWMOpaqueDataInfo
{
    UINT32         m_ulNumSubStreams;
    RuleToFlagMap* m_pRuleToSubStreamMap;
    IHXBuffer**    m_ppSubStreamHdr;
}
HXWMOpaqueDataInfo;

HX_RESULT ParseWMOpaqueData(IUnknown*           pContext,
                            IHXBuffer*          pBuffer,
                            HXWMOpaqueDataInfo* pInfo);

void ClearWMOpaqueDataInfo(HXWMOpaqueDataInfo* pInfo);


#endif /* #ifndef PARSE_OPAQUE_H */


From ehyche at helixcommunity.org  Thu May  4 14:04:52 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:57:47 2006
Subject: [Datatype-cvs] wm/common/platform/win32 allocmediabuffer.cpp, NONE,
	1.1 hxwmdefs.cpp, NONE, 1.1 mediabuffer.cpp, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/wm/common/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv25349/common/platform/win32

Added Files:
	allocmediabuffer.cpp hxwmdefs.cpp mediabuffer.cpp 
Log Message:
Transfer datatype/asf to datatype/wm

--- NEW FILE: hxwmdefs.cpp ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#include "hxtypes.h"
#include "hxcom.h"
#include "safestring.h"
#include "wmsdk.h"
#include "hxwmdefs.h"

typedef struct _WMGUID2String
{
    GUID        m_guid;
    const char* m_pszStr;
}
WMGUID2String;

#define HX_NUM_WM_GUIDS  52

static const WMGUID2String g_WMGuid2String[HX_NUM_WM_GUIDS] =
{
    {WMFORMAT_VideoInfo,              "WMFORMAT_VideoInfo"},
    {WMFORMAT_WaveFormatEx,           "WMFORMAT_WaveFormatEx"},
    {WMFORMAT_MPEG2Video,             "WMFORMAT_MPEG2Video"},
    {WMFORMAT_WebStream,              "WMFORMAT_WebStream"},
    {WMFORMAT_Script,                 "WMFORMAT_Script"},
    {WMMEDIATYPE_Video,               "WMMEDIATYPE_Video"},
    {WMMEDIATYPE_Audio,               "WMMEDIATYPE_Audio"},
    {WMMEDIATYPE_Script,              "WMMEDIATYPE_Script"},
    {WMMEDIATYPE_FileTransfer,        "WMMEDIATYPE_FileTransfer"},
    {WMMEDIATYPE_Image,               "WMMEDIATYPE_Image"},
    {WMMEDIATYPE_Text,                "WMMEDIATYPE_Text"},
    {WMMEDIASUBTYPE_Base,             "WMMEDIASUBTYPE_Base"},
    {WMMEDIASUBTYPE_RGB1,             "WMMEDIASUBTYPE_RGB1"},
    {WMMEDIASUBTYPE_RGB4,             "WMMEDIASUBTYPE_RGB4"},
    {WMMEDIASUBTYPE_RGB8,             "WMMEDIASUBTYPE_RGB8"},
    {WMMEDIASUBTYPE_RGB565,           "WMMEDIASUBTYPE_RGB565"},
    {WMMEDIASUBTYPE_RGB555,           "WMMEDIASUBTYPE_RGB555"},
    {WMMEDIASUBTYPE_RGB24,            "WMMEDIASUBTYPE_RGB24"},
    {WMMEDIASUBTYPE_RGB32,            "WMMEDIASUBTYPE_RGB32"},
    {WMMEDIASUBTYPE_I420,             "WMMEDIASUBTYPE_I420"},
    {WMMEDIASUBTYPE_IYUV,             "WMMEDIASUBTYPE_IYUV"},
    {WMMEDIASUBTYPE_YV12,             "WMMEDIASUBTYPE_YV12"},
    {WMMEDIASUBTYPE_YUY2,             "WMMEDIASUBTYPE_YUY2"},
    {WMMEDIASUBTYPE_P422,             "WMMEDIASUBTYPE_P422"},
    {WMMEDIASUBTYPE_UYVY,             "WMMEDIASUBTYPE_UYVY"},
    {WMMEDIASUBTYPE_YVYU,             "WMMEDIASUBTYPE_YVYU"},
    {WMMEDIASUBTYPE_YVU9,             "WMMEDIASUBTYPE_YVU9"},
    {WMMEDIASUBTYPE_PCM,              "WMMEDIASUBTYPE_PCM"},
    {WMMEDIASUBTYPE_DRM,              "WMMEDIASUBTYPE_DRM"},
    {WMMEDIASUBTYPE_WebStream,        "WMMEDIASUBTYPE_WebStream"},
    {WMMEDIASUBTYPE_VIDEOIMAGE,       "WMMEDIASUBTYPE_VIDEOIMAGE"},
    {WMMEDIASUBTYPE_ACELPnet,         "WMMEDIASUBTYPE_ACELPnet"},
    {WMMEDIASUBTYPE_MP3,              "WMMEDIASUBTYPE_MP3"},
    {WMMEDIASUBTYPE_MP43,             "WMMEDIASUBTYPE_MP43"},
    {WMMEDIASUBTYPE_MP4S,             "WMMEDIASUBTYPE_MP4S"},
    {WMMEDIASUBTYPE_MPEG2_VIDEO,      "WMMEDIASUBTYPE_MPEG2_VIDEO"},
    {WMMEDIASUBTYPE_MSS1,             "WMMEDIASUBTYPE_MSS1"},
    {WMMEDIASUBTYPE_MSS2,             "WMMEDIASUBTYPE_MSS2"},
    {WMMEDIASUBTYPE_WMVP,             "WMMEDIASUBTYPE_WMVP"},
    {WMMEDIASUBTYPE_WVP2,             "WMMEDIASUBTYPE_WVP2"},
    {WMMEDIASUBTYPE_WMAudio_Lossless, "WMMEDIASUBTYPE_WMAudio_Lossless"},
    {WMMEDIASUBTYPE_WMAudioV2,        "WMMEDIASUBTYPE_WMAudioV2"},
    {WMMEDIASUBTYPE_WMAudioV7,        "WMMEDIASUBTYPE_WMAudioV7"},
    {WMMEDIASUBTYPE_WMAudioV8,        "WMMEDIASUBTYPE_WMAudioV8"},
    {WMMEDIASUBTYPE_WMAudioV9,        "WMMEDIASUBTYPE_WMAudioV9"},
    {WMMEDIASUBTYPE_M4S2,             "WMMEDIASUBTYPE_M4S2"},
    {WMMEDIASUBTYPE_WMSP1,            "WMMEDIASUBTYPE_WMSP1"},
    {WMMEDIASUBTYPE_WMV1,             "WMMEDIASUBTYPE_WMV1"},
    {WMMEDIASUBTYPE_WMV2,             "WMMEDIASUBTYPE_WMV2"},
    {WMMEDIASUBTYPE_WMV3,             "WMMEDIASUBTYPE_WMV3"},
    {WMMEDIASUBTYPE_WMVA,             "WMMEDIASUBTYPE_WMVA"},
    {WMSCRIPTTYPE_TwoStrings,         "WMSCRIPTTYPE_TwoStrings"}
};

const char* GetWMGUIDString(GUID* pGUID, char* pszBuf, UINT32 ulBufLen)
{
    const char* pszRet = NULL;

    for (UINT32 i = 0; i < HX_NUM_WM_GUIDS; i++)
    {
        if (IsEqualIID(*pGUID, g_WMGuid2String[i].m_guid))
        {
            pszRet = g_WMGuid2String[i].m_pszStr;
            break;
        }
    }
    if (!pszRet)
    {
        SafeSprintf(pszBuf, ulBufLen, "(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
                    pGUID->Data1,
                    pGUID->Data2,
                    pGUID->Data3,
                    pGUID->Data4[0],
                    pGUID->Data4[1],
                    pGUID->Data4[2],
                    pGUID->Data4[3],
                    pGUID->Data4[4],
                    pGUID->Data4[5],
                    pGUID->Data4[6],
                    pGUID->Data4[7]);
        pszRet = pszBuf;
    }

    return pszRet;
}

--- NEW FILE: allocmediabuffer.cpp ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#include "hxtypes.h"
#include "hxcom.h"
#include "hxalloc.h"
#include "allocmediabuffer.h"
#define HELIX_FEATURE_LOGLEVEL_NONE // comment out to use logging
#include "hxtlogutil.h"

CAllocatorMediaBuffer::CAllocatorMediaBuffer(BYTE* pBuf, UINT32 ulLen, IHX20MemoryAllocator* pAlloc)
    : m_lRefCount(0)
    , m_pBuffer(pBuf)
    , m_ulBufferLen(ulLen)
    , m_ulDataLen(ulLen)
    , m_pAllocator(pAlloc)
{
    HXLOGL4(HXLOG_WMV9, "Construct CAllocatorMediaBuffer(0x%08x,%lu,0x%08x) this=0x%08x",
            pBuf, ulLen, pAlloc, this);
    HX_ADDREF(m_pAllocator);
}

CAllocatorMediaBuffer::~CAllocatorMediaBuffer()
{
    HXLOGL4(HXLOG_WMV9, "Destruct CAllocatorMediaBuffer() this=0x%08x", this);
    // Since the allocator owns this memory, we can
    // now tell the allocator we are done with it
    if (m_pAllocator)
    {
        m_pAllocator->ReleasePacketPtr(m_pBuffer);
    }
    HX_RELEASE(m_pAllocator);
    m_pBuffer     = NULL;
    m_ulBufferLen = 0;
    m_ulDataLen   = 0;
}

STDMETHODIMP CAllocatorMediaBuffer::QueryInterface(REFIID riid, void** ppvObj)
{
    HRESULT hr = E_FAIL;

    if (ppvObj)
    {
        // Clear the return value
        hr = S_OK;
        // NULL out by default
        *ppvObj = NULL;
        // Switch based on IID
        if (IsEqualIID(riid, IID_IUnknown))
        {
            *ppvObj = (IUnknown*) (IMediaBuffer*) this;
        }
        else if (IsEqualIID(riid, IID_IMediaBuffer))
        {
            *ppvObj = (IMediaBuffer*) this;
        }
        else
        {
            hr = E_NOINTERFACE;
        }
        if (SUCCEEDED(hr))
        {
            AddRef();
        }
    }

    return hr;
}

STDMETHODIMP_(ULONG32) CAllocatorMediaBuffer::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

STDMETHODIMP_(ULONG32) CAllocatorMediaBuffer::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}


STDMETHODIMP CAllocatorMediaBuffer::SetLength(UINT32 ulLength)
{
    HXLOGL4(HXLOG_WMV9, "CAllocatorMediaBuffer::SetLength(%lu) this=0x%08x", ulLength, this);
    HRESULT hr = E_FAIL;

    if (m_pBuffer && ulLength <= m_ulBufferLen)
    {
        m_ulDataLen = ulLength;
        hr          = S_OK;
    }

    return hr;
}

STDMETHODIMP CAllocatorMediaBuffer::GetMaxLength(UINT32* pulMaxLength)
{
    HXLOGL4(HXLOG_WMA9, "CAllocatorMediaBuffer::GetMaxLength() this=0x%08x m_ulBufferLen=%lu", this, m_ulBufferLen);
    HRESULT hr = E_POINTER;

    if (pulMaxLength)
    {
        *pulMaxLength = m_ulBufferLen;
        hr            = S_OK;
    }

    return hr;
}

STDMETHODIMP CAllocatorMediaBuffer::GetBufferAndLength(BYTE** ppBuffer, UINT32* pulLength)
{
    HXLOGL4(HXLOG_WMV9, "CAllocatorMediaBuffer::GetBufferAndLength() this=0x%08x m_pBuffer=0x%08x m_ulBufferLen=%lu",
            this, m_pBuffer, m_ulBufferLen);
    HRESULT hr = E_POINTER;

    // One or the other can be NULL, but not both
    if (ppBuffer || pulLength)
    {
        if (ppBuffer)
        {
            *ppBuffer  = m_pBuffer;
        }
        if (pulLength)
        {
            *pulLength = m_ulDataLen;
        }
        hr = S_OK;
    }

    return hr;
}

HX_RESULT CAllocatorMediaBuffer::CreateAllocatorMediaBuffer(BYTE*                 pBuf,
                                                            UINT32                ulLen,
                                                            IHX20MemoryAllocator* pAlloc,
                                                            IMediaBuffer**        ppMediaBuffer)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pBuf && ulLen && pAlloc && ppMediaBuffer)
    {
        // Allocate a CAllocatorMediaBuffer object
        CAllocatorMediaBuffer* pMediaBuffer = new CAllocatorMediaBuffer(pBuf, ulLen, pAlloc);
        if (pMediaBuffer)
        {
            // QueryInterface for the IMediaBuffer interface
            HRESULT hr = pMediaBuffer->QueryInterface(IID_IMediaBuffer, (void**) ppMediaBuffer);
            if (hr == S_OK)
            {
                retVal = HXR_OK;
            }
        }
        if (FAILED(retVal))
        {
            HX_DELETE(pMediaBuffer);
        }
    }

    return retVal;
}


--- NEW FILE: mediabuffer.cpp ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#include "hxtypes.h"
#include "hxcom.h"
#include "mediabuffer.h"
#define HELIX_FEATURE_LOGLEVEL_NONE // comment out to use logging
#include "hxtlogutil.h"

CMediaBuffer::CMediaBuffer(BYTE* pBuf, UINT32 ulLen, HXBOOL bOwn)
    : m_lRefCount(0)
    , m_pBuffer(NULL)
    , m_ulBufferLen(0)
    , m_ulDataLen(0)
    , m_bBufferOwner(bOwn)
{
    HXLOGL4(HXLOG_WMA9, "Construct CMediaBuffer(0x%08x,%lu,%lu) this=0x%08x", pBuf, ulLen, bOwn, this);
    if (pBuf && ulLen)
    {
        if (m_bBufferOwner)
        {
            m_pBuffer = new BYTE [ulLen];
            if (m_pBuffer)
            {
                // Copy everything into the buffer
                memcpy(m_pBuffer, pBuf, ulLen);
                // Set the members
                m_ulBufferLen = ulLen;
                m_ulDataLen   = ulLen;
            }
        }
        else
        {
            // The user owns the buffer, we just
            // hold a pointer to it
            m_pBuffer = pBuf;
            // Set the members
            m_ulBufferLen = ulLen;
            m_ulDataLen   = ulLen;
        }
    }
}

CMediaBuffer::~CMediaBuffer()
{
    HXLOGL4(HXLOG_WMA9, "Destruct CMediaBuffer() this=0x%08x", this);
    if (m_bBufferOwner)
    {
        HX_VECTOR_DELETE(m_pBuffer);
    }
    else
    {
        m_pBuffer = NULL;
    }
    m_ulBufferLen = 0;
    m_ulDataLen   = 0;
}

STDMETHODIMP CMediaBuffer::QueryInterface(REFIID riid, void** ppvObj)
{
    HRESULT hr = E_FAIL;

    if (ppvObj)
    {
        // Clear the return value
        hr = S_OK;
        // NULL out by default
        *ppvObj = NULL;
        // Switch based on IID
        if (IsEqualIID(riid, IID_IUnknown))
        {
            *ppvObj = (IUnknown*) (IMediaBuffer*) this;
        }
        else if (IsEqualIID(riid, IID_IMediaBuffer))
        {
            *ppvObj = (IMediaBuffer*) this;
        }
        else
        {
            hr = E_NOINTERFACE;
        }
        if (SUCCEEDED(hr))
        {
            AddRef();
        }
    }

    return hr;
}

STDMETHODIMP_(ULONG32) CMediaBuffer::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

STDMETHODIMP_(ULONG32) CMediaBuffer::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}


STDMETHODIMP CMediaBuffer::SetLength(UINT32 ulLength)
{
    HXLOGL4(HXLOG_WMA9, "CMediaBuffer::SetLength(%lu) this=0x%08x", ulLength, this);
    HRESULT hr = E_FAIL;

    if (m_pBuffer && ulLength <= m_ulBufferLen)
    {
        m_ulDataLen = ulLength;
        hr          = S_OK;
    }

    return hr;
}

STDMETHODIMP CMediaBuffer::GetMaxLength(UINT32* pulMaxLength)
{
    HXLOGL4(HXLOG_WMA9, "CMediaBuffer::GetMaxLength() this=0x%08x m_ulBufferLen=%lu", this, m_ulBufferLen);
    HRESULT hr = E_POINTER;

    if (pulMaxLength)
    {
        *pulMaxLength = m_ulBufferLen;
        hr            = S_OK;
    }

    return hr;
}

STDMETHODIMP CMediaBuffer::GetBufferAndLength(BYTE** ppBuffer, UINT32* pulLength)
{
    HXLOGL4(HXLOG_WMA9, "CMediaBuffer::GetBufferAndLength() this=0x%08x m_pBuffer=0x%08x m_ulBufferLen=%lu",
            this, m_pBuffer, m_ulBufferLen);
    HRESULT hr = E_POINTER;

    // One or the other can be NULL, but not both
    if (ppBuffer || pulLength)
    {
        if (ppBuffer)
        {
            *ppBuffer  = m_pBuffer;
        }
        if (pulLength)
        {
            *pulLength = m_ulDataLen;
        }
        hr = S_OK;
    }

    return hr;
}

HX_RESULT CMediaBuffer::CreateMediaBuffer(BYTE* pBuf, UINT32 ulLen, HXBOOL bCopy, IMediaBuffer** ppMediaBuffer)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pBuf && ulLen && ppMediaBuffer)
    {
        // Allocate a CMediaBuffer object
        CMediaBuffer* pMediaBuffer = new CMediaBuffer(pBuf, ulLen, bCopy);
        if (pMediaBuffer)
        {
            // Get the max length to make sure alloc succeeded
            UINT32 ulTmp = 0;
            HRESULT hr = pMediaBuffer->GetMaxLength(&ulTmp);
            if (hr == S_OK && ulTmp == ulLen)
            {
                // QueryInterface for the IMediaBuffer interface
                hr = pMediaBuffer->QueryInterface(IID_IMediaBuffer, (void**) ppMediaBuffer);
                if (hr == S_OK)
                {
                    retVal = HXR_OK;
                }
            }
        }
        if (FAILED(retVal))
        {
            HX_DELETE(pMediaBuffer);
        }
    }

    return retVal;
}



From ehyche at helixcommunity.org  Thu May  4 14:04:52 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:57:47 2006
Subject: [Datatype-cvs] 
	wm/common/pub/platform/win32 allocmediabuffer.h, NONE,
	1.1 hxwmdefs.h, NONE, 1.1 mediabuffer.h, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/wm/common/pub/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv25349/common/pub/platform/win32

Added Files:
	allocmediabuffer.h hxwmdefs.h mediabuffer.h 
Log Message:
Transfer datatype/asf to datatype/wm

--- NEW FILE: hxwmdefs.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef HXWMDEFS_H
#define HXWMDEFS_H

const char* GetWMGUIDString(GUID* pGUID, char* pszBuf, UINT32 ulBufLen);

#endif /* #ifndef HXWMDEFS_H */

--- NEW FILE: mediabuffer.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef MEDIABUFFER_H
#define MEDIABUFFER_H

#include "dmo.h"

class CMediaBuffer : public IMediaBuffer
{
public:
    CMediaBuffer(BYTE* pBuf, UINT32 ulLen, HXBOOL bOwn);
    virtual ~CMediaBuffer();

    // IUnknown methods
    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)  (THIS);
    STDMETHOD_(ULONG32,Release) (THIS);

    // IMediaBuffer methods
    STDMETHOD(SetLength)          (THIS_ UINT32 ulLength);
    STDMETHOD(GetMaxLength)       (THIS_ UINT32* pulMaxLength);
    STDMETHOD(GetBufferAndLength) (THIS_ BYTE** ppBuffer, UINT32* pulLength);

    // CMediaBuffer methods
    static HX_RESULT CreateMediaBuffer(BYTE* pBuf, UINT32 ulLen, HXBOOL bCopy, IMediaBuffer** ppMediaBuffer);
protected:
    INT32    m_lRefCount;
    BYTE*    m_pBuffer;
    UINT32   m_ulBufferLen;
    UINT32   m_ulDataLen;
    HXBOOL   m_bBufferOwner;
};

#endif /* #ifndef MEDIABUFFER_H */

--- NEW FILE: allocmediabuffer.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef ALLOCMEDIABUFFER_H
#define ALLOCMEDIABUFFER_H

// Includes
#include "dmo.h"

// Forward declarations
class IHX20MemoryAllocator;

class CAllocatorMediaBuffer : public IMediaBuffer
{
public:
    CAllocatorMediaBuffer(BYTE* pBuf, UINT32 ulLen, IHX20MemoryAllocator* pAlloc);
    virtual ~CAllocatorMediaBuffer();

    // IUnknown methods
    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)  (THIS);
    STDMETHOD_(ULONG32,Release) (THIS);

    // IMediaBuffer methods
    STDMETHOD(SetLength)          (THIS_ UINT32 ulLength);
    STDMETHOD(GetMaxLength)       (THIS_ UINT32* pulMaxLength);
    STDMETHOD(GetBufferAndLength) (THIS_ BYTE** ppBuffer, UINT32* pulLength);

    // CAllocatorMediaBuffer methods
    static HX_RESULT CreateAllocatorMediaBuffer(BYTE*                 pBuf,
                                                UINT32                ulLen,
                                                IHX20MemoryAllocator* pAlloc,
                                                IMediaBuffer**        ppMediaBuffer);
protected:
    INT32                 m_lRefCount;
    BYTE*                 m_pBuffer;
    UINT32                m_ulBufferLen;
    UINT32                m_ulDataLen;
    IHX20MemoryAllocator* m_pAllocator;
};

#endif /* #ifndef ALLOCMEDIABUFFER_H */


From ehyche at helixcommunity.org  Thu May  4 14:04:52 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:57:47 2006
Subject: [Datatype-cvs] wm/wmphost Umakefil, NONE, 1.1 wmphost.ver, NONE,
	1.1 wmphostdll, NONE, 1.1 wmphostdll_win32.pcf, NONE,
	1.1 wmphostlib, NONE, 1.1 wmphostlib_win32.pcf, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv25349/wmphost

Added Files:
	Umakefil wmphost.ver wmphostdll wmphostdll_win32.pcf 
	wmphostlib wmphostlib_win32.pcf 
Log Message:
Transfer datatype/asf to datatype/wm

--- NEW FILE: wmphostlib_win32.pcf ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

import os

project.AddModuleIncludes("common/include",
                          "common/runtime/pub",
                          "common/dbgtool/pub",
                          "common/util/pub",
                          "common/container/pub",
                          "common/system/pub",
                          "common/log/logutil/pub",
                          "datatype/smil/include",
                          "datatype/common/basehost/pub")

wmpsdk = GetSDKPath("wmpsdk")
wmpsdk_include = os.path.join(wmpsdk, "include")

project.AddIncludes("platform/win32",
                    wmpsdk_include)

project.AddSources("platform/win32/wmp_hosted_factory.cpp",
                   "platform/win32/asf_hosted_fileformat.cpp",
                   "platform/win32/asf_hosted_renderer.cpp",
                   "platform/win32/asx_playlist_fileformat.cpp",
                   "platform/win32/asx_playlist_renderer.cpp",
                   "platform/win32/wmp_guest_player.cpp")

--- NEW FILE: wmphostdll ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

if "win32" in sysinfo.family_list:
    DLLTarget("wmphost")
else:
    EmptyTarget()

DependTarget()

--- NEW FILE: wmphostdll_win32.pcf ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

import os

wmpsdk = GetSDKPath("wmpsdk")
wmpsdk_include = os.path.join(wmpsdk, "include")

project.AddModuleIncludes("common/include")

project.AddModuleLibraries("common/runtime[runtlib]",
                           "common/dbgtool[debuglib]", 
                           "common/util[utillib]", 
                           "common/container[contlib]",
                           "common/system[syslib]",
                           "common/log/logutil[logutillib]",
                           "datatype/common/basehost[basehostlib]",
                           "datatype/common/util[dtutillib]",
                           "datatype/asf/wmphost[wmphostlib]")

project.AddIncludes("platform/win32",
                    wmpsdk_include)

project.AddSources("platform/win32/wmp_hosted_guids.cpp",
                   "platform/win32/wmp_hosted_dll.cpp",
                   "platform/win32/wmp_hosted.cpp",
                   "platform/win32/wmp_hosted.rc",
                   "platform/win32/wmp_hosted_i.c")

project.ExportFunction("RMACreateInstance",
                       "IUnknown** ppObj",
                       "common/include",
                       "hxcom.h")
project.ExportFunction("CanUnload2", "void")
if not project.IsDefined("HELIX_FEATURE_DLLACCESS_CLIENT"):
    project.ExportFunction("SetDLLAccessPath", "const char* pszPath")

project.AddSystemLibraries("version.lib", 
			   "kernel32.lib", 
			   "user32.lib", 
			   "advapi32.lib", 
			   "gdi32.lib",
			   "wsock32.lib",
                           "ole32.lib")

--- NEW FILE: wmphost.ver ---
/* THIS FILE IS GENERATED BY THE BUILD SYSTEM -- DO NOT EDIT
 * Copyright (C) 1997-2002 RealNetworks Corporation. All rights reserved.
 */
#ifdef _MACINTOSH
#define TARVER_ULONG32_VERSION ((10<<28)|(0<<20)|(0<<12)|7491)
#else
#define TARVER_ULONG32_VERSION (UINT32)((10L<<28L)|(0L<<20L)|(0L<< 12L)|7491L)
#endif
#define TARVER_LIST_VERSION 10,0,0,7491
#define TARVER_MAJOR_VERSION 10
#define TARVER_MINOR_VERSION 0
#define TARVER_STRING_VERSION "10.0.0.7491"
#define TARVER_STR_BUILD_NAME ""

--- NEW FILE: wmphostlib ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

if "win32" in sysinfo.family_list:
    LibraryTarget("wmphostlib")
    DependTarget()
else:
    EmptyTarget()


--- NEW FILE: Umakefil ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

MultiTargetMake("wmphostlib", "wmphostdll")



From ehyche at helixcommunity.org  Thu May  4 14:04:53 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:57:54 2006
Subject: [Datatype-cvs] wm/wmphost/wmpconsoleapp Umakefil, NONE,
	1.1 win32.pcf, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost/wmpconsoleapp
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv25349/wmphost/wmpconsoleapp

Added Files:
	Umakefil win32.pcf 
Log Message:
Transfer datatype/asf to datatype/wm

--- NEW FILE: win32.pcf ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

import os

wmpsdk = GetSDKPath("wmpsdk")
wmpsdk_include = os.path.join(wmpsdk, "include")

project.AddIncludes("platform/win32",
                    wmpsdk_include)

project.AddSources("platform/win32/wmpconsole.cpp",
                   "platform/win32/stdafx.cpp",
                   "platform/win32/gettickcount.cpp",
                   "platform/win32/CWMPEventDispatch.cpp")

project.AddSystemLibraries("version.lib", 
			   "kernel32.lib", 
			   "user32.lib", 
			   "advapi32.lib", 
			   "gdi32.lib",
			   "wsock32.lib",
                           "ole32.lib")

--- NEW FILE: Umakefil ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

if "win32" in sysinfo.family_list:
    ProgramTarget("wmpconsole")
else:
    EmptyTarget()

DependTarget()



From ehyche at helixcommunity.org  Thu May  4 14:04:53 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:57:54 2006
Subject: [Datatype-cvs] wm/wmphost/platform/win32 Resource.h, NONE,
	1.1 asf_hosted_fileformat.cpp, NONE,
	1.1 asf_hosted_fileformat.h, NONE, 1.1 asf_hosted_renderer.cpp,
	NONE, 1.1 asf_hosted_renderer.h, NONE,
	1.1 asx_playlist_fileformat.cpp, NONE,
	1.1 asx_playlist_fileformat.h, NONE,
	1.1 asx_playlist_renderer.cpp, NONE,
	1.1 asx_playlist_renderer.h, NONE, 1.1 stdafx.h, NONE,
	1.1 wmp_guest_player.cpp, NONE, 1.1 wmp_guest_player.h, NONE,
	1.1 wmp_hosted.cpp, NONE, 1.1 wmp_hosted.h, NONE,
	1.1 wmp_hosted.idl, NONE, 1.1 wmp_hosted.rc, NONE,
	1.1 wmp_hosted.rgs, NONE, 1.1 wmp_hosted_dll.cpp, NONE,
	1.1 wmp_hosted_factory.cpp, NONE, 1.1 wmp_hosted_factory.h,
	NONE, 1.1 wmp_hosted_guids.cpp, NONE, 1.1 wmp_hosted_i.c, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv25349/wmphost/platform/win32

Added Files:
	Resource.h asf_hosted_fileformat.cpp asf_hosted_fileformat.h 
	asf_hosted_renderer.cpp asf_hosted_renderer.h 
	asx_playlist_fileformat.cpp asx_playlist_fileformat.h 
	asx_playlist_renderer.cpp asx_playlist_renderer.h stdafx.h 
	wmp_guest_player.cpp wmp_guest_player.h wmp_hosted.cpp 
	wmp_hosted.h wmp_hosted.idl wmp_hosted.rc wmp_hosted.rgs 
	wmp_hosted_dll.cpp wmp_hosted_factory.cpp wmp_hosted_factory.h 
	wmp_hosted_guids.cpp wmp_hosted_i.c 
Log Message:
Transfer datatype/asf to datatype/wm

--- NEW FILE: wmp_hosted_dll.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#include "hxtypes.h"
#include "hxwintyp.h"
#include "hxcom.h"
#include "hxplugn.h"
#include "ihxpckts.h"
#include "dllpath.h"
#include "baseobj.h"
#include "wmp_hosted_factory.h"

#if !defined(HELIX_FEATURE_DLLACCESS_CLIENT)
ENABLE_DLLACCESS_PATHS(wmphostfactory);
#endif /* #if !defined(HELIX_FEATURE_DLLACCESS_CLIENT) */

STDAPI ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppUnk)   
{   
    return CWMPHostedPluginFactory::HXCreateInstance(ppUnk);
}   

STDAPI ENTRYPOINT(CanUnload2)(void)
{
    return (CHXBaseCountingObject::ObjectsActive() > 0 ? HXR_FAIL : HXR_OK);
}

--- NEW FILE: asx_playlist_fileformat.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#include "hxtypes.h"
#include "hxcom.h"
#include "asx_playlist_fileformat.h"
#include "wmp_guest_player.h"
#include "wmphost.ver"
#include "hxver.h"

#include "hxheap.h"
#ifdef _DEBUG
#undef HX_THIS_FILE             
static const char HX_THIS_FILE[] = __FILE__;
#endif

const char* const CASXHostedFileFormat::m_pszDescription            = "Helix Hosted Windows Media Player ASX Fileformat Plugin";
const char* const CASXHostedFileFormat::m_ppszFileMimeType[]        = {"application/vnd.ms-asx", "audio/x-ms-wax", "video/x-ms-wvx", NULL};
const char* const CASXHostedFileFormat::m_ppszFileExtension[]       = {"asx", "wax", "wvx", NULL};
const char* const CASXHostedFileFormat::m_ppszFileOpenName[]        = {"Windows Media Files (*.asx,*.wax,*.wvx)", NULL};
const char* const CASXHostedFileFormat::m_pszMimeType               = "application/vnd.rn-hostedwmp-asx";
const char* const CASXHostedFileFormat::m_ppszSchemeExtensionInfo[] = {"file:asx", "file:wax", "file:wvx",
                                                                       "http:asx", "http:wax", "http:wvx",
                                                                       "rtsp:asx", "rtsp:wax", "rtsp:wvx", NULL};


STDMETHODIMP CASXHostedFileFormat::GetFileFormatInfo(REF(const char**) rppszFileMimeTypes,
                                                     REF(const char**) rppszFileExtensions,
                                                     REF(const char**) rppszFileOpenNames)
{
    rppszFileMimeTypes  = (const char**) m_ppszFileMimeType;
    rppszFileExtensions = (const char**) m_ppszFileExtension;
    rppszFileOpenNames  = (const char**) m_ppszFileOpenName;

    return HXR_OK;
}

HX_RESULT STDAPICALLTYPE CASXHostedFileFormat::HXCreateInstance(IUnknown** ppIUnknown)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppIUnknown)
    {
        // Set default
        *ppIUnknown = NULL;
        // Create the object
        CASXHostedFileFormat* pObj = new CASXHostedFileFormat();
        if (pObj)
        {
            // QI for IUnknown
            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);
        }
        if (FAILED(retVal))
        {
            HX_DELETE(pObj);
        }
    }

    return retVal;
}

STDMETHODIMP CASXHostedFileFormat::GetDescription(REF(const char*) rpszDescription)
{
    rpszDescription = m_pszDescription;
    return HXR_OK;
}

STDMETHODIMP CASXHostedFileFormat::CreateGuestPlayer(REF(IHXGuestPlayer*) rpPlayer)
{
    return CWMPGuestPlayer::CreateGuestPlayer(rpPlayer);
}

STDMETHODIMP CASXHostedFileFormat::GetMimeType(REF(const char*) rpszMimeType)
{
    rpszMimeType = m_pszMimeType;
    return HXR_OK;
}

STDMETHODIMP CASXHostedFileFormat::GetSchemeExtensionInfo(REF(const char**) rppszSchemeExtensionInfo)
{
    rppszSchemeExtensionInfo = (const char**) m_ppszSchemeExtensionInfo;
    return HXR_OK;
}

--- NEW FILE: stdafx.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#pragma once

#ifndef STRICT
#define STRICT
#endif

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER				// Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0400		// Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif

#ifndef _WIN32_WINNT		// Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0400	// Change this to the appropriate value to target Windows 2000 or later.
#endif						

#ifndef _WIN32_WINDOWS		// Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif

#ifndef _WIN32_IE			// Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0400	// Change this to the appropriate value to target IE 5.0 or later.
#endif

#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit

// turns off ATL's hiding of some common and often safely ignored warning messages
#define _ATL_ALL_WARNINGS


#include "resource.h"
#include 
#include 

using namespace ATL;
--- NEW FILE: wmp_hosted_i.c ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */



/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */

/* link this file in with the server and any clients */


 /* File created by MIDL compiler version 6.00.0361 */
/* at Tue Mar 07 23:18:04 2006
 */
/* Compiler settings for .\wmp_hosted.idl:
    Oicf, W1, Zp8, env=Win32 (32b run)
    protocol : dce , ms_ext, c_ext, robust
    error checks: allocation ref bounds_check enum stub_data 
    VC __declspec() decoration level: 
         __declspec(uuid()), __declspec(selectany), __declspec(novtable)
         DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING(  )

#if !defined(_M_IA64) && !defined(_M_AMD64)


#pragma warning( disable: 4049 )  /* more than 64k source lines */


#ifdef __cplusplus
extern "C"{
#endif 


#include 
#include 

#ifdef _MIDL_USE_GUIDDEF_

#ifndef INITGUID
#define INITGUID
#include 
#undef INITGUID
#else
#include 
#endif

#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
        DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)

#else // !_MIDL_USE_GUIDDEF_

#ifndef __IID_DEFINED__
#define __IID_DEFINED__

typedef struct _IID
{
    unsigned long x;
    unsigned short s1;
    unsigned short s2;
    unsigned char  c[8];
} IID;

#endif // __IID_DEFINED__

#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED

#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
        const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

#endif !_MIDL_USE_GUIDDEF_

MIDL_DEFINE_GUID(IID, LIBID_wmp_hostedLib,0xC5A3025E,0xA8E4,0x4045,0xB1,0x8D,0xF3,0xBB,0xBE,0x15,0x8B,0x06);

#undef MIDL_DEFINE_GUID

#ifdef __cplusplus
}
#endif



#endif /* !defined(_M_IA64) && !defined(_M_AMD64)*/


--- NEW FILE: wmp_hosted.rgs ---
HKCR
{
	NoRemove AppID
	{
		'%APPID%' = s 'wmp_hosted'
		'wmp_hosted.DLL'
		{
			val AppID = s '%APPID%'
		}
	}
}

--- NEW FILE: wmp_hosted_factory.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef WMP_HOSTED_FACTORY_H
#define WMP_HOSTED_FACTORY_H

#include "baseobj.h"
#include "hxplugn.h"

class CWMPHostedPluginFactory : public IHXPluginFactory,
                                public CHXBaseCountingObject
{
public:
    CWMPHostedPluginFactory();
    virtual ~CWMPHostedPluginFactory();

    // IUnknown methods
    STDMETHOD(QueryInterface)  (THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(UINT32,AddRef)  (THIS);
    STDMETHOD_(UINT32,Release) (THIS);

    // IHXPluginFactory methods
    STDMETHOD_(UINT16,GetNumPlugins) (THIS);
    STDMETHOD(GetPlugin)             (THIS_ UINT16 usIndex, IUnknown** ppPlugin);

    // CWMPHostedPluginFactory methods
    static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
protected:
    INT32  m_lRefCount;
    UINT16 m_usNumPlugins;

    static HX_RESULT (STDAPICALLTYPE* m_fpRMACreateInstanceArray[])(IUnknown**);
};

#endif /* #ifndef WMP_HOSTED_FACTORY_H */

--- NEW FILE: asf_hosted_fileformat.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#include "hxtypes.h"
#include "hxcom.h"
#include "asf_hosted_fileformat.h"
#include "wmp_guest_player.h"
#include "wmphost.ver"
#include "hxver.h"

#include "hxheap.h"
#ifdef _DEBUG
#undef HX_THIS_FILE             
static const char HX_THIS_FILE[] = __FILE__;
#endif

const char* const CASFHostedFileFormat::m_pszDescription            = "Helix Hosted Windows Media Player ASF Fileformat Plugin";
const char* const CASFHostedFileFormat::m_ppszFileMimeType[]        = {"video/x-ms-asf", "audio/x-ms-wma", "video/x-ms-wmv", NULL};
const char* const CASFHostedFileFormat::m_ppszFileExtension[]       = {"asf", "wma", "wmv", NULL};
const char* const CASFHostedFileFormat::m_ppszFileOpenName[]        = {"Windows Media Files (*.asf,*.wma,*.wmv)", NULL};
const char* const CASFHostedFileFormat::m_pszMimeType               = "application/vnd.rn-hostedwmp-asf";
const char* const CASFHostedFileFormat::m_ppszSchemeExtensionInfo[] = {"mms", "file:asf", "file:wma", "file:wmv", "http:asf", "http:wma", "http:wmv",
                                                                       "rtsp:asf", "rtsp:wma", "rtsp:wmv", NULL};


STDMETHODIMP CASFHostedFileFormat::GetFileFormatInfo(REF(const char**) rppszFileMimeTypes,
                                                     REF(const char**) rppszFileExtensions,
                                                     REF(const char**) rppszFileOpenNames)
{
    rppszFileMimeTypes  = (const char**) m_ppszFileMimeType;
    rppszFileExtensions = (const char**) m_ppszFileExtension;
    rppszFileOpenNames  = (const char**) m_ppszFileOpenName;

    return HXR_OK;
}

HX_RESULT STDAPICALLTYPE CASFHostedFileFormat::HXCreateInstance(IUnknown** ppIUnknown)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppIUnknown)
    {
        // Set default
        *ppIUnknown = NULL;
        // Create the object
        CASFHostedFileFormat* pObj = new CASFHostedFileFormat();
        if (pObj)
        {
            // QI for IUnknown
            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);
        }
        if (FAILED(retVal))
        {
            HX_DELETE(pObj);
        }
    }

    return retVal;
}

STDMETHODIMP CASFHostedFileFormat::GetDescription(REF(const char*) rpszDescription)
{
    rpszDescription = m_pszDescription;
    return HXR_OK;
}

STDMETHODIMP CASFHostedFileFormat::CreateGuestPlayer(REF(IHXGuestPlayer*) rpPlayer)
{
    return CWMPGuestPlayer::CreateGuestPlayer(rpPlayer);
}

STDMETHODIMP CASFHostedFileFormat::GetMimeType(REF(const char*) rpszMimeType)
{
    rpszMimeType = m_pszMimeType;
    return HXR_OK;
}

STDMETHODIMP CASFHostedFileFormat::GetSchemeExtensionInfo(REF(const char**) rppszSchemeExtensionInfo)
{
    rppszSchemeExtensionInfo = (const char**) m_ppszSchemeExtensionInfo;
    return HXR_OK;
}

--- NEW FILE: wmp_hosted.rc ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

//Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1252)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE  
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE  
BEGIN
    "#include ""winres.h""\r\n"
    "\0"
END

//3 TEXTINCLUDE  
//BEGIN
//    "1 TYPELIB ""wmp_hosted.tlb""\r\n"
//    "\0"
//END

#endif    // APSTUDIO_INVOKED

#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,1
 PRODUCTVERSION 1,0,0,1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x2L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904e4"
        BEGIN
            VALUE "CompanyName", "Helix Windows Media Player Hosted Renderer"
            VALUE "FileDescription", "Helix Windows Media Player Hosted Renderer"
            VALUE "FileVersion", "1.0.0.1"
            VALUE "LegalCopyright", "(c) RealNetworks.  All rights reserved."
            VALUE "InternalName", "wmp_hosted.dll"
            VALUE "OriginalFilename", "wmp_hosted.dll"
            VALUE "ProductName", "Helix DNA Client"
            VALUE "ProductVersion", "1.0.0.1"
            VALUE "OLESelfRegister", ""
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
		VALUE "Translation", 0x0409, 1252
    END
END

#endif    // !_MAC

/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE  
BEGIN
	IDS_PROJNAME					"wmp_hosted"
END

IDR_WMP_HOSTED REGISTRY "wmp_hosted.rgs"
////////////////////////////////////////////////////////////////////////////


#endif

#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
//1 TYPELIB "wmp_hosted.tlb"
/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED


--- NEW FILE: asf_hosted_fileformat.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef ASF_HOSTED_FILEFORMAT_H
#define ASF_HOSTED_FILEFORMAT_H

// Includes
#include "base_playlist_fileformat.h"

class CASFHostedFileFormat : public CBaseHostedPlaylistEnabledFileFormat
{
public:
    CASFHostedFileFormat() {};
    virtual ~CASFHostedFileFormat() {};

    // IHXFileFormatObject overridden methods
    STDMETHOD(GetFileFormatInfo) (THIS_ REF(const char**) rppszFileMimeTypes,
                                        REF(const char**) rppszFileExtensions,
                                        REF(const char**) rppszFileOpenNames);

    // CASFHostedFileFormat methods
    static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
protected:
    STDMETHOD(GetDescription)         (THIS_ REF(const char*) rpszDescription);
    STDMETHOD(CreateGuestPlayer)      (THIS_ REF(IHXGuestPlayer*) rpPlayer);
    STDMETHOD(GetMimeType)            (THIS_ REF(const char*) rpszMimeType);
    STDMETHOD(GetSchemeExtensionInfo) (THIS_ REF(const char**) rpszSchemeExtInfo);

    static const char* const m_pszDescription;
    static const char* const m_ppszFileMimeType[];
    static const char* const m_ppszFileExtension[];
    static const char* const m_ppszFileOpenName[];
    static const char* const m_pszMimeType;
    static const char* const m_ppszSchemeExtensionInfo[];
};

#endif /* #ifndef ASF_HOSTED_FILEFORMAT_H */

--- NEW FILE: Resource.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by wmp_hosted.rc
//

#define IDS_PROJNAME                    100
#define IDR_WMP_HOSTED	101

// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        201
#define _APS_NEXT_COMMAND_VALUE         32768
#define _APS_NEXT_CONTROL_VALUE         201
#define _APS_NEXT_SYMED_VALUE           102
#endif
#endif

--- NEW FILE: asx_playlist_fileformat.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef ASX_HOSTED_FILEFORMAT_H
#define ASX_HOSTED_FILEFORMAT_H

// Includes
#include "base_playlist_fileformat.h"

class CASXHostedFileFormat : public CBaseHostedPlaylistEnabledFileFormat
{
public:
    CASXHostedFileFormat() {};
    virtual ~CASXHostedFileFormat() {};

    // IHXFileFormatObject overridden methods
    STDMETHOD(GetFileFormatInfo) (THIS_ REF(const char**) rppszFileMimeTypes,
                                        REF(const char**) rppszFileExtensions,
                                        REF(const char**) rppszFileOpenNames);

    // CASXHostedFileFormat methods
    static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
protected:
    STDMETHOD(GetDescription)           (THIS_ REF(const char*) rpszDescription);
    STDMETHOD(CreateGuestPlayer)        (THIS_ REF(IHXGuestPlayer*) rpPlayer);
    STDMETHOD(GetMimeType)              (THIS_ REF(const char*) rpszMimeType);
    STDMETHOD(GetSchemeExtensionInfo)   (THIS_ REF(const char**) rpszSchemeExtInfo);
    STDMETHOD_(HXBOOL,IsMetaFileFormat) (THIS) { return TRUE; }

    static const char* const m_pszDescription;
    static const char* const m_ppszFileMimeType[];
    static const char* const m_ppszFileExtension[];
    static const char* const m_ppszFileOpenName[];
    static const char* const m_pszMimeType;
    static const char* const m_ppszSchemeExtensionInfo[];
};


#endif /* #ifndef ASX_HOSTED_FILEFORMAT_H */

--- NEW FILE: asx_playlist_renderer.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef ASX_PLAYLIST_RENDERER_H
#define ASX_PLAYLIST_RENDERER_H

// Includes
#include "base_playlist_renderer.h"

class CASXHostedPlaylistRenderer : public CBaseHostedPlaylistRenderer
{
public:
    CASXHostedPlaylistRenderer() {};
    virtual ~CASXHostedPlaylistRenderer() {};

    // CASXHostedMetaRenderer methods
    static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
protected:
    STDMETHOD(GetDescription) (THIS_ REF(const char*) rpszDescription);
    STDMETHOD(GetMimeType)    (THIS_ REF(const char**) rppszMimeType);

    static const char* const m_pszDescription;
    static const char* const m_ppszMimeType[];
};

#endif /* #ifndef ASX_PLAYLIST_RENDERER_H */

--- NEW FILE: asx_playlist_renderer.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#include "hxtypes.h"
#include "hxwintyp.h"
#include "hxcom.h"
#include "asx_playlist_renderer.h"
#include "wmphost.ver"


const char* const CASXHostedPlaylistRenderer::m_pszDescription = "Helix Windows Media Player Hosted ASX Renderer Plugin";
const char* const CASXHostedPlaylistRenderer::m_ppszMimeType[] = {"application/vnd.rn-hostedwmp-asx", NULL};

HX_RESULT STDAPICALLTYPE CASXHostedPlaylistRenderer::HXCreateInstance(IUnknown** ppIUnknown)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppIUnknown)
    {
        // Set default
        *ppIUnknown = NULL;
        // Create the object
        CASXHostedPlaylistRenderer* pObj = new CASXHostedPlaylistRenderer();
        if (pObj)
        {
            // QI for IUnknown
            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);
        }
        if (FAILED(retVal))
        {
            HX_DELETE(pObj);
        }
    }

    return retVal;
}

STDMETHODIMP CASXHostedPlaylistRenderer::GetDescription(REF(const char*) rpszDescription)
{
    rpszDescription = m_pszDescription;
    return HXR_OK;
}

STDMETHODIMP CASXHostedPlaylistRenderer::GetMimeType(REF(const char**) rppszMimeType)
{
    rppszMimeType = (const char**) m_ppszMimeType;
    return HXR_OK;
}

--- NEW FILE: wmp_hosted_factory.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */


#include "hxtypes.h"
#include "hxwintyp.h"
#include "hxcom.h"
#include "hxplugn.h"
#include "hxengin.h"
#include "hxformt.h"
#include "baseobj.h"
#include "wmp_hosted_factory.h"
#include "asf_hosted_fileformat.h"
#include "asf_hosted_renderer.h"
#include "asx_playlist_fileformat.h"
#include "asx_playlist_renderer.h"

#include "hxheap.h"
#ifdef _DEBUG
#undef HX_THIS_FILE		
static const char HX_THIS_FILE[] = __FILE__;
#endif

HX_RESULT (STDAPICALLTYPE* CWMPHostedPluginFactory::m_fpRMACreateInstanceArray[])(IUnknown**) =
{
    CASFHostedFileFormat::HXCreateInstance,
    CASFHostedRenderer::HXCreateInstance,
    CASXHostedFileFormat::HXCreateInstance,
    CASXHostedPlaylistRenderer::HXCreateInstance,
    NULL
};

CWMPHostedPluginFactory::CWMPHostedPluginFactory()
{
    m_lRefCount = 0;
    for(m_usNumPlugins = 0; m_fpRMACreateInstanceArray[m_usNumPlugins]; m_usNumPlugins++);
}

CWMPHostedPluginFactory::~CWMPHostedPluginFactory()
{
}

STDMETHODIMP CWMPHostedPluginFactory::QueryInterface(REFIID riid, void** ppvObj)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppvObj)
    {
        // Set defaults
        *ppvObj = NULL;
        retVal  = HXR_OK;
        // Check for IID type
        if (IsEqualIID(riid, IID_IUnknown))
        {
            *ppvObj = (IUnknown*) (IHXPluginFactory*) this;
        }
        else if (IsEqualIID(riid, IID_IHXPluginFactory))
        {
            *ppvObj = (IHXPluginFactory*) this;
        }
        else
        {
            retVal = HXR_NOINTERFACE;
        }
        if (SUCCEEDED(retVal))
        {
            AddRef();
        }
    }

    return retVal;
}

STDMETHODIMP_(UINT32) CWMPHostedPluginFactory::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}


STDMETHODIMP_(UINT32) CWMPHostedPluginFactory::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;

    return 0;
}


STDMETHODIMP_(UINT16) CWMPHostedPluginFactory::GetNumPlugins()
{
    return m_usNumPlugins;
}

STDMETHODIMP CWMPHostedPluginFactory::GetPlugin(UINT16 usIndex, IUnknown** ppPlugin)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppPlugin && usIndex < m_usNumPlugins)
    {
        retVal = m_fpRMACreateInstanceArray[usIndex](ppPlugin);
    }

    return retVal;
}

HX_RESULT STDAPICALLTYPE CWMPHostedPluginFactory::HXCreateInstance(IUnknown** ppIUnknown)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppIUnknown)
    {
        // Set default
        *ppIUnknown = NULL;
        // Create the object
        CWMPHostedPluginFactory *pObj = new CWMPHostedPluginFactory();
        if (pObj)
        {
            // QI for IUnknown
            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);
        }
        if (FAILED(retVal))
        {
            HX_DELETE(pObj);
        }
    }

    return retVal;
}


--- NEW FILE: wmp_guest_player.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
[...2828 lines suppressed...]
    {
        // Check for NULL character at end
        if (pBuf[ulLen - 1] == 0)
        {
            // Make sure each character before the last is printable
            bRet = TRUE;
            for (UINT32 i = 0; i < ulLen - 1; i++)
            {
                if (!isprint(pBuf[i]))
                {
                    bRet = FALSE;
                    break;
                }
            }
        }
    }

    return bRet;
}


--- NEW FILE: wmp_hosted.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */



/* this ALWAYS GENERATED file contains the definitions for the interfaces */


 /* File created by MIDL compiler version 6.00.0361 */
/* at Tue Mar 07 23:18:04 2006
 */
/* Compiler settings for .\wmp_hosted.idl:
    Oicf, W1, Zp8, env=Win32 (32b run)
    protocol : dce , ms_ext, c_ext, robust
    error checks: allocation ref bounds_check enum stub_data 
    VC __declspec() decoration level: 
         __declspec(uuid()), __declspec(selectany), __declspec(novtable)
         DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING(  )

#pragma warning( disable: 4049 )  /* more than 64k source lines */


/* verify that the  version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif

#include "rpc.h"
#include "rpcndr.h"

#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of 
#endif // __RPCNDR_H_VERSION__


#ifndef __wmp_hosted_h__
#define __wmp_hosted_h__

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

/* Forward Declarations */ 

/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"

#ifdef __cplusplus
extern "C"{
#endif 

void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * ); 


#ifndef __wmp_hostedLib_LIBRARY_DEFINED__
#define __wmp_hostedLib_LIBRARY_DEFINED__

/* library wmp_hostedLib */
/* [helpstring][version][uuid] */ 


EXTERN_C const IID LIBID_wmp_hostedLib;
#endif /* __wmp_hostedLib_LIBRARY_DEFINED__ */

/* Additional Prototypes for ALL interfaces */

/* end of Additional Prototypes */

#ifdef __cplusplus
}
#endif

#endif



--- NEW FILE: asf_hosted_renderer.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#include "hxtypes.h"
#include "hxwintyp.h"
#include "hxcom.h"
#include "asf_hosted_renderer.h"
#include "wmphost.ver"


const char* const CASFHostedRenderer::m_pszDescription = "Helix Windows Media Player Hosted ASF Renderer Plugin";
const char* const CASFHostedRenderer::m_ppszMimeType[] = {"application/vnd.rn-hostedwmp-asf", NULL};

HX_RESULT STDAPICALLTYPE CASFHostedRenderer::HXCreateInstance(IUnknown** ppIUnknown)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppIUnknown)
    {
        // Set default
        *ppIUnknown = NULL;
        // Create the object
        CASFHostedRenderer* pObj = new CASFHostedRenderer();
        if (pObj)
        {
            // QI for IUnknown
            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);
        }
        if (FAILED(retVal))
        {
            HX_DELETE(pObj);
        }
    }

    return retVal;
}

STDMETHODIMP CASFHostedRenderer::GetDescription(REF(const char*) rpszDescription)
{
    rpszDescription = m_pszDescription;
    return HXR_OK;
}

STDMETHODIMP CASFHostedRenderer::GetMimeType(REF(const char**) rppszMimeType)
{
    rppszMimeType = (const char**) m_ppszMimeType;
    return HXR_OK;
}

--- NEW FILE: wmp_guest_player.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef WMP_GUEST_PLAYER_H
#define WMP_GUEST_PLAYER_H

// Includes
#include "hxguestplayer.h"
#include 
#include 
#include 
#include "wmpids.h"
#include "wmp.h"
#include "wmpservices.h"
#include "baseobj.h"

// Forward declarations
class CHXSimpleList;


class CWMPGuestPlayer : public IHXGuestPlayer,
                        public IWMPEvents,
                        public _WMPOCXEvents,  // _WMPOCXEvents inherits from IDispatch
                        public IServiceProvider,
                        public IWMPGraphCreation,
                        public CHXBaseCountingObject
{
public:
    CWMPGuestPlayer();
    virtual ~CWMPGuestPlayer();

    // IUnknown methods
    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)  (THIS);
    STDMETHOD_(ULONG32,Release) (THIS);

    // IHXGuestPlayer methods
    STDMETHOD(Initialize)                      (THIS_ IUnknown* pContext);
    STDMETHOD(SetNetworkingConfiguration)      (THIS_ IHXValues* pConfig);
    STDMETHOD(AddResponse)                     (THIS_ IHXGuestPlayerResponse* pResponse);
    STDMETHOD(RemoveResponse)                  (THIS_ IHXGuestPlayerResponse* pResponse);
    STDMETHOD(Terminate)                       (THIS);
    STDMETHOD(Open)                            (THIS_ IHXRequest* pRequest);
    STDMETHOD(Close)                           (THIS);
    STDMETHOD(GetPlaylistMetaData)             (THIS_ REF(IHXValues*) rpData);
    STDMETHOD(GetMetaData)                     (THIS_ REF(IHXValues*) rpData);
    STDMETHOD_(UINT32,GetPlayerState)          (THIS) { return m_ulGuestPlayerState; }
    STDMETHOD_(UINT32,GetPlayerCaps)           (THIS);
    STDMETHOD(GetBufferingStatus)              (THIS_ REF(UINT16) rusStatusCode, REF(UINT16) rusPercentDone);
    STDMETHOD(GetStatistics)                   (THIS_ REF(IHXValues*) rpStats);
    STDMETHOD(GetPlaybackTime)                 (THIS_ REF(UINT32) rulTime);
    STDMETHOD(GetPlaybackDuration)             (THIS_ REF(UINT32) rulDuration);
    STDMETHOD_(HXBOOL,IsLive)                  (THIS);
    STDMETHOD(GetVisualInfo)                   (THIS_ REF(HXBOOL) rbHasVisuals, REF(HXxSize) rSize);
    STDMETHOD(AttachWindow)                    (THIS_ HXxWindow* pWindow);
    STDMETHOD(DetachWindow)                    (THIS);
    STDMETHOD(EventOccurred)                   (THIS_ HXxEvent* pEvent);
    STDMETHOD(InitMedia)                       (THIS);
    STDMETHOD(PreFetch)                        (THIS_ UINT32 ulStartTime);
    STDMETHOD(Play)                            (THIS);
    STDMETHOD(Stop)                            (THIS);
    STDMETHOD(Pause)                           (THIS);
    STDMETHOD(Seek)                            (THIS_ UINT32 ulSeekFrom, UINT32 ulSeekTo);
    STDMETHOD(SetPlaybackRate)                 (THIS_ INT32 lRate);
    STDMETHOD_(INT32,GetPlaybackRate)          (THIS);
    STDMETHOD(FrameStep)                       (THIS_ INT32 lNumFrames);
    STDMETHOD_(UINT16,GetVolume)               (THIS);
    STDMETHOD(SetVolume)                       (THIS_ UINT16 usVolume);
    STDMETHOD(SetMute)                         (THIS_ HXBOOL bMute);
    STDMETHOD_(HXBOOL,GetMute)                 (THIS);
    STDMETHOD_(UINT16,GetNumPlaylistEntries)   (THIS);
    STDMETHOD_(UINT16,GetCurrentPlaylistEntry) (THIS);
    STDMETHOD(SetCurrentPlaylistEntry)         (THIS_ UINT16 usEntry);
    STDMETHOD(GetPlaylistEntryInfo)            (THIS_ UINT16 usEntry, REF(IHXValues*) rpInfo);
    STDMETHOD(NextPlaylistEntry)               (THIS);
    STDMETHOD(PreviousPlaylistEntry)           (THIS);
    STDMETHOD_(HXBOOL,QueryCaps)               (THIS_ UINT32 ulCaps);
    STDMETHOD(EnterFullScreen)                 (THIS);
    STDMETHOD(ExitFullScreen)                  (THIS);

    // IWMPEvents methods
    void STDMETHODCALLTYPE OpenStateChange(long NewState);
    void STDMETHODCALLTYPE PlayStateChange(long NewState);
    void STDMETHODCALLTYPE AudioLanguageChange(long LangID);
    void STDMETHODCALLTYPE StatusChange();
    void STDMETHODCALLTYPE ScriptCommand(BSTR scType, BSTR Param);
    void STDMETHODCALLTYPE NewStream();
    void STDMETHODCALLTYPE Disconnect(long Result);
    void STDMETHODCALLTYPE Buffering(VARIANT_BOOL Start);
    void STDMETHODCALLTYPE Error();
    void STDMETHODCALLTYPE Warning(long WarningType, long Param, BSTR Description);
    void STDMETHODCALLTYPE EndOfStream(long Result);
    void STDMETHODCALLTYPE PositionChange( double oldPosition, double newPosition);
    void STDMETHODCALLTYPE MarkerHit( long MarkerNum );
    void STDMETHODCALLTYPE DurationUnitChange( long NewDurationUnit );
    void STDMETHODCALLTYPE CdromMediaChange( long CdromNum );
    void STDMETHODCALLTYPE PlaylistChange( IDispatch * Playlist, WMPPlaylistChangeEventType change );
    void STDMETHODCALLTYPE CurrentPlaylistChange( WMPPlaylistChangeEventType change );
    void STDMETHODCALLTYPE CurrentPlaylistItemAvailable( BSTR bstrItemName );
    void STDMETHODCALLTYPE MediaChange( IDispatch * Item );
    void STDMETHODCALLTYPE CurrentMediaItemAvailable( BSTR bstrItemName );
    void STDMETHODCALLTYPE CurrentItemChange( IDispatch *pdispMedia);
    void STDMETHODCALLTYPE MediaCollectionChange();
    void STDMETHODCALLTYPE MediaCollectionAttributeStringAdded( BSTR bstrAttribName,  BSTR bstrAttribVal );
    void STDMETHODCALLTYPE MediaCollectionAttributeStringRemoved( BSTR bstrAttribName,  BSTR bstrAttribVal );
    void STDMETHODCALLTYPE MediaCollectionAttributeStringChanged( BSTR bstrAttribName, BSTR bstrOldAttribVal, BSTR bstrNewAttribVal);
    void STDMETHODCALLTYPE PlaylistCollectionChange();
    void STDMETHODCALLTYPE PlaylistCollectionPlaylistAdded( BSTR bstrPlaylistName);
    void STDMETHODCALLTYPE PlaylistCollectionPlaylistRemoved( BSTR bstrPlaylistName);
    void STDMETHODCALLTYPE PlaylistCollectionPlaylistSetAsDeleted( BSTR bstrPlaylistName, VARIANT_BOOL varfIsDeleted);
    void STDMETHODCALLTYPE ModeChange( BSTR ModeName, VARIANT_BOOL NewValue);
    void STDMETHODCALLTYPE MediaError( IDispatch * pMediaObject);
    void STDMETHODCALLTYPE OpenPlaylistSwitch( IDispatch *pItem );
    void STDMETHODCALLTYPE DomainChange( BSTR strDomain);
    void STDMETHODCALLTYPE SwitchedToPlayerApplication();
    void STDMETHODCALLTYPE SwitchedToControl();
    void STDMETHODCALLTYPE PlayerDockedStateChange();
    void STDMETHODCALLTYPE PlayerReconnect();
    void STDMETHODCALLTYPE Click( short nButton, short nShiftState, long fX, long fY );
    void STDMETHODCALLTYPE DoubleClick( short nButton, short nShiftState, long fX, long fY );
    void STDMETHODCALLTYPE KeyDown( short nKeyCode, short nShiftState );
    void STDMETHODCALLTYPE KeyPress( short nKeyAscii );
    void STDMETHODCALLTYPE KeyUp( short nKeyCode, short nShiftState );
    void STDMETHODCALLTYPE MouseDown( short nButton, short nShiftState, long fX, long fY );
    void STDMETHODCALLTYPE MouseMove( short nButton, short nShiftState, long fX, long fY );
    void STDMETHODCALLTYPE MouseUp( short nButton, short nShiftState, long fX, long fY );

    // IDispatch methods
    STDMETHOD(GetIDsOfNames)    (REFIID            riid,
                                 OLECHAR FAR* FAR* rgszNames,
                                 unsigned int      cNames, 
                                 LCID              lcid, 
                                 DISPID FAR*       rgDispId)  { return E_NOTIMPL; }
    STDMETHOD(GetTypeInfo)      (unsigned int iTInfo, 
                                 LCID         lcid, 
                                 ITypeInfo FAR* FAR* ppTInfo) { return E_NOTIMPL; }
    STDMETHOD(GetTypeInfoCount) (unsigned int FAR *pctinfo)   { return E_NOTIMPL; }
    STDMETHOD(Invoke)           (DISPID            dispIdMember,
                                 REFIID            riid,
                                 LCID              lcid,
                                 WORD              wFlags,
                                 DISPPARAMS FAR*   pDispParams,
                                 VARIANT FAR*      pVarResult,
                                 EXCEPINFO FAR*    pExcepInfo,
                                 unsigned int FAR* puArgErr);

    // IServiceProvider methods
    STDMETHOD(QueryService) (REFGUID guidService, REFIID riid, void **ppv);

    // IWMPGraphCreation methods
    STDMETHOD(GetGraphCreationFlags)   (DWORD* pdwFlags);
    STDMETHOD(GraphCreationPostRender) (IUnknown* pFilterGraph);
    STDMETHOD(GraphCreationPreRender)  (IUnknown* pFilterGraph, IUnknown* pReserved);

    // CWMPGuestPlayer methods
    static HX_RESULT STDAPICALLTYPE CreateGuestPlayer(REF(IHXGuestPlayer*) rpPlayer);
protected:
    enum
    {
        kResponseOpenDone,
        kResponsePlayerStateChange,
        kNumResponses
    };

    INT32                       m_lRefCount;
    IUnknown*                   m_pContext;
    IHXValues*                  m_pNetworkConfig;
    CHXSimpleList*              m_pResponseList;
    IHXRequest*                 m_pRequest;
    CAxWindow                   m_wndView;
    CComPtr         m_spWMPPlayer;
    CComPtr   m_spConnectionPoint;
    CComPtr       m_spWMPSettings;
    CComPtr       m_spWMPControls;
    CComPtr          m_spWMPMedia;
    CComPtr        m_spWMPNetwork;
    DWORD                       m_dwAdviseCookie;
    HWND                        m_hTempWindow;
    UINT32                      m_ulGuestPlayerState;
    UINT32                      m_ulLastPlaybackTick;
    UINT32                      m_ulLastPlaybackTime;
    UINT32                      m_ulLastReturnedTime;
    UINT32                      m_ulDuration;
    UINT16                      m_usVolume;
    HXBOOL                      m_bMute;
    double                      m_dPlaybackRate;

    static const char* const m_pszTmpWindowClassName;
    static const char* const m_pszOpenState[wmposOpeningUnknownURL + 1];
    static const char* const m_pszPlayState[wmppsLast];

    void      ConfigureNetworking(IHXValues* pConfig, IWMPPlayer* pPlayer);
    HX_RESULT SetMetaDataProperties(IHXValues* pData, const char* pszName,
                                    const char* pszValue, IUnknown* pContext);
    void      LogMediaAttributes(IWMPMedia* pWMPMedia);
    void      LogPlaylistAttributes(IWMPPlaylist* pWMPPlaylist);
    HX_RESULT GetMediaMetaData(IWMPMedia* pMedia, REF(IHXValues*) rpData);
    HX_RESULT GetPlaylistMetaData(IWMPPlaylist* pPlaylist, REF(IHXValues*) rpData);
    void      ClearResponseList();
    void      CallAllResponsePlayerStateChange();
    void      CallAllResponseError(HX_RESULT status, IHXBuffer* pErrStr);
    void      SetGuestPlayerStateEnforceTransitions(UINT32 ulNewState);
    void      SetGuestPlayerState(UINT32 ulNewState);
    HXBOOL    IsAllDigits(BYTE* pBuf, UINT32 ulLen);
    HXBOOL    IsAllPrintable(BYTE* pBuf, UINT32 ulLen);
};

#endif /* #ifndef WMP_HOSTED_RENDERER_H */

--- NEW FILE: wmp_hosted_guids.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#define INITGUID

#include "hxtypes.h"
#include "hxwintyp.h"
#include "hxresult.h"
#include "hxcom.h"
#include "hxcomm.h"
#include "ihxpckts.h"
#include "hxcore.h"
#include "hxrendr.h"
#include "hxplugn.h"
#include "hxplgns.h"
#include "hxasm.h"
#include "hxupgrd.h"
#include "hxausvc.h"
#include "hxengin.h"
#include "hxprefs.h"
#include "hxerror.h"
#include "hxwin.h"
#include "hxthread.h"
#include "hxmon.h"
#include "hxformt.h"
#include "hxplayvelocity.h"
#include "hxguestplayer.h"
#include "hxpends.h"
#include "ihxtlogsystem.h"
#include "ihxtlogsystemcontext.h"
#include "hxdllaccess.h"
#include "wmp.h"
#include "ihxfgbuf.h"
#include "hxgroup.h"

--- NEW FILE: wmp_hosted.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

// wmp_hosted.cpp : Implementation of DLL Exports.

#include "stdafx.h"
#include "resource.h"
#include "wmp_hosted.h"

class Cwmp_hostedModule : public CAtlDllModuleT< Cwmp_hostedModule >
{
public :
	DECLARE_LIBID(LIBID_wmp_hostedLib)
	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_WMP_HOSTED, "{916A0293-2995-4DC3-92A6-F7FA269C1836}")
};

Cwmp_hostedModule _AtlModule;

HINSTANCE g_hInstance;

// DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
    g_hInstance = hInstance;
    return _AtlModule.DllMain(dwReason, lpReserved); 
}


// Used to determine whether the DLL can be unloaded by OLE
STDAPI DllCanUnloadNow(void)
{
    return _AtlModule.DllCanUnloadNow();
}


// Returns a class factory to create an object of the requested type
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
    return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
}


// DllRegisterServer - Adds entries to the system registry
STDAPI DllRegisterServer(void)
{
    // registers object, typelib and all interfaces in typelib
    HRESULT hr = _AtlModule.DllRegisterServer();
	return hr;
}


// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
{
	HRESULT hr = _AtlModule.DllUnregisterServer();
	return hr;
}

--- NEW FILE: asf_hosted_renderer.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef ASF_HOSTED_RENDERER_H
#define ASF_HOSTED_RENDERER_H

// Includes
#include "base_hosted_renderer.h"

class CASFHostedRenderer : public CBaseHostedRenderer
{
public:
    CASFHostedRenderer() {};
    virtual ~CASFHostedRenderer() {};

    // CWMPHostedRenderer methods
    static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
protected:
    STDMETHOD(GetDescription) (THIS_ REF(const char*) rpszDescription);
    STDMETHOD(GetMimeType)    (THIS_ REF(const char**) rppszMimeType);

    static const char* const m_pszDescription;
    static const char* const m_ppszMimeType[];
};

#endif /* #ifndef ASF_HOSTED_RENDERER_H */

--- NEW FILE: wmp_hosted.idl ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

// wmp_hosted.idl : IDL source for wmp_hosted
//

// This file will be processed by the MIDL tool to
// produce the type library (wmp_hosted.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";

[
	uuid(C5A3025E-A8E4-4045-B18D-F3BBBE158B06),
	version(1.0),
	helpstring("wmp_hosted 1.0 Type Library")
]
library wmp_hostedLib
{
	importlib("stdole2.tlb");
};


From ehyche at helixcommunity.org  Thu May  4 14:04:54 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu May  4 15:57:54 2006
Subject: [Datatype-cvs] wm/wmphost/wmpconsoleapp/platform/win32
	CWMPEventDispatch.cpp, NONE, 1.1 CWMPEventDispatch.h, NONE,
	1.1 gettickcount.cpp, NONE, 1.1 gettickcount.h, NONE,
	1.1 stdafx.cpp, NONE, 1.1 stdafx.h, NONE, 1.1 wmpconsole.cpp,
	NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost/wmpconsoleapp/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv25349/wmphost/wmpconsoleapp/platform/win32

Added Files:
	CWMPEventDispatch.cpp CWMPEventDispatch.h gettickcount.cpp 
	gettickcount.h stdafx.cpp stdafx.h wmpconsole.cpp 
Log Message:
Transfer datatype/asf to datatype/wm

--- NEW FILE: wmpconsole.cpp ---
// wmpconsole.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include 
#include "CWMPEventDispatch.h"
#include "gettickcount.h"

#include 

CComModule _Module;

BEGIN_OBJECT_MAP(ObjectMap)
END_OBJECT_MAP()

int _tmain(int argc, _TCHAR* argv[])
{
    if (argc < 2 || argc > 3)
    {
        printf("Usage %s  [noAuto]", argv[0]);
        return -1;
    }

    unsigned long ulBaseTick = GetBetterTickCount();

    CoInitialize(NULL);

    HRESULT hr = S_OK;
    CComBSTR bstrVersionInfo; // Contains the version string.
    CComPtr spPlayer;  // Smart pointer to IWMPPlayer interface.
    CComPtr spConnectionContainer;
    CComWMPEventDispatch*              pEventListener = NULL;
    CComPtr                spEventListener;
    CComPtr              spSettings;
    CComPtr              spControls;
    CComPtr                 spCore3;
    CComPtr                 spMedia;
    CComPtr              spPlaylist;
    CComPtr   m_spConnectionPoint;
    DWORD                       m_dwAdviseCookie;
    bool bPrintedListAtOpen = false;
    bool bPrintedMediaAtOpen = false;
    CComBSTR bstrURL((const char*) argv[1]);

    hr = spPlayer.CoCreateInstance( __uuidof(WindowsMediaPlayer), 0, CLSCTX_INPROC_SERVER );
    if (FAILED(hr))
    {
        goto failoutboy;
    }


    hr = CComWMPEventDispatch::CreateInstance(&pEventListener);
    pEventListener->SetPlayer(spPlayer);
    pEventListener->SetBaseTick(ulBaseTick);
    spEventListener = pEventListener;
    if (FAILED(hr))
    {
        goto failoutboy;
    }

    hr = spPlayer->QueryInterface(&spConnectionContainer);
    if (FAILED(hr))
    {
        goto failoutboy;
    }

    // See if OCX supports the IWMPEvents interface
    hr = spConnectionContainer->FindConnectionPoint(__uuidof(IWMPEvents), &m_spConnectionPoint);
    if (FAILED(hr))
    {
        // If not, try the _WMPOCXEvents interface, which will use IDispatch
        hr = spConnectionContainer->FindConnectionPoint(__uuidof(_WMPOCXEvents), &m_spConnectionPoint);
        if (FAILED(hr))
        {
            goto failoutboy;
        }
    }

    hr = m_spConnectionPoint->Advise(spEventListener, &m_dwAdviseCookie);
    if (FAILED(hr))
    {
        goto failoutboy;
    }

    // Get the controls interface
    spPlayer->get_controls(&spControls);

    // Get the settings interface
    spPlayer->get_settings(&spSettings);

    bool bAutoStart = true;
    if (argc == 3)
    {
        const char* pszStr = (const char*) argv[2];
        if (!strcmp(pszStr, "noAuto"))
        {
            bAutoStart = false;
        }
    }

    if (!bAutoStart)
    {
        if (spSettings)
        {
            printf("wmpconsole: Calling IWMPSettings::put_autoStart(false).\n");
            spSettings->put_autoStart(bAutoStart);
        }
    }

    printf("wmpconsole: Calling IWMPCore::put_URL(%S).\n", bstrURL);
    hr = spPlayer->put_URL(bstrURL);
    if (FAILED(hr))
    {
        goto failoutboy;
    }

    MSG msg;
//    while (GetMessage(&msg, 0, 0, 0))
    BOOL bMsgAvail = false;
    while (1)
    {
        BOOL bMsgAvail = PeekMessage(&msg, 0, 0, 0, PM_REMOVE);

        if (bMsgAvail)
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
        else
        {
            // No windows message, so check console
            if (_kbhit())
            {
                char ch = _getch();
                if (spControls)
                {
                    if (ch == 'q')
                    {
                        printf("wmpconsole: q pressed - calling IWMPControls::stop().\n");
                        break;
                    }
                    else if (ch == 'r')
                    {
                        printf("wmpconsole: r pressed - calling IWMPControls::play().\n");
                        spControls->play();
                    }
                    else if (ch == 'p')
                    {
                        printf("wmpconsole: p pressed - calling IWMPControls::pause().\n");
                        spControls->pause();
                    }
                    else if (ch == 'f')
                    {
                        printf("wmpconsole: f pressed - calling IWMPControls::next().\n");
                        spControls->next();
                    }
                    else if (ch == 'b')
                    {
                        printf("wmpconsole: b pressed - calling IWMPControls::previous().\n");
                        spControls->previous();
                    }
                }
            }
            else
            {
                // No console keystroke hit, so sleep for a little bit?
                Sleep(1);
            }
        }
    }

failoutboy:
    if (spControls)
    {
        spControls->stop();
    }

    // Clean up.
    spPlayer.Release();
    spSettings.Release();
    spControls.Release();
    spCore3.Release();
    spMedia.Release();
    spPlaylist.Release();
    spEventListener.Release();
    CoUninitialize();

    return 0;
}


--- NEW FILE: gettickcount.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: gettickcount.cpp,v 1.1 2006/05/04 21:04:51 ehyche Exp $
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#include "stdafx.h"
#include "gettickcount.h"

/*
 * In 32bit Windows we have a HX_GET_BETTERTICKCOUNT()
 * which uses the queryPerformance interface for highly accurate times.
 * XXXKB: This implementation is now thread safe;
 */
ULONG32 GetBetterTickCount()
{
    static ULARGE_INTEGER s_ullPerformanceFrequency = { 0, 0 };
    static HXBOOL s_bFrequencyChecked = FALSE;
    ULARGE_INTEGER ullPerformanceCounter;
    
    do
    {
        if (s_ullPerformanceFrequency.LowPart)
        {
            if (QueryPerformanceCounter((union _LARGE_INTEGER*)
                                          &ullPerformanceCounter))
            {
                return (ULONG32) ((ullPerformanceCounter.QuadPart*1000) / 
                                  s_ullPerformanceFrequency.QuadPart);
            }
        }

        if (!s_bFrequencyChecked)
        {
            // Hopefully this is atomic kernel call:
            if (!QueryPerformanceFrequency((union _LARGE_INTEGER*)
                                           &s_ullPerformanceFrequency)
                // If the frequency > 32 bits, we lose range
                || s_ullPerformanceFrequency.HighPart 
                // If the frequency < 1000, we lose precision
                || (s_ullPerformanceFrequency.LowPart < 1000))
            {
                s_ullPerformanceFrequency.LowPart = 0;
            }

            s_bFrequencyChecked = TRUE;
        }
        
    } while (s_ullPerformanceFrequency.LowPart);
    
    return GetTickCount();
}


--- NEW FILE: CWMPEventDispatch.cpp ---
// CWMPEventDispatch.cpp : Implementation of the event dispatcher
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//

#include "stdafx.h"
#include "CWMPEventDispatch.h"
#include "gettickcount.h"

#ifndef SAFE_RELEASE
#define SAFE_RELEASE(x)   \
    if ((x))              \
    {                     \
        (x)->Release();   \
        (x) = NULL;       \
    }
#endif

HRESULT CWMPEventDispatch::Invoke(
                            DISPID  dispIdMember,      
                            REFIID  riid,              
                            LCID  lcid,                
                            WORD  wFlags,              
                            DISPPARAMS FAR*  pDispParams,  
                            VARIANT FAR*  pVarResult,  
                            EXCEPINFO FAR*  pExcepInfo,  
                            unsigned int FAR*  puArgErr )
{
    if (!pDispParams)
        return E_POINTER;

    if (pDispParams->cNamedArgs != 0)
        return DISP_E_NONAMEDARGS;

    HRESULT hr = DISP_E_MEMBERNOTFOUND;

    switch (dispIdMember)
    {
        case DISPID_WMPCOREEVENT_OPENSTATECHANGE:
            OpenStateChange(pDispParams->rgvarg[0].lVal /* NewState */ );
            break;

        case DISPID_WMPCOREEVENT_PLAYSTATECHANGE:
            PlayStateChange(pDispParams->rgvarg[0].lVal /* NewState */);
            break;

        case DISPID_WMPCOREEVENT_AUDIOLANGUAGECHANGE:
            AudioLanguageChange(pDispParams->rgvarg[0].lVal /* LangID */);
            break;

        case DISPID_WMPCOREEVENT_STATUSCHANGE:
            StatusChange();
            break;

        case DISPID_WMPCOREEVENT_SCRIPTCOMMAND:
            ScriptCommand(pDispParams->rgvarg[1].bstrVal /* scType */, pDispParams->rgvarg[0].bstrVal /* Param */ );
            break;

        case DISPID_WMPCOREEVENT_NEWSTREAM:
            NewStream();
            break;

        case DISPID_WMPCOREEVENT_DISCONNECT:
            Disconnect(pDispParams->rgvarg[0].lVal /* Result */ );
            break;

        case DISPID_WMPCOREEVENT_BUFFERING:
            Buffering(pDispParams->rgvarg[0].boolVal /* Start */);
            break;

        case DISPID_WMPCOREEVENT_ERROR:
            Error();
            break;

        case DISPID_WMPCOREEVENT_WARNING:
            Warning(pDispParams->rgvarg[1].lVal /* WarningType */, pDispParams->rgvarg[0].lVal /* Param */, pDispParams->rgvarg[2].bstrVal /* Description */);
            break;

        case DISPID_WMPCOREEVENT_ENDOFSTREAM:
            EndOfStream(pDispParams->rgvarg[0].lVal /* Result */ );
            break;

        case DISPID_WMPCOREEVENT_POSITIONCHANGE:
            PositionChange(pDispParams->rgvarg[1].dblVal /* oldPosition */, pDispParams->rgvarg[0].dblVal /* newPosition */);
            break;

        case DISPID_WMPCOREEVENT_MARKERHIT:
            MarkerHit(pDispParams->rgvarg[0].lVal /* MarkerNum */);
            break;

        case DISPID_WMPCOREEVENT_DURATIONUNITCHANGE:
            DurationUnitChange(pDispParams->rgvarg[0].lVal /* NewDurationUnit */);
            break;

        case DISPID_WMPCOREEVENT_CDROMMEDIACHANGE:
            CdromMediaChange(pDispParams->rgvarg[0].lVal /* CdromNum */);
            break;

        case DISPID_WMPCOREEVENT_PLAYLISTCHANGE:
            PlaylistChange(pDispParams->rgvarg[1].pdispVal /* Playlist */, (WMPPlaylistChangeEventType) pDispParams->rgvarg[0].lVal /* change */);
            break;
            
        case DISPID_WMPCOREEVENT_CURRENTPLAYLISTCHANGE:
            CurrentPlaylistChange((WMPPlaylistChangeEventType) pDispParams->rgvarg[0].lVal /* change */);
            break;

        case DISPID_WMPCOREEVENT_CURRENTPLAYLISTITEMAVAILABLE:
            CurrentPlaylistItemAvailable(pDispParams->rgvarg[0].bstrVal /*  bstrItemName */);
            break;

        case DISPID_WMPCOREEVENT_MEDIACHANGE:
            MediaChange(pDispParams->rgvarg[0].pdispVal /* Item */);
            break;

        case DISPID_WMPCOREEVENT_CURRENTMEDIAITEMAVAILABLE:
            CurrentMediaItemAvailable(pDispParams->rgvarg[0].bstrVal /* bstrItemName */);
            break;

        case DISPID_WMPCOREEVENT_CURRENTITEMCHANGE:
            CurrentItemChange(pDispParams->rgvarg[0].pdispVal /* pdispMedia */);
            break;

        case DISPID_WMPCOREEVENT_MEDIACOLLECTIONCHANGE:
            MediaCollectionChange();
            break;
            
        case DISPID_WMPCOREEVENT_MEDIACOLLECTIONATTRIBUTESTRINGADDED:
            MediaCollectionAttributeStringAdded(pDispParams->rgvarg[1].bstrVal /* bstrAttribName */, pDispParams->rgvarg[0].bstrVal /* bstrAttribVal */ );
            break;

        case DISPID_WMPCOREEVENT_MEDIACOLLECTIONATTRIBUTESTRINGREMOVED:
            MediaCollectionAttributeStringRemoved(pDispParams->rgvarg[1].bstrVal /* bstrAttribName */, pDispParams->rgvarg[0].bstrVal /* bstrAttribVal */ );
            break;

        case DISPID_WMPCOREEVENT_MEDIACOLLECTIONATTRIBUTESTRINGCHANGED:
            MediaCollectionAttributeStringChanged(pDispParams->rgvarg[2].bstrVal /* bstrAttribName */, pDispParams->rgvarg[1].bstrVal /* bstrOldAttribVal */, pDispParams->rgvarg[0].bstrVal /* bstrNewAttribVal */);
            break;

        case DISPID_WMPCOREEVENT_PLAYLISTCOLLECTIONCHANGE:
            PlaylistCollectionChange();
            break;

        case DISPID_WMPCOREEVENT_PLAYLISTCOLLECTIONPLAYLISTADDED:
            PlaylistCollectionPlaylistAdded(pDispParams->rgvarg[0].bstrVal /* bstrPlaylistName */ );
            break;

        case DISPID_WMPCOREEVENT_PLAYLISTCOLLECTIONPLAYLISTREMOVED:
            PlaylistCollectionPlaylistRemoved(pDispParams->rgvarg[0].bstrVal /* bstrPlaylistName */ );
            break;

        case DISPID_WMPCOREEVENT_PLAYLISTCOLLECTIONPLAYLISTSETASDELETED:
            PlaylistCollectionPlaylistSetAsDeleted(pDispParams->rgvarg[1].bstrVal /* bstrPlaylistName */, pDispParams->rgvarg[0].boolVal /* varfIsDeleted */);
            break;

        case DISPID_WMPCOREEVENT_MODECHANGE:
            ModeChange(pDispParams->rgvarg[1].bstrVal /* ModeName */, pDispParams->rgvarg[0].boolVal /* NewValue */);
            break;

        case DISPID_WMPCOREEVENT_MEDIAERROR:
            MediaError(pDispParams->rgvarg[0].pdispVal /* pMediaObject */);
            break;

        case DISPID_WMPCOREEVENT_OPENPLAYLISTSWITCH:
            OpenPlaylistSwitch(pDispParams->rgvarg[0].pdispVal /* pItem */);
            break;

        case DISPID_WMPCOREEVENT_DOMAINCHANGE:
            DomainChange(pDispParams->rgvarg[0].bstrVal /* strDomain */);
            break;

        case DISPID_WMPOCXEVENT_SWITCHEDTOPLAYERAPPLICATION:
            SwitchedToPlayerApplication();
            break;

        case DISPID_WMPOCXEVENT_SWITCHEDTOCONTROL:
            SwitchedToControl();
            break;

        case DISPID_WMPOCXEVENT_PLAYERDOCKEDSTATECHANGE:
            PlayerDockedStateChange();
            break;

        case DISPID_WMPOCXEVENT_PLAYERRECONNECT:
            PlayerReconnect();
            break;

        case DISPID_WMPOCXEVENT_CLICK:
            Click(pDispParams->rgvarg[3].iVal /* nButton */, pDispParams->rgvarg[2].iVal /* nShiftState */,  pDispParams->rgvarg[1].lVal /* fX */,  pDispParams->rgvarg[0].lVal /* fY */);
            break;

        case DISPID_WMPOCXEVENT_DOUBLECLICK:
            DoubleClick(pDispParams->rgvarg[3].iVal /* nButton */, pDispParams->rgvarg[2].iVal /* nShiftState */,  pDispParams->rgvarg[1].lVal /* fX */,  pDispParams->rgvarg[0].lVal /* fY */);
            break;

        case DISPID_WMPOCXEVENT_KEYDOWN:
            KeyDown(pDispParams->rgvarg[1].iVal /* nKeyCode */, pDispParams->rgvarg[0].iVal /* nShiftState */);
            break;

        case DISPID_WMPOCXEVENT_KEYPRESS:
            KeyPress(pDispParams->rgvarg[0].iVal /* nKeyAscii */);
            break;

        case DISPID_WMPOCXEVENT_KEYUP:
            KeyUp(pDispParams->rgvarg[1].iVal /* nKeyCode */, pDispParams->rgvarg[0].iVal /* nShiftState */);
            break;

        case DISPID_WMPOCXEVENT_MOUSEDOWN:
            MouseDown(pDispParams->rgvarg[3].iVal /* nButton */, pDispParams->rgvarg[2].iVal /* nShiftState */,  pDispParams->rgvarg[1].lVal /* fX */,  pDispParams->rgvarg[0].lVal /* fY */);
            break;

        case DISPID_WMPOCXEVENT_MOUSEMOVE:
            MouseMove(pDispParams->rgvarg[3].iVal /* nButton */, pDispParams->rgvarg[2].iVal /* nShiftState */,  pDispParams->rgvarg[1].lVal /* fX */,  pDispParams->rgvarg[0].lVal /* fY */);
            break;

        case DISPID_WMPOCXEVENT_MOUSEUP:
            MouseUp(pDispParams->rgvarg[3].iVal /* nButton */, pDispParams->rgvarg[2].iVal /* nShiftState */,  pDispParams->rgvarg[1].lVal /* fX */,  pDispParams->rgvarg[0].lVal /* fY */);
            break;
    }

    return( hr );
}

// Sent when the control changes OpenState
void CWMPEventDispatch::OpenStateChange(long NewState)
{
    const char* pszOpenState[wmposOpeningUnknownURL + 1] =
    {
        "Undefined",
        "PlaylistChanging",
        "PlaylistLocating",
        "PlaylistConnecting",
        "PlaylistLoading",
        "PlaylistOpening",
        "PlaylistOpenNoMedia",
        "PlaylistChanged",
        "MediaChanging",
        "MediaLocating",
        "MediaConnecting",
        "MediaLoading",
        "MediaOpening",
        "MediaOpen",
        "BeginCodecAcquisition",
        "EndCodecAcquisition",
        "BeginLicenseAcquisition",
        "EndLicenseAcquisition",
        "BeginIndividualization",
        "EndIndividualization",
        "MediaWaiting",
        "OpeningUnknownURL"
    };
    unsigned long ulTick = RelTick();
    printf("%9lu OpenStateChange(%s)\n", ulTick, pszOpenState[NewState]);
    switch(NewState)
    {
        case wmposPlaylistChanging:
        case wmposPlaylistLocating:
        case wmposPlaylistConnecting:
        case wmposPlaylistLoading:
        case wmposPlaylistOpening:
        case wmposPlaylistOpenNoMedia:
        case wmposMediaChanging:
        case wmposMediaLocating:
        case wmposMediaConnecting:
        case wmposMediaLoading:
        case wmposMediaOpening:
        case wmposMediaOpen:
        case wmposBeginCodecAcquisition:
        case wmposEndCodecAcquisition:
        case wmposBeginLicenseAcquisition:
        case wmposEndLicenseAcquisition:
        case wmposBeginIndividualization:
        case wmposEndIndividualization:
        case wmposMediaWaiting:
        case wmposOpeningUnknownURL:
            break;
        case wmposPlaylistChanged:
            {
                CComPtr spPlaylist;
                m_spPlayer->get_currentPlaylist(&spPlaylist);
                if (spPlaylist)
                {
                    long lNumItems = 0;
                    spPlaylist->get_count(&lNumItems);
                    printf("\t\t\tcurrent playlist has %ld items\n", lNumItems);
                }
            }
            break;
    };
    return;
}

// Sent when the control changes PlayState
void CWMPEventDispatch::PlayStateChange(long NewState)
{
    const char* pszPlayState[wmppsLast] =
    {
        "Undefined",
        "Stopped",
        "Paused",
        "Playing",
        "ScanForward",
        "ScanReverse",
        "Buffering",
        "Waiting",
        "MediaEnded",
        "Transitioning",
        "Ready",
        "Reconnecting"
    };
    unsigned long ulTick = RelTick();
    printf("%9lu PlayStateChange(%s)\n", ulTick, pszPlayState[NewState]);

    switch (NewState)
    {
        case wmppsStopped:
        case wmppsPaused:
        case wmppsPlaying:
        case wmppsScanForward:
        case wmppsScanReverse:
        case wmppsBuffering:
        case wmppsWaiting:
        case wmppsMediaEnded:
        case wmppsTransitioning:
        case wmppsReady:
        case wmppsReconnecting:
        case wmppsLast:
            break;
    }

    return;
}

// Sent when the audio language changes
void CWMPEventDispatch::AudioLanguageChange(long LangID)
{
    printf("%9lu AudioLanguageChange(%ld)\n", RelTick(), LangID);
    return;
}

// Sent when the status string changes
void CWMPEventDispatch::StatusChange()
{
    printf("%9lu StatusChange\n", RelTick());
    return;
}

// Sent when a synchronized command or URL is received
void CWMPEventDispatch::ScriptCommand(BSTR scType,BSTR Param)
{
    printf("ScriptCommand(%S,%S)\n", scType, Param);
    return;
}

// Sent when a new stream is encountered (obsolete)
void CWMPEventDispatch::NewStream()
{
    printf("NewStream\n");
    return;
}

// Sent when the control is disconnected from the server (obsolete)
void CWMPEventDispatch:: Disconnect(long Result )
{
    printf("Disconnect(%ld)\n", Result);
    return;
}

// Sent when the control begins or ends buffering
void CWMPEventDispatch:: Buffering(VARIANT_BOOL Start)
{
    printf("%9lu Buffering(%lu)\n", RelTick(), Start);
    return;
}

// Sent when the control has an error condition
void CWMPEventDispatch::Error()
{
    printf("%9lu Error\n", RelTick());
    IWMPError* pWMPError = NULL;
    HRESULT hr = m_spPlayer->get_error(&pWMPError);
    if (hr == S_OK)
    {
        long lNumErrors = 0;
        hr = pWMPError->get_errorCount(&lNumErrors);
        if (hr == S_OK)
        {
            for (long i = 0; i < lNumErrors && hr == S_OK; i++)
            {
                IWMPErrorItem* pItem = NULL;
                hr = pWMPError->get_item(i, &pItem);
                if (hr == S_OK)
                {
                    long     lErrorCode = 0;
                    CComBSTR bstrErrorDesc;
                    pItem->get_errorCode(&lErrorCode);
                    pItem->get_errorDescription(&bstrErrorDesc);
                    printf("\tError() code=%ld description=%S\n", lErrorCode, bstrErrorDesc);
                }
                SAFE_RELEASE(pItem);
            }
        }
    }
    SAFE_RELEASE(pWMPError);
    return;
}

// Sent when the control has an warning condition (obsolete)
void CWMPEventDispatch::Warning(long WarningType, long Param, BSTR Description)
{
    printf("%9lu Warning(%ld,%ld,%S)\n", RelTick(), WarningType, Param, Description);
    return;
}

// Sent when the media has reached end of stream
void CWMPEventDispatch::EndOfStream(long Result)
{
    printf("%9lu EndOfStream(%ld)\n", RelTick(), Result);
    return;
}

// Indicates that the current position of the movie has changed
void CWMPEventDispatch::PositionChange(double oldPosition,double newPosition)
{
    printf("%9lu PositionChange(%lf,%lf)\n", RelTick(), oldPosition, newPosition);
    return;
}

// Sent when a marker is reached
void CWMPEventDispatch::MarkerHit(long MarkerNum )
{
    printf("MarkerHit(%ld)\n", MarkerNum);
    return;
}

// Indicates that the unit used to express duration and position has changed
void CWMPEventDispatch::DurationUnitChange(long NewDurationUnit)
{
    printf("DurationUnitChange(%ld)\n", NewDurationUnit);
    return;
}

// Indicates that the CD ROM media has changed
void CWMPEventDispatch::CdromMediaChange(long CdromNum)
{
    printf("CdromMediaChange(%ld)\n", CdromNum);
    return;
}

// Sent when a playlist changes
void CWMPEventDispatch::PlaylistChange(IDispatch * pPlaylist,WMPPlaylistChangeEventType change)
{
    const char* pszPlaylistChange[wmplcLast] =
    {
        "Unknown",
        "Clear",
        "InfoChange",
        "Move",
        "Delete",
        "Insert",
        "Append",
        "Private",
        "NameChange",
        "Morph",
        "Sort"
    };
    printf("%9lu PlaylistChange(%p,%s)\n", RelTick(), pPlaylist, pszPlaylistChange[change]);
    if (pPlaylist)
    {
        // QI for IWMPPlaylist
        IWMPPlaylist* pList = NULL;
        HRESULT hr = pPlaylist->QueryInterface(__uuidof(IWMPPlaylist), (void**) &pList);
        if (hr == S_OK)
        {
            PrintPlaylistAttributes(pList);
        }
        SAFE_RELEASE(pList);
    }
    switch (change)
    {
        case wmplcClear:
        case wmplcInfoChange:
        case wmplcMove:
        case wmplcDelete:
        case wmplcInsert:
        case wmplcAppend:
        case wmplcPrivate:
        case wmplcNameChange:
        case wmplcMorph:
        case wmplcSort:
            break;
    }
    return;
}

// Sent when the current playlist changes
void CWMPEventDispatch::CurrentPlaylistChange(WMPPlaylistChangeEventType change )
{
    const char* pszPlaylistChange[wmplcLast] =
    {
        "Unknown",
        "Clear",
        "InfoChange",
        "Move",
        "Delete",
        "Insert",
        "Append",
        "Private",
        "NameChange",
        "Morph",
        "Sort"
    };
    printf("%9lu CurrentPlaylistChange(%s)\n", RelTick(), pszPlaylistChange[change]);
    return;
}

// Sent when a current playlist item becomes available
void CWMPEventDispatch::CurrentPlaylistItemAvailable(BSTR bstrItemName)
{
    printf("%9lu CurrentPlaylistItemAvailable(%S)\n", RelTick(), bstrItemName);
    return;
}

// Sent when a media object changes
void CWMPEventDispatch::MediaChange(IDispatch * pItem)
{
    printf("%9lu MediaChange(%p)\n", RelTick(), pItem);
    if (pItem)
    {
        IWMPMedia* pWMPMedia = NULL;
        HRESULT hr = pItem->QueryInterface(__uuidof(IWMPMedia), (void**) &pWMPMedia);
        if (hr == S_OK)
        {
            PrintMediaAttributes(pWMPMedia);
        }
        SAFE_RELEASE(pWMPMedia);
    }
    return;
}

// Sent when a current media item becomes available
void CWMPEventDispatch::CurrentMediaItemAvailable(BSTR bstrItemName)
{
    printf("%9lu CurrentMediaItemAvailable(%S)\n", RelTick(), bstrItemName);
    return;
}

// Sent when the item selection on the current playlist changes
void CWMPEventDispatch::CurrentItemChange(IDispatch *pdispMedia)
{
    printf("%9lu CurrentItemChange(%p)\n", RelTick(), pdispMedia);
    if (pdispMedia)
    {
        IWMPMedia* pWMPMedia = NULL;
        HRESULT hr = pdispMedia->QueryInterface(__uuidof(IWMPMedia), (void**) &pWMPMedia);
        if (hr == S_OK)
        {
            PrintMediaAttributes(pWMPMedia);
        }
        SAFE_RELEASE(pWMPMedia);
    }
    return;
}

// Sent when the media collection needs to be requeried
void CWMPEventDispatch::MediaCollectionChange()
{
    printf("MediaCollectionChange\n");
    return;
}

// Sent when an attribute string is added in the media collection
void CWMPEventDispatch::MediaCollectionAttributeStringAdded(BSTR bstrAttribName, BSTR bstrAttribVal)
{
    printf("MediaCollectionAttributeStringAdded(%S,%S)\n", bstrAttribName, bstrAttribVal);
    return;
}

// Sent when an attribute string is removed from the media collection
void CWMPEventDispatch::MediaCollectionAttributeStringRemoved(BSTR bstrAttribName, BSTR bstrAttribVal)
{
    printf("MediaCollectionAttributeStringRemoved(%S,%S)\n", bstrAttribName, bstrAttribVal);
    return;
}

// Sent when an attribute string is changed in the media collection
void CWMPEventDispatch::MediaCollectionAttributeStringChanged(BSTR bstrAttribName, BSTR bstrOldAttribVal, BSTR bstrNewAttribVal)
{
    printf("MediaCollectionAttributeStringChanged(%S,%S,%S)\n", bstrAttribName, bstrOldAttribVal, bstrNewAttribVal);
    return;
}

// Sent when playlist collection needs to be requeried
void CWMPEventDispatch::PlaylistCollectionChange()
{
    printf("PlaylistCollectionChange()\n");
    return;
}

// Sent when a playlist is added to the playlist collection
void CWMPEventDispatch::PlaylistCollectionPlaylistAdded(BSTR bstrPlaylistName)
{
    printf("PlaylistCollectionPlaylistAdded(%S)\n", bstrPlaylistName);
    return;
}

// Sent when a playlist is removed from the playlist collection
void CWMPEventDispatch::PlaylistCollectionPlaylistRemoved(BSTR bstrPlaylistName)
{
    printf("PlaylistCollectionPlaylistRemoved(%S)\n", bstrPlaylistName);
    return;
}

// Sent when a playlist has been set or reset as deleted
void CWMPEventDispatch::PlaylistCollectionPlaylistSetAsDeleted(BSTR bstrPlaylistName, VARIANT_BOOL varfIsDeleted)
{
    printf("PlaylistCollectionPlaylistSetAsDeleted(%S,%lu)\n", bstrPlaylistName, varfIsDeleted);
    return;
}

// Playlist playback mode has changed
void CWMPEventDispatch::ModeChange(BSTR ModeName, VARIANT_BOOL NewValue)
{
    printf("ModeChange(%S,%lu)\n", ModeName, NewValue);
    return;
}

// Sent when the media object has an error condition
void CWMPEventDispatch::MediaError(IDispatch * pMediaObject)
{
    printf("%9lu MediaError(%p)\n", RelTick(), pMediaObject);
    if (pMediaObject)
    {
        IWMPMedia2* pWMPMedia2 = NULL;
        HRESULT hr = pMediaObject->QueryInterface(__uuidof(IWMPMedia2), (void**) &pWMPMedia2);
        if (hr == S_OK)
        {
            IWMPErrorItem* pItem = NULL;
            hr = pWMPMedia2->get_error(&pItem);
            if (hr == S_OK)
            {
                long lErrCode = 0;
                hr = pItem->get_errorCode(&lErrCode);
                if (hr == S_OK)
                {
                    CComBSTR bstrErrDesc;
                    hr = pItem->get_errorDescription(&bstrErrDesc);
                    if (hr == S_OK)
                    {
                        printf("\terrCode=%ld errDesc=%S\n", lErrCode, bstrErrDesc);
                    }
                }
            }
            SAFE_RELEASE(pItem);
        }
        SAFE_RELEASE(pWMPMedia2);
    }
    return;
}

// Current playlist switch with no open state change
void CWMPEventDispatch::OpenPlaylistSwitch(IDispatch *pItem)
{
    printf("OpenPlaylistSwitch(%p)\n", pItem);
    if (pItem)
    {
        // QI for IWMPPlaylist
        IWMPPlaylist* pList = NULL;
        HRESULT hr = pItem->QueryInterface(__uuidof(IWMPPlaylist), (void**) &pList);
        if (hr == S_OK)
        {
            PrintPlaylistAttributes(pList);
        }
        SAFE_RELEASE(pList);
    }
    return;
}

// Sent when the current DVD domain changes
void CWMPEventDispatch::DomainChange(BSTR strDomain)
{
    printf("DomainChange(%S)\n", strDomain);
    return;
}

// Sent when display switches to player application
void CWMPEventDispatch::SwitchedToPlayerApplication()
{
    printf("SwitchedToPlayerApplication()\n");
    return;
}

// Sent when display switches to control
void CWMPEventDispatch::SwitchedToControl()
{
    printf("SwitchedToControl()\n");
    return;
}

// Sent when the player docks or undocks
void CWMPEventDispatch::PlayerDockedStateChange()
{
    printf("PlayerDockedStateChange()\n");
    return;
}

// Sent when the OCX reconnects to the player
void CWMPEventDispatch::PlayerReconnect()
{
    printf("PlayerReconnect()\n");
    return;
}

// Occurs when a user clicks the mouse
void CWMPEventDispatch::Click( short nButton, short nShiftState, long fX, long fY )
{
    printf("Click(%d,%d,%ld,%ld)\n", nButton, nShiftState, fX, fY);
    return;
}

// Occurs when a user double-clicks the mouse
void CWMPEventDispatch::DoubleClick( short nButton, short nShiftState, long fX, long fY )
{
    printf("DoubleClick(%d,%d,%ld,%ld)\n", nButton, nShiftState, fX, fY);
    return;
}

// Occurs when a key is pressed
void CWMPEventDispatch::KeyDown( short nKeyCode, short nShiftState )
{
    printf("KeyDown(%d,%d)\n", nKeyCode, nShiftState);
    return;
}

// Occurs when a key is pressed and released
void CWMPEventDispatch::KeyPress( short nKeyAscii )
{
    printf("KeyPress(%d)\n", nKeyAscii);
    return;
}

// Occurs when a key is released
void CWMPEventDispatch::KeyUp( short nKeyCode, short nShiftState )
{
    printf("KeyUp(%d,%d)\n", nKeyCode, nShiftState);
    return;
}

// Occurs when a mouse button is pressed
void CWMPEventDispatch::MouseDown( short nButton, short nShiftState, long fX, long fY )
{
    printf("MouseDown(%d,%d,%ld,%ld)\n", nButton, nShiftState, fX, fY);
    return;
}

// Occurs when a mouse pointer is moved
void CWMPEventDispatch::MouseMove( short nButton, short nShiftState, long fX, long fY )
{
    printf("MouseDown(%d,%d,%ld,%ld)\n", nButton, nShiftState, fX, fY);
    return;
}

// Occurs when a mouse button is released
void CWMPEventDispatch::MouseUp( short nButton, short nShiftState, long fX, long fY )
{
    printf("MouseUp(%d,%d,%ld,%ld)\n", nButton, nShiftState, fX, fY);
    return;
}

void CWMPEventDispatch::PrintMediaAttributes(IWMPMedia* pWMPMedia)
{
    if (pWMPMedia)
    {
        // Get the media name
        CComBSTR bstrMediaName;
        pWMPMedia->get_name(&bstrMediaName);
        // Get the media duration
        double dDuration = 0.0;
        pWMPMedia->get_duration(&dDuration);
        // Get the source URL
        CComBSTR bstrSourceURL;
        pWMPMedia->get_sourceURL(&bstrSourceURL);
        // Get the image source width
        long lWidth = 0;
        pWMPMedia->get_imageSourceWidth(&lWidth);
        // Get the image source height
        long lHeight = 0;
        pWMPMedia->get_imageSourceHeight(&lHeight);
        // Get the attribute count
        long lNumAttr = 0;
        pWMPMedia->get_attributeCount(&lNumAttr);
        // Log the name, duration, URL, width, and height, and number of attributes
        printf("\tMedia Attributes(%p) name=%S sourceURL=%S width=%ld height=%ld duration=%lf numAttributes=%ld\n",
                pWMPMedia, bstrMediaName, bstrSourceURL, lWidth, lHeight, dDuration, lNumAttr);
        // Loop through the attributes
        CComBSTR bstrAttrName;
        CComBSTR bstrAttrValue;
        for (long i = 0; i < lNumAttr; i++)
        {
            // Get the attribute name
            HRESULT hr = pWMPMedia->getAttributeName(i, &bstrAttrName);
            if (hr == S_OK)
            {
                hr = pWMPMedia->getItemInfo(bstrAttrName, &bstrAttrValue);
                if (hr == S_OK)
                {
                    printf("\t\tname=%S\tvalue=%S\n", bstrAttrName, bstrAttrValue);
                }
            }
        }
    }
}

void CWMPEventDispatch::PrintPlaylistAttributes(IWMPPlaylist* pWMPPlaylist)
{
    if (pWMPPlaylist)
    {
        // Get the playlist name
        CComBSTR bstrPlaylistName;
        pWMPPlaylist->get_name(&bstrPlaylistName);
        // Get the number of items in the playlist
        long lCount = 0;
        pWMPPlaylist->get_count(&lCount);
        // Get the attribute count
        long lNumAttr = 0;
        pWMPPlaylist->get_attributeCount(&lNumAttr);
        // Log the name, number of items, and number of attributes
        printf("\tPlaylist Attributes(%p) name=%S itemCount=%ld numAttributes=%ld\n",
                pWMPPlaylist, bstrPlaylistName, lCount, lNumAttr);
        // Loop through the attributes
        CComBSTR bstrAttrName;
        CComBSTR bstrAttrValue;
        long i = 0;
        for (i = 0; i < lNumAttr; i++)
        {
            // Get the attribute name
            HRESULT hr = pWMPPlaylist->get_attributeName(i, &bstrAttrName);
            if (hr == S_OK)
            {
                hr = pWMPPlaylist->getItemInfo(bstrAttrName, &bstrAttrValue);
                if (hr == S_OK)
                {
                    printf("\t\tname=%S\tvalue=%S\n", bstrAttrName, bstrAttrValue);
                }
            }
        }
        // Loop through the playlist items
        for (i = 0; i < lCount; i++)
        {
            IWMPMedia* pWMPMedia = NULL;
            HRESULT hr = pWMPPlaylist->get_item(i, &pWMPMedia);
            if (hr == S_OK)
            {
                PrintMediaAttributes(pWMPMedia);
            }
            SAFE_RELEASE(pWMPMedia);
        }
    }
}

void CWMPEventDispatch::SetPlayer(IWMPPlayer* pPlayer)
{
    if (pPlayer)
    {
        m_spPlayer = pPlayer;
        if (m_spPlayer)
        {
            m_spPlayer->get_controls(&m_spControls);
        }
    }
}

unsigned long CWMPEventDispatch::RelTick()
{
    unsigned long ulRet = GetBetterTickCount();
    ulRet -= m_ulBaseTick;
    return ulRet;
}

CWMPEventDispatch::CWMPEventDispatch()
{
    m_ulBaseTick         = 0;
    m_bOpeningUnknownURL = false;
    m_bMediaOpen         = false;
    m_bPauseOnPlay       = false;
}

--- NEW FILE: gettickcount.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: gettickcount.h,v 1.1 2006/05/04 21:04:51 ehyche Exp $
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef GETTICKCOUNT_H
#define GETTICKCOUNT_H

#define ULONG32 unsigned long
#define HXBOOL bool

ULONG32 GetBetterTickCount();

#endif /* #ifndef GETTICKCOUNT_H */

--- NEW FILE: stdafx.h ---
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once


#include 
#include 
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit

#include 
#include 
#include 

// TODO: reference additional headers your program requires here

--- NEW FILE: stdafx.cpp ---
// stdafx.cpp : source file that includes just the standard includes
// wmpconsole.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"

// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

--- NEW FILE: CWMPEventDispatch.h ---
// CWMPEventDispatch.h : Declaration of the event dispatcher
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//

#include "stdafx.h"
#include "wmpids.h"
#include "wmp.h"

class CWMPEventDispatch:
    public CComObjectRootEx,
    public IWMPEvents,
    public _WMPOCXEvents
    {
public:

    BEGIN_COM_MAP(CWMPEventDispatch)
        COM_INTERFACE_ENTRY(_WMPOCXEvents)
        COM_INTERFACE_ENTRY(IWMPEvents)
        COM_INTERFACE_ENTRY(IDispatch)
    END_COM_MAP()

    // IDispatch methods
    STDMETHOD(GetIDsOfNames)( REFIID riid, 
                              OLECHAR FAR *FAR *rgszNames,
                              unsigned int cNames, 
                              LCID lcid, 
                              DISPID FAR *rgDispId )
    { return( E_NOTIMPL ); }

    STDMETHOD(GetTypeInfo)( unsigned int iTInfo, 
                            LCID lcid, 
                            ITypeInfo FAR *FAR *ppTInfo )
    { return( E_NOTIMPL ); }

    STDMETHOD(GetTypeInfoCount)( unsigned int FAR *pctinfo )
    {
        return( E_NOTIMPL );
    }

    STDMETHOD(Invoke)( DISPID  dispIdMember,      
                       REFIID  riid,              
                       LCID  lcid,                
                       WORD  wFlags,              
                       DISPPARAMS FAR*  pDispParams,  
                       VARIANT FAR*  pVarResult,  
                       EXCEPINFO FAR*  pExcepInfo,  
                       unsigned int FAR*  puArgErr );

    // IWMPEvents methods
    void STDMETHODCALLTYPE OpenStateChange( long NewState );
    void STDMETHODCALLTYPE PlayStateChange( long NewState );
    void STDMETHODCALLTYPE AudioLanguageChange( long LangID );
    void STDMETHODCALLTYPE StatusChange();
    void STDMETHODCALLTYPE ScriptCommand( BSTR scType, BSTR Param );
    void STDMETHODCALLTYPE NewStream();
    void STDMETHODCALLTYPE Disconnect( long Result );
    void STDMETHODCALLTYPE Buffering( VARIANT_BOOL Start );
    void STDMETHODCALLTYPE Error();
    void STDMETHODCALLTYPE Warning( long WarningType, long Param, BSTR Description );
    void STDMETHODCALLTYPE EndOfStream( long Result );
    void STDMETHODCALLTYPE PositionChange( double oldPosition, double newPosition);
    void STDMETHODCALLTYPE MarkerHit( long MarkerNum );
    void STDMETHODCALLTYPE DurationUnitChange( long NewDurationUnit );
    void STDMETHODCALLTYPE CdromMediaChange( long CdromNum );
    void STDMETHODCALLTYPE PlaylistChange( IDispatch * Playlist, WMPPlaylistChangeEventType change );
    void STDMETHODCALLTYPE CurrentPlaylistChange( WMPPlaylistChangeEventType change );
    void STDMETHODCALLTYPE CurrentPlaylistItemAvailable( BSTR bstrItemName );
    void STDMETHODCALLTYPE MediaChange( IDispatch * Item );
    void STDMETHODCALLTYPE CurrentMediaItemAvailable( BSTR bstrItemName );
    void STDMETHODCALLTYPE CurrentItemChange( IDispatch *pdispMedia);
    void STDMETHODCALLTYPE MediaCollectionChange();
    void STDMETHODCALLTYPE MediaCollectionAttributeStringAdded( BSTR bstrAttribName,  BSTR bstrAttribVal );
    void STDMETHODCALLTYPE MediaCollectionAttributeStringRemoved( BSTR bstrAttribName,  BSTR bstrAttribVal );
    void STDMETHODCALLTYPE MediaCollectionAttributeStringChanged( BSTR bstrAttribName, BSTR bstrOldAttribVal, BSTR bstrNewAttribVal);
    void STDMETHODCALLTYPE PlaylistCollectionChange();
    void STDMETHODCALLTYPE PlaylistCollectionPlaylistAdded( BSTR bstrPlaylistName);
    void STDMETHODCALLTYPE PlaylistCollectionPlaylistRemoved( BSTR bstrPlaylistName);
    void STDMETHODCALLTYPE PlaylistCollectionPlaylistSetAsDeleted( BSTR bstrPlaylistName, VARIANT_BOOL varfIsDeleted);
    void STDMETHODCALLTYPE ModeChange( BSTR ModeName, VARIANT_BOOL NewValue);
    void STDMETHODCALLTYPE MediaError( IDispatch * pMediaObject);
    void STDMETHODCALLTYPE OpenPlaylistSwitch( IDispatch *pItem );
    void STDMETHODCALLTYPE DomainChange( BSTR strDomain);
    void STDMETHODCALLTYPE SwitchedToPlayerApplication();
    void STDMETHODCALLTYPE SwitchedToControl();
    void STDMETHODCALLTYPE PlayerDockedStateChange();
    void STDMETHODCALLTYPE PlayerReconnect();
    void STDMETHODCALLTYPE Click( short nButton, short nShiftState, long fX, long fY );
    void STDMETHODCALLTYPE DoubleClick( short nButton, short nShiftState, long fX, long fY );
    void STDMETHODCALLTYPE KeyDown( short nKeyCode, short nShiftState );
    void STDMETHODCALLTYPE KeyPress( short nKeyAscii );
    void STDMETHODCALLTYPE KeyUp( short nKeyCode, short nShiftState );
    void STDMETHODCALLTYPE MouseDown( short nButton, short nShiftState, long fX, long fY );
    void STDMETHODCALLTYPE MouseMove( short nButton, short nShiftState, long fX, long fY );
    void STDMETHODCALLTYPE MouseUp( short nButton, short nShiftState, long fX, long fY );

    static void PrintMediaAttributes(IWMPMedia* pWMPMedia);
    static void PrintPlaylistAttributes(IWMPPlaylist* pWMPPlaylist);
    void SetPlayer(IWMPPlayer* pPlayer);
    void SetBaseTick(unsigned long ulTick) { m_ulBaseTick = ulTick; }
protected:
    CWMPEventDispatch();
    CComPtr   m_spPlayer;
    CComPtr m_spControls;
    unsigned long         m_ulBaseTick;
    bool                  m_bOpeningUnknownURL;
    bool                  m_bMediaOpen;
    bool                  m_bPauseOnPlay;

    unsigned long RelTick();
};

typedef CComObject CComWMPEventDispatch;

From jagmeet at helixcommunity.org  Thu May  4 23:38:06 2006
From: jagmeet at helixcommunity.org (jagmeet@helixcommunity.org)
Date: Fri May  5 01:30:52 2006
Subject: [Datatype-cvs] null/renderer nullrend.cpp,1.5.10.2,1.5.10.2.8.1
Message-ID: 

Update of /cvsroot/datatype/null/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv20512

Modified Files:
      Tag: helixsim-perf-05SEPT6
	nullrend.cpp 
Log Message:
Jagmeet: Fix for PR# 163183 (Never logs rebuffer for 3gp), removed dependence on m_ulFinalPacketTime for rebuffering from Null Renderer.



Index: nullrend.cpp
===================================================================
RCS file: /cvsroot/datatype/null/renderer/nullrend.cpp,v
retrieving revision 1.5.10.2
retrieving revision 1.5.10.2.8.1
diff -u -d -r1.5.10.2 -r1.5.10.2.8.1
--- nullrend.cpp	20 May 2005 00:14:45 -0000	1.5.10.2
+++ nullrend.cpp	5 May 2006 06:38:04 -0000	1.5.10.2.8.1
@@ -467,6 +467,7 @@
     , m_ulPacketDuration(0)
     , m_ulLastPacketTime(0)
     , m_ulCurrentTime(0)
+    , m_bEndOfPackets(FALSE)
     , m_bRebuffering(FALSE)
     , m_bUseRebuffering(TRUE)
 { 
@@ -705,13 +706,15 @@
 	
 	/* see if we can stop rebuffering */
 	if (m_bRebuffering && !pPacket->IsLost() &&
-	    ulTime > m_ulCurrentTime + m_ulPreroll)
+	    ((LONG32)(ulTime - (m_ulCurrentTime + m_ulPreroll))) > 0)
 	{
 	    m_pStream->ReportRebufferStatus(0,0);
 	    m_bRebuffering = FALSE;
 	}
-	
-	m_ulLastPacketTime = ulTime;
+	if(!pPacket->IsLost())
+	{
+	    m_ulLastPacketTime = ulTime;
+	}
     }
     
     return HXR_OK;
@@ -733,9 +736,8 @@
 //	printf("OnTimeSych(): time %d\n", ulTime);
 
 	/* determine whether we're out of packets */
-	if (ulTime > m_ulLastPacketTime &&
-	    (ulTime < m_ulFinalPacketTime ||
-	    m_ulLastPacketTime < m_ulFinalPacketTime) &&
+	if (((LONG32)(m_ulLastPacketTime - ulTime) < 0) &&
+	    !m_bEndOfPackets &&
 	    !m_bRebuffering)
 	{
 	    /* start rebuffering */
@@ -774,6 +776,8 @@
 //
 STDMETHODIMP NullRenderer::OnPostSeek(ULONG32 ulOldTime, ULONG32 ulNewTime)
 {
+    m_bEndOfPackets = FALSE;
+    m_ulLastPacketTime = ulNewTime;
     return HXR_OK;
 }
 
@@ -800,6 +804,7 @@
 //
 STDMETHODIMP NullRenderer::OnBegin(ULONG32 ulTime)
 {
+    m_ulLastPacketTime = ulTime;
     return HXR_OK;
 }
 
@@ -851,6 +856,7 @@
  */
 STDMETHODIMP NullRenderer::OnEndofPackets(void)
 {
+    m_bEndOfPackets = TRUE;
     return HXR_OK;
 }
 
@@ -963,27 +969,7 @@
 UINT32
 NullRenderer::AdjustTimestamp(UINT32 ulTimestamp, LONG32 lTimeOffset)
 {
-    UINT32 ulAdjustedTime = ulTimestamp;
-
-    // adjust the time based on the offset handling overflow
-    // correctly
-    if (lTimeOffset < 0)
-    {
-	ulAdjustedTime += (UINT32) (-lTimeOffset);
-    }
-    else
-    {
-	if (ulAdjustedTime < (UINT32)lTimeOffset)
-	{
-	    ulAdjustedTime = 0;
-	}
-	else
-	{
-	    ulAdjustedTime -= (UINT32)lTimeOffset;
-	}
-    }
-
-    return ulAdjustedTime;
+    return (ulTimestamp - lTimeOffset);
 }
 
 // *** IUnknown methods ***


From jagmeet at helixcommunity.org  Fri May  5 01:15:45 2006
From: jagmeet at helixcommunity.org (jagmeet@helixcommunity.org)
Date: Fri May  5 03:08:30 2006
Subject: [Datatype-cvs] null/renderer nullrend.h,1.2.22.1,1.2.22.1.10.1
Message-ID: 

Update of /cvsroot/datatype/null/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv1310

Modified Files:
      Tag: helixsim-perf-05SEPT6
	nullrend.h 
Log Message:
Jagmeet: checkin the updated nullrend.h file.



Index: nullrend.h
===================================================================
RCS file: /cvsroot/datatype/null/renderer/nullrend.h,v
retrieving revision 1.2.22.1
retrieving revision 1.2.22.1.10.1
diff -u -d -r1.2.22.1 -r1.2.22.1.10.1
--- nullrend.h	29 Mar 2005 21:30:02 -0000	1.2.22.1
+++ nullrend.h	5 May 2006 08:15:43 -0000	1.2.22.1.10.1
@@ -50,6 +50,7 @@
     UINT32		m_ulLastPacketTime;
     UINT32		m_ulFinalPacketTime;
     UINT32		m_ulCurrentTime;
+    BOOL		m_bEndOfPackets;
     BOOL		m_bRebuffering;
     BOOL			m_bUseRebuffering;
     


From jagmeet at helixcommunity.org  Fri May  5 02:01:41 2006
From: jagmeet at helixcommunity.org (jagmeet@helixcommunity.org)
Date: Fri May  5 03:54:25 2006
Subject: [Datatype-cvs] null/renderer nullrend.cpp, 1.11, 1.12 nullrend.h,
	1.5, 1.6
Message-ID: 

Update of /cvsroot/datatype/null/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv27807

Modified Files:
	nullrend.cpp nullrend.h 
Log Message:
Jagmeet: Fix for PR# 163183 (Never logs rebuffer for 3gp), removed dependence on m_ulFinalPacketTime for rebuffering from Null Renderer.

Index: nullrend.cpp
===================================================================
RCS file: /cvsroot/datatype/null/renderer/nullrend.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- nullrend.cpp	27 Feb 2006 16:18:58 -0000	1.11
+++ nullrend.cpp	5 May 2006 09:01:39 -0000	1.12
@@ -465,6 +465,7 @@
 , m_ulPacketDuration(0)
 , m_ulLastPacketTime(0)
 , m_ulCurrentTime(0)
+    , m_bEndOfPackets(FALSE)
 , m_bRebuffering(FALSE)
 , m_bUseRebuffering(TRUE)
 #endif // End of #ifndef HELIX_NULLREND_MIMELESS_MINIMAL
@@ -691,14 +692,16 @@
         
         /* see if we can stop rebuffering */
         if (m_bRebuffering && !pPacket->IsLost() &&
-            ulTime > m_ulCurrentTime + m_ulPreroll)
+	    ((LONG32)(ulTime - (m_ulCurrentTime + m_ulPreroll))) > 0)
         {
             m_pStream->ReportRebufferStatus(0,0);
             m_bRebuffering = FALSE;
         }
-        
+	if(!pPacket->IsLost())
+	{
         m_ulLastPacketTime = ulTime;
     }
+}
 #endif // End of #ifndef HELIX_NULLREND_MIMELESS_MINIMAL    
     
     return HXR_OK;
@@ -722,9 +725,8 @@
         //	printf("OnTimeSych(): time %d\n", ulTime);
         
         /* determine whether we're out of packets */
-        if (ulTime > m_ulLastPacketTime &&
-            (ulTime < m_ulFinalPacketTime ||
-            m_ulLastPacketTime < m_ulFinalPacketTime) &&
+	if (((LONG32)(m_ulLastPacketTime - ulTime) < 0) &&
+	    !m_bEndOfPackets &&
             !m_bRebuffering)
         {
             /* start rebuffering */
@@ -764,6 +766,8 @@
 //
 STDMETHODIMP NullRenderer::OnPostSeek(ULONG32 ulOldTime, ULONG32 ulNewTime)
 {
+    m_bEndOfPackets = FALSE;
+    m_ulLastPacketTime = ulNewTime;
     return HXR_OK;
 }
 
@@ -790,6 +794,7 @@
 //
 STDMETHODIMP NullRenderer::OnBegin(ULONG32 ulTime)
 {
+    m_ulLastPacketTime = ulTime;
     return HXR_OK;
 }
 
@@ -841,6 +846,7 @@
  */
 STDMETHODIMP NullRenderer::OnEndofPackets(void)
 {
+    m_bEndOfPackets = TRUE;
     return HXR_OK;
 }
 
@@ -933,27 +939,7 @@
 UINT32
 NullRenderer::AdjustTimestamp(UINT32 ulTimestamp, LONG32 lTimeOffset)
 {
-    UINT32 ulAdjustedTime = ulTimestamp;
-    
-    // adjust the time based on the offset handling overflow
-    // correctly
-    if (lTimeOffset < 0)
-    {
-        ulAdjustedTime += (UINT32) (-lTimeOffset);
-    }
-    else
-    {
-        if (ulAdjustedTime < (UINT32)lTimeOffset)
-        {
-            ulAdjustedTime = 0;
-        }
-        else
-        {
-            ulAdjustedTime -= (UINT32)lTimeOffset;
-        }
-    }
-    
-    return ulAdjustedTime;
+    return (ulTimestamp - lTimeOffset);
 }
 
 void NullRenderer::AddCodec(IHXValues* pValues, 

Index: nullrend.h
===================================================================
RCS file: /cvsroot/datatype/null/renderer/nullrend.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- nullrend.h	28 Sep 2005 15:58:06 -0000	1.5
+++ nullrend.h	5 May 2006 09:01:39 -0000	1.6
@@ -92,6 +92,7 @@
     UINT32		m_ulLastPacketTime;
     UINT32		m_ulFinalPacketTime;
     UINT32		m_ulCurrentTime;
+    HXBOOL		m_bEndOfPackets;
     HXBOOL		m_bRebuffering;
     HXBOOL		m_bUseRebuffering;
 #endif // End of #ifndef HELIX_NULLREND_MIMELESS_MINIMAL


From ehyche at helixcommunity.org  Fri May  5 06:09:05 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:01:46 2006
Subject: [Datatype-cvs] wm/common Umakefil,1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/wm/common
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv30354/common

Modified Files:
	Umakefil 
Log Message:
Transferring datatype/asf to datatype/wm.
All code has been previously reviewed.


Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/wm/common/Umakefil,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Umakefil	4 May 2006 21:04:49 -0000	1.1
+++ Umakefil	5 May 2006 13:09:03 -0000	1.2
@@ -61,6 +61,6 @@
 
 project.AddSources("parse_opaque.cpp")
 
-LibraryTarget("asfcomlib")
+LibraryTarget("wmcomlib")
 
 DependTarget()


From ehyche at helixcommunity.org  Fri May  5 06:09:05 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:01:46 2006
Subject: [Datatype-cvs] wm/fileformat asfffdll, 1.1.1.1,
	1.2 asffflib_win32.pcf, 1.1.1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/wm/fileformat
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv30354/fileformat

Modified Files:
	asfffdll asffflib_win32.pcf 
Log Message:
Transferring datatype/asf to datatype/wm.
All code has been previously reviewed.


Index: asffflib_win32.pcf
===================================================================
RCS file: /cvsroot/datatype/wm/fileformat/asffflib_win32.pcf,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- asffflib_win32.pcf	4 May 2006 20:45:22 -0000	1.1.1.1
+++ asffflib_win32.pcf	5 May 2006 13:09:03 -0000	1.2
@@ -44,7 +44,7 @@
                        "platform/win32/hxwmreader.cpp",
                        "platform/win32/asf_rule_state.cpp")
     project.AddModuleIncludes("common/system/pub/platform/win",
-                              "datatype/asf/common/pub/platform/win32")
+                              "datatype/wm/common/pub/platform/win32")
     project.AddIncludes("pub/platform/win32")
     wmfsdk = GetSDKPath("wmfsdk")
     wmfsdk_include = os.path.join(wmfsdk, "include")

Index: asfffdll
===================================================================
RCS file: /cvsroot/datatype/wm/fileformat/asfffdll,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- asfffdll	4 May 2006 20:45:22 -0000	1.1.1.1
+++ asfffdll	5 May 2006 13:09:03 -0000	1.2
@@ -45,8 +45,8 @@
                            "common/util[utillib]",
                            "common/system[syslib]",
                            "common/log/logutil[logutillib]",
-                           "datatype/asf/common[asfcomlib]",
-                           "datatype/asf/fileformat[asffflib]")
+                           "datatype/wm/common[wmcomlib]",
+                           "datatype/wm/fileformat[asffflib]")
                            
 project.AddSources("asf_file_format_dll.cpp",
                    "asf_file_format_guids.cpp")


From ehyche at helixcommunity.org  Fri May  5 06:09:06 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:01:48 2006
Subject: [Datatype-cvs] wm/video/codec/wmv9 wmv9decoderdll, 1.1.1.1,
	1.2 wmv9decoderlib, 1.1.1.1, 1.2 wmv9decoderlib_win32.pcf,
	1.1.1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/wm/video/codec/wmv9
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv30354/video/codec/wmv9

Modified Files:
	wmv9decoderdll wmv9decoderlib wmv9decoderlib_win32.pcf 
Log Message:
Transferring datatype/asf to datatype/wm.
All code has been previously reviewed.


Index: wmv9decoderlib
===================================================================
RCS file: /cvsroot/datatype/wm/video/codec/wmv9/wmv9decoderlib,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmv9decoderlib	4 May 2006 20:45:34 -0000	1.1.1.1
+++ wmv9decoderlib	5 May 2006 13:09:03 -0000	1.2
@@ -47,7 +47,7 @@
                           "client/include",
                           "datatype/rm/common/pub",
                           "datatype/rm/include",
-                          "datatype/asf/common/pub")
+                          "datatype/wm/common/pub")
 
 LibraryTarget("wmv9decoderlib")
 

Index: wmv9decoderdll
===================================================================
RCS file: /cvsroot/datatype/wm/video/codec/wmv9/wmv9decoderdll,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmv9decoderdll	4 May 2006 20:45:34 -0000	1.1.1.1
+++ wmv9decoderdll	5 May 2006 13:09:03 -0000	1.2
@@ -47,8 +47,8 @@
                            "common/container[contlib]",
                            "common/system[syslib]",
                            "common/log/logutil[logutillib]",
-                           "datatype/asf/common[asfcomlib]",
-                           "datatype/asf/video/codec/wmv9[wmv9decoderlib]")
+                           "datatype/wm/common[wmcomlib]",
+                           "datatype/wm/video/codec/wmv9[wmv9decoderlib]")
 
 project.AddSources("wmv9_decoder_guids.cpp",
                    "wmv9_decoder_entry.cpp")

Index: wmv9decoderlib_win32.pcf
===================================================================
RCS file: /cvsroot/datatype/wm/video/codec/wmv9/wmv9decoderlib_win32.pcf,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmv9decoderlib_win32.pcf	4 May 2006 20:45:34 -0000	1.1.1.1
+++ wmv9decoderlib_win32.pcf	5 May 2006 13:09:03 -0000	1.2
@@ -39,7 +39,7 @@
 
 if project.IsDefined("HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO"):
     project.AddSources("platform/win32/wmv9_decoder_dmo.cpp")
-    project.AddModuleIncludes("datatype/asf/common/pub/platform/win32")
+    project.AddModuleIncludes("datatype/wm/common/pub/platform/win32")
     project.AddIncludes("platform/win32")
     wmfsdk = GetSDKPath("wmfsdk")
     wmfsdk_include = os.path.join(wmfsdk, "include")


From ehyche at helixcommunity.org  Fri May  5 06:09:06 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:01:48 2006
Subject: [Datatype-cvs] wm/video/renderer wmvrenderdll, 1.1.1.1,
	1.2 wmvrenderlib, 1.1.1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/wm/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv30354/video/renderer

Modified Files:
	wmvrenderdll wmvrenderlib 
Log Message:
Transferring datatype/asf to datatype/wm.
All code has been previously reviewed.


Index: wmvrenderlib
===================================================================
RCS file: /cvsroot/datatype/wm/video/renderer/wmvrenderlib,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmvrenderlib	4 May 2006 20:45:41 -0000	1.1.1.1
+++ wmvrenderlib	5 May 2006 13:09:04 -0000	1.2
@@ -54,7 +54,7 @@
                           "datatype/common/container/pub",
                           "datatype/common/util/pub",
                           "datatype/common/vidrend/pub",
-                          "datatype/asf/common/pub")
+                          "datatype/wm/common/pub")
 
 project.AddSources("wmvrender.cpp",
                    "wmvformat.cpp",

Index: wmvrenderdll
===================================================================
RCS file: /cvsroot/datatype/wm/video/renderer/wmvrenderdll,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmvrenderdll	4 May 2006 20:45:41 -0000	1.1.1.1
+++ wmvrenderdll	5 May 2006 13:09:04 -0000	1.2
@@ -58,8 +58,8 @@
                            "datatype/common/vidrend[vidrend]",
                            "datatype/common/util[dtutillib]",
                            "datatype/rm/common[rmcomlib]",
-                           "datatype/asf/common[asfcomlib]",
-                           "datatype/asf/video/renderer[wmvrenderlib]")
+                           "datatype/wm/common[wmcomlib]",
+                           "datatype/wm/video/renderer[wmvrenderlib]")
 
 project.AddLibraries(GetSDKPath("rmvidcom_lib"))
 


From ehyche at helixcommunity.org  Fri May  5 06:09:07 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:01:48 2006
Subject: [Datatype-cvs] wm/wmphost wmphostdll_win32.pcf,1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv30354/wmphost

Modified Files:
	wmphostdll_win32.pcf 
Log Message:
Transferring datatype/asf to datatype/wm.
All code has been previously reviewed.


Index: wmphostdll_win32.pcf
===================================================================
RCS file: /cvsroot/datatype/wm/wmphost/wmphostdll_win32.pcf,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmphostdll_win32.pcf	4 May 2006 21:04:50 -0000	1.1
+++ wmphostdll_win32.pcf	5 May 2006 13:09:04 -0000	1.2
@@ -50,7 +50,7 @@
                            "common/log/logutil[logutillib]",
                            "datatype/common/basehost[basehostlib]",
                            "datatype/common/util[dtutillib]",
-                           "datatype/asf/wmphost[wmphostlib]")
+                           "datatype/wm/wmphost[wmphostlib]")
 
 project.AddIncludes("platform/win32",
                     wmpsdk_include)


From ehyche at helixcommunity.org  Fri May  5 06:09:03 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:02:16 2006
Subject: [Datatype-cvs] wm/audio/codec/wma9 wma9decoderdll, 1.1.1.1,
	1.2 wma9decoderlib, 1.1.1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/wm/audio/codec/wma9
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv30354/audio/codec/wma9

Modified Files:
	wma9decoderdll wma9decoderlib 
Log Message:
Transferring datatype/asf to datatype/wm.
All code has been previously reviewed.


Index: wma9decoderlib
===================================================================
RCS file: /cvsroot/datatype/wm/audio/codec/wma9/wma9decoderlib,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wma9decoderlib	4 May 2006 20:45:12 -0000	1.1.1.1
+++ wma9decoderlib	5 May 2006 13:08:59 -0000	1.2
@@ -45,7 +45,7 @@
                           "common/system/pub",
                           "common/log/logutil/pub",
                           "datatype/include",
-                          "datatype/asf/common/pub")
+                          "datatype/wm/common/pub")
 
 LibraryTarget("wma9decoderlib")
 

Index: wma9decoderdll
===================================================================
RCS file: /cvsroot/datatype/wm/audio/codec/wma9/wma9decoderdll,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wma9decoderdll	4 May 2006 20:45:12 -0000	1.1.1.1
+++ wma9decoderdll	5 May 2006 13:08:59 -0000	1.2
@@ -47,8 +47,8 @@
                            "common/container[contlib]",
                            "common/system[syslib]",
                            "common/log/logutil[logutillib]",
-                           "datatype/asf/common[asfcomlib]",
-                           "datatype/asf/audio/codec/wma9[wma9decoderlib]")
+                           "datatype/wm/common[wmcomlib]",
+                           "datatype/wm/audio/codec/wma9[wma9decoderlib]")
 
 project.AddSources("wma9_decoder_entry.cpp",
                    "wma9_decoder_guids.cpp")


From ehyche at helixcommunity.org  Fri May  5 06:09:05 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:02:16 2006
Subject: [Datatype-cvs] wm/audio/renderer wmarenderdll_win32.pcf, NONE,
	1.1 wmarenderdll, 1.1.1.1, 1.2 win32.pcf, 1.1.1.1, NONE
Message-ID: 

Update of /cvsroot/datatype/wm/audio/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv30354/audio/renderer

Modified Files:
	wmarenderdll 
Added Files:
	wmarenderdll_win32.pcf 
Removed Files:
	win32.pcf 
Log Message:
Transferring datatype/asf to datatype/wm.
All code has been previously reviewed.


--- NEW FILE: wmarenderdll_win32.pcf ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

project.AddSources("platform/win32/wmarender.rc")

project.AddSystemLibraries("version.lib", 
			   "kernel32.lib", 
			   "user32.lib", 
			   "advapi32.lib", 
			   "gdi32.lib",
			   "wsock32.lib")

--- win32.pcf DELETED ---

Index: wmarenderdll
===================================================================
RCS file: /cvsroot/datatype/wm/audio/renderer/wmarenderdll,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmarenderdll	4 May 2006 20:45:19 -0000	1.1.1.1
+++ wmarenderdll	5 May 2006 13:09:01 -0000	1.2
@@ -50,7 +50,7 @@
                            "datatype/common/util[dtutillib]",
                            "datatype/common/container[dtcomcontlib]",
                            "datatype/common/audrend[audrend]",
-                           "datatype/asf/audio/renderer[wmarenderlib]")
+                           "datatype/wm/audio/renderer[wmarenderlib]")
 
 project.AddSources("wmarender_guids.cpp",
                    "wmarender_dll.cpp")


From ehyche at helixcommunity.org  Fri May  5 06:22:47 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:15:28 2006
Subject: [Datatype-cvs] wm/audio/codec/wma9 wma9_decoder_entry.cpp, 1.1.1.1,
	1.2 wma9decoderdll_win32.pcf, 1.1.1.1,
	1.2 wma9decoderlib_win32.pcf, 1.1.1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/wm/audio/codec/wma9
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv7789/audio/codec/wma9

Modified Files:
	wma9_decoder_entry.cpp wma9decoderdll_win32.pcf 
	wma9decoderlib_win32.pcf 
Log Message:
Change HELIX_FEATURE_ASF_xxxx to HELIX_FEATURE_WM_xxxx


Index: wma9decoderlib_win32.pcf
===================================================================
RCS file: /cvsroot/datatype/wm/audio/codec/wma9/wma9decoderlib_win32.pcf,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wma9decoderlib_win32.pcf	4 May 2006 20:45:12 -0000	1.1.1.1
+++ wma9decoderlib_win32.pcf	5 May 2006 13:22:43 -0000	1.2
@@ -37,7 +37,7 @@
 
 import os
 
-if project.IsDefined("HELIX_FEATURE_ASF_AUDIO_CODEC_WMA9_DMO"):
+if project.IsDefined("HELIX_FEATURE_WM_AUDIO_CODEC_WMA9_DMO"):
     project.AddSources("platform/win32/wma9_decoder_dmo.cpp")
     project.AddIncludes("platform/win32")
     wmfsdk = GetSDKPath("wmfsdk")

Index: wma9_decoder_entry.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/audio/codec/wma9/wma9_decoder_entry.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wma9_decoder_entry.cpp	4 May 2006 20:45:13 -0000	1.1.1.1
+++ wma9_decoder_entry.cpp	5 May 2006 13:22:43 -0000	1.2
@@ -37,21 +37,21 @@
 #include "hxcom.h"
 #include "hxresult.h"
 #include "hxacodec.h"
-#if defined(HELIX_FEATURE_ASF_AUDIO_CODEC_WMA9_DMO)
+#if defined(HELIX_FEATURE_WM_AUDIO_CODEC_WMA9_DMO)
 #include "wma9_decoder_dmo.h"
-#endif /* #if defined(HELIX_FEATURE_ASF_AUDIO_CODEC_WMA9_DMO) */
+#endif /* #if defined(HELIX_FEATURE_WM_AUDIO_CODEC_WMA9_DMO) */
 
 HX_RESULT HXEXPORT ENTRYPOINT(RACreateDecoderInstance)(const CLSID& clsid, IUnknown** ppUnk)
 {
     HX_RESULT retVal = HXR_NOTIMPL;
 
-#if defined(HELIX_FEATURE_ASF_AUDIO_CODEC_WMA9_DMO)
+#if defined(HELIX_FEATURE_WM_AUDIO_CODEC_WMA9_DMO)
     CWMA9DecoderDMO* pObj = new CWMA9DecoderDMO();
     if (pObj)
     {
         retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppUnk);
     }
-#endif /* #if defined(HELIX_FEATURE_ASF_AUDIO_WMFSDK) */
+#endif /* #if defined(HELIX_FEATURE_WM_AUDIO_WMFSDK) */
 
     return retVal;
 }

Index: wma9decoderdll_win32.pcf
===================================================================
RCS file: /cvsroot/datatype/wm/audio/codec/wma9/wma9decoderdll_win32.pcf,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wma9decoderdll_win32.pcf	4 May 2006 20:45:12 -0000	1.1.1.1
+++ wma9decoderdll_win32.pcf	5 May 2006 13:22:43 -0000	1.2
@@ -37,7 +37,7 @@
 
 import os
 
-if project.IsDefined("HELIX_FEATURE_ASF_AUDIO_CODEC_WMA9_DMO"):
+if project.IsDefined("HELIX_FEATURE_WM_AUDIO_CODEC_WMA9_DMO"):
     project.AddIncludes("platform/win32")
     wmfsdk = GetSDKPath("wmfsdk")
     wmfsdk_include = os.path.join(wmfsdk, "include")


From ehyche at helixcommunity.org  Fri May  5 06:22:47 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:15:28 2006
Subject: [Datatype-cvs] wm/common win32.pcf,1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/wm/common
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv7789/common

Modified Files:
	win32.pcf 
Log Message:
Change HELIX_FEATURE_ASF_xxxx to HELIX_FEATURE_WM_xxxx


Index: win32.pcf
===================================================================
RCS file: /cvsroot/datatype/wm/common/win32.pcf,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- win32.pcf	4 May 2006 21:04:49 -0000	1.1
+++ win32.pcf	5 May 2006 13:22:45 -0000	1.2
@@ -49,8 +49,8 @@
 
 import os
 
-if project.IsDefined("HELIX_FEATURE_ASF_AUDIO_CODEC_WMA9_DMO") or \
-   project.IsDefined("HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO") or \
+if project.IsDefined("HELIX_FEATURE_WM_AUDIO_CODEC_WMA9_DMO") or \
+   project.IsDefined("HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO") or \
    project.IsDefined("HELIX_FEATURE_ASF_FILEFORMAT_WMFSDK"):
     project.AddSources("platform/win32/mediabuffer.cpp",
                        "platform/win32/allocmediabuffer.cpp",


From ehyche at helixcommunity.org  Fri May  5 06:22:47 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:15:30 2006
Subject: [Datatype-cvs] wm/video/codec/wmv9 wmv9_decoder_entry.cpp, 1.1.1.1,
	1.2 wmv9decoderdll_win32.pcf, 1.1.1.1,
	1.2 wmv9decoderlib_win32.pcf, 1.2, 1.3
Message-ID: 

Update of /cvsroot/datatype/wm/video/codec/wmv9
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv7789/video/codec/wmv9

Modified Files:
	wmv9_decoder_entry.cpp wmv9decoderdll_win32.pcf 
	wmv9decoderlib_win32.pcf 
Log Message:
Change HELIX_FEATURE_ASF_xxxx to HELIX_FEATURE_WM_xxxx


Index: wmv9_decoder_entry.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/video/codec/wmv9/wmv9_decoder_entry.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmv9_decoder_entry.cpp	4 May 2006 20:45:35 -0000	1.1.1.1
+++ wmv9_decoder_entry.cpp	5 May 2006 13:22:45 -0000	1.2
@@ -37,9 +37,9 @@
 #include "hxcom.h"
 #include "hxresult.h"
 #include "hxcodec.h"
-#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
+#if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO)
 #include "wmv9_decoder_dmo.h"
-#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
+#endif /* #if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO) */
 
 
 HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_Open)(HX_MOFTAG moftFormatTag, HXCODEC* pCodecRef)
@@ -108,7 +108,7 @@
 
     if (codecRef)
     {
-#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
+#if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO)
         CWMV9DecoderDMO* pObj = new CWMV9DecoderDMO();
         if (pObj)
         {
@@ -120,7 +120,7 @@
                 *pStreamRef = (HXSTREAM) pObj;
             }
         }
-#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
+#endif /* #if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO) */
     }
 
     return retVal;
@@ -138,7 +138,7 @@
 
     if (streamRef)
     {
-#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
+#if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO)
         CWMV9DecoderDMO* pObj = (CWMV9DecoderDMO*) streamRef;
         // Close the object
         pObj->Close();
@@ -146,7 +146,7 @@
         HX_DELETE(pObj);
         // Clear the return value
         retVal = HXR_OK;
-#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
+#endif /* #if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO) */
     }
 
     return retVal;
@@ -159,11 +159,11 @@
 
     if (streamRef)
     {
-#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
+#if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO)
         CWMV9DecoderDMO* pObj = (CWMV9DecoderDMO*) streamRef;
         // Call the equivalent method in the object
         retVal = pObj->SetDataCallback(callbackRef, memoryRef, fpDataCallback);
-#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
+#endif /* #if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO) */
     }
 
     return retVal;
@@ -175,11 +175,11 @@
 
     if (streamRef)
     {
-#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
+#if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO)
         CWMV9DecoderDMO* pObj = (CWMV9DecoderDMO*) streamRef;
         // Call the equivalent method in the object
         retVal = pObj->GetStreamHeaderSize(pulSize);
-#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
+#endif /* #if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO) */
     }
 
     return retVal;
@@ -191,11 +191,11 @@
 
     if (streamRef)
     {
-#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
+#if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO)
         CWMV9DecoderDMO* pObj = (CWMV9DecoderDMO*) streamRef;
         // Call the equivalent method in the object
         retVal = pObj->GetStreamHeader(pHeader);
-#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
+#endif /* #if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO) */
     }
 
     return retVal;
@@ -207,11 +207,11 @@
 
     if (streamRef)
     {
-#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
+#if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO)
         CWMV9DecoderDMO* pObj = (CWMV9DecoderDMO*) streamRef;
         // Call the equivalent method in the object
         retVal = pObj->Input(pData);
-#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
+#endif /* #if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO) */
     }
 
     return retVal;
@@ -236,11 +236,11 @@
 
     if (streamRef)
     {
-#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
+#if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO)
         CWMV9DecoderDMO* pObj = (CWMV9DecoderDMO*) streamRef;
         // Call the equivalent method in the object
         retVal = pObj->GetProperty(prop, pValue);
-#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
+#endif /* #if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO) */
     }
 
     return retVal;
@@ -252,11 +252,11 @@
 
     if (streamRef)
     {
-#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
+#if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO)
         CWMV9DecoderDMO* pObj = (CWMV9DecoderDMO*) streamRef;
         // Call the equivalent method in the object
         retVal = pObj->SetProperty(prop, pValue);
-#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
+#endif /* #if defined(HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO) */
     }
 
     return retVal;

Index: wmv9decoderdll_win32.pcf
===================================================================
RCS file: /cvsroot/datatype/wm/video/codec/wmv9/wmv9decoderdll_win32.pcf,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmv9decoderdll_win32.pcf	4 May 2006 20:45:34 -0000	1.1.1.1
+++ wmv9decoderdll_win32.pcf	5 May 2006 13:22:45 -0000	1.2
@@ -37,7 +37,7 @@
 
 import os
 
-if project.IsDefined("HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO"):
+if project.IsDefined("HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO"):
     project.AddIncludes("platform/win32")
     wmfsdk = GetSDKPath("wmfsdk")
     wmfsdk_include = os.path.join(wmfsdk, "include")

Index: wmv9decoderlib_win32.pcf
===================================================================
RCS file: /cvsroot/datatype/wm/video/codec/wmv9/wmv9decoderlib_win32.pcf,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- wmv9decoderlib_win32.pcf	5 May 2006 13:09:03 -0000	1.2
+++ wmv9decoderlib_win32.pcf	5 May 2006 13:22:45 -0000	1.3
@@ -37,7 +37,7 @@
 
 import os
 
-if project.IsDefined("HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO"):
+if project.IsDefined("HELIX_FEATURE_WM_VIDEO_CODEC_WMV9_DMO"):
     project.AddSources("platform/win32/wmv9_decoder_dmo.cpp")
     project.AddModuleIncludes("datatype/wm/common/pub/platform/win32")
     project.AddIncludes("platform/win32")


From ehyche at helixcommunity.org  Fri May  5 06:22:47 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:15:30 2006
Subject: [Datatype-cvs] wm/video/renderer wmvformat.cpp,1.1.1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/wm/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv7789/video/renderer

Modified Files:
	wmvformat.cpp 
Log Message:
Change HELIX_FEATURE_ASF_xxxx to HELIX_FEATURE_WM_xxxx


Index: wmvformat.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/video/renderer/wmvformat.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmvformat.cpp	4 May 2006 20:45:41 -0000	1.1.1.1
+++ wmvformat.cpp	5 May 2006 13:22:45 -0000	1.2
@@ -560,7 +560,7 @@
     {
         ulSubStreamIndex = (UINT32) m_pRuleToSubStreamMap->rule_to_flag_map[usASMRule];
     }
-#if defined(HELIX_FEATURE_ASF_VIDEO_DISCARD_LATE_ENCODED_FRAMES)
+#if defined(HELIX_FEATURE_WM_VIDEO_DISCARD_LATE_ENCODED_FRAMES)
     HXBOOL bDecodeThisOne = TRUE;
     // Are we currently playing?
     if (m_pWMVideoRenderer->IsActive())
@@ -629,7 +629,7 @@
         bInputFrameProcessed = TRUE;
         m_pWMVideoRenderer->ReportDroppedFrame();
     }
-#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_DISCARD_LATE_ENCODED_FRAMES) */
+#endif /* #if defined(HELIX_FEATURE_WM_VIDEO_DISCARD_LATE_ENCODED_FRAMES) */
 
     // Check for substream switch
     if (pFrameToDecode &&
@@ -732,7 +732,7 @@
             pDecodedPacket = (HXCODEC_DATA*) m_pDecodedRingBuffer->Get();
         }
 
-#if !defined(HELIX_FEATURE_ASF_VIDEO_DISCARD_LATE_ENCODED_FRAMES)
+#if !defined(HELIX_FEATURE_WM_VIDEO_DISCARD_LATE_ENCODED_FRAMES)
         // If we not checking to discard late encoded frames, then
         // will check to possibly discard late *decoded* frames
         if (pDecodedPacket)
@@ -748,7 +748,7 @@
                 }
             }
         }
-#endif /* #if !defined(HELIX_FEATURE_ASF_VIDEO_DISCARD_LATE_ENCODED_FRAMES) */
+#endif /* #if !defined(HELIX_FEATURE_WM_VIDEO_DISCARD_LATE_ENCODED_FRAMES) */
         // Package the decoded frame into a media packet
         if (pDecodedPacket)
         {


From ehyche at helixcommunity.org  Fri May  5 06:46:06 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:38:47 2006
Subject: [Datatype-cvs] common/basehost/pub base_hosted_fileformat.h, 1.1,
	1.2
Message-ID: 

Update of /cvsroot/datatype/common/basehost/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv15285/pub

Modified Files:
	base_hosted_fileformat.h 
Log Message:
Fix release build buster.


Index: base_hosted_fileformat.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/base_hosted_fileformat.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- base_hosted_fileformat.h	25 Apr 2006 16:56:40 -0000	1.1
+++ base_hosted_fileformat.h	5 May 2006 13:46:03 -0000	1.2
@@ -60,6 +60,7 @@
 #include "baseobj.h"
 
 // Forward declarations
+typedef _INTERFACE IHXErrorMessages;
 class CHXGenericCallback;
 
 


From ehyche at helixcommunity.org  Fri May  5 06:46:45 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 08:39:26 2006
Subject: [Datatype-cvs] wm/fileformat/platform/win32 asf_rule_state.cpp,
	1.1.1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/wm/fileformat/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv15835/platform/win32

Modified Files:
	asf_rule_state.cpp 
Log Message:
Fix release build buster.


Index: asf_rule_state.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/fileformat/platform/win32/asf_rule_state.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- asf_rule_state.cpp	4 May 2006 20:45:25 -0000	1.1.1.1
+++ asf_rule_state.cpp	5 May 2006 13:46:41 -0000	1.2
@@ -35,6 +35,7 @@
 
 #include "hxtypes.h"
 #include "hxresult.h"
+#include "hlxclib/memory.h"
 #include "asf_rule_state.h"
 
 CASFRuleState::CASFRuleState(UINT16 usStreamNum, UINT16 usNumRules)


From ehyche at helixcommunity.org  Fri May  5 11:19:46 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 13:12:24 2006
Subject: [Datatype-cvs] wm/audio/codec/wma9/pub - New directory
Message-ID: 

Update of /cvsroot/datatype/wm/audio/codec/wma9/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv27824/pub

Log Message:
Directory /cvsroot/datatype/wm/audio/codec/wma9/pub added to the repository



From ehyche at helixcommunity.org  Fri May  5 11:23:47 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 13:16:25 2006
Subject: [Datatype-cvs] wm/audio/codec/wma9/pub wma9_decoder_create.h, NONE,
	1.1
Message-ID: 

Update of /cvsroot/datatype/wm/audio/codec/wma9/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv29995/pub

Added Files:
	wma9_decoder_create.h 
Log Message:
Transfer datatype/asf to datatype/wm


--- NEW FILE: wma9_decoder_create.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef WMA9_DECODER_CREATE_H
#define WMA9_DECODER_CREATE_H

HX_RESULT CreateWMA9DecoderInstance(IUnknown** ppUnk);

#endif /* #ifndef WMA9_DECODER_CREATE_H */


From ehyche at helixcommunity.org  Fri May  5 11:23:44 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 13:16:53 2006
Subject: [Datatype-cvs] wm/audio/codec/wma9 Umakefil, 1.1.1.1,
	1.2 wma9_decoder_entry.cpp, 1.2, 1.3 wma9decoderdll, 1.2, 1.3
Message-ID: 

Update of /cvsroot/datatype/wm/audio/codec/wma9
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv29995

Modified Files:
	Umakefil wma9_decoder_entry.cpp wma9decoderdll 
Log Message:
Transfer datatype/asf to datatype/wm


Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/wm/audio/codec/wma9/Umakefil,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Umakefil	4 May 2006 20:45:12 -0000	1.1.1.1
+++ Umakefil	5 May 2006 18:23:36 -0000	1.2
@@ -37,4 +37,7 @@
 
 UmakefileVersion(2,2)
 
-MultiTargetMake("wma9decoderlib", "wma9decoderdll")
+if project.IsDefined("HELIX_FEATURE_WM_AUDIO_CODEC_WMA9_DMO"):
+    MultiTargetMake("wma9decoderlib", "wma9decoderdll")
+else:
+    MultiTargetMake("wma9decoderdll")

Index: wma9decoderdll
===================================================================
RCS file: /cvsroot/datatype/wm/audio/codec/wma9/wma9decoderdll,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- wma9decoderdll	5 May 2006 13:08:59 -0000	1.2
+++ wma9decoderdll	5 May 2006 18:23:36 -0000	1.3
@@ -47,12 +47,16 @@
                            "common/container[contlib]",
                            "common/system[syslib]",
                            "common/log/logutil[logutillib]",
-                           "datatype/wm/common[wmcomlib]",
-                           "datatype/wm/audio/codec/wma9[wma9decoderlib]")
+                           "datatype/wm/common[wmcomlib]")
 
 project.AddSources("wma9_decoder_entry.cpp",
                    "wma9_decoder_guids.cpp")
 
+if project.IsDefined("HELIX_FEATURE_WM_AUDIO_CODEC_WMA9_DMO"):
+    project.AddModuleLibraries("datatype/wm/audio/codec/wma9[wma9decoderlib]")
+else:
+    project.AddLibraries(GetSDKPath("wma9_decoderlib"))
+
 project.ExportFunction("RACreateDecoderInstance",
                        "const CLSID& clsid, IUnknown** ppUnk",
                        "common/include",

Index: wma9_decoder_entry.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/audio/codec/wma9/wma9_decoder_entry.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- wma9_decoder_entry.cpp	5 May 2006 13:22:43 -0000	1.2
+++ wma9_decoder_entry.cpp	5 May 2006 18:23:36 -0000	1.3
@@ -39,6 +39,8 @@
 #include "hxacodec.h"
 #if defined(HELIX_FEATURE_WM_AUDIO_CODEC_WMA9_DMO)
 #include "wma9_decoder_dmo.h"
+#else
+#include "wma9_decoder_create.h"
 #endif /* #if defined(HELIX_FEATURE_WM_AUDIO_CODEC_WMA9_DMO) */
 
 HX_RESULT HXEXPORT ENTRYPOINT(RACreateDecoderInstance)(const CLSID& clsid, IUnknown** ppUnk)
@@ -51,6 +53,8 @@
     {
         retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppUnk);
     }
+#else
+    retVal = CreateWMA9DecoderInstance(ppUnk);
 #endif /* #if defined(HELIX_FEATURE_WM_AUDIO_WMFSDK) */
 
     return retVal;


From ehyche at helixcommunity.org  Fri May  5 12:07:33 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri May  5 14:00:11 2006
Subject: [Datatype-cvs] wm/audio/codec/wma9 wma9_decoder_guids.cpp, 1.1.1.1,
	1.2
Message-ID: 

Update of /cvsroot/datatype/wm/audio/codec/wma9
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv5684

Modified Files:
	wma9_decoder_guids.cpp 
Log Message:
Fix build buster - add two missing GUIDs.


Index: wma9_decoder_guids.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/audio/codec/wma9/wma9_decoder_guids.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wma9_decoder_guids.cpp	4 May 2006 20:45:13 -0000	1.1.1.1
+++ wma9_decoder_guids.cpp	5 May 2006 19:07:29 -0000	1.2
@@ -42,7 +42,8 @@
 #include "ihxtlogsystemcontext.h"
 #include "ihxfgbuf.h"
 #include "hxdllaccess.h"
+#include "ihxpckts.h"
+#include "hxengin.h"
 #include "hxplgns.h"
 #include "hxplugn.h"
 #include "hxccf.h"
-// #include "dmo.h" // we include dmoguids.lib to get these GUIDs


From jagmeet at helixcommunity.org  Mon May  8 00:43:57 2006
From: jagmeet at helixcommunity.org (jagmeet@helixcommunity.org)
Date: Mon May  8 02:35:57 2006
Subject: [Datatype-cvs] null/renderer nullrend.cpp, 1.5.10.2,
	1.5.10.3 nullrend.h, 1.2.22.1, 1.2.22.2
Message-ID: 

Update of /cvsroot/datatype/null/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv12448

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	nullrend.cpp nullrend.h 
Log Message:
Jagmeet: Fix for PR# 163183 (Never logs rebuffer for 3gp), removed dependence on m_ulFinalPacketTime for rebuffering from Null Renderer.

Index: nullrend.cpp
===================================================================
RCS file: /cvsroot/datatype/null/renderer/nullrend.cpp,v
retrieving revision 1.5.10.2
retrieving revision 1.5.10.3
diff -u -d -r1.5.10.2 -r1.5.10.3
--- nullrend.cpp	20 May 2005 00:14:45 -0000	1.5.10.2
+++ nullrend.cpp	8 May 2006 07:43:54 -0000	1.5.10.3
@@ -467,6 +467,7 @@
     , m_ulPacketDuration(0)
     , m_ulLastPacketTime(0)
     , m_ulCurrentTime(0)
+    , m_bEndOfPackets(FALSE)
     , m_bRebuffering(FALSE)
     , m_bUseRebuffering(TRUE)
 { 
@@ -705,13 +706,15 @@
 	
 	/* see if we can stop rebuffering */
 	if (m_bRebuffering && !pPacket->IsLost() &&
-	    ulTime > m_ulCurrentTime + m_ulPreroll)
+	    ((LONG32)(ulTime - (m_ulCurrentTime + m_ulPreroll))) > 0)
 	{
 	    m_pStream->ReportRebufferStatus(0,0);
 	    m_bRebuffering = FALSE;
 	}
-	
+	if(!pPacket->IsLost())
+	{
 	m_ulLastPacketTime = ulTime;
+	}
     }
     
     return HXR_OK;
@@ -733,9 +736,8 @@
 //	printf("OnTimeSych(): time %d\n", ulTime);
 
 	/* determine whether we're out of packets */
-	if (ulTime > m_ulLastPacketTime &&
-	    (ulTime < m_ulFinalPacketTime ||
-	    m_ulLastPacketTime < m_ulFinalPacketTime) &&
+	if (((LONG32)(m_ulLastPacketTime - ulTime) < 0) &&
+	    !m_bEndOfPackets &&
 	    !m_bRebuffering)
 	{
 	    /* start rebuffering */
@@ -774,6 +776,8 @@
 //
 STDMETHODIMP NullRenderer::OnPostSeek(ULONG32 ulOldTime, ULONG32 ulNewTime)
 {
+    m_bEndOfPackets = FALSE;
+    m_ulLastPacketTime = ulNewTime;
     return HXR_OK;
 }
 
@@ -800,6 +804,7 @@
 //
 STDMETHODIMP NullRenderer::OnBegin(ULONG32 ulTime)
 {
+    m_ulLastPacketTime = ulTime;
     return HXR_OK;
 }
 
@@ -851,6 +856,7 @@
  */
 STDMETHODIMP NullRenderer::OnEndofPackets(void)
 {
+    m_bEndOfPackets = TRUE;
     return HXR_OK;
 }
 
@@ -963,27 +969,7 @@
 UINT32
 NullRenderer::AdjustTimestamp(UINT32 ulTimestamp, LONG32 lTimeOffset)
 {
-    UINT32 ulAdjustedTime = ulTimestamp;
-
-    // adjust the time based on the offset handling overflow
-    // correctly
-    if (lTimeOffset < 0)
-    {
-	ulAdjustedTime += (UINT32) (-lTimeOffset);
-    }
-    else
-    {
-	if (ulAdjustedTime < (UINT32)lTimeOffset)
-	{
-	    ulAdjustedTime = 0;
-	}
-	else
-	{
-	    ulAdjustedTime -= (UINT32)lTimeOffset;
-	}
-    }
-
-    return ulAdjustedTime;
+    return (ulTimestamp - lTimeOffset);
 }
 
 // *** IUnknown methods ***

Index: nullrend.h
===================================================================
RCS file: /cvsroot/datatype/null/renderer/nullrend.h,v
retrieving revision 1.2.22.1
retrieving revision 1.2.22.2
diff -u -d -r1.2.22.1 -r1.2.22.2
--- nullrend.h	29 Mar 2005 21:30:02 -0000	1.2.22.1
+++ nullrend.h	8 May 2006 07:43:54 -0000	1.2.22.2
@@ -50,6 +50,7 @@
     UINT32		m_ulLastPacketTime;
     UINT32		m_ulFinalPacketTime;
     UINT32		m_ulCurrentTime;
+    BOOL		m_bEndOfPackets;
     BOOL		m_bRebuffering;
     BOOL			m_bUseRebuffering;
     


From milko at helixcommunity.org  Mon May  8 18:09:49 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Mon May  8 20:01:39 2006
Subject: [Datatype-cvs] tools/dtdriver/engine cmultifwriter.cpp, NONE,
	1.1 cmultifwriter.h, NONE, 1.1 Umakefil, 1.12,
	1.13 ffdriver.cpp, 1.29, 1.30
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv10107

Modified Files:
	Umakefil ffdriver.cpp 
Added Files:
	cmultifwriter.cpp cmultifwriter.h 
Log Message:
Modified by: milko@real.com
Date: 5:08:06
Project: dtdriver

Synopsis: Enables multi-writer output in dtdriver 

Overview:
The changes enables dtdriver to output any number of files in various
formats cuncurrently as part of single "drive" operation.
This is useful to allow playback while recording of formats that cannot
be played until fully written.  In such case, it is possible to write
content into a linear container format (e.g. RealMedia container format)
concurrently with the target format and use the liner containe format
for playback while still writing the target format.

The mult-file output is simply specified by providing a ';' separated
output file name list in the Drive command.
e.g.:
"music.ra;C:\MusicFiles\music.m4a"

dtdriver forks the final output stream to the number of specified
output files and uses a separate file-writer of appropriate type to 
write each fork of the output.  The requirement is that all file-writers 
support the payload being sent to them.

The reports returned through a single IHXFIleWriterMonitor are 
consolidated as follow:
- OnPacketsReady is called only when all writers reported OnPacketsReady
- OnCompletion is called only when all writers reported OnCompletion
- OnStatus calls are associated with a specific file via "FileNumber" header
in the report containing a 0 based index into the file list given in the
Drive commnad.

The inclusion of this feature can be controlled via 
HELIX_FEATURE_DTDR_MULTIWRITER compile-time macro.
The macro is defined by default in helix-dtdr-local-audio-transcode.pfi
which is used by helix-client-all-defines profile.

New Files:
datatype/tools/dtdriver/engine/cmultifwriter.h
datatype/tools/dtdriver/engine/cmultifwriter.cpp

Files Modified:
/datatype/tools/dtdriver/engine/Umakefil,v
/datatype/tools/dtdriver/engine/ffdriver.cpp,v

/ribosome/build/umakepf/helix-dtdr-local-audio-transcode.pfi

Image Size and Heap Use impact (Client -Only):
Small increase on dtdriver engine size when feature is enabled
via HELIX_FEATURE_DTDR_MULTIWRITER.

Platforms and Profiles Affected:
all

Distribution Libraries Affected:
none

Distribution library impact and planned action:
n/a

Platforms and Profiles Build Verified:
win32-i386-vc7, helix-client-all-defines

Platforms and Profiles Functionality verified:
win32-i386-vc7, helix-client-all-defines

Branch:
HEAD, hxclient_1_5_0_cayenne


--- NEW FILE: cmultifwriter.cpp ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

/****************************************************************************
 *  Defines
 */
#define MULWRTR_FILE_NUMBER_OFFSET  65536


/****************************************************************************
 *  Includes
 */
#include "hlxclib/string.h"
#include "safestring.h"

#include "cmultifwriter.h"
#include "hxslist.h"

#include "reporterror.h"


/****************************************************************************
 *  CMultiFileWriter
 */
/****************************************************************************
 *  Constructor/Destructor
 */
CMultiFileWriter::CMultiFileWriter(void)
    : m_uNumAgents(0)
    , m_pAgentArray(NULL)
    , m_pMiniContext(NULL)
    , m_pReportArray(NULL)
    , m_lRefCount(0)
{
    ;
}

CMultiFileWriter::~CMultiFileWriter()
{
    Close();
}


/****************************************************************************
 *  Native methods
 */
/****************************************************************************
 *  CMultiFileWriter::Init
 */
HX_RESULT CMultiFileWriter::Init(const char* pFileNames,
				 IHXFileWriterMonitor* pFileWriterMonitor,
				 MiniContext* pMiniContext)
{
    CHXSimpleList fileNameList;
    HX_RESULT retVal = HXR_INVALID_PARAMETER;

    if (pFileNames && pMiniContext)
    {
	retVal = HXR_OK;
	Close();

	m_pMiniContext = pMiniContext;
	HX_ADDREF(m_pMiniContext);
    }

    if (SUCCEEDED(retVal))
    {
	m_pReportArray = new MultiWriterReport [MULWRTR_REPORT_TYPE_COUNT];
	retVal = HXR_OUTOFMEMORY;
	if (m_pReportArray)
	{
	    retVal = HXR_OK;
	}
    }

    // Determine start of file-names
    if (SUCCEEDED(retVal))
    {
	const char* pFileNameStart = pFileNames;
	const char* pFileNameEnd;
	char* pFileName;
	UINT32 ulFileNameLen;

	do
	{
	    pFileNameEnd = pFileNameStart;

	    // Find end of file name
	    while ((*pFileNameEnd) &&
		   ((*pFileNameEnd) != MULWRTR_FILE_NAME_DELIMINATOR))
	    {
		pFileNameEnd++;
	    }
	    
	    // If file-name is non-null, add it to the name list
	    ulFileNameLen = (pFileNameEnd - pFileNameStart);
	    if (ulFileNameLen)
	    {
		pFileName = new char[ulFileNameLen + 1];
		retVal = HXR_OUTOFMEMORY;
		if (pFileName)
		{
		    SafeStrCpy(pFileName, pFileNameStart, ulFileNameLen + 1);
		    if (fileNameList.AddTail(pFileName))
		    {
			retVal = HXR_OK;
		    }
		    else
		    {
			delete [] pFileName;
		    }
		}
	    }

	    // set the start of the next file name
	    pFileNameStart = pFileNameEnd + 1;

	} while ((*pFileNameEnd) && SUCCEEDED(retVal));
    }

    // Create file writer agent for each file name
    if (SUCCEEDED(retVal))
    {
	UINT16 uNumFiles = (UINT16) fileNameList.GetCount();

	retVal = HXR_INVALID_PARAMETER;
	if (uNumFiles)
	{
	    retVal = HXR_OUTOFMEMORY;
	    m_pAgentArray = new CMultiFileWriterAgent* [uNumFiles];
	    if (m_pAgentArray)
	    {
		memset(m_pAgentArray, 0, sizeof(CMultiFileWriterAgent*) * uNumFiles);
		retVal = HXR_OK;
	    }
	}
    }

    // Initialize each file writer agent
    {
	char* pFileName;
	
	while (!fileNameList.IsEmpty())
	{
	    pFileName = (char*) fileNameList.RemoveHead();

	    if (SUCCEEDED(retVal))
	    {
		m_pAgentArray[m_uNumAgents] = new CMultiFileWriterAgent;
		retVal = HXR_OUTOFMEMORY;
		if (m_pAgentArray[m_uNumAgents])
		{
		    m_pAgentArray[m_uNumAgents]->AddRef();
		    m_uNumAgents++;
		    retVal = HXR_OK;
		}
	    }

	    if (SUCCEEDED(retVal))
	    {
		retVal = m_pAgentArray[m_uNumAgents - 1]->Init(m_uNumAgents - 1,
							       pFileName,
							       pFileWriterMonitor,
							       this);

		if (FAILED(retVal))
		{
		    ::ReportError((IUnknown*)(IHXPlayer*) m_pMiniContext,
				  retVal, 
				  "Failed to find file writer for designated file: %s", 
				  pFileName);
		}
	    }
	    else
	    {
		HX_VECTOR_DELETE(pFileName);
	    }
	}
    }

    return retVal;
}

/****************************************************************************
 *  MakeReport
 */
HX_RESULT CMultiFileWriter::MakeReport(MultiWriterReportType eReportType,
				       HX_RESULT status)
{
    HX_RESULT retVal = HXR_UNEXPECTED;

    if (m_pReportArray &&
	(m_pReportArray[eReportType].m_uNumReports < m_uNumAgents))
    {
	retVal = HXR_OK;

	if (SUCCEEDED(m_pReportArray[eReportType].m_ReportsStatus))
	{
	    m_pReportArray[eReportType].m_ReportsStatus = status;
	}

	m_pReportArray[eReportType].m_uNumReports++;
    }

    return retVal;
}

/****************************************************************************
 *  IsReportComplete
 */
HXBOOL CMultiFileWriter::GetCompletedReport(MultiWriterReportType eReportType,
					    HX_RESULT &status)
{
    HXBOOL bRetVal = FALSE;

    if (m_pReportArray)
    {
	status = m_pReportArray[eReportType].m_ReportsStatus;
	bRetVal = (m_pReportArray[eReportType].m_uNumReports >= m_uNumAgents);
    }
    else
    {
	status = HXR_UNEXPECTED;
    }

    return bRetVal;
}


/****************************************************************************
 *  IHXPlugin methods
 */
/****************************************************************************
 *  GetPluginInfo
 */
STDMETHODIMP CMultiFileWriter::GetPluginInfo(REF(HXBOOL)      /*OUT*/ bMultipleLoad,
					     REF(const char*) /*OUT*/ pDescription,
					     REF(const char*) /*OUT*/ pCopyright,
					     REF(const char*) /*OUT*/ pMoreInfoURL,
					     REF(ULONG32)     /*OUT*/ ulVersionNumber)
{
    return HXR_UNEXPECTED;
}

/****************************************************************************
 *  InitPlugin
 */
STDMETHODIMP CMultiFileWriter::InitPlugin(IUnknown*   /*IN*/  pContext)
{
    UINT16 uIdx;
    HX_RESULT retVal = HXR_OK;
    HX_RESULT status;

    for (uIdx = 0; uIdx < m_uNumAgents; uIdx++)
    {
	if (m_pAgentArray[uIdx]->m_pFileWriter)
	{
	    IHXPlugin* pPlugin = NULL;

	    status = m_pAgentArray[uIdx]->m_pFileWriter->QueryInterface(IID_IHXPlugin,
									(void**) &pPlugin);
	    if (SUCCEEDED(status))
	    {
		status = pPlugin->InitPlugin(pContext);
	    }

	    HX_RELEASE(pPlugin);
	}
	else
	{
	    status = HXR_FAIL;
	}
	
	if (SUCCEEDED(retVal))
	{
	    status = retVal;
	}
    }

    return retVal;
}


/****************************************************************************
 *  IHXFileWriter methods
 */
HX_RESULT CMultiFileWriter::GetFileFormatInfo (REF(const char**) /*OUT*/ pFileMimeTypes,
					       REF(const char**) /*OUT*/ pFileExtensions,
					       REF(const char**) /*OUT*/ pFileOpenNames)
{
    return HXR_UNEXPECTED;
}

HX_RESULT CMultiFileWriter::InitFileWriter (IHXRequest* pRequest,
					    IHXFileWriterMonitor* pMonitor,
					    IHXPropertyAdviser* pAdviser)
{
    UINT16 uIdx;
    HX_RESULT retVal = HXR_OK;
    HX_RESULT status;

    for (uIdx = 0; uIdx < m_uNumAgents; uIdx++)
    {
	status = m_pAgentArray[uIdx]->InitFileWriter(pRequest,
						     pMonitor,
						     pAdviser);
	
	if (SUCCEEDED(retVal))
	{
	    status = retVal;
	}
    }

    return retVal;
}

HX_RESULT CMultiFileWriter::Close(void)
{
    HX_RESULT retVal = HXR_OK;
    HX_RESULT status = HXR_OK;

    if (m_pAgentArray)
    {
	while (m_uNumAgents)
	{
	    m_uNumAgents--;
	    status = m_pAgentArray[m_uNumAgents]->Close();
	    if (SUCCEEDED(retVal))
	    {
		retVal = status;
	    }
	    m_pAgentArray[m_uNumAgents]->Release();
	    m_pAgentArray[m_uNumAgents] = NULL;
	}
    }
    m_uNumAgents = 0;
    HX_RELEASE(m_pMiniContext);
    HX_VECTOR_DELETE(m_pAgentArray);
    HX_VECTOR_DELETE(m_pReportArray);

    return retVal;
}

HX_RESULT CMultiFileWriter::Abort(void)
{
    UINT16 uIdx;
    HX_RESULT retVal = HXR_OK;
    HX_RESULT status;

    for (uIdx = 0; uIdx < m_uNumAgents; uIdx++)
    {
	if (m_pAgentArray[uIdx]->m_pFileWriter)
	{
	    status = m_pAgentArray[uIdx]->m_pFileWriter->Abort();
	}
	else
	{
	    status = HXR_FAIL;
	}
	
	if (SUCCEEDED(retVal))
	{
	    status = retVal;
	}
    }

    return retVal;
}

HX_RESULT CMultiFileWriter::SetFileHeader(IHXValues* pHeader)
{
    UINT16 uIdx;
    HX_RESULT retVal = HXR_OK;
    HX_RESULT status;

    for (uIdx = 0; uIdx < m_uNumAgents; uIdx++)
    {
	if (m_pAgentArray[uIdx]->m_pFileWriter)
	{
	    status = m_pAgentArray[uIdx]->m_pFileWriter->SetFileHeader(pHeader);
	}
	else
	{
	    status = HXR_FAIL;
	}
	
	if (SUCCEEDED(retVal))
	{
	    status = retVal;
	}
    }

    return retVal;
}


HX_RESULT CMultiFileWriter::SetStreamHeader(IHXValues* pHeader)
{
    UINT16 uIdx;
    HX_RESULT retVal = HXR_OK;
    HX_RESULT status;

    for (uIdx = 0; uIdx < m_uNumAgents; uIdx++)
    {
	if (m_pAgentArray[uIdx]->m_pFileWriter)
	{
	    status = m_pAgentArray[uIdx]->m_pFileWriter->SetStreamHeader(pHeader);
	}
	else
	{
	    status = HXR_FAIL;
	}
	
	if (SUCCEEDED(retVal))
	{
	    status = retVal;
	}
    }

    return retVal;
}

HX_RESULT CMultiFileWriter::SetProperties(IHXValues* pProperties)
{
    UINT16 uIdx;
    HX_RESULT retVal = HXR_OK;
    HX_RESULT status;

    for (uIdx = 0; uIdx < m_uNumAgents; uIdx++)
    {
	if (m_pAgentArray[uIdx]->m_pFileWriter)
	{
	    status = m_pAgentArray[uIdx]->m_pFileWriter->SetProperties(pProperties);
	}
	else
	{
	    status = HXR_FAIL;
	}

	if (SUCCEEDED(retVal))
	{
	    status = retVal;
	}
    }

    return retVal;
}

HX_RESULT CMultiFileWriter::SetPacket(IHXPacket* pPacket)
{
    UINT16 uIdx;
    HX_RESULT retVal = HXR_OK;
    HX_RESULT status;

    for (uIdx = 0; uIdx < m_uNumAgents; uIdx++)
    {
	if (m_pAgentArray[uIdx]->m_pFileWriter)
	{
	    status = m_pAgentArray[uIdx]->m_pFileWriter->SetPacket(pPacket);
	}
	else
	{
	    status = HXR_FAIL;
	}
	
	if (SUCCEEDED(retVal))
	{
	    status = retVal;
	}
    }

    return retVal;
}

HX_RESULT CMultiFileWriter::StreamDone(UINT16 unStreamNumber)
{
    UINT16 uIdx;
    HX_RESULT retVal = HXR_OK;
    HX_RESULT status;

    for (uIdx = 0; uIdx < m_uNumAgents; uIdx++)
    {
	if (m_pAgentArray[uIdx]->m_pFileWriter)
	{
	    status = m_pAgentArray[uIdx]->m_pFileWriter->StreamDone(unStreamNumber);
	}
	else
	{
	    status = HXR_FAIL;
	}

	if (SUCCEEDED(retVal))
	{
	    status = retVal;
	}
    }

    return retVal;
}
    

/****************************************************************************
 *  IUnknown methods
 */
STDMETHODIMP CMultiFileWriter::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown))
    {
        AddRef();
        *ppvObj = this;
        return HXR_OK;
    }
    else if (IsEqualIID(riid, IID_IHXPlugin))
    {
        AddRef();
        *ppvObj = (IHXPlugin*)this;
        return HXR_OK;
    }
    else if (IsEqualIID(riid, IID_IHXFileWriter))
    {
        AddRef();
        *ppvObj = (IHXFileWriter*)this;
        return HXR_OK;
    }

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}


STDMETHODIMP_(ULONG32) CMultiFileWriter::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}


STDMETHODIMP_(ULONG32) CMultiFileWriter::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}


/****************************************************************************
 *  CMultiFileWriterAgent
 */
/****************************************************************************
 *  Constructor/Destructor
 */
CMultiFileWriterAgent::CMultiFileWriterAgent(void)
    : m_uFileNumber(0)
    , m_pFileName(NULL)
    , m_pFileWriter(NULL)
    , m_pFileWriterMonitor(NULL)
    , m_pMultiFileWriter(NULL)
    , m_lRefCount(0)
{
    ;
}

CMultiFileWriterAgent::~CMultiFileWriterAgent()
{
    Close();
}


/****************************************************************************
 *  Native Methods
 */
/****************************************************************************
 *  CMultiFileWriterAgent::Init
 */
HX_RESULT CMultiFileWriterAgent::Init(UINT16 uFileNumber,
				      char* pFileName,
				      IHXFileWriterMonitor* pFileWriterMonitor,
				      CMultiFileWriter* pMultiFileWriter)
{
    HX_RESULT retVal = HXR_UNEXPECTED;

    if (pFileName && pMultiFileWriter)
    {
	retVal = HXR_OK;
	Close();
    }

    if (SUCCEEDED(retVal))
    {
	m_uFileNumber = uFileNumber;
	m_pFileName = pFileName;
	m_pFileWriterMonitor = pFileWriterMonitor;
	HX_ADDREF(m_pFileWriterMonitor);
	m_pMultiFileWriter = pMultiFileWriter;
	HX_ADDREF(m_pMultiFileWriter);

	retVal = HXR_FAIL;
	if (m_pMultiFileWriter->m_pMiniContext)
	{
	    retVal = m_pMultiFileWriter->m_pMiniContext->FindFileWriter(
			    m_pFileWriter,
			    m_pFileName);
	}
    }

    return retVal;
}

/****************************************************************************
 *  CMultiFileWriterAgent::Close
 */
HX_RESULT CMultiFileWriterAgent::Close(void)
{
    HX_RESULT retVal = HXR_OK;

    if (m_pFileWriter)
    {
	retVal = m_pFileWriter->Close();
	m_pFileWriter->Release();
	m_pFileWriter = NULL;
    }
    HX_RELEASE(m_pFileWriterMonitor);
    HX_RELEASE(m_pMultiFileWriter);

    HX_VECTOR_DELETE(m_pFileName);
    m_uFileNumber = 0;

    return retVal;
}

/****************************************************************************
 *  CMultiFileWriterAgent::InitFileWriter
 */
HX_RESULT CMultiFileWriterAgent::InitFileWriter(IHXRequest* pRequest,
						IHXFileWriterMonitor* pMonitor,
						IHXPropertyAdviser* pAdviser)
{
    HX_RESULT retVal = HXR_UNEXPECTED;
    IHXValues* pRequestHeaders = NULL;
    IHXRequest* pNewRequest = NULL;

    if (pRequest)
    {
	pRequest->GetRequestHeaders(pRequestHeaders);
    }

    if (m_pMultiFileWriter && m_pMultiFileWriter->m_pMiniContext)
    {
	retVal = m_pMultiFileWriter->m_pMiniContext->InitFileRequest(
			pNewRequest, 
			m_pFileName,
			pRequestHeaders);
    }

    if (SUCCEEDED(retVal))
    {
	retVal = HXR_UNEXPECTED;

	if (m_pFileWriter)
	{
	    retVal = m_pFileWriter->InitFileWriter(pNewRequest,
						   this,    // IHXFileWriterMonitor
						   pAdviser);
	}
    }

    HX_RELEASE(pRequestHeaders);
    HX_RELEASE(pNewRequest);

    return retVal;
}


/****************************************************************************
 *  IHXFileWriterMonitor
 */
/****************************************************************************
 *  CMultiFileWriterAgent::OnStatus
 */
STDMETHODIMP CMultiFileWriterAgent::OnStatus(HX_RESULT status, 
					     IHXValues* pInfoList)
{
    HX_RESULT retVal = HXR_OK;

    if (m_pFileWriterMonitor)
    {
	pInfoList->SetPropertyULONG32("FileNumber", m_uFileNumber);

	retVal = m_pFileWriterMonitor->OnStatus(status, pInfoList);
    }

    return retVal;
}

/****************************************************************************
 *  CMultiFileWriterAgent::OnVolumeInitiation
 */
STDMETHODIMP CMultiFileWriterAgent::OnVolumeInitiation(HX_RESULT status,
					  const char* pName,
					  REF(ULONG32) ulTag)
{
    HX_RESULT retVal = HXR_OK;

    if (m_pFileWriterMonitor)
    {
	ulTag += (m_uFileNumber * MULWRTR_FILE_NUMBER_OFFSET);
	retVal = m_pFileWriterMonitor->OnVolumeInitiation(status, 
							  pName, 
							  ulTag);
    }

    return retVal;
}

/****************************************************************************
 *  CMultiFileWriterAgent::OnPacketsReady
 */
STDMETHODIMP CMultiFileWriterAgent::OnPacketsReady(HX_RESULT status)
{
    HX_RESULT retVal = HXR_UNEXPECTED;

    if (m_pMultiFileWriter)
    {
	retVal = m_pMultiFileWriter->MakeReport(MULWRTR_PACKETS_READY_REPORT,
						status);

	if (m_pMultiFileWriter->GetCompletedReport(MULWRTR_PACKETS_READY_REPORT,
						   status) &&
	    m_pFileWriterMonitor)
	{
	    retVal = m_pFileWriterMonitor->OnPacketsReady(status);
	}
    }

    return retVal;
}

/****************************************************************************
 *  CMultiFileWriterAgent::OnVolumeCompletion
 */
STDMETHODIMP CMultiFileWriterAgent::OnVolumeCompletion(HX_RESULT status,
						       ULONG32 ulTag)
{
    HX_RESULT retVal = HXR_OK;

    if (m_pFileWriterMonitor)
    {
	retVal = m_pFileWriterMonitor->OnVolumeCompletion(status, 
							  ulTag);
    }

    return retVal;
}

/****************************************************************************
 *  CMultiFileWriterAgent::OnCompletion
 */
STDMETHODIMP CMultiFileWriterAgent::OnCompletion(HX_RESULT status)
{
    HX_RESULT retVal = HXR_OK;

    if (m_pMultiFileWriter)
    {
	retVal = m_pMultiFileWriter->MakeReport(MULWRTR_COMPLETION_REPORT,
						status);

	if (m_pMultiFileWriter->GetCompletedReport(MULWRTR_COMPLETION_REPORT,
						   status) &&
	    m_pFileWriterMonitor)
	{
	    retVal = m_pFileWriterMonitor->OnCompletion(status);
	}
    }

    return retVal;
}


/****************************************************************************
 *  IUnknown methods
 */
STDMETHODIMP CMultiFileWriterAgent::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown))
    {
        AddRef();
        *ppvObj = this;
        return HXR_OK;
    }
    else if (IsEqualIID(riid, IID_IHXFileWriterMonitor))
    {
        AddRef();
        *ppvObj = (IHXFileWriterMonitor*)this;
        return HXR_OK;
    }

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}


STDMETHODIMP_(ULONG32) CMultiFileWriterAgent::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}


STDMETHODIMP_(ULONG32) CMultiFileWriterAgent::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}
Index: ffdriver.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/ffdriver.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- ffdriver.cpp	4 May 2006 00:28:48 -0000	1.29
+++ ffdriver.cpp	9 May 2006 01:09:46 -0000	1.30
@@ -150,6 +150,7 @@
 #include "csrchdlrstackfact.h"
 #include "stream_desc_hlpr.h"
 
+#include "cmultifwriter.h"
 
 
 /****************************************************************************
@@ -919,6 +920,38 @@
 
                         HX_RELEASE(pPlugin);
                     }
+#if defined(HELIX_FEATURE_DTDR_MULTIWRITER)
+		    else if (strchr(m_pWriteFileName, MULWRTR_FILE_NAME_DELIMINATOR))
+		    {
+			// File name contains at least one file name delimiter.
+			// Create multi-filewriter to handle this file-writing request.
+			CMultiFileWriter* pMultiFileWriter = new CMultiFileWriter;
+			status = HXR_OUTOFMEMORY;
+			if (pMultiFileWriter)
+			{
+			    pMultiFileWriter->AddRef();
+
+			    status = pMultiFileWriter->Init(m_pWriteFileName,
+							    (IHXFileWriterMonitor *) this,
+							    m_pContext);
+
+			    if (FAILED(status))
+			    {
+				ReportError(status, 
+					    "Failed to find all needed writers for designated multi-write output: %s", 
+					    m_pWriteFileName);
+			    }
+			}
+
+			if (SUCCEEDED(status))
+			{
+			    status = pMultiFileWriter->QueryInterface(IID_IHXFileWriter, 
+								      (void**) &m_pFileWriter);
+			}
+
+			HX_RELEASE(pMultiFileWriter);
+		    }
+#endif	// HELIX_FEATURE_DTDR_MULTIWRITER
                     else
                     {
                         status = m_pContext->FindFileWriter(m_pFileWriter,
@@ -1243,7 +1276,7 @@
 
                 HX_RELEASE(m_pSourceHandlerStack);
                 ReleaseSourceHandlerList(m_pUtilizedSourceHandlerList);
-                HX_RELEASE(m_pScheduler);
+                
                 if (MEMORY_TRACKING_NEEDED && !m_bPersistentContext)
                 {
 		    HX_RELEASE(m_pScheduler);
@@ -1842,18 +1875,20 @@
 					   m_pClientContext);
         }
 
+	// Get handle on the error message sink
         if (SUCCEEDED(RetVal))
         {
             HX_RELEASE(m_pErrorMessages);
             m_pContext->QueryInterface(IID_IHXErrorMessages,
                                        (void**) &m_pErrorMessages);
         }
-    }
 
-    /* Get Handle on the Scheduler */
-    if (SUCCEEDED(RetVal) && m_pScheduler == NULL)
-    {
-        RetVal = m_pContext->QueryInterface(IID_IHXScheduler, (void **) &m_pScheduler);
+	/* Get Handle on the Scheduler */
+	if (SUCCEEDED(RetVal))
+	{
+	    HX_RELEASE(m_pScheduler);
+	    RetVal = m_pContext->QueryInterface(IID_IHXScheduler, (void **) &m_pScheduler);
+	}
     }
 
     return RetVal;

--- NEW FILE: cmultifwriter.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef _MULTIFWRITER_H_
#define _MULTIFWRITER_H_

/****************************************************************************
 *  Defines
 */
#define MULWRTR_FILE_NAME_DELIMINATOR ';'


/****************************************************************************
 *  Includes
 */
#include "hxtypes.h"
#include "ihxpckts.h"
#include "hxplugn.h"
#include "hxfwrtr.h"
#include "minicntx.h"


class CMultiFileWriterAgent;


typedef enum
{
    MULWRTR_PACKETS_READY_REPORT = 0,
    MULWRTR_COMPLETION_REPORT,
    MULWRTR_REPORT_TYPE_COUNT
} MultiWriterReportType;

/****************************************************************************
 * 
 *  Class:
 *
 *	CMultiFileWriter
 *
 *  Purpose:
 *
 *	Provides Source Handler Stack construction methods.
 *
 */
class CMultiFileWriter : public IHXPlugin,
			 public IHXFileWriter
{
public:

    /*
     *  Constructor/Destructor
     */
    CMultiFileWriter(void);

    ~CMultiFileWriter();


    friend CMultiFileWriterAgent;


    /*
     *  Native Methods
     */
    HX_RESULT Init(const char* pFileNames,
		   IHXFileWriterMonitor* pFileWriterMonitor,
		   MiniContext* pMiniContext);

    HX_RESULT MakeReport(MultiWriterReportType eReportType,
			 HX_RESULT status);
    HXBOOL GetCompletedReport(MultiWriterReportType eReportType,
			      HX_RESULT &status);

    /*
     *	IUnknown methods
     */
    STDMETHOD(QueryInterface)	(THIS_
				REFIID riid,
				void** ppvObj);

    STDMETHOD_(ULONG32,AddRef)	(THIS);

    STDMETHOD_(ULONG32,Release)	(THIS);

    /*
     *	IHXPlugin methods
     */
    /************************************************************************
     *	Method:
     *	    IHXPlugin::GetPluginInfo
     *	Purpose:
     *	    Returns the basic information about this plugin. Including:
     *
     *	    bMultipleLoad	Whether or not this plugin can be instantiated
     *				multiple times. All File Formats must set
     *				this value to TRUE.  The only other type of
     *				plugin that can specify bMultipleLoad=TRUE is
     *				a filesystem plugin.  Any plugin that sets
     *				this flag to TRUE must not use global variables
     *				of any type.
     *
     *				Setting this flag to TRUE implies that you
     *				accept that your plugin may be instantiated
     *				multiple times (possibly in different
     *				address spaces).  Plugins are instantiated
     *				multiple times only in the server (for
     *				performance reasons).
     *
     *				An example of a plugin, that must set this
     *				flag to FALSE is a filesystem plugin that 
     *				uses a single TCP connection to communicate
     *				with a database.
     *				
     *	    pDescription	which is used in about UIs (can be NULL)
     *	    pCopyright		which is used in about UIs (can be NULL)
     *	    pMoreInfoURL	which is used in about UIs (can be NULL)
     *	    ulVersionNumber	The version of this plugin.
     */
    STDMETHOD(GetPluginInfo)	(THIS_
				REF(HXBOOL)	 /*OUT*/ bMultipleLoad,
				REF(const char*) /*OUT*/ pDescription,
				REF(const char*) /*OUT*/ pCopyright,
				REF(const char*) /*OUT*/ pMoreInfoURL,
				REF(ULONG32)	 /*OUT*/ ulVersionNumber);

    /************************************************************************
     *	Method:
     *	    IHXPlugin::InitPlugin
     *	Purpose:
     *	    Initializes the plugin for use. This interface must always be
     *	    called before any other method is called. This is primarily needed 
     *	    so that the plugin can have access to the context for creation of
     *	    IHXBuffers and IMalloc.
     */
    STDMETHOD(InitPlugin)   (THIS_
			    IUnknown*   /*IN*/  pContext);


    /*
     *	IHXFileWriter methods
     */
    /************************************************************************
     *	Method:
     *	    IHXFileFormatObject::GetFileFormatInfo
     *	Purpose:
     *	    Returns information vital to the instantiation of file format 
     *	    plugins.
     */
    STDMETHOD(GetFileFormatInfo)(THIS_
				REF(const char**) /*OUT*/ pFileMimeTypes,
				REF(const char**) /*OUT*/ pFileExtensions,
				REF(const char**) /*OUT*/ pFileOpenNames
				);

    STDMETHOD(InitFileWriter)	(THIS_
				IHXRequest* pRequest,
				IHXFileWriterMonitor* pMonitor,
				IHXPropertyAdviser* pAdviser
				);

    STDMETHOD(Close)		(THIS);

    STDMETHOD(Abort)		(THIS);

    STDMETHOD(SetFileHeader)	(THIS_
				IHXValues* pHeader
				);

    STDMETHOD(SetStreamHeader)	(THIS_
				IHXValues* pHeader
				);

    STDMETHOD(SetProperties)	(THIS_
				IHXValues* pProperties
				);
    
    STDMETHOD(SetPacket)	(THIS_
				IHXPacket* pPacket
				);

    STDMETHOD(StreamDone)	(THIS_
				UINT16 unStreamNumber
				);

protected:
    class MultiWriterReport
    {
    public:
	MultiWriterReport::MultiWriterReport()
	    : m_uNumReports(0)
	    , m_ReportsStatus(NULL)
	{
	    ;
	}
	UINT16 m_uNumReports;
	HX_RESULT m_ReportsStatus;
    };

    UINT16 m_uNumAgents;
    CMultiFileWriterAgent** m_pAgentArray;
    MiniContext* m_pMiniContext;
    MultiWriterReport* m_pReportArray;
    INT32 m_lRefCount;
};


/****************************************************************************
 * 
 *  Class:
 *
 *	CMultiFileWriterAgent
 *
 *  Purpose:
 *
 *	Receives messages from a specific file-writer on behalf of the 
 *  multi-filewriter.
 *
 */
class CMultiFileWriterAgent : public IHXFileWriterMonitor
{
public:

    /*
     *  Constructor/Destructor
     */
    CMultiFileWriterAgent(void);

    ~CMultiFileWriterAgent(void);


    friend CMultiFileWriter;

    /*
     *  Native Methods
     */
    HX_RESULT Init(UINT16 uFileNumber,
		   char* pFileName,
		   IHXFileWriterMonitor* pFileWriterMonitor,
		   CMultiFileWriter* pMultiFileWriter);

    HX_RESULT InitFileWriter(IHXRequest* pRequest,
			     IHXFileWriterMonitor* pMonitor,
			     IHXPropertyAdviser* pAdviser);

    HX_RESULT Close(void);

    /*
     *	IUnknown methods
     */
    STDMETHOD(QueryInterface)	(THIS_
				REFIID riid,
				void** ppvObj);

    STDMETHOD_(ULONG32,AddRef)	(THIS);

    STDMETHOD_(ULONG32,Release)	(THIS);


    /*
     *	IHXFileWriterMonitor methods
     */
    STDMETHOD(OnStatus)		(THIS_
				HX_RESULT status,
				IHXValues* pInfoList
				);

    STDMETHOD(OnVolumeInitiation)	(THIS_
				HX_RESULT status,
				const char* pFileName,
				REF(ULONG32) ulTag
				);

    STDMETHOD(OnPacketsReady)	(THIS_
				HX_RESULT status
				);

    STDMETHOD(OnVolumeCompletion)	(THIS_
				HX_RESULT status,
				ULONG32 ulTag
				);

    STDMETHOD(OnCompletion)	(THIS_
				HX_RESULT status
				);

protected:
    UINT16	    m_uFileNumber;
    char*	    m_pFileName;
    IHXFileWriter*  m_pFileWriter;
    IHXFileWriterMonitor* m_pFileWriterMonitor;
    CMultiFileWriter* m_pMultiFileWriter;
    INT32	    m_lRefCount;
};

#endif	// _MULTIFWRITER_H_


Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/Umakefil,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- Umakefil	6 Dec 2005 21:49:10 -0000	1.12
+++ Umakefil	9 May 2006 01:09:46 -0000	1.13
@@ -68,6 +68,9 @@
 if project.IsDefined("HELIX_FEATURE_DTDR_MUXER"):
     project.AddSources("cmuxsrchandler.cpp")
 
+if project.IsDefined("HELIX_FEATURE_DTDR_MULTIWRITER"):
+    project.AddSources("cmultifwriter.cpp")
+
 # the dtdriver engine relies on Producer headers that require
 # deprecated smartpointer implementation
 project.AddDefines( 'HELIX_FEATURE_ALLOW_DEPRECATED_SMARTPOINTERS' )


From milko at helixcommunity.org  Mon May  8 18:18:38 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Mon May  8 20:10:27 2006
Subject: [Datatype-cvs] tools/dtdriver/engine Umakefil, 1.11,
	1.11.6.1 ffdriver.cpp, 1.22.4.6, 1.22.4.7
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv14840

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	Umakefil ffdriver.cpp 
Log Message:
Modified by: milko@real.com
Date: 5:08:06
Project: dtdriver

Synopsis: Enables multi-writer output in dtdriver 

Overview:
The changes enables dtdriver to output any number of files in various
formats cuncurrently as part of single "drive" operation.
This is useful to allow playback while recording of formats that cannot
be played until fully written.  In such case, it is possible to write
content into a linear container format (e.g. RealMedia container format)
concurrently with the target format and use the liner containe format
for playback while still writing the target format.

The mult-file output is simply specified by providing a ';' separated
output file name list in the Drive command.
e.g.:
"music.ra;C:\MusicFiles\music.m4a"

dtdriver forks the final output stream to the number of specified
output files and uses a separate file-writer of appropriate type to 
write each fork of the output.  The requirement is that all file-writers 
support the payload being sent to them.

The reports returned through a single IHXFIleWriterMonitor are 
consolidated as follow:
- OnPacketsReady is called only when all writers reported OnPacketsReady
- OnCompletion is called only when all writers reported OnCompletion
- OnStatus calls are associated with a specific file via "FileNumber" header
in the report containing a 0 based index into the file list given in the
Drive commnad.

The inclusion of this feature can be controlled via 
HELIX_FEATURE_DTDR_MULTIWRITER compile-time macro.
The macro is defined by default in helix-dtdr-local-audio-transcode.pfi
which is used by helix-client-all-defines profile.

New Files:
datatype/tools/dtdriver/engine/cmultifwriter.h
datatype/tools/dtdriver/engine/cmultifwriter.cpp

Files Modified:
/datatype/tools/dtdriver/engine/Umakefil,v
/datatype/tools/dtdriver/engine/ffdriver.cpp,v

/ribosome/build/umakepf/helix-dtdr-local-audio-transcode.pfi

Image Size and Heap Use impact (Client -Only):
Small increase on dtdriver engine size when feature is enabled
via HELIX_FEATURE_DTDR_MULTIWRITER.

Platforms and Profiles Affected:
all

Distribution Libraries Affected:
none

Distribution library impact and planned action:
n/a

Platforms and Profiles Build Verified:
win32-i386-vc7, helix-client-all-defines

Platforms and Profiles Functionality verified:
win32-i386-vc7, helix-client-all-defines

Branch:
HEAD, hxclient_1_5_0_cayenne


Index: ffdriver.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/ffdriver.cpp,v
retrieving revision 1.22.4.6
retrieving revision 1.22.4.7
diff -u -d -r1.22.4.6 -r1.22.4.7
--- ffdriver.cpp	24 Apr 2006 19:09:02 -0000	1.22.4.6
+++ ffdriver.cpp	9 May 2006 01:18:35 -0000	1.22.4.7
@@ -150,6 +150,7 @@
 #include "csrchdlrstackfact.h"
 #include "stream_desc_hlpr.h"
 
+#include "cmultifwriter.h"
 
 
 /****************************************************************************
@@ -921,6 +922,38 @@
 
                         HX_RELEASE(pPlugin);
                     }
+#if defined(HELIX_FEATURE_DTDR_MULTIWRITER)
+		    else if (strchr(m_pWriteFileName, MULWRTR_FILE_NAME_DELIMINATOR))
+		    {
+			// File name contains at least one file name delimiter.
+			// Create multi-filewriter to handle this file-writing request.
+			CMultiFileWriter* pMultiFileWriter = new CMultiFileWriter;
+			status = HXR_OUTOFMEMORY;
+			if (pMultiFileWriter)
+			{
+			    pMultiFileWriter->AddRef();
+
+			    status = pMultiFileWriter->Init(m_pWriteFileName,
+							    (IHXFileWriterMonitor *) this,
+							    m_pContext);
+
+			    if (FAILED(status))
+			    {
+				ReportError(status, 
+					    "Failed to find all needed writers for designated multi-write output: %s", 
+					    m_pWriteFileName);
+			    }
+			}
+
+			if (SUCCEEDED(status))
+			{
+			    status = pMultiFileWriter->QueryInterface(IID_IHXFileWriter, 
+								      (void**) &m_pFileWriter);
+			}
+
+			HX_RELEASE(pMultiFileWriter);
+		    }
+#endif	// HELIX_FEATURE_DTDR_MULTIWRITER
                     else
                     {
                         status = m_pContext->FindFileWriter(m_pFileWriter,

Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/Umakefil,v
retrieving revision 1.11
retrieving revision 1.11.6.1
diff -u -d -r1.11 -r1.11.6.1
--- Umakefil	18 Nov 2004 21:44:43 -0000	1.11
+++ Umakefil	9 May 2006 01:18:35 -0000	1.11.6.1
@@ -68,6 +68,9 @@
 if project.IsDefined("HELIX_FEATURE_DTDR_MUXER"):
     project.AddSources("cmuxsrchandler.cpp")
 
+if project.IsDefined("HELIX_FEATURE_DTDR_MULTIWRITER"):
+    project.AddSources("cmultifwriter.cpp")
+
 LibraryTarget("dtdrengine")
 
 DependTarget()


From ehyche at helixcommunity.org  Tue May  9 13:11:49 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue May  9 15:03:28 2006
Subject: [Datatype-cvs] wm/audio/renderer wmadecoder.cpp, 1.1.1.1,
	1.2 wmadecoder.h, 1.1.1.1, 1.2 wmaformat.cpp, 1.1.1.1,
	1.2 wmaformat.h, 1.1.1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/wm/audio/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv13555/audio/renderer

Modified Files:
	wmadecoder.cpp wmadecoder.h wmaformat.cpp wmaformat.h 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Erik Hodge (ehodge@real.com)

Description
------------------------------------------
In testing WMA9 Lossless files, I discovered that
there are some properties that are stored in the
ASF header that are necessary for WMA9 Lossless and
WMA9 Pro decoding (as opposed to being stored in the
type-specific data, where most codec initialization
data is stored).

Therefore, these additional properties need to be parsed out
in the file format, sent through the stream header,
and passed into the codec.

While I was making this change, I also changed the
WMA9 codec to support IHXAudioDecoderRenderer, which
inherits from IHXAudioDecoder and provides two more
methods (SetStartTime() and SetNextFrameTime()). Having
these methods allows us to be able to provide the WMA9
codec with timestamps for the encoded input buffers we are
passing into it.

Files Modified
------------------------------------------
datatype/wm/audio/renderer/wmadecoder.cpp
datatype/wm/audio/renderer/wmadecoder.h
datatype/wm/audio/renderer/wmaformat.cpp
datatype/wm/audio/renderer/wmaformat.h
datatype/wm/fileformat/platform/win32/hxwmreader.cpp

Branches
------------------------------------------
HEAD only



Index: wmaformat.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/audio/renderer/wmaformat.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmaformat.cpp	4 May 2006 20:45:18 -0000	1.1.1.1
+++ wmaformat.cpp	9 May 2006 20:11:44 -0000	1.2
@@ -78,6 +78,7 @@
     , m_ulLastDecodedEndTimeInSamples(0)
     , m_ulLastFrameTimeInSamples(0)
     , m_ulLastDecodedEndTimeInMs(0)
+    , m_pStreamHdr(NULL)
 {
     HX_ASSERT(m_pCommonClassFactory);
 }
@@ -93,6 +94,8 @@
     // Delete the buffer that holds decoded data
     HX_VECTOR_DELETE(m_pDecoderBuffer);
     m_ulDecoderBufferSize = 0;
+    // Release the stream header
+    HX_RELEASE(m_pStreamHdr);
     // Delete the rule maps
     HX_DELETE(m_pRuleToSubStreamMap);
     HX_DELETE(m_pRuleToFlagMap);
@@ -107,6 +110,10 @@
     HX_RESULT retVal = CAudioFormat::Init(pHeader);
     if (SUCCEEDED(retVal))
     {
+        // Save the stream header
+        HX_RELEASE(m_pStreamHdr);
+        m_pStreamHdr = pHeader;
+        m_pStreamHdr->AddRef();
         // Get the opaque data
         IHXBuffer* pOpaqueData = NULL;
         retVal = pHeader->GetPropertyBuffer("OpaqueData", pOpaqueData);
@@ -457,6 +464,8 @@
                     ulSamplesProduced = m_ulMaxDecoderOutputSamples;
                     // Check the encoded audio frame
                     ProcessAssembledFrame(pAssembledFrame);
+                    // Set the next frame time
+                    pDecoder->SetNextFrameTime(pAssembledFrame->m_ulTime);
                     // Decode the encoded audio frame
                     retVal = pDecoder->Decode(pAssembledFrame->m_pData,
                                               pAssembledFrame->m_ulDataSize,
@@ -602,6 +611,9 @@
         m_ppWMAudioDecoder[m_ulActiveSubStreamIndex])
     {
         m_ppWMAudioDecoder[m_ulActiveSubStreamIndex]->Reset();
+        // Get the start time from the base audio format
+        // and set it into the decoder
+        m_ppWMAudioDecoder[m_ulActiveSubStreamIndex]->SetStartTime(GetStartTime());
     }
 
     m_ulLastDecodedEndTimeInSamples = 0;
@@ -708,9 +720,13 @@
                                             // Initialize the CWMAudioDecoder with the substream header.
                                             // This only parses the substream header. It does not
                                             // go ahead and load the IHXAudioDecoder
-                                            retVal = m_ppWMAudioDecoder[i]->Init(m_pContext, pBuf, ulSubStreamHdrLen);
+                                            retVal = m_ppWMAudioDecoder[i]->Init(m_pContext, pBuf, ulSubStreamHdrLen,
+                                                                                 m_pStreamHdr, i, m_ulNumSubStreams);
                                             if (SUCCEEDED(retVal))
                                             {
+                                                // Get the start time from the base audio format
+                                                // and set it into the decoder
+                                                m_ppWMAudioDecoder[i]->SetStartTime(GetStartTime());
                                                 // Go ahead and open the decoder. This will cause the
                                                 // codec to be loaded.
                                                 // XXXMEH - for performance reasons, we may want to 

Index: wmadecoder.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/audio/renderer/wmadecoder.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmadecoder.cpp	4 May 2006 20:45:17 -0000	1.1.1.1
+++ wmadecoder.cpp	9 May 2006 20:11:44 -0000	1.2
@@ -45,6 +45,7 @@
 #include "hxstrutl.h"
 #include "pckunpck.h"
 #include "hxplgns.h"
+#include "hxassert.h"
 #include "wmadecoder.h"
 
 #define CODEC_FOURCC_CONFIG_PROPERTY           "CodecFourCC"
@@ -52,8 +53,8 @@
 #define WMDECODER_CODEC_NAME_WMA9_PROFESSIONAL "Windows Media Audio 9 Professional"
 #define WMDECODER_CODEC_NAME_WMA9_LOSSLESS     "Windows Media Audio 9 Lossless"
 #define WMDECODER_CODEC_4CC_WMA9               "WMA9"
-#define WMDECODER_CODEC_4CC_WMA9_PROFESSIONAL  "WMAP"
-#define WMDECODER_CODEC_4CC_WMA9_LOSSLESS      "WMAL"
+#define WMDECODER_CODEC_4CC_WMA9_PROFESSIONAL  "WMA9"
+#define WMDECODER_CODEC_4CC_WMA9_LOSSLESS      "WMA9"
 
 #if defined(WIN32) || defined(_WIN32) || defined(_SYMBIAN)
 const char* const CWMAudioDecoder::m_pszDLLSuffix = ".DLL";
@@ -86,6 +87,9 @@
     , m_ulAvgBytesPerSec(0)
     , m_usBlockAlign(0)
     , m_usBitsPerSample(0)
+    , m_ulNumSubStreams(0)
+    , m_ulSubStreamIndex(0)
+    , m_pStreamHdr(NULL)
     , m_pDecoderInitBuffer(NULL)
     , m_pDLLAccess(NULL)
     , m_pAudioDecoder(NULL)
@@ -102,7 +106,8 @@
     Close();
 }
 
-HX_RESULT CWMAudioDecoder::Init(IUnknown* pContext, BYTE* pInitBuf, UINT32 ulInitBufLen)
+HX_RESULT CWMAudioDecoder::Init(IUnknown* pContext, BYTE* pInitBuf, UINT32 ulInitBufLen,
+                                IHXValues* pStreamHdr, UINT32 ulSubStreamIndex, UINT32 ulNumSubStreams)
 {
     HX_RESULT retVal = HXR_FAIL;
 
@@ -114,6 +119,13 @@
         HX_RELEASE(m_pContext);
         m_pContext = pContext;
         m_pContext->AddRef();
+        // Save the number of substreams and the substream index of this decoder
+        m_ulSubStreamIndex = ulSubStreamIndex;
+        m_ulNumSubStreams  = ulNumSubStreams;
+        // Save the stream header
+        HX_RELEASE(m_pStreamHdr);
+        m_pStreamHdr = pStreamHdr;
+        HX_ADDREF(m_pStreamHdr);
         // Parse the init buffer
         retVal = ParseInitBuffer(pInitBuf, ulInitBufLen);
         if (SUCCEEDED(retVal))
@@ -290,8 +302,33 @@
     return retVal;
 }
 
+HX_RESULT CWMAudioDecoder::SetStartTime(UINT32 ulTime)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (m_pAudioDecoderRenderer)
+    {
+        retVal = m_pAudioDecoderRenderer->SetStartTime(ulTime);
+    }
+
+    return retVal;
+}
+
+HX_RESULT CWMAudioDecoder::SetNextFrameTime(UINT32 ulTime)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (m_pAudioDecoderRenderer)
+    {
+        retVal = m_pAudioDecoderRenderer->SetNextFrameTime(ulTime);
+    }
+
+    return retVal;
+}
+
 HX_RESULT CWMAudioDecoder::Close(void)
 {
+    HX_RELEASE(m_pStreamHdr);
     HX_RELEASE(m_pAudioDecoder);
     HX_RELEASE(m_pAudioDecoderRenderer);
     HX_DELETE(m_pDLLAccess);
@@ -306,6 +343,8 @@
     m_ulAvgBytesPerSec = 0;
     m_usBlockAlign     = 0;
     m_usBitsPerSample  = 0;
+    m_ulNumSubStreams  = 0;
+    m_ulSubStreamIndex = 0;
 
     return HXR_OK;
 }
@@ -516,6 +555,37 @@
                                                pszCodec4cc, pContext, FALSE);
                 if (SUCCEEDED(retVal))
                 {
+                    // Set WMA Pro and Lossless-related properties.
+                    // XXXMEH - we could have put these in the opaque data,
+                    // and if we think there will potentially be multi-rate
+                    // files that contain lossless streams, then we probably
+                    // should. But since lossless files almost always stand
+                    // on their own (NOT inside a multi-rate file), then
+                    // we will put these in the stream header.
+                    HX_ASSERT(m_ulNumSubStreams == 1);
+                    if (m_pStreamHdr)
+                    {
+                        UINT32 ulTmp = 0;
+                        if (SUCCEEDED(m_pStreamHdr->GetPropertyULONG32("DRCPeakReference", ulTmp)))
+                        {
+                            pConfig->SetPropertyULONG32("DRCPeakReference", ulTmp);
+                        }
+                        ulTmp = 0;
+                        if (SUCCEEDED(m_pStreamHdr->GetPropertyULONG32("DRCPeakTarget", ulTmp)))
+                        {
+                            pConfig->SetPropertyULONG32("DRCPeakTarget", ulTmp);
+                        }
+                        ulTmp = 0;
+                        if (SUCCEEDED(m_pStreamHdr->GetPropertyULONG32("DRCAverageReference", ulTmp)))
+                        {
+                            pConfig->SetPropertyULONG32("DRCAverageReference", ulTmp);
+                        }
+                        ulTmp = 0;
+                        if (SUCCEEDED(m_pStreamHdr->GetPropertyULONG32("DRCAverageTarget", ulTmp)))
+                        {
+                            pConfig->SetPropertyULONG32("DRCAverageTarget", ulTmp);
+                        }
+                    }
                     // Set the context
                     retVal = pObjConfig->SetContext(pContext);
                     if (SUCCEEDED(retVal))

Index: wmaformat.h
===================================================================
RCS file: /cvsroot/datatype/wm/audio/renderer/wmaformat.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmaformat.h	4 May 2006 20:45:19 -0000	1.1.1.1
+++ wmaformat.h	9 May 2006 20:11:44 -0000	1.2
@@ -86,6 +86,7 @@
     UINT32            m_ulLastDecodedEndTimeInSamples;
     UINT32            m_ulLastFrameTimeInSamples;
     UINT32            m_ulLastDecodedEndTimeInMs;
+    IHXValues*        m_pStreamHdr;
 
     // Protected methods overridden from base audio format
     virtual CMediaPacket* CreateAssembledPacket(IHXPacket* pCodecData);

Index: wmadecoder.h
===================================================================
RCS file: /cvsroot/datatype/wm/audio/renderer/wmadecoder.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wmadecoder.h	4 May 2006 20:45:17 -0000	1.1.1.1
+++ wmadecoder.h	9 May 2006 20:11:44 -0000	1.2
@@ -65,7 +65,8 @@
     CWMAudioDecoder();
     ~CWMAudioDecoder();
 
-    HX_RESULT   Init(IUnknown* pContext, BYTE* pInitBuf, UINT32 ulInitBufLen);
+    HX_RESULT   Init(IUnknown* pContext, BYTE* pInitBuf, UINT32 ulInitBufLen,
+                     IHXValues* pStreamHdr, UINT32 ulSubStreamIndex, UINT32 ulNumSubStreams);
     HX_RESULT   Open();
     HXBOOL      CanChangeAudioStream();
     HX_RESULT   GetNumChannels(UINT16* pusNumChannels);
@@ -77,6 +78,8 @@
                        INT16* samplesOut, UINT32& rulNumSamplesOut, HXBOOL bEOF);
     HX_RESULT   Reset();
     HX_RESULT   Close(void);
+    HX_RESULT   SetStartTime(UINT32 ulTime);
+    HX_RESULT   SetNextFrameTime(UINT32 ulTime);
     const char* GetAutoUpgradeString() { return (const char*) m_pszAutoUpgrade; }
     const char* GetCodecName()         { return (const char*) m_pszCodecName;   }
     const char* GetCodecFourCC()       { return (const char*) m_pszCodec4cc;    } 
@@ -88,6 +91,9 @@
     UINT32                   m_ulAvgBytesPerSec;
     UINT16                   m_usBlockAlign;
     UINT16                   m_usBitsPerSample;
+    UINT32                   m_ulNumSubStreams;
+    UINT32                   m_ulSubStreamIndex;
+    IHXValues*               m_pStreamHdr;
     IHXBuffer*               m_pDecoderInitBuffer;
     HXWM_MEDIA_TYPE          m_MediaType;
     DLLAccessBridge*         m_pDLLAccess;


From ehyche at helixcommunity.org  Tue May  9 13:11:50 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue May  9 15:03:28 2006
Subject: [Datatype-cvs] 
	wm/fileformat/platform/win32 hxwmreader.cpp, 1.1.1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/wm/fileformat/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv13555/fileformat/platform/win32

Modified Files:
	hxwmreader.cpp 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Erik Hodge (ehodge@real.com)

Description
------------------------------------------
In testing WMA9 Lossless files, I discovered that
there are some properties that are stored in the
ASF header that are necessary for WMA9 Lossless and
WMA9 Pro decoding (as opposed to being stored in the
type-specific data, where most codec initialization
data is stored).

Therefore, these additional properties need to be parsed out
in the file format, sent through the stream header,
and passed into the codec.

While I was making this change, I also changed the
WMA9 codec to support IHXAudioDecoderRenderer, which
inherits from IHXAudioDecoder and provides two more
methods (SetStartTime() and SetNextFrameTime()). Having
these methods allows us to be able to provide the WMA9
codec with timestamps for the encoded input buffers we are
passing into it.

Files Modified
------------------------------------------
datatype/wm/audio/renderer/wmadecoder.cpp
datatype/wm/audio/renderer/wmadecoder.h
datatype/wm/audio/renderer/wmaformat.cpp
datatype/wm/audio/renderer/wmaformat.h
datatype/wm/fileformat/platform/win32/hxwmreader.cpp

Branches
------------------------------------------
HEAD only



Index: hxwmreader.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/fileformat/platform/win32/hxwmreader.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- hxwmreader.cpp	4 May 2006 20:45:31 -0000	1.1.1.1
+++ hxwmreader.cpp	9 May 2006 20:11:47 -0000	1.2
@@ -64,15 +64,19 @@
 
 const CHXWMReader::HelixWMAttributeNamePair CHXWMReader::m_pAttributeNameMap[] =
 {
-    {g_wszWMAlbumArtist,                 "Performer"       },
-    {g_wszWMGenre,                       "Genre"           },
-    {g_wszWMDRM_IsDRM,                   "IsLicensed"      },
-    {g_wszWMDRM_DRMHeader_ContentID,     "ContentGUID"     },
-    {g_wszWMDRM_DRMHeader_LicenseAcqURL, "LicenseServerURL"},
-    {g_wszWMIsVBR,                       "IsVBR"           },
-    {g_wszWMPeakBitrate,                 "WMPeakBitrate"   },
-    {g_wszWMDuration,                    "Duration"        },
-    {NULL,                               NULL              }
+    {g_wszWMAlbumArtist,                 "Performer"           },
+    {g_wszWMGenre,                       "Genre"               },
+    {g_wszWMDRM_IsDRM,                   "IsLicensed"          },
+    {g_wszWMDRM_DRMHeader_ContentID,     "ContentGUID"         },
+    {g_wszWMDRM_DRMHeader_LicenseAcqURL, "LicenseServerURL"    },
+    {g_wszWMIsVBR,                       "IsVBR"               },
+    {g_wszWMPeakBitrate,                 "WMPeakBitrate"       },
+    {g_wszWMDuration,                    "Duration"            },
+    {g_wszWMWMADRCAverageReference,      "DRCAverageReference" },
+    {g_wszWMWMADRCAverageTarget,         "DRCAverageTarget"    },
+    {g_wszWMWMADRCPeakReference,         "DRCPeakReference"    },
+    {g_wszWMWMADRCPeakTarget,            "DRCPeakTarget"       },
+    {NULL,                               NULL                  }
 };
 
 const char* const CHXWMReader::m_pWMReaderEventName[WMT_PROXIMITY_COMPLETED + 1] =
@@ -2637,86 +2641,100 @@
                     HRESULT hr = pReader->QueryInterface(IID_IWMProfile, (void**) &pProfile);
                     if (SUCCEEDED(hr))
                     {
-                        // Get the IWMStreamConfig interface for this stream
-                        IWMStreamConfig* pConfig = NULL;
-                        hr = pProfile->GetStreamByNumber(usWMStreamNum, &pConfig);
+                        // Get the IWMHeaderInfo3 interface
+                        IWMHeaderInfo3* pInfo = NULL;
+                        hr = pReader->QueryInterface(IID_IWMHeaderInfo3, (void**) &pInfo);
                         if (SUCCEEDED(hr))
                         {
-                            // QI for IWMMediaProps
-                            IWMMediaProps* pMediaProps = NULL;
-                            hr = pConfig->QueryInterface(IID_IWMMediaProps, (void**) &pMediaProps);
+                            // Get the IWMStreamConfig interface for this stream
+                            IWMStreamConfig* pConfig = NULL;
+                            hr = pProfile->GetStreamByNumber(usWMStreamNum, &pConfig);
                             if (SUCCEEDED(hr))
                             {
-                                // Get the size of the WM_MEDIA_TYPE struct
-                                DWORD dwSize = 0;
-                                hr = pMediaProps->GetMediaType(NULL, &dwSize);
+                                // QI for IWMMediaProps
+                                IWMMediaProps* pMediaProps = NULL;
+                                hr = pConfig->QueryInterface(IID_IWMMediaProps, (void**) &pMediaProps);
                                 if (SUCCEEDED(hr))
                                 {
-                                    // Allocate a buffer this big
-                                    BYTE* pMediaTypeBuf = new BYTE [dwSize];
-                                    if (pMediaTypeBuf)
+                                    // Get the size of the WM_MEDIA_TYPE struct
+                                    DWORD dwSize = 0;
+                                    hr = pMediaProps->GetMediaType(NULL, &dwSize);
+                                    if (SUCCEEDED(hr))
                                     {
-                                        // Now get the WM_MEDIA_TYPE struct
-                                        hr = pMediaProps->GetMediaType((WM_MEDIA_TYPE*) pMediaTypeBuf, &dwSize);
-                                        if (SUCCEEDED(hr))
+                                        // Allocate a buffer this big
+                                        BYTE* pMediaTypeBuf = new BYTE [dwSize];
+                                        if (pMediaTypeBuf)
                                         {
-                                            // Clear the return value
-                                            retVal = HXR_OK;
-                                            // Switch on major media type (audio, video, etc.)
-                                            WM_MEDIA_TYPE* pMediaType = (WM_MEDIA_TYPE*) pMediaTypeBuf;
-                                            if (IsEqualIID(pMediaType->majortype, WMMEDIATYPE_Video))
+                                            // Now get the WM_MEDIA_TYPE struct
+                                            hr = pMediaProps->GetMediaType((WM_MEDIA_TYPE*) pMediaTypeBuf, &dwSize);
+                                            if (SUCCEEDED(hr))
                                             {
-                                                // This is video. Now check the formattype
-                                                if (IsEqualIID(pMediaType->formattype, WMFORMAT_VideoInfo))
+                                                // Clear the return value
+                                                retVal = HXR_OK;
+                                                // Switch on major media type (audio, video, etc.)
+                                                WM_MEDIA_TYPE* pMediaType = (WM_MEDIA_TYPE*) pMediaTypeBuf;
+                                                if (IsEqualIID(pMediaType->majortype, WMMEDIATYPE_Video))
                                                 {
-                                                    WMVIDEOINFOHEADER* pVideoHdr = (WMVIDEOINFOHEADER*) pMediaType->pbFormat;
-                                                    if (pVideoHdr)
+                                                    // This is video. Now check the formattype
+                                                    if (IsEqualIID(pMediaType->formattype, WMFORMAT_VideoInfo))
                                                     {
-                                                        RECT  rcTarget = pVideoHdr->rcTarget;
-                                                        INT32 lWidth   = rcTarget.right - rcTarget.left;
-                                                        INT32 lHeight  = rcTarget.bottom - rcTarget.top;
-                                                        if (lWidth > 0 && lHeight >0)
-                                                        {
-                                                            pHdr->SetPropertyULONG32("Width",  (UINT32) lWidth);
-                                                            pHdr->SetPropertyULONG32("Height", (UINT32) lHeight);
-                                                        }
-                                                        INT32 lFrameWidth  = pVideoHdr->bmiHeader.biWidth;
-                                                        INT32 lFrameHeight = pVideoHdr->bmiHeader.biHeight;
-                                                        if (lFrameWidth > 0 && lFrameHeight > 0)
+                                                        WMVIDEOINFOHEADER* pVideoHdr = (WMVIDEOINFOHEADER*) pMediaType->pbFormat;
+                                                        if (pVideoHdr)
                                                         {
-                                                            pHdr->SetPropertyULONG32("FrameWidth",  lFrameWidth);
-                                                            pHdr->SetPropertyULONG32("FrameHeight", lFrameHeight);
+                                                            RECT  rcTarget = pVideoHdr->rcTarget;
+                                                            INT32 lWidth   = rcTarget.right - rcTarget.left;
+                                                            INT32 lHeight  = rcTarget.bottom - rcTarget.top;
+                                                            if (lWidth > 0 && lHeight >0)
+                                                            {
+                                                                pHdr->SetPropertyULONG32("Width",  (UINT32) lWidth);
+                                                                pHdr->SetPropertyULONG32("Height", (UINT32) lHeight);
+                                                            }
+                                                            INT32 lFrameWidth  = pVideoHdr->bmiHeader.biWidth;
+                                                            INT32 lFrameHeight = pVideoHdr->bmiHeader.biHeight;
+                                                            if (lFrameWidth > 0 && lFrameHeight > 0)
+                                                            {
+                                                                pHdr->SetPropertyULONG32("FrameWidth",  lFrameWidth);
+                                                                pHdr->SetPropertyULONG32("FrameHeight", lFrameHeight);
+                                                            }
                                                         }
                                                     }
                                                 }
-                                            }
-                                            else if (IsEqualIID(pMediaType->majortype, WMMEDIATYPE_Audio))
-                                            {
-                                                // This is audio. Now check the formattype
-                                                if (IsEqualIID(pMediaType->formattype, WMFORMAT_WaveFormatEx))
+                                                else if (IsEqualIID(pMediaType->majortype, WMMEDIATYPE_Audio))
                                                 {
-                                                    WAVEFORMATEX* pAudioHdr = (WAVEFORMATEX*) pMediaType->pbFormat;
-                                                    if (pAudioHdr)
+                                                    // This is audio. Now check the formattype
+                                                    if (IsEqualIID(pMediaType->formattype, WMFORMAT_WaveFormatEx))
                                                     {
-                                                        // Set the audio-specific properties
-                                                        pHdr->SetPropertyULONG32("Channels",         (UINT32) pAudioHdr->nChannels);
-                                                        pHdr->SetPropertyULONG32("SamplesPerSecond", (UINT32) pAudioHdr->nSamplesPerSec);
-                                                        pHdr->SetPropertyULONG32("BitsPerSample",    (UINT32) pAudioHdr->wBitsPerSample);
+                                                        WAVEFORMATEX* pAudioHdr = (WAVEFORMATEX*) pMediaType->pbFormat;
+                                                        if (pAudioHdr)
+                                                        {
+                                                            // Set the audio-specific properties
+                                                            pHdr->SetPropertyULONG32("Channels",         (UINT32) pAudioHdr->nChannels);
+                                                            pHdr->SetPropertyULONG32("SamplesPerSecond", (UINT32) pAudioHdr->nSamplesPerSec);
+                                                            pHdr->SetPropertyULONG32("BitsPerSample",    (UINT32) pAudioHdr->wBitsPerSample);
+                                                        }
+                                                        // Look for the "WM/WMADRCPeakReference", "WM/WMADRCPeakTarget",
+                                                        // "WM/WMADRCAverageReference", and "WM/WMADRCAverageTarget"
+                                                        // properties. These are used for WMA Lossless and WMA Pro.
+                                                        SetHeaderProperty(pInfo, &usWMStreamNum, "DRCPeakReference", pHdr, m_pContext);
+                                                        SetHeaderProperty(pInfo, &usWMStreamNum, "DRCPeakTarget", pHdr, m_pContext);
+                                                        SetHeaderProperty(pInfo, &usWMStreamNum, "DRCAverageReference", pHdr, m_pContext);
+                                                        SetHeaderProperty(pInfo, &usWMStreamNum, "DRCAverageTarget", pHdr, m_pContext);
                                                     }
                                                 }
                                             }
                                         }
+                                        else
+                                        {
+                                            retVal = HXR_OUTOFMEMORY;
+                                        }
+                                        HX_VECTOR_DELETE(pMediaTypeBuf);
                                     }
-                                    else
-                                    {
-                                        retVal = HXR_OUTOFMEMORY;
-                                    }
-                                    HX_VECTOR_DELETE(pMediaTypeBuf);
                                 }
+                                HX_RELEASE(pMediaProps);
                             }
-                            HX_RELEASE(pMediaProps);
+                            HX_RELEASE(pConfig);
                         }
-                        HX_RELEASE(pConfig);
+                        HX_RELEASE(pInfo);
                     }
                     HX_RELEASE(pProfile);
                 }


From chopaul at helixcommunity.org  Tue May  9 16:21:25 2006
From: chopaul at helixcommunity.org (chopaul@helixcommunity.org)
Date: Tue May  9 18:13:00 2006
Subject: [Datatype-cvs] tools/dtdriver/dtdrplin dtdr_genr_dll,1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/dtdrplin
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv5021/dtdrplin

Modified Files:
	dtdr_genr_dll 
Log Message:
Subject: [datatype-dev] CR-Client: Adding library dependency to fix break


Modified by: pcho@real.com
Reviewed by: pcho@real.com
Date: 5/9/2006
Project: datatype
 
Synopsis: Added library dependencies to fix breaks
 
Overview: Added dependencies to client/common/util and common/lang/xml
 
Files Modified:
datatype/tools/dtdriver/apps/dtdrive/Umakefil
datatype/tools/dtdriver/dtdrplin/dtdr_genr_dll
 
Image Size and Heap Use impact (Client -Only):
N/A
 
Platforms and Profiles Affected:
All
 
Distribution Libraries Affected:
N/A
 
Distribution library impact and planned action:
N/A
 
Platforms and Profiles Build Verified:
Windows
helix-client-all-defines
 
Platforms and Profiles Functionality verified:
Windows
helix-client-all-defines
 
Branch:
HEAD

CR by Ping


Index: dtdr_genr_dll
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/dtdr_genr_dll,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dtdr_genr_dll	4 May 2006 00:24:14 -0000	1.1
+++ dtdr_genr_dll	9 May 2006 23:21:22 -0000	1.2
@@ -70,6 +70,7 @@
                             "datatype/tools/dtdriver/decoder/video[dtdrviddec]",
                             "client/common/container[contclntlib]",
                             "client/common/system[sysclntlib]",
+                            "client/common/util[utlclntlib]",
                             "common/runtime[runtlib]",
                             "common/dbgtool[debuglib]", 
                             "common/util[utillib]", 


From chopaul at helixcommunity.org  Tue May  9 16:21:25 2006
From: chopaul at helixcommunity.org (chopaul@helixcommunity.org)
Date: Tue May  9 18:13:02 2006
Subject: [Datatype-cvs] tools/dtdriver/apps/dtdrive Umakefil,1.15,1.16
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/apps/dtdrive
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv5021/apps/dtdrive

Modified Files:
	Umakefil 
Log Message:
Subject: [datatype-dev] CR-Client: Adding library dependency to fix break


Modified by: pcho@real.com
Reviewed by: pcho@real.com
Date: 5/9/2006
Project: datatype
 
Synopsis: Added library dependencies to fix breaks
 
Overview: Added dependencies to client/common/util and common/lang/xml
 
Files Modified:
datatype/tools/dtdriver/apps/dtdrive/Umakefil
datatype/tools/dtdriver/dtdrplin/dtdr_genr_dll
 
Image Size and Heap Use impact (Client -Only):
N/A
 
Platforms and Profiles Affected:
All
 
Distribution Libraries Affected:
N/A
 
Distribution library impact and planned action:
N/A
 
Platforms and Profiles Build Verified:
Windows
helix-client-all-defines
 
Platforms and Profiles Functionality verified:
Windows
helix-client-all-defines
 
Branch:
HEAD

CR by Ping


Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/apps/dtdrive/Umakefil,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Umakefil	4 May 2006 00:15:53 -0000	1.15
+++ Umakefil	9 May 2006 23:21:23 -0000	1.16
@@ -15,8 +15,10 @@
 			    "client/medpltfm[hxmedpltfmlib]",
 			    "client/common/container[contclntlib]",
 			    "client/common/system[sysclntlib]",
-			    "common/runtime[runtlib]",
+			    "client/common/util[utlclntlib]",
+                            "common/runtime[runtlib]",
 			    "common/dbgtool[debuglib]", 
+                            "common/lang/xml[xmllib]",
 			    "common/util[utillib]", 
 			    "common/container[contlib]",
 			    "common/system[syslib]",


From jwei at helixcommunity.org  Wed May 10 09:22:40 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed May 10 11:14:05 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp,1.27,1.28
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv17643

Modified Files:
	mdfvideoadapter.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 08-05-2006.

Error ID: JWEI-6PLLBP

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Setting PostProcessor Output format

This CR proposes following error corrections or/and improvements:
1) In current codes, Postprocessor's output format is not set. A default value is utilized. However, in newer version of post processor's code, the default value is no long a valid one. It means it is mandatory to set postprocessor's output format.

2) Devideo's SynchronizeDecoding is set to False, which is the default behavior of our version of DevVideo implemenation.

Files Modified:

/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp

Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.3.2.23
diff -u -w -b -r1.3.2.23 mdfvideoadapter.cpp
--- mdfvideoadapter.cpp	1 May 2006 15:02:07 -0000	1.3.2.23
+++ mdfvideoadapter.cpp	9 May 2006 20:40:17 -0000
@@ -347,6 +347,25 @@
         m_pDevVideoPlay->SetVideoDestScreenL( ETrue );
         MDFVIDEOLOG_INOUTFN( "SetVideoDestScreenL() does not leave" );
 
+        RArray aVideoFormat;
+        CleanupClosePushL( aVideoFormat );
+        m_pDevVideoPlay->GetOutputFormatListL( m_PostProcessorHwDeviceId, aVideoFormat );
+        if( aVideoFormat.Count() )
+        {
+            //according to DevVideo API, the first entry in aVideoFormat is the most prefrerred
+            //output format
+            m_pDevVideoPlay->SetOutputFormatL( m_PostProcessorHwDeviceId, aVideoFormat[0] );
+            MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to PostProcessor does not leave" );
+        }
+        else
+        {
+            MDFVIDEOLOG_INOUTFN( "PostProcessor does not support any output format" );
+            User::Leave( KErrNotSupported );
+        }
+        CleanupStack::PopAndDestroy( &aVideoFormat );
+
+        m_pDevVideoPlay->SynchronizeDecoding(EFalse);
+
         CMMFDevVideoPlay::TBufferOptions bufferOptions;
         bufferOptions.iMaxInputBufferSize = (352*288);
         bufferOptions.iMinNumInputBuffers = 2; ======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- mdfvideoadapter.cpp	1 May 2006 15:51:24 -0000	1.27
+++ mdfvideoadapter.cpp	10 May 2006 16:22:34 -0000	1.28
@@ -348,6 +348,25 @@
         m_pDevVideoPlay->SetVideoDestScreenL( ETrue );
         MDFVIDEOLOG_INOUTFN( "SetVideoDestScreenL() does not leave" );
 
+        RArray aVideoFormat;
+        CleanupClosePushL( aVideoFormat );
+        m_pDevVideoPlay->GetOutputFormatListL( m_PostProcessorHwDeviceId, aVideoFormat );
+        if( aVideoFormat.Count() )
+        {
+            //according to DevVideo API, the first entry in aVideoFormat is the most prefrerred
+            //output format
+            m_pDevVideoPlay->SetOutputFormatL( m_PostProcessorHwDeviceId, aVideoFormat[0] );
+            MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to PostProcessor does not leave" );
+        }
+        else
+        {
+            MDFVIDEOLOG_INOUTFN( "PostProcessor does not support any output format" );
+            User::Leave( KErrNotSupported );
+        }
+        CleanupStack::PopAndDestroy( &aVideoFormat );
+
+        m_pDevVideoPlay->SynchronizeDecoding(EFalse);
+
         CMMFDevVideoPlay::TBufferOptions bufferOptions;
         bufferOptions.iMaxInputBufferSize = (352*288);
         bufferOptions.iMinNumInputBuffers = 2;


From jwei at helixcommunity.org  Wed May 10 09:23:15 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed May 10 11:14:41 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp, 1.3.2.23,
	1.3.2.24
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv17986

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfvideoadapter.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 08-05-2006.

Error ID: JWEI-6PLLBP

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Setting PostProcessor Output format

This CR proposes following error corrections or/and improvements:
1) In current codes, Postprocessor's output format is not set. A default value is utilized. However, in newer version of post processor's code, the default value is no long a valid one. It means it is mandatory to set postprocessor's output format.

2) Devideo's SynchronizeDecoding is set to False, which is the default behavior of our version of DevVideo implemenation.

Files Modified:

/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp

Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.3.2.23
diff -u -w -b -r1.3.2.23 mdfvideoadapter.cpp
--- mdfvideoadapter.cpp	1 May 2006 15:02:07 -0000	1.3.2.23
+++ mdfvideoadapter.cpp	9 May 2006 20:40:17 -0000
@@ -347,6 +347,25 @@
         m_pDevVideoPlay->SetVideoDestScreenL( ETrue );
         MDFVIDEOLOG_INOUTFN( "SetVideoDestScreenL() does not leave" );
 
+        RArray aVideoFormat;
+        CleanupClosePushL( aVideoFormat );
+        m_pDevVideoPlay->GetOutputFormatListL( m_PostProcessorHwDeviceId, aVideoFormat );
+        if( aVideoFormat.Count() )
+        {
+            //according to DevVideo API, the first entry in aVideoFormat is the most prefrerred
+            //output format
+            m_pDevVideoPlay->SetOutputFormatL( m_PostProcessorHwDeviceId, aVideoFormat[0] );
+            MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to PostProcessor does not leave" );
+        }
+        else
+        {
+            MDFVIDEOLOG_INOUTFN( "PostProcessor does not support any output format" );
+            User::Leave( KErrNotSupported );
+        }
+        CleanupStack::PopAndDestroy( &aVideoFormat );
+
+        m_pDevVideoPlay->SynchronizeDecoding(EFalse);
+
         CMMFDevVideoPlay::TBufferOptions bufferOptions;
         bufferOptions.iMaxInputBufferSize = (352*288);
         bufferOptions.iMinNumInputBuffers = 2; ======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.3.2.23
retrieving revision 1.3.2.24
diff -u -d -r1.3.2.23 -r1.3.2.24
--- mdfvideoadapter.cpp	1 May 2006 15:02:07 -0000	1.3.2.23
+++ mdfvideoadapter.cpp	10 May 2006 16:23:11 -0000	1.3.2.24
@@ -347,6 +347,25 @@
         m_pDevVideoPlay->SetVideoDestScreenL( ETrue );
         MDFVIDEOLOG_INOUTFN( "SetVideoDestScreenL() does not leave" );
 
+        RArray aVideoFormat;
+        CleanupClosePushL( aVideoFormat );
+        m_pDevVideoPlay->GetOutputFormatListL( m_PostProcessorHwDeviceId, aVideoFormat );
+        if( aVideoFormat.Count() )
+        {
+            //according to DevVideo API, the first entry in aVideoFormat is the most prefrerred
+            //output format
+            m_pDevVideoPlay->SetOutputFormatL( m_PostProcessorHwDeviceId, aVideoFormat[0] );
+            MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to PostProcessor does not leave" );
+        }
+        else
+        {
+            MDFVIDEOLOG_INOUTFN( "PostProcessor does not support any output format" );
+            User::Leave( KErrNotSupported );
+        }
+        CleanupStack::PopAndDestroy( &aVideoFormat );
+
+        m_pDevVideoPlay->SynchronizeDecoding(EFalse);
+
         CMMFDevVideoPlay::TBufferOptions bufferOptions;
         bufferOptions.iMaxInputBufferSize = (352*288);
         bufferOptions.iMinNumInputBuffers = 2;


From kliu at helixcommunity.org  Wed May 10 11:35:09 2006
From: kliu at helixcommunity.org (kliu@helixcommunity.org)
Date: Wed May 10 13:26:33 2006
Subject: [Datatype-cvs] CVSROOT avail,1.93,1.94
Message-ID: 

Update of /cvsroot/datatype/CVSROOT
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv16368/CVSROOT

Modified Files:
	avail 
Log Message:
giving ckirby write access for the 'datatype' project

Index: avail
===================================================================
RCS file: /cvsroot/datatype/CVSROOT/avail,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- avail	4 May 2006 18:49:10 -0000	1.93
+++ avail	10 May 2006 18:35:06 -0000	1.94
@@ -39,6 +39,7 @@
 avail|chopaul
 avail|chrismd
 avail|ckarusala
+avail|ckirby
 avail|cnoel
 avail|crobinson
 avail|csaw
@@ -219,6 +220,7 @@
 avail|tsuzuki
 avail|tzupan
 avail|uboddeti
+avail|umakanth
 avail|vader70
 avail|vanand
 avail|vgondi


From bobclark at helixcommunity.org  Wed May 10 19:02:25 2006
From: bobclark at helixcommunity.org (bobclark@helixcommunity.org)
Date: Wed May 10 20:53:44 2006
Subject: [Datatype-cvs] tools/dtdriver/engine cmultifwriter.h,1.1,1.1.2.1
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv32664

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	cmultifwriter.h 
Log Message:
fix for gcc4; cr ehodge

Index: cmultifwriter.h
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/cmultifwriter.h,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -d -r1.1 -r1.1.2.1
--- cmultifwriter.h	9 May 2006 01:09:46 -0000	1.1
+++ cmultifwriter.h	11 May 2006 02:02:21 -0000	1.1.2.1
@@ -86,7 +86,7 @@
     ~CMultiFileWriter();
 
 
-    friend CMultiFileWriterAgent;
+    friend class CMultiFileWriterAgent;
 
 
     /*
@@ -258,7 +258,7 @@
     ~CMultiFileWriterAgent(void);
 
 
-    friend CMultiFileWriter;
+    friend class CMultiFileWriter;
 
     /*
      *  Native Methods


From dcollins at helixcommunity.org  Thu May 11 09:01:14 2006
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Thu May 11 10:52:25 2006
Subject: [Datatype-cvs] image/common pximage.cpp,1.7,1.8
Message-ID: 

Update of /cvsroot/datatype/image/common
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv32222

Modified Files:
	pximage.cpp 
Log Message:
Fix a build-buster for Debian 3.1 /w gcc 3.3.5.

Error:
~~~~~~
pximage.cpp: In member function `HX_RESULT PXImage::Create(long int,
long int, long unsigned int, long unsigned int, int, int)':
pximage.cpp:287: warning: jump to label `cleanup'
pximage.cpp:207: warning:   from here
pximage.cpp:236: error:   crosses initialization of `UINT32 ulNumBytes'
pximage.cpp:287: warning: jump to label `cleanup'
pximage.cpp:196: warning:   from here
pximage.cpp:236: error:   crosses initialization of `UINT32 ulNumBytes'
pximage.cpp:287: warning: jump to label `cleanup'
pximage.cpp:187: warning:   from here
pximage.cpp:236: error:   crosses initialization of `UINT32 ulNumBytes'
make: *** [rel/obj/pximage.o] Error 1
Time used: 2.12 seconds
ERROR: UNIXCompile(datatype/image/common) ERROR: Make failed.



Index: pximage.cpp
===================================================================
RCS file: /cvsroot/datatype/image/common/pximage.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- pximage.cpp	7 Apr 2006 17:15:38 -0000	1.7
+++ pximage.cpp	11 May 2006 16:01:08 -0000	1.8
@@ -175,6 +175,7 @@
                           HXBOOL bRowsInverted, HXBOOL bAlloc)
 {
     HX_RESULT retVal = HXR_OK;
+    UINT32 ulNumBytes = 0;
 
     // Check for invalid input size
     if (lW <= 0          ||
@@ -233,7 +234,7 @@
     m_lRowStride                = (m_lRowBytes + 3) & ~3;
 
     // Determine the number of bytes we need
-    UINT32 ulNumBytes = m_lRowStride * m_cBitmapInfo.biHeight;
+    ulNumBytes = m_lRowStride * m_cBitmapInfo.biHeight;
 
     // Check to see if we need to alloc memory. We will allocate
     // if the bAlloc parameter tells us to OR if bAlloc is FALSE


From kliu at helixcommunity.org  Thu May 11 10:13:44 2006
From: kliu at helixcommunity.org (kliu@helixcommunity.org)
Date: Thu May 11 12:04:57 2006
Subject: [Datatype-cvs] CVSROOT avail,1.94,1.95
Message-ID: 

Update of /cvsroot/datatype/CVSROOT
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv23736/CVSROOT

Modified Files:
	avail 
Log Message:
revoking write access for  kegunn from the 'datatype' project

Index: avail
===================================================================
RCS file: /cvsroot/datatype/CVSROOT/avail,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- avail	10 May 2006 18:35:06 -0000	1.94
+++ avail	11 May 2006 17:13:41 -0000	1.95
@@ -137,7 +137,6 @@
 avail|karll
 avail|kbeukelman
 avail|kcollar
-avail|kegunn
 avail|kevinf
 avail|kliu
 avail|kross


From dyek at helixcommunity.org  Mon May 15 11:45:52 2006
From: dyek at helixcommunity.org (dyek@helixcommunity.org)
Date: Mon May 15 13:36:02 2006
Subject: [Datatype-cvs] wav/renderer/pcm pcmfmt.cpp,1.1.8.2.2.1,1.1.8.2.2.2
Message-ID: 

Update of /cvsroot/datatype/wav/renderer/pcm
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv32190

Modified Files:
      Tag: hxclient_1_4_3_neptunex
	pcmfmt.cpp 
Log Message:
Synopsis: Allocate buffer before modifying read-only data.

Overview:
RealPlayer for Linux crashed when playing back AIFF file.

The reason was that SwapWordBytes() causes SEGV (Segmentation Fault) 
writing to read-only memory.

This is happening in 143Neptunex but was fixed in 150Cayenne, 130NepX
and HEAD.

The fix is to port the bug fix from 150Cayenne branch to 143Neptunex
branch.

The change involves moving buffer allocation code in 
CPCMAudioFormat::DecodeAudioData() up to prior to calling
SwapWordBytes(), instead of after.




Files Modified:
datatype/wav/renderer/pcm/pcmfmt.cpp - Changed to allocate buffer before 
calling SwapWordBytes(), instead of after.


Image Size and Heap Use impact (Client -Only):
None

Platforms and Profiles Affected:
Linux

Platforms and Profiles Build Verified:
Profile: helix_client_all_define.
Platforms: Fedora core 3 Linux

Platforms and Profiles Functionality verified:
Profile: helix_client_all_define.
Platforms: Fedora core 3 Linux

Branch: hxclient_1_4_3_neptunex

Copyright assignment: I am a RealNetworks employee.





Index: pcmfmt.cpp
===================================================================
RCS file: /cvsroot/datatype/wav/renderer/pcm/pcmfmt.cpp,v
retrieving revision 1.1.8.2.2.1
retrieving revision 1.1.8.2.2.2
diff -u -d -r1.1.8.2.2.1 -r1.1.8.2.2.2
--- pcmfmt.cpp	6 Dec 2005 18:41:34 -0000	1.1.8.2.2.1
+++ pcmfmt.cpp	15 May 2006 18:45:49 -0000	1.1.8.2.2.2
@@ -268,22 +268,26 @@
             case kMimeTypeAudioL8:
             case kMimeTypeAudioL16:
             case kMimeTypeAudioXPNWav:
-            // Byteswap the samples if necessary
-            if (m_bSwapSampleBytes)
-            {
-                SwapWordBytes((UINT16*) pPacket->m_pData, pPacket->m_ulDataSize >> 1);
-            }
-            // Offset 8-bit samples if necessary
-            if (m_bZeroOffsetPCM)
+
+            // Copy the media packet into this buffer
+            retVal = pBuffer->Set(pPacket->m_pData, pPacket->m_ulDataSize);
+            if (SUCCEEDED(retVal))
             {
-                UCHAR* pTmp = (UCHAR*) pPacket->m_pData;
-                for (UINT32 i = 0; i < pPacket->m_ulDataSize; i++)
+                // Byteswap the samples if necessary
+                if (m_bSwapSampleBytes)
                 {
-                    pTmp[i] -= 128;
+                    SwapWordBytes((UINT16*) pBuffer->GetBuffer(), pBuffer->GetSize() / 2 );
+                }
+                // Offset 8-bit samples if necessary
+                if (m_bZeroOffsetPCM)
+                {
+                    UCHAR* pTmp = (UCHAR*) pBuffer->GetBuffer();
+                    for (UINT32 i = 0; i < pBuffer->GetSize(); i++)
+                    {
+                        pTmp[i] -= 128;
+                    }
                 }
             }
-            // Copy the media packet into this buffer
-            retVal = pBuffer->Set(pPacket->m_pData, pPacket->m_ulDataSize);
                 break;
             case kMimeTypeAudioPCMA:
             case kMimeTypeAudioPCMU:    


From ehyche at helixcommunity.org  Tue May 16 07:07:04 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue May 16 08:57:04 2006
Subject: [Datatype-cvs] common/basehost/pub base_hosted_factory.h, NONE,
	1.1 base_hosted_fileformat.h, 1.2, 1.3 base_hosted_renderer.h,
	1.1, 1.2 base_playlist_fileformat.h, 1.1,
	1.2 base_playlist_renderer.h, 1.1, 1.2 hxguestplayer.h, 1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/common/basehost/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv20483/pub

Modified Files:
	base_hosted_fileformat.h base_hosted_renderer.h 
	base_playlist_fileformat.h base_playlist_renderer.h 
	hxguestplayer.h 
Added Files:
	base_hosted_factory.h 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Milko Boic (milko@real.com)

Description
----------------------------------------
In the *current* guest player code, a new implementor
of an IHXGuestPlayer would have to not only implement
IHXGuestPlayer, but would also have to:

  1) derive from the base file format
  2) derive from the base renderer
  3) (possibly) derive from the base playlist file format
  4) (possibly) derive from the base playlist renderer
  5) (optionally) package all of these plugins together
     into a plugin factory

Although the code in each of these items is small,
it still is a non-trivial task to get all of these
plugins working together. This change dramatically simplifies
this task, and reduces the above 5 tasks down to
just specifying two macros.

The reason that previously this was so distributed
is that the file format and renderer plugins have to
be able to provide the information on what file extensions,
schemes, stream mime types, etc. that they want to claim.
This information logically would reside in the guest player
itself, but it is these plugins that must create and
own the guest player. Therefore, we previously had
to derive from the base plugins. The dervied plugins
would simply provide these values of claimed 
extensions, schemes, etc.

Now this information has been centralized into
a IHXGuestPlayerCreator interface which is implemented
by the base factory (the base factory is also new, and
it takes care of the IHXPluginFactory implementation
for the guest player.

So now, the implementor of a guest player now
only has to use the following two macros:

DECLARE_GUEST_FACTORY_WITH_PLAYLISTS(class_name)
DEFINE_GUEST_FACTORY_WITH_PLAYLISTS(class_name, ...)

In the DEFINE_xxx macro, the user provides all the 
strings that the guest player wants to claim.



--- NEW FILE: base_hosted_factory.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef BASE_HOSTED_FACTORY_H
#define BASE_HOSTED_FACTORY_H

#include "hxplugn.h"
#include "hxguestplayer.h"
#include "baseobj.h"

class CHXBaseHostedPluginFactory : public IHXPluginFactory,
                                   public IHXGuestPlayerCreator,
                                   public CHXBaseCountingObject
{
public:
    CHXBaseHostedPluginFactory();
    virtual ~CHXBaseHostedPluginFactory() {};

    // IUnknown methods
    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)  (THIS);
    STDMETHOD_(ULONG32,Release) (THIS);

    // IHXPluginFactory methods
    STDMETHOD_(UINT16,GetNumPlugins) (THIS);
    STDMETHOD(GetPlugin)             (THIS_ UINT16 usIndex, IUnknown** ppPlugin);

    // IHXGuestPlayerCreator methods
    STDMETHOD(CreateGuestPlayer)     (THIS_ REF(IHXGuestPlayer*) rpPlayer) PURE;
    STDMETHOD(GetFormatInfo)         (THIS_ REF(const char*)  rpszDescription,
                                            REF(const char**) rppszFileMimeTypes,
                                            REF(const char**) rppszFileExtensions,
                                            REF(const char**) rppszFileOpenNames,
                                            REF(const char**) rppszSchemeExtInfo,
                                            REF(const char*)  rpszMimeType) PURE;
    STDMETHOD(GetPlaylistFormatInfo) (THIS_ REF(const char*)  rpszDescription,
                                            REF(const char**) rppszFileMimeTypes,
                                            REF(const char**) rppszFileExtensions,
                                            REF(const char**) rppszFileOpenNames,
                                            REF(const char**) rppszSchemeExtInfo,
                                            REF(const char*)  rpszMimeType) PURE;

    // CHXBaseHostedPluginFactory methods
    STDMETHOD(Init) (THIS);
protected:
    INT32  m_lRefCount;
    UINT16 m_usNumPlugins;

    static HX_RESULT (STDAPICALLTYPE* m_fpCreateInstanceArray[])(IHXGuestPlayerCreator*,IUnknown**);
};


#define DECLARE_GUEST_FACTORY_NO_PLAYLISTS(FACTNAME)                                  \
                                                                                      \
class FACTNAME : public CHXBaseHostedPluginFactory                                    \
{                                                                                     \
public:                                                                               \
    FACTNAME() {};                                                                    \
    virtual ~FACTNAME() {};                                                           \
                                                                                      \
    STDMETHOD(CreateGuestPlayer)     (THIS_ REF(IHXGuestPlayer*) rpPlayer);           \
    STDMETHOD(GetFormatInfo)         (THIS_ REF(const char*)  rpszDescription,        \
                                            REF(const char**) rppszFileMimeTypes,     \
                                            REF(const char**) rppszFileExtensions,    \
                                            REF(const char**) rppszFileOpenNames,     \
                                            REF(const char**) rppszSchemeExtInfo,     \
                                            REF(const char*)  rpszMimeType);          \
    STDMETHOD(GetPlaylistFormatInfo) (THIS_ REF(const char*)  rpszDescription,        \
                                            REF(const char**) rppszFileMimeTypes,     \
                                            REF(const char**) rppszFileExtensions,    \
                                            REF(const char**) rppszFileOpenNames,     \
                                            REF(const char**) rppszSchemeExtInfo,     \
                                            REF(const char*)  rpszMimeType)           \
    { return HXR_NOTIMPL; };                                                          \
                                                                                      \
    static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);          \
protected:                                                                            \
    static const char* const m_pszMediaDescription;                                   \
    static const char* const m_ppszMediaFileMimeType[];                               \
    static const char* const m_ppszMediaFileExtension[];                              \
    static const char* const m_ppszMediaFileOpenName[];                               \
    static const char* const m_ppszMediaSchemeExtensionInfo[];                        \
    static const char* const m_pszMediaMimeType;                                      \
}


#define DECLARE_GUEST_FACTORY_WITH_PLAYLISTS(FACTNAME)                                \
                                                                                      \
class FACTNAME : public CHXBaseHostedPluginFactory                                    \
{                                                                                     \
public:                                                                               \
    FACTNAME() {};                                                                    \
    virtual ~FACTNAME() {};                                                           \
                                                                                      \
    STDMETHOD(CreateGuestPlayer)     (THIS_ REF(IHXGuestPlayer*) rpPlayer);           \
    STDMETHOD(GetFormatInfo)         (THIS_ REF(const char*)  rpszDescription,        \
                                            REF(const char**) rppszFileMimeTypes,     \
                                            REF(const char**) rppszFileExtensions,    \
                                            REF(const char**) rppszFileOpenNames,     \
                                            REF(const char**) rppszSchemeExtInfo,     \
                                            REF(const char*)  rpszMimeType);          \
    STDMETHOD(GetPlaylistFormatInfo) (THIS_ REF(const char*)  rpszDescription,        \
                                            REF(const char**) rppszFileMimeTypes,     \
                                            REF(const char**) rppszFileExtensions,    \
                                            REF(const char**) rppszFileOpenNames,     \
                                            REF(const char**) rppszSchemeExtInfo,     \
                                            REF(const char*)  rpszMimeType);          \
    static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);          \
protected:                                                                            \
    static const char* const m_pszMediaDescription;                                   \
    static const char* const m_ppszMediaFileMimeType[];                               \
    static const char* const m_ppszMediaFileExtension[];                              \
    static const char* const m_ppszMediaFileOpenName[];                               \
    static const char* const m_ppszMediaSchemeExtensionInfo[];                        \
    static const char* const m_pszMediaMimeType;                                      \
    static const char* const m_pszPlaylistDescription;                                \
    static const char* const m_ppszPlaylistFileMimeType[];                            \
    static const char* const m_ppszPlaylistFileExtension[];                           \
    static const char* const m_ppszPlaylistFileOpenName[];                            \
    static const char* const m_ppszPlaylistSchemeExtensionInfo[];                     \
    static const char* const m_pszPlaylistMimeType;                                   \
}

#define DEFINE_GUEST_FACTORY_NO_PLAYLISTS(FACTNAME,GPNAME,DESC,FMT,FE,FON,SEI,SMT)    \
                                                                                      \
const char* const FACTNAME::m_pszMediaDescription               = DESC;               \
const char* const FACTNAME::m_ppszMediaFileMimeType[]           = {FMT, NULL};        \
const char* const FACTNAME::m_ppszMediaFileExtension[]          = {FE,  NULL};        \
const char* const FACTNAME::m_ppszMediaFileOpenName[]           = {FON, NULL};        \
const char* const FACTNAME::m_ppszMediaSchemeExtensionInfo[]    = {SEI, NULL};        \
const char* const FACTNAME::m_pszMediaMimeType                  = SMT;                \
                                                                                      \
STDMETHODIMP FACTNAME::CreateGuestPlayer(REF(IHXGuestPlayer*) rpPlayer)               \
{                                                                                     \
    return GPNAME::CreateGuestPlayer(rpPlayer);                                       \
}                                                                                     \
                                                                                      \
STDMETHODIMP FACTNAME::GetFormatInfo(REF(const char*)  rpszDescription,               \
                                     REF(const char**) rppszFileMimeTypes,            \
                                     REF(const char**) rppszFileExtensions,           \
                                     REF(const char**) rppszFileOpenNames,            \
                                     REF(const char**) rppszSchemeExtInfo,            \
                                     REF(const char*)  rpszMimeType)                  \
{                                                                                     \
    rpszDescription     = (const char*)  m_pszMediaDescription;                       \
    rppszFileMimeTypes  = (const char**) m_ppszMediaFileMimeType;                     \
    rppszFileExtensions = (const char**) m_ppszMediaFileExtension;                    \
    rppszFileOpenNames  = (const char**) m_ppszMediaFileOpenName;                     \
    rppszSchemeExtInfo  = (const char**) m_ppszMediaSchemeExtensionInfo;              \
    rpszMimeType        = (const char*)  m_pszMediaMimeType;                          \
                                                                                      \
    return HXR_OK;                                                                    \
}                                                                                     \
                                                                                      \
HX_RESULT STDAPICALLTYPE FACTNAME::HXCreateInstance(IUnknown** ppIUnknown)            \
{                                                                                     \
    HX_RESULT retVal = HXR_FAIL;                                                      \
                                                                                      \
    if (ppIUnknown)                                                                   \
    {                                                                                 \
        *ppIUnknown = NULL;                                                           \
        FACTNAME* pObj = new FACTNAME();                                              \
        if (pObj)                                                                     \
        {                                                                             \
            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);         \
            if (SUCCEEDED(retVal))                                                    \
            {                                                                         \
                retVal = pObj->Init();                                                \
            }                                                                         \
        }                                                                             \
        if (FAILED(retVal))                                                           \
        {                                                                             \
            HX_DELETE(pObj);                                                          \
        }                                                                             \
    }                                                                                 \
                                                                                      \
    return retVal;                                                                    \
}

#define DEFINE_GUEST_FACTORY_WITH_PLAYLISTS(FACTNAME,GPNAME,MDESC,MFMT,MFE,MFON,MSEI,MSMT,PDESC,PFMT,PFE,PFON,PSEI,PSMT) \
                                                                                      \
const char* const FACTNAME::m_pszMediaDescription               = MDESC;              \
const char* const FACTNAME::m_ppszMediaFileMimeType[]           = {MFMT, NULL};       \
const char* const FACTNAME::m_ppszMediaFileExtension[]          = {MFE,  NULL};       \
const char* const FACTNAME::m_ppszMediaFileOpenName[]           = {MFON, NULL};       \
const char* const FACTNAME::m_ppszMediaSchemeExtensionInfo[]    = {MSEI, NULL};       \
const char* const FACTNAME::m_pszMediaMimeType                  = MSMT;               \
const char* const FACTNAME::m_pszPlaylistDescription            = PDESC;              \
const char* const FACTNAME::m_ppszPlaylistFileMimeType[]        = {PFMT, NULL};       \
const char* const FACTNAME::m_ppszPlaylistFileExtension[]       = {PFE,  NULL};       \
const char* const FACTNAME::m_ppszPlaylistFileOpenName[]        = {PFON, NULL};       \
const char* const FACTNAME::m_ppszPlaylistSchemeExtensionInfo[] = {PSEI, NULL};       \
const char* const FACTNAME::m_pszPlaylistMimeType               = PSMT;               \
                                                                                      \
STDMETHODIMP FACTNAME::CreateGuestPlayer(REF(IHXGuestPlayer*) rpPlayer)               \
{                                                                                     \
    return GPNAME::CreateGuestPlayer(rpPlayer);                                       \
}                                                                                     \
                                                                                      \
STDMETHODIMP FACTNAME::GetFormatInfo(REF(const char*)  rpszDescription,               \
                                     REF(const char**) rppszFileMimeTypes,            \
                                     REF(const char**) rppszFileExtensions,           \
                                     REF(const char**) rppszFileOpenNames,            \
                                     REF(const char**) rppszSchemeExtInfo,            \
                                     REF(const char*)  rpszMimeType)                  \
{                                                                                     \
    rpszDescription     = (const char*)  m_pszMediaDescription;                       \
    rppszFileMimeTypes  = (const char**) m_ppszMediaFileMimeType;                     \
    rppszFileExtensions = (const char**) m_ppszMediaFileExtension;                    \
    rppszFileOpenNames  = (const char**) m_ppszMediaFileOpenName;                     \
    rppszSchemeExtInfo  = (const char**) m_ppszMediaSchemeExtensionInfo;              \
    rpszMimeType        = (const char*)  m_pszMediaMimeType;                          \
                                                                                      \
    return HXR_OK;                                                                    \
}                                                                                     \
                                                                                      \
STDMETHODIMP FACTNAME::GetPlaylistFormatInfo(REF(const char*)  rpszDescription,       \
                                             REF(const char**) rppszFileMimeTypes,    \
                                             REF(const char**) rppszFileExtensions,   \
                                             REF(const char**) rppszFileOpenNames,    \
                                             REF(const char**) rppszSchemeExtInfo,    \
                                             REF(const char*)  rpszMimeType)          \
{                                                                                     \
    rpszDescription     = (const char*)  m_pszPlaylistDescription;                    \
    rppszFileMimeTypes  = (const char**) m_ppszPlaylistFileMimeType;                  \
    rppszFileExtensions = (const char**) m_ppszPlaylistFileExtension;                 \
    rppszFileOpenNames  = (const char**) m_ppszPlaylistFileOpenName;                  \
    rppszSchemeExtInfo  = (const char**) m_ppszPlaylistSchemeExtensionInfo;           \
    rpszMimeType        = (const char*)  m_pszPlaylistMimeType;                       \
                                                                                      \
    return HXR_OK;                                                                    \
}                                                                                     \
                                                                                      \
HX_RESULT STDAPICALLTYPE FACTNAME::HXCreateInstance(IUnknown** ppIUnknown)            \
{                                                                                     \
    HX_RESULT retVal = HXR_FAIL;                                                      \
                                                                                      \
    if (ppIUnknown)                                                                   \
    {                                                                                 \
        *ppIUnknown = NULL;                                                           \
        FACTNAME* pObj = new FACTNAME();                                              \
        if (pObj)                                                                     \
        {                                                                             \
            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);         \
            if (SUCCEEDED(retVal))                                                    \
            {                                                                         \
                retVal = pObj->Init();                                                \
            }                                                                         \
        }                                                                             \
        if (FAILED(retVal))                                                           \
        {                                                                             \
            HX_DELETE(pObj);                                                          \
        }                                                                             \
    }                                                                                 \
                                                                                      \
    return retVal;                                                                    \
}

#endif /* #ifndef BASE_HOSTED_FACTORY_H */

Index: hxguestplayer.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/hxguestplayer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hxguestplayer.h	25 Apr 2006 16:56:40 -0000	1.1
+++ hxguestplayer.h	16 May 2006 14:07:01 -0000	1.2
@@ -52,6 +52,7 @@
 // Includes
 #include "hxtypes.h"
 #include "hxwintyp.h"
+#include "hxfiles.h"
 
 /*****************************************************
  SetNetworkingConfiguration Properties
@@ -370,4 +371,51 @@
     STDMETHOD(ExitFullScreen)                  (THIS) PURE;
 };
 
+
+/****************************************************************************
+ * 
+ *  Interface:
+ * 
+ *      IHXGuestPlayerCreator
+ * 
+ *  Purpose:
+ * 
+ *      This interface allows the guest player implementor to specify
+ *      information about the guest player used in creation.
+ * 
+ *  IID_IHXGuestPlayerCreator
+ * 
+ *      {D6EA593B-3C3E-4c44-8EE8-5681EB8C6B74}
+ * 
+ */
+
+DEFINE_GUID(IID_IHXGuestPlayerCreator, 0xd6ea593b, 0x3c3e, 0x4c44, 0x8e, 0xe8,
+            0x56, 0x81, 0xeb, 0x8c, 0x6b, 0x74);
+
+#undef  INTERFACE
+#define INTERFACE   IHXGuestPlayerCreator
+
+DECLARE_INTERFACE_(IHXGuestPlayerCreator, IUnknown)
+{
+    // IUnknown method
+    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj) PURE;
+    STDMETHOD_(ULONG32,AddRef)  (THIS) PURE;
+    STDMETHOD_(ULONG32,Release) (THIS) PURE;
+
+    // IHXGuestPlayerCreator methods
+    STDMETHOD(CreateGuestPlayer)     (THIS_ REF(IHXGuestPlayer*) rpPlayer) PURE;
+    STDMETHOD(GetFormatInfo)         (THIS_ REF(const char*)  rpszDescription,
+                                            REF(const char**) rppszFileMimeTypes,
+                                            REF(const char**) rppszFileExtensions,
+                                            REF(const char**) rppszFileOpenNames,
+                                            REF(const char**) rppszSchemeExtInfo,
+                                            REF(const char*)  rpszMimeType) PURE;
+    STDMETHOD(GetPlaylistFormatInfo) (THIS_ REF(const char*)  rpszDescription,
+                                            REF(const char**) rppszFileMimeTypes,
+                                            REF(const char**) rppszFileExtensions,
+                                            REF(const char**) rppszFileOpenNames,
+                                            REF(const char**) rppszSchemeExtInfo,
+                                            REF(const char*)  rpszMimeType) PURE;
+};
+
 #endif /* #ifndef HXGUESTPLAYER_H */

Index: base_playlist_renderer.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/base_playlist_renderer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- base_playlist_renderer.h	25 Apr 2006 16:56:40 -0000	1.1
+++ base_playlist_renderer.h	16 May 2006 14:07:01 -0000	1.2
@@ -70,7 +70,7 @@
 class CHXMapLongToObj;
 class CHXSimpleList;
 
-struct ASXPlayToAssoc
+struct HXPlayToAssoc
 {
     UINT16    m_uGroupIndex;
     UINT16    m_uTrackIndex;
@@ -155,10 +155,14 @@
     STDMETHOD(PlayerStateChange) (THIS_ UINT32 ulState);
     STDMETHOD(PlayerError)       (THIS_ HX_RESULT status, IHXBuffer* pErrStr);
 
-    // CBaseHostedRenderer methods
+    // CBaseHostedPlaylistRenderer methods
+    STDMETHOD(Configure) (THIS_ IHXGuestPlayerCreator* pCreator);
     void CallbackFunc();
+    // CBaseHostedPlaylistRenderer static methods
+    static HX_RESULT STDAPICALLTYPE HXCreateHostInstance(IHXGuestPlayerCreator* pCreator, IUnknown** ppUnk);
 protected:
     INT32                          m_lRefCount;
+    IHXGuestPlayerCreator*         m_pGuestPlayerCreator;
     IUnknown*                      m_pContext;
     IHXStream*                     m_pStream;
     IHXPlayer*                     m_pPlayer;
@@ -187,10 +191,8 @@
     HXBOOL                         m_bAddedResponse;
     HXBOOL                         m_bFirstTrack;
     UINT32                         m_ulGuestPlayerState;
-
-    // Methods the derived class must override
-    STDMETHOD(GetDescription) (THIS_ REF(const char*) rpszDescription) PURE;
-    STDMETHOD(GetMimeType)    (THIS_ REF(const char**) rppszMimeType) PURE;
+    const char*                    m_pszDescription;
+    const char*                    m_ppszMimeType[2];
 private:
     IHXScheduler*               m_pScheduler;
     CHXGenericCallback*         m_pCallback;
@@ -199,8 +201,8 @@
     static const char* const    m_pszMoreInfoURL;
 
     // Methods accessible only to the base class
-    ASXPlayToAssoc*  GetPlayToAssoc(UINT16 usGroupIndex, UINT16 usTrackIndex);
-    ASXPlayToAssoc*  GetPlayToAssocByMedia(const char* pszMediaID);
+    HXPlayToAssoc*   GetPlayToAssoc(UINT16 usGroupIndex, UINT16 usTrackIndex);
+    HXPlayToAssoc*   GetPlayToAssocByMedia(const char* pszMediaID);
     void             Cleanup();
     void             RemoveTracks();
     void             RemoveAllPlayToAssoc();

Index: base_hosted_renderer.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/base_hosted_renderer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- base_hosted_renderer.h	25 Apr 2006 16:56:40 -0000	1.1
+++ base_hosted_renderer.h	16 May 2006 14:07:01 -0000	1.2
@@ -207,7 +207,10 @@
     STDMETHOD(PlayerError)       (THIS_ HX_RESULT status, IHXBuffer* pErrStr);
 
     // CBaseHostedRenderer methods
-    void CallbackFunc();
+    STDMETHOD(Configure) (THIS_ IHXGuestPlayerCreator* pCreator);
+    void                 CallbackFunc();
+    // CBaseHostedRenderer static methods
+    static HX_RESULT STDAPICALLTYPE HXCreateHostInstance(IHXGuestPlayerCreator* pCreator, IUnknown** ppUnk);
 protected:
     enum
     {
@@ -221,6 +224,7 @@
     };
     // Member variables the derived class has access to
     INT32                       m_lRefCount;
+    IHXGuestPlayerCreator*      m_pGuestPlayerCreator;
     IUnknown*                   m_pContext;
     IHXStream*                  m_pStream;
     IHXPlayer*                  m_pPlayer;
@@ -254,10 +258,8 @@
     CRendererStatisticsDisplay* m_pSourceStats;
     CRendererStatisticsDisplay* m_pRendererStats;
     CRendererStatisticsDisplay* m_pMetaDataStats;
-
-    // Methods the derived class must override
-    STDMETHOD(GetDescription) (THIS_ REF(const char*) rpszDescription) PURE;
-    STDMETHOD(GetMimeType)    (THIS_ REF(const char**) rppszMimeType) PURE;
+    const char*                 m_pszDescription;
+    const char*                 m_ppszMimeType[2];
 private:
     IHXScheduler*               m_pScheduler;
     CHXGenericCallback*         m_pCallback;

Index: base_playlist_fileformat.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/base_playlist_fileformat.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- base_playlist_fileformat.h	25 Apr 2006 16:56:40 -0000	1.1
+++ base_playlist_fileformat.h	16 May 2006 14:07:01 -0000	1.2
@@ -58,6 +58,11 @@
 public:
     CBaseHostedPlaylistEnabledFileFormat();
     virtual ~CBaseHostedPlaylistEnabledFileFormat() {}
+
+    // CBaseHostedPlaylistEnabledFileFormat methods
+    STDMETHOD(Configure) (THIS_ IHXGuestPlayerCreator* pCreator);
+    // CBaseHostedPlaylistEnabledFileFormat static methods
+    static HX_RESULT STDAPICALLTYPE HXCreatePlaylistHostInstance(IHXGuestPlayerCreator* pCreator, IUnknown** ppUnk);
 protected:
     HXBOOL m_bCreatedGuestPlayer;
     UINT32 m_ulPersistentVersion;

Index: base_hosted_fileformat.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/base_hosted_fileformat.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- base_hosted_fileformat.h	5 May 2006 13:46:03 -0000	1.2
+++ base_hosted_fileformat.h	16 May 2006 14:07:01 -0000	1.3
@@ -60,7 +60,6 @@
 #include "baseobj.h"
 
 // Forward declarations
-typedef _INTERFACE IHXErrorMessages;
 class CHXGenericCallback;
 
 
@@ -95,7 +94,7 @@
     // IHXFileFormatObject methods
     STDMETHOD(GetFileFormatInfo) (THIS_ REF(const char**) rppszFileMimeTypes,
                                         REF(const char**) rppszFileExtensions,
-                                        REF(const char**) rppszFileOpenNames) PURE;
+                                        REF(const char**) rppszFileOpenNames);
     STDMETHOD(InitFileFormat)    (THIS_ IHXRequest*        pRequest,
                                         IHXFormatResponse* pFormatResponse,
                                         IHXFileObject*     pFileObject);
@@ -118,7 +117,10 @@
     STDMETHOD(PlayerError)       (THIS_ HX_RESULT status, IHXBuffer* pErrStr);
 
     // CBaseHostedFileFormat methods
-    void CallbackFunc();
+    STDMETHOD(Configure) (THIS_ IHXGuestPlayerCreator* pCreator);
+    void                 CallbackFunc();
+    // CBaseHostedFileFormat static methods
+    static HX_RESULT STDAPICALLTYPE HXCreateHostInstance(IHXGuestPlayerCreator* pCreator, IUnknown** ppUnk);
 protected:
     enum
     {
@@ -132,24 +134,26 @@
     };
 
     // Member variables the derived class has access to
-    INT32                 m_lRefCount;
-    IUnknown*             m_pContext;
-    IHXErrorMessages*     m_pErrorMessages;
-    IHXRequest*           m_pRequest;
-    IHXFormatResponse*    m_pFormatResponse;
-    IHXGuestPlayer*       m_pGuestPlayer;
-    IHXValues*            m_pMetaData;
-    UINT32                m_ulState;
-    UINT32                m_ulParentRegistryID;
-    UINT32                m_ulGuestPlayerState;
-    HXBOOL                m_bAddedResponse;
-    HXBOOL                m_bCanGetMetaData;
+    INT32                  m_lRefCount;
+    IHXGuestPlayerCreator* m_pGuestPlayerCreator;
+    IUnknown*              m_pContext;
+    IHXErrorMessages*      m_pErrorMessages;
+    IHXRequest*            m_pRequest;
+    IHXFormatResponse*     m_pFormatResponse;
+    IHXGuestPlayer*        m_pGuestPlayer;
+    IHXValues*             m_pMetaData;
+    UINT32                 m_ulState;
+    UINT32                 m_ulParentRegistryID;
+    UINT32                 m_ulGuestPlayerState;
+    HXBOOL                 m_bAddedResponse;
+    HXBOOL                 m_bCanGetMetaData;
+    const char*            m_pszDescription;
+    const char**           m_ppszFileMimeTypes;
+    const char**           m_ppszFileExtensions;
+    const char**           m_ppszFileOpenNames;
+    const char**           m_ppszSchemeExtInfo;
+    const char*            m_pszMimeType;
 
-    // Methods the derived class must implement
-    STDMETHOD(GetDescription)         (THIS_ REF(const char*) rpszDescription) PURE;
-    STDMETHOD(CreateGuestPlayer)      (THIS_ REF(IHXGuestPlayer*) rpPlayer) PURE;
-    STDMETHOD(GetMimeType)            (THIS_ REF(const char*) rpszMimeType) PURE;
-    STDMETHOD(GetSchemeExtensionInfo) (THIS_ REF(const char**) rpszSchemeExtInfo) PURE;
     // For media engines that don't support meta-files (such as Flash),
     // this method will simply call CreateGuestEngine(). For media engines
     // that support meta-files (such as Windows Media Player), then


From ehyche at helixcommunity.org  Tue May 16 07:07:03 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue May 16 08:57:05 2006
Subject: [Datatype-cvs] common/basehost base_hosted_factory.cpp, NONE,
	1.1 Umakefil, 1.1, 1.2 base_hosted_fileformat.cpp, 1.1,
	1.2 base_hosted_renderer.cpp, 1.1,
	1.2 base_playlist_fileformat.cpp, 1.1,
	1.2 base_playlist_renderer.cpp, 1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/common/basehost
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv20483

Modified Files:
	Umakefil base_hosted_fileformat.cpp base_hosted_renderer.cpp 
	base_playlist_fileformat.cpp base_playlist_renderer.cpp 
Added Files:
	base_hosted_factory.cpp 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Milko Boic (milko@real.com)

Description
----------------------------------------
In the *current* guest player code, a new implementor
of an IHXGuestPlayer would have to not only implement
IHXGuestPlayer, but would also have to:

  1) derive from the base file format
  2) derive from the base renderer
  3) (possibly) derive from the base playlist file format
  4) (possibly) derive from the base playlist renderer
  5) (optionally) package all of these plugins together
     into a plugin factory

Although the code in each of these items is small,
it still is a non-trivial task to get all of these
plugins working together. This change dramatically simplifies
this task, and reduces the above 5 tasks down to
just specifying two macros.

The reason that previously this was so distributed
is that the file format and renderer plugins have to
be able to provide the information on what file extensions,
schemes, stream mime types, etc. that they want to claim.
This information logically would reside in the guest player
itself, but it is these plugins that must create and
own the guest player. Therefore, we previously had
to derive from the base plugins. The dervied plugins
would simply provide these values of claimed 
extensions, schemes, etc.

Now this information has been centralized into
a IHXGuestPlayerCreator interface which is implemented
by the base factory (the base factory is also new, and
it takes care of the IHXPluginFactory implementation
for the guest player.

So now, the implementor of a guest player now
only has to use the following two macros:

DECLARE_GUEST_FACTORY_WITH_PLAYLISTS(class_name)
DEFINE_GUEST_FACTORY_WITH_PLAYLISTS(class_name, ...)

In the DEFINE_xxx macro, the user provides all the 
strings that the guest player wants to claim.



Index: base_playlist_renderer.cpp
===================================================================
RCS file: /cvsroot/datatype/common/basehost/base_playlist_renderer.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- base_playlist_renderer.cpp	25 Apr 2006 16:56:40 -0000	1.1
+++ base_playlist_renderer.cpp	16 May 2006 14:06:57 -0000	1.2
@@ -73,6 +73,7 @@
 
 CBaseHostedPlaylistRenderer::CBaseHostedPlaylistRenderer()
     : m_lRefCount(0)
+    , m_pGuestPlayerCreator(NULL)
     , m_pContext(NULL)
     , m_pStream(NULL)
     , m_pPlayer(NULL)
@@ -99,10 +100,13 @@
     , m_bAddedResponse(FALSE)
     , m_bFirstTrack(TRUE)
     , m_ulGuestPlayerState(HXGUEST_NUM_PLAYER_STATES) // invalid state
+    , m_pszDescription(NULL)
     , m_pScheduler(NULL)
     , m_pCallback(NULL)
 {
     HXLOGL2(HXLOG_HOST, "Construct CBaseHostedPlaylistRenderer this=%p");
+    m_ppszMimeType[0] = NULL;
+    m_ppszMimeType[1] = NULL;
 }
 
 CBaseHostedPlaylistRenderer::~CBaseHostedPlaylistRenderer()
@@ -168,20 +172,28 @@
 }
 
 STDMETHODIMP CBaseHostedPlaylistRenderer::GetPluginInfo(REF(HXBOOL)      rbLoadMultiple,
-                                                    REF(const char*) rpszDescription,
-                                                    REF(const char*) rpszCopyright,
-                                                    REF(const char*) rpszMoreInfoURL,
-                                                    REF(ULONG32)     rulVersionNumber)
+                                                        REF(const char*) rpszDescription,
+                                                        REF(const char*) rpszCopyright,
+                                                        REF(const char*) rpszMoreInfoURL,
+                                                        REF(ULONG32)     rulVersionNumber)
 {
-    HX_RESULT retVal = HXR_OK;
+    HX_RESULT retVal = HXR_FAIL;
 
+    // Assume we have a description from our Configure() call
+    HX_ASSERT(m_pszDescription);
     // Set up the properties common to all derived renderers
     rbLoadMultiple   = TRUE;
     rpszCopyright    = (const char*) m_pszCopyright;
     rpszMoreInfoURL  = (const char*) m_pszMoreInfoURL;
     rulVersionNumber = TARVER_ULONG32_VERSION;
-    // Get the description string from the derived renderer
-    retVal = GetDescription(rpszDescription);
+    // Do we have a description?
+    if (m_pszDescription)
+    {
+        // Assign the description out parameter
+        rpszDescription = m_pszDescription;
+        // Clear the return value
+        retVal = HXR_OK;
+    }
 
     return retVal;
 }
@@ -227,12 +239,24 @@
 }
 
 STDMETHODIMP CBaseHostedPlaylistRenderer::GetRendererInfo(REF(const char**) rppszStreamMimeType,
-                                                      REF(UINT32)       rulInitialGranularity)
+                                                          REF(UINT32)       rulInitialGranularity)
 {
+    HX_RESULT retVal = HXR_FAIL;
+
+    // Assume we have a mime type from our Configure call
+    HX_ASSERT(m_ppszMimeType[0] != NULL);
     // Set the initial granularity
-    rulInitialGranularity = 0;
-    // Get the stream mime type from the guest
-    return GetMimeType(rppszStreamMimeType);
+    rulInitialGranularity = 100; // 100 ms for playlist renderer is adequate
+    // Do we have a mime type?
+    if (m_ppszMimeType[0])
+    {
+        // Assign the mime type array out parameter
+        rppszStreamMimeType = &m_ppszMimeType[0];
+        // Clear the return value
+        retVal = HXR_OK;
+    }
+
+    return retVal;
 }
 
 STDMETHODIMP CBaseHostedPlaylistRenderer::StartStream(IHXStream* pStream, IHXPlayer* pPlayer)
@@ -516,8 +540,8 @@
 
     if (pTrack)
     {
-        // Create an ASXPlayToAssoc struct
-        ASXPlayToAssoc* pPlayTo = new ASXPlayToAssoc;
+        // Create an HXPlayToAssoc struct
+        HXPlayToAssoc* pPlayTo = new HXPlayToAssoc;
         if (pPlayTo)
         {
             // Initialize the struct
@@ -552,7 +576,7 @@
             }
             if (m_pPlayToAssocList)
             {
-                // Add this ASXPlayToAssoc struct to the list
+                // Add this HXPlayToAssoc struct to the list
                 m_pPlayToAssocList->AddTail((void*) pPlayTo);
                 // Clear the return value
                 retVal = HXR_OK;
@@ -628,8 +652,8 @@
 
     if (m_elementWithinTag == WithinSeqInPar && !bIsLive)
     {
-        // Look up the ASXPlayToAssoc struct
-        ASXPlayToAssoc* pPlayTo = GetPlayToAssoc((UINT16) ulGroupIndex, (UINT16) ulTrackIndex);
+        // Look up the HXPlayToAssoc struct
+        HXPlayToAssoc* pPlayTo = GetPlayToAssoc((UINT16) ulGroupIndex, (UINT16) ulTrackIndex);
         if (pPlayTo && m_pTrackMap)
         {
             // m_id is in the format of "_"
@@ -714,7 +738,7 @@
     HX_RESULT           rc = HXR_OK;
     HXBOOL              bIsWindowed = FALSE;
     HX_DISPLAY_TYPE     ulFlags = HX_DISPLAY_NONE;
-    ASXPlayToAssoc*     pPlayToAssoc = NULL;
+    HXPlayToAssoc*      pPlayToAssoc = NULL;
     IHXBuffer*          pBuffer = NULL;
 
     UINT32              ulGroupIndex = 0;
@@ -814,7 +838,7 @@
                                                            REF(IHXValues*) pProperties)
 {
     HX_RESULT           rc = HXR_OK;
-    ASXPlayToAssoc*     pPlayToAssoc = NULL;
+    HXPlayToAssoc*      pPlayToAssoc = NULL;
     ElementWithinTag    elementWithinTag = WithinUnknown;
     
     rc = CreateValuesCCF(pProperties, m_pContext);
@@ -946,22 +970,75 @@
     return HXR_OK;
 }
 
+STDMETHODIMP CBaseHostedPlaylistRenderer::Configure(IHXGuestPlayerCreator* pCreator)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pCreator)
+    {
+        // Save the creator interface
+        HX_RELEASE(m_pGuestPlayerCreator);
+        m_pGuestPlayerCreator = pCreator;
+        m_pGuestPlayerCreator->AddRef();
+        // Get the plugin info about the media format
+        const char** ppszTmp = NULL;
+        retVal = m_pGuestPlayerCreator->GetPlaylistFormatInfo(m_pszDescription,
+                                                              ppszTmp,
+                                                              ppszTmp,
+                                                              ppszTmp,
+                                                              ppszTmp,
+                                                              m_ppszMimeType[0]);
+    }
+
+    return retVal;
+}
+
 void CBaseHostedPlaylistRenderer::CallbackFunc()
 {
     HXLOGL4(HXLOG_HOST, "CBaseHostedPlaylistRenderer::CallbackFunc()");
 }
 
-ASXPlayToAssoc* CBaseHostedPlaylistRenderer::GetPlayToAssocByMedia(const char* pszMediaID)
+HX_RESULT STDAPICALLTYPE CBaseHostedPlaylistRenderer::HXCreateHostInstance(IHXGuestPlayerCreator* pCreator, IUnknown** ppIUnknown)
 {
-    ASXPlayToAssoc* pPlayToAssoc = NULL;
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (ppIUnknown)
+    {
+        // Set default
+        *ppIUnknown = NULL;
+        // Create the object
+        CBaseHostedPlaylistRenderer* pObj = new CBaseHostedPlaylistRenderer();
+        if (pObj)
+        {
+            // QI for IUnknown
+            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);
+            if (SUCCEEDED(retVal))
+            {
+                // Configure the CBaseHostedPlaylistRenderer with
+                // the IHXGuestPlayerCreator interface
+                retVal = pObj->Configure(pCreator);
+            }
+        }
+        if (FAILED(retVal))
+        {
+            HX_DELETE(pObj);
+        }
+    }
+
+    return retVal;
+}
+
+HXPlayToAssoc* CBaseHostedPlaylistRenderer::GetPlayToAssocByMedia(const char* pszMediaID)
+{
+    HXPlayToAssoc* pPlayToAssoc = NULL;
 
     if (pszMediaID && m_pPlayToAssocList)
     {
         LISTPOSITION pos = m_pPlayToAssocList->GetHeadPosition();
         while (pos)
         {
-            ASXPlayToAssoc* pListMember =
-                (ASXPlayToAssoc*) m_pPlayToAssocList->GetNext(pos);
+            HXPlayToAssoc* pListMember =
+                (HXPlayToAssoc*) m_pPlayToAssocList->GetNext(pos);
             if (pListMember && pListMember->m_id == pszMediaID)
             {
                 pPlayToAssoc = pListMember;
@@ -973,16 +1050,16 @@
      return pPlayToAssoc;
 }
 
-ASXPlayToAssoc* CBaseHostedPlaylistRenderer::GetPlayToAssoc(UINT16 usGroupIndex, UINT16 usTrackIndex)
+HXPlayToAssoc* CBaseHostedPlaylistRenderer::GetPlayToAssoc(UINT16 usGroupIndex, UINT16 usTrackIndex)
 {
-    ASXPlayToAssoc* pRet = NULL;
+    HXPlayToAssoc* pRet = NULL;
 
     if(m_pPlayToAssocList && m_pPlayToAssocList->GetCount() > 0)
     {
         LISTPOSITION pos = m_pPlayToAssocList->GetHeadPosition();
         while (pos)
         {
-            ASXPlayToAssoc* pPlayTo = (ASXPlayToAssoc*) m_pPlayToAssocList->GetNext(pos);
+            HXPlayToAssoc* pPlayTo = (HXPlayToAssoc*) m_pPlayToAssocList->GetNext(pos);
             if (pPlayTo &&
                 pPlayTo->m_uGroupIndex == usGroupIndex &&
                 pPlayTo->m_uTrackIndex == usTrackIndex)
@@ -1017,6 +1094,7 @@
     HX_RELEASE(m_pStream);
     HX_RELEASE(m_pPlayer);
     HX_RELEASE(m_pOriginalURL);
+    HX_RELEASE(m_pGuestPlayerCreator);
     HX_VECTOR_DELETE(m_pszURLFragment);
 }
 
@@ -1040,7 +1118,7 @@
     {
         while (m_pPlayToAssocList->GetCount() > 0)
         {
-            ASXPlayToAssoc* pPlayTo = (ASXPlayToAssoc*) m_pPlayToAssocList->RemoveHead();
+            HXPlayToAssoc* pPlayTo = (HXPlayToAssoc*) m_pPlayToAssocList->RemoveHead();
             HX_DELETE(pPlayTo);
         }
     }

Index: base_hosted_renderer.cpp
===================================================================
RCS file: /cvsroot/datatype/common/basehost/base_hosted_renderer.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- base_hosted_renderer.cpp	25 Apr 2006 16:56:40 -0000	1.1
+++ base_hosted_renderer.cpp	16 May 2006 14:06:57 -0000	1.2
@@ -109,6 +109,7 @@
 
 CBaseHostedRenderer::CBaseHostedRenderer()
     : m_lRefCount(0)
+    , m_pGuestPlayerCreator(NULL)
     , m_pContext(NULL)
     , m_pStream(NULL)
     , m_pPlayer(NULL)
@@ -140,12 +141,15 @@
     , m_pSourceStats(NULL)
     , m_pRendererStats(NULL)
     , m_pMetaDataStats(NULL)
+    , m_pszDescription(NULL)
     , m_pScheduler(NULL)
     , m_pCallback(NULL)
 {
     HXLOGL2(HXLOG_HOST, "Construct CBaseHostedRenderer this=%p");
     m_MediaSize.cx = 0;
     m_MediaSize.cy = 0;
+    m_ppszMimeType[0] = NULL;
+    m_ppszMimeType[1] = NULL;
 }
 
 CBaseHostedRenderer::~CBaseHostedRenderer()
@@ -159,6 +163,7 @@
     HX_RELEASE(m_pCallback);
     HX_RELEASE(m_pScheduler);
     HX_RELEASE(m_pContext);
+    HX_RELEASE(m_pGuestPlayerCreator);
     HX_RELEASE(m_pStream);
     HX_RELEASE(m_pPlayer);
     HX_RELEASE(m_pStreamHeader);
@@ -220,15 +225,23 @@
                                                 REF(const char*) rpszMoreInfoURL,
                                                 REF(ULONG32)     rulVersionNumber)
 {
-    HX_RESULT retVal = HXR_OK;
+    HX_RESULT retVal = HXR_FAIL;
 
+    // Assume we have a description from our Configure() call
+    HX_ASSERT(m_pszDescription);
     // Set up the properties common to all derived renderers
     rbLoadMultiple   = TRUE;
     rpszCopyright    = (const char*) m_pszCopyright;
     rpszMoreInfoURL  = (const char*) m_pszMoreInfoURL;
     rulVersionNumber = TARVER_ULONG32_VERSION;
-    // Get the description string from the derived renderer
-    retVal = GetDescription(rpszDescription);
+    // Do we have a description?
+    if (m_pszDescription)
+    {
+        // Assign the description out parameter
+        rpszDescription = m_pszDescription;
+        // Clear the return value
+        retVal = HXR_OK;
+    }
 
     return retVal;
 }
@@ -276,10 +289,22 @@
 STDMETHODIMP CBaseHostedRenderer::GetRendererInfo(REF(const char**) rppszStreamMimeType,
                                                   REF(UINT32)       rulInitialGranularity)
 {
+    HX_RESULT retVal = HXR_FAIL;
+
+    // Assume we have a mime type from our Configure call
+    HX_ASSERT(m_ppszMimeType[0] != NULL);
     // Set the initial granularity
     rulInitialGranularity = HXHOST_INITIAL_GRANULARITY;
-    // Get the stream mime type from the guest
-    return GetMimeType(rppszStreamMimeType);
+    // Do we have a mime type?
+    if (m_ppszMimeType[0])
+    {
+        // Assign the mime type array out parameter
+        rppszStreamMimeType = &m_ppszMimeType[0];
+        // Clear the return value
+        retVal = HXR_OK;
+    }
+
+    return retVal;
 }
 
 STDMETHODIMP CBaseHostedRenderer::StartStream(IHXStream* pStream, IHXPlayer* pPlayer)
@@ -1083,6 +1108,29 @@
     return HXR_OK;
 }
 
+STDMETHODIMP CBaseHostedRenderer::Configure(IHXGuestPlayerCreator* pCreator)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pCreator)
+    {
+        // Save the creator interface
+        HX_RELEASE(m_pGuestPlayerCreator);
+        m_pGuestPlayerCreator = pCreator;
+        m_pGuestPlayerCreator->AddRef();
+        // Get the plugin info about the media format
+        const char** ppszTmp = NULL;
+        retVal = m_pGuestPlayerCreator->GetFormatInfo(m_pszDescription,
+                                                      ppszTmp,
+                                                      ppszTmp,
+                                                      ppszTmp,
+                                                      ppszTmp,
+                                                      m_ppszMimeType[0]);
+    }
+
+    return retVal;
+}
+
 void CBaseHostedRenderer::CallbackFunc()
 {
     HXLOGL4(HXLOG_HOST, "CBaseHostedRenderer::CallbackFunc()");
@@ -1092,6 +1140,36 @@
     ChangeHelixBuffering(m_bCallbackSetBuffering);
 }
 
+HX_RESULT STDAPICALLTYPE CBaseHostedRenderer::HXCreateHostInstance(IHXGuestPlayerCreator* pCreator, IUnknown** ppIUnknown)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (ppIUnknown)
+    {
+        // Set default
+        *ppIUnknown = NULL;
+        // Create the object
+        CBaseHostedRenderer* pObj = new CBaseHostedRenderer();
+        if (pObj)
+        {
+            // QI for IUnknown
+            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);
+            if (SUCCEEDED(retVal))
+            {
+                // Configure the CBaseHostedRenderer with
+                // the IHXGuestPlayerCreator interface
+                retVal = pObj->Configure(pCreator);
+            }
+        }
+        if (FAILED(retVal))
+        {
+            HX_DELETE(pObj);
+        }
+    }
+
+    return retVal;
+}
+
 HX_RESULT CBaseHostedRenderer::GetParentRegistryID(UINT32 ulRegID, REF(UINT32) rulParentRegID)
 {
     HX_RESULT retVal = HXR_UNEXPECTED;

--- NEW FILE: base_hosted_factory.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#include "hxtypes.h"
#include "hxcom.h"
#include "base_hosted_factory.h"
#include "base_hosted_fileformat.h"
#include "base_hosted_renderer.h"
#include "base_playlist_fileformat.h"
#include "base_playlist_renderer.h"


HX_RESULT (STDAPICALLTYPE* CHXBaseHostedPluginFactory::m_fpCreateInstanceArray[])(IHXGuestPlayerCreator*,IUnknown**) =
{
    CBaseHostedFileFormat::HXCreateHostInstance,
    CBaseHostedRenderer::HXCreateHostInstance,
    CBaseHostedPlaylistEnabledFileFormat::HXCreatePlaylistHostInstance,
    CBaseHostedPlaylistRenderer::HXCreateHostInstance,
    NULL
};

CHXBaseHostedPluginFactory::CHXBaseHostedPluginFactory()
    : m_lRefCount(0)
    , m_usNumPlugins(0)
{
}

STDMETHODIMP CHXBaseHostedPluginFactory::QueryInterface(REFIID riid, void** ppvObj)
{
    QInterfaceList qiList[] =
    {
        {GET_IIDHANDLE(IID_IUnknown),              (IUnknown*)(IHXPluginFactory*) this},
        {GET_IIDHANDLE(IID_IHXPluginFactory),      (IHXPluginFactory*)            this},
        {GET_IIDHANDLE(IID_IHXGuestPlayerCreator), (IHXGuestPlayerCreator*)       this}
    };

    return QIFind(qiList, QILISTSIZE(qiList), riid, ppvObj);
}

STDMETHODIMP_(ULONG32) CHXBaseHostedPluginFactory::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

STDMETHODIMP_(ULONG32) CHXBaseHostedPluginFactory::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}


STDMETHODIMP_(UINT16) CHXBaseHostedPluginFactory::GetNumPlugins()
{
    return m_usNumPlugins;
}

STDMETHODIMP CHXBaseHostedPluginFactory::GetPlugin(UINT16 usIndex, IUnknown** ppPlugin)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppPlugin && usIndex < m_usNumPlugins)
    {
        // Get our own IHXGuestPlayerCreator interface
        IHXGuestPlayerCreator* pCreator = NULL;
        retVal = QueryInterface(IID_IHXGuestPlayerCreator, (void**) &pCreator);
        if (SUCCEEDED(retVal))
        {
            retVal = m_fpCreateInstanceArray[usIndex](pCreator, ppPlugin);
        }
        HX_RELEASE(pCreator);
    }

    return retVal;
}

STDMETHODIMP CHXBaseHostedPluginFactory::Init()
{
    // Assume that this is called right after creation
    HX_ASSERT(m_usNumPlugins == 0);

    if (!m_usNumPlugins)
    {
        const char*  pszTmp  = NULL;
        const char** ppszTmp = NULL;
        HX_RESULT rv = GetFormatInfo(pszTmp, ppszTmp, ppszTmp,
                                        ppszTmp, ppszTmp, pszTmp);
        if (SUCCEEDED(rv))
        {
            // We should provide the media file format and media renderer
            m_usNumPlugins += 2;
        }
        rv = GetPlaylistFormatInfo(pszTmp, ppszTmp, ppszTmp,
                                    ppszTmp, ppszTmp, pszTmp);
        if (SUCCEEDED(rv))
        {
            // We should provide the playlist file format and playlist renderer
            m_usNumPlugins += 2;
        }
    }

    return HXR_OK;
}

Index: base_playlist_fileformat.cpp
===================================================================
RCS file: /cvsroot/datatype/common/basehost/base_playlist_fileformat.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- base_playlist_fileformat.cpp	25 Apr 2006 16:56:40 -0000	1.1
+++ base_playlist_fileformat.cpp	16 May 2006 14:06:57 -0000	1.2
@@ -63,10 +63,63 @@
 {
 }
 
+STDMETHODIMP CBaseHostedPlaylistEnabledFileFormat::Configure(IHXGuestPlayerCreator* pCreator)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pCreator)
+    {
+        // Save the creator interface
+        HX_RELEASE(m_pGuestPlayerCreator);
+        m_pGuestPlayerCreator = pCreator;
+        m_pGuestPlayerCreator->AddRef();
+        // Get the plugin info about the playlist format
+        retVal = m_pGuestPlayerCreator->GetPlaylistFormatInfo(m_pszDescription,
+                                                              m_ppszFileMimeTypes,
+                                                              m_ppszFileExtensions,
+                                                              m_ppszFileOpenNames,
+                                                              m_ppszSchemeExtInfo,
+                                                              m_pszMimeType);
+    }
+
+    return retVal;
+}
+
+HX_RESULT STDAPICALLTYPE CBaseHostedPlaylistEnabledFileFormat::HXCreatePlaylistHostInstance(IHXGuestPlayerCreator* pCreator, IUnknown** ppIUnknown)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (ppIUnknown)
+    {
+        // Set default
+        *ppIUnknown = NULL;
+        // Create the object
+        CBaseHostedPlaylistEnabledFileFormat* pObj = new CBaseHostedPlaylistEnabledFileFormat();
+        if (pObj)
+        {
+            // QI for IUnknown
+            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);
+            if (SUCCEEDED(retVal))
+            {
+                // Configure the CBaseHostedPlaylistEnabledFileFormat with
+                // the IHXGuestPlayerCreator interface
+                retVal = pObj->Configure(pCreator);
+            }
+        }
+        if (FAILED(retVal))
+        {
+            HX_DELETE(pObj);
+        }
+    }
+
+    return retVal;
+}
+
 STDMETHODIMP CBaseHostedPlaylistEnabledFileFormat::GetGuestEngineInstance(REF(IHXGuestPlayer*) rpPlayer)
 {
     HX_RESULT retVal = HXR_FAIL;
 
+    // Assume the out parameter is initially NULL
     HX_ASSERT(rpPlayer == NULL);
 
     if (m_pContext)
@@ -128,7 +181,7 @@
                 // we should just create the player rather than
                 // just finding another component from whom we can get
                 // a reference to it.
-                retVal = CreateGuestPlayer(rpPlayer);
+                retVal = CBaseHostedFileFormat::GetGuestEngineInstance(rpPlayer);
                 if (SUCCEEDED(retVal))
                 {
                     // Set the flag saying we were the object that

Index: base_hosted_fileformat.cpp
===================================================================
RCS file: /cvsroot/datatype/common/basehost/base_hosted_fileformat.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- base_hosted_fileformat.cpp	25 Apr 2006 16:56:40 -0000	1.1
+++ base_hosted_fileformat.cpp	16 May 2006 14:06:57 -0000	1.2
@@ -66,6 +66,7 @@
 
 CBaseHostedFileFormat::CBaseHostedFileFormat()
     : m_lRefCount(0)
+    , m_pGuestPlayerCreator(NULL)
     , m_pContext(NULL)
     , m_pErrorMessages(NULL)
     , m_pRequest(NULL)
@@ -77,6 +78,12 @@
     , m_ulGuestPlayerState(HXGUEST_NUM_PLAYER_STATES) // Invalid state
     , m_bAddedResponse(FALSE)
     , m_bCanGetMetaData(FALSE)
+    , m_pszDescription(NULL)
+    , m_ppszFileMimeTypes(NULL)
+    , m_ppszFileExtensions(NULL)
+    , m_ppszFileOpenNames(NULL)
+    , m_ppszSchemeExtInfo(NULL)
+    , m_pszMimeType(NULL)
     , m_pNetworkConfig(NULL)
     , m_pCallback(NULL)
     , m_pScheduler(NULL)
@@ -140,15 +147,23 @@
                                                   REF(const char*) rpszMoreInfoURL,
                                                   REF(ULONG32)     rulVersionNumber)
 {
-    HX_RESULT retVal = HXR_OK;
+    HX_RESULT retVal = HXR_FAIL;
 
-    // Set up the properties common to all derived renderers
+    // Assume we have a description
+    HX_ASSERT(m_pszDescription != NULL);
+    // Set up the common properties
     rbLoadMultiple   = TRUE;
     rpszCopyright    = (const char*) m_pszCopyright;
     rpszMoreInfoURL  = (const char*) m_pszMoreInfoURL;
     rulVersionNumber = TARVER_ULONG32_VERSION;
-    // Get the description string from the derived renderer
-    retVal = GetDescription(rpszDescription);
+    // Do we have a description from our Configure() call?
+    if (m_pszDescription)
+    {
+        // Yes we have a description, so set it
+        rpszDescription  = m_pszDescription;
+        // Clear the return value
+        retVal = HXR_OK;
+    }
 
     return retVal;
 }
@@ -182,36 +197,33 @@
 {
     HX_RESULT retVal = HXR_UNEXPECTED;
 
+    // Assume the out parameter is initially NULL
     HX_ASSERT(rpProps == NULL);
+    // Assume that we have the scheme/extention pair info
+    HX_ASSERT(m_ppszSchemeExtInfo != NULL);
 
-    if (m_pContext)
+    if (m_pContext && m_ppszSchemeExtInfo)
     {
         // Create an IHXValues
         IHXValues* pProps = NULL;
         retVal = CreateValuesCCF(pProps, m_pContext);
         if (SUCCEEDED(retVal))
         {
-            // Get the scheme/extension info from the derived fileformat
-            const char** ppszSchemeExtInfo = NULL;
-            retVal = GetSchemeExtensionInfo(ppszSchemeExtInfo);
+            // Combine the separate strings into one string
+            IHXBuffer* pBuffer = NULL;
+            retVal = CatStringsCCF(pBuffer, m_ppszSchemeExtInfo, "|", m_pContext);
             if (SUCCEEDED(retVal))
             {
-                // Combine the separate strings into one string
-                IHXBuffer* pBuffer = NULL;
-                retVal = CatStringsCCF(pBuffer, ppszSchemeExtInfo, "|", m_pContext);
+                // Set the PLUGIN_SCHEME_EXTENSION property
+                retVal = pProps->SetPropertyCString(PLUGIN_SCHEME_EXTENSION, pBuffer);
                 if (SUCCEEDED(retVal))
                 {
-                    // Set the PLUGIN_SCHEME_EXTENSION property
-                    retVal = pProps->SetPropertyCString(PLUGIN_SCHEME_EXTENSION, pBuffer);
-                    if (SUCCEEDED(retVal))
-                    {
-                        // Copy the out parameter
-                        rpProps = pProps;
-                        rpProps->AddRef();
-                    }
+                    // Copy the out parameter
+                    rpProps = pProps;
+                    rpProps->AddRef();
                 }
-                HX_RELEASE(pBuffer);
             }
+            HX_RELEASE(pBuffer);
         }
         HX_RELEASE(pProps);
     }
@@ -219,6 +231,29 @@
     return retVal;
 }
 
+STDMETHODIMP CBaseHostedFileFormat::GetFileFormatInfo(REF(const char**) rppszFileMimeTypes,
+                                                      REF(const char**) rppszFileExtensions,
+                                                      REF(const char**) rppszFileOpenNames)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    // Assume we have already received the file format
+    // info from our Configure() call
+    HX_ASSERT(m_ppszFileMimeTypes && m_ppszFileExtensions && m_ppszFileOpenNames);
+
+    if (m_ppszFileMimeTypes && m_ppszFileExtensions && m_ppszFileOpenNames)
+    {
+        // Return the file format info
+        rppszFileMimeTypes  = m_ppszFileMimeTypes;
+        rppszFileExtensions = m_ppszFileExtensions;
+        rppszFileOpenNames  = rppszFileOpenNames;
+        // Clear the return value
+        retVal = HXR_OK;
+    }
+
+    return retVal;
+}
+
 STDMETHODIMP CBaseHostedFileFormat::InitFileFormat(IHXRequest*        pRequest,
                                                    IHXFormatResponse* pFormatResponse,
                                                    IHXFileObject*     pFileObject)
@@ -315,6 +350,9 @@
                         //
                         // Set the state
                         m_ulState = kStatePlaylistReadyPending;
+                        // If we open the player, then we should
+                        // be able to get meta-data
+                        m_bCanGetMetaData = TRUE;
                         // Open the guest player
                         retVal = m_pGuestPlayer->Open(m_pRequest);
                     }
@@ -430,6 +468,7 @@
     HX_RELEASE(m_pMetaData);
     HX_RELEASE(m_pNetworkConfig);
     HX_RELEASE(m_pScheduler);
+    HX_RELEASE(m_pGuestPlayerCreator);
 
     m_ulState            = kStateCreated;
     m_ulParentRegistryID = 0;
@@ -491,7 +530,10 @@
     HXLOGL2(HXLOG_HOST, "GetStreamHeader(%u)", unStreamNumber);
     HX_RESULT retVal = HXR_UNEXPECTED;
 
-    if (m_ulState == kStateFileHeaderSent)
+    // Assume we have a mime type
+    HX_ASSERT(m_pszMimeType);
+
+    if (m_ulState == kStateFileHeaderSent && m_pszMimeType)
     {
         // Create an IHXValues
         IHXValues* pHdr = NULL;
@@ -551,24 +593,18 @@
             }
             if (SUCCEEDED(retVal))
             {
-                // Get the stream mime type from the guest
-                const char* pszStreamMimeType = NULL;
-                retVal = GetMimeType(pszStreamMimeType);
+                // Use the first mime type provided
+                retVal = SetCStringPropertyCCF(pHdr, "MimeType", m_pszMimeType, m_pContext);
                 if (SUCCEEDED(retVal))
                 {
-                    // Use the first mime type provided
-                    retVal = SetCStringPropertyCCF(pHdr, "MimeType", pszStreamMimeType, m_pContext);
+                    // Add any playlist-related properties
+                    retVal = AddPlaylistRelatedProperties(pHdr);
                     if (SUCCEEDED(retVal))
                     {
-                        // Add any playlist-related properties
-                        retVal = AddPlaylistRelatedProperties(pHdr);
-                        if (SUCCEEDED(retVal))
-                        {
-                            // Set the state
-                            m_ulState = kStateStreamHeaderSent;
-                            // Pass the stream header to the response interface
-                            m_pFormatResponse->StreamHeaderReady(retVal, pHdr);
-                        }
+                        // Set the state
+                        m_ulState = kStateStreamHeaderSent;
+                        // Pass the stream header to the response interface
+                        m_pFormatResponse->StreamHeaderReady(retVal, pHdr);
                     }
                 }
             }
@@ -709,6 +745,28 @@
     return HXR_OK;
 }
 
+STDMETHODIMP CBaseHostedFileFormat::Configure(IHXGuestPlayerCreator* pCreator)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pCreator)
+    {
+        // Save the creator interface
+        HX_RELEASE(m_pGuestPlayerCreator);
+        m_pGuestPlayerCreator = pCreator;
+        m_pGuestPlayerCreator->AddRef();
+        // Get the plugin info about the media format
+        retVal = m_pGuestPlayerCreator->GetFormatInfo(m_pszDescription,
+                                                      m_ppszFileMimeTypes,
+                                                      m_ppszFileExtensions,
+                                                      m_ppszFileOpenNames,
+                                                      m_ppszSchemeExtInfo,
+                                                      m_pszMimeType);
+    }
+
+    return retVal;
+}
+
 void CBaseHostedFileFormat::CallbackFunc()
 {
     HXLOGL4(HXLOG_HOST, "CallbackFunc()");
@@ -721,9 +779,49 @@
     }
 }
 
+HX_RESULT STDAPICALLTYPE CBaseHostedFileFormat::HXCreateHostInstance(IHXGuestPlayerCreator* pCreator, IUnknown** ppIUnknown)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (ppIUnknown)
+    {
+        // Set default
+        *ppIUnknown = NULL;
+        // Create the object
+        CBaseHostedFileFormat* pObj = new CBaseHostedFileFormat();
+        if (pObj)
+        {
+            // QI for IUnknown
+            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);
+            if (SUCCEEDED(retVal))
+            {
+                // Configure the CBaseHostedFileFormat with
+                // the IHXGuestPlayerCreator interface
+                retVal = pObj->Configure(pCreator);
+            }
+        }
+        if (FAILED(retVal))
+        {
+            HX_DELETE(pObj);
+        }
+    }
+
+    return retVal;
+}
+
 STDMETHODIMP CBaseHostedFileFormat::GetGuestEngineInstance(REF(IHXGuestPlayer*) rpPlayer)
 {
-    return CreateGuestPlayer(rpPlayer);
+    HX_RESULT retVal = HXR_FAIL;
+
+    // Assume we have a guest player creator interface
+    HX_ASSERT(m_pGuestPlayerCreator);
+
+    if (m_pGuestPlayerCreator)
+    {
+        retVal = m_pGuestPlayerCreator->CreateGuestPlayer(rpPlayer);
+    }
+
+    return retVal;
 }
 
 STDMETHODIMP CBaseHostedFileFormat::GetRequestHeaderValues(IHXRequest* pRequest)

Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/common/basehost/Umakefil,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Umakefil	25 Apr 2006 16:56:40 -0000	1.1
+++ Umakefil	16 May 2006 14:06:57 -0000	1.2
@@ -64,7 +64,8 @@
 project.AddSources("base_hosted_fileformat.cpp",
                    "base_playlist_fileformat.cpp",
                    "base_hosted_renderer.cpp",
-                   "base_playlist_renderer.cpp")
+                   "base_playlist_renderer.cpp",
+                   "base_hosted_factory.cpp")
 
 LibraryTarget("basehostlib")
 


From ehyche at helixcommunity.org  Tue May 16 07:08:15 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue May 16 08:58:14 2006
Subject: [Datatype-cvs] wm/wmphost wmphostlib_win32.pcf,1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv21776

Modified Files:
	wmphostlib_win32.pcf 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Milko Boic (milko@real.com)

Description
----------------------------------------
In the *current* guest player code, a new implementor
of an IHXGuestPlayer would have to not only implement
IHXGuestPlayer, but would also have to:

  1) derive from the base file format
  2) derive from the base renderer
  3) (possibly) derive from the base playlist file format
  4) (possibly) derive from the base playlist renderer
  5) (optionally) package all of these plugins together
     into a plugin factory

Although the code in each of these items is small,
it still is a non-trivial task to get all of these
plugins working together. This change dramatically simplifies
this task, and reduces the above 5 tasks down to
just specifying two macros.

The reason that previously this was so distributed
is that the file format and renderer plugins have to
be able to provide the information on what file extensions,
schemes, stream mime types, etc. that they want to claim.
This information logically would reside in the guest player
itself, but it is these plugins that must create and
own the guest player. Therefore, we previously had
to derive from the base plugins. The dervied plugins
would simply provide these values of claimed 
extensions, schemes, etc.

Now this information has been centralized into
a IHXGuestPlayerCreator interface which is implemented
by the base factory (the base factory is also new, and
it takes care of the IHXPluginFactory implementation
for the guest player.

So now, the implementor of a guest player now
only has to use the following two macros:

DECLARE_GUEST_FACTORY_WITH_PLAYLISTS(class_name)
DEFINE_GUEST_FACTORY_WITH_PLAYLISTS(class_name, ...)

In the DEFINE_xxx macro, the user provides all the 
strings that the guest player wants to claim.



Index: wmphostlib_win32.pcf
===================================================================
RCS file: /cvsroot/datatype/wm/wmphost/wmphostlib_win32.pcf,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmphostlib_win32.pcf	4 May 2006 21:04:50 -0000	1.1
+++ wmphostlib_win32.pcf	16 May 2006 14:08:11 -0000	1.2
@@ -54,8 +54,4 @@
                     wmpsdk_include)
 
 project.AddSources("platform/win32/wmp_hosted_factory.cpp",
-                   "platform/win32/asf_hosted_fileformat.cpp",
-                   "platform/win32/asf_hosted_renderer.cpp",
-                   "platform/win32/asx_playlist_fileformat.cpp",
-                   "platform/win32/asx_playlist_renderer.cpp",
                    "platform/win32/wmp_guest_player.cpp")


From ehyche at helixcommunity.org  Tue May 16 07:08:17 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue May 16 08:58:16 2006
Subject: [Datatype-cvs] 
	wm/wmphost/platform/win32 wmp_hosted_factory.cpp, 1.1,
	1.2 wmp_hosted_factory.h, 1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/wm/wmphost/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv21776/platform/win32

Modified Files:
	wmp_hosted_factory.cpp wmp_hosted_factory.h 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Milko Boic (milko@real.com)

Description
----------------------------------------
In the *current* guest player code, a new implementor
of an IHXGuestPlayer would have to not only implement
IHXGuestPlayer, but would also have to:

  1) derive from the base file format
  2) derive from the base renderer
  3) (possibly) derive from the base playlist file format
  4) (possibly) derive from the base playlist renderer
  5) (optionally) package all of these plugins together
     into a plugin factory

Although the code in each of these items is small,
it still is a non-trivial task to get all of these
plugins working together. This change dramatically simplifies
this task, and reduces the above 5 tasks down to
just specifying two macros.

The reason that previously this was so distributed
is that the file format and renderer plugins have to
be able to provide the information on what file extensions,
schemes, stream mime types, etc. that they want to claim.
This information logically would reside in the guest player
itself, but it is these plugins that must create and
own the guest player. Therefore, we previously had
to derive from the base plugins. The dervied plugins
would simply provide these values of claimed 
extensions, schemes, etc.

Now this information has been centralized into
a IHXGuestPlayerCreator interface which is implemented
by the base factory (the base factory is also new, and
it takes care of the IHXPluginFactory implementation
for the guest player.

So now, the implementor of a guest player now
only has to use the following two macros:

DECLARE_GUEST_FACTORY_WITH_PLAYLISTS(class_name)
DEFINE_GUEST_FACTORY_WITH_PLAYLISTS(class_name, ...)

In the DEFINE_xxx macro, the user provides all the 
strings that the guest player wants to claim.



Index: wmp_hosted_factory.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/wmphost/platform/win32/wmp_hosted_factory.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmp_hosted_factory.cpp	4 May 2006 21:04:50 -0000	1.1
+++ wmp_hosted_factory.cpp	16 May 2006 14:08:13 -0000	1.2
@@ -54,125 +54,22 @@
 #include "hxengin.h"
 #include "hxformt.h"
 #include "baseobj.h"
+#include "wmp_guest_player.h"
 #include "wmp_hosted_factory.h"
-#include "asf_hosted_fileformat.h"
-#include "asf_hosted_renderer.h"
-#include "asx_playlist_fileformat.h"
-#include "asx_playlist_renderer.h"
-
-#include "hxheap.h"
-#ifdef _DEBUG
-#undef HX_THIS_FILE		
-static const char HX_THIS_FILE[] = __FILE__;
-#endif
-
-HX_RESULT (STDAPICALLTYPE* CWMPHostedPluginFactory::m_fpRMACreateInstanceArray[])(IUnknown**) =
-{
-    CASFHostedFileFormat::HXCreateInstance,
-    CASFHostedRenderer::HXCreateInstance,
-    CASXHostedFileFormat::HXCreateInstance,
-    CASXHostedPlaylistRenderer::HXCreateInstance,
-    NULL
-};
 
-CWMPHostedPluginFactory::CWMPHostedPluginFactory()
-{
-    m_lRefCount = 0;
-    for(m_usNumPlugins = 0; m_fpRMACreateInstanceArray[m_usNumPlugins]; m_usNumPlugins++);
-}
 
-CWMPHostedPluginFactory::~CWMPHostedPluginFactory()
-{
-}
-
-STDMETHODIMP CWMPHostedPluginFactory::QueryInterface(REFIID riid, void** ppvObj)
-{
-    HX_RESULT retVal = HXR_FAIL;
-
-    if (ppvObj)
-    {
-        // Set defaults
-        *ppvObj = NULL;
-        retVal  = HXR_OK;
-        // Check for IID type
-        if (IsEqualIID(riid, IID_IUnknown))
-        {
-            *ppvObj = (IUnknown*) (IHXPluginFactory*) this;
-        }
-        else if (IsEqualIID(riid, IID_IHXPluginFactory))
-        {
-            *ppvObj = (IHXPluginFactory*) this;
-        }
-        else
-        {
-            retVal = HXR_NOINTERFACE;
-        }
-        if (SUCCEEDED(retVal))
-        {
-            AddRef();
-        }
-    }
-
-    return retVal;
-}
-
-STDMETHODIMP_(UINT32) CWMPHostedPluginFactory::AddRef()
-{
-    return InterlockedIncrement(&m_lRefCount);
-}
-
-
-STDMETHODIMP_(UINT32) CWMPHostedPluginFactory::Release()
-{
-    if (InterlockedDecrement(&m_lRefCount) > 0)
-    {
-        return m_lRefCount;
-    }
-
-    delete this;
-
-    return 0;
-}
-
-
-STDMETHODIMP_(UINT16) CWMPHostedPluginFactory::GetNumPlugins()
-{
-    return m_usNumPlugins;
-}
-
-STDMETHODIMP CWMPHostedPluginFactory::GetPlugin(UINT16 usIndex, IUnknown** ppPlugin)
-{
-    HX_RESULT retVal = HXR_FAIL;
-
-    if (ppPlugin && usIndex < m_usNumPlugins)
-    {
-        retVal = m_fpRMACreateInstanceArray[usIndex](ppPlugin);
-    }
-
-    return retVal;
-}
-
-HX_RESULT STDAPICALLTYPE CWMPHostedPluginFactory::HXCreateInstance(IUnknown** ppIUnknown)
-{
-    HX_RESULT retVal = HXR_FAIL;
-
-    if (ppIUnknown)
-    {
-        // Set default
-        *ppIUnknown = NULL;
-        // Create the object
-        CWMPHostedPluginFactory *pObj = new CWMPHostedPluginFactory();
-        if (pObj)
-        {
-            // QI for IUnknown
-            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppIUnknown);
-        }
-        if (FAILED(retVal))
-        {
-            HX_DELETE(pObj);
-        }
-    }
-
-    return retVal;
-}
+DEFINE_GUEST_FACTORY_WITH_PLAYLISTS(CWMPHostedPluginFactory,
+                                    CWMPGuestPlayer,
+                                    "Helix Hosted Windows Media Player ASF Plugin",
+                                    "video/x-ms-asf|audio/x-ms-wma|video/x-ms-wmv",
+                                    "asf|wma|wmv",
+                                    "Windows Media Files (*.asf,*.wma,*.wmv)",
+                                    "mms|file:asf|file:wma|file:wmv|http:asf|http:wma|http:wmv|rtsp:asf|rtsp:wma|rtsp:wmv",
+                                    "application/vnd.rn-hostedwmp-asf",
+                                    "Helix Hosted Windows Media Player ASX Plugin",
+                                    "application/vnd.ms-asx|audio/x-ms-wax|video/x-ms-wvx",
+                                    "asx|wax|wvx",
+                                    "Windows Media Playlist Files (*.asx,*.wax,*.wvx)",
+                                    "file:asx|file:wax|file:wvx|http:asx|http:wax|http:wvx|rtsp:asx|rtsp:wax|rtsp:wvx",
+                                    "application/vnd.rn-hostedwmp-asx");
 

Index: wmp_hosted_factory.h
===================================================================
RCS file: /cvsroot/datatype/wm/wmphost/platform/win32/wmp_hosted_factory.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmp_hosted_factory.h	4 May 2006 21:04:50 -0000	1.1
+++ wmp_hosted_factory.h	16 May 2006 14:08:13 -0000	1.2
@@ -49,32 +49,8 @@
 #ifndef WMP_HOSTED_FACTORY_H
 #define WMP_HOSTED_FACTORY_H
 
-#include "baseobj.h"
-#include "hxplugn.h"
-
-class CWMPHostedPluginFactory : public IHXPluginFactory,
-                                public CHXBaseCountingObject
-{
-public:
-    CWMPHostedPluginFactory();
-    virtual ~CWMPHostedPluginFactory();
-
-    // IUnknown methods
-    STDMETHOD(QueryInterface)  (THIS_ REFIID riid, void** ppvObj);
-    STDMETHOD_(UINT32,AddRef)  (THIS);
-    STDMETHOD_(UINT32,Release) (THIS);
-
-    // IHXPluginFactory methods
-    STDMETHOD_(UINT16,GetNumPlugins) (THIS);
-    STDMETHOD(GetPlugin)             (THIS_ UINT16 usIndex, IUnknown** ppPlugin);
-
-    // CWMPHostedPluginFactory methods
-    static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
-protected:
-    INT32  m_lRefCount;
-    UINT16 m_usNumPlugins;
+#include "base_hosted_factory.h"
 
-    static HX_RESULT (STDAPICALLTYPE* m_fpRMACreateInstanceArray[])(IUnknown**);
-};
+DECLARE_GUEST_FACTORY_WITH_PLAYLISTS(CWMPHostedPluginFactory);
 
 #endif /* #ifndef WMP_HOSTED_FACTORY_H */


From sgadamsetty at helixcommunity.org  Tue May 16 09:22:36 2006
From: sgadamsetty at helixcommunity.org (sgadamsetty@helixcommunity.org)
Date: Tue May 16 11:12:33 2006
Subject: [Datatype-cvs] tone - New directory
Message-ID: 

Update of /cvsroot/datatype/tone
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv13881/tone

Log Message:
Directory /cvsroot/datatype/tone added to the repository



From sgadamsetty at helixcommunity.org  Tue May 16 09:23:16 2006
From: sgadamsetty at helixcommunity.org (sgadamsetty@helixcommunity.org)
Date: Tue May 16 11:13:12 2006
Subject: [Datatype-cvs] tone/fileformat - New directory
Message-ID: 

Update of /cvsroot/datatype/tone/fileformat
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv14078/fileformat

Log Message:
Directory /cvsroot/datatype/tone/fileformat added to the repository



From sgadamsetty at helixcommunity.org  Tue May 16 09:24:02 2006
From: sgadamsetty at helixcommunity.org (sgadamsetty@helixcommunity.org)
Date: Tue May 16 11:13:58 2006
Subject: [Datatype-cvs] tone/renderer - New directory
Message-ID: 

Update of /cvsroot/datatype/tone/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv14339/renderer

Log Message:
Directory /cvsroot/datatype/tone/renderer added to the repository



From sgadamsetty at helixcommunity.org  Tue May 16 09:33:15 2006
From: sgadamsetty at helixcommunity.org (sgadamsetty@helixcommunity.org)
Date: Tue May 16 11:23:11 2006
Subject: [Datatype-cvs] tone/fileformat/pub - New directory
Message-ID: 

Update of /cvsroot/datatype/tone/fileformat/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv18425/pub

Log Message:
Directory /cvsroot/datatype/tone/fileformat/pub added to the repository



From sgadamsetty at helixcommunity.org  Tue May 16 09:33:43 2006
From: sgadamsetty at helixcommunity.org (sgadamsetty@helixcommunity.org)
Date: Tue May 16 11:23:39 2006
Subject: [Datatype-cvs] tone/fileformat/platform - New directory
Message-ID: 

Update of /cvsroot/datatype/tone/fileformat/platform
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv18625/platform

Log Message:
Directory /cvsroot/datatype/tone/fileformat/platform added to the repository



From sgadamsetty at helixcommunity.org  Tue May 16 09:36:44 2006
From: sgadamsetty at helixcommunity.org (sgadamsetty@helixcommunity.org)
Date: Tue May 16 11:26:40 2006
Subject: [Datatype-cvs] tone/fileformat/platform/win32 - New directory
Message-ID: 

Update of /cvsroot/datatype/tone/fileformat/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv19800/win32

Log Message:
Directory /cvsroot/datatype/tone/fileformat/platform/win32 added to the repository



From sgadamsetty at helixcommunity.org  Tue May 16 09:58:24 2006
From: sgadamsetty at helixcommunity.org (sgadamsetty@helixcommunity.org)
Date: Tue May 16 11:48:19 2006
Subject: [Datatype-cvs] tone/renderer/platform - New directory
Message-ID: 

Update of /cvsroot/datatype/tone/renderer/platform
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv31248/platform

Log Message:
Directory /cvsroot/datatype/tone/renderer/platform added to the repository



From sgadamsetty at helixcommunity.org  Tue May 16 09:58:48 2006
From: sgadamsetty at helixcommunity.org (sgadamsetty@helixcommunity.org)
Date: Tue May 16 11:48:45 2006
Subject: [Datatype-cvs] tone/renderer/pub - New directory
Message-ID: 

Update of /cvsroot/datatype/tone/renderer/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv31415/pub

Log Message:
Directory /cvsroot/datatype/tone/renderer/pub added to the repository



From sgadamsetty at helixcommunity.org  Tue May 16 10:02:54 2006
From: sgadamsetty at helixcommunity.org (sgadamsetty@helixcommunity.org)
Date: Tue May 16 11:52:49 2006
Subject: [Datatype-cvs] tone/renderer/platform/win32 - New directory
Message-ID: 

Update of /cvsroot/datatype/tone/renderer/platform/win32
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv2185/win32

Log Message:
Directory /cvsroot/datatype/tone/renderer/platform/win32 added to the repository



From pankajgupta at helixcommunity.org  Thu May 18 23:05:45 2006
From: pankajgupta at helixcommunity.org (pankajgupta@helixcommunity.org)
Date: Fri May 19 00:55:03 2006
Subject: [Datatype-cvs] mp4/fileformat qtatmmgs.cpp,1.31,1.32
Message-ID: 

Update of /cvsroot/datatype/mp4/fileformat
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv17397

Modified Files:
	qtatmmgs.cpp 
Log Message:
Modified by: pgupta@real.com
Date :18 May 2006
Reviewed By: ehyche@real.com
Issue : Build Failure in symbian 81 platform in client folder
Overview:
To resolve build failures for symbain 81 following fix are suggested
-  Added pContext parameter in CHXURL(pURL, m_pContext);
- To resolve parameters mismatch whicle assigning values to  fpColorConverter, its datatype is modified under HELIX_CONFIG_NOSTATICS define
- Reolved typecasting issue in rtcputil.cpp
- Resolve undefined FPRMCREATEENGINE issue in chxclientenginemanager.cpp
Platform: symbian 8.1
Branch : Head
File Modified:
-  filesystem/httplite/httpfileobj.cpp
-  datatype/mp4/fileformat/qtatmmgs.cpp
-  video/sitelib/minisurf.cpp
-  video/sitelib/pub/minisurf.h
-  protocol/transport/rtp/rtcputil.cpp
-  clientapps/symbianplayer/platform/symbian/chxclientenginemanager.h
Files Added: Nil


Index: qtatmmgs.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/fileformat/qtatmmgs.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- qtatmmgs.cpp	16 Mar 2006 23:54:52 -0000	1.31
+++ qtatmmgs.cpp	19 May 2006 06:05:43 -0000	1.32
@@ -1503,7 +1503,6 @@
 HXBOOL CQT_DataReference_Manager::FindRelPath(UINT8* pData, 
 					    ULONG32 ulDataLength, 
 					    UINT8* &pRelPath, 
-    , m_ulAvgPacketSize(0)
 					    ULONG32 &ulPathLength)
 {
     return FALSE;


From rrajesh at helixcommunity.org  Fri May 19 07:20:44 2006
From: rrajesh at helixcommunity.org (rrajesh@helixcommunity.org)
Date: Fri May 19 09:09:58 2006
Subject: [Datatype-cvs] mdf/audio/dsp mdfdevsound.cpp,1.1.2.9,1.1.2.10
Message-ID: 

Update of /cvsroot/datatype/mdf/audio/dsp
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv4451

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfdevsound.cpp 
Log Message:
> "Nokia submits this code under the terms of a commercial contribution 
> agreement with RealNetworks, and I am authorized to contribute this 
> code under said agreement."
> 
> 	Modified by:  rajesh.rathinasamy@nokia.com
> 
> 	Reviewed by: 
> 
> 	Date: 16-May-2006. 
> 
> 	Project: Helix Symbian player
> 
> 	ErrorId: EAVZ-6PLUR3
> 
> 	Synopsis:  Resumption of Helix streaming after incoming (Audio/ 
> Video) call
> 
> 	The problem is noticed only on 3gp streaming which uses dsp 
> devsound..
> 
> 	 During a streaming session when phone rings, the devsound gets a 
> play error. The mdfdevsound handles the Device taken error only when 
> in playing state.
> 
> 	Mdfdevsound receives error during the paused state and it just 
> changes the state to error state which it can never recover from.
> 
> 	The handling has been changed to process the device taken in other 
> possible states (like paused, waiting, etc) too.
> 
> 	Also changed the playerror log level to 1. 
> 
> 	Files Modified: 
> 	=========== 
> 	datatype/mdf/audio/dsp/mdfdevsound.cpp
> 
> 	Image Size and Heap Use impact: Minor
> 
> 	Platforms and Profiles Build Verified: 
> helix-client-s60-mmf-mdf-dsp
> 
> 	Platforms and Profiles Functionality verified: armv5
> 
>      Branch: Helix, 210CayS

Index: mdfdevsound.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -d -r1.1.2.9 -r1.1.2.10
--- mdfdevsound.cpp	7 Apr 2006 19:44:35 -0000	1.1.2.9
+++ mdfdevsound.cpp	19 May 2006 14:20:33 -0000	1.1.2.10
@@ -1,1061 +1,1069 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Source last modified: $Id$
- * 
- * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
- * 
- * The contents of this file, and the files included with this file,
- * are subject to the current version of the RealNetworks Public
- * Source License (the "RPSL") available at
- * http://www.helixcommunity.org/content/rpsl unless you have licensed
- * the file under the current version of the RealNetworks Community
- * Source License (the "RCSL") available at
[...2099 lines suppressed...]
+//
+void CMDFDevSound::GetSymbianUid(const char* fourCC, TUid& uid)
+{
+    if (strcasecmp("amrn",fourCC)==0)
+    {
+        uid = TUid::Uid(KUidHwCodecNbAMRDecToPCM16);
+    }
+    else
+    if (strcasecmp("amrw",fourCC)==0)
+    {
+        uid = TUid::Uid(KUidHwCodecAWBDecToPCM16);
+    }
+    else 
+    if (strcasecmp("raac", fourCC)==0 || strcasecmp("aac4", fourCC)==0)
+    {
+        uid = TUid::Uid(KUidHwCodecAACToPCM16);
+    }
+
+    return;
+}


From rrajesh at helixcommunity.org  Fri May 19 08:03:42 2006
From: rrajesh at helixcommunity.org (rrajesh@helixcommunity.org)
Date: Fri May 19 09:53:00 2006
Subject: [Datatype-cvs] mdf/audio/dsp mdfdevsound.cpp,1.9,1.10
Message-ID: 

Update of /cvsroot/datatype/mdf/audio/dsp
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv4371

Modified Files:
	mdfdevsound.cpp 
Log Message:
> "Nokia submits this code under the terms of a commercial contribution 
> agreement with RealNetworks, and I am authorized to contribute this 
> code under said agreement."
> 
> 	Modified by:  rajesh.rathinasamy@nokia.com
> 
> 	Reviewed by: 
> 
> 	Date: 16-May-2006. 
> 
> 	Project: Helix Symbian player
> 
> 	ErrorId: EAVZ-6PLUR3
> 
> 	Synopsis:  Resumption of Helix streaming after incoming (Audio/ 
> Video) call
> 
> 	The problem is noticed only on 3gp streaming which uses dsp 
> devsound..
> 
> 	 During a streaming session when phone rings, the devsound gets a 
> play error. The mdfdevsound handles the Device taken error only when 
> in playing state.
> 
> 	Mdfdevsound receives error during the paused state and it just 
> changes the state to error state which it can never recover from.
> 
> 	The handling has been changed to process the device taken in other 
> possible states (like paused, waiting, etc) too.
> 
> 	Also changed the playerror log level to 1. 
> 
> 	Files Modified: 
> 	=========== 
> 	datatype/mdf/audio/dsp/mdfdevsound.cpp
> 
> 	Image Size and Heap Use impact: Minor
> 
> 	Platforms and Profiles Build Verified: 
> helix-client-s60-mmf-mdf-dsp
> 
> 	Platforms and Profiles Functionality verified: armv5
> 
>      Branch: Helix, 210CayS

Index: mdfdevsound.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- mdfdevsound.cpp	7 Apr 2006 19:18:14 -0000	1.9
+++ mdfdevsound.cpp	19 May 2006 15:03:26 -0000	1.10
@@ -1,1061 +1,1069 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Source last modified: $Id$
- * 
- * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
- * 
- * The contents of this file, and the files included with this file,
- * are subject to the current version of the RealNetworks Public
- * Source License (the "RPSL") available at
- * http://www.helixcommunity.org/content/rpsl unless you have licensed
- * the file under the current version of the RealNetworks Community
- * Source License (the "RCSL") available at
[...2099 lines suppressed...]
+//
+void CMDFDevSound::GetSymbianUid(const char* fourCC, TUid& uid)
+{
+    if (strcasecmp("amrn",fourCC)==0)
+    {
+        uid = TUid::Uid(KUidHwCodecNbAMRDecToPCM16);
+    }
+    else
+    if (strcasecmp("amrw",fourCC)==0)
+    {
+        uid = TUid::Uid(KUidHwCodecAWBDecToPCM16);
+    }
+    else 
+    if (strcasecmp("raac", fourCC)==0 || strcasecmp("aac4", fourCC)==0)
+    {
+        uid = TUid::Uid(KUidHwCodecAACToPCM16);
+    }
+
+    return;
+}


From gashish at helixcommunity.org  Fri May 19 11:21:54 2006
From: gashish at helixcommunity.org (gashish@helixcommunity.org)
Date: Fri May 19 13:11:06 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp, 1.3.2.24,
	1.3.2.25
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv12580

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfvideoadapter.cpp 
Log Message:
Crash when playing a MMS.

"Nokia submits this code under the terms of a commercial contribution agreement 
with RealNetworks, and I am authorized to contribute this code under said agreement."

Modified by:  ashish.as.gupta@nokia.com

Reviewed by:

Date: 05-18-2006

Error ID: TSW ID=EJEA-6P9SS8

Project: Helix plugin for Symbian

Synopsis: Crash during MMS playback.

Files Modified: 

There are multiple crashes. Two changes are made. 

-Calling some functions while no frame has been passed to dev-video results in crash. Checks are introduced to avoid this problem.
-A check is introduced so that SetScreenClipRegion is called only when DevVideo is initialized.

datatype/mdf/video/renderer/mdfvideoadapter.cpp

Files Added: None.

Image Size and Heap Use impact: Very minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp

Platforms and Profiles Functionality verified: armv5

Branch: head, hxclient_2_1_0_cayennes



Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.3.2.24
retrieving revision 1.3.2.25
diff -u -d -r1.3.2.24 -r1.3.2.25
--- mdfvideoadapter.cpp	10 May 2006 16:23:11 -0000	1.3.2.24
+++ mdfvideoadapter.cpp	19 May 2006 18:21:51 -0000	1.3.2.25
@@ -460,6 +460,7 @@
     if( m_pDevVideoPlay && m_DevVidInitialized == EInitializedSuccess && !m_bStreamEnd)
     {
         MDFVIDEOLOG_INOUTFN( "InputEnd" );
+        if( m_bIsFirstFrameSent )
         m_pDevVideoPlay->Stop();
 //        m_DevVidInitialized = EInitializedReady;
         if( m_pBltrPump )
@@ -472,6 +473,7 @@
         }
 
         CMMFDevVideoPlay::TPictureCounters pictureCounter;
+        if( m_bIsFirstFrameSent )
         m_pDevVideoPlay->GetPictureCounters( pictureCounter );
         
         MDFVIDEOLOG_WRITE_FORMAT1( "    Num of Frames dropped by adapter         :%u", m_ulFramesDroppedByAdapter );
@@ -1551,9 +1553,16 @@
         MDFVIDEOLOG_WRITE_MULTI_FORMAT( "    Rightbottom %d:%d", rect.iBr.iX, rect.iBr.iY );
     }
 
+    if (m_DevVidInitialized == EInitializedSuccess)
+    {
     m_pDevVideoPlay->SetScreenClipRegion(m_ClipRegion);
 
     retVal = HXR_OK;
+    }
+    else
+    {
+        MDFVIDEOLOG_LEAVEFN2( "m_DevVidInitialized != EInitializedSuccess. not calling SetScreenClipRegion" );
+    }
 
     MDFVIDEOLOG_LEAVEFN2( "UpdateDisplayRegion" );
     return retVal;


From gashish at helixcommunity.org  Fri May 19 11:24:46 2006
From: gashish at helixcommunity.org (gashish@helixcommunity.org)
Date: Fri May 19 13:13:56 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp,1.28,1.29
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv14516

Modified Files:
	mdfvideoadapter.cpp 
Log Message:
Crash when playing a MMS.

"Nokia submits this code under the terms of a commercial contribution agreement 
with RealNetworks, and I am authorized to contribute this code under said agreement."

Modified by:  ashish.as.gupta@nokia.com

Reviewed by:

Date: 05-18-2006

Error ID: TSW ID=EJEA-6P9SS8

Project: Helix plugin for Symbian

Synopsis: Crash during MMS playback.

Files Modified: 

There are multiple crashes. Two changes are made. 

-Calling some functions while no frame has been passed to dev-video results in crash. Checks are introduced to avoid this problem.
-A check is introduced so that SetScreenClipRegion is called only when DevVideo is initialized.

datatype/mdf/video/renderer/mdfvideoadapter.cpp

Files Added: None.

Image Size and Heap Use impact: Very minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp

Platforms and Profiles Functionality verified: armv5

Branch: head, hxclient_2_1_0_cayennes



Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- mdfvideoadapter.cpp	10 May 2006 16:22:34 -0000	1.28
+++ mdfvideoadapter.cpp	19 May 2006 18:24:41 -0000	1.29
@@ -461,6 +461,7 @@
     if( m_pDevVideoPlay && m_DevVidInitialized == EInitializedSuccess && !m_bStreamEnd)
     {
         MDFVIDEOLOG_INOUTFN( "InputEnd" );
+        if( m_bIsFirstFrameSent )
         m_pDevVideoPlay->Stop();
 //        m_DevVidInitialized = EInitializedReady;
         if( m_pBltrPump )
@@ -473,6 +474,7 @@
         }
 
         CMMFDevVideoPlay::TPictureCounters pictureCounter;
+        if( m_bIsFirstFrameSent )
         m_pDevVideoPlay->GetPictureCounters( pictureCounter );
         
         MDFVIDEOLOG_WRITE_FORMAT1( "    Num of Frames dropped by adapter         :%u", m_ulFramesDroppedByAdapter );
@@ -1552,9 +1554,16 @@
         MDFVIDEOLOG_WRITE_MULTI_FORMAT( "    Rightbottom %d:%d", rect.iBr.iX, rect.iBr.iY );
     }
 
+    if (m_DevVidInitialized == EInitializedSuccess)
+    {
     m_pDevVideoPlay->SetScreenClipRegion(m_ClipRegion);
 
     retVal = HXR_OK;
+    }
+    else
+    {
+        MDFVIDEOLOG_LEAVEFN2( "m_DevVidInitialized != EInitializedSuccess. not calling SetScreenClipRegion" );
+    }
 
     MDFVIDEOLOG_LEAVEFN2( "UpdateDisplayRegion" );
     return retVal;


From karll at helixcommunity.org  Fri May 19 14:53:46 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Fri May 19 16:42:54 2006
Subject: [Datatype-cvs] h264 - New directory
Message-ID: 

Update of /cvsroot/datatype/h264
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv31551/h264

Log Message:
Directory /cvsroot/datatype/h264 added to the repository



From karll at helixcommunity.org  Fri May 19 14:54:01 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Fri May 19 16:43:09 2006
Subject: [Datatype-cvs] h264/codec - New directory
Message-ID: 

Update of /cvsroot/datatype/h264/codec
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv31577/codec

Log Message:
Directory /cvsroot/datatype/h264/codec added to the repository



From karll at helixcommunity.org  Fri May 19 14:54:12 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Fri May 19 16:43:20 2006
Subject: [Datatype-cvs] h264/codec/decoder - New directory
Message-ID: 

Update of /cvsroot/datatype/h264/codec/decoder
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv31590/decoder

Log Message:
Directory /cvsroot/datatype/h264/codec/decoder added to the repository



From karll at helixcommunity.org  Fri May 19 14:55:59 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Fri May 19 16:45:08 2006
Subject: [Datatype-cvs] h264/codec/decoder/platform - New directory
Message-ID: 

Update of /cvsroot/datatype/h264/codec/decoder/platform
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv31646/platform

Log Message:
Directory /cvsroot/datatype/h264/codec/decoder/platform added to the repository



From karll at helixcommunity.org  Fri May 19 14:56:08 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Fri May 19 16:45:17 2006
Subject: [Datatype-cvs] h264/codec/decoder/platform/mac - New directory
Message-ID: 

Update of /cvsroot/datatype/h264/codec/decoder/platform/mac
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv31665/mac

Log Message:
Directory /cvsroot/datatype/h264/codec/decoder/platform/mac added to the repository



From karll at helixcommunity.org  Fri May 19 14:56:08 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Fri May 19 16:45:17 2006
Subject: [Datatype-cvs] h264/codec/decoder/platform/win - New directory
Message-ID: 

Update of /cvsroot/datatype/h264/codec/decoder/platform/win
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv31665/win

Log Message:
Directory /cvsroot/datatype/h264/codec/decoder/platform/win added to the repository



From karll at helixcommunity.org  Fri May 19 15:13:11 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Fri May 19 17:02:19 2006
Subject: [Datatype-cvs] h264/codec/decoder umakefil,1.1.1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/h264/codec/decoder
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv13932

Modified Files:
	umakefil 
Log Message:
test checkin


Index: umakefil
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/umakefil,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- umakefil	19 May 2006 22:08:04 -0000	1.1.1.1
+++ umakefil	19 May 2006 22:13:04 -0000	1.2
@@ -1,7 +1,7 @@
 # ***** BEGIN LICENSE BLOCK *****  
 # Source last modified: $Id$ 
 #  
-# Copyright Notices: 
+# Copyright Notices : 
 #  
 # Portions Copyright (c) 1995-2006 RealNetworks, Inc. All Rights Reserved. 
 # 


From jwei at helixcommunity.org  Mon May 22 13:48:35 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Mon May 22 15:36:59 2006
Subject: [Datatype-cvs] mdf/video/format/h264 mdfh264payloadformat.cpp, 1.2,
	1.3
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/h264
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv30993

Modified Files:
	mdfh264payloadformat.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 19-05-2006.

Error ID: JWEI-6NLKLF

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Memory Leak Check

This CR proposes following error corrections or/and improvements:
1) This CR fixes some memory leak cases.

Files Modified:

/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
/cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

========================================================
changes incorporated CR comments made by Greg Wright


Index: mdfh264payloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mdfh264payloadformat.cpp	14 Apr 2006 18:08:32 -0000	1.2
+++ mdfh264payloadformat.cpp	22 May 2006 20:48:32 -0000	1.3
@@ -100,7 +100,6 @@
 
     HX_RESULT retVal = HXR_OK;
 
-    
     IHXBuffer* pMimeType = NULL;
     const char* pMimeTypeData = NULL;
     


From jwei at helixcommunity.org  Mon May 22 13:48:51 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Mon May 22 15:37:16 2006
Subject: [Datatype-cvs] mdf/video/format/h264 mdfh264payloadformat.cpp,
	1.1.2.3, 1.1.2.4
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/h264
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv31348

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfh264payloadformat.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 19-05-2006.

Error ID: JWEI-6NLKLF

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Memory Leak Check

This CR proposes following error corrections or/and improvements:
1) This CR fixes some memory leak cases.

Files Modified:

/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
/cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

========================================================
changes incorporated CR comments made by Greg Wright


Index: mdfh264payloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- mdfh264payloadformat.cpp	14 Apr 2006 18:08:24 -0000	1.1.2.3
+++ mdfh264payloadformat.cpp	22 May 2006 20:48:49 -0000	1.1.2.4
@@ -100,7 +100,6 @@
 
     HX_RESULT retVal = HXR_OK;
 
-    
     IHXBuffer* pMimeType = NULL;
     const char* pMimeTypeData = NULL;
     
@@ -470,7 +469,7 @@
             pPluginDevice->m_pInputAllocator->ReleasePacketPtr(pDeadData->data);
         }
 
-        delete[] ((ULONG32*) pDeadData);
+        delete [] ((ULONG32*) pDeadData);
     }
 }
 


From jwei at helixcommunity.org  Mon May 22 13:49:54 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Mon May 22 15:38:18 2006
Subject: [Datatype-cvs] 
	mdf/video/format/mp4 mdfmp4payloadformat.cpp, 1.2.2.6, 1.2.2.7
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/mp4
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv32573

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfmp4payloadformat.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 19-05-2006.

Error ID: JWEI-6NLKLF

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Memory Leak Check

This CR proposes following error corrections or/and improvements:
1) This CR fixes some memory leak cases.

Files Modified:

/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
/cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

========================================================
changes incorporated CR comments made by Greg Wright


Index: mdfmp4payloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
retrieving revision 1.2.2.6
retrieving revision 1.2.2.7
diff -u -d -r1.2.2.6 -r1.2.2.7
--- mdfmp4payloadformat.cpp	14 Apr 2006 18:04:15 -0000	1.2.2.6
+++ mdfmp4payloadformat.cpp	22 May 2006 20:49:51 -0000	1.2.2.7
@@ -133,7 +133,45 @@
             return NULL;
         }
     }
+
+    /*///////////////notice to memory leak check///////////////->>>>>
+    If you intend to use __UHEAP_MARK and __UHEAP_MARKEND to check memory
+    leakage, please do following steps. Otherwise, please ignore this comment.
+
+    MP4 depacktizer has maintained an internal link list pointing to 
+    its created frame data. The list normally grows with new frames.
+    It marks the pointer as unused if the pointed frame is 
+    deleted and will be reused later. If you use __UHEAP_MARK and 
+    __UHEAP_MARKEND to check memory leak, this link list likely gives
+    you false impression of leakage. One way to solve this problem is
+    to preallocate this link list.
     
+    1) MP4VPayloadFormat::CreateHXCodecPacket() calls 
+       m_pAllocator->GetPacketBuffer() in mp4vpyld.cpp
+    2) CHXBufferMemoryAllocator::GetPacketBuffer() calls 
+       m_BufMap.SetAt(pRetVal, pBufBlock) in hxalloc.cpp
+    3) CHXMapPtrToPtr.SetAt() in chxmapptrtoptr.cpp or MAP_TYPE::SetAt() in 
+       chxmapcommon_inl.h make its members m_buckets and m_free allocate 
+       some memory to build a table.
+    4) this memory is not released when m_BufMap.RemoveKey(memPtr) is called.
+       Instead, these memory is marked as not used.
+    5) (1)-(4) create difficutly in memory leak hunting. In order to overcome this,
+       add following codes into 
+       void CHXMapPtrToPtr::ConstructTypeSpecifics()
+
+            m_items.reserve( 100 );
+            m_free.reserve( 100 );
+            for( int i = 0; i < 100; i++ )
+                m_free.push_back( i );
+            m_buckets.Init( 1 );
+            m_buckets[0].reserve(100);
+
+       These codes preallocate m_items, m_free and m_bucekets. So no new memory is
+       allocated when new item is inserted as long as number of item is less than 100
+
+    6) note: it recommends only building contlib.lib, mp4pyldlib.lib,
+       and mdfmp4payloadformat.dll with this change.
+    /////////////////notice to memory leak check///////////////-<<<<<*/
     m_pMP4Depacketizer->CreateHXCodecPacket( pCodecPacketRaw ); //customized method
     pCodecPacket = (HXCODEC_DATA*) pCodecPacketRaw;
     if( pCodecPacket )


From jwei at helixcommunity.org  Mon May 22 13:50:54 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Mon May 22 15:39:19 2006
Subject: [Datatype-cvs] mdf/video/format/mp4 mdfmp4payloadformat.cpp, 1.8,
	1.9
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/mp4
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv1236

Modified Files:
	mdfmp4payloadformat.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 19-05-2006.

Error ID: JWEI-6NLKLF

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Memory Leak Check

This CR proposes following error corrections or/and improvements:
1) This CR fixes some memory leak cases.

Files Modified:

/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
/cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

========================================================
changes incorporated CR comments made by Greg Wright


Index: mdfmp4payloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- mdfmp4payloadformat.cpp	14 Apr 2006 18:04:25 -0000	1.8
+++ mdfmp4payloadformat.cpp	22 May 2006 20:50:52 -0000	1.9
@@ -133,7 +133,45 @@
             return NULL;
         }
     }
+
+    /*///////////////notice to memory leak check///////////////->>>>>
+    If you intend to use __UHEAP_MARK and __UHEAP_MARKEND to check memory
+    leakage, please do following steps. Otherwise, please ignore this comment.
+
+    MP4 depacktizer has maintained an internal link list pointing to 
+    its created frame data. The list normally grows with new frames.
+    It marks the pointer as unused if the pointed frame is 
+    deleted and will be reused later. If you use __UHEAP_MARK and 
+    __UHEAP_MARKEND to check memory leak, this link list likely gives
+    you false impression of leakage. One way to solve this problem is
+    to preallocate this link list.
     
+    1) MP4VPayloadFormat::CreateHXCodecPacket() calls 
+       m_pAllocator->GetPacketBuffer() in mp4vpyld.cpp
+    2) CHXBufferMemoryAllocator::GetPacketBuffer() calls 
+       m_BufMap.SetAt(pRetVal, pBufBlock) in hxalloc.cpp
+    3) CHXMapPtrToPtr.SetAt() in chxmapptrtoptr.cpp or MAP_TYPE::SetAt() in 
+       chxmapcommon_inl.h make its members m_buckets and m_free allocate 
+       some memory to build a table.
+    4) this memory is not released when m_BufMap.RemoveKey(memPtr) is called.
+       Instead, these memory is marked as not used.
+    5) (1)-(4) create difficutly in memory leak hunting. In order to overcome this,
+       add following codes into 
+       void CHXMapPtrToPtr::ConstructTypeSpecifics()
+
+            m_items.reserve( 100 );
+            m_free.reserve( 100 );
+            for( int i = 0; i < 100; i++ )
+                m_free.push_back( i );
+            m_buckets.Init( 1 );
+            m_buckets[0].reserve(100);
+
+       These codes preallocate m_items, m_free and m_bucekets. So no new memory is
+       allocated when new item is inserted as long as number of item is less than 100
+
+    6) note: it recommends only building contlib.lib, mp4pyldlib.lib,
+       and mdfmp4payloadformat.dll with this change.
+    /////////////////notice to memory leak check///////////////-<<<<<*/
     m_pMP4Depacketizer->CreateHXCodecPacket( pCodecPacketRaw ); //customized method
     pCodecPacket = (HXCODEC_DATA*) pCodecPacketRaw;
     if( pCodecPacket )


From jwei at helixcommunity.org  Mon May 22 13:53:21 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Mon May 22 15:41:46 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfpluginmanager.cpp,1.6,1.7
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv3380

Modified Files:
	mdfpluginmanager.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 19-05-2006.

Error ID: JWEI-6NLKLF

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Memory Leak Check

This CR proposes following error corrections or/and improvements:
1) This CR fixes some memory leak cases.

Files Modified:

/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
/cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

========================================================
changes incorporated CR comments made by Greg Wright


Index: mdfpluginmanager.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mdfpluginmanager.cpp	28 Mar 2006 20:35:20 -0000	1.6
+++ mdfpluginmanager.cpp	22 May 2006 20:53:19 -0000	1.7
@@ -356,8 +356,9 @@
     CleanupStack::PopAndDestroy(&postprocessorPlugins);
     
     RImplInfoPtrArray payloadformatPlugins;
-    REComSession::ListImplementationsL(KUidPayloadFormatPluginDevice, payloadformatPlugins);
     CleanupResetAndDestroyPushL( payloadformatPlugins );
+
+    REComSession::ListImplementationsL(KUidPayloadFormatPluginDevice, payloadformatPlugins);
     
     TInt countpy = payloadformatPlugins.Count();
     MDFVIDEOLOG_WRITE_FORMAT2( "<-> Number of payload discovered is = %d", countpy );
@@ -557,7 +558,13 @@
     
     m_PluginPackageArray.ResetAndDestroy();
     m_PluginPackageArray.Close();
-    
+
+    //It does not make any difference if you call REComSession::FinalClose().
+    //REComSession will make this call anyway when it closes. 
+    //The reason to manually make FinalClose() call is to force 
+    //REComSession release unused memory. It will help identify if there 
+    //is memory leak or not.
+    //REComSession::FinalClose();  //this cleans out the garbage
     MDFVIDEOLOG_LEAVEFN( "Reset" );
 }
 


From jwei at helixcommunity.org  Mon May 22 13:53:27 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Mon May 22 15:41:52 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfpluginmanager.cpp, 1.2.2.5,
	1.2.2.6
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv3416

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfpluginmanager.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 19-05-2006.

Error ID: JWEI-6NLKLF

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Memory Leak Check

This CR proposes following error corrections or/and improvements:
1) This CR fixes some memory leak cases.

Files Modified:

/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
/cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

========================================================
changes incorporated CR comments made by Greg Wright


Index: mdfpluginmanager.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp,v
retrieving revision 1.2.2.5
retrieving revision 1.2.2.6
diff -u -d -r1.2.2.5 -r1.2.2.6
--- mdfpluginmanager.cpp	28 Mar 2006 20:35:13 -0000	1.2.2.5
+++ mdfpluginmanager.cpp	22 May 2006 20:53:25 -0000	1.2.2.6
@@ -356,8 +356,9 @@
     CleanupStack::PopAndDestroy(&postprocessorPlugins);
     
     RImplInfoPtrArray payloadformatPlugins;
-    REComSession::ListImplementationsL(KUidPayloadFormatPluginDevice, payloadformatPlugins);
     CleanupResetAndDestroyPushL( payloadformatPlugins );
+
+    REComSession::ListImplementationsL(KUidPayloadFormatPluginDevice, payloadformatPlugins);
     
     TInt countpy = payloadformatPlugins.Count();
     MDFVIDEOLOG_WRITE_FORMAT2( "<-> Number of payload discovered is = %d", countpy );
@@ -557,7 +558,13 @@
     
     m_PluginPackageArray.ResetAndDestroy();
     m_PluginPackageArray.Close();
-    
+
+    //It does not make any difference if you call REComSession::FinalClose().
+    //REComSession will make this call anyway when it closes. 
+    //The reason to manually make FinalClose() call is to force 
+    //REComSession release unused memory. It will help identify if there 
+    //is memory leak or not.
+    //REComSession::FinalClose();  //this cleans out the garbage
     MDFVIDEOLOG_LEAVEFN( "Reset" );
 }
 


From jwei at helixcommunity.org  Mon May 22 13:53:48 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Mon May 22 15:42:13 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp,1.29,1.30
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv3445

Modified Files:
	mdfvideoadapter.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 19-05-2006.

Error ID: JWEI-6NLKLF

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Memory Leak Check

This CR proposes following error corrections or/and improvements:
1) This CR fixes some memory leak cases.

Files Modified:

/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
/cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

========================================================
changes incorporated CR comments made by Greg Wright


Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- mdfvideoadapter.cpp	19 May 2006 18:24:41 -0000	1.29
+++ mdfvideoadapter.cpp	22 May 2006 20:53:46 -0000	1.30
@@ -497,11 +497,7 @@
     HX_ASSERT( m_pDevVideoPlay );
     if( m_bIsFirstFrameSent )
     {
-        TRAPD( error, m_pDevVideoPlay->SetPosition( aPlaybackPosition ) );
-        if( error != KErrNone )
-        {
-            HX_RESULT retVal = HXR_FAIL;
-        }
+        m_pDevVideoPlay->SetPosition( aPlaybackPosition );
     }
     MDFVIDEOLOG_RETURNFN( "SetVideoTimePosition", retVal );
     return retVal;


From jwei at helixcommunity.org  Mon May 22 13:53:55 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Mon May 22 15:42:19 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp, 1.3.2.25,
	1.3.2.26
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv3462

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfvideoadapter.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 19-05-2006.

Error ID: JWEI-6NLKLF

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Memory Leak Check

This CR proposes following error corrections or/and improvements:
1) This CR fixes some memory leak cases.

Files Modified:

/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
/cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

========================================================
changes incorporated CR comments made by Greg Wright


Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.3.2.25
retrieving revision 1.3.2.26
diff -u -d -r1.3.2.25 -r1.3.2.26
--- mdfvideoadapter.cpp	19 May 2006 18:21:51 -0000	1.3.2.25
+++ mdfvideoadapter.cpp	22 May 2006 20:53:53 -0000	1.3.2.26
@@ -496,11 +496,7 @@
     HX_ASSERT( m_pDevVideoPlay );
     if( m_bIsFirstFrameSent )
     {
-        TRAPD( error, m_pDevVideoPlay->SetPosition( aPlaybackPosition ) );
-        if( error != KErrNone )
-        {
-            HX_RESULT retVal = HXR_FAIL;
-        }
+        m_pDevVideoPlay->SetPosition( aPlaybackPosition );
     }
     MDFVIDEOLOG_RETURNFN( "SetVideoTimePosition", retVal );
     return retVal;


From jwei at helixcommunity.org  Mon May 22 13:54:07 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Mon May 22 15:42:32 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvidrend.cpp,1.14,1.15
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv3487

Modified Files:
	mdfvidrend.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 19-05-2006.

Error ID: JWEI-6NLKLF

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Memory Leak Check

This CR proposes following error corrections or/and improvements:
1) This CR fixes some memory leak cases.

Files Modified:

/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
/cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

========================================================
changes incorporated CR comments made by Greg Wright


Index: mdfvidrend.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- mdfvidrend.cpp	18 Apr 2006 21:12:31 -0000	1.14
+++ mdfvidrend.cpp	22 May 2006 20:54:05 -0000	1.15
@@ -105,12 +105,12 @@
     UINT16 index = 0;
     while( zm_pStreamMimeTypes != NULL && zm_pStreamMimeTypes[index] != NULL )
     {
-        delete  [] zm_pStreamMimeTypes[index++];
+        HX_VECTOR_DELETE( zm_pStreamMimeTypes[index++] );
     }
-    delete zm_pStreamMimeTypes;
+    HX_VECTOR_DELETE( zm_pStreamMimeTypes );
     zm_pStreamMimeTypes = NULL;
 
-    delete [] m_pCurrentMimetype;
+    HX_VECTOR_DELETE( m_pCurrentMimetype );
 
     HX_DELETE( m_pPluginManager );
     HX_RELEASE( m_pMdfVideoAdapter );
@@ -388,8 +388,8 @@
     {
         m_pStream = pStream;
         m_pStream->AddRef();
-        }
-        else
+    }
+    else
     {
         HX_RELEASE( m_pStream );
     }
@@ -479,7 +479,7 @@
     {
         if( m_pCurrentMimetype )
         {
-            delete [] m_pCurrentMimetype;
+            HX_VECTOR_DELETE( m_pCurrentMimetype );
             m_pCurrentMimetype = NULL;
         }
         if( pMimeTypeData )


From jwei at helixcommunity.org  Mon May 22 13:54:13 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Mon May 22 15:42:36 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvidrend.cpp,1.4.2.10,1.4.2.11
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv3502

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfvidrend.cpp 
Log Message:

"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement."

Modified by:  John Wei

Reviewed by: 

Date: 19-05-2006.

Error ID: JWEI-6NLKLF

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Memory Leak Check

This CR proposes following error corrections or/and improvements:
1) This CR fixes some memory leak cases.

Files Modified:

/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
/cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp
/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-dsp,
armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

========================================================
changes incorporated CR comments made by Greg Wright


Index: mdfvidrend.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp,v
retrieving revision 1.4.2.10
retrieving revision 1.4.2.11
diff -u -d -r1.4.2.10 -r1.4.2.11
--- mdfvidrend.cpp	18 Apr 2006 21:11:49 -0000	1.4.2.10
+++ mdfvidrend.cpp	22 May 2006 20:54:10 -0000	1.4.2.11
@@ -105,12 +105,12 @@
     UINT16 index = 0;
     while( zm_pStreamMimeTypes != NULL && zm_pStreamMimeTypes[index] != NULL )
     {
-        delete  [] zm_pStreamMimeTypes[index++];
+        HX_VECTOR_DELETE( zm_pStreamMimeTypes[index++] );
     }
-    delete zm_pStreamMimeTypes;
+    HX_VECTOR_DELETE( zm_pStreamMimeTypes );
     zm_pStreamMimeTypes = NULL;
 
-    delete [] m_pCurrentMimetype;
+    HX_VECTOR_DELETE( m_pCurrentMimetype );
 
     HX_DELETE( m_pPluginManager );
     HX_RELEASE( m_pMdfVideoAdapter );
@@ -388,8 +388,8 @@
     {
         m_pStream = pStream;
         m_pStream->AddRef();
-        }
-        else
+    }
+    else
     {
         HX_RELEASE( m_pStream );
     }
@@ -479,7 +479,7 @@
     {
         if( m_pCurrentMimetype )
         {
-            delete [] m_pCurrentMimetype;
+            HX_VECTOR_DELETE( m_pCurrentMimetype );
             m_pCurrentMimetype = NULL;
         }
         if( pMimeTypeData )


From milko at helixcommunity.org  Mon May 22 18:28:00 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Mon May 22 20:16:22 2006
Subject: [Datatype-cvs] tools/dtdriver/apps/dtdrive main.cpp,1.23,1.24
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/apps/dtdrive
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv5733/apps/dtdrive

Modified Files:
	main.cpp 
Log Message:
Modified by: milko@real.com
Date: 5:22:06
Project: dtdriver

Synopsis: Enables dtdriver for TAC editing 

Overview:
The changes enables dtdriver to add or replace the following meta-data
properties in the content stream file header:
"Title", "Author", "Copyright", "Abstract", "Keywords".

Command line dtdrive usage for new functionality:
=> Meta Data:
     Commands:
      -TITLE 
                    = Set/Replace title string in the content stream
      -AUTHOR <Author>
                    = Set/Replace author string in the content stream
      -COPYRIGHT <Copyright>
                    = Set/Replace copyright string in the content stream
      -ABSTRACT <Copyright>
                    = Set/Replace abstract string in the content stream
      -KEYWORDS <Keywords>
                    = Set/Replace keywords string in the content stream

Example command line to alter TAC information in an .rm file:
dtdrive input_file.rm -TITLE "New Title" -AUTHOR "New Author" -COPYRIGHT "New Copyright" -W output_file.rm

Files Modified:
/datatype/tools/dtdriver/apps/dtdrive/main.cpp,v
/datatype/tools/dtdriver/engine/ffdriver.cpp,v
/datatype/tools/dtdriver/engine/pub/ffdriver.h,v

Image Size and Heap Use impact (Client -Only):
Very Small increase on dtdriver engine size.

Platforms and Profiles Affected:
all

Distribution Libraries Affected:
none

Distribution library impact and planned action:
n/a

Platforms and Profiles Build Verified:
win32-i386-vc6, helix-client-all-defines

Platforms and Profiles Functionality verified:
win32-i386-vc6, helix-client-all-defines

Branch:
HEAD, hxclient_1_5_0_cayenne



Index: main.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/apps/dtdrive/main.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- main.cpp	4 May 2006 00:15:53 -0000	1.23
+++ main.cpp	23 May 2006 01:27:56 -0000	1.24
@@ -70,6 +70,11 @@
 #define SERVER_OPTION_STRING	    "S"
 #define TIMER_OPTION_STRING	    "T"
 #define WRITE_OPTION_STRING	    "W"
+#define TITLE_OPTION_STRING	    "TITLE"
+#define AUTHOR_OPTION_STRING	    "AUTHOR"
+#define COPYRIGHT_OPTION_STRING	    "COPYRIGHT"
+#define ABSTRACT_OPTION_STRING	    "ABSTRACT"
+#define KEYWORDS_OPTION_STRING	    "KEYWORDS"
 #define TEMPDIR_OPTION_STRING	    "TD"
 #define LOADDIR_OPTION_STRING	    "L"
 #define LOADPLUGINDIR_OPTION_STRING "LP"
@@ -140,6 +145,7 @@
 #include "hxtick.h"
 
 #include "chxpckts.h"
+#include "pckunpck.h"
 
 #include "dllpath.h"
 
@@ -155,7 +161,8 @@
                                   REF(ULONG32) ulValue);
 static HX_RESULT AddStringOption(REF(int) ArgIndex, int argc, char *argv[],
                                  IHXValues* pOptions, 
-                                 const char* pOptionName);
+                                 const char* pOptionName,
+				 HXBOOL bAsBuffer = FALSE);
 
 /*
  *  main entry point
@@ -1045,6 +1052,34 @@
 		    RetVal = HXR_PARSE_ERROR;
 		}
 	    }
+	    else if (strcmp(&(argv[ArgIndex][1]), TITLE_OPTION_STRING) == 0)
+	    {
+		RetVal = AddStringOption(ArgIndex, argc, argv, pOptions, 
+                                         TITLE_OPTION_NAME,
+					 TRUE);// set as buffer		
+	    }
+	    else if (strcmp(&(argv[ArgIndex][1]), AUTHOR_OPTION_STRING) == 0)
+	    {
+		RetVal = AddStringOption(ArgIndex, argc, argv, pOptions, 
+                                         AUTHOR_OPTION_NAME,
+					 TRUE);// set as buffer			
+	    }
+	    else if (strcmp(&(argv[ArgIndex][1]), COPYRIGHT_OPTION_STRING) == 0)
+	    {
+		RetVal = AddStringOption(ArgIndex, argc, argv, pOptions, 
+                                         COPYRIGHT_OPTION_NAME,
+					 TRUE);// set as buffer			
+	    }
+	    else if (strcmp(&(argv[ArgIndex][1]), ABSTRACT_OPTION_STRING) == 0)
+	    {
+		RetVal = AddStringOption(ArgIndex, argc, argv, pOptions, 
+                                         ABSTRACT_OPTION_NAME);
+	    }
+	    else if (strcmp(&(argv[ArgIndex][1]), KEYWORDS_OPTION_STRING) == 0)
+	    {
+		RetVal = AddStringOption(ArgIndex, argc, argv, pOptions, 
+                                         KEYWORDS_OPTION_NAME);
+	    }
 #ifdef _MEMPROBE_ENABLED
 	    else if(strcmp(&(argv[ArgIndex][1]), MEMBREAK_OPTION_STRING) == 0)
 	    {
@@ -1285,6 +1320,18 @@
     printf("                       * overrides HELIX_CODECS environment variable setting\n");
     printf("      -%s <Path>    = load encoder SDK from specified path\n", LOADENCSDKDIR_OPTION_STRING);
     printf("                       * overrides HELIX_ENCSDK environment variable setting\n");
+    printf("\n=> Meta Data:\n");
+    printf("     Commands:\n");
+    printf("      -%s <Title>\n", TITLE_OPTION_STRING);
+    printf("                    = Set/Replace title string in the content stream\n");
+    printf("      -%s <Author>\n", AUTHOR_OPTION_STRING);
+    printf("                    = Set/Replace author string in the content stream\n");
+    printf("      -%s <Copyright>\n", COPYRIGHT_OPTION_STRING);
+    printf("                    = Set/Replace copyright string in the content stream\n");
+    printf("      -%s <Abstract>\n", ABSTRACT_OPTION_STRING);
+    printf("                    = Set/Replace abstract string in the content stream\n");
+    printf("      -%s <Keywords>\n", KEYWORDS_OPTION_STRING);
+    printf("                    = Set/Replace keywords string in the content stream\n");
     printf("\n=> Output:\n");
     printf("     Options: (+ = add, - = remove)\n");
     printf("      %c = dump packet content\n", PACKET_OPT);
@@ -1424,7 +1471,7 @@
 }
 
 HX_RESULT AddStringOption(REF(int) ArgIndex, int argc, char *argv[],
-                          IHXValues* pOptions, const char* pOptionName)
+                          IHXValues* pOptions, const char* pOptionName, HXBOOL bAsBuffer)
 {
     HX_RESULT retVal = HXR_PARSE_ERROR;
 
@@ -1441,7 +1488,14 @@
 
             if (SUCCEEDED(retVal))
             {
-                retVal = pOptions->SetPropertyCString(pOptionName, pBuffer);
+		if (bAsBuffer)
+		{
+		    retVal = pOptions->SetPropertyBuffer(pOptionName, pBuffer);
+		}
+		else
+		{
+		    retVal = pOptions->SetPropertyCString(pOptionName, pBuffer);
+		}
             }
 
             HX_RELEASE(pBuffer);


From milko at helixcommunity.org  Mon May 22 18:28:00 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Mon May 22 20:16:23 2006
Subject: [Datatype-cvs] tools/dtdriver/engine ffdriver.cpp,1.30,1.31
Message-ID: <mailman.14898.1148354183.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv5733/engine

Modified Files:
	ffdriver.cpp 
Log Message:
Modified by: milko@real.com
Date: 5:22:06
Project: dtdriver

Synopsis: Enables dtdriver for TAC editing 

Overview:
The changes enables dtdriver to add or replace the following meta-data
properties in the content stream file header:
"Title", "Author", "Copyright", "Abstract", "Keywords".

Command line dtdrive usage for new functionality:
=> Meta Data:
     Commands:
      -TITLE <Title>
                    = Set/Replace title string in the content stream
      -AUTHOR <Author>
                    = Set/Replace author string in the content stream
      -COPYRIGHT <Copyright>
                    = Set/Replace copyright string in the content stream
      -ABSTRACT <Copyright>
                    = Set/Replace abstract string in the content stream
      -KEYWORDS <Keywords>
                    = Set/Replace keywords string in the content stream

Example command line to alter TAC information in an .rm file:
dtdrive input_file.rm -TITLE "New Title" -AUTHOR "New Author" -COPYRIGHT "New Copyright" -W output_file.rm

Files Modified:
/datatype/tools/dtdriver/apps/dtdrive/main.cpp,v
/datatype/tools/dtdriver/engine/ffdriver.cpp,v
/datatype/tools/dtdriver/engine/pub/ffdriver.h,v

Image Size and Heap Use impact (Client -Only):
Very Small increase on dtdriver engine size.

Platforms and Profiles Affected:
all

Distribution Libraries Affected:
none

Distribution library impact and planned action:
n/a

Platforms and Profiles Build Verified:
win32-i386-vc6, helix-client-all-defines

Platforms and Profiles Functionality verified:
win32-i386-vc6, helix-client-all-defines

Branch:
HEAD, hxclient_1_5_0_cayenne



Index: ffdriver.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/ffdriver.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- ffdriver.cpp	9 May 2006 01:09:46 -0000	1.30
+++ ffdriver.cpp	23 May 2006 01:27:58 -0000	1.31
@@ -3279,6 +3279,11 @@
         return HXR_UNEXPECTED;
     }
 
+    if (SUCCEEDED(status) && pHeader)
+    {
+	retVal = ApplyFileHeaderModifications(pHeader);
+    }
+
     if (SUCCEEDED(status))
     {
         if (m_bParseSDP)
@@ -3430,6 +3435,72 @@
     return status;
 }
 
+HX_RESULT FFDriver::ApplyFileHeaderModifications(IHXValues* pHeader)
+{
+    HX_RESULT retVal = HXR_INVALID_PARAMETER;
+
+    if (pHeader)
+    {
+	IHXBuffer* pBuffValue = NULL;
+	HX_RESULT status = HXR_OK;
+	retVal = HXR_OK;
+
+	// Check for Title/Author/Copyright
+	if (SUCCEEDED(m_pOptions->GetPropertyBuffer(TITLE_OPTION_NAME, pBuffValue)))
+	{
+	    status = pHeader->SetPropertyBuffer("Title", pBuffValue);
+	    if (SUCCEEDED(retVal))
+	    {
+		retVal = status;
+	    }
+	}
+	HX_RELEASE(pBuffValue);
+
+	if (SUCCEEDED(m_pOptions->GetPropertyBuffer(AUTHOR_OPTION_NAME, pBuffValue)))
+	{
+	    status = pHeader->SetPropertyBuffer("Author", pBuffValue);
+	    if (SUCCEEDED(retVal))
+	    {
+		retVal = status;
+	    }
+	}
+	HX_RELEASE(pBuffValue);
+
+	if (SUCCEEDED(m_pOptions->GetPropertyBuffer(COPYRIGHT_OPTION_NAME, pBuffValue)))
+	{
+	    status = pHeader->SetPropertyBuffer("Copyright", pBuffValue);
+	    if (SUCCEEDED(retVal))
+	    {
+		retVal = status;
+	    }
+	}
+	HX_RELEASE(pBuffValue);
+
+	// Check for Abstract/Keywords
+	if (SUCCEEDED(m_pOptions->GetPropertyCString(ABSTRACT_OPTION_NAME, pBuffValue)))
+	{
+	    status = pHeader->SetPropertyCString("Abstract", pBuffValue);
+	    if (SUCCEEDED(retVal))
+	    {
+		retVal = status;
+	    }
+	}
+	HX_RELEASE(pBuffValue);
+
+	if (SUCCEEDED(m_pOptions->GetPropertyCString(KEYWORDS_OPTION_NAME, pBuffValue)))
+	{
+	    status = pHeader->SetPropertyCString("Keywords", pBuffValue);
+	    if (SUCCEEDED(retVal))
+	    {
+		retVal = status;
+	    }
+	}
+	HX_RELEASE(pBuffValue);
+    }
+
+    return retVal;
+}
+
 
 STDMETHODIMP FFDriver::StreamHeaderReady(HX_RESULT status, IHXValues* pHeader)
 {
@@ -3465,7 +3536,7 @@
                 // Report error and keep going.
                 ReportError(sdpParseStatus, 
                         "Failed to parse SDP in stream header");
-            };
+            }
         }
     }
 


From milko at helixcommunity.org  Mon May 22 18:28:00 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Mon May 22 20:16:23 2006
Subject: [Datatype-cvs] tools/dtdriver/engine/pub ffdriver.h,1.23,1.24
Message-ID: <mailman.14899.1148354183.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/tools/dtdriver/engine/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv5733/engine/pub

Modified Files:
	ffdriver.h 
Log Message:
Modified by: milko@real.com
Date: 5:22:06
Project: dtdriver

Synopsis: Enables dtdriver for TAC editing 

Overview:
The changes enables dtdriver to add or replace the following meta-data
properties in the content stream file header:
"Title", "Author", "Copyright", "Abstract", "Keywords".

Command line dtdrive usage for new functionality:
=> Meta Data:
     Commands:
      -TITLE <Title>
                    = Set/Replace title string in the content stream
      -AUTHOR <Author>
                    = Set/Replace author string in the content stream
      -COPYRIGHT <Copyright>
                    = Set/Replace copyright string in the content stream
      -ABSTRACT <Copyright>
                    = Set/Replace abstract string in the content stream
      -KEYWORDS <Keywords>
                    = Set/Replace keywords string in the content stream

Example command line to alter TAC information in an .rm file:
dtdrive input_file.rm -TITLE "New Title" -AUTHOR "New Author" -COPYRIGHT "New Copyright" -W output_file.rm

Files Modified:
/datatype/tools/dtdriver/apps/dtdrive/main.cpp,v
/datatype/tools/dtdriver/engine/ffdriver.cpp,v
/datatype/tools/dtdriver/engine/pub/ffdriver.h,v

Image Size and Heap Use impact (Client -Only):
Very Small increase on dtdriver engine size.

Platforms and Profiles Affected:
all

Distribution Libraries Affected:
none

Distribution library impact and planned action:
n/a

Platforms and Profiles Build Verified:
win32-i386-vc6, helix-client-all-defines

Platforms and Profiles Functionality verified:
win32-i386-vc6, helix-client-all-defines

Branch:
HEAD, hxclient_1_5_0_cayenne



Index: ffdriver.h
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/pub/ffdriver.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- ffdriver.h	4 May 2006 00:28:49 -0000	1.23
+++ ffdriver.h	23 May 2006 01:27:58 -0000	1.24
@@ -61,6 +61,11 @@
 #define TIMING_OPTION_NAME	    "Timing"
 #define EVENT_OPTION_NAME	    "Event"
 #define DURATION_OPTION_NAME	    "Duration"
+#define TITLE_OPTION_NAME   	    "Title"
+#define AUTHOR_OPTION_NAME	    "Author"
+#define COPYRIGHT_OPTION_NAME	    "Copyright"
+#define ABSTRACT_OPTION_NAME	    "Abstract"
+#define KEYWORDS_OPTION_NAME	    "Keywords"
 #define PREROLL_OPTION_NAME	    "RecomputePreroll"
 #define BLASTFILE_OPTION_NAME	    "BlastFiles"
 #define ROTATIONSIZE_OPTION_NAME    "RotationSize"
@@ -462,6 +467,7 @@
 
     HX_RESULT	InternalizeSource(char *pInputFileName);
     HX_RESULT	InternalizeSourceHandlerList(IHXSourceHandler** pSourceHandlerList);
+    HX_RESULT	ApplyFileHeaderModifications(IHXValues* pHeader);
     HX_RESULT	CreateWriterProps(IHXValues* &pWriterProps);
     HX_RESULT	InitGetPacketEngine(UINT16 uStreamCount);
     HX_RESULT	ConfigureDecodePosition(void);


From milko at helixcommunity.org  Mon May 22 18:30:07 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Mon May 22 20:18:29 2006
Subject: [Datatype-cvs] tools/dtdriver/apps/dtdrive main.cpp, 1.20.2.1,
	1.20.2.2
Message-ID: <mailman.14900.1148354309.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/tools/dtdriver/apps/dtdrive
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv6613/apps/dtdrive

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	main.cpp 
Log Message:
Modified by: milko@real.com
Date: 5:22:06
Project: dtdriver

Synopsis: Enables dtdriver for TAC editing 

Overview:
The changes enables dtdriver to add or replace the following meta-data
properties in the content stream file header:
"Title", "Author", "Copyright", "Abstract", "Keywords".

Command line dtdrive usage for new functionality:
=> Meta Data:
     Commands:
      -TITLE <Title>
                    = Set/Replace title string in the content stream
      -AUTHOR <Author>
                    = Set/Replace author string in the content stream
      -COPYRIGHT <Copyright>
                    = Set/Replace copyright string in the content stream
      -ABSTRACT <Copyright>
                    = Set/Replace abstract string in the content stream
      -KEYWORDS <Keywords>
                    = Set/Replace keywords string in the content stream

Example command line to alter TAC information in an .rm file:
dtdrive input_file.rm -TITLE "New Title" -AUTHOR "New Author" -COPYRIGHT "New Copyright" -W output_file.rm

Files Modified:
/datatype/tools/dtdriver/apps/dtdrive/main.cpp,v
/datatype/tools/dtdriver/engine/ffdriver.cpp,v
/datatype/tools/dtdriver/engine/pub/ffdriver.h,v

Image Size and Heap Use impact (Client -Only):
Very Small increase on dtdriver engine size.

Platforms and Profiles Affected:
all

Distribution Libraries Affected:
none

Distribution library impact and planned action:
n/a

Platforms and Profiles Build Verified:
win32-i386-vc6, helix-client-all-defines

Platforms and Profiles Functionality verified:
win32-i386-vc6, helix-client-all-defines

Branch:
HEAD, hxclient_1_5_0_cayenne



Index: main.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/apps/dtdrive/main.cpp,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -u -d -r1.20.2.1 -r1.20.2.2
--- main.cpp	19 Apr 2006 01:11:59 -0000	1.20.2.1
+++ main.cpp	23 May 2006 01:30:05 -0000	1.20.2.2
@@ -70,6 +70,11 @@
 #define SERVER_OPTION_STRING	    "S"
 #define TIMER_OPTION_STRING	    "T"
 #define WRITE_OPTION_STRING	    "W"
+#define TITLE_OPTION_STRING	    "TITLE"
+#define AUTHOR_OPTION_STRING	    "AUTHOR"
+#define COPYRIGHT_OPTION_STRING	    "COPYRIGHT"
+#define ABSTRACT_OPTION_STRING	    "ABSTRACT"
+#define KEYWORDS_OPTION_STRING	    "KEYWORDS"
 #define TEMPDIR_OPTION_STRING	    "TD"
 #define LOADDIR_OPTION_STRING	    "L"
 #define LOADPLUGINDIR_OPTION_STRING "LP"
@@ -138,6 +143,7 @@
 #include "hxtick.h"
 
 #include "chxpckts.h"
+#include "pckunpck.h"
 
 #include "dllpath.h"
 
@@ -1001,6 +1007,87 @@
 		    RetVal = HXR_PARSE_ERROR;
 		}
 	    }
+	    else if (strcmp(&(argv[ArgIndex][1]), TITLE_OPTION_STRING) == 0)
+	    {
+		ArgIndex++;
+		if (ArgIndex < argc)
+		{
+		    RetVal = SetCStringProperty(pOptions,
+						TITLE_OPTION_NAME,
+						argv[ArgIndex],
+						NULL,
+						TRUE);	// set as buffer
+		}
+		else
+		{
+		    RetVal = HXR_PARSE_ERROR;
+		}
+		
+	    }
+	    else if (strcmp(&(argv[ArgIndex][1]), AUTHOR_OPTION_STRING) == 0)
+	    {
+		ArgIndex++;
+		if (ArgIndex < argc)
+		{
+		    RetVal = SetCStringProperty(pOptions,
+						AUTHOR_OPTION_NAME,
+						argv[ArgIndex],
+						NULL,
+						TRUE);	// set as buffer
+		}
+		else
+		{
+		    RetVal = HXR_PARSE_ERROR;
+		}
+		
+	    }
+	    else if (strcmp(&(argv[ArgIndex][1]), COPYRIGHT_OPTION_STRING) == 0)
+	    {
+		ArgIndex++;
+		if (ArgIndex < argc)
+		{
+		    RetVal = SetCStringProperty(pOptions,
+						COPYRIGHT_OPTION_NAME,
+						argv[ArgIndex],
+						NULL,
+						TRUE);	// set as buffer
+		}
+		else
+		{
+		    RetVal = HXR_PARSE_ERROR;
+		}
+		
+	    }
+	    else if (strcmp(&(argv[ArgIndex][1]), ABSTRACT_OPTION_STRING) == 0)
+	    {
+		ArgIndex++;
+		if (ArgIndex < argc)
+		{
+		    RetVal = SetCStringProperty(pOptions,
+						ABSTRACT_OPTION_NAME,
+						argv[ArgIndex]);
+		}
+		else
+		{
+		    RetVal = HXR_PARSE_ERROR;
+		}
+		
+	    }
+	    else if (strcmp(&(argv[ArgIndex][1]), KEYWORDS_OPTION_STRING) == 0)
+	    {
+		ArgIndex++;
+		if (ArgIndex < argc)
+		{
+		    RetVal = SetCStringProperty(pOptions,
+						KEYWORDS_OPTION_NAME,
+						argv[ArgIndex]);
+		}
+		else
+		{
+		    RetVal = HXR_PARSE_ERROR;
+		}
+		
+	    }
 #ifdef _MEMPROBE_ENABLED
 	    else if(strcmp(&(argv[ArgIndex][1]), MEMBREAK_OPTION_STRING) == 0)
 	    {
@@ -1241,6 +1328,18 @@
     printf("                       * overrides HELIX_CODECS environment variable setting\n");
     printf("      -%s <Path>    = load encoder SDK from specified path\n", LOADENCSDKDIR_OPTION_STRING);
     printf("                       * overrides HELIX_ENCSDK environment variable setting\n");
+    printf("\n=> Meta Data:\n");
+    printf("     Commands:\n");
+    printf("      -%s <Title>\n", TITLE_OPTION_STRING);
+    printf("                    = Set/Replace title string in the content stream\n");
+    printf("      -%s <Author>\n", AUTHOR_OPTION_STRING);
+    printf("                    = Set/Replace author string in the content stream\n");
+    printf("      -%s <Copyright>\n", COPYRIGHT_OPTION_STRING);
+    printf("                    = Set/Replace copyright string in the content stream\n");
+    printf("      -%s <Abstract>\n", ABSTRACT_OPTION_STRING);
+    printf("                    = Set/Replace abstract string in the content stream\n");
+    printf("      -%s <Keywords>\n", KEYWORDS_OPTION_STRING);
+    printf("                    = Set/Replace keywords string in the content stream\n");
     printf("\n=> Output:\n");
     printf("     Options: (+ = add, - = remove)\n");
     printf("      %c = dump packet content\n", PACKET_OPT);


From milko at helixcommunity.org  Mon May 22 18:30:07 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Mon May 22 20:18:30 2006
Subject: [Datatype-cvs] tools/dtdriver/engine ffdriver.cpp, 1.22.4.7,
	1.22.4.8
Message-ID: <mailman.14901.1148354310.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv6613/engine

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	ffdriver.cpp 
Log Message:
Modified by: milko@real.com
Date: 5:22:06
Project: dtdriver

Synopsis: Enables dtdriver for TAC editing 

Overview:
The changes enables dtdriver to add or replace the following meta-data
properties in the content stream file header:
"Title", "Author", "Copyright", "Abstract", "Keywords".

Command line dtdrive usage for new functionality:
=> Meta Data:
     Commands:
      -TITLE <Title>
                    = Set/Replace title string in the content stream
      -AUTHOR <Author>
                    = Set/Replace author string in the content stream
      -COPYRIGHT <Copyright>
                    = Set/Replace copyright string in the content stream
      -ABSTRACT <Copyright>
                    = Set/Replace abstract string in the content stream
      -KEYWORDS <Keywords>
                    = Set/Replace keywords string in the content stream

Example command line to alter TAC information in an .rm file:
dtdrive input_file.rm -TITLE "New Title" -AUTHOR "New Author" -COPYRIGHT "New Copyright" -W output_file.rm

Files Modified:
/datatype/tools/dtdriver/apps/dtdrive/main.cpp,v
/datatype/tools/dtdriver/engine/ffdriver.cpp,v
/datatype/tools/dtdriver/engine/pub/ffdriver.h,v

Image Size and Heap Use impact (Client -Only):
Very Small increase on dtdriver engine size.

Platforms and Profiles Affected:
all

Distribution Libraries Affected:
none

Distribution library impact and planned action:
n/a

Platforms and Profiles Build Verified:
win32-i386-vc6, helix-client-all-defines

Platforms and Profiles Functionality verified:
win32-i386-vc6, helix-client-all-defines

Branch:
HEAD, hxclient_1_5_0_cayenne



Index: ffdriver.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/ffdriver.cpp,v
retrieving revision 1.22.4.7
retrieving revision 1.22.4.8
diff -u -d -r1.22.4.7 -r1.22.4.8
--- ffdriver.cpp	9 May 2006 01:18:35 -0000	1.22.4.7
+++ ffdriver.cpp	23 May 2006 01:30:05 -0000	1.22.4.8
@@ -3281,6 +3281,11 @@
         return HXR_UNEXPECTED;
     }
 
+    if (SUCCEEDED(status) && pHeader)
+    {
+	retVal = ApplyFileHeaderModifications(pHeader);
+    }
+
     if (SUCCEEDED(status))
     {
         if (m_bParseSDP)
@@ -3297,7 +3302,7 @@
                 // Report error and keep going
                 ReportError(sdpParseStatus, 
                         "Failed to parse SDP in file header");
-            };
+            }
         }
     }
 
@@ -3353,7 +3358,7 @@
         retVal = HXR_UNEXPECTED;
         return retVal;
     }
-
+    
     /* get the stream count */
     if (pHeader == NULL)
     {
@@ -3432,6 +3437,72 @@
     return status;
 }
 
+HX_RESULT FFDriver::ApplyFileHeaderModifications(IHXValues* pHeader)
+{
+    HX_RESULT retVal = HXR_INVALID_PARAMETER;
+
+    if (pHeader)
+    {
+	IHXBuffer* pBuffValue = NULL;
+	HX_RESULT status = HXR_OK;
+	retVal = HXR_OK;
+
+	// Check for Title/Author/Copyright
+	if (SUCCEEDED(m_pOptions->GetPropertyBuffer(TITLE_OPTION_NAME, pBuffValue)))
+	{
+	    status = pHeader->SetPropertyBuffer("Title", pBuffValue);
+	    if (SUCCEEDED(retVal))
+	    {
+		retVal = status;
+	    }
+	}
+	HX_RELEASE(pBuffValue);
+
+	if (SUCCEEDED(m_pOptions->GetPropertyBuffer(AUTHOR_OPTION_NAME, pBuffValue)))
+	{
+	    status = pHeader->SetPropertyBuffer("Author", pBuffValue);
+	    if (SUCCEEDED(retVal))
+	    {
+		retVal = status;
+	    }
+	}
+	HX_RELEASE(pBuffValue);
+
+	if (SUCCEEDED(m_pOptions->GetPropertyBuffer(COPYRIGHT_OPTION_NAME, pBuffValue)))
+	{
+	    status = pHeader->SetPropertyBuffer("Copyright", pBuffValue);
+	    if (SUCCEEDED(retVal))
+	    {
+		retVal = status;
+	    }
+	}
+	HX_RELEASE(pBuffValue);
+
+	// Check for Abstract/Keywords
+	if (SUCCEEDED(m_pOptions->GetPropertyCString(ABSTRACT_OPTION_NAME, pBuffValue)))
+	{
+	    status = pHeader->SetPropertyCString("Abstract", pBuffValue);
+	    if (SUCCEEDED(retVal))
+	    {
+		retVal = status;
+	    }
+	}
+	HX_RELEASE(pBuffValue);
+
+	if (SUCCEEDED(m_pOptions->GetPropertyCString(KEYWORDS_OPTION_NAME, pBuffValue)))
+	{
+	    status = pHeader->SetPropertyCString("Keywords", pBuffValue);
+	    if (SUCCEEDED(retVal))
+	    {
+		retVal = status;
+	    }
+	}
+	HX_RELEASE(pBuffValue);
+    }
+
+    return retVal;
+}
+
 
 STDMETHODIMP FFDriver::StreamHeaderReady(HX_RESULT status, IHXValues* pHeader)
 {


From milko at helixcommunity.org  Mon May 22 18:30:08 2006
From: milko at helixcommunity.org (milko@helixcommunity.org)
Date: Mon May 22 20:18:30 2006
Subject: [Datatype-cvs] tools/dtdriver/engine/pub ffdriver.h, 1.19.2.5,
	1.19.2.6
Message-ID: <mailman.14902.1148354310.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/tools/dtdriver/engine/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv6613/engine/pub

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	ffdriver.h 
Log Message:
Modified by: milko@real.com
Date: 5:22:06
Project: dtdriver

Synopsis: Enables dtdriver for TAC editing 

Overview:
The changes enables dtdriver to add or replace the following meta-data
properties in the content stream file header:
"Title", "Author", "Copyright", "Abstract", "Keywords".

Command line dtdrive usage for new functionality:
=> Meta Data:
     Commands:
      -TITLE <Title>
                    = Set/Replace title string in the content stream
      -AUTHOR <Author>
                    = Set/Replace author string in the content stream
      -COPYRIGHT <Copyright>
                    = Set/Replace copyright string in the content stream
      -ABSTRACT <Copyright>
                    = Set/Replace abstract string in the content stream
      -KEYWORDS <Keywords>
                    = Set/Replace keywords string in the content stream

Example command line to alter TAC information in an .rm file:
dtdrive input_file.rm -TITLE "New Title" -AUTHOR "New Author" -COPYRIGHT "New Copyright" -W output_file.rm

Files Modified:
/datatype/tools/dtdriver/apps/dtdrive/main.cpp,v
/datatype/tools/dtdriver/engine/ffdriver.cpp,v
/datatype/tools/dtdriver/engine/pub/ffdriver.h,v

Image Size and Heap Use impact (Client -Only):
Very Small increase on dtdriver engine size.

Platforms and Profiles Affected:
all

Distribution Libraries Affected:
none

Distribution library impact and planned action:
n/a

Platforms and Profiles Build Verified:
win32-i386-vc6, helix-client-all-defines

Platforms and Profiles Functionality verified:
win32-i386-vc6, helix-client-all-defines

Branch:
HEAD, hxclient_1_5_0_cayenne



Index: ffdriver.h
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/pub/ffdriver.h,v
retrieving revision 1.19.2.5
retrieving revision 1.19.2.6
diff -u -d -r1.19.2.5 -r1.19.2.6
--- ffdriver.h	24 Apr 2006 19:09:04 -0000	1.19.2.5
+++ ffdriver.h	23 May 2006 01:30:05 -0000	1.19.2.6
@@ -61,6 +61,11 @@
 #define TIMING_OPTION_NAME	    "Timing"
 #define EVENT_OPTION_NAME	    "Event"
 #define DURATION_OPTION_NAME	    "Duration"
+#define TITLE_OPTION_NAME   	    "Title"
+#define AUTHOR_OPTION_NAME	    "Author"
+#define COPYRIGHT_OPTION_NAME	    "Copyright"
+#define ABSTRACT_OPTION_NAME	    "Abstract"
+#define KEYWORDS_OPTION_NAME	    "Keywords"
 #define PREROLL_OPTION_NAME	    "RecomputePreroll"
 #define BLASTFILE_OPTION_NAME	    "BlastFiles"
 #define ROTATIONSIZE_OPTION_NAME    "RotationSize"
@@ -461,6 +466,7 @@
 
     HX_RESULT	InternalizeSource(char *pInputFileName);
     HX_RESULT	InternalizeSourceHandlerList(IHXSourceHandler** pSourceHandlerList);
+    HX_RESULT	ApplyFileHeaderModifications(IHXValues* pHeader);
     HX_RESULT	CreateWriterProps(IHXValues* &pWriterProps);
     HX_RESULT	InitGetPacketEngine(UINT16 uStreamCount);
     HX_RESULT	ConfigureDecodePosition(void);


From karll at helixcommunity.org  Tue May 23 13:03:01 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Tue May 23 14:51:12 2006
Subject: [Datatype-cvs] rm/include hxmtypes.h,1.2.4.1,1.2.4.2
Message-ID: <mailman.14916.1148421072.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/rm/include
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv26621

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	hxmtypes.h 
Log Message:
added HX_AVC1VIDEO_ID 0x41564331 // 'AVC1'


Index: hxmtypes.h
===================================================================
RCS file: /cvsroot/datatype/rm/include/hxmtypes.h,v
retrieving revision 1.2.4.1
retrieving revision 1.2.4.2
diff -u -d -r1.2.4.1 -r1.2.4.2
--- hxmtypes.h	17 Mar 2005 04:28:59 -0000	1.2.4.1
+++ hxmtypes.h	23 May 2006 20:02:59 -0000	1.2.4.2
@@ -61,6 +61,7 @@
 #define HX_RGB24_ID	0x20524742L	// ' RGB' 24 bit RGB top-down format
 #define HX_8BIT_ID	0x38424954L	// '8BIT' 8 Bit dithered format
 
+#define HX_AVC1VIDEO_ID 0x41564331 // 'AVC1'
 #define HX_MP4VVIDEO_ID 0x4d503456 // 'MP4V'
 #define HX_CLEARVIDEO_ID 0x434C5631 // 'CLV1'
 


From jeffl at helixcommunity.org  Wed May 24 10:09:10 2006
From: jeffl at helixcommunity.org (jeffl@helixcommunity.org)
Date: Wed May 24 11:57:07 2006
Subject: [Datatype-cvs] common/basehost base_hosted_factory.cpp, 1.1,
	1.2 base_hosted_fileformat.cpp, 1.2,
	1.3 base_hosted_renderer.cpp, 1.2,
	1.3 base_playlist_fileformat.cpp, 1.2,
	1.3 base_playlist_renderer.cpp, 1.2, 1.3
Message-ID: <mailman.14965.1148497027.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/common/basehost
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv20989

Modified Files:
	base_hosted_factory.cpp base_hosted_fileformat.cpp 
	base_hosted_renderer.cpp base_playlist_fileformat.cpp 
	base_playlist_renderer.cpp 
Log Message:
Changed classes to derive from CUnknownIMP.  Added smart pointer definitions to hxguestplayer.h
CR by Eric Hyche


Index: base_playlist_renderer.cpp
===================================================================
RCS file: /cvsroot/datatype/common/basehost/base_playlist_renderer.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- base_playlist_renderer.cpp	16 May 2006 14:06:57 -0000	1.2
+++ base_playlist_renderer.cpp	24 May 2006 17:09:05 -0000	1.3
@@ -71,9 +71,18 @@
 
 #define MAX_NUM_URLS 1000
 
+BEGIN_INTERFACE_LIST(CBaseHostedPlaylistRenderer)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXPlugin)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXRenderer)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXPersistentRenderer)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXGroupSink)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXRendererAdviseSink)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXGuestPlayerResponse)
+INTERFACE_LIST_ENTRY_MEMBER(IID_IHXGuestPlayer, m_pGuestPlayer)
+END_INTERFACE_LIST
+
 CBaseHostedPlaylistRenderer::CBaseHostedPlaylistRenderer()
-    : m_lRefCount(0)
-    , m_pGuestPlayerCreator(NULL)
+    : m_pGuestPlayerCreator(NULL)
     , m_pContext(NULL)
     , m_pStream(NULL)
     , m_pPlayer(NULL)
@@ -128,49 +137,6 @@
     m_bAddedResponse                = FALSE;
 }
 
-STDMETHODIMP CBaseHostedPlaylistRenderer::QueryInterface(REFIID riid, void** ppvObj)
-{
-    HX_RESULT retVal = HXR_OK;
-
-    QInterfaceList qiList[] =
-    {
-        {GET_IIDHANDLE(IID_IUnknown),               (IUnknown*)(IHXPlugin*)   this},
-        {GET_IIDHANDLE(IID_IHXPlugin),              (IHXPlugin*)              this},
-        {GET_IIDHANDLE(IID_IHXRenderer),            (IHXRenderer*)            this},
-        {GET_IIDHANDLE(IID_IHXPersistentRenderer),  (IHXPersistentRenderer*)  this},
-        {GET_IIDHANDLE(IID_IHXGroupSink),           (IHXGroupSink*)           this},
-        {GET_IIDHANDLE(IID_IHXRendererAdviseSink),  (IHXRendererAdviseSink*)  this},
-        {GET_IIDHANDLE(IID_IHXGuestPlayerResponse), (IHXGuestPlayerResponse*) this}
-    };
-
-    retVal = QIFind(qiList, QILISTSIZE(qiList), riid, ppvObj);
-    if (FAILED(retVal))
-    {
-        if (IsEqualIID(riid, IID_IHXGuestPlayer) && m_pGuestPlayer)
-        {
-            retVal = m_pGuestPlayer->QueryInterface(riid, ppvObj);
-        }
-    }
-
-    return retVal;
-}
-
-STDMETHODIMP_(ULONG32) CBaseHostedPlaylistRenderer::AddRef()
-{
-    return InterlockedIncrement(&m_lRefCount);
-}
-
-STDMETHODIMP_(ULONG32) CBaseHostedPlaylistRenderer::Release()
-{
-    if (InterlockedDecrement(&m_lRefCount) > 0)
-    {
-        return m_lRefCount;
-    }
-
-    delete this;
-    return 0;
-}
-
 STDMETHODIMP CBaseHostedPlaylistRenderer::GetPluginInfo(REF(HXBOOL)      rbLoadMultiple,
                                                         REF(const char*) rpszDescription,
                                                         REF(const char*) rpszCopyright,

Index: base_hosted_fileformat.cpp
===================================================================
RCS file: /cvsroot/datatype/common/basehost/base_hosted_fileformat.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- base_hosted_fileformat.cpp	16 May 2006 14:06:57 -0000	1.2
+++ base_hosted_fileformat.cpp	24 May 2006 17:09:05 -0000	1.3
@@ -64,9 +64,18 @@
 const char* const CBaseHostedFileFormat::m_pszCopyright   = HXVER_COPYRIGHT;
 const char* const CBaseHostedFileFormat::m_pszMoreInfoURL = HXVER_MOREINFO;
 
+BEGIN_INTERFACE_LIST(CBaseHostedFileFormat)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXPlugin)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXPluginProperties)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXFileFormatObject)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXInterruptSafe)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXPendingStatus)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXGuestPlayerResponse)
+INTERFACE_LIST_ENTRY_MEMBER(IID_IHXGuestPlayer, m_pGuestPlayer)
+END_INTERFACE_LIST
+
 CBaseHostedFileFormat::CBaseHostedFileFormat()
-    : m_lRefCount(0)
-    , m_pGuestPlayerCreator(NULL)
+    : m_pGuestPlayerCreator(NULL)
     , m_pContext(NULL)
     , m_pErrorMessages(NULL)
     , m_pRequest(NULL)
@@ -98,49 +107,6 @@
     Close();
 }
 
-STDMETHODIMP CBaseHostedFileFormat::QueryInterface(REFIID riid, void** ppvObj)
-{
-    HX_RESULT retVal = HXR_OK;
-
-    QInterfaceList qiList[] =
-    {
-        {GET_IIDHANDLE(IID_IUnknown),               (IUnknown*)(IHXPlugin*)   this},
-        {GET_IIDHANDLE(IID_IHXPlugin),              (IHXPlugin*)              this},
-        {GET_IIDHANDLE(IID_IHXPluginProperties),    (IHXPluginProperties*)    this},
-        {GET_IIDHANDLE(IID_IHXFileFormatObject),    (IHXFileFormatObject*)    this},
-        {GET_IIDHANDLE(IID_IHXInterruptSafe),       (IHXInterruptSafe*)       this},
-        {GET_IIDHANDLE(IID_IHXPendingStatus),       (IHXPendingStatus*)       this},
-        {GET_IIDHANDLE(IID_IHXGuestPlayerResponse), (IHXGuestPlayerResponse*) this}
-    };
-
-    retVal = QIFind(qiList, QILISTSIZE(qiList), riid, ppvObj);
-    if (FAILED(retVal))
-    {
-        if (IsEqualIID(riid, IID_IHXGuestPlayer) && m_pGuestPlayer)
-        {
-            retVal = m_pGuestPlayer->QueryInterface(riid, ppvObj);
-        }
-    }
-
-    return retVal;
-}
-
-STDMETHODIMP_(ULONG32) CBaseHostedFileFormat::AddRef()
-{
-    return InterlockedIncrement(&m_lRefCount);
-}
-
-STDMETHODIMP_(ULONG32) CBaseHostedFileFormat::Release()
-{
-    if (InterlockedDecrement(&m_lRefCount) > 0)
-    {
-        return m_lRefCount;
-    }
-
-    delete this;
-    return 0;
-}
-
 STDMETHODIMP CBaseHostedFileFormat::GetPluginInfo(REF(HXBOOL)      rbLoadMultiple,
                                                   REF(const char*) rpszDescription,
                                                   REF(const char*) rpszCopyright,

Index: base_hosted_factory.cpp
===================================================================
RCS file: /cvsroot/datatype/common/basehost/base_hosted_factory.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- base_hosted_factory.cpp	16 May 2006 14:06:57 -0000	1.1
+++ base_hosted_factory.cpp	24 May 2006 17:09:05 -0000	1.2
@@ -54,6 +54,10 @@
 #include "base_playlist_fileformat.h"
 #include "base_playlist_renderer.h"
 
+BEGIN_INTERFACE_LIST_NOCREATE(CHXBaseHostedPluginFactory)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXPluginFactory)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXGuestPlayerCreator)
+END_INTERFACE_LIST
 
 HX_RESULT (STDAPICALLTYPE* CHXBaseHostedPluginFactory::m_fpCreateInstanceArray[])(IHXGuestPlayerCreator*,IUnknown**) =
 {
@@ -65,40 +69,10 @@
 };
 
 CHXBaseHostedPluginFactory::CHXBaseHostedPluginFactory()
-    : m_lRefCount(0)
-    , m_usNumPlugins(0)
-{
-}
-
-STDMETHODIMP CHXBaseHostedPluginFactory::QueryInterface(REFIID riid, void** ppvObj)
-{
-    QInterfaceList qiList[] =
-    {
-        {GET_IIDHANDLE(IID_IUnknown),              (IUnknown*)(IHXPluginFactory*) this},
-        {GET_IIDHANDLE(IID_IHXPluginFactory),      (IHXPluginFactory*)            this},
-        {GET_IIDHANDLE(IID_IHXGuestPlayerCreator), (IHXGuestPlayerCreator*)       this}
-    };
-
-    return QIFind(qiList, QILISTSIZE(qiList), riid, ppvObj);
-}
-
-STDMETHODIMP_(ULONG32) CHXBaseHostedPluginFactory::AddRef()
-{
-    return InterlockedIncrement(&m_lRefCount);
-}
-
-STDMETHODIMP_(ULONG32) CHXBaseHostedPluginFactory::Release()
+    : m_usNumPlugins(0)
 {
-    if (InterlockedDecrement(&m_lRefCount) > 0)
-    {
-        return m_lRefCount;
-    }
-
-    delete this;
-    return 0;
 }
 
-
 STDMETHODIMP_(UINT16) CHXBaseHostedPluginFactory::GetNumPlugins()
 {
     return m_usNumPlugins;

Index: base_hosted_renderer.cpp
===================================================================
RCS file: /cvsroot/datatype/common/basehost/base_hosted_renderer.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- base_hosted_renderer.cpp	16 May 2006 14:06:57 -0000	1.2
+++ base_hosted_renderer.cpp	24 May 2006 17:09:05 -0000	1.3
@@ -71,6 +71,18 @@
 const char* const CBaseHostedRenderer::m_pszCopyright   = HXVER_COPYRIGHT;
 const char* const CBaseHostedRenderer::m_pszMoreInfoURL = HXVER_MOREINFO;
 
+BEGIN_INTERFACE_LIST(CBaseHostedRenderer)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXPlugin)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXRenderer)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXSiteUser)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXStatistics)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXPlaybackVelocity)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXClockSource)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXUpdateProperties)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXVolumeAdviseSink)
+INTERFACE_LIST_ENTRY_SIMPLE(IHXGuestPlayerResponse)
+END_INTERFACE_LIST
+
 const HXHostStatInfo CBaseHostedRenderer::m_pSourceStatsInfo[HXHOST_NUM_SOURCE_STATS] =
 {
     {HXHOST_SOURCE_STATS_NUM_PACKETS_RECEIVED,  REG_TYPE_NUMBER, HXGUEST_STATPROP_RECEIVED      },
@@ -108,8 +120,7 @@
 };
 
 CBaseHostedRenderer::CBaseHostedRenderer()
-    : m_lRefCount(0)
-    , m_pGuestPlayerCreator(NULL)
+    : m_pGuestPlayerCreator(NULL)
     , m_pContext(NULL)
     , m_pStream(NULL)
     , m_pPlayer(NULL)
@@ -180,45 +191,6 @@
     m_bKeyFrameMode      = FALSE;
 }
 
-STDMETHODIMP CBaseHostedRenderer::QueryInterface(REFIID riid, void** ppvObj)
-{
-    HX_RESULT retVal = HXR_OK;
-
-    QInterfaceList qiList[] =
-    {
-        {GET_IIDHANDLE(IID_IUnknown),               (IUnknown*)(IHXPlugin*)   this},
-        {GET_IIDHANDLE(IID_IHXPlugin),              (IHXPlugin*)              this},
-        {GET_IIDHANDLE(IID_IHXRenderer),            (IHXRenderer*)            this},
-        {GET_IIDHANDLE(IID_IHXSiteUser),            (IHXSiteUser*)            this},
-        {GET_IIDHANDLE(IID_IHXStatistics),          (IHXStatistics*)          this},
-        {GET_IIDHANDLE(IID_IHXPlaybackVelocity),    (IHXPlaybackVelocity*)    this},
-        {GET_IIDHANDLE(IID_IHXClockSource),         (IHXClockSource*)         this},
-        {GET_IIDHANDLE(IID_IHXUpdateProperties),    (IHXUpdateProperties*)    this},
-        {GET_IIDHANDLE(IID_IHXVolumeAdviseSink),    (IHXVolumeAdviseSink*)    this},
-        {GET_IIDHANDLE(IID_IHXGuestPlayerResponse), (IHXGuestPlayerResponse*) this}
-    };
-
-    retVal = QIFind(qiList, QILISTSIZE(qiList), riid, ppvObj);
-
-    return retVal;
-}
-
-STDMETHODIMP_(ULONG32) CBaseHostedRenderer::AddRef()
-{
-    return InterlockedIncrement(&m_lRefCount);
-}
-
-STDMETHODIMP_(ULONG32) CBaseHostedRenderer::Release()
-{
-    if (InterlockedDecrement(&m_lRefCount) > 0)
-    {
-        return m_lRefCount;
-    }
-
-    delete this;
-    return 0;
-}
-
 STDMETHODIMP CBaseHostedRenderer::GetPluginInfo(REF(HXBOOL)      rbLoadMultiple,
                                                 REF(const char*) rpszDescription,
                                                 REF(const char*) rpszCopyright,

Index: base_playlist_fileformat.cpp
===================================================================
RCS file: /cvsroot/datatype/common/basehost/base_playlist_fileformat.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- base_playlist_fileformat.cpp	16 May 2006 14:06:57 -0000	1.2
+++ base_playlist_fileformat.cpp	24 May 2006 17:09:05 -0000	1.3
@@ -55,6 +55,9 @@
 #include "hxrendr.h"
 #include "hxfiles.h"
 
+BEGIN_INTERFACE_LIST(CBaseHostedPlaylistEnabledFileFormat)
+END_INTERFACE_LIST_BASE(CBaseHostedFileFormat)
+
 CBaseHostedPlaylistEnabledFileFormat::CBaseHostedPlaylistEnabledFileFormat()
     : CBaseHostedFileFormat()
     , m_bCreatedGuestPlayer(FALSE)


From jeffl at helixcommunity.org  Wed May 24 10:09:11 2006
From: jeffl at helixcommunity.org (jeffl@helixcommunity.org)
Date: Wed May 24 11:57:09 2006
Subject: [Datatype-cvs] common/basehost/pub base_hosted_factory.h, 1.1,
	1.2 base_hosted_fileformat.h, 1.3, 1.4 base_hosted_renderer.h,
	1.2, 1.3 base_playlist_fileformat.h, 1.2,
	1.3 base_playlist_renderer.h, 1.2, 1.3 hxguestplayer.h, 1.2, 1.3
Message-ID: <mailman.14966.1148497029.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/common/basehost/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv20989/pub

Modified Files:
	base_hosted_factory.h base_hosted_fileformat.h 
	base_hosted_renderer.h base_playlist_fileformat.h 
	base_playlist_renderer.h hxguestplayer.h 
Log Message:
Changed classes to derive from CUnknownIMP.  Added smart pointer definitions to hxguestplayer.h
CR by Eric Hyche


Index: base_hosted_factory.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/base_hosted_factory.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- base_hosted_factory.h	16 May 2006 14:07:01 -0000	1.1
+++ base_hosted_factory.h	24 May 2006 17:09:08 -0000	1.2
@@ -52,20 +52,19 @@
 #include "hxplugn.h"
 #include "hxguestplayer.h"
 #include "baseobj.h"
+#include "unkimp.h"
 
-class CHXBaseHostedPluginFactory : public IHXPluginFactory,
+class CHXBaseHostedPluginFactory : public CUnknownIMP,
+                                   public IHXPluginFactory,
                                    public IHXGuestPlayerCreator,
                                    public CHXBaseCountingObject
 {
+    DECLARE_UNKNOWN_NOCREATE(CHXBaseHostedPluginFactory);
+
 public:
     CHXBaseHostedPluginFactory();
     virtual ~CHXBaseHostedPluginFactory() {};
 
-    // IUnknown methods
-    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj);
-    STDMETHOD_(ULONG32,AddRef)  (THIS);
-    STDMETHOD_(ULONG32,Release) (THIS);
-
     // IHXPluginFactory methods
     STDMETHOD_(UINT16,GetNumPlugins) (THIS);
     STDMETHOD(GetPlugin)             (THIS_ UINT16 usIndex, IUnknown** ppPlugin);
@@ -88,7 +87,6 @@
     // CHXBaseHostedPluginFactory methods
     STDMETHOD(Init) (THIS);
 protected:
-    INT32  m_lRefCount;
     UINT16 m_usNumPlugins;
 
     static HX_RESULT (STDAPICALLTYPE* m_fpCreateInstanceArray[])(IHXGuestPlayerCreator*,IUnknown**);

Index: hxguestplayer.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/hxguestplayer.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hxguestplayer.h	16 May 2006 14:07:01 -0000	1.2
+++ hxguestplayer.h	24 May 2006 17:09:08 -0000	1.3
@@ -418,4 +418,9 @@
                                             REF(const char*)  rpszMimeType) PURE;
 };
 
+#include "hxcomptr.h"
+DEFINE_SMART_PTR(IHXGuestPlayerResponse)
+DEFINE_SMART_PTR(IHXGuestPlayer)
+DEFINE_SMART_PTR(IHXGuestPlayerCreator)
+
 #endif /* #ifndef HXGUESTPLAYER_H */

Index: base_playlist_renderer.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/base_playlist_renderer.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- base_playlist_renderer.h	16 May 2006 14:07:01 -0000	1.2
+++ base_playlist_renderer.h	24 May 2006 17:09:08 -0000	1.3
@@ -59,6 +59,7 @@
 #include "baseobj.h"
 #include "hxstring.h"
 #include "smiltype.h"
+#include "unkimp.h"
 
 // Forward declarations
 _INTERFACE IHXStream;
@@ -79,7 +80,8 @@
     CHXString m_id;
 };
 
-class CBaseHostedPlaylistRenderer : public IHXPlugin,
+class CBaseHostedPlaylistRenderer : public CUnknownIMP,
+                                    public IHXPlugin,
                                     public IHXRenderer,
                                     public IHXPersistentRenderer,
                                     public IHXGroupSink,
@@ -87,15 +89,12 @@
                                     public IHXGuestPlayerResponse,
                                     public CHXBaseCountingObject
 {
+    DECLARE_UNKNOWN(CBaseHostedPlaylistRenderer);
+
 public:
     CBaseHostedPlaylistRenderer();
     virtual ~CBaseHostedPlaylistRenderer();
 
-    // IUnknown methods
-    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj);
-    STDMETHOD_(ULONG32,AddRef)  (THIS);
-    STDMETHOD_(ULONG32,Release) (THIS);
-
     // IHXPlugin methods
     STDMETHOD(GetPluginInfo) (THIS_ REF(HXBOOL)      rbLoadMultiple,
                                     REF(const char*) rpszDescription,
@@ -161,7 +160,6 @@
     // CBaseHostedPlaylistRenderer static methods
     static HX_RESULT STDAPICALLTYPE HXCreateHostInstance(IHXGuestPlayerCreator* pCreator, IUnknown** ppUnk);
 protected:
-    INT32                          m_lRefCount;
     IHXGuestPlayerCreator*         m_pGuestPlayerCreator;
     IUnknown*                      m_pContext;
     IHXStream*                     m_pStream;

Index: base_hosted_renderer.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/base_hosted_renderer.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- base_hosted_renderer.h	16 May 2006 14:07:01 -0000	1.2
+++ base_hosted_renderer.h	24 May 2006 17:09:08 -0000	1.3
@@ -60,6 +60,7 @@
 #include "hxcore.h"
 #include "baseobj.h"
 #include "hxausvc.h"
+#include "unkimp.h"
 
 // Forward declarations
 _INTERFACE IHXStream;
@@ -122,7 +123,8 @@
 }
 HXHostStatInfo;
 
-class CBaseHostedRenderer : public IHXPlugin,
+class CBaseHostedRenderer : public CUnknownIMP,
+                            public IHXPlugin,
                             public IHXRenderer,
                             public IHXSiteUser,
                             public IHXStatistics,
@@ -133,15 +135,12 @@
                             public IHXGuestPlayerResponse,
                             public CHXBaseCountingObject
 {
+    DECLARE_UNKNOWN(CBaseHostedRenderer);
+
 public:
     CBaseHostedRenderer();
     virtual ~CBaseHostedRenderer();
 
-    // IUnknown methods
-    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj);
-    STDMETHOD_(ULONG32,AddRef)  (THIS);
-    STDMETHOD_(ULONG32,Release) (THIS);
-
     // IHXPlugin methods
     STDMETHOD(GetPluginInfo) (THIS_ REF(HXBOOL)      rbLoadMultiple,
                                     REF(const char*) rpszDescription,
@@ -223,7 +222,6 @@
         kStateSeeking
     };
     // Member variables the derived class has access to
-    INT32                       m_lRefCount;
     IHXGuestPlayerCreator*      m_pGuestPlayerCreator;
     IUnknown*                   m_pContext;
     IHXStream*                  m_pStream;

Index: base_playlist_fileformat.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/base_playlist_fileformat.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- base_playlist_fileformat.h	16 May 2006 14:07:01 -0000	1.2
+++ base_playlist_fileformat.h	24 May 2006 17:09:08 -0000	1.3
@@ -55,6 +55,8 @@
 
 class CBaseHostedPlaylistEnabledFileFormat : public CBaseHostedFileFormat
 {
+    DECLARE_UNKNOWN(CBaseHostedPlaylistEnabledFileFormat);
+
 public:
     CBaseHostedPlaylistEnabledFileFormat();
     virtual ~CBaseHostedPlaylistEnabledFileFormat() {}

Index: base_hosted_fileformat.h
===================================================================
RCS file: /cvsroot/datatype/common/basehost/pub/base_hosted_fileformat.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- base_hosted_fileformat.h	16 May 2006 14:07:01 -0000	1.3
+++ base_hosted_fileformat.h	24 May 2006 17:09:08 -0000	1.4
@@ -58,12 +58,14 @@
 #include "hxcomm.h"
 #include "hxguestplayer.h"
 #include "baseobj.h"
+#include "unkimp.h"
 
 // Forward declarations
 class CHXGenericCallback;
 
 
-class CBaseHostedFileFormat : public IHXPlugin,
+class CBaseHostedFileFormat : public CUnknownIMP,
+                              public IHXPlugin,
                               public IHXPluginProperties,
                               public IHXFileFormatObject,
                               public IHXInterruptSafe,
@@ -71,15 +73,12 @@
                               public IHXGuestPlayerResponse,
                               public CHXBaseCountingObject
 {
+    DECLARE_UNKNOWN(CBaseHostedFileFormat);
+
 public:
     CBaseHostedFileFormat();
     virtual ~CBaseHostedFileFormat();
 
-    // IUnknown methods
-    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj);
-    STDMETHOD_(ULONG32,AddRef)  (THIS);
-    STDMETHOD_(ULONG32,Release) (THIS);
-
     // IHXPlugin methods
     STDMETHOD(GetPluginInfo) (THIS_ REF(HXBOOL)      rbLoadMultiple,
                                     REF(const char*) rpszDescription,
@@ -134,7 +133,6 @@
     };
 
     // Member variables the derived class has access to
-    INT32                  m_lRefCount;
     IHXGuestPlayerCreator* m_pGuestPlayerCreator;
     IUnknown*              m_pContext;
     IHXErrorMessages*      m_pErrorMessages;


From ehodge at helixcommunity.org  Wed May 24 10:10:53 2006
From: ehodge at helixcommunity.org (ehodge@helixcommunity.org)
Date: Wed May 24 11:58:51 2006
Subject: [Datatype-cvs] smil/renderer/smil2/pub smldoc.h, 1.13,
	1.14 smlelem.h, 1.11, 1.12
Message-ID: <mailman.14967.1148497131.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/smil/renderer/smil2/pub
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv21804/pub

Modified Files:
	smldoc.h smlelem.h 
Log Message:
+ Fixes behavior when an animate element is restarted based on
  a syncArc (didn't work before), eventArc (worked before),
  clockValue (as in when there are multiple begin times and
  2nd-to-resolve is a clock value like "3:23"), and syncArcs that
  resolve when the sync-to element time resolves on an eventArc
  (didn't work before).  The solution was to create a new copy
  of the animate element that is restarting and to leave the
  prior instance alone (if fill="freeze" or "hold") to keep
  track of its prior delay and duration for calculating how
  much effect it has on the animated target.
+ Fixes 1st-instance behavior of fill="hold" elements that end
  on an event.  Before, they would not halt on an early end.
+ REMAINING TO BE FIXED is when an animate element ends a second
  or subsequent instance of it on an event when fill="hold" or
  fill="freeze".  This fix, which creates a new copy of the
  animate element to handle a restart, does not properly handle
  resetting the delay (end time) of the prior instance and thus
  the prior instance keeps animating (or so my theory goes).
.
+ Fixes a crash that happened if an event gets sent from
  another component to the SMIL renderer before its
  m_pPlayToAssocList is set up.
.
+ Fixes restarting of a media element if it has a syncBase value
  that has re-resolved and has an offset; in that case, the delay
  of the element already accounts for the offset (as calculated
  in ElementResolved()).  This fixes remove event problems in:
  20060516-FIXD_20060512_imageWith50pctOpacityThatBeginsOn[...].smil
  as well as restart element on restarted syncBase element bug in:
  20060512_restartOfRTfails_beginsOnEndOfElementThatBeginsOnClick.smil
.
+ Handles creating copy of a CSmilNode if pParser passed in is
  NULL.  Also, clears out the array created for that purpose in
  case an error occurs.
.
+ Fixes some asserts, adds a few others.


Index: smldoc.h
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/pub/smldoc.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- smldoc.h	13 Apr 2006 21:48:24 -0000	1.13
+++ smldoc.h	24 May 2006 17:10:50 -0000	1.14
@@ -311,6 +311,9 @@
     HX_RESULT handleTrackResuming(const char* pID, INT32 nGroupNum);
 #if defined(HELIX_FEATURE_SMIL2_ANIMATION)
     HX_RESULT handleAnimate(CSmilAnimateElement* pAnimate);
+#if !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR)
+    HX_RESULT _handleAnimate(CSmilAnimateElement* pAnimate);
+#endif // #if !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR).
 #endif /* #if defined(HELIX_FEATURE_SMIL2_ANIMATION) */
     HX_RESULT handleRemoveTimeUpdate(CSmilElement* pElement, UINT32 ulRemoveTime);
     HX_RESULT handleExternalMediaMarkerFile(CSmilElement* pElement,

Index: smlelem.h
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/pub/smlelem.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- smlelem.h	3 May 2006 18:28:04 -0000	1.11
+++ smlelem.h	24 May 2006 17:10:50 -0000	1.12
@@ -50,6 +50,7 @@
 #ifndef _SMLELEM_H_
 #define _SMLELEM_H_
 
+
 #define WAY_IN_THE_FUTURE  1981342000 /*1981342000 is 22d+22h+22m+22s */
 #if !defined(MAX_LONG32)
 #define MAX_LONG32  0x7FFFFFFF
@@ -200,6 +201,7 @@
     virtual HXBOOL      hasEventBasedBeginTime();
     virtual HXBOOL      hasEventBasedEndTime();
     virtual CSmilElement* getSyncAncestorElement();
+    virtual HX_RESULT Copy(const CSmilElement& rhs, HXBOOL bIsAnimateTypeElement);
 
     // /Use of the new method fixes PR 79699 and PR 8XXYZ (PR 63622 part 3,
     // revisited) by making sure that the duration passed to
@@ -227,7 +229,8 @@
     HX_RESULT	GetElementProperties(REF(IHXValues*) pProperties, IUnknown* pContext);
 
     void checkElementFillBehavior();
-    
+
+   
     // /NOTE: all values below are for the currently-active (or, if this
     // element is not active on the timeline currently, the next-to-be
     // active) "interval" (see SMIL 2.0 Timing module for details on
@@ -351,6 +354,8 @@
     HX_BITFIELD           m_bClipEndUsesMarker : 1;
     HX_BITFIELD           m_bClipEndMarkerResolved : 1;
     HX_BITFIELD           m_bWaitingOnClipEndToResolve : 1;
+    HX_BITFIELD           m_bIsCopyOfOriginalXmlElement;
+    HX_BITFIELD           m_bIsFullCopy;
 };
 
 class CSmilAddGroup: public CSmilElement
@@ -772,6 +777,8 @@
 public:
     PathCmd();
     ~PathCmd();
+    
+    PathCmd(const PathCmd& pathCmdToCopy);
 
     PathCmdType m_eType;
     HXBOOL        m_bRelative;
@@ -792,6 +799,22 @@
     HX_VECTOR_DELETE(m_pdCoord);
 }
 
+inline PathCmd::PathCmd(const PathCmd& rhs)
+{
+    m_eType       = rhs.m_eType;
+    m_bRelative   = rhs.m_bRelative;
+    m_ulNumCoords = rhs.m_ulNumCoords;
+    m_pdCoord     = m_ulNumCoords? new double [m_ulNumCoords] : NULL;
+    if (m_pdCoord)
+    {
+        UINT32 ulIndex = 0;
+        for (; ulIndex < m_ulNumCoords; ulIndex++)
+        {
+            m_pdCoord[ulIndex] = rhs.m_pdCoord[ulIndex];
+        }
+    }
+}
+
 #endif
 
 #if defined(HELIX_FEATURE_SMIL2_ANIMATION)
@@ -807,6 +830,8 @@
     // differently than sources do.
     virtual HX_RESULT getCurrentScheduledStopTime(REF(ULONG32) ulActualStopTime);
 
+    HX_RESULT   Copy(const CSmilAnimateElement& smilAnimateElement);
+
     UINT32      m_ulSimpleDuration;
     UINT32      m_ulActiveDuration;
     UINT32      m_ulADNoSpeed;


From ehodge at helixcommunity.org  Wed May 24 10:10:52 2006
From: ehodge at helixcommunity.org (ehodge@helixcommunity.org)
Date: Wed May 24 11:58:51 2006
Subject: [Datatype-cvs] 
	smil/renderer/smil2 animsand.cpp, 1.4, 1.5 animsand.h,
	1.4, 1.5 smldoc.cpp, 1.34, 1.35 smlelem.cpp, 1.18,
	1.19 smlparse.cpp, 1.36, 1.37 smltime.cpp, 1.11,
	1.12 smltime.h, 1.4, 1.5
Message-ID: <mailman.14968.1148497131.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/smil/renderer/smil2
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv21804

Modified Files:
	animsand.cpp animsand.h smldoc.cpp smlelem.cpp smlparse.cpp 
	smltime.cpp smltime.h 
Log Message:
+ Fixes behavior when an animate element is restarted based on
  a syncArc (didn't work before), eventArc (worked before),
  clockValue (as in when there are multiple begin times and
  2nd-to-resolve is a clock value like "3:23"), and syncArcs that
  resolve when the sync-to element time resolves on an eventArc
  (didn't work before).  The solution was to create a new copy
  of the animate element that is restarting and to leave the
  prior instance alone (if fill="freeze" or "hold") to keep
  track of its prior delay and duration for calculating how
  much effect it has on the animated target.
+ Fixes 1st-instance behavior of fill="hold" elements that end
  on an event.  Before, they would not halt on an early end.
+ REMAINING TO BE FIXED is when an animate element ends a second
  or subsequent instance of it on an event when fill="hold" or
  fill="freeze".  This fix, which creates a new copy of the
  animate element to handle a restart, does not properly handle
  resetting the delay (end time) of the prior instance and thus
  the prior instance keeps animating (or so my theory goes).
.
+ Fixes a crash that happened if an event gets sent from
  another component to the SMIL renderer before its
  m_pPlayToAssocList is set up.
.
+ Fixes restarting of a media element if it has a syncBase value
  that has re-resolved and has an offset; in that case, the delay
  of the element already accounts for the offset (as calculated
  in ElementResolved()).  This fixes remove event problems in:
  20060516-FIXD_20060512_imageWith50pctOpacityThatBeginsOn[...].smil
  as well as restart element on restarted syncBase element bug in:
  20060512_restartOfRTfails_beginsOnEndOfElementThatBeginsOnClick.smil
.
+ Handles creating copy of a CSmilNode if pParser passed in is
  NULL.  Also, clears out the array created for that purpose in
  case an error occurs.
.
+ Fixes some asserts, adds a few others.


Index: animsand.h
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/animsand.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- animsand.h	14 Mar 2005 19:21:08 -0000	1.4
+++ animsand.h	24 May 2006 17:10:50 -0000	1.5
@@ -131,6 +131,10 @@
     UINT32      GetNumLayers() const;
     HXBOOL        MatchingSandwich(CSmilAnimateElement* pAnim);
     HXBOOL        AtLeastOneActiveLayer(UINT32 ulTime);
+
+    CHXSimpleList* GetLayerList() { return m_pLayerList; }
+    HXBOOL         IsCurrentlyActive(const char* pszAnimationElementID);
+
 protected:
     CHXString*     m_pTargetElementID;
     SMILNodeTag    m_eTargetElementTag;

Index: smlelem.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smlelem.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- smlelem.cpp	3 May 2006 18:28:02 -0000	1.18
+++ smlelem.cpp	24 May 2006 17:10:50 -0000	1.19
@@ -179,6 +179,8 @@
   , m_bListeningForPFHasLogicalNotOperator(FALSE)
   , m_bAtRestartUseClipBeginForDisplayWhile(FALSE)
 #endif // HELIX_FEATURE_PRESENTATION_FEATURE_SELECTION.
+  , m_bIsCopyOfOriginalXmlElement(FALSE)
+  , m_bIsFullCopy(FALSE)
 {
     // /XXXEH- we may need to set m_bIndefiniteBegin to TRUE if
     // hasAncestor(SMILExcl, this), but setInitialDelay() fix seems to be
@@ -219,6 +221,143 @@
     HX_VECTOR_DELETE(m_pszClipEndExternalMarkerFileName);
 }
 
+HX_RESULT
+CSmilElement::Copy(const CSmilElement& rhs, HXBOOL bIsAnimateTypeElement)
+{
+    HX_RESULT hxr = HXR_OK;
+
+    m_pNode = NULL;
+    if (rhs.m_pNode)
+    {
+        m_pNode = new SMILNode(*(rhs.m_pNode), FALSE /* bKeepId */,
+                rhs.m_pTimelineElement->GetParser()
+#if !defined(XXXEH_REPEAT_VALUE_TIMING_SHOULD_BE_EVENT_BASED)
+                , 0 /* ulRepeatNum */
+#endif
+                );
+    }
+    
+    if (!m_pNode)
+    {
+        HX_ASSERT(rhs.m_pNode);
+        hxr = HXR_OUTOFMEMORY;
+    }
+
+    m_ulClipBegin = rhs.m_ulClipBegin;
+    m_ulAuthoredClipBegin = rhs.m_ulAuthoredClipBegin;
+    m_ulClipEnd = rhs.m_ulClipEnd;
+    m_lBeginOffset = rhs.m_lBeginOffset;
+    m_ulBeginOffsetFromSyncBase = rhs.m_ulBeginOffsetFromSyncBase;
+    m_ulDelay = rhs.m_ulDelay;
+    m_ulDuration = rhs.m_ulDuration;
+    m_ulOriginalDuration = rhs.m_ulOriginalDuration;
+    m_ulDurationInAddTrack = rhs.m_ulDurationInAddTrack;
+    m_ulMaxDuration = rhs.m_ulMaxDuration;
+    m_ulMaxActiveDur = rhs.m_ulMaxActiveDur;
+    m_ulMinActiveDur = rhs.m_ulMinActiveDur;
+    m_ulAuthoredDur = rhs.m_ulAuthoredDur;
+    m_lEndOffset = rhs.m_lEndOffset;
+    m_ulAnticipatedPauseDur = rhs.m_ulAnticipatedPauseDur;
+    m_ulEndSync = rhs.m_ulEndSync;
+    m_ulStopTimeInExcl = rhs.m_ulStopTimeInExcl;
+    m_ulLongSyncArcBeginInGroupTime = rhs.m_ulLongSyncArcBeginInGroupTime;
+    m_fRepeatValue = rhs.m_fRepeatValue;
+    m_ulTimestamp = rhs.m_ulTimestamp;
+    m_restartBehavior = rhs.m_restartBehavior;
+    m_restartDefaultBehavior = rhs.m_restartDefaultBehavior;
+    // /Defaults to "default" which means use val of syncToleranceDefault:
+    m_ulSyncTolerance = rhs.m_ulSyncTolerance;
+    // /Defaults to "inherit"; if there is no parent timed element, then
+    // it is implementation-dependent (but should be less than or = 2s):
+    m_ulSyncToleranceDefault = rhs.m_ulSyncToleranceDefault;
+    m_syncBehavior = rhs.m_syncBehavior;
+    m_syncBehaviorDefault = rhs.m_syncBehaviorDefault;
+    m_ulReadIndex = rhs.m_ulReadIndex;
+    m_nBeginEventSourceTag = rhs.m_nBeginEventSourceTag;
+    m_lBeginEventClockValue = rhs.m_lBeginEventClockValue;
+    m_nEndEventSourceTag = rhs.m_nEndEventSourceTag;
+    m_lEndEventClockValue = rhs.m_lEndEventClockValue;
+    m_nEndsyncEventSourceTag = rhs.m_nEndsyncEventSourceTag;
+    //  This is not deleted by ~rhs so we can straight copy
+    m_pHandler = rhs.m_pHandler;
+    m_eFill = rhs.m_eFill;
+    m_eFillDefault = rhs.m_eFillDefault;
+    m_eActualFill = rhs.m_eActualFill;
+    m_eErase = rhs.m_eErase;
+    m_ulRemoveTime = rhs.m_ulRemoveTime;
+    m_eAccessErrorBehavior = rhs.m_eAccessErrorBehavior;
+    m_ulTimeDeferralOccurred = rhs.m_ulTimeDeferralOccurred;
+    m_bBeginOffsetSet = rhs.m_bBeginOffsetSet;
+    m_bNegBeginOffsetAlreadyUsed = rhs.m_bNegBeginOffsetAlreadyUsed;
+    m_bCurBeginIsOffsetFromSyncBase = rhs.m_bCurBeginIsOffsetFromSyncBase;
+    m_bCurEndClippedByParent = rhs.m_bCurEndClippedByParent;
+    m_bUseMediaDurForMinDur = rhs.m_bUseMediaDurForMinDur;
+    m_bUseMediaDurForMaxDur = rhs.m_bUseMediaDurForMaxDur;
+    m_bHasExplicitEnd = rhs.m_bHasExplicitEnd;
+    m_bHasExplicitDur = rhs.m_bHasExplicitDur;
+    m_bDurationIncludesDelayBeyondSyncbase = rhs.m_bDurationIncludesDelayBeyondSyncbase;
+    m_bAddDurationAlreadyDone = rhs.m_bAddDurationAlreadyDone;
+    m_bEndOffsetSet = rhs.m_bEndOffsetSet;
+    m_bInsertedIntoTimeline = rhs.m_bInsertedIntoTimeline;
+    m_bHasBeenScheduled = rhs.m_bHasBeenScheduled;
+    m_bIsPausedInExcl = rhs.m_bIsPausedInExcl;
+    m_bIsDeferredInExcl = rhs.m_bIsDeferredInExcl;
+    m_bIsStoppedInExcl = rhs.m_bIsStoppedInExcl;
+    m_bCurrentSourceIsLive = rhs.m_bCurrentSourceIsLive;
+    m_bRendererInitialized = rhs.m_bRendererInitialized;
+    m_bIsRestarting = rhs.m_bIsRestarting;
+    m_bAwaitingSyncAncestorBeginNotification = rhs.m_bAwaitingSyncAncestorBeginNotification;
+    m_bIndefiniteDuration = rhs.m_bIndefiniteDuration;
+    m_bIndefiniteBegin = rhs.m_bIndefiniteBegin;
+    m_bIndefiniteEnd = rhs.m_bIndefiniteEnd;
+    m_bWallClockBegin = rhs.m_bWallClockBegin;
+    m_bWallClockEnd = rhs.m_bWallClockEnd;
+    m_bHasAtLeastOneEventBasedBegin = rhs.m_bHasAtLeastOneEventBasedBegin;
+    m_bHasAtLeastOneNonEventBasedBegin = rhs.m_bHasAtLeastOneNonEventBasedBegin;
+    m_bUsesExternalMediaMarkerFile = rhs.m_bUsesExternalMediaMarkerFile;
+    m_bClipBeginUsesMarker = rhs.m_bClipBeginUsesMarker;
+    m_bClipBeginMarkerResolved = rhs.m_bClipBeginMarkerResolved;
+    m_bWaitingOnClipBeginToResolve = rhs.m_bWaitingOnClipBeginToResolve;
+    m_bClipEndUsesMarker = rhs.m_bClipEndUsesMarker;
+    m_bClipEndMarkerResolved = rhs.m_bClipEndMarkerResolved;
+    m_bWaitingOnClipEndToResolve = rhs.m_bWaitingOnClipEndToResolve;
+#if defined(HELIX_FEATURE_PRESENTATION_FEATURE_SELECTION)
+    m_bPFToChangeOnActivateEventHasLogicalNotOperator = rhs.m_bPFToChangeOnActivateEventHasLogicalNotOperator;
+    m_bPFToChangeOnBeginEventHasLogicalNotOperator = rhs.m_bPFToChangeOnBeginEventHasLogicalNotOperator;
+    m_bPFToChangeOnEndEventHasLogicalNotOperator = rhs.m_bPFToChangeOnEndEventHasLogicalNotOperator;
+    m_bListeningForPFHasLogicalNotOperator = rhs.m_bListeningForPFHasLogicalNotOperator;
+    m_bAtRestartUseClipBeginForDisplayWhile = rhs.m_bAtRestartUseClipBeginForDisplayWhile;
+#endif // HELIX_FEATURE_PRESENTATION_FEATURE_SELECTION.
+
+
+    m_bIsCopyOfOriginalXmlElement = TRUE;
+    //  Leave these pointers NULL for now; this method exists for handling
+    // restart of animate-type elements where a copy of the element is needed
+    // in order to allow for ; if anyone ever needs a true copy,
+    // they'll have to add code to copy all of these pointers' data over and
+    // set the m_bIsFullCopy to TRUE:
+    if (bIsAnimateTypeElement)
+    {
+        m_bIsFullCopy = FALSE;
+        m_pBeginTimeList = NULL;
+        m_pEndTimeList = NULL;
+        m_pHyperlinks = NULL;
+        m_pTimelineElement = NULL;
+        m_pszClipBeginMarkerName = NULL;
+        m_pszClipBeginExternalMarkerFileName = NULL;
+        m_pszClipEndMarkerName = NULL;
+        m_pszClipEndExternalMarkerFileName = NULL;
+    }
+    else
+    {
+        m_bIsFullCopy = TRUE; //  For future
+        HX_ASSERT(0  &&  "Need to finish CSmilElement::Copy() for non-animate elements");
+        hxr = HXR_FAIL;
+    }
+
+    return hxr;
+}
+
 void
 CSmilElement::addDuration(UINT32 ulDuration)
 {
@@ -1100,7 +1239,8 @@
     HX_RESULT ret = HXR_OK;
     
 #if defined(HELIX_FEATURE_PRESENTATION_FEATURE_SELECTION)
-    if (m_bAtRestartUseClipBeginForDisplayWhile  &&  ((UINT32)-1) != m_ulDelay)
+    if (m_bAtRestartUseClipBeginForDisplayWhile  &&  pSmilParser  &&
+            ((UINT32)-1) != m_ulDelay)
     {
         ulActualStartTime = pSmilParser->getSyncBaseTimeInGroupTimeCoords(
                 m_pNode);
@@ -2494,6 +2634,122 @@
 #endif
 }
 
+//  This is needed for making a copy of an existing CSmilAnimateElement for
+// when it restarts (which is *not* the same as it repeating) due to resolving
+// of one of its begin times after it had begun at least once before; in that
+// case we don't want to reuse it if it's still active but rather add another
+// layer to the mix:
+HX_RESULT
+CSmilAnimateElement::Copy(const CSmilAnimateElement& rhs)
+{
+    HX_RESULT hxr = HXR_OK;
+
+    //  First, we need to copy the rhs's CSmilElement attributes:
+    hxr = ((CSmilElement*)(this))->Copy(*((CSmilElement*)(&rhs)), TRUE);
+
+    m_ulSimpleDuration          = rhs.m_ulSimpleDuration;
+    m_ulActiveDuration          = rhs.m_ulActiveDuration;
+    m_ulADNoSpeed               = rhs.m_ulADNoSpeed;
+    m_pTargetElementID          = new CHXString((const char*)(*(rhs.m_pTargetElementID)));
+    if (!m_pTargetElementID)
+    {
+        hxr = HXR_OUTOFMEMORY;
+    }
+    m_eTargetElementTag         = rhs.m_eTargetElementTag;
+    m_ulNumValues               = rhs.m_ulNumValues;
+    HX_ASSERT(m_ulNumValues);
+    // Allocate the array of CAttr*
+    m_ppValue = m_ulNumValues>0? new CAttr* [m_ulNumValues] : NULL;
+    UINT32 ulIndex = 0;
+    if (m_ppValue)
+    {
+        //  Zero out the memory
+        memset((void*)m_ppValue, 0, sizeof(CAttr*) * m_ulNumValues);
+        //  Copy all attributes from the source element:
+        for (ulIndex = 0; ulIndex < m_ulNumValues; ulIndex++)
+        {
+            CAttr* pAttr = new CAttr(*(rhs.m_ppValue[ulIndex]));
+            if (!pAttr)
+            {
+                hxr = HXR_OUTOFMEMORY;
+                break;
+            }
+            else
+            {
+                m_ppValue[ulIndex] = pAttr;
+            }
+        }
+    }
+    m_ucAttributeName           = rhs.m_ucAttributeName;
+    m_ucCalcMode                = rhs.m_ucCalcMode;
+    m_ucAccumulate              = rhs.m_ucAccumulate;
+    m_ucAdditive                = rhs.m_ucAdditive;
+    m_ucAnimationType           = rhs.m_ucAnimationType;
+    m_dRepeatCount              = rhs.m_dRepeatCount;
+    m_ulRepeatDur               = rhs.m_ulRepeatDur;
+    m_bRepeatDurIsIndefinite    = rhs.m_bRepeatDurIsIndefinite;
+    m_dAccelerate               = rhs.m_dAccelerate;
+    m_dDecelerate               = rhs.m_dDecelerate;
+    m_bAutoReverse              = rhs.m_bAutoReverse;
+    m_dSpeed                    = rhs.m_dSpeed;
+    m_bIndefiniteSimpleDuration = rhs.m_bIndefiniteSimpleDuration;
+    m_bIndefiniteActiveDuration = rhs.m_bIndefiniteActiveDuration;
+    m_bCancelAnimation          = rhs.m_bCancelAnimation;
+#if defined(XXXMEH_SPLINE_ANIMATION)
+    m_ulNumKeyTimes             = rhs.m_ulNumKeyTimes;
+    m_pdKeyTime = m_ulNumKeyTimes? new double [m_ulNumKeyTimes] : NULL;
+    if (!m_pdKeyTime)
+    {
+        hxr = HXR_OUTOFMEMORY;
+    }
+    else
+    {
+        for (ulIndex = 0; ulIndex < m_ulNumKeyTimes; ulIndex++)
+        {
+            m_pdKeyTime[ulIndex] = rhs.m_pdKeyTime[ulIndex];
+        }
+    }
+    //  Now copy the splines:
+    m_ulNumKeySplines           = rhs.m_ulNumKeySplines;
+    m_pKeySpline = m_ulNumKeySplines? new KeySpline [m_ulNumKeySplines] : NULL;
+    if (!m_pKeySpline)
+    {
+        hxr = HXR_OUTOFMEMORY;
+    }
+    else
+    {
+        for (ulIndex = 0; ulIndex < m_ulNumKeySplines; ulIndex++)
+        {
+            m_pKeySpline[ulIndex].x1 = rhs.m_pKeySpline[ulIndex].x1;
+            m_pKeySpline[ulIndex].y1 = rhs.m_pKeySpline[ulIndex].y1;
+            m_pKeySpline[ulIndex].x2 = rhs.m_pKeySpline[ulIndex].x2;
+            m_pKeySpline[ulIndex].y2 = rhs.m_pKeySpline[ulIndex].y2;
+        }
+    }
+
+    m_ulNumPathCmds             = rhs.m_ulNumPathCmds;
+    m_ppPathCmd = m_ulNumPathCmds? new PathCmd* [m_ulNumPathCmds] : NULL;
+    if (!m_ppPathCmd)
+    {
+        hxr = HXR_OUTOFMEMORY;
+    }
+    else
+    {
+        for (ulIndex = 0; ulIndex < m_ulNumPathCmds; ulIndex++)
+        {
+            HX_ASSERT(rhs.m_ppPathCmd[ulIndex]);
+            if (rhs.m_ppPathCmd[ulIndex])
+            {
+                m_ppPathCmd[ulIndex] = new PathCmd(*(rhs.m_ppPathCmd[ulIndex]));
+            }
+        }
+    }
+#endif
+
+    return hxr;
+}
+
+
 CSmilAnimateElement::~CSmilAnimateElement()
 {
     HX_DELETE(m_pTargetElementID);

Index: animsand.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/animsand.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- animsand.cpp	14 Mar 2005 19:21:08 -0000	1.4
+++ animsand.cpp	24 May 2006 17:10:50 -0000	1.5
@@ -342,7 +342,8 @@
         // Initialize to the underlying value
         cRet = *pUnder;
         // Compute the zero-based time
-        UINT32 ulT = ulTime - m_ulDelay; // XXXMEH - is this right?
+        UINT32 ulT = ulTime - m_ulDelay;
+        HX_ASSERT(ulTime >= m_ulDelay);
         // Compute the time after time manipulations
         UINT32 ulTM = ComputeFilteredSimpleTime(ulT);
         // Decide if we're active or frozen
@@ -370,6 +371,8 @@
             if (ulLastIter != ulThisIter &&
                 m_pSmilParser)
             {
+                HX_ASSERT(ulThisIter > ulLastIter);
+
                 m_pSmilParser->tryToResolveBeginEndEvents("repeatEvent",
                                                           m_pElement->m_pNode->m_id,
                                                           ulTime);
@@ -1555,6 +1558,36 @@
     return bRet;
 }
 
+HXBOOL
+CAnimationSandwich::IsCurrentlyActive(const char* pszAnimationElementID)
+{
+    HXBOOL bIsCurrentlActive = FALSE;
+
+    if (pszAnimationElementID  &&   m_pLayerList)
+    {
+        LISTPOSITION posLL = m_pLayerList->GetHeadPosition();
+        while (posLL)
+        {
+            CAnimationSandwichLayer* pLayer =
+                (CAnimationSandwichLayer*) m_pLayerList->GetAt(posLL);
+            if (pLayer  &&  pLayer->GetAnimationElementID()  &&
+                    0==strcmp(pszAnimationElementID,
+                    pLayer->GetAnimationElementID()))
+            {
+                bIsCurrentlActive = TRUE;
+                break;
+            }
+            else
+            {
+                m_pLayerList->GetNext(posLL);
+            }
+        }
+    }
+    
+    return bIsCurrentlActive;
+}                    
+
+
 CSmilAnimateInfo::CSmilAnimateInfo()
 {
     m_pSandwich = NULL;

Index: smlparse.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smlparse.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- smlparse.cpp	3 May 2006 18:28:02 -0000	1.36
+++ smlparse.cpp	24 May 2006 17:10:50 -0000	1.37
@@ -7194,10 +7194,23 @@
 	    INT32 lTimeWithFullOffset = 0;
             lResolvedToTimeWithoutOffset = pTmpVal->getResolvedToTimeWithoutOffset();
             lEventTimeOffset = pTmpVal->getTimeOffset();
+#if !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR)
+            //  If this is a syncBase value that has re-resolved, then the
+            // delay of this already accounts for the offset (as calculated
+            // in ElementResolved()).  This fixes remove event problems in:
+            // 20060516-FIXD_20060512_imageWith50pctOpacityThatBeginsOn[...].smil
+            // as well as restart element on restarted syncBase element bug in:
+            // 20060512_restartOfRTfails_beginsOnEndOfElementThatBeginsOnClick.smil
+            if (SmilTimeSyncBase == pTmpVal->m_type)
+            {
+                lEventTimeOffset = 0;
+            }
+#endif //  HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR.
             lTimeWithFullOffset = lResolvedToTimeWithoutOffset + lEventTimeOffset;
 
 	    INT32 lClippedOffsetAmount =
 		    lTimeWithFullOffset - lEffectiveResolvedTime;
+
 	    if (lEventTimeOffset < 0  &&  lClippedOffsetAmount < 0)
 	    {
 		// /If clip-begin is invalid, set it otherwise add to it:
@@ -7221,12 +7234,12 @@
 #if defined(_DEBUG)  &&  defined(XXXEHODGE_DEBUG_CHECKPENDINGBEGINTIMES)
 {	static HXBOOL bFirstTime = TRUE;
 	FILE* f1 = ::fopen("c:\\smil2_checkPending.txt", bFirstTime?"w":"a+");
-	::fprintf(f1, "\npTmpVal->m_idRef= %s, LINE= %lu, "
+	::fprintf(f1, "\npTmpVal element id= %s\tLINE= %lu, "
 	"curSMILTimelineStatus==SMILTimelineStatusCurrentlyPlaying?%lu, "
 	"SmilRestartAlways==pTmpVal->m_pElement->m_restartBehavior%lu, "
 	"lTimeWithFullOffset=%ld, lElementCurBeginTime=%ld, lEffectiveResolvedTime=%ld, "
 	"lSyncbaseDelayAddedToResolvedTime=%ld, m_ulRemoveTime=%lu\n",
-	(const char*)pTmpVal->m_idRef, (UINT32)__LINE__,
+	(const char*)pTmpVal->m_pElement->m_pNode->m_id, (UINT32)__LINE__,
 	curSMILTimelineStatus==SMILTimelineStatusCurrentlyPlaying,
 	SmilRestartAlways==pTmpVal->m_pElement->m_restartBehavior,
 	lTimeWithFullOffset, lElementCurBeginTime, lEffectiveResolvedTime,
@@ -26309,6 +26322,8 @@
         char* pIDName = new char [256];
         if (pIDName)
         {
+            memset(pIDName, 0, 256); /* Flawfinder: ignore */
+
 #if defined(XXXEH_REPEAT_VALUE_TIMING_SHOULD_BE_EVENT_BASED)
 #else
 	    // /For repeated elements, create an ID of the following form:
@@ -26334,6 +26349,13 @@
                 {
                     sprintf(pIDName, "node_copy_%ld", pParser->GetUniqueNumber()); /* Flawfinder: ignore */
                 }
+                //  If there's no pParser, just append the copied-from id
+                // followed by the this ptr:
+                else
+                {
+                    SafeSprintf(pIDName, 256, "node_copy_of_%s__%lu",
+                            (const char*)rhs.m_id, (UINT32)this);
+                }
 	    }
 
 	    m_id = pIDName;

Index: smltime.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smltime.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- smltime.cpp	27 Mar 2006 23:45:40 -0000	1.11
+++ smltime.cpp	24 May 2006 17:10:50 -0000	1.12
@@ -1815,15 +1815,38 @@
 		else if (pEventElement->m_pSourceElement->m_ulDelay >
 			pSyncBaseNode->m_pElement->m_ulDelay)
 		{
-		    ULONG32 ulDelayFromSyncBase =
-			    pEventElement->m_pSourceElement->m_ulDelay -
-			    pSyncBaseNode->m_pElement->m_ulDelay;
-		    HX_ASSERT(lDelay>(LONG32)ulDelayFromSyncBase);
-		    if (lDelay < (LONG32)ulDelayFromSyncBase)
-		    {
-			ulDelayFromSyncBase = lDelay;
-		    }
-		    lDelay -= (LONG32)ulDelayFromSyncBase;
+#if !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR)
+                    //  XXXEH- I'm not ready to pull this code completely out
+                    // but my testing in May 2006 does not lead me to content
+                    // that needs the below, only content that fails with it
+                    // (e.g., 20060512_testAnimationFix.smil where restarting
+                    // an <animate> results in the following calculating its
+                    // delay wrong and later resulting in it getting a 0
+                    // duration; asserts above at line ~971:
+                    //            "timing#1.15: child's dur (=0)..." ).
+                    if (SMILAnimate != m_pSourceElement->m_pNode->m_tag  &&
+                            SMILSet != m_pSourceElement->m_pNode->m_tag  &&
+                            SMILAnimateColor != m_pSourceElement->m_pNode->m_tag &&
+                            SMILAnimateMotion != m_pSourceElement->m_pNode->m_tag )
+#else // is defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR).
+                    //  Do the following block for all elements:
+#endif // end else of !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR).
+                    {
+                        // I'm still trying to find content that enters this
+                        // that isn't animate or set element.  For now just
+                        // don't do this calculation if it's an animate or
+                        // set element:
+                        HX_ASSERT(0  &&  "XXXEH- if this content plays as expected, remove this assert");
+		        ULONG32 ulDelayFromSyncBase =
+			        pEventElement->m_pSourceElement->m_ulDelay -
+			        pSyncBaseNode->m_pElement->m_ulDelay;
+		        HX_ASSERT(lDelay>(LONG32)ulDelayFromSyncBase);
+		        if (lDelay < (LONG32)ulDelayFromSyncBase)
+		        {
+			    ulDelayFromSyncBase = lDelay;
+		        }
+		        lDelay -= (LONG32)ulDelayFromSyncBase;
+                    }
 		}
 	    }
 
@@ -1878,7 +1901,7 @@
 		m_pSourceElement->m_ulDuration = (UINT32)(lSum<0 ? 0 : lSum);
 	    }
 
-	    bNeedToResolveBeginTimeListVals = TRUE;
+            bNeedToResolveBeginTimeListVals = TRUE;
 	    if (HXR_OK == m_pParser->adjustForNegativeOffset(m_pID))
 	    {
 		if (!m_pSourceElement->m_bHasBeenScheduled  ||
@@ -3277,7 +3300,9 @@
 	    {
 		continue;
 	    }
-	    HX_ASSERT((UINT32)-1 != pElement->m_pSourceElement->m_ulDuration);
+            //  SMILSet doesn't have its duration set if its begin resolves on event:
+	    HX_ASSERT((UINT32)-1 != pElement->m_pSourceElement->m_ulDuration
+                    ||  SMILSet == pElement->m_pSourceElement->m_pNode->m_tag);
 
 	    // /Make sure we take endsync into account here; doing so helps fix
 	    // PR 50679 (and probably other bugs):

Index: smldoc.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smldoc.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- smldoc.cpp	21 Apr 2006 22:23:56 -0000	1.34
+++ smldoc.cpp	24 May 2006 17:10:50 -0000	1.35
@@ -1933,6 +1933,98 @@
 #if defined(HELIX_FEATURE_SMIL2_ANIMATION)
 
 HX_RESULT CSmilDocumentRenderer::handleAnimate(CSmilAnimateElement* pAnimate)
+#if !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR)
+{
+    HX_RESULT hxrslt = HXR_OK;
+
+    CSmilAnimateElement* pAnimateElement = pAnimate;
+
+    if (!pAnimate)
+    {
+        hxrslt = HXR_INVALID_PARAMETER;
+    }
+    else
+    {
+        //  In order to fix behavior of re-started animation elements, we need
+        // to see if current matching already-scheduled animate element exists
+        // and, if so, create a new CSmilAnimateElement to handle the
+        // newly-(re)resolved begin time of the associated SMIL element.
+        // That ensures that additional layer is added and that delay and
+        // activeDuration, ...etc., are all properly set.  It also allows for
+        // seeking backward to prior begin of the animate and to have it and
+        // subsequent begin times behave properly post seek:
+        const char* pAnimateID = (pAnimateElement  &&  pAnimateElement->m_pNode)?
+                (const char*)pAnimateElement->m_pNode->m_id : NULL;
+        HX_ASSERT(pAnimateID);  //  Sanity check.
+        HXBOOL bFoundMatchingActiveAnimate = FALSE;
+        if (pAnimateID  &&  m_pActiveAnimations  &&
+                m_pActiveAnimations->GetCount() > 0)
+        {
+            // Run through all animations, active now, in the past, or in the 
+            // future, and check to see if one of their layer's ID matches
+            // pAnimate's ID; if so, create a copy element and handle that
+            // instead:
+            LISTPOSITION posAA = m_pActiveAnimations->GetHeadPosition();
+            while (posAA  &&  !bFoundMatchingActiveAnimate)
+            {
+                CSmilAnimateInfo* pInfo =
+                        (CSmilAnimateInfo*)m_pActiveAnimations->GetNext(posAA);
+                if (pInfo  &&  pInfo->m_pSandwich)
+                {
+                    CHXSimpleList* pLayerList =
+                            pInfo->m_pSandwich->GetLayerList();
+                    if (pLayerList  &&  pLayerList->GetCount() > 0)
+                    {
+                        LISTPOSITION posLL = pLayerList->GetHeadPosition();
+                        while (posLL)
+                        {
+                            CAnimationSandwichLayer* pLayer =
+                                    (CAnimationSandwichLayer*)
+                                    pLayerList->GetNext(posLL);
+                            if (pLayer)
+                            {
+                                const char* pLayerAnimElementID =
+                                        pLayer->GetAnimationElementID();
+                                if (pLayerAnimElementID  &&
+                                        0==strcmp(pAnimateID, pLayerAnimElementID))
+                                {
+                                    bFoundMatchingActiveAnimate = TRUE;
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        if (bFoundMatchingActiveAnimate)
+        {
+            //  Element is restarting and prior instance is "active" so we need
+            // to create a new element to send to _handleAnimate():
+            pAnimateElement = new CSmilAnimateElement(pAnimate->m_pNode);
+            if (!pAnimateElement)
+            {
+                hxrslt = HXR_OUTOFMEMORY;
+            }
+            else
+            {
+                //  Copy pAnimate info into pAnimateElement:
+                pAnimateElement->Copy(*pAnimate);
+            }
+        }
+    }
+
+    if (SUCCEEDED(hxrslt))
+    {
+        hxrslt = _handleAnimate(pAnimateElement);
+    }
+
+    return hxrslt;
+}
+
+HX_RESULT CSmilDocumentRenderer::_handleAnimate(CSmilAnimateElement* pAnimate)
+#endif // #if !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR).
 {
     MLOG_ANIM(m_pErrorMessages,"CSmilDocumentRenderer::handleAnimate() id=%s tel=%s t=%lu\n",
                 (const char*) pAnimate->m_pNode->m_id,
@@ -11828,17 +11920,47 @@
     {
         // If there is a soundlevel animation going on, then
         // we need to try to grab the mutex
-        if (m_pSoundLevelMutex) m_pSoundLevelMutex->Lock();
+        if (m_pSoundLevelMutex)
+        {
+            m_pSoundLevelMutex->Lock();
+        }
+
+        HXBOOL bBeginOnEvent = FALSE;
+        HXBOOL bEndOnEvent = FALSE;
+
+#if !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR)
+        //  Did this instance of this animation end on an event?
+        ULONG32 ulActualStopTime = 0;
+
+        HX_RESULT hxrStop = pAnimate->getCurrentScheduledStopTime(
+                ulActualStopTime);
+#if defined(_DEBUG)
+        ULONG32 ulActualStartTime = 0;
+        HX_RESULT hxrStart = pAnimate->getCurrentScheduledStartTime(
+                ulActualStartTime, m_pSmilParser);
+        HX_ASSERT(hxrStart <= hxrStop);
+#endif //  _DEBUG.
+
+        //  We're being ended on an event if and only if our current instance's
+        // scheduled stop time is greater than the current group time:
+        bEndOnEvent = (m_ulCurrentTime < ulActualStopTime);
+#else // else do old behavior (HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR):
         // Does this animation begin on an event?
-        HXBOOL bBeginOnEvent = pAnimate->hasEventBasedBeginTime();
+        bBeginOnEvent = pAnimate->hasEventBasedBeginTime();
         // Does this animation end on an event?
-        HXBOOL bEndOnEvent = pAnimate->hasEventBasedEndTime();
+        bEndOnEvent = pAnimate->hasEventBasedEndTime();
+#endif // end else of !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR).
+
         // If we end on an event AND we have fill="freeze"
         // behavior, then we don't want to end, but rather
         // shorten the active duration to be the current time.
         // Then we will automatically go into a freeze state.
         if (bEndOnEvent &&
-            pAnimate->m_eActualFill == FillFreeze)
+                (pAnimate->m_eActualFill == FillFreeze
+#if !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR)
+                ||  pAnimate->m_eActualFill == FillHold
+#endif // !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR).
+                ) )
         {
             // Find the right animation layer
             LISTPOSITION pos = m_pActiveAnimations->GetHeadPosition();
@@ -11856,8 +11978,16 @@
                 }
             }
         }
-        else if (!bBeginOnEvent ||
-                 (bEndOnEvent && pAnimate->m_eActualFill == FillRemove))
+        else if (
+#if !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR)
+                //  We'll be making a copy to handle this animate element's
+                // next begin, thus we don't want to enter the below if() if
+                // we're not beginning on an event and also not ending on one
+                // that needs fill="remove" handling.
+#else // is defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR).
+                !bBeginOnEvent  ||
+#endif // end else of !defined(HELIX_FEATURE_DO_PRE_2006_SMIL_BEHAVIOR).
+                (bEndOnEvent && pAnimate->m_eActualFill == FillRemove))
         {
             if (m_pActiveAnimations &&
                 m_pActiveAnimations->GetCount() > 0)
@@ -18205,7 +18335,7 @@
 {
     HX_RESULT retVal = HXR_OK;
 
-    if (pURLStr && pEventNameStr)
+    if (pURLStr  &&  pEventNameStr  &&  m_pPlayToAssocList)
     {
         LISTPOSITION pos = m_pPlayToAssocList->GetHeadPosition();
         while (pos)

Index: smltime.h
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smltime.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- smltime.h	14 Mar 2005 19:21:09 -0000	1.4
+++ smltime.h	24 May 2006 17:10:50 -0000	1.5
@@ -124,6 +124,8 @@
     UINT32	 getNumChildren() { return (m_pChildren? (UINT32)m_pChildren->GetCount():0); }
 
     CHXSimpleList*  getChildren() { return m_pChildren; }
+    CSmilParser*    GetParser()   { return m_pParser; }
+
 protected:
     CSmilElement*         m_pSourceElement;
     CSmilParser*          m_pParser;


From karll at helixcommunity.org  Thu May 25 12:03:14 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Thu May 25 13:50:56 2006
Subject: [Datatype-cvs] h264/codec/decoder avc1, 1.1.1.1, 1.2 h264decdll,
	1.1.1.1, 1.2
Message-ID: <mailman.15019.1148590256.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/h264/codec/decoder
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv22643

Modified Files:
	avc1 h264decdll 
Log Message:
switched to GetSDKPath()
so the DLLs can build from dist libraries.


Index: avc1
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/avc1,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- avc1	19 May 2006 22:08:04 -0000	1.1.1.1
+++ avc1	25 May 2006 19:03:11 -0000	1.2
@@ -53,16 +53,14 @@
 
 project.AddSources("frontend/avc1api.cpp")
 
-# need to use project.AddLibraries(GetSDKPath("avc1lib")
+project.AddLibraries(GetSDKPath("h264decoder_libs")+'[avc1lib]')
 
 # for symbian arm linking order, runtlib should be last
 project.AddModuleLibraries(
-	"datatype-restricted/h264/codec/decoder[avc1lib]",
 	"common/system[syslib]",
 	"common/dbgtool[debuglib]",
 	"common/container[contlib]",
 	"common/util[utillib]",
-	"common/system[syslib]",
 	"datatype/common/util[dtutillib]",
 	"common/runtime[runtlib]",
 	"common/log/logutil[logutillib]",

Index: h264decdll
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/h264decdll,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- h264decdll	19 May 2006 22:08:04 -0000	1.1.1.1
+++ h264decdll	25 May 2006 19:03:11 -0000	1.2
@@ -51,11 +51,10 @@
 	"common/include",
 	)
 
-# need to use project.AddLibraries(GetSDKPath("h264declib")
+project.AddLibraries(GetSDKPath("h264decoder_libs")+'[h264declib]')
 
 
 project.AddModuleLibraries(
-	"datatype-restricted/h264/codec/decoder[h264declib]",
 	"common/dbgtool[debuglib]",
 	"common/runtime[runtlib]",
 	"common/log/logutil[logutillib]",


From cybette at helixcommunity.org  Thu May 25 12:08:42 2006
From: cybette at helixcommunity.org (cybette@helixcommunity.org)
Date: Thu May 25 13:56:23 2006
Subject: [Datatype-cvs] common/vidrend vidrend.cpp,1.64.2.3,1.64.2.4
Message-ID: <mailman.15024.1148590583.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/common/vidrend
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv29535

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	vidrend.cpp 
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement
with RealNetworks, and I am authorized to contribute this code under said agreement."

Modified by:
    carol.i.chen@nokia.com

Reviewed by:

Date: 
    5-24-2006

Error ID:
    TSW ID=EOVL-6PFUEZ

Project: 
    Helix plugin for Symbian

Synopsis: 
(1) When streaming certain 3GP clips, GetVideoFrameSizeL will return zero. This is because the a=framesize attribute is missing from the SDP. When this happens, the "FrameWidth" and "FrameHeight" values are not set. The fix is to add check for this situation of missing frame size, then assume the track size values of "Width" and "Height" and return those instead of zero.

Additionally, since the Frame size check is already in CachePresentationInfo (which is always called), the values are stored in member variables so they can be used in GetVideoFrameSizeL instead of having to parse the header again to obtain the same info.

(2) As "Width" and "Height" might not be present when streaming from non-Real servers, the second fix is to set "Width" and "Height" appropriately for all renderers derived from the base video renderer.

Files Modified: 
(1)    clientapps\symbianMmf\hxmmfctrlimpl.h
       clientapps\symbianMmf\hxmmfctrlimpl.cpp
(2)    datatype\common\vidrend\vidrend.cpp    

Files Added: 
    none

Image Size and Heap Use impact: 
    minor

Platforms and Profiles Build Verified: 
    armv5 / helix-client-s60-mmf-mdf-dsp, helix-client-s60-mmf-basic

Platforms and Profiles Functionality verified: 
    armv5 / helix-client-s60-mmf-mdf-dsp

Branch: 
    hxclient_2_1_0_cayennes and HEAD for both (1) and (2)
    hxclient_1_5_0_cayenne for (2) only


Index: vidrend.cpp
===================================================================
RCS file: /cvsroot/datatype/common/vidrend/vidrend.cpp,v
retrieving revision 1.64.2.3
retrieving revision 1.64.2.4
diff -u -d -r1.64.2.3 -r1.64.2.4
--- vidrend.cpp	15 Mar 2006 20:42:05 -0000	1.64.2.3
+++ vidrend.cpp	25 May 2006 19:08:38 -0000	1.64.2.4
@@ -2532,15 +2532,20 @@
             }
         }
 
+        if (!m_bWinSizeFixed ||
+            (m_SetWinSize.cx != szViewFrame.cx) ||
+            (m_SetWinSize.cy != szViewFrame.cy))
+        {
+            if(m_pHeader)
+            {
+                m_pHeader->SetPropertyULONG32("Width", (ULONG32) szViewFrame.cx);
+                m_pHeader->SetPropertyULONG32("Height", (ULONG32) szViewFrame.cy);
+            }
 #if defined(HELIX_FEATURE_STATS)
-	if (!m_bWinSizeFixed ||
-	    (m_SetWinSize.cx != szViewFrame.cx) ||
-	    (m_SetWinSize.cy != szViewFrame.cy))
-	{
-	    ReportStat(VS_IMAGE_WIDTH, (INT32) szViewFrame.cx);
-	    ReportStat(VS_IMAGE_HEIGHT, (INT32) szViewFrame.cy);
-	}
+            ReportStat(VS_IMAGE_WIDTH, (INT32) szViewFrame.cx);
+            ReportStat(VS_IMAGE_HEIGHT, (INT32) szViewFrame.cy);
 #endif /* #if defined(HELIX_FEATURE_STATS) */
+        }
 
         m_SetWinSize.cx = szViewFrame.cx;
         m_SetWinSize.cy = szViewFrame.cy;


From cybette at helixcommunity.org  Thu May 25 12:13:43 2006
From: cybette at helixcommunity.org (cybette@helixcommunity.org)
Date: Thu May 25 14:01:24 2006
Subject: [Datatype-cvs] common/vidrend vidrend.cpp,1.70,1.71
Message-ID: <mailman.15025.1148590884.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/common/vidrend
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv1615

Modified Files:
	vidrend.cpp 
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement
with RealNetworks, and I am authorized to contribute this code under said agreement."

Modified by:
    carol.i.chen@nokia.com

Reviewed by:

Date: 
    5-24-2006

Error ID:
    TSW ID=EOVL-6PFUEZ

Project: 
    Helix plugin for Symbian

Synopsis: 
(1) When streaming certain 3GP clips, GetVideoFrameSizeL will return zero.
This is because the a=framesize attribute is missing from the SDP.
When this happens, the "FrameWidth" and "FrameHeight" values are not set.
The fix is to add check for this situation of missing frame size, then assume
the track size values of "Width" and "Height" and return those instead of zero.

Additionally, since the Frame size check is already in CachePresentationInfo
(which is always called), the values are stored in member variables so they can
be used in GetVideoFrameSizeL instead of having to parse the header again to
obtain the same info.

(2) As "Width" and "Height" might not be present when streaming from non-Real
servers, the second fix is to set "Width" and "Height" appropriately for all
renderers derived from the base video renderer.

Files Modified: 
(1)    clientapps\symbianMmf\hxmmfctrlimpl.h
       clientapps\symbianMmf\hxmmfctrlimpl.cpp
(2)    datatype\common\vidrend\vidrend.cpp    

Files Added: 
    none

Image Size and Heap Use impact: 
    minor

Platforms and Profiles Build Verified: 
    armv5 / helix-client-s60-mmf-mdf-dsp, helix-client-s60-mmf-basic

Platforms and Profiles Functionality verified: 
    armv5 / helix-client-s60-mmf-mdf-dsp

Branch: 
    hxclient_2_1_0_cayennes and HEAD for both (1) and (2)
    hxclient_1_5_0_cayenne for (2) only


Index: vidrend.cpp
===================================================================
RCS file: /cvsroot/datatype/common/vidrend/vidrend.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- vidrend.cpp	15 Mar 2006 20:39:58 -0000	1.70
+++ vidrend.cpp	25 May 2006 19:13:39 -0000	1.71
@@ -2493,15 +2493,20 @@
             }
         }
 
+        if (!m_bWinSizeFixed ||
+            (m_SetWinSize.cx != szViewFrame.cx) ||
+            (m_SetWinSize.cy != szViewFrame.cy))
+        {
+            if(m_pHeader)
+            {
+                m_pHeader->SetPropertyULONG32("Width", (ULONG32) szViewFrame.cx);
+                m_pHeader->SetPropertyULONG32("Height", (ULONG32) szViewFrame.cy);
+            }
 #if defined(HELIX_FEATURE_STATS)
-	if (!m_bWinSizeFixed ||
-	    (m_SetWinSize.cx != szViewFrame.cx) ||
-	    (m_SetWinSize.cy != szViewFrame.cy))
-	{
-	    ReportStat(VS_IMAGE_WIDTH, (INT32) szViewFrame.cx);
-	    ReportStat(VS_IMAGE_HEIGHT, (INT32) szViewFrame.cy);
-	}
+            ReportStat(VS_IMAGE_WIDTH, (INT32) szViewFrame.cx);
+            ReportStat(VS_IMAGE_HEIGHT, (INT32) szViewFrame.cy);
 #endif /* #if defined(HELIX_FEATURE_STATS) */
+        }
 
         m_SetWinSize.cx = szViewFrame.cx;
         m_SetWinSize.cy = szViewFrame.cy;


From karll at helixcommunity.org  Thu May 25 12:18:11 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Thu May 25 14:05:52 2006
Subject: [Datatype-cvs] h264/codec/decoder/backend h264api.h, 1.1.1.1,
	1.2 h264decapi.cpp, 1.1.1.1, 1.2 h264decapi.h, 1.1.1.1, 1.2
Message-ID: <mailman.15028.1148591152.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/h264/codec/decoder/backend
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv4346/backend

Modified Files:
	h264api.h h264decapi.cpp h264decapi.h 
Log Message:
fixed Id tag


Index: h264decapi.h
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/backend/h264decapi.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- h264decapi.h	19 May 2006 22:08:04 -0000	1.1.1.1
+++ h264decapi.h	25 May 2006 19:18:08 -0000	1.2
@@ -1,6 +1,6 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  *  
- * Source last modified: $Id:  
+ * Source last modified: $Id$
  *  
  * Copyright Notices: 
  *  

Index: h264decapi.cpp
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/backend/h264decapi.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- h264decapi.cpp	19 May 2006 22:08:04 -0000	1.1.1.1
+++ h264decapi.cpp	25 May 2006 19:18:08 -0000	1.2
@@ -1,6 +1,6 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  *  
- * Source last modified: $Id:  
+ * Source last modified: $Id$
  *  
  * Copyright Notices: 
  *  

Index: h264api.h
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/backend/h264api.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- h264api.h	19 May 2006 22:08:04 -0000	1.1.1.1
+++ h264api.h	25 May 2006 19:18:08 -0000	1.2
@@ -1,6 +1,6 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  *  
- * Source last modified: $Id:  
+ * Source last modified: $Id$
  *  
  * Copyright Notices: 
  *  


From karll at helixcommunity.org  Thu May 25 12:18:12 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Thu May 25 14:05:53 2006
Subject: [Datatype-cvs] h264/codec/decoder/frontend avc1api.cpp,1.1.1.1,1.2
Message-ID: <mailman.15029.1148591153.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/h264/codec/decoder/frontend
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv4346/frontend

Modified Files:
	avc1api.cpp 
Log Message:
fixed Id tag


Index: avc1api.cpp
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/frontend/avc1api.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- avc1api.cpp	19 May 2006 22:08:04 -0000	1.1.1.1
+++ avc1api.cpp	25 May 2006 19:18:09 -0000	1.2
@@ -1,6 +1,6 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  *  
- * Source last modified: $Id:  
+ * Source last modified: $Id$
  *  
  * Copyright Notices: 
  *  


From karll at helixcommunity.org  Thu May 25 12:19:29 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Thu May 25 14:07:09 2006
Subject: [Datatype-cvs] h264/codec/decoder avc1.def, 1.1.1.1,
	NONE h264dec.def, 1.1.1.1, NONE
Message-ID: <mailman.15030.1148591229.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/h264/codec/decoder
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv6497

Removed Files:
	avc1.def h264dec.def 
Log Message:
removed .def files


--- h264dec.def DELETED ---

--- avc1.def DELETED ---


From cybette at helixcommunity.org  Thu May 25 12:20:08 2006
From: cybette at helixcommunity.org (cybette@helixcommunity.org)
Date: Thu May 25 14:07:48 2006
Subject: [Datatype-cvs] common/vidrend vidrend.cpp,1.54.2.11,1.54.2.12
Message-ID: <mailman.15031.1148591268.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/common/vidrend
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv7173

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	vidrend.cpp 
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement
with RealNetworks, and I am authorized to contribute this code under said agreement."

Modified by:
    carol.i.chen@nokia.com

Reviewed by:

Date: 
    5-24-2006

Error ID:
    TSW ID=EOVL-6PFUEZ

Project: 
    Helix plugin for Symbian

Synopsis: 
(1) When streaming certain 3GP clips, GetVideoFrameSizeL will return zero.
This is because the a=framesize attribute is missing from the SDP.
When this happens, the "FrameWidth" and "FrameHeight" values are not set.
The fix is to add check for this situation of missing frame size, then assume
the track size values of "Width" and "Height" and return those instead of zero.

Additionally, since the Frame size check is already in CachePresentationInfo
(which is always called), the values are stored in member variables so they can
be used in GetVideoFrameSizeL instead of having to parse the header again to
obtain the same info.

(2) As "Width" and "Height" might not be present when streaming from non-Real
servers, the second fix is to set "Width" and "Height" appropriately for all
renderers derived from the base video renderer.

Files Modified: 
(1)    clientapps\symbianMmf\hxmmfctrlimpl.h
       clientapps\symbianMmf\hxmmfctrlimpl.cpp
(2)    datatype\common\vidrend\vidrend.cpp    

Files Added: 
    none

Image Size and Heap Use impact: 
    minor

Platforms and Profiles Build Verified: 
    armv5 / helix-client-s60-mmf-mdf-dsp, helix-client-s60-mmf-basic

Platforms and Profiles Functionality verified: 
    armv5 / helix-client-s60-mmf-mdf-dsp

Branch: 
    hxclient_2_1_0_cayennes and HEAD for both (1) and (2)
    hxclient_1_5_0_cayenne for (2) only


Index: vidrend.cpp
===================================================================
RCS file: /cvsroot/datatype/common/vidrend/vidrend.cpp,v
retrieving revision 1.54.2.11
retrieving revision 1.54.2.12
diff -u -d -r1.54.2.11 -r1.54.2.12
--- vidrend.cpp	15 Mar 2006 20:37:52 -0000	1.54.2.11
+++ vidrend.cpp	25 May 2006 19:20:05 -0000	1.54.2.12
@@ -2510,15 +2510,20 @@
             }
         }
 
+        if (!m_bWinSizeFixed ||
+            (m_SetWinSize.cx != szViewFrame.cx) ||
+            (m_SetWinSize.cy != szViewFrame.cy))
+        {
+            if(m_pHeader)
+            {
+                m_pHeader->SetPropertyULONG32("Width", (ULONG32) szViewFrame.cx);
+                m_pHeader->SetPropertyULONG32("Height", (ULONG32) szViewFrame.cy);
+            }
 #if defined(HELIX_FEATURE_STATS)
-	if (!m_bWinSizeFixed ||
-	    (m_SetWinSize.cx != szViewFrame.cx) ||
-	    (m_SetWinSize.cy != szViewFrame.cy))
-	{
-	    ReportStat(VS_IMAGE_WIDTH, (INT32) szViewFrame.cx);
-	    ReportStat(VS_IMAGE_HEIGHT, (INT32) szViewFrame.cy);
-	}
+            ReportStat(VS_IMAGE_WIDTH, (INT32) szViewFrame.cx);
+            ReportStat(VS_IMAGE_HEIGHT, (INT32) szViewFrame.cy);
 #endif /* #if defined(HELIX_FEATURE_STATS) */
+        }
 
         m_SetWinSize.cx = szViewFrame.cx;
         m_SetWinSize.cy = szViewFrame.cy;


From karll at helixcommunity.org  Thu May 25 12:21:44 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Thu May 25 14:09:25 2006
Subject: [Datatype-cvs] h264/codec/decoder avc1, 1.1.1.1,
	1.1.1.1.2.1 h264decdll, 1.1.1.1, 1.1.1.1.2.1 avc1.def, 1.1.1.1,
	NONE h264dec.def, 1.1.1.1, NONE
Message-ID: <mailman.15032.1148591365.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/h264/codec/decoder
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv8081

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	avc1 h264decdll 
Removed Files:
      Tag: hxclient_1_5_0_cayenne
	avc1.def h264dec.def 
Log Message:
fixed Id tag, now using GetSDKPath() in makefiles for proper
building using dist libs


Index: avc1
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/avc1,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -d -r1.1.1.1 -r1.1.1.1.2.1
--- avc1	19 May 2006 22:08:04 -0000	1.1.1.1
+++ avc1	25 May 2006 19:21:41 -0000	1.1.1.1.2.1
@@ -53,16 +53,14 @@
 
 project.AddSources("frontend/avc1api.cpp")
 
-# need to use project.AddLibraries(GetSDKPath("avc1lib")
+project.AddLibraries(GetSDKPath("h264decoder_libs")+'[avc1lib]')
 
 # for symbian arm linking order, runtlib should be last
 project.AddModuleLibraries(
-	"datatype-restricted/h264/codec/decoder[avc1lib]",
 	"common/system[syslib]",
 	"common/dbgtool[debuglib]",
 	"common/container[contlib]",
 	"common/util[utillib]",
-	"common/system[syslib]",
 	"datatype/common/util[dtutillib]",
 	"common/runtime[runtlib]",
 	"common/log/logutil[logutillib]",

Index: h264decdll
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/h264decdll,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -d -r1.1.1.1 -r1.1.1.1.2.1
--- h264decdll	19 May 2006 22:08:04 -0000	1.1.1.1
+++ h264decdll	25 May 2006 19:21:41 -0000	1.1.1.1.2.1
@@ -51,11 +51,10 @@
 	"common/include",
 	)
 
-# need to use project.AddLibraries(GetSDKPath("h264declib")
+project.AddLibraries(GetSDKPath("h264decoder_libs")+'[h264declib]')
 
 
 project.AddModuleLibraries(
-	"datatype-restricted/h264/codec/decoder[h264declib]",
 	"common/dbgtool[debuglib]",
 	"common/runtime[runtlib]",
 	"common/log/logutil[logutillib]",

--- h264dec.def DELETED ---

--- avc1.def DELETED ---


From karll at helixcommunity.org  Thu May 25 12:21:44 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Thu May 25 14:09:25 2006
Subject: [Datatype-cvs] h264/codec/decoder/backend h264api.h, 1.1.1.1,
	1.1.1.1.2.1 h264decapi.cpp, 1.1.1.1, 1.1.1.1.2.1 h264decapi.h,
	1.1.1.1, 1.1.1.1.2.1
Message-ID: <mailman.15033.1148591365.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/h264/codec/decoder/backend
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv8081/backend

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	h264api.h h264decapi.cpp h264decapi.h 
Log Message:
fixed Id tag, now using GetSDKPath() in makefiles for proper
building using dist libs


Index: h264decapi.h
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/backend/h264decapi.h,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -d -r1.1.1.1 -r1.1.1.1.2.1
--- h264decapi.h	19 May 2006 22:08:04 -0000	1.1.1.1
+++ h264decapi.h	25 May 2006 19:21:41 -0000	1.1.1.1.2.1
@@ -1,6 +1,6 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  *  
- * Source last modified: $Id:  
+ * Source last modified: $Id$
  *  
  * Copyright Notices: 
  *  

Index: h264decapi.cpp
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/backend/h264decapi.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -d -r1.1.1.1 -r1.1.1.1.2.1
--- h264decapi.cpp	19 May 2006 22:08:04 -0000	1.1.1.1
+++ h264decapi.cpp	25 May 2006 19:21:41 -0000	1.1.1.1.2.1
@@ -1,6 +1,6 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  *  
- * Source last modified: $Id:  
+ * Source last modified: $Id$
  *  
  * Copyright Notices: 
  *  

Index: h264api.h
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/backend/h264api.h,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -d -r1.1.1.1 -r1.1.1.1.2.1
--- h264api.h	19 May 2006 22:08:04 -0000	1.1.1.1
+++ h264api.h	25 May 2006 19:21:41 -0000	1.1.1.1.2.1
@@ -1,6 +1,6 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  *  
- * Source last modified: $Id:  
+ * Source last modified: $Id$
  *  
  * Copyright Notices: 
  *  


From karll at helixcommunity.org  Thu May 25 12:21:45 2006
From: karll at helixcommunity.org (karll@helixcommunity.org)
Date: Thu May 25 14:09:28 2006
Subject: [Datatype-cvs] h264/codec/decoder/frontend avc1api.cpp, 1.1.1.1,
	1.1.1.1.2.1
Message-ID: <mailman.15034.1148591368.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/h264/codec/decoder/frontend
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv8081/frontend

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	avc1api.cpp 
Log Message:
fixed Id tag, now using GetSDKPath() in makefiles for proper
building using dist libs


Index: avc1api.cpp
===================================================================
RCS file: /cvsroot/datatype/h264/codec/decoder/frontend/avc1api.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -d -r1.1.1.1 -r1.1.1.1.2.1
--- avc1api.cpp	19 May 2006 22:08:04 -0000	1.1.1.1
+++ avc1api.cpp	25 May 2006 19:21:42 -0000	1.1.1.1.2.1
@@ -1,6 +1,6 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  *  
- * Source last modified: $Id:  
+ * Source last modified: $Id$
  *  
  * Copyright Notices: 
  *  


From ehodge at helixcommunity.org  Tue May 30 16:26:30 2006
From: ehodge at helixcommunity.org (ehodge@helixcommunity.org)
Date: Tue May 30 18:12:54 2006
Subject: [Datatype-cvs] smil/renderer/smil2 smlelem.cpp,1.19,1.20
Message-ID: <mailman.15163.1149037974.1552.datatype-cvs@helixcommunity.org>

Update of /cvsroot/datatype/smil/renderer/smil2
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv22529

Modified Files:
	smlelem.cpp 
Log Message:
+ This fixes the one animate-element test file that was broken by
my checkins to this directory on May 23rd.  By keeping the same node
ID if we're making a copy of an animate-type element (for the
purposes of handling a restart of the element), we allow for code
in CSmilDocumentRenderer::removeAnimation() to properly process the
element based on the association with the original element.  There
is no downside that I can find to sharing IDs for this purpose.


Index: smlelem.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smlelem.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- smlelem.cpp	24 May 2006 17:10:50 -0000	1.19
+++ smlelem.cpp	30 May 2006 23:26:23 -0000	1.20
@@ -229,7 +229,12 @@
     m_pNode = NULL;
     if (rhs.m_pNode)
     {
-        m_pNode = new SMILNode(*(rhs.m_pNode), FALSE /* bKeepId */,
+        //  Note: we want to keep the ID the same if (and only if) we're
+        // creating this copy for an animate-type element.  That allows
+        // CSmilDocumentRenderer::removeAnimation() to properly process the
+        // element based on the association with the original element:
+        HXBOOL bKeepSameID = bIsAnimateTypeElement;
+        m_pNode = new SMILNode(*(rhs.m_pNode), bKeepSameID,
                 rhs.m_pTimelineElement->GetParser()
 #if !defined(XXXEH_REPEAT_VALUE_TIMING_SHOULD_BE_EVENT_BASED)
                 , 0 /* ulRepeatNum */


</pre></div>
<div style="line-height: 10px"> </div>
<hr style="width: 900px; height: 1px; background: #aaaaaa; border: 0px;"/>
<div style="text-align: center; font-size: 10px">
<a href="http://helixcommunity.org/about/site_map">Site Map</a>   |  
<a href="http://helixcommunity.org/about/terms_of_using">Terms of Use</a>   |  
<a href="http://helixcommunity.org/about/policies">Privacy Policy</a>   |  
<a href="http://helixcommunity.org/about/contact">Contact Us</a>
</div>
<br style="line-height: 10px"/>
<div style="text-align: center; font-size: 10px; color: #aaaaaa">
Copyright © 1995-2007 RealNetworks, Inc. All rights reserved.
RealNetworks and Helix are trademarks of RealNetworks.<br />
All other trademarks or registered trademarks are the property of their respective holders.
</div>
</div>
</body>
</html>