From jwei at helixcommunity.org  Wed Feb  1 08:49:10 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:04:51 2006
Subject: [Datatype-cvs] mdf/video/common/include mdfgenericlog.h, 1.2,
	1.2.2.1
Message-ID: 

Update of /cvsroot/datatype/mdf/video/common/include
In directory cvs:/tmp/cvs-serv19263

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfgenericlog.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfgenericlog.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/common/include/mdfgenericlog.h,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -d -r1.2 -r1.2.2.1
--- mdfgenericlog.h	10 Nov 2005 16:42:18 -0000	1.2
+++ mdfgenericlog.h	1 Feb 2006 16:49:08 -0000	1.2.2.1
@@ -50,76 +50,63 @@
 #ifndef _MDFGENERICLOG_H_
 #define _MDFGENERICLOG_H_
 
-// Define these flags if you want logging from the
-// your components
-#define _MDFVIDEO_LOG
-//#define _USE_HELIXLOG
-
-//do not put these define into seperate files
-//it will cause wrong setting since one file will include the other
-
-#include 
-
-#if defined (_MDFVIDEO_LOG)  //use log
-#if defined (_USE_HELIXLOG)  //use Helix log
-    #define  HELIX_FEATURE_LOGLEVEL_3
     #include "hxtlogutil.h"         //logging
+	#include "hxglobalmgr.h"        //HXGlobalManager
 
-    #define MdfGGenericEnterFn   "->  %s::%s"
-    #define MdfGGenericLeaveFn   "<-  %s::%s"
-    #define MdfGGenericReturnFn	 "<-  %s::%s, return 0x%08x"
-    #define MdfGGenericInOutFn   "<-> %s::%s"
-
-    #define MDF_ENABLE_LOGGING(a)           HX_ENABLE_LOGGING(a)
-
-    #define MDFVIDEOLOG_CLASSNAME(name)        const char* className = name;
-    #define MDFVIDEOLOG_CLASSNAME_BASE(name)   extern const char* className;
-    #define MDFVIDEOLOG_DEFINE
-    #define MDFVIDEOLOG_DEFINE_STATIC
+    #define MdfGGenericEnterFn      "->  %s::%s"
+    #define MdfGGenericLeaveFn      "<-  %s::%s"
+    #define MdfGGenericReturnFn     "<-  %s::%s, return 0x%08x"
+    #define MdfGGenericInOutFn      "<-> %s::%s"
 
-    #define MDFVIDEOLOG_CREATE
-    #define MDFVIDEOLOG_CREATE_NOWRITE
-    #define MDFVIDEOLOG_DELETE
+    #define MDF_ENABLE_LOGGING(a)               HX_ENABLE_LOGGING(a)
+
+    #define MDFVIDEOLOG_DEFINE              private: char* iMdfVideoLogClassName;
+    #define MDFVIDEOLOG_CLASSNAME(name)     {iMdfVideoLogClassName=name;}
+
+    #define MDFVIDEOLOG_CREATE
+    #define MDFVIDEOLOG_CREATE_NOWRITE
+    #define MDFVIDEOLOG_DELETE
+    #define MDFVIDEOLOG_DELETE_ECOMDLL      {HXGlobalManager* pGM = HXGlobalManager::Instance();if( pGM ){pGM->Shutdown();}}
 
     //HXLOG1
-    #define MDFVIDEOLOG_ENTERFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericEnterFn,  className, a);
-    #define MDFVIDEOLOG_LEAVEFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericLeaveFn,  className, a);
-    #define MDFVIDEOLOG_RETURNFN1(a, b)     HXLOGL1(HXLOG_VIDE, MdfGGenericReturnFn, className, a, b);
-    #define MDFVIDEOLOG_INOUTFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericInOutFn,  className, a);
+    #define MDFVIDEOLOG_ENTERFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericEnterFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_LEAVEFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericLeaveFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_RETURNFN1(a, b)     HXLOGL1(HXLOG_VIDE, MdfGGenericReturnFn, iMdfVideoLogClassName, a, b);
+    #define MDFVIDEOLOG_INOUTFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericInOutFn,  iMdfVideoLogClassName, a);
 
     #define MDFVIDEOLOG_WRITE1(a)                    HXLOGL1(HXLOG_VIDE, a);
     #define MDFVIDEOLOG_WRITE_FORMAT1(a,b)           HXLOGL1(HXLOG_VIDE, a, b);
     #define MDFVIDEOLOG_WRITE_MULTI_FORMAT1(a,b,c)   HXLOGL1(HXLOG_VIDE, a, b, c);
 
     //HXLOG2
-    #define MDFVIDEOLOG_ENTERFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericEnterFn,  className, a);
-    #define MDFVIDEOLOG_LEAVEFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericLeaveFn,  className, a);
-    #define MDFVIDEOLOG_RETURNFN2(a, b)     HXLOGL2(HXLOG_VIDE, MdfGGenericReturnFn, className, a, b);
-    #define MDFVIDEOLOG_INOUTFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericInOutFn,  className, a);
+    #define MDFVIDEOLOG_ENTERFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericEnterFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_LEAVEFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericLeaveFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_RETURNFN2(a, b)     HXLOGL2(HXLOG_VIDE, MdfGGenericReturnFn, iMdfVideoLogClassName, a, b);
+    #define MDFVIDEOLOG_INOUTFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericInOutFn,  iMdfVideoLogClassName, a);
 
     #define MDFVIDEOLOG_WRITE2(a)                    HXLOGL2(HXLOG_VIDE, a);
     #define MDFVIDEOLOG_WRITE_FORMAT2(a,b)           HXLOGL2(HXLOG_VIDE, a, b);
     #define MDFVIDEOLOG_WRITE_MULTI_FORMAT2(a,b,c)   HXLOGL2(HXLOG_VIDE, a, b, c);
 
     //HXLOG3
-    #define MDFVIDEOLOG_ENTERFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericEnterFn,  className, a);
-    #define MDFVIDEOLOG_LEAVEFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericLeaveFn,  className, a);
-    #define MDFVIDEOLOG_RETURNFN3(a, b)     HXLOGL3(HXLOG_VIDE, MdfGGenericReturnFn, className, a, b);
-    #define MDFVIDEOLOG_INOUTFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericInOutFn,  className, a);
+    #define MDFVIDEOLOG_ENTERFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericEnterFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_LEAVEFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericLeaveFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_RETURNFN3(a, b)     HXLOGL3(HXLOG_VIDE, MdfGGenericReturnFn, iMdfVideoLogClassName, a, b);
+    #define MDFVIDEOLOG_INOUTFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericInOutFn,  iMdfVideoLogClassName, a);
 
     #define MDFVIDEOLOG_WRITE3(a)                    HXLOGL3(HXLOG_VIDE, a);
     #define MDFVIDEOLOG_WRITE_FORMAT3(a,b)           HXLOGL3(HXLOG_VIDE, a, b);
     #define MDFVIDEOLOG_WRITE_MULTI_FORMAT3(a,b,c)   HXLOGL3(HXLOG_VIDE, a, b, c);
 
     //HXLOG4
-    #define MDFVIDEOLOG_ENTERFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericEnterFn,  className, a);
-    #define MDFVIDEOLOG_LEAVEFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericLeaveFn,  className, a);
-    #define MDFVIDEOLOG_RETURNFN4(a, b)     HXLOGL4(HXLOG_VIDE, MdfGGenericReturnFn, className, a, b);
-    #define MDFVIDEOLOG_INOUTFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericInOutFn,  className, a);
+    #define MDFVIDEOLOG_ENTERFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericEnterFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_LEAVEFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericLeaveFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_RETURNFN4(a, b)     HXLOGL4(HXLOG_VIDE, MdfGGenericReturnFn, iMdfVideoLogClassName, a, b);
+    #define MDFVIDEOLOG_INOUTFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericInOutFn,  iMdfVideoLogClassName, a);
 
-    #define MDFVIDEOLOG_WRITE4                      HXLOGL4(HXLOG_VIDE, a);
-    #define MDFVIDEOLOG_WRITE_FORMAT4               HXLOGL4(HXLOG_VIDE, a, b);
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT4         HXLOGL4(HXLOG_VIDE, a, b, c);
+    #define MDFVIDEOLOG_WRITE4(a)                   HXLOGL4(HXLOG_VIDE, a);
+    #define MDFVIDEOLOG_WRITE_FORMAT4(a,b)          HXLOGL4(HXLOG_VIDE, a, b);
+    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT4(a,b,c)  HXLOGL4(HXLOG_VIDE, a, b, c);
 
     //HXLOG
     #define MDFVIDEOLOG_ENTERFN             MDFVIDEOLOG_ENTERFN3
@@ -131,98 +118,5 @@
     #define MDFVIDEOLOG_WRITE_FORMAT        MDFVIDEOLOG_WRITE_FORMAT3
     #define MDFVIDEOLOG_WRITE_MULTI_FORMAT  MDFVIDEOLOG_WRITE_MULTI_FORMAT3
 
-#else  //use Series60 log
-    _LIT(KMdfGGenericDir,               "MdfVideo");
-    _LIT(KMdfGGenericFile,              "MdfLogFile.txt");
-    _LIT8(KMdfGGenericBanner,           "MDF Component");
-    _LIT8(KMdfGGenericEnterFn,          "->  %S::%S");
-    _LIT8(KMdfGGenericLeaveFn,          "<-  %S::%S");
-    _LIT8(KMdfGGenericReturnFn,		    "<-  %S::%S, return 0x%08x");
-    _LIT8(KMdfGGenericInOutFn,          "<-> %S::%S");
-    _LIT(KMdfGGenericTimeFormatString,  "%H:%T:%S:%*C2");
-
-    #define MDFVIDEOLOG_CLASSNAME(name)   _LIT8(className, name);
-
-    #define MDFVIDEOLOG_DEFINE			 public: mutable RFileLogger iLog;
-
-    // use this inside static functions
-    #define MDFVIDEOLOG_DEFINE_STATIC     RFileLogger iLog;
-
-    #define MDFVIDEOLOG_CREATE			 {if(!iLog.Handle())iLog.Connect(); iLog.CreateLog(KMdfGGenericDir, KMdfGGenericFile, EFileLoggingModeAppend); iLog.SetDateAndTime(ETrue, ETrue); iLog.WriteFormat(KMdfGGenericBanner);}
-    #define MDFVIDEOLOG_CREATE_NOWRITE	 {if(!iLog.Handle())iLog.Connect(); iLog.CreateLog(KMdfGGenericDir, KMdfGGenericFile, EFileLoggingModeAppend); iLog.SetDateAndTime(ETrue, ETrue); }
-    #define MDFVIDEOLOG_DELETE			 {iLog.CloseLog(); iLog.Close(); }
-
-    #define MDFVIDEOLOG_ENTERFN(a)		 {_LIT8(temp, a); iLog.WriteFormat(KMdfGGenericEnterFn, &className, &temp);}
-    #define MDFVIDEOLOG_LEAVEFN(a)		 {_LIT8(temp, a); iLog.WriteFormat(KMdfGGenericLeaveFn, &className, &temp);}
-    #define MDFVIDEOLOG_RETURNFN(a, b)   {_LIT8(temp, a); iLog.WriteFormat(KMdfGGenericReturnFn,&className, &temp, b);}
-    #define MDFVIDEOLOG_INOUTFN(a)       {_LIT8(temp, a); iLog.WriteFormat(KMdfGGenericInOutFn, &className, &temp);}
-
-    #define MDFVIDEOLOG_WRITE(a) 		          {_LIT8(temp, a); iLog.Write(temp);}
-    #define MDFVIDEOLOG_WRITE_FORMAT(a,b)         {iLog.WriteFormat(_L(a), b);}
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT(a,b,c) {iLog.WriteFormat(_L(a), b, c);}
-#endif //_USE_HELIXLOG
-#else  //no log
-    #define MDFVIDEOLOG_CLASSNAME(name)
-
-    #define MDFVIDEOLOG_DEFINE
-    #define MDFVIDEOLOG_DEFINE_STATIC
-    #define MDFVIDEOLOG_CREATE
-    #define MDFVIDEOLOG_CREATE_NOWRITE
-    #define MDFVIDEOLOG_DELETE
-
-    #define MDFVIDEOLOG_ENTERFN(a)
-    #define MDFVIDEOLOG_LEAVEFN(a)
-    #define MDFVIDEOLOG_RETURNFN(a, b) 
-    #define MDFVIDEOLOG_INOUTFN(a)
-
-    #define MDFVIDEOLOG_WRITE(a)	
-    #define MDFVIDEOLOG_WRITE_FORMAT(a, b)
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT(a, b, c)
-#endif  //_MDFVIDEO_LOG
-
-#if !defined(_USE_HELIXLOG)
-    #define MDF_ENABLE_LOGGING(a)
-    #define MDFVIDEOLOG_CLASSNAME_BASE      MDFVIDEOLOG_CLASSNAME
-    //level1
-    #define MDFVIDEOLOG_ENTERFN1            MDFVIDEOLOG_ENTERFN
-    #define MDFVIDEOLOG_LEAVEFN1            MDFVIDEOLOG_LEAVEFN
-    #define MDFVIDEOLOG_RETURNFN1           MDFVIDEOLOG_RETURNFN
-    #define MDFVIDEOLOG_INOUTFN1            MDFVIDEOLOG_INOUTFN
-
-    #define MDFVIDEOLOG_WRITE1              MDFVIDEOLOG_WRITE
-    #define MDFVIDEOLOG_WRITE_FORMAT1       MDFVIDEOLOG_WRITE_FORMAT
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT1 MDFVIDEOLOG_WRITE_MULTI_FORMAT
-
-    //level2
-    #define MDFVIDEOLOG_ENTERFN2            MDFVIDEOLOG_ENTERFN
-    #define MDFVIDEOLOG_LEAVEFN2            MDFVIDEOLOG_LEAVEFN
-    #define MDFVIDEOLOG_RETURNFN2           MDFVIDEOLOG_RETURNFN
-    #define MDFVIDEOLOG_INOUTFN2            MDFVIDEOLOG_INOUTFN
-
-    #define MDFVIDEOLOG_WRITE2              MDFVIDEOLOG_WRITE
-    #define MDFVIDEOLOG_WRITE_FORMAT2       MDFVIDEOLOG_WRITE_FORMAT
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT2 MDFVIDEOLOG_WRITE_MULTI_FORMAT
-
-    //level3
-    #define MDFVIDEOLOG_ENTERFN3            MDFVIDEOLOG_ENTERFN
-    #define MDFVIDEOLOG_LEAVEFN3            MDFVIDEOLOG_LEAVEFN
-    #define MDFVIDEOLOG_RETURNFN3           MDFVIDEOLOG_RETURNFN
-    #define MDFVIDEOLOG_INOUTFN3            MDFVIDEOLOG_INOUTFN
-
-    #define MDFVIDEOLOG_WRITE3              MDFVIDEOLOG_WRITE
-    #define MDFVIDEOLOG_WRITE_FORMAT3       MDFVIDEOLOG_WRITE_FORMAT
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT3 MDFVIDEOLOG_WRITE_MULTI_FORMAT
-
-    //level4
-    #define MDFVIDEOLOG_ENTERFN4            MDFVIDEOLOG_ENTERFN
-    #define MDFVIDEOLOG_LEAVEFN4            MDFVIDEOLOG_LEAVEFN
-    #define MDFVIDEOLOG_RETURNFN4           MDFVIDEOLOG_RETURNFN
-    #define MDFVIDEOLOG_INOUTFN4            MDFVIDEOLOG_INOUTFN
-
-    #define MDFVIDEOLOG_WRITE4              MDFVIDEOLOG_WRITE
-    #define MDFVIDEOLOG_WRITE_FORMAT4       MDFVIDEOLOG_WRITE_FORMAT
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT4 MDFVIDEOLOG_WRITE_MULTI_FORMAT
-
-#endif  //_USE_HELIXLOG
 
 #endif  // _MDFGENERICLOG_H_


From jwei at helixcommunity.org  Wed Feb  1 08:52:11 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:07:50 2006
Subject: [Datatype-cvs] mdf/video/common/include mdfgenericlog.h,1.2,1.3
Message-ID: 

Update of /cvsroot/datatype/mdf/video/common/include
In directory cvs:/tmp/cvs-serv19798

Modified Files:
	mdfgenericlog.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfgenericlog.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/common/include/mdfgenericlog.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mdfgenericlog.h	10 Nov 2005 16:42:18 -0000	1.2
+++ mdfgenericlog.h	1 Feb 2006 16:52:07 -0000	1.3
@@ -50,76 +50,63 @@
 #ifndef _MDFGENERICLOG_H_
 #define _MDFGENERICLOG_H_
 
-// Define these flags if you want logging from the
-// your components
-#define _MDFVIDEO_LOG
-//#define _USE_HELIXLOG
-
-//do not put these define into seperate files
-//it will cause wrong setting since one file will include the other
-
-#include 
-
-#if defined (_MDFVIDEO_LOG)  //use log
-#if defined (_USE_HELIXLOG)  //use Helix log
-    #define  HELIX_FEATURE_LOGLEVEL_3
     #include "hxtlogutil.h"         //logging
+	#include "hxglobalmgr.h"        //HXGlobalManager
 
-    #define MdfGGenericEnterFn   "->  %s::%s"
-    #define MdfGGenericLeaveFn   "<-  %s::%s"
-    #define MdfGGenericReturnFn	 "<-  %s::%s, return 0x%08x"
-    #define MdfGGenericInOutFn   "<-> %s::%s"
-
-    #define MDF_ENABLE_LOGGING(a)           HX_ENABLE_LOGGING(a)
-
-    #define MDFVIDEOLOG_CLASSNAME(name)        const char* className = name;
-    #define MDFVIDEOLOG_CLASSNAME_BASE(name)   extern const char* className;
-    #define MDFVIDEOLOG_DEFINE
-    #define MDFVIDEOLOG_DEFINE_STATIC
+    #define MdfGGenericEnterFn      "->  %s::%s"
+    #define MdfGGenericLeaveFn      "<-  %s::%s"
+    #define MdfGGenericReturnFn     "<-  %s::%s, return 0x%08x"
+    #define MdfGGenericInOutFn      "<-> %s::%s"
 
-    #define MDFVIDEOLOG_CREATE
-    #define MDFVIDEOLOG_CREATE_NOWRITE
-    #define MDFVIDEOLOG_DELETE
+    #define MDF_ENABLE_LOGGING(a)               HX_ENABLE_LOGGING(a)
+
+    #define MDFVIDEOLOG_DEFINE              private: char* iMdfVideoLogClassName;
+    #define MDFVIDEOLOG_CLASSNAME(name)     {iMdfVideoLogClassName=name;}
+
+    #define MDFVIDEOLOG_CREATE
+    #define MDFVIDEOLOG_CREATE_NOWRITE
+    #define MDFVIDEOLOG_DELETE
+    #define MDFVIDEOLOG_DELETE_ECOMDLL      {HXGlobalManager* pGM = HXGlobalManager::Instance();if( pGM ){pGM->Shutdown();}}
 
     //HXLOG1
-    #define MDFVIDEOLOG_ENTERFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericEnterFn,  className, a);
-    #define MDFVIDEOLOG_LEAVEFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericLeaveFn,  className, a);
-    #define MDFVIDEOLOG_RETURNFN1(a, b)     HXLOGL1(HXLOG_VIDE, MdfGGenericReturnFn, className, a, b);
-    #define MDFVIDEOLOG_INOUTFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericInOutFn,  className, a);
+    #define MDFVIDEOLOG_ENTERFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericEnterFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_LEAVEFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericLeaveFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_RETURNFN1(a, b)     HXLOGL1(HXLOG_VIDE, MdfGGenericReturnFn, iMdfVideoLogClassName, a, b);
+    #define MDFVIDEOLOG_INOUTFN1(a)         HXLOGL1(HXLOG_VIDE, MdfGGenericInOutFn,  iMdfVideoLogClassName, a);
 
     #define MDFVIDEOLOG_WRITE1(a)                    HXLOGL1(HXLOG_VIDE, a);
     #define MDFVIDEOLOG_WRITE_FORMAT1(a,b)           HXLOGL1(HXLOG_VIDE, a, b);
     #define MDFVIDEOLOG_WRITE_MULTI_FORMAT1(a,b,c)   HXLOGL1(HXLOG_VIDE, a, b, c);
 
     //HXLOG2
-    #define MDFVIDEOLOG_ENTERFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericEnterFn,  className, a);
-    #define MDFVIDEOLOG_LEAVEFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericLeaveFn,  className, a);
-    #define MDFVIDEOLOG_RETURNFN2(a, b)     HXLOGL2(HXLOG_VIDE, MdfGGenericReturnFn, className, a, b);
-    #define MDFVIDEOLOG_INOUTFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericInOutFn,  className, a);
+    #define MDFVIDEOLOG_ENTERFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericEnterFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_LEAVEFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericLeaveFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_RETURNFN2(a, b)     HXLOGL2(HXLOG_VIDE, MdfGGenericReturnFn, iMdfVideoLogClassName, a, b);
+    #define MDFVIDEOLOG_INOUTFN2(a)         HXLOGL2(HXLOG_VIDE, MdfGGenericInOutFn,  iMdfVideoLogClassName, a);
 
     #define MDFVIDEOLOG_WRITE2(a)                    HXLOGL2(HXLOG_VIDE, a);
     #define MDFVIDEOLOG_WRITE_FORMAT2(a,b)           HXLOGL2(HXLOG_VIDE, a, b);
     #define MDFVIDEOLOG_WRITE_MULTI_FORMAT2(a,b,c)   HXLOGL2(HXLOG_VIDE, a, b, c);
 
     //HXLOG3
-    #define MDFVIDEOLOG_ENTERFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericEnterFn,  className, a);
-    #define MDFVIDEOLOG_LEAVEFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericLeaveFn,  className, a);
-    #define MDFVIDEOLOG_RETURNFN3(a, b)     HXLOGL3(HXLOG_VIDE, MdfGGenericReturnFn, className, a, b);
-    #define MDFVIDEOLOG_INOUTFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericInOutFn,  className, a);
+    #define MDFVIDEOLOG_ENTERFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericEnterFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_LEAVEFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericLeaveFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_RETURNFN3(a, b)     HXLOGL3(HXLOG_VIDE, MdfGGenericReturnFn, iMdfVideoLogClassName, a, b);
+    #define MDFVIDEOLOG_INOUTFN3(a)         HXLOGL3(HXLOG_VIDE, MdfGGenericInOutFn,  iMdfVideoLogClassName, a);
 
     #define MDFVIDEOLOG_WRITE3(a)                    HXLOGL3(HXLOG_VIDE, a);
     #define MDFVIDEOLOG_WRITE_FORMAT3(a,b)           HXLOGL3(HXLOG_VIDE, a, b);
     #define MDFVIDEOLOG_WRITE_MULTI_FORMAT3(a,b,c)   HXLOGL3(HXLOG_VIDE, a, b, c);
 
     //HXLOG4
-    #define MDFVIDEOLOG_ENTERFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericEnterFn,  className, a);
-    #define MDFVIDEOLOG_LEAVEFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericLeaveFn,  className, a);
-    #define MDFVIDEOLOG_RETURNFN4(a, b)     HXLOGL4(HXLOG_VIDE, MdfGGenericReturnFn, className, a, b);
-    #define MDFVIDEOLOG_INOUTFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericInOutFn,  className, a);
+    #define MDFVIDEOLOG_ENTERFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericEnterFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_LEAVEFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericLeaveFn,  iMdfVideoLogClassName, a);
+    #define MDFVIDEOLOG_RETURNFN4(a, b)     HXLOGL4(HXLOG_VIDE, MdfGGenericReturnFn, iMdfVideoLogClassName, a, b);
+    #define MDFVIDEOLOG_INOUTFN4(a)         HXLOGL4(HXLOG_VIDE, MdfGGenericInOutFn,  iMdfVideoLogClassName, a);
 
-    #define MDFVIDEOLOG_WRITE4                      HXLOGL4(HXLOG_VIDE, a);
-    #define MDFVIDEOLOG_WRITE_FORMAT4               HXLOGL4(HXLOG_VIDE, a, b);
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT4         HXLOGL4(HXLOG_VIDE, a, b, c);
+    #define MDFVIDEOLOG_WRITE4(a)                   HXLOGL4(HXLOG_VIDE, a);
+    #define MDFVIDEOLOG_WRITE_FORMAT4(a,b)          HXLOGL4(HXLOG_VIDE, a, b);
+    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT4(a,b,c)  HXLOGL4(HXLOG_VIDE, a, b, c);
 
     //HXLOG
     #define MDFVIDEOLOG_ENTERFN             MDFVIDEOLOG_ENTERFN3
@@ -131,98 +118,5 @@
     #define MDFVIDEOLOG_WRITE_FORMAT        MDFVIDEOLOG_WRITE_FORMAT3
     #define MDFVIDEOLOG_WRITE_MULTI_FORMAT  MDFVIDEOLOG_WRITE_MULTI_FORMAT3
 
-#else  //use Series60 log
-    _LIT(KMdfGGenericDir,               "MdfVideo");
-    _LIT(KMdfGGenericFile,              "MdfLogFile.txt");
-    _LIT8(KMdfGGenericBanner,           "MDF Component");
-    _LIT8(KMdfGGenericEnterFn,          "->  %S::%S");
-    _LIT8(KMdfGGenericLeaveFn,          "<-  %S::%S");
-    _LIT8(KMdfGGenericReturnFn,		    "<-  %S::%S, return 0x%08x");
-    _LIT8(KMdfGGenericInOutFn,          "<-> %S::%S");
-    _LIT(KMdfGGenericTimeFormatString,  "%H:%T:%S:%*C2");
-
-    #define MDFVIDEOLOG_CLASSNAME(name)   _LIT8(className, name);
-
-    #define MDFVIDEOLOG_DEFINE			 public: mutable RFileLogger iLog;
-
-    // use this inside static functions
-    #define MDFVIDEOLOG_DEFINE_STATIC     RFileLogger iLog;
-
-    #define MDFVIDEOLOG_CREATE			 {if(!iLog.Handle())iLog.Connect(); iLog.CreateLog(KMdfGGenericDir, KMdfGGenericFile, EFileLoggingModeAppend); iLog.SetDateAndTime(ETrue, ETrue); iLog.WriteFormat(KMdfGGenericBanner);}
-    #define MDFVIDEOLOG_CREATE_NOWRITE	 {if(!iLog.Handle())iLog.Connect(); iLog.CreateLog(KMdfGGenericDir, KMdfGGenericFile, EFileLoggingModeAppend); iLog.SetDateAndTime(ETrue, ETrue); }
-    #define MDFVIDEOLOG_DELETE			 {iLog.CloseLog(); iLog.Close(); }
-
-    #define MDFVIDEOLOG_ENTERFN(a)		 {_LIT8(temp, a); iLog.WriteFormat(KMdfGGenericEnterFn, &className, &temp);}
-    #define MDFVIDEOLOG_LEAVEFN(a)		 {_LIT8(temp, a); iLog.WriteFormat(KMdfGGenericLeaveFn, &className, &temp);}
-    #define MDFVIDEOLOG_RETURNFN(a, b)   {_LIT8(temp, a); iLog.WriteFormat(KMdfGGenericReturnFn,&className, &temp, b);}
-    #define MDFVIDEOLOG_INOUTFN(a)       {_LIT8(temp, a); iLog.WriteFormat(KMdfGGenericInOutFn, &className, &temp);}
-
-    #define MDFVIDEOLOG_WRITE(a) 		          {_LIT8(temp, a); iLog.Write(temp);}
-    #define MDFVIDEOLOG_WRITE_FORMAT(a,b)         {iLog.WriteFormat(_L(a), b);}
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT(a,b,c) {iLog.WriteFormat(_L(a), b, c);}
-#endif //_USE_HELIXLOG
-#else  //no log
-    #define MDFVIDEOLOG_CLASSNAME(name)
-
-    #define MDFVIDEOLOG_DEFINE
-    #define MDFVIDEOLOG_DEFINE_STATIC
-    #define MDFVIDEOLOG_CREATE
-    #define MDFVIDEOLOG_CREATE_NOWRITE
-    #define MDFVIDEOLOG_DELETE
-
-    #define MDFVIDEOLOG_ENTERFN(a)
-    #define MDFVIDEOLOG_LEAVEFN(a)
-    #define MDFVIDEOLOG_RETURNFN(a, b) 
-    #define MDFVIDEOLOG_INOUTFN(a)
-
-    #define MDFVIDEOLOG_WRITE(a)	
-    #define MDFVIDEOLOG_WRITE_FORMAT(a, b)
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT(a, b, c)
-#endif  //_MDFVIDEO_LOG
-
-#if !defined(_USE_HELIXLOG)
-    #define MDF_ENABLE_LOGGING(a)
-    #define MDFVIDEOLOG_CLASSNAME_BASE      MDFVIDEOLOG_CLASSNAME
-    //level1
-    #define MDFVIDEOLOG_ENTERFN1            MDFVIDEOLOG_ENTERFN
-    #define MDFVIDEOLOG_LEAVEFN1            MDFVIDEOLOG_LEAVEFN
-    #define MDFVIDEOLOG_RETURNFN1           MDFVIDEOLOG_RETURNFN
-    #define MDFVIDEOLOG_INOUTFN1            MDFVIDEOLOG_INOUTFN
-
-    #define MDFVIDEOLOG_WRITE1              MDFVIDEOLOG_WRITE
-    #define MDFVIDEOLOG_WRITE_FORMAT1       MDFVIDEOLOG_WRITE_FORMAT
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT1 MDFVIDEOLOG_WRITE_MULTI_FORMAT
-
-    //level2
-    #define MDFVIDEOLOG_ENTERFN2            MDFVIDEOLOG_ENTERFN
-    #define MDFVIDEOLOG_LEAVEFN2            MDFVIDEOLOG_LEAVEFN
-    #define MDFVIDEOLOG_RETURNFN2           MDFVIDEOLOG_RETURNFN
-    #define MDFVIDEOLOG_INOUTFN2            MDFVIDEOLOG_INOUTFN
-
-    #define MDFVIDEOLOG_WRITE2              MDFVIDEOLOG_WRITE
-    #define MDFVIDEOLOG_WRITE_FORMAT2       MDFVIDEOLOG_WRITE_FORMAT
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT2 MDFVIDEOLOG_WRITE_MULTI_FORMAT
-
-    //level3
-    #define MDFVIDEOLOG_ENTERFN3            MDFVIDEOLOG_ENTERFN
-    #define MDFVIDEOLOG_LEAVEFN3            MDFVIDEOLOG_LEAVEFN
-    #define MDFVIDEOLOG_RETURNFN3           MDFVIDEOLOG_RETURNFN
-    #define MDFVIDEOLOG_INOUTFN3            MDFVIDEOLOG_INOUTFN
-
-    #define MDFVIDEOLOG_WRITE3              MDFVIDEOLOG_WRITE
-    #define MDFVIDEOLOG_WRITE_FORMAT3       MDFVIDEOLOG_WRITE_FORMAT
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT3 MDFVIDEOLOG_WRITE_MULTI_FORMAT
-
-    //level4
-    #define MDFVIDEOLOG_ENTERFN4            MDFVIDEOLOG_ENTERFN
-    #define MDFVIDEOLOG_LEAVEFN4            MDFVIDEOLOG_LEAVEFN
-    #define MDFVIDEOLOG_RETURNFN4           MDFVIDEOLOG_RETURNFN
-    #define MDFVIDEOLOG_INOUTFN4            MDFVIDEOLOG_INOUTFN
-
-    #define MDFVIDEOLOG_WRITE4              MDFVIDEOLOG_WRITE
-    #define MDFVIDEOLOG_WRITE_FORMAT4       MDFVIDEOLOG_WRITE_FORMAT
-    #define MDFVIDEOLOG_WRITE_MULTI_FORMAT4 MDFVIDEOLOG_WRITE_MULTI_FORMAT
-
-#endif  //_USE_HELIXLOG
 
 #endif  // _MDFGENERICLOG_H_


From jwei at helixcommunity.org  Wed Feb  1 09:08:32 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:24:11 2006
Subject: [Datatype-cvs] mdf/video/format/common Umakefil, 1.1.1.1,
	1.1.1.1.2.1
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/common
In directory cvs:/tmp/cvs-serv31588

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	Umakefil 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/common/Umakefil,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
--- Umakefil	6 Oct 2005 11:46:32 -0000	1.1.1.1
+++ Umakefil	1 Feb 2006 17:08:29 -0000	1.1.1.1.2.1
@@ -51,8 +51,9 @@
 project.AddModuleIncludes("common/include",
                           "datatype/rm/include",
                           "common/log/logutil/pub",
-                          "datatype/common/container/pub")
-
+                          "datatype/common/container/pub",
+                          "common/system/pub")
+                            
 project.AddIncludes("../../common/include")
 
 project.AddSystemLibraries("flogger.lib")


From jwei at helixcommunity.org  Wed Feb  1 09:09:23 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:25:01 2006
Subject: [Datatype-cvs] mdf/video/format/common Umakefil,1.1.1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/common
In directory cvs:/tmp/cvs-serv32584

Modified Files:
	Umakefil 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/common/Umakefil,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Umakefil	6 Oct 2005 11:46:32 -0000	1.1.1.1
+++ Umakefil	1 Feb 2006 17:09:20 -0000	1.2
@@ -51,8 +51,9 @@
 project.AddModuleIncludes("common/include",
                           "datatype/rm/include",
                           "common/log/logutil/pub",
-                          "datatype/common/container/pub")
-
+                          "datatype/common/container/pub",
+                          "common/system/pub")
+                            
 project.AddIncludes("../../common/include")
 
 project.AddSystemLibraries("flogger.lib")


From jwei at helixcommunity.org  Wed Feb  1 09:09:54 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:25:33 2006
Subject: [Datatype-cvs] 
	mdf/video/format/common mdfpayloadformat.cpp, 1.2.2.1, 1.2.2.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/common
In directory cvs:/tmp/cvs-serv673

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfpayloadformat.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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfpayloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/common/mdfpayloadformat.cpp,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- mdfpayloadformat.cpp	31 Jan 2006 17:44:52 -0000	1.2.2.1
+++ mdfpayloadformat.cpp	1 Feb 2006 17:09:52 -0000	1.2.2.2
@@ -52,8 +52,6 @@
 
 #define DEFAUL_PREROLL_IN_MS        500
 
-MDFVIDEOLOG_CLASSNAME_BASE( "CPayloadFormatPluginDevice" )
-
 /////////////////////////////////////////////////////////////////////
 //CPayloadFormatInfo
 /////////////////////////////////////////////////////////////////////
@@ -214,7 +212,7 @@
 
 CPayloadFormatPluginDevice::~CPayloadFormatPluginDevice()
 {
-    MDFVIDEOLOG_ENTERFN( "~CPayloadFormatPluginDevice" )
+    MDFVIDEOLOG_ENTERFN( "~CPayloadFormatPluginDevice" );
     if( m_pDepacketizer )
     {
         m_pDepacketizer->Close();
@@ -226,16 +224,16 @@
     HX_RELEASE( m_pHeader );
     HX_DELETE( m_pStreamHeader );
     
-    MDFVIDEOLOG_LEAVEFN( "~CPayloadFormatPluginDevice" )
-    MDFVIDEOLOG_DELETE
-        
+    MDFVIDEOLOG_LEAVEFN( "~CPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_DELETE_ECOMDLL;
+    
     REComSession::DestroyedImplementation(m_Dtor_ID_Key);
 }
 
 HX_RESULT CPayloadFormatPluginDevice::Init( IUnknown *pContext, IHXValues* pHeader )
 {
-    MDFVIDEOLOG_ENTERFN( "Init" )
-
+    MDFVIDEOLOG_ENTERFN2( "Init" );
+    
     HX_ASSERT( pContext );
     MDF_ENABLE_LOGGING( pContext );
     HX_RESULT retVal = HXR_OK;
@@ -267,8 +265,8 @@
     {
         retVal = FormBitstreamHeader( m_pStreamHeader );
     }
-
-    MDFVIDEOLOG_LEAVEFN( "Init" )
+    
+    MDFVIDEOLOG_RETURNFN2( "Init", retVal );
     return retVal;
 }
 
@@ -276,13 +274,15 @@
 {
     //only PluginDevice knows how to fill the buffer properly
     //generic method
+    MDFVIDEOLOG_ENTERFN4( "FillBuffer" );
     HX_RESULT retVal = HXR_FAILED;
     if( inputBuffer.MaxLength() >= (TInt) pMediaPacket->m_ulDataSize )
     {
         inputBuffer.Copy( pMediaPacket->m_pData, pMediaPacket->m_ulDataSize );
         retVal = HXR_OK;
     }
-
+    
+    MDFVIDEOLOG_RETURNFN4( "FillBuffer", retVal );
     return retVal;
 }
 
@@ -290,25 +290,25 @@
 {
     //after Reset(), CPayloadFormatPluginDevice is ready to take
     //packets with same header info
-    MDFVIDEOLOG_ENTERFN( "Reset" )
+    MDFVIDEOLOG_ENTERFN( "Reset" );
     if( m_pDepacketizer )
     {
         m_pDepacketizer->Reset();
     }
     m_LastError = HXR_OK;
-    MDFVIDEOLOG_LEAVEFN( "Reset" )
+    MDFVIDEOLOG_LEAVEFN( "Reset" );
 }
 
 UINT32 CPayloadFormatPluginDevice::GetPreRollInMs() const
 {
-    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" )
-    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" )
+    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" );
+    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" );
     return DEFAUL_PREROLL_IN_MS;
 }
 
 CPayloadFormatInfo* CPayloadFormatPluginDevice::PayloadFormatInfoLC() const
 {
-    MDFVIDEOLOG_ENTERFN( "PayloadFormatInfoLC" )
+    MDFVIDEOLOG_ENTERFN( "PayloadFormatInfoLC" );
     CPayloadFormatInfo* self = CPayloadFormatInfo::NewL();
     CleanupStack::PushL( self );
     SetVideoMimetypes( *self );
@@ -316,7 +316,7 @@
     self->SetVideoDataUnitType( m_VideoDataUnitType );
     self->SetVideoDataUnitEncapsulation( m_VideoDataUnitEncapsulation );
     
-    MDFVIDEOLOG_LEAVEFN( "PayloadFormatInfoLC" )
+    MDFVIDEOLOG_LEAVEFN( "PayloadFormatInfoLC" );
     return self;  //transfer ownership
 }
 
@@ -350,14 +350,15 @@
   m_VideoDataUnitEncapsulation( EDuGenericPayload )
   //m_Dtor_ID_Key
 {
-    MDFVIDEOLOG_CREATE_NOWRITE
-    MDFVIDEOLOG_ENTERFN( "CPayloadFormatPluginDevice" )
-
-    MDFVIDEOLOG_LEAVEFN( "CPayloadFormatPluginDevice" )
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_ENTERFN( "CPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_LEAVEFN( "CPayloadFormatPluginDevice" );
 }
 
 HX_RESULT CPayloadFormatPluginDevice::InitializeDepacketizer()
 {
+    MDFVIDEOLOG_ENTERFN( "InitializeDepacketizer" );
     HX_RESULT retVal = HXR_OK;
 
     HX_ASSERT( m_pContext );
@@ -369,7 +370,9 @@
     {
         retVal = m_pDepacketizer->Init( pCommonClassFactory, FALSE );
     }
-    HX_RELEASE( pCommonClassFactory );
+    HX_RELEASE( pCommonClassFactory );
+    
+    MDFVIDEOLOG_RETURNFN( "InitializeDepacketizer", retVal );
     return retVal;
 }
 


From jwei at helixcommunity.org  Wed Feb  1 09:10:29 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:26:08 2006
Subject: [Datatype-cvs] mdf/video/format/common mdfpayloadformat.cpp, 1.3,
	1.4
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/common
In directory cvs:/tmp/cvs-serv1367

Modified Files:
	mdfpayloadformat.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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfpayloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/common/mdfpayloadformat.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mdfpayloadformat.cpp	31 Jan 2006 20:54:56 -0000	1.3
+++ mdfpayloadformat.cpp	1 Feb 2006 17:10:27 -0000	1.4
@@ -52,8 +52,6 @@
 
 #define DEFAUL_PREROLL_IN_MS        500
 
-MDFVIDEOLOG_CLASSNAME_BASE( "CPayloadFormatPluginDevice" )
-
 /////////////////////////////////////////////////////////////////////
 //CPayloadFormatInfo
 /////////////////////////////////////////////////////////////////////
@@ -214,7 +212,7 @@
 
 CPayloadFormatPluginDevice::~CPayloadFormatPluginDevice()
 {
-    MDFVIDEOLOG_ENTERFN( "~CPayloadFormatPluginDevice" )
+    MDFVIDEOLOG_ENTERFN( "~CPayloadFormatPluginDevice" );
     if( m_pDepacketizer )
     {
         m_pDepacketizer->Close();
@@ -226,16 +224,16 @@
     HX_RELEASE( m_pHeader );
     HX_DELETE( m_pStreamHeader );
     
-    MDFVIDEOLOG_LEAVEFN( "~CPayloadFormatPluginDevice" )
-    MDFVIDEOLOG_DELETE
-        
+    MDFVIDEOLOG_LEAVEFN( "~CPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_DELETE_ECOMDLL;
+    
     REComSession::DestroyedImplementation(m_Dtor_ID_Key);
 }
 
 HX_RESULT CPayloadFormatPluginDevice::Init( IUnknown *pContext, IHXValues* pHeader )
 {
-    MDFVIDEOLOG_ENTERFN( "Init" )
-
+    MDFVIDEOLOG_ENTERFN2( "Init" );
+    
     HX_ASSERT( pContext );
     MDF_ENABLE_LOGGING( pContext );
     HX_RESULT retVal = HXR_OK;
@@ -267,8 +265,8 @@
     {
         retVal = FormBitstreamHeader( m_pStreamHeader );
     }
-
-    MDFVIDEOLOG_LEAVEFN( "Init" )
+    
+    MDFVIDEOLOG_RETURNFN2( "Init", retVal );
     return retVal;
 }
 
@@ -276,13 +274,15 @@
 {
     //only PluginDevice knows how to fill the buffer properly
     //generic method
+    MDFVIDEOLOG_ENTERFN4( "FillBuffer" );
     HX_RESULT retVal = HXR_FAILED;
     if( inputBuffer.MaxLength() >= (TInt) pMediaPacket->m_ulDataSize )
     {
         inputBuffer.Copy( pMediaPacket->m_pData, pMediaPacket->m_ulDataSize );
         retVal = HXR_OK;
     }
-
+    
+    MDFVIDEOLOG_RETURNFN4( "FillBuffer", retVal );
     return retVal;
 }
 
@@ -290,25 +290,25 @@
 {
     //after Reset(), CPayloadFormatPluginDevice is ready to take
     //packets with same header info
-    MDFVIDEOLOG_ENTERFN( "Reset" )
+    MDFVIDEOLOG_ENTERFN( "Reset" );
     if( m_pDepacketizer )
     {
         m_pDepacketizer->Reset();
     }
     m_LastError = HXR_OK;
-    MDFVIDEOLOG_LEAVEFN( "Reset" )
+    MDFVIDEOLOG_LEAVEFN( "Reset" );
 }
 
 UINT32 CPayloadFormatPluginDevice::GetPreRollInMs() const
 {
-    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" )
-    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" )
+    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" );
+    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" );
     return DEFAUL_PREROLL_IN_MS;
 }
 
 CPayloadFormatInfo* CPayloadFormatPluginDevice::PayloadFormatInfoLC() const
 {
-    MDFVIDEOLOG_ENTERFN( "PayloadFormatInfoLC" )
+    MDFVIDEOLOG_ENTERFN( "PayloadFormatInfoLC" );
     CPayloadFormatInfo* self = CPayloadFormatInfo::NewL();
     CleanupStack::PushL( self );
     SetVideoMimetypes( *self );
@@ -316,7 +316,7 @@
     self->SetVideoDataUnitType( m_VideoDataUnitType );
     self->SetVideoDataUnitEncapsulation( m_VideoDataUnitEncapsulation );
     
-    MDFVIDEOLOG_LEAVEFN( "PayloadFormatInfoLC" )
+    MDFVIDEOLOG_LEAVEFN( "PayloadFormatInfoLC" );
     return self;  //transfer ownership
 }
 
@@ -350,14 +350,15 @@
   m_VideoDataUnitEncapsulation( EDuGenericPayload )
   //m_Dtor_ID_Key
 {
-    MDFVIDEOLOG_CREATE_NOWRITE
-    MDFVIDEOLOG_ENTERFN( "CPayloadFormatPluginDevice" )
-
-    MDFVIDEOLOG_LEAVEFN( "CPayloadFormatPluginDevice" )
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_ENTERFN( "CPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_LEAVEFN( "CPayloadFormatPluginDevice" );
 }
 
 HX_RESULT CPayloadFormatPluginDevice::InitializeDepacketizer()
 {
+    MDFVIDEOLOG_ENTERFN( "InitializeDepacketizer" );
     HX_RESULT retVal = HXR_OK;
 
     HX_ASSERT( m_pContext );
@@ -369,7 +370,9 @@
     {
         retVal = m_pDepacketizer->Init( pCommonClassFactory, FALSE );
     }
-    HX_RELEASE( pCommonClassFactory );
+    HX_RELEASE( pCommonClassFactory );
+    
+    MDFVIDEOLOG_RETURNFN( "InitializeDepacketizer", retVal );
     return retVal;
 }
 


From jwei at helixcommunity.org  Wed Feb  1 09:10:55 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:26:35 2006
Subject: [Datatype-cvs] mdf/video/format/common/pub mdfpayloadformat.h,
	1.2.2.1, 1.2.2.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/common/pub
In directory cvs:/tmp/cvs-serv1834

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfpayloadformat.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfpayloadformat.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/common/pub/mdfpayloadformat.h,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- mdfpayloadformat.h	31 Jan 2006 17:45:17 -0000	1.2.2.1
+++ mdfpayloadformat.h	1 Feb 2006 17:10:53 -0000	1.2.2.2
@@ -151,7 +151,7 @@
     
     TUid                    m_Dtor_ID_Key;
     
-    MDFVIDEOLOG_DEFINE
+    MDFVIDEOLOG_DEFINE;
 };
 
 


From jwei at helixcommunity.org  Wed Feb  1 09:11:44 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:27:23 2006
Subject: [Datatype-cvs] mdf/video/format/common/pub mdfpayloadformat.h, 1.3,
	1.4
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/common/pub
In directory cvs:/tmp/cvs-serv2518

Modified Files:
	mdfpayloadformat.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfpayloadformat.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/common/pub/mdfpayloadformat.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mdfpayloadformat.h	31 Jan 2006 20:56:06 -0000	1.3
+++ mdfpayloadformat.h	1 Feb 2006 17:11:35 -0000	1.4
@@ -151,7 +151,7 @@
     
     TUid                    m_Dtor_ID_Key;
     
-    MDFVIDEOLOG_DEFINE
+    MDFVIDEOLOG_DEFINE;
 };
 
 


From jwei at helixcommunity.org  Wed Feb  1 09:12:40 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:28:19 2006
Subject: [Datatype-cvs] mdf/video/format/h263 mdfh263payloadformat.cpp, 1.2,
	1.2.2.1
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/h263
In directory cvs:/tmp/cvs-serv3563a

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfh263payloadformat.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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfh263payloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/h263/mdfh263payloadformat.cpp,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -d -r1.2 -r1.2.2.1
--- mdfh263payloadformat.cpp	10 Nov 2005 16:46:43 -0000	1.2
+++ mdfh263payloadformat.cpp	1 Feb 2006 17:12:37 -0000	1.2.2.1
@@ -60,8 +60,6 @@
 
 const TUid KUidH263PayloadFormatPluginDevice = {KUidH263PayloadFormatPluginDeviceDefine};
 
-MDFVIDEOLOG_CLASSNAME( "CH263PayloadFormatPluginDevice" )
-
 CH263PayloadFormatPluginDevice* CH263PayloadFormatPluginDevice::NewL()
 {
     CH263PayloadFormatPluginDevice* self = new (ELeave) CH263PayloadFormatPluginDevice();
@@ -73,14 +71,14 @@
 
 CH263PayloadFormatPluginDevice::~CH263PayloadFormatPluginDevice()
 {
-    MDFVIDEOLOG_ENTERFN( "~CH263PayloadFormatPluginDevice" )
-    MDFVIDEOLOG_LEAVEFN( "~CH263PayloadFormatPluginDevice" )
+    MDFVIDEOLOG_ENTERFN( "~CH263PayloadFormatPluginDevice" );
+    MDFVIDEOLOG_LEAVEFN( "~CH263PayloadFormatPluginDevice" );
 }
 
 HX_RESULT CH263PayloadFormatPluginDevice::CreatePayloadFormat( IHXPayloadFormatObject*& aPayloadFormatObject )
 {
-    MDFVIDEOLOG_ENTERFN( "CreatePayloadFormat" )
-        
+    MDFVIDEOLOG_ENTERFN( "CreatePayloadFormat" );
+    
     aPayloadFormatObject = NULL;
     IHXBuffer* pMimeType = NULL;
     const char* pMimeTypeData = NULL;
@@ -108,12 +106,12 @@
             retVal = HXR_FAIL;
         }
     }
-
+    
     if( SUCCEEDED( retVal ) )
     {
         if( strcasecmp(pMimeTypeData, MP4V_RN_3GPP_H263_PAYLOAD_MIME_TYPE) == 0 )
         {
-            MDFVIDEOLOG_INOUTFN( "MimeTypeData = video/X-RN-3GPP-H263 " )
+            MDFVIDEOLOG_INOUTFN( "MimeTypeData = video/X-RN-3GPP-H263 " );
             //do not use GetFMTParams() since its return is not actually GMTParams
 
             IHXBuffer* pConfigData = NULL;
@@ -137,25 +135,27 @@
                         UINT8* pType = infov20->pType;
                         if( pType[0] == 'd' && pType[1] == '2' && pType[2] == '6' && pType[3] == '3' )
                         {
-		                // Looks good as 3GPP-v2.0 DecoderSpecificInfo
+                            // Looks good as 3GPP-v2.0 DecoderSpecificInfo
                             UINT8 profile = (infov20->sData).pH263Profile[0];
                             if( profile >= 0x03 )
-                            {
+                            {
+                                MDFVIDEOLOG_INOUTFN( "    Profile 3 video, MDF does not support" );
                                 retVal = HXR_UNSUPPORTED_VIDEO; //do not support profile 3 clip
                             }
-	                    }
+                        }
                         else if((ulSize >= sizeof(DecoderSpecificInfoV10) ) )
                         {
                             DecoderSpecificInfoV10* infov10 = (DecoderSpecificInfoV10*) pData;
                             if( infov10->pTag[0] == 0x05 )
-	                        {
-		                    // Looks good as 3GPP-v1.0 DecoderSpecificInfo
+                            {
+                                // Looks good as 3GPP-v1.0 DecoderSpecificInfo
                                 UINT8 profile = (infov10->sData).pH263Profile[0];
                                 if( profile >= 0x03 )
                                 {
+                                    MDFVIDEOLOG_INOUTFN( "    Profile 3 video, MDF does not support" );
                                     retVal = HXR_UNSUPPORTED_VIDEO; //do not support profile 3 clip
                                 }
-	                        }
+                            }
                         }
                     }
                 }
@@ -164,33 +164,33 @@
         else
         {
             // Assume H263 payload - Create Packet Assembler
-            MDFVIDEOLOG_INOUTFN( "MimeTypeData != video/X-RN-3GPP-H263 " )
-
+            MDFVIDEOLOG_INOUTFN( "MimeTypeData != video/X-RN-3GPP-H263 " );
+            
             IHXValues* pFMTParams = NULL;
             HX_RESULT retValFMT = GetFMTParams( pFMTParams );
             
             if( SUCCEEDED( retValFMT ) && pFMTParams )
             {
-                MDFVIDEOLOG_INOUTFN( " GetFMTParams is OK " )
+                MDFVIDEOLOG_INOUTFN( " GetFMTParams is OK " );
                     
                 ULONG32 ulProfileLevelID = 0;
                 retValFMT = pFMTParams->GetPropertyULONG32( "FMTPprofile-level-id", ulProfileLevelID );
                 
-                MDFVIDEOLOG_WRITE_FORMAT( "<-> FMTPprofile-level-id: %d", ulProfileLevelID )
-                    
+                MDFVIDEOLOG_WRITE_FORMAT( "<-> FMTPprofile-level-id: %d", ulProfileLevelID );
+                
                 ULONG32 ulProfile = 0;
                 retValFMT = pFMTParams->GetPropertyULONG32( "FMTPProfile", ulProfile );
-                MDFVIDEOLOG_WRITE_FORMAT( "<-> FMTPProfile: %d", ulProfile )
-
+                MDFVIDEOLOG_WRITE_FORMAT( "<-> FMTPProfile: %d", ulProfile );
+                
                 if( SUCCEEDED( retValFMT ) && ulProfile >= 3 )
                 {
                     retVal = HXR_UNSUPPORTED_VIDEO;
                 }
-                    
+                
             }
-
+            
             HX_RELEASE( pFMTParams );
-
+            
             if( SUCCEEDED( retVal ) )
             {
                 aPayloadFormatObject = new CH263PayloadFormat();
@@ -209,7 +209,7 @@
     
     HX_RELEASE(pMimeType);
     
-    MDFVIDEOLOG_LEAVEFN( "CreatePayloadFormat" )
+    MDFVIDEOLOG_RETURNFN( "CreatePayloadFormat", retVal );
     return retVal;
 }
 
@@ -217,8 +217,8 @@
 {
     //pPayloadData is owned and released by Helix core
     //do not release pPayloadData without AddRef() it
-    MDFVIDEOLOG_ENTERFN( "CreateAssembledPacket" )
-        
+    MDFVIDEOLOG_ENTERFN4( "CreateAssembledPacket" );
+    
     m_LastError = HXR_OK;
     if( !pPayloadData )
     {
@@ -254,7 +254,7 @@
     {
         pBuffer = pDepcketized->GetBuffer();
     }
-
+    
     if (pBuffer)
     {
         pFramePacket = new CMediaPacket(pBuffer,
@@ -265,36 +265,38 @@
             MDPCKT_USES_IHXBUFFER_FLAG,
             NULL);
     }
-
+    
     HX_RELEASE( pBuffer );
     HX_RELEASE( pDepcketized );
     
-    MDFVIDEOLOG_LEAVEFN( "CreateAssembledPacket" )
+    MDFVIDEOLOG_LEAVEFN4( "CreateAssembledPacket" );
     return pFramePacket;
 }
 
 UINT32 CH263PayloadFormatPluginDevice::GetPreRollInMs() const
 {
-    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" )
-    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" )
+    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" );
+    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" );
     return DEFAUL_H263_PREROLL_IN_MS;
 }
 
 CH263PayloadFormatPluginDevice::CH263PayloadFormatPluginDevice()
-{
-    MDFVIDEOLOG_ENTERFN( "CH263PayloadFormatPluginDevice" )
-    MDFVIDEOLOG_LEAVEFN( "CH263PayloadFormatPluginDevice" )
+{
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CH263PayloadFormatPluginDevice" );
+    MDFVIDEOLOG_ENTERFN( "CH263PayloadFormatPluginDevice" );
+    MDFVIDEOLOG_LEAVEFN( "CH263PayloadFormatPluginDevice" );
 }
 
 void CH263PayloadFormatPluginDevice::ConstructL()
 {
-    MDFVIDEOLOG_ENTERFN( "ConstructL" )
-    MDFVIDEOLOG_LEAVEFN( "ConstructL" )
+    MDFVIDEOLOG_ENTERFN( "ConstructL" );
+    MDFVIDEOLOG_LEAVEFN( "ConstructL" );
 }
 
 void CH263PayloadFormatPluginDevice::SetVideoMimetypes( CPayloadFormatInfo& aPayloadFormatInfo ) const
 {
-    MDFVIDEOLOG_ENTERFN( "SetVideoMimetypes" )
+    MDFVIDEOLOG_ENTERFN( "SetVideoMimetypes" );
     _LIT8( KVideoMimeTypeH2632000, "video/H263-2000" );
     _LIT8( KVideoMimeTypeH2631998, "video/H263-1998" );
     _LIT8( KVideoMimeTypeH263, "video/H263" );
@@ -308,18 +310,22 @@
     
     aPayloadFormatInfo.SetPayloadFormatId( KUidH263PayloadFormatPluginDevice );
     
-    MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" )
+    MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" );
     return;
 }
 
 void CH263PayloadFormatPluginDevice::SetVideoDataUnit()
 {
+    MDFVIDEOLOG_ENTERFN( "SetVideoDataUnit" );
     m_VideoDataUnitType = EDuCodedPicture;
     m_VideoDataUnitEncapsulation = EDuElementaryStream;
+    MDFVIDEOLOG_LEAVEFN( "SetVideoDataUnit" );
 }
 
 HX_RESULT CH263PayloadFormatPluginDevice::GetFMTParams( IHXValues*& pFMTParams )
 {
+    MDFVIDEOLOG_ENTERFN( "GetFMTParams" );
+    
     HX_RESULT retVal = HXR_INVALID_PARAMETER;
     IHXCommonClassFactory* pCommonClassFactory = NULL;
     pFMTParams = NULL;
@@ -399,6 +405,8 @@
     }
     
     HX_RELEASE( pCommonClassFactory );
+    
+    MDFVIDEOLOG_RETURNFN( "GetFMTParams", retVal );
     return retVal;
 }
 


From jwei at helixcommunity.org  Wed Feb  1 09:13:34 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:29:13 2006
Subject: [Datatype-cvs] 
	mdf/video/format/h263/pub mdfh263payloadformat.h, 1.2, 1.2.2.1
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/h263/pub
In directory cvs:/tmp/cvs-serv4494

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfh263payloadformat.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfh263payloadformat.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -d -r1.2 -r1.2.2.1
--- mdfh263payloadformat.h	10 Nov 2005 16:46:06 -0000	1.2
+++ mdfh263payloadformat.h	1 Feb 2006 17:13:32 -0000	1.2.2.1
@@ -102,6 +102,7 @@
         H263DecSpecStruct sData;
     };
 
+    MDFVIDEOLOG_DEFINE;
 };
 
 #endif //_MDFH263PAYLOADFORMAT_H_


From jwei at helixcommunity.org  Wed Feb  1 09:14:00 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:29:38 2006
Subject: [Datatype-cvs] 
	mdf/video/format/h263/pub mdfh263payloadformat.h, 1.2, 1.3
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/h263/pub
In directory cvs:/tmp/cvs-serv4896

Modified Files:
	mdfh263payloadformat.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfh263payloadformat.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mdfh263payloadformat.h	10 Nov 2005 16:46:06 -0000	1.2
+++ mdfh263payloadformat.h	1 Feb 2006 17:13:57 -0000	1.3
@@ -102,6 +102,7 @@
         H263DecSpecStruct sData;
     };
 
+    MDFVIDEOLOG_DEFINE;
 };
 
 #endif //_MDFH263PAYLOADFORMAT_H_


From jwei at helixcommunity.org  Wed Feb  1 09:14:26 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:30:05 2006
Subject: [Datatype-cvs] 
	mdf/video/format/mp4 mdfmp4payloadformat.cpp, 1.2.2.1, 1.2.2.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/mp4
In directory cvs:/tmp/cvs-serv5095

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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfmp4payloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- mdfmp4payloadformat.cpp	31 Jan 2006 17:45:44 -0000	1.2.2.1
+++ mdfmp4payloadformat.cpp	1 Feb 2006 17:14:23 -0000	1.2.2.2
@@ -53,8 +53,6 @@
 #define KUidMP4PayloadFormatPluginDeviceDefine  0x10207477
 const TUid KUidMP4PayloadFormatPluginDevice =   {KUidMP4PayloadFormatPluginDeviceDefine};
 
-MDFVIDEOLOG_CLASSNAME( "CMP4PayloadFormatPluginDevice" )
-
 CMP4PayloadFormatPluginDevice* CMP4PayloadFormatPluginDevice::NewL()
 {
     CMP4PayloadFormatPluginDevice* self = new (ELeave) CMP4PayloadFormatPluginDevice();
@@ -66,14 +64,14 @@
 
 CMP4PayloadFormatPluginDevice::~CMP4PayloadFormatPluginDevice()
 {
-    MDFVIDEOLOG_ENTERFN( "~CMP4PayloadFormatPluginDevice" )
+    MDFVIDEOLOG_ENTERFN( "~CMP4PayloadFormatPluginDevice" );
     HX_RELEASE( m_pInputAllocator );
-    MDFVIDEOLOG_LEAVEFN( "~CMP4PayloadFormatPluginDevice" )
+    MDFVIDEOLOG_LEAVEFN( "~CMP4PayloadFormatPluginDevice" );
 }
 
 HX_RESULT CMP4PayloadFormatPluginDevice::Init( IUnknown *pContext, IHXValues* pHeader )
 {
-    MDFVIDEOLOG_ENTERFN( "Init" )
+    MDFVIDEOLOG_ENTERFN2( "Init" );
     HX_RESULT retVal = HXR_OK;
     
     retVal = CreateAllocators();
@@ -82,15 +80,15 @@
     {
         retVal = CPayloadFormatPluginDevice::Init( pContext, pHeader );
     }
-
-    MDFVIDEOLOG_LEAVEFN( "Init" )
+    
+    MDFVIDEOLOG_RETURNFN2( "Init", retVal );
     return retVal;
 }
 
 HX_RESULT CMP4PayloadFormatPluginDevice::CreatePayloadFormat( IHXPayloadFormatObject*& aPayloadFormatObject )
 {
-    MDFVIDEOLOG_ENTERFN( "CreatePayloadFormat" )
-        
+    MDFVIDEOLOG_ENTERFN2( "CreatePayloadFormat" );
+    
     HX_RESULT retVal = HXR_OK;
     
     aPayloadFormatObject = NULL;
@@ -107,13 +105,13 @@
         retVal = HXR_OUTOFMEMORY;
     }
     
-    MDFVIDEOLOG_LEAVEFN( "CreatePayloadFormat" )
+    MDFVIDEOLOG_RETURNFN2( "CreatePayloadFormat", retVal );
     return retVal;
 }
 
 CMediaPacket* CMP4PayloadFormatPluginDevice::CreateAssembledPacket( IHXPacket* pCodecData )
 {
-    MDFVIDEOLOG_ENTERFN( "CreateAssembledPacket" )
+    MDFVIDEOLOG_ENTERFN4( "CreateAssembledPacket" );
     
     UINT32* pCodecPacketRaw = NULL;
     HXCODEC_DATA* pCodecPacket;
@@ -154,12 +152,14 @@
 	        pFramePacket->m_pUserData = this;
 	    }
     }
-    MDFVIDEOLOG_LEAVEFN( "CreateAssembledPacket" )
+    MDFVIDEOLOG_LEAVEFN4( "CreateAssembledPacket" );
     return pFramePacket;
 }
 
 HX_RESULT CMP4PayloadFormatPluginDevice::FillBuffer( TPtr8& inputBuffer, const CMediaPacket* pMediaPacket ) const
 {
+    MDFVIDEOLOG_ENTERFN4( "FillBuffer" );
+    
     HX_RESULT retVal = HXR_FAILED;
     HXCODEC_DATA* pCodecPacket = (HXCODEC_DATA*) pMediaPacket->m_pData;
     if( inputBuffer.MaxLength() >= pCodecPacket->dataLength )
@@ -167,26 +167,27 @@
         inputBuffer.Copy( pCodecPacket->data, pCodecPacket->dataLength );
         retVal = HXR_OK;
     }
-
+    
+    MDFVIDEOLOG_RETURNFN4( "FillBuffer", retVal );
     return retVal;
 }
-
-void CMP4PayloadFormatPluginDevice::Reset( UINT32 ulBeginTime )
-{
-    MDFVIDEOLOG_ENTERFN( "Reset" );
-    CPayloadFormatPluginDevice::Reset( ulBeginTime );
-
-    if( m_pMP4Depacketizer )
-    {
-        m_pMP4Depacketizer->SetTimeAnchor( ulBeginTime );
-    }
-    MDFVIDEOLOG_LEAVEFN( "Reset" );
-}
+
+void CMP4PayloadFormatPluginDevice::Reset( UINT32 ulBeginTime )
+{
+    MDFVIDEOLOG_ENTERFN( "Reset" );
+    CPayloadFormatPluginDevice::Reset( ulBeginTime );
+
+    if( m_pMP4Depacketizer )
+    {
+        m_pMP4Depacketizer->SetTimeAnchor( ulBeginTime );
+    }
+    MDFVIDEOLOG_LEAVEFN( "Reset" );
+}
 
 UINT32 CMP4PayloadFormatPluginDevice::GetPreRollInMs() const
 {
-    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" )
-    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" )
+    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" );
+    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" );
     return DEFAUL_MP4_PREROLL_IN_MS;
 }
 
@@ -194,53 +195,59 @@
 : m_pInputAllocator( NULL ),
   m_pMP4Depacketizer( NULL )
 {
-    MDFVIDEOLOG_ENTERFN( "CMP4PayloadFormatPluginDevice" )
-    MDFVIDEOLOG_LEAVEFN( "CMP4PayloadFormatPluginDevice" )
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CMP4PayloadFormatPluginDevice" );
+    MDFVIDEOLOG_ENTERFN( "CMP4PayloadFormatPluginDevice" );
+    MDFVIDEOLOG_LEAVEFN( "CMP4PayloadFormatPluginDevice" );
 }
 
 void CMP4PayloadFormatPluginDevice::ConstructL()
 {
-    MDFVIDEOLOG_ENTERFN( "ConstructL" )
-    MDFVIDEOLOG_LEAVEFN( "ConstructL" )
+    MDFVIDEOLOG_ENTERFN( "ConstructL" );
+    MDFVIDEOLOG_LEAVEFN( "ConstructL" );
 }
 
 void CMP4PayloadFormatPluginDevice::SetVideoMimetypes( CPayloadFormatInfo& aPayloadFormatInfo ) const
 {
-    MDFVIDEOLOG_ENTERFN( "SetVideoMimetypes" )
+    MDFVIDEOLOG_ENTERFN( "SetVideoMimetypes" );
     _LIT8( KVideoMimeTypeMP4ES,   "video/MP4V-ES" );
     _LIT8( KVideoMimeTypeMP4RN,   "video/X-RN-MP4" );
     _LIT8( KVideoMimeTypeMP4AVC,  "video/X-HX-AVC1" );
     _LIT8( KVideoMimeTypeMP4DIVX, "video/X-HX-DIVX" );
     
     aPayloadFormatInfo.Reset();
-
+    
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4ES );
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4RN );
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4AVC );
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4DIVX );
     aPayloadFormatInfo.SetPayloadFormatId( KUidMP4PayloadFormatPluginDevice );
     
-    MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" )
+    MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" );
     return;
 }
 
 void CMP4PayloadFormatPluginDevice::SetVideoDataUnit()
 {
+    MDFVIDEOLOG_ENTERFN( "SetVideoDataUnit" );
     m_VideoDataUnitType = EDuCodedPicture;
     m_VideoDataUnitEncapsulation = EDuElementaryStream;
+    MDFVIDEOLOG_LEAVEFN( "SetVideoDataUnit" );
 }
 
 HX_RESULT CMP4PayloadFormatPluginDevice::FormBitstreamHeader( HBufC8*& pStreamHeader ) const
 {
+    MDFVIDEOLOG_ENTERFN( "FormBitstreamHeader" );
+    
     HX_RESULT retVal = HXR_FAIL;
     HX_DELETE( pStreamHeader );
-
+    
 #if defined( SYMBIAN_MDF_API_V2 ) and defined ( HELIX_FEATURE_SYMBIAN_MDF_API_V2_SUPPORTED )
     if( m_pMP4Depacketizer )
     {
         const TUint8* bitstreamheader = (const TUint8*) m_pMP4Depacketizer->GetBitstreamHeader();
         TInt length = (TInt) m_pMP4Depacketizer->GetBitstreamHeaderSize();
-
+        
         TRAPD( error, pStreamHeader = HBufC8::NewL( length ) );
         if( error == KErrNone )
         {
@@ -255,13 +262,14 @@
     pStreamHeader = NULL;
     retVal = HXR_OK;
 #endif
-
+    
+    MDFVIDEOLOG_RETURNFN( "FormBitstreamHeader", retVal );
     return retVal;
 }
 
 HX_RESULT CMP4PayloadFormatPluginDevice::CreateAllocators()
 {
-    MDFVIDEOLOG_ENTERFN( "CreateAllocators" )
+    MDFVIDEOLOG_ENTERFN( "CreateAllocators" );
     HX_RESULT retVal = HXR_OK;
     HX20ALLOCPROPS allocRequest, allocActual;
     
@@ -282,7 +290,7 @@
     {
         retVal = HXR_OUTOFMEMORY;
     }
-    MDFVIDEOLOG_LEAVEFN( "CreateAllocators" )
+    MDFVIDEOLOG_RETURNFN( "CreateAllocators", retVal );
     return retVal;
 }
 


From jwei at helixcommunity.org  Wed Feb  1 09:19:34 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:35:14 2006
Subject: [Datatype-cvs] mdf/video/format/mp4/pub mdfmp4payloadformat.h,
	1.2.2.1, 1.2.2.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/mp4/pub
In directory cvs:/tmp/cvs-serv5818

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfmp4payloadformat.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfmp4payloadformat.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- mdfmp4payloadformat.h	31 Jan 2006 17:46:07 -0000	1.2.2.1
+++ mdfmp4payloadformat.h	1 Feb 2006 17:19:32 -0000	1.2.2.2
@@ -88,6 +88,8 @@
     //or customized methods which are specific to MP4.
     //Without m_pMP4Depacketizer, m_pDepacketizer needs to be up-casted.
     MP4VPayloadFormat*        m_pMP4Depacketizer;
+
+    MDFVIDEOLOG_DEFINE;
     
 };
 


From jwei at helixcommunity.org  Wed Feb  1 09:26:35 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:42:14 2006
Subject: [Datatype-cvs] mdf/video/format/mp4 mdfmp4payloadformat.cpp, 1.3,
	1.4
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/mp4
In directory cvs:/tmp/cvs-serv7014

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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfmp4payloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mdfmp4payloadformat.cpp	31 Jan 2006 20:57:13 -0000	1.3
+++ mdfmp4payloadformat.cpp	1 Feb 2006 17:26:32 -0000	1.4
@@ -53,8 +53,6 @@
 #define KUidMP4PayloadFormatPluginDeviceDefine  0x10207477
 const TUid KUidMP4PayloadFormatPluginDevice =   {KUidMP4PayloadFormatPluginDeviceDefine};
 
-MDFVIDEOLOG_CLASSNAME( "CMP4PayloadFormatPluginDevice" )
-
 CMP4PayloadFormatPluginDevice* CMP4PayloadFormatPluginDevice::NewL()
 {
     CMP4PayloadFormatPluginDevice* self = new (ELeave) CMP4PayloadFormatPluginDevice();
@@ -66,14 +64,14 @@
 
 CMP4PayloadFormatPluginDevice::~CMP4PayloadFormatPluginDevice()
 {
-    MDFVIDEOLOG_ENTERFN( "~CMP4PayloadFormatPluginDevice" )
+    MDFVIDEOLOG_ENTERFN( "~CMP4PayloadFormatPluginDevice" );
     HX_RELEASE( m_pInputAllocator );
-    MDFVIDEOLOG_LEAVEFN( "~CMP4PayloadFormatPluginDevice" )
+    MDFVIDEOLOG_LEAVEFN( "~CMP4PayloadFormatPluginDevice" );
 }
 
 HX_RESULT CMP4PayloadFormatPluginDevice::Init( IUnknown *pContext, IHXValues* pHeader )
 {
-    MDFVIDEOLOG_ENTERFN( "Init" )
+    MDFVIDEOLOG_ENTERFN2( "Init" );
     HX_RESULT retVal = HXR_OK;
     
     retVal = CreateAllocators();
@@ -82,15 +80,15 @@
     {
         retVal = CPayloadFormatPluginDevice::Init( pContext, pHeader );
     }
-
-    MDFVIDEOLOG_LEAVEFN( "Init" )
+    
+    MDFVIDEOLOG_RETURNFN2( "Init", retVal );
     return retVal;
 }
 
 HX_RESULT CMP4PayloadFormatPluginDevice::CreatePayloadFormat( IHXPayloadFormatObject*& aPayloadFormatObject )
 {
-    MDFVIDEOLOG_ENTERFN( "CreatePayloadFormat" )
-        
+    MDFVIDEOLOG_ENTERFN2( "CreatePayloadFormat" );
+    
     HX_RESULT retVal = HXR_OK;
     
     aPayloadFormatObject = NULL;
@@ -107,13 +105,13 @@
         retVal = HXR_OUTOFMEMORY;
     }
     
-    MDFVIDEOLOG_LEAVEFN( "CreatePayloadFormat" )
+    MDFVIDEOLOG_RETURNFN2( "CreatePayloadFormat", retVal );
     return retVal;
 }
 
 CMediaPacket* CMP4PayloadFormatPluginDevice::CreateAssembledPacket( IHXPacket* pCodecData )
 {
-    MDFVIDEOLOG_ENTERFN( "CreateAssembledPacket" )
+    MDFVIDEOLOG_ENTERFN4( "CreateAssembledPacket" );
     
     UINT32* pCodecPacketRaw = NULL;
     HXCODEC_DATA* pCodecPacket;
@@ -154,12 +152,14 @@
 	        pFramePacket->m_pUserData = this;
 	    }
     }
-    MDFVIDEOLOG_LEAVEFN( "CreateAssembledPacket" )
+    MDFVIDEOLOG_LEAVEFN4( "CreateAssembledPacket" );
     return pFramePacket;
 }
 
 HX_RESULT CMP4PayloadFormatPluginDevice::FillBuffer( TPtr8& inputBuffer, const CMediaPacket* pMediaPacket ) const
 {
+    MDFVIDEOLOG_ENTERFN4( "FillBuffer" );
+    
     HX_RESULT retVal = HXR_FAILED;
     HXCODEC_DATA* pCodecPacket = (HXCODEC_DATA*) pMediaPacket->m_pData;
     if( inputBuffer.MaxLength() >= pCodecPacket->dataLength )
@@ -167,26 +167,27 @@
         inputBuffer.Copy( pCodecPacket->data, pCodecPacket->dataLength );
         retVal = HXR_OK;
     }
-
+    
+    MDFVIDEOLOG_RETURNFN4( "FillBuffer", retVal );
     return retVal;
 }
-
-void CMP4PayloadFormatPluginDevice::Reset( UINT32 ulBeginTime )
-{
-    MDFVIDEOLOG_ENTERFN( "Reset" );
-    CPayloadFormatPluginDevice::Reset( ulBeginTime );
-
-    if( m_pMP4Depacketizer )
-    {
-        m_pMP4Depacketizer->SetTimeAnchor( ulBeginTime );
-    }
-    MDFVIDEOLOG_LEAVEFN( "Reset" );
-}
+
+void CMP4PayloadFormatPluginDevice::Reset( UINT32 ulBeginTime )
+{
+    MDFVIDEOLOG_ENTERFN( "Reset" );
+    CPayloadFormatPluginDevice::Reset( ulBeginTime );
+
+    if( m_pMP4Depacketizer )
+    {
+        m_pMP4Depacketizer->SetTimeAnchor( ulBeginTime );
+    }
+    MDFVIDEOLOG_LEAVEFN( "Reset" );
+}
 
 UINT32 CMP4PayloadFormatPluginDevice::GetPreRollInMs() const
 {
-    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" )
-    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" )
+    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" );
+    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" );
     return DEFAUL_MP4_PREROLL_IN_MS;
 }
 
@@ -194,53 +195,59 @@
 : m_pInputAllocator( NULL ),
   m_pMP4Depacketizer( NULL )
 {
-    MDFVIDEOLOG_ENTERFN( "CMP4PayloadFormatPluginDevice" )
-    MDFVIDEOLOG_LEAVEFN( "CMP4PayloadFormatPluginDevice" )
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CMP4PayloadFormatPluginDevice" );
+    MDFVIDEOLOG_ENTERFN( "CMP4PayloadFormatPluginDevice" );
+    MDFVIDEOLOG_LEAVEFN( "CMP4PayloadFormatPluginDevice" );
 }
 
 void CMP4PayloadFormatPluginDevice::ConstructL()
 {
-    MDFVIDEOLOG_ENTERFN( "ConstructL" )
-    MDFVIDEOLOG_LEAVEFN( "ConstructL" )
+    MDFVIDEOLOG_ENTERFN( "ConstructL" );
+    MDFVIDEOLOG_LEAVEFN( "ConstructL" );
 }
 
 void CMP4PayloadFormatPluginDevice::SetVideoMimetypes( CPayloadFormatInfo& aPayloadFormatInfo ) const
 {
-    MDFVIDEOLOG_ENTERFN( "SetVideoMimetypes" )
+    MDFVIDEOLOG_ENTERFN( "SetVideoMimetypes" );
     _LIT8( KVideoMimeTypeMP4ES,   "video/MP4V-ES" );
     _LIT8( KVideoMimeTypeMP4RN,   "video/X-RN-MP4" );
     _LIT8( KVideoMimeTypeMP4AVC,  "video/X-HX-AVC1" );
     _LIT8( KVideoMimeTypeMP4DIVX, "video/X-HX-DIVX" );
     
     aPayloadFormatInfo.Reset();
-
+    
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4ES );
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4RN );
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4AVC );
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4DIVX );
     aPayloadFormatInfo.SetPayloadFormatId( KUidMP4PayloadFormatPluginDevice );
     
-    MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" )
+    MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" );
     return;
 }
 
 void CMP4PayloadFormatPluginDevice::SetVideoDataUnit()
 {
+    MDFVIDEOLOG_ENTERFN( "SetVideoDataUnit" );
     m_VideoDataUnitType = EDuCodedPicture;
     m_VideoDataUnitEncapsulation = EDuElementaryStream;
+    MDFVIDEOLOG_LEAVEFN( "SetVideoDataUnit" );
 }
 
 HX_RESULT CMP4PayloadFormatPluginDevice::FormBitstreamHeader( HBufC8*& pStreamHeader ) const
 {
+    MDFVIDEOLOG_ENTERFN( "FormBitstreamHeader" );
+    
     HX_RESULT retVal = HXR_FAIL;
     HX_DELETE( pStreamHeader );
-
+    
 #if defined( SYMBIAN_MDF_API_V2 ) and defined ( HELIX_FEATURE_SYMBIAN_MDF_API_V2_SUPPORTED )
     if( m_pMP4Depacketizer )
     {
         const TUint8* bitstreamheader = (const TUint8*) m_pMP4Depacketizer->GetBitstreamHeader();
         TInt length = (TInt) m_pMP4Depacketizer->GetBitstreamHeaderSize();
-
+        
         TRAPD( error, pStreamHeader = HBufC8::NewL( length ) );
         if( error == KErrNone )
         {
@@ -255,13 +262,14 @@
     pStreamHeader = NULL;
     retVal = HXR_OK;
 #endif
-
+    
+    MDFVIDEOLOG_RETURNFN( "FormBitstreamHeader", retVal );
     return retVal;
 }
 
 HX_RESULT CMP4PayloadFormatPluginDevice::CreateAllocators()
 {
-    MDFVIDEOLOG_ENTERFN( "CreateAllocators" )
+    MDFVIDEOLOG_ENTERFN( "CreateAllocators" );
     HX_RESULT retVal = HXR_OK;
     HX20ALLOCPROPS allocRequest, allocActual;
     
@@ -282,7 +290,7 @@
     {
         retVal = HXR_OUTOFMEMORY;
     }
-    MDFVIDEOLOG_LEAVEFN( "CreateAllocators" )
+    MDFVIDEOLOG_RETURNFN( "CreateAllocators", retVal );
     return retVal;
 }
 


From jwei at helixcommunity.org  Wed Feb  1 09:27:03 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:42:42 2006
Subject: [Datatype-cvs] mdf/video/format/mp4/pub mdfmp4payloadformat.h, 1.3,
	1.4
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/mp4/pub
In directory cvs:/tmp/cvs-serv7195

Modified Files:
	mdfmp4payloadformat.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfmp4payloadformat.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mdfmp4payloadformat.h	31 Jan 2006 20:57:49 -0000	1.3
+++ mdfmp4payloadformat.h	1 Feb 2006 17:27:01 -0000	1.4
@@ -88,6 +88,8 @@
     //or customized methods which are specific to MP4.
     //Without m_pMP4Depacketizer, m_pDepacketizer needs to be up-casted.
     MP4VPayloadFormat*        m_pMP4Depacketizer;
+
+    MDFVIDEOLOG_DEFINE;
     
 };
 


From jwei at helixcommunity.org  Wed Feb  1 09:27:42 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:43:21 2006
Subject: [Datatype-cvs] mdf/video/format/rm mdfrvxpayloadformat.cpp, 1.1,
	1.1.2.1
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/rm
In directory cvs:/tmp/cvs-serv7413

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfrvxpayloadformat.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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfrvxpayloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -d -r1.1 -r1.1.2.1
--- mdfrvxpayloadformat.cpp	10 Nov 2005 19:33:38 -0000	1.1
+++ mdfrvxpayloadformat.cpp	1 Feb 2006 17:27:40 -0000	1.1.2.1
@@ -55,8 +55,6 @@
 #define KUidRVXPayloadFormatPluginDeviceDefine  0x10207479
 const TUid KUidRVXPayloadFormatPluginDevice = {KUidRVXPayloadFormatPluginDeviceDefine};
 
-MDFVIDEOLOG_CLASSNAME( "CRVXPayloadFormatPluginDevice" )
-
 CRVXPayloadFormatPluginDevice* CRVXPayloadFormatPluginDevice::NewL()
 {
     CRVXPayloadFormatPluginDevice* self = new (ELeave) CRVXPayloadFormatPluginDevice();
@@ -68,14 +66,15 @@
 
 CRVXPayloadFormatPluginDevice::~CRVXPayloadFormatPluginDevice()
 {
-    MDFVIDEOLOG_ENTERFN( "~CRVXPayloadFormatPluginDevice" )
+    MDFVIDEOLOG_ENTERFN( "~CRVXPayloadFormatPluginDevice" );
     HX_RELEASE(m_pInputAllocator);
-    MDFVIDEOLOG_LEAVEFN( "~CRVXPayloadFormatPluginDevice" )
+    MDFVIDEOLOG_LEAVEFN( "~CRVXPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_DELETE;
 }
 
 HX_RESULT CRVXPayloadFormatPluginDevice::Init( IUnknown *pContext, IHXValues* pHeader )
 {
-    MDFVIDEOLOG_ENTERFN( "Init" )
+    MDFVIDEOLOG_ENTERFN2( "Init" );
     HX_RESULT retVal = HXR_OK;
     
     retVal = CreateAllocators();
@@ -84,15 +83,15 @@
     {
         retVal = CPayloadFormatPluginDevice::Init( pContext, pHeader );
     }
-
-    MDFVIDEOLOG_LEAVEFN( "Init" )
+    
+    MDFVIDEOLOG_LEAVEFN2( "Init" );
     return retVal;
 }
 
 HX_RESULT CRVXPayloadFormatPluginDevice::CreatePayloadFormat( IHXPayloadFormatObject*& aPayloadFormatObject  )
 {
-    MDFVIDEOLOG_ENTERFN( "CreatePayloadFormat" )
-        
+    MDFVIDEOLOG_ENTERFN2( "CreatePayloadFormat" );
+    
     HX_RESULT retVal = HXR_OK;
     
     if( SUCCEEDED( retVal ) )
@@ -112,13 +111,13 @@
         }
     }
     
-    MDFVIDEOLOG_LEAVEFN( "CreatePayloadFormat" )
+    MDFVIDEOLOG_LEAVEFN2( "CreatePayloadFormat" );
     return retVal;
 }
 
 CMediaPacket* CRVXPayloadFormatPluginDevice::CreateAssembledPacket( IHXPacket* pCodecData )
 {
-    MDFVIDEOLOG_ENTERFN( "CreateAssembledPacket" )
+    MDFVIDEOLOG_ENTERFN4( "CreateAssembledPacket" );
     
     HXCODEC_DATA* pCodecPacket = NULL;
     CMediaPacket* pFramePacket = NULL;
@@ -135,7 +134,7 @@
     }
     
     m_pRvxDepacketizer->CreateHXCodecPacket( pCodecPacket );
-
+    
     if( pCodecPacket )
     {
         UINT32 trvFrameDataSize = sizeof( TRVFrameData );
@@ -161,19 +160,21 @@
             pFramePacket->m_pUserData = this;
         }
     }
-    MDFVIDEOLOG_LEAVEFN( "CreateAssembledPacket" )
+    MDFVIDEOLOG_LEAVEFN4( "CreateAssembledPacket" );
     return pFramePacket;
 }
 
 UINT32 CRVXPayloadFormatPluginDevice::GetPreRollInMs() const
 {
-    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" )
-    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" )
+    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" );
+    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" );
     return DEFAUL_RVX_PREROLL_IN_MS;
 }
 
 HX_RESULT CRVXPayloadFormatPluginDevice::FillBuffer( TPtr8& inputBuffer, const CMediaPacket* pMediaPacket ) const
 {
+    MDFVIDEOLOG_ENTERFN4( "FillBuffer" );
+    
     HX_RESULT retVal = HXR_FAIL;
     
     if( pMediaPacket )
@@ -209,57 +210,63 @@
         }
         
         memcpy( (TUint8*) trvSegment, pCodecPacket->data, pCodecPacket->dataLength);
-
+        
         inputBuffer.SetLength( length );
-
+        
         retVal = HXR_OK;
     }
+    MDFVIDEOLOG_RETURNFN4( "FillBuffer", retVal );
     return retVal;
 }
 
 CRVXPayloadFormatPluginDevice::CRVXPayloadFormatPluginDevice()
 : m_pInputAllocator( NULL )
 {
-    MDFVIDEOLOG_ENTERFN( "CRVXPayloadFormatPluginDevice" )
-    MDFVIDEOLOG_LEAVEFN( "CRVXPayloadFormatPluginDevice" )
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CRVXPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_ENTERFN( "CRVXPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_LEAVEFN( "CRVXPayloadFormatPluginDevice" );
 }
 
 void CRVXPayloadFormatPluginDevice::ConstructL()
 {
-    MDFVIDEOLOG_ENTERFN( "ConstructL" )
-    MDFVIDEOLOG_LEAVEFN( "ConstructL" )
+    MDFVIDEOLOG_ENTERFN( "ConstructL" );
+    MDFVIDEOLOG_LEAVEFN( "ConstructL" );
 }
 
 void CRVXPayloadFormatPluginDevice::SetVideoMimetypes( CPayloadFormatInfo& aPayloadFormatInfo ) const
 {
-    MDFVIDEOLOG_ENTERFN( "SetVideoMimetypes" )
+    MDFVIDEOLOG_ENTERFN( "SetVideoMimetypes" );
     _LIT8( KVideoMimeTypeRVX,      "video/x-pn-realvideo" );
     _LIT8( KVideoMimeTypeRVXMUL,   "video/x-pn-multirate-realvideo" );
     
     aPayloadFormatInfo.Reset();
 #ifdef SYMBIAN_MDF_API_V2
-    MDFVIDEOLOG_INOUTFN( "SYMBIAN_MDF_API_V2 is true" )
+    MDFVIDEOLOG_INOUTFN( "SYMBIAN_MDF_API_V2 is true" );
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeRVX );
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeRVXMUL );
     
     aPayloadFormatInfo.SetPayloadFormatId( KUidRVXPayloadFormatPluginDevice );
 #endif
-
-    MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" )
+    
+    MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" );
     return;
 }
 
 void CRVXPayloadFormatPluginDevice::SetVideoDataUnit()
 {
+    MDFVIDEOLOG_ENTERFN( "SetVideoDataUnit" );
     m_VideoDataUnitType          = EDuVideoSegment;
     m_VideoDataUnitEncapsulation = EDuGenericPayload;
+    MDFVIDEOLOG_LEAVEFN( "SetVideoDataUnit" );
 }
 
 HX_RESULT CRVXPayloadFormatPluginDevice::FormBitstreamHeader( HBufC8*& pStreamHeader ) const
 {
+    MDFVIDEOLOG_ENTERFN( "FormBitstreamHeader" );
     HX_RESULT retVal = HXR_FAIL;
     HX_DELETE( pStreamHeader );
-
+    
     if( m_pDepacketizer )
     {
         //pMOFHeader is created and destroyed by m_pDepacketizer
@@ -268,22 +275,22 @@
         if( pMOFHeader->moftag == HX_MEDIA_VIDEO )
         {
             //HX_FORMAT_VIDEO structure
-
+            
             HX_FORMAT_VIDEO* videoFormat = (HX_FORMAT_VIDEO*) pMOFHeader;
-
+            
             UINT32 videoFormatSize = sizeof( HX_FORMAT_VIDEO );
             UINT32 opaqueDataLen  = m_pRvxDepacketizer->GetBitstreamHeaderSize() - videoFormatSize;
-
+            
             UINT32 trvHeaderSize = sizeof( TRVHeaderData );
-
+            
             TInt length = trvHeaderSize + opaqueDataLen;
-
+            
             TRAPD( error, pStreamHeader = HBufC8::NewL( length ) );
             if( error == KErrNone )
             {
                 TPtr8 tptr8 = pStreamHeader->Des();
                 TUint8* headerString = (TUint8*) tptr8.Ptr();
-
+                
                 TRVHeaderData* trvHeader = (TRVHeaderData*) headerString;
                 
                 trvHeader->iLength    = (TUint32) videoFormat->cbLength;
@@ -303,12 +310,14 @@
             }
         }
     }
+    MDFVIDEOLOG_RETURNFN( "FormBitstreamHeader", retVal );
     return retVal;
 }
 
 HX_RESULT CRVXPayloadFormatPluginDevice::CreateAllocators()
 {
-    MDFVIDEOLOG_ENTERFN( "CreateAllocators" )
+    MDFVIDEOLOG_ENTERFN( "CreateAllocators" );
+    
     HX_RESULT retVal = HXR_OK;
     HX20ALLOCPROPS allocRequest, allocActual;
     
@@ -332,18 +341,23 @@
             retVal = HXR_OUTOFMEMORY;
         }
     }
-    MDFVIDEOLOG_LEAVEFN( "CreateAllocators" )
+    
+    MDFVIDEOLOG_RETURNFN( "CreateAllocators", retVal );
     return retVal;
 }
 
 
 HX_RESULT CRVXPayloadFormatPluginDevice::InitializeDepacketizer()
 {
+    MDFVIDEOLOG_ENTERFN( "InitializeDepacketizer" );
+    
     HX_RESULT retVal = HXR_OK;
-
+    
     HX_ASSERT( m_pContext );
-
+    
     retVal = m_pDepacketizer->Init( m_pContext, FALSE );
+    
+    MDFVIDEOLOG_RETURNFN( "InitializeDepacketizer", retVal );
     return retVal;
 }
 


From jwei at helixcommunity.org  Wed Feb  1 09:27:53 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:43:32 2006
Subject: [Datatype-cvs] mdf/video/format/rm mdfrvxpayloadformat.cpp,1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/rm
In directory cvs:/tmp/cvs-serv7436

Modified Files:
	mdfrvxpayloadformat.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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfrvxpayloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mdfrvxpayloadformat.cpp	10 Nov 2005 19:33:38 -0000	1.1
+++ mdfrvxpayloadformat.cpp	1 Feb 2006 17:27:51 -0000	1.2
@@ -55,8 +55,6 @@
 #define KUidRVXPayloadFormatPluginDeviceDefine  0x10207479
 const TUid KUidRVXPayloadFormatPluginDevice = {KUidRVXPayloadFormatPluginDeviceDefine};
 
-MDFVIDEOLOG_CLASSNAME( "CRVXPayloadFormatPluginDevice" )
-
 CRVXPayloadFormatPluginDevice* CRVXPayloadFormatPluginDevice::NewL()
 {
     CRVXPayloadFormatPluginDevice* self = new (ELeave) CRVXPayloadFormatPluginDevice();
@@ -68,14 +66,15 @@
 
 CRVXPayloadFormatPluginDevice::~CRVXPayloadFormatPluginDevice()
 {
-    MDFVIDEOLOG_ENTERFN( "~CRVXPayloadFormatPluginDevice" )
+    MDFVIDEOLOG_ENTERFN( "~CRVXPayloadFormatPluginDevice" );
     HX_RELEASE(m_pInputAllocator);
-    MDFVIDEOLOG_LEAVEFN( "~CRVXPayloadFormatPluginDevice" )
+    MDFVIDEOLOG_LEAVEFN( "~CRVXPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_DELETE;
 }
 
 HX_RESULT CRVXPayloadFormatPluginDevice::Init( IUnknown *pContext, IHXValues* pHeader )
 {
-    MDFVIDEOLOG_ENTERFN( "Init" )
+    MDFVIDEOLOG_ENTERFN2( "Init" );
     HX_RESULT retVal = HXR_OK;
     
     retVal = CreateAllocators();
@@ -84,15 +83,15 @@
     {
         retVal = CPayloadFormatPluginDevice::Init( pContext, pHeader );
     }
-
-    MDFVIDEOLOG_LEAVEFN( "Init" )
+    
+    MDFVIDEOLOG_LEAVEFN2( "Init" );
     return retVal;
 }
 
 HX_RESULT CRVXPayloadFormatPluginDevice::CreatePayloadFormat( IHXPayloadFormatObject*& aPayloadFormatObject  )
 {
-    MDFVIDEOLOG_ENTERFN( "CreatePayloadFormat" )
-        
+    MDFVIDEOLOG_ENTERFN2( "CreatePayloadFormat" );
+    
     HX_RESULT retVal = HXR_OK;
     
     if( SUCCEEDED( retVal ) )
@@ -112,13 +111,13 @@
         }
     }
     
-    MDFVIDEOLOG_LEAVEFN( "CreatePayloadFormat" )
+    MDFVIDEOLOG_LEAVEFN2( "CreatePayloadFormat" );
     return retVal;
 }
 
 CMediaPacket* CRVXPayloadFormatPluginDevice::CreateAssembledPacket( IHXPacket* pCodecData )
 {
-    MDFVIDEOLOG_ENTERFN( "CreateAssembledPacket" )
+    MDFVIDEOLOG_ENTERFN4( "CreateAssembledPacket" );
     
     HXCODEC_DATA* pCodecPacket = NULL;
     CMediaPacket* pFramePacket = NULL;
@@ -135,7 +134,7 @@
     }
     
     m_pRvxDepacketizer->CreateHXCodecPacket( pCodecPacket );
-
+    
     if( pCodecPacket )
     {
         UINT32 trvFrameDataSize = sizeof( TRVFrameData );
@@ -161,19 +160,21 @@
             pFramePacket->m_pUserData = this;
         }
     }
-    MDFVIDEOLOG_LEAVEFN( "CreateAssembledPacket" )
+    MDFVIDEOLOG_LEAVEFN4( "CreateAssembledPacket" );
     return pFramePacket;
 }
 
 UINT32 CRVXPayloadFormatPluginDevice::GetPreRollInMs() const
 {
-    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" )
-    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" )
+    MDFVIDEOLOG_ENTERFN( "GetPreRollInMs" );
+    MDFVIDEOLOG_LEAVEFN( "GetPreRollInMs" );
     return DEFAUL_RVX_PREROLL_IN_MS;
 }
 
 HX_RESULT CRVXPayloadFormatPluginDevice::FillBuffer( TPtr8& inputBuffer, const CMediaPacket* pMediaPacket ) const
 {
+    MDFVIDEOLOG_ENTERFN4( "FillBuffer" );
+    
     HX_RESULT retVal = HXR_FAIL;
     
     if( pMediaPacket )
@@ -209,57 +210,63 @@
         }
         
         memcpy( (TUint8*) trvSegment, pCodecPacket->data, pCodecPacket->dataLength);
-
+        
         inputBuffer.SetLength( length );
-
+        
         retVal = HXR_OK;
     }
+    MDFVIDEOLOG_RETURNFN4( "FillBuffer", retVal );
     return retVal;
 }
 
 CRVXPayloadFormatPluginDevice::CRVXPayloadFormatPluginDevice()
 : m_pInputAllocator( NULL )
 {
-    MDFVIDEOLOG_ENTERFN( "CRVXPayloadFormatPluginDevice" )
-    MDFVIDEOLOG_LEAVEFN( "CRVXPayloadFormatPluginDevice" )
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CRVXPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_ENTERFN( "CRVXPayloadFormatPluginDevice" );
+    MDFVIDEOLOG_LEAVEFN( "CRVXPayloadFormatPluginDevice" );
 }
 
 void CRVXPayloadFormatPluginDevice::ConstructL()
 {
-    MDFVIDEOLOG_ENTERFN( "ConstructL" )
-    MDFVIDEOLOG_LEAVEFN( "ConstructL" )
+    MDFVIDEOLOG_ENTERFN( "ConstructL" );
+    MDFVIDEOLOG_LEAVEFN( "ConstructL" );
 }
 
 void CRVXPayloadFormatPluginDevice::SetVideoMimetypes( CPayloadFormatInfo& aPayloadFormatInfo ) const
 {
-    MDFVIDEOLOG_ENTERFN( "SetVideoMimetypes" )
+    MDFVIDEOLOG_ENTERFN( "SetVideoMimetypes" );
     _LIT8( KVideoMimeTypeRVX,      "video/x-pn-realvideo" );
     _LIT8( KVideoMimeTypeRVXMUL,   "video/x-pn-multirate-realvideo" );
     
     aPayloadFormatInfo.Reset();
 #ifdef SYMBIAN_MDF_API_V2
-    MDFVIDEOLOG_INOUTFN( "SYMBIAN_MDF_API_V2 is true" )
+    MDFVIDEOLOG_INOUTFN( "SYMBIAN_MDF_API_V2 is true" );
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeRVX );
     aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeRVXMUL );
     
     aPayloadFormatInfo.SetPayloadFormatId( KUidRVXPayloadFormatPluginDevice );
 #endif
-
-    MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" )
+    
+    MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" );
     return;
 }
 
 void CRVXPayloadFormatPluginDevice::SetVideoDataUnit()
 {
+    MDFVIDEOLOG_ENTERFN( "SetVideoDataUnit" );
     m_VideoDataUnitType          = EDuVideoSegment;
     m_VideoDataUnitEncapsulation = EDuGenericPayload;
+    MDFVIDEOLOG_LEAVEFN( "SetVideoDataUnit" );
 }
 
 HX_RESULT CRVXPayloadFormatPluginDevice::FormBitstreamHeader( HBufC8*& pStreamHeader ) const
 {
+    MDFVIDEOLOG_ENTERFN( "FormBitstreamHeader" );
     HX_RESULT retVal = HXR_FAIL;
     HX_DELETE( pStreamHeader );
-
+    
     if( m_pDepacketizer )
     {
         //pMOFHeader is created and destroyed by m_pDepacketizer
@@ -268,22 +275,22 @@
         if( pMOFHeader->moftag == HX_MEDIA_VIDEO )
         {
             //HX_FORMAT_VIDEO structure
-
+            
             HX_FORMAT_VIDEO* videoFormat = (HX_FORMAT_VIDEO*) pMOFHeader;
-
+            
             UINT32 videoFormatSize = sizeof( HX_FORMAT_VIDEO );
             UINT32 opaqueDataLen  = m_pRvxDepacketizer->GetBitstreamHeaderSize() - videoFormatSize;
-
+            
             UINT32 trvHeaderSize = sizeof( TRVHeaderData );
-
+            
             TInt length = trvHeaderSize + opaqueDataLen;
-
+            
             TRAPD( error, pStreamHeader = HBufC8::NewL( length ) );
             if( error == KErrNone )
             {
                 TPtr8 tptr8 = pStreamHeader->Des();
                 TUint8* headerString = (TUint8*) tptr8.Ptr();
-
+                
                 TRVHeaderData* trvHeader = (TRVHeaderData*) headerString;
                 
                 trvHeader->iLength    = (TUint32) videoFormat->cbLength;
@@ -303,12 +310,14 @@
             }
         }
     }
+    MDFVIDEOLOG_RETURNFN( "FormBitstreamHeader", retVal );
     return retVal;
 }
 
 HX_RESULT CRVXPayloadFormatPluginDevice::CreateAllocators()
 {
-    MDFVIDEOLOG_ENTERFN( "CreateAllocators" )
+    MDFVIDEOLOG_ENTERFN( "CreateAllocators" );
+    
     HX_RESULT retVal = HXR_OK;
     HX20ALLOCPROPS allocRequest, allocActual;
     
@@ -332,18 +341,23 @@
             retVal = HXR_OUTOFMEMORY;
         }
     }
-    MDFVIDEOLOG_LEAVEFN( "CreateAllocators" )
+    
+    MDFVIDEOLOG_RETURNFN( "CreateAllocators", retVal );
     return retVal;
 }
 
 
 HX_RESULT CRVXPayloadFormatPluginDevice::InitializeDepacketizer()
 {
+    MDFVIDEOLOG_ENTERFN( "InitializeDepacketizer" );
+    
     HX_RESULT retVal = HXR_OK;
-
+    
     HX_ASSERT( m_pContext );
-
+    
     retVal = m_pDepacketizer->Init( m_pContext, FALSE );
+    
+    MDFVIDEOLOG_RETURNFN( "InitializeDepacketizer", retVal );
     return retVal;
 }
 


From jwei at helixcommunity.org  Wed Feb  1 09:28:39 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:44:18 2006
Subject: [Datatype-cvs] mdf/video/format/rm/pub mdfrvxpayloadformat.h, 1.1,
	1.1.2.1
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/rm/pub
In directory cvs:/tmp/cvs-serv7472

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfrvxpayloadformat.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfrvxpayloadformat.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -d -r1.1 -r1.1.2.1
--- mdfrvxpayloadformat.h	10 Nov 2005 19:34:20 -0000	1.1
+++ mdfrvxpayloadformat.h	1 Feb 2006 17:28:37 -0000	1.1.2.1
@@ -113,7 +113,9 @@
         TUint16     iFlags;
         TInt        iLastPacket;
         TUint32     iNumSegments;
-    };    
+    };
+
+    MDFVIDEOLOG_DEFINE;
 };
 
 #endif //_MDFRVXPAYLOADFORMAT_H_


From jwei at helixcommunity.org  Wed Feb  1 09:28:56 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:44:35 2006
Subject: [Datatype-cvs] mdf/video/format/rm/pub mdfrvxpayloadformat.h, 1.1,
	1.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/format/rm/pub
In directory cvs:/tmp/cvs-serv7533

Modified Files:
	mdfrvxpayloadformat.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfrvxpayloadformat.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mdfrvxpayloadformat.h	10 Nov 2005 19:34:20 -0000	1.1
+++ mdfrvxpayloadformat.h	1 Feb 2006 17:28:54 -0000	1.2
@@ -113,7 +113,9 @@
         TUint16     iFlags;
         TInt        iLastPacket;
         TUint32     iNumSegments;
-    };    
+    };
+
+    MDFVIDEOLOG_DEFINE;
 };
 
 #endif //_MDFRVXPAYLOADFORMAT_H_


From jwei at helixcommunity.org  Wed Feb  1 09:29:26 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:45:04 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfclocksource.cpp, 1.3.2.1,
	1.3.2.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv7615

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfclocksource.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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfclocksource.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- mdfclocksource.cpp	31 Jan 2006 17:46:33 -0000	1.3.2.1
+++ mdfclocksource.cpp	1 Feb 2006 17:29:23 -0000	1.3.2.2
@@ -62,6 +62,9 @@
 
 CMdfClockSource::~CMdfClockSource()
 {
+    MDFVIDEOLOG_ENTERFN( "CMdfClockSource" );
+    MDFVIDEOLOG_LEAVEFN( "CMdfClockSource" );
+    MDFVIDEOLOG_DELETE;
 }
 
 TAny* CMdfClockSource::CustomInterface( TUid aInterface )
@@ -71,22 +74,25 @@
 
 TTimeIntervalMicroSeconds CMdfClockSource::Time()
 {
-    TTimeIntervalMicroSeconds currentTimeInMicro( 0 );
+    MDFVIDEOLOG_ENTERFN4( "Time" );
+    TTimeIntervalMicroSeconds currentTimeInMicro( 0 );
     TInt64 currentTimeInMs64  = 0;
-    TUint  currentTimeInMsTUint = 0;
+    TUint  currentTimeInMsTUint = 0;
     
     if( m_bClockStarted )
     {
-        //does not require Mutex in this operation
+        //does not require Mutex in this operation
         currentTimeInMsTUint = (TUint) m_pTimeSyncSmoother->GetTimeNow();
     }
     else
     {
         currentTimeInMsTUint = (TUint) m_pTimeSyncSmoother->GetBaseTime() + m_pTimeSyncSmoother->GetTimelineOffset();
-    }
+    }
     
-    currentTimeInMs64  = TInt64( currentTimeInMsTUint );
-    currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
+    currentTimeInMs64  = TInt64( currentTimeInMsTUint );
+    currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
+    
+    MDFVIDEOLOG_WRITE_FORMAT4( "<-  Time, return %l", currentTimeInMsTUint );
     return currentTimeInMicro;
 }
 
@@ -94,6 +100,10 @@
 : m_pTimeSyncSmoother(pTimeSyncSmoother ),
   m_bClockStarted( EFalse )
 {
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CMdfClockSource" );
+    MDFVIDEOLOG_ENTERFN( "CMdfClockSource" );
+    MDFVIDEOLOG_LEAVEFN( "CMdfClockSource" );
 }
 
 void CMdfClockSource::ConstructL()
@@ -102,12 +112,15 @@
 
 void CMdfClockSource::Start()
 {
+    MDFVIDEOLOG_ENTERFN( "Start" );
     m_bClockStarted = ETrue;
+    MDFVIDEOLOG_LEAVEFN( "Start" );
 }
 
 void CMdfClockSource::Stop()
 {
+    MDFVIDEOLOG_ENTERFN( "Stop" );
     m_bClockStarted = EFalse;
+    MDFVIDEOLOG_LEAVEFN( "Stop" );
 }
-
-
+


From jwei at helixcommunity.org  Wed Feb  1 09:29:36 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:45:14 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfclocksource.cpp,1.4,1.5
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv7644

Modified Files:
	mdfclocksource.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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfclocksource.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mdfclocksource.cpp	31 Jan 2006 20:58:36 -0000	1.4
+++ mdfclocksource.cpp	1 Feb 2006 17:29:34 -0000	1.5
@@ -62,6 +62,9 @@
 
 CMdfClockSource::~CMdfClockSource()
 {
+    MDFVIDEOLOG_ENTERFN( "CMdfClockSource" );
+    MDFVIDEOLOG_LEAVEFN( "CMdfClockSource" );
+    MDFVIDEOLOG_DELETE;
 }
 
 TAny* CMdfClockSource::CustomInterface( TUid aInterface )
@@ -71,22 +74,25 @@
 
 TTimeIntervalMicroSeconds CMdfClockSource::Time()
 {
-    TTimeIntervalMicroSeconds currentTimeInMicro( 0 );
+    MDFVIDEOLOG_ENTERFN4( "Time" );
+    TTimeIntervalMicroSeconds currentTimeInMicro( 0 );
     TInt64 currentTimeInMs64  = 0;
-    TUint  currentTimeInMsTUint = 0;
+    TUint  currentTimeInMsTUint = 0;
     
     if( m_bClockStarted )
     {
-        //does not require Mutex in this operation
+        //does not require Mutex in this operation
         currentTimeInMsTUint = (TUint) m_pTimeSyncSmoother->GetTimeNow();
     }
     else
     {
         currentTimeInMsTUint = (TUint) m_pTimeSyncSmoother->GetBaseTime() + m_pTimeSyncSmoother->GetTimelineOffset();
-    }
+    }
     
-    currentTimeInMs64  = TInt64( currentTimeInMsTUint );
-    currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
+    currentTimeInMs64  = TInt64( currentTimeInMsTUint );
+    currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
+    
+    MDFVIDEOLOG_WRITE_FORMAT4( "<-  Time, return %l", currentTimeInMsTUint );
     return currentTimeInMicro;
 }
 
@@ -94,6 +100,10 @@
 : m_pTimeSyncSmoother(pTimeSyncSmoother ),
   m_bClockStarted( EFalse )
 {
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CMdfClockSource" );
+    MDFVIDEOLOG_ENTERFN( "CMdfClockSource" );
+    MDFVIDEOLOG_LEAVEFN( "CMdfClockSource" );
 }
 
 void CMdfClockSource::ConstructL()
@@ -102,12 +112,15 @@
 
 void CMdfClockSource::Start()
 {
+    MDFVIDEOLOG_ENTERFN( "Start" );
     m_bClockStarted = ETrue;
+    MDFVIDEOLOG_LEAVEFN( "Start" );
 }
 
 void CMdfClockSource::Stop()
 {
+    MDFVIDEOLOG_ENTERFN( "Stop" );
     m_bClockStarted = EFalse;
+    MDFVIDEOLOG_LEAVEFN( "Stop" );
 }
-
-
+


From jwei at helixcommunity.org  Wed Feb  1 09:29:51 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:45:31 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfpluginmanager.cpp,1.2,1.2.2.1
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv7670

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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfpluginmanager.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -d -r1.2 -r1.2.2.1
--- mdfpluginmanager.cpp	10 Nov 2005 16:57:34 -0000	1.2
+++ mdfpluginmanager.cpp	1 Feb 2006 17:29:49 -0000	1.2.2.1
@@ -52,8 +52,6 @@
 #include 
 #include "mdfgenericlog.h"
 
-MDFVIDEOLOG_CLASSNAME( "CMdfPluginManager" )
-
 /////////////////////////////////////////////////////////////////////
 //CPluginPackage
 /////////////////////////////////////////////////////////////////////
@@ -248,34 +246,38 @@
   m_PluginPackageArray( HW_PACKAGE_ARRAY_GRANULARITY ),
   m_PayloadFormatArray( PAYLOADFORMAT_ARRAY_GRANULARITY )
 {
-    MDFVIDEOLOG_CREATE_NOWRITE
-    MDFVIDEOLOG_ENTERFN( "CMdfPluginManager" )
-    MDFVIDEOLOG_LEAVEFN( "CMdfPluginManager" )
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CMdfPluginManager" );
+    MDFVIDEOLOG_ENTERFN( "CMdfPluginManager" );
+    MDFVIDEOLOG_LEAVEFN( "CMdfPluginManager" );
 }
 
 CMdfPluginManager::~CMdfPluginManager()
 {
-    MDFVIDEOLOG_ENTERFN( "~CMdfPluginManager" )
+    MDFVIDEOLOG_ENTERFN( "~CMdfPluginManager" );
     Reset();
-    MDFVIDEOLOG_LEAVEFN( "~CMdfPluginManager" )
-    MDFVIDEOLOG_DELETE
+    MDFVIDEOLOG_LEAVEFN( "~CMdfPluginManager" );
+    MDFVIDEOLOG_DELETE;
 }
 
 void CMdfPluginManager::ConstructL()
 {
-    MDFVIDEOLOG_ENTERFN( "ConstructL" )
-
+    MDFVIDEOLOG_ENTERFN2( "ConstructL" );
+    
     RImplInfoPtrArray decoderPlugins;
     CleanupResetAndDestroyPushL( decoderPlugins );
     
     REComSession::ListImplementationsL(KUidDevVideoDecoderHwDevice, decoderPlugins);
     
-    TInt countdec = decoderPlugins.Count();
+    TInt countdec = decoderPlugins.Count();
+    MDFVIDEOLOG_WRITE_FORMAT2( "<-> Number of decoders discovered is = %d", countdec );
+    
     for( TInt i = 0; i < countdec; i++ )
     {
         const CImplementationInformation* plugin = decoderPlugins[i];
         
         TUid  pluginId = plugin->ImplementationUid();
+        MDFVIDEOLOG_WRITE_MULTI_FORMAT2( "    (%d): Decoder id = 0x%08x", i, pluginId.iUid );
         
         CMMFVideoDecodeHwDevice* dev = CMMFVideoDecodeHwDevice::NewL( pluginId, *this );
         CleanupStack::PushL(dev);
@@ -294,11 +296,14 @@
     REComSession::ListImplementationsL(KUidDevVideoPostProcessorHwDevice, postprocessorPlugins);
     
     TInt countpp = postprocessorPlugins.Count();
+    MDFVIDEOLOG_WRITE_FORMAT2( "<-> Number of postprocessor discovered is = %d", countpp );
+    
     for( TInt j = 0; j < countpp; j++ )
     {
         const CImplementationInformation* plugin = postprocessorPlugins[j];
         
         TUid  pluginId = plugin->ImplementationUid();
+        MDFVIDEOLOG_WRITE_MULTI_FORMAT2( "    (%d): Postprocessor id = 0x%08x", j, pluginId.iUid );
         
         CMMFVideoPostProcHwDevice* dev = CMMFVideoPostProcHwDevice::NewL( pluginId, *this );
         CleanupStack::PushL( dev );
@@ -310,17 +315,20 @@
     }
     
     CleanupStack::PopAndDestroy(&postprocessorPlugins);
-        
+    
     RImplInfoPtrArray payloadformatPlugins;
     REComSession::ListImplementationsL(KUidPayloadFormatPluginDevice, payloadformatPlugins);
     CleanupResetAndDestroyPushL( payloadformatPlugins );
     
     TInt countpy = payloadformatPlugins.Count();
+    MDFVIDEOLOG_WRITE_FORMAT2( "<-> Number of payload discovered is = %d", countpy );
+    
     for( TInt k = 0; k < countpy; k++ )
     {
         const CImplementationInformation* plugin = payloadformatPlugins[k];
         
         TUid  pluginId = plugin->ImplementationUid();
+        MDFVIDEOLOG_WRITE_MULTI_FORMAT2( "    (%d): Payload id = 0x%08x", k, pluginId.iUid );
         
         CPayloadFormatPluginDevice* dev = CPayloadFormatPluginDevice::NewL( pluginId );
         
@@ -335,16 +343,18 @@
     
     CleanupStack::PopAndDestroy(&payloadformatPlugins);
     
-    MDFVIDEOLOG_LEAVEFN( "ConstructL" )
+    MDFVIDEOLOG_LEAVEFN2( "ConstructL" );
 }
 
 //if found hw given the MimeType, return ETrue, otherwise EFalse
 TBool CMdfPluginManager::GetIdsByMimeTypeL( CPluginPackage& aPluginPackage )
 {
-    MDFVIDEOLOG_ENTERFN( "GetIdsByMimeTypeL" )
-        
-    const TDesC8& aMimeType = aPluginPackage.GetMimeType();
+    MDFVIDEOLOG_ENTERFN( "GetIdsByMimeTypeL" );
     
+    const TDesC8& aMimeType = aPluginPackage.GetMimeType();
+    
+    MDFVIDEOLOG_WRITE_FORMAT( "<-> Mimetype investigated for support is %s", aMimeType.Ptr() );
+    
     TBool foundPackage       = EFalse;
     TBool foundPayloadFormat = EFalse;
     
@@ -358,13 +368,15 @@
         if( package->GetMimeType() == aMimeType )
         {
             foundPackage = ETrue;
-            entryLocation = i;
+            entryLocation = i;
+            MDFVIDEOLOG_INOUTFN( "Mimetype has already been investigated earlier" );
             break;
         }
     }
     
     if( !foundPackage )
     {
+        MDFVIDEOLOG_INOUTFN( "Mimetype has not been investigated earlier, investigate now ..." );
         CPluginPackage* newPackage = CPluginPackage::NewL( aMimeType );
         entryLocation = m_PluginPackageArray.Count();
         m_PluginPackageArray.Append( newPackage );  //transfer the ownership
@@ -378,66 +390,102 @@
         TInt postprocessorCount = m_HwPostProcessorArray.Count();
         TInt payloadformatCount = m_PayloadFormatArray.Count();
         CPayloadFormatInfo* payloadformatinfo = NULL;
-
+        
         for( TInt m = 0; m < payloadformatCount && !foundPayloadFormat; m++ )
         {
-            payloadformatinfo = m_PayloadFormatArray[ m ];
+            payloadformatinfo = m_PayloadFormatArray[ m ];
+            MDFVIDEOLOG_WRITE_FORMAT( "<-> Payload selected id: 0x%08x", payloadformatinfo->Uid().iUid );
+            
             if( payloadformatinfo->SupportMimeType( aMimeType ) )
-            {
+            {
+                MDFVIDEOLOG_INOUTFN( "Selected payload do support mimetype" );
                 TVideoDataUnitType  unitType = payloadformatinfo->GetVideoDataUnitType();
                 TVideoDataUnitEncapsulation unitEncapsulation = payloadformatinfo->GetVideoDataUnitEncapsulation();
                 TUid plId = payloadformatinfo->Uid();
-
+                
                 newPackage->SetVideoDataUnitType( unitType );
                 newPackage->SetVideoDataUnitEncapsulation( unitEncapsulation );
                 newPackage->SetPayloadFormatId( plId );
-
+                
                 foundPayloadFormat = ETrue;
-            }
+            }
+            else
+            {
+                MDFVIDEOLOG_INOUTFN( "Selected payload do NOT support mimetype" );
+            }
         }
         
         if( foundPayloadFormat )
         {        
+            MDFVIDEOLOG_INOUTFN( "Payload matches, check for decoder ..." );
+            
             for( TInt j = 0; j < decoderCount && !foundPackage; j++ )
             {
-                CVideoDecoderInfo* decoderInfo = m_HwDecoderArray[j];
+                CVideoDecoderInfo* decoderInfo = m_HwDecoderArray[j];
+                MDFVIDEOLOG_WRITE_FORMAT( "<-> Decoder selected id: 0x%08x", decoderInfo->Uid().iUid );
+                
                 if( decoderInfo->SupportsFormat(*format) )
                 {
+                    MDFVIDEOLOG_INOUTFN( "Selected decoder do support mimetype" );
                     TUid decoderUid = decoderInfo->Uid();
                     CMMFVideoDecodeHwDevice* dev = CMMFVideoDecodeHwDevice::NewL( decoderUid, *this );
                     CleanupStack::PushL(dev);
-
+                    
                     TVideoDataUnitType UnitType = payloadformatinfo->GetVideoDataUnitType();
                     TVideoDataUnitEncapsulation UnitEncapsulation = payloadformatinfo->GetVideoDataUnitEncapsulation();
-
+                    
                     TRAPD( error, dev->SetInputFormatL( *format, UnitType, UnitEncapsulation, ETrue ) );
                     if( error == KErrNone )
-                    {
+                    {
+                        MDFVIDEOLOG_INOUTFN( "dev->SetInputFormatL does not leave" );
+                        
                         RArray decoderOutputFormat;
                         dev->GetOutputFormatListL( decoderOutputFormat );
-                    
+                        
+                        MDFVIDEOLOG_INOUTFN( "dev->GetOutputFormatListL does not leave" );
                         //check to see if postprocessor is supporting
                         for( TInt k = 0; k < postprocessorCount && !foundPackage; k++ )
                         {
                             CPostProcessorInfo* postprocessorInfo = m_HwPostProcessorArray[k];
+                            MDFVIDEOLOG_WRITE_FORMAT( "<-> Postprocessor selected id: 0x%08x", postprocessorInfo->Uid().iUid );
+                            
                             if( postprocessorInfo->SupportsDirectDisplay() )
                             {
+                                MDFVIDEOLOG_INOUTFN( "postprocessorInfo->SupportsDirectDisplay() true" );
                                 const RArray& postprocessorInputFormat = postprocessorInfo->SupportedFormats();
                                 TUncompressedVideoFormat aCommonFormat;
                                 foundPackage = CMMFDevVideoPlay::FindCommonFormat( decoderOutputFormat.Array(), postprocessorInputFormat.Array(), aCommonFormat );
                                 if( foundPackage )
-                                {
+                                {
+                                    MDFVIDEOLOG_INOUTFN( "Commonformat between decoder and postprocessor is found" );
                                     TUid decoderId = decoderInfo->Uid();
                                     newPackage->SetHwDecoderId( decoderId );
                                     TUid ppId = postprocessorInfo->Uid();
                                     newPackage->SetHwPostProcessorId( ppId );
                                     newPackage->SetHwUncompressedVideoFormat( aCommonFormat );
                                     newPackage->SetPackageValid( ETrue );
-                                }
+                                    MDFVIDEOLOG_INOUTFN( "Mimetype is supported" );
+                                }
+                                else
+                                {
+                                    MDFVIDEOLOG_INOUTFN( "Commonformat between decoder and postprocessor is NOT found" );
+                                }
+                            }
+                            else
+                            {
+                                MDFVIDEOLOG_INOUTFN( "postprocessorInfo->SupportsDirectDisplay() false" );
                             }
                         }
+                    }
+                    else
+                    {
+                        MDFVIDEOLOG_INOUTFN( "dev->SetInputFormatL leaves" );
                     }
                     CleanupStack::PopAndDestroy(dev);
+                }
+                else
+                {
+                    MDFVIDEOLOG_INOUTFN( "Decoder do NOT support mimetype" );
                 }
             }
         }
@@ -449,15 +497,15 @@
     
     aPluginPackage = *package;
     
-    MDFVIDEOLOG_LEAVEFN( "GetIdsByMimeTypeL" )
-        
+    MDFVIDEOLOG_LEAVEFN( "GetIdsByMimeTypeL" );
+    
     return package->IsPackageValid();
 }
-    
+
 void CMdfPluginManager::Reset()
 {
-    MDFVIDEOLOG_ENTERFN( "Reset" )
-        
+    MDFVIDEOLOG_ENTERFN( "Reset" );
+    
     m_PayloadFormatArray.ResetAndDestroy();
     m_PayloadFormatArray.Close();
     
@@ -470,13 +518,13 @@
     m_PluginPackageArray.ResetAndDestroy();
     m_PluginPackageArray.Close();
     
-    MDFVIDEOLOG_LEAVEFN( "Reset" )
+    MDFVIDEOLOG_LEAVEFN( "Reset" );
 }
 
 char** CMdfPluginManager::GetSupportedMimeType() //transfer ownership
 {
-    MDFVIDEOLOG_ENTERFN( "GetSupportedMimeType" )
-
+    MDFVIDEOLOG_ENTERFN2( "GetSupportedMimeType" );
+    
     TInt   numberOfMimeType = 0;
     
     TInt count = m_PayloadFormatArray.Count();
@@ -489,6 +537,8 @@
         for( TInt j = 0; j < countMimeType; j++ )
         {
             HBufC8* tdesc = supportedmimetypearray[ j ];
+            MDFVIDEOLOG_WRITE_FORMAT( "<-> Mimetype targeted is %s", tdesc->Ptr() );
+            
             CPluginPackage* pluginpackage = NULL;
             TBool valid = EFalse;
             TRAPD( error, pluginpackage = CPluginPackage::NewL( *tdesc ) );
@@ -504,30 +554,39 @@
             if( valid )
             {
                 numberOfMimeType++;
+                MDFVIDEOLOG_INOUTFN( "Mimetype is supported" );
+            }
+            else
+            {
+                MDFVIDEOLOG_INOUTFN( "Mimetype is NOT supported" );
             }
         }
         
     }
-
+    
+    MDFVIDEOLOG_INOUTFN( "Mimetypes that are supported and returned to Helix ..." );
     char** pMimeType = NULL;
     pMimeType = new char*[ numberOfMimeType +1 ];
     if( pMimeType )
     {
         TInt count = m_PluginPackageArray.Count();
-
+        
         TInt validPackage = 0;
-
+        
         for( TInt k = 0; k < count; k++ )
         {
             CPluginPackage* pluginPackage = m_PluginPackageArray[ k ];
             if( pluginPackage->IsPackageValid() )
             {
                 const TDesC8& supportedMimeType = pluginPackage->GetMimeType();
-
+                
                 TInt length = supportedMimeType.Length();
-                const unsigned char* buffer = supportedMimeType.Ptr();
+                const unsigned char* buffer = supportedMimeType.Ptr();
+                
+                MDFVIDEOLOG_WRITE_FORMAT2( "    Mimetype %s is supported", buffer );
+                
                 pMimeType[ validPackage ] = new char[ length+1 ];
-
+                
                 TInt m = 0;
                 for( m = 0; m < length; m++ )
                 {
@@ -537,11 +596,11 @@
             }
         }    
         pMimeType[ validPackage ] = NULL;
-        HX_ASSERT( numberOfMimeType == validPackage );
+        HX_ASSERT( numberOfMimeType >= validPackage );
     }
-
-    MDFVIDEOLOG_LEAVEFN( "GetSupportedMimeType" )
-        
+    
+    MDFVIDEOLOG_LEAVEFN2( "GetSupportedMimeType" );
+    
     return pMimeType;
 }
 
@@ -556,10 +615,10 @@
     
     _LIT8( KHelixMP4,  "video/MP4V-ES" );
     _LIT8( KMdfMP4,    "video/mp4v-es" );
-
+    
     _LIT8( KMulirateRV, "video/x-pn-multirate-realvideo" );
     _LIT8( KHelixRV,    "video/x-pn-realvideo" );
-
+    
     _LIT8( KXRNH263, "video/X-RN-3GPP-H263" );
     
     _LIT8( KXRNMP4,  "video/X-RN-MP4" );
@@ -598,6 +657,6 @@
     return convertedMimeType;
 }
 
-    
-    
-    
+
+
+


From jwei at helixcommunity.org  Wed Feb  1 09:30:02 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:45:42 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfpluginmanager.cpp,1.2,1.3
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv7692

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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfpluginmanager.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfpluginmanager.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mdfpluginmanager.cpp	10 Nov 2005 16:57:34 -0000	1.2
+++ mdfpluginmanager.cpp	1 Feb 2006 17:30:00 -0000	1.3
@@ -52,8 +52,6 @@
 #include 
 #include "mdfgenericlog.h"
 
-MDFVIDEOLOG_CLASSNAME( "CMdfPluginManager" )
-
 /////////////////////////////////////////////////////////////////////
 //CPluginPackage
 /////////////////////////////////////////////////////////////////////
@@ -248,34 +246,38 @@
   m_PluginPackageArray( HW_PACKAGE_ARRAY_GRANULARITY ),
   m_PayloadFormatArray( PAYLOADFORMAT_ARRAY_GRANULARITY )
 {
-    MDFVIDEOLOG_CREATE_NOWRITE
-    MDFVIDEOLOG_ENTERFN( "CMdfPluginManager" )
-    MDFVIDEOLOG_LEAVEFN( "CMdfPluginManager" )
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CMdfPluginManager" );
+    MDFVIDEOLOG_ENTERFN( "CMdfPluginManager" );
+    MDFVIDEOLOG_LEAVEFN( "CMdfPluginManager" );
 }
 
 CMdfPluginManager::~CMdfPluginManager()
 {
-    MDFVIDEOLOG_ENTERFN( "~CMdfPluginManager" )
+    MDFVIDEOLOG_ENTERFN( "~CMdfPluginManager" );
     Reset();
-    MDFVIDEOLOG_LEAVEFN( "~CMdfPluginManager" )
-    MDFVIDEOLOG_DELETE
+    MDFVIDEOLOG_LEAVEFN( "~CMdfPluginManager" );
+    MDFVIDEOLOG_DELETE;
 }
 
 void CMdfPluginManager::ConstructL()
 {
-    MDFVIDEOLOG_ENTERFN( "ConstructL" )
-
+    MDFVIDEOLOG_ENTERFN2( "ConstructL" );
+    
     RImplInfoPtrArray decoderPlugins;
     CleanupResetAndDestroyPushL( decoderPlugins );
     
     REComSession::ListImplementationsL(KUidDevVideoDecoderHwDevice, decoderPlugins);
     
-    TInt countdec = decoderPlugins.Count();
+    TInt countdec = decoderPlugins.Count();
+    MDFVIDEOLOG_WRITE_FORMAT2( "<-> Number of decoders discovered is = %d", countdec );
+    
     for( TInt i = 0; i < countdec; i++ )
     {
         const CImplementationInformation* plugin = decoderPlugins[i];
         
         TUid  pluginId = plugin->ImplementationUid();
+        MDFVIDEOLOG_WRITE_MULTI_FORMAT2( "    (%d): Decoder id = 0x%08x", i, pluginId.iUid );
         
         CMMFVideoDecodeHwDevice* dev = CMMFVideoDecodeHwDevice::NewL( pluginId, *this );
         CleanupStack::PushL(dev);
@@ -294,11 +296,14 @@
     REComSession::ListImplementationsL(KUidDevVideoPostProcessorHwDevice, postprocessorPlugins);
     
     TInt countpp = postprocessorPlugins.Count();
+    MDFVIDEOLOG_WRITE_FORMAT2( "<-> Number of postprocessor discovered is = %d", countpp );
+    
     for( TInt j = 0; j < countpp; j++ )
     {
         const CImplementationInformation* plugin = postprocessorPlugins[j];
         
         TUid  pluginId = plugin->ImplementationUid();
+        MDFVIDEOLOG_WRITE_MULTI_FORMAT2( "    (%d): Postprocessor id = 0x%08x", j, pluginId.iUid );
         
         CMMFVideoPostProcHwDevice* dev = CMMFVideoPostProcHwDevice::NewL( pluginId, *this );
         CleanupStack::PushL( dev );
@@ -310,17 +315,20 @@
     }
     
     CleanupStack::PopAndDestroy(&postprocessorPlugins);
-        
+    
     RImplInfoPtrArray payloadformatPlugins;
     REComSession::ListImplementationsL(KUidPayloadFormatPluginDevice, payloadformatPlugins);
     CleanupResetAndDestroyPushL( payloadformatPlugins );
     
     TInt countpy = payloadformatPlugins.Count();
+    MDFVIDEOLOG_WRITE_FORMAT2( "<-> Number of payload discovered is = %d", countpy );
+    
     for( TInt k = 0; k < countpy; k++ )
     {
         const CImplementationInformation* plugin = payloadformatPlugins[k];
         
         TUid  pluginId = plugin->ImplementationUid();
+        MDFVIDEOLOG_WRITE_MULTI_FORMAT2( "    (%d): Payload id = 0x%08x", k, pluginId.iUid );
         
         CPayloadFormatPluginDevice* dev = CPayloadFormatPluginDevice::NewL( pluginId );
         
@@ -335,16 +343,18 @@
     
     CleanupStack::PopAndDestroy(&payloadformatPlugins);
     
-    MDFVIDEOLOG_LEAVEFN( "ConstructL" )
+    MDFVIDEOLOG_LEAVEFN2( "ConstructL" );
 }
 
 //if found hw given the MimeType, return ETrue, otherwise EFalse
 TBool CMdfPluginManager::GetIdsByMimeTypeL( CPluginPackage& aPluginPackage )
 {
-    MDFVIDEOLOG_ENTERFN( "GetIdsByMimeTypeL" )
-        
-    const TDesC8& aMimeType = aPluginPackage.GetMimeType();
+    MDFVIDEOLOG_ENTERFN( "GetIdsByMimeTypeL" );
     
+    const TDesC8& aMimeType = aPluginPackage.GetMimeType();
+    
+    MDFVIDEOLOG_WRITE_FORMAT( "<-> Mimetype investigated for support is %s", aMimeType.Ptr() );
+    
     TBool foundPackage       = EFalse;
     TBool foundPayloadFormat = EFalse;
     
@@ -358,13 +368,15 @@
         if( package->GetMimeType() == aMimeType )
         {
             foundPackage = ETrue;
-            entryLocation = i;
+            entryLocation = i;
+            MDFVIDEOLOG_INOUTFN( "Mimetype has already been investigated earlier" );
             break;
         }
     }
     
     if( !foundPackage )
     {
+        MDFVIDEOLOG_INOUTFN( "Mimetype has not been investigated earlier, investigate now ..." );
         CPluginPackage* newPackage = CPluginPackage::NewL( aMimeType );
         entryLocation = m_PluginPackageArray.Count();
         m_PluginPackageArray.Append( newPackage );  //transfer the ownership
@@ -378,66 +390,102 @@
         TInt postprocessorCount = m_HwPostProcessorArray.Count();
         TInt payloadformatCount = m_PayloadFormatArray.Count();
         CPayloadFormatInfo* payloadformatinfo = NULL;
-
+        
         for( TInt m = 0; m < payloadformatCount && !foundPayloadFormat; m++ )
         {
-            payloadformatinfo = m_PayloadFormatArray[ m ];
+            payloadformatinfo = m_PayloadFormatArray[ m ];
+            MDFVIDEOLOG_WRITE_FORMAT( "<-> Payload selected id: 0x%08x", payloadformatinfo->Uid().iUid );
+            
             if( payloadformatinfo->SupportMimeType( aMimeType ) )
-            {
+            {
+                MDFVIDEOLOG_INOUTFN( "Selected payload do support mimetype" );
                 TVideoDataUnitType  unitType = payloadformatinfo->GetVideoDataUnitType();
                 TVideoDataUnitEncapsulation unitEncapsulation = payloadformatinfo->GetVideoDataUnitEncapsulation();
                 TUid plId = payloadformatinfo->Uid();
-
+                
                 newPackage->SetVideoDataUnitType( unitType );
                 newPackage->SetVideoDataUnitEncapsulation( unitEncapsulation );
                 newPackage->SetPayloadFormatId( plId );
-
+                
                 foundPayloadFormat = ETrue;
-            }
+            }
+            else
+            {
+                MDFVIDEOLOG_INOUTFN( "Selected payload do NOT support mimetype" );
+            }
         }
         
         if( foundPayloadFormat )
         {        
+            MDFVIDEOLOG_INOUTFN( "Payload matches, check for decoder ..." );
+            
             for( TInt j = 0; j < decoderCount && !foundPackage; j++ )
             {
-                CVideoDecoderInfo* decoderInfo = m_HwDecoderArray[j];
+                CVideoDecoderInfo* decoderInfo = m_HwDecoderArray[j];
+                MDFVIDEOLOG_WRITE_FORMAT( "<-> Decoder selected id: 0x%08x", decoderInfo->Uid().iUid );
+                
                 if( decoderInfo->SupportsFormat(*format) )
                 {
+                    MDFVIDEOLOG_INOUTFN( "Selected decoder do support mimetype" );
                     TUid decoderUid = decoderInfo->Uid();
                     CMMFVideoDecodeHwDevice* dev = CMMFVideoDecodeHwDevice::NewL( decoderUid, *this );
                     CleanupStack::PushL(dev);
-
+                    
                     TVideoDataUnitType UnitType = payloadformatinfo->GetVideoDataUnitType();
                     TVideoDataUnitEncapsulation UnitEncapsulation = payloadformatinfo->GetVideoDataUnitEncapsulation();
-
+                    
                     TRAPD( error, dev->SetInputFormatL( *format, UnitType, UnitEncapsulation, ETrue ) );
                     if( error == KErrNone )
-                    {
+                    {
+                        MDFVIDEOLOG_INOUTFN( "dev->SetInputFormatL does not leave" );
+                        
                         RArray decoderOutputFormat;
                         dev->GetOutputFormatListL( decoderOutputFormat );
-                    
+                        
+                        MDFVIDEOLOG_INOUTFN( "dev->GetOutputFormatListL does not leave" );
                         //check to see if postprocessor is supporting
                         for( TInt k = 0; k < postprocessorCount && !foundPackage; k++ )
                         {
                             CPostProcessorInfo* postprocessorInfo = m_HwPostProcessorArray[k];
+                            MDFVIDEOLOG_WRITE_FORMAT( "<-> Postprocessor selected id: 0x%08x", postprocessorInfo->Uid().iUid );
+                            
                             if( postprocessorInfo->SupportsDirectDisplay() )
                             {
+                                MDFVIDEOLOG_INOUTFN( "postprocessorInfo->SupportsDirectDisplay() true" );
                                 const RArray& postprocessorInputFormat = postprocessorInfo->SupportedFormats();
                                 TUncompressedVideoFormat aCommonFormat;
                                 foundPackage = CMMFDevVideoPlay::FindCommonFormat( decoderOutputFormat.Array(), postprocessorInputFormat.Array(), aCommonFormat );
                                 if( foundPackage )
-                                {
+                                {
+                                    MDFVIDEOLOG_INOUTFN( "Commonformat between decoder and postprocessor is found" );
                                     TUid decoderId = decoderInfo->Uid();
                                     newPackage->SetHwDecoderId( decoderId );
                                     TUid ppId = postprocessorInfo->Uid();
                                     newPackage->SetHwPostProcessorId( ppId );
                                     newPackage->SetHwUncompressedVideoFormat( aCommonFormat );
                                     newPackage->SetPackageValid( ETrue );
-                                }
+                                    MDFVIDEOLOG_INOUTFN( "Mimetype is supported" );
+                                }
+                                else
+                                {
+                                    MDFVIDEOLOG_INOUTFN( "Commonformat between decoder and postprocessor is NOT found" );
+                                }
+                            }
+                            else
+                            {
+                                MDFVIDEOLOG_INOUTFN( "postprocessorInfo->SupportsDirectDisplay() false" );
                             }
                         }
+                    }
+                    else
+                    {
+                        MDFVIDEOLOG_INOUTFN( "dev->SetInputFormatL leaves" );
                     }
                     CleanupStack::PopAndDestroy(dev);
+                }
+                else
+                {
+                    MDFVIDEOLOG_INOUTFN( "Decoder do NOT support mimetype" );
                 }
             }
         }
@@ -449,15 +497,15 @@
     
     aPluginPackage = *package;
     
-    MDFVIDEOLOG_LEAVEFN( "GetIdsByMimeTypeL" )
-        
+    MDFVIDEOLOG_LEAVEFN( "GetIdsByMimeTypeL" );
+    
     return package->IsPackageValid();
 }
-    
+
 void CMdfPluginManager::Reset()
 {
-    MDFVIDEOLOG_ENTERFN( "Reset" )
-        
+    MDFVIDEOLOG_ENTERFN( "Reset" );
+    
     m_PayloadFormatArray.ResetAndDestroy();
     m_PayloadFormatArray.Close();
     
@@ -470,13 +518,13 @@
     m_PluginPackageArray.ResetAndDestroy();
     m_PluginPackageArray.Close();
     
-    MDFVIDEOLOG_LEAVEFN( "Reset" )
+    MDFVIDEOLOG_LEAVEFN( "Reset" );
 }
 
 char** CMdfPluginManager::GetSupportedMimeType() //transfer ownership
 {
-    MDFVIDEOLOG_ENTERFN( "GetSupportedMimeType" )
-
+    MDFVIDEOLOG_ENTERFN2( "GetSupportedMimeType" );
+    
     TInt   numberOfMimeType = 0;
     
     TInt count = m_PayloadFormatArray.Count();
@@ -489,6 +537,8 @@
         for( TInt j = 0; j < countMimeType; j++ )
         {
             HBufC8* tdesc = supportedmimetypearray[ j ];
+            MDFVIDEOLOG_WRITE_FORMAT( "<-> Mimetype targeted is %s", tdesc->Ptr() );
+            
             CPluginPackage* pluginpackage = NULL;
             TBool valid = EFalse;
             TRAPD( error, pluginpackage = CPluginPackage::NewL( *tdesc ) );
@@ -504,30 +554,39 @@
             if( valid )
             {
                 numberOfMimeType++;
+                MDFVIDEOLOG_INOUTFN( "Mimetype is supported" );
+            }
+            else
+            {
+                MDFVIDEOLOG_INOUTFN( "Mimetype is NOT supported" );
             }
         }
         
     }
-
+    
+    MDFVIDEOLOG_INOUTFN( "Mimetypes that are supported and returned to Helix ..." );
     char** pMimeType = NULL;
     pMimeType = new char*[ numberOfMimeType +1 ];
     if( pMimeType )
     {
         TInt count = m_PluginPackageArray.Count();
-
+        
         TInt validPackage = 0;
-
+        
         for( TInt k = 0; k < count; k++ )
         {
             CPluginPackage* pluginPackage = m_PluginPackageArray[ k ];
             if( pluginPackage->IsPackageValid() )
             {
                 const TDesC8& supportedMimeType = pluginPackage->GetMimeType();
-
+                
                 TInt length = supportedMimeType.Length();
-                const unsigned char* buffer = supportedMimeType.Ptr();
+                const unsigned char* buffer = supportedMimeType.Ptr();
+                
+                MDFVIDEOLOG_WRITE_FORMAT2( "    Mimetype %s is supported", buffer );
+                
                 pMimeType[ validPackage ] = new char[ length+1 ];
-
+                
                 TInt m = 0;
                 for( m = 0; m < length; m++ )
                 {
@@ -537,11 +596,11 @@
             }
         }    
         pMimeType[ validPackage ] = NULL;
-        HX_ASSERT( numberOfMimeType == validPackage );
+        HX_ASSERT( numberOfMimeType >= validPackage );
     }
-
-    MDFVIDEOLOG_LEAVEFN( "GetSupportedMimeType" )
-        
+    
+    MDFVIDEOLOG_LEAVEFN2( "GetSupportedMimeType" );
+    
     return pMimeType;
 }
 
@@ -556,10 +615,10 @@
     
     _LIT8( KHelixMP4,  "video/MP4V-ES" );
     _LIT8( KMdfMP4,    "video/mp4v-es" );
-
+    
     _LIT8( KMulirateRV, "video/x-pn-multirate-realvideo" );
     _LIT8( KHelixRV,    "video/x-pn-realvideo" );
-
+    
     _LIT8( KXRNH263, "video/X-RN-3GPP-H263" );
     
     _LIT8( KXRNMP4,  "video/X-RN-MP4" );
@@ -598,6 +657,6 @@
     return convertedMimeType;
 }
 
-    
-    
-    
+
+
+


From jwei at helixcommunity.org  Wed Feb  1 09:30:15 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:45:54 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp, 1.3.2.1,
	1.3.2.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv7713

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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- mdfvideoadapter.cpp	31 Jan 2006 17:46:48 -0000	1.3.2.1
+++ mdfvideoadapter.cpp	1 Feb 2006 17:30:13 -0000	1.3.2.2
@@ -50,8 +50,6 @@
 #include "mdfvideoadapter.h"
 #define MDF_FRAME_DROP_THRESHOLD 3000  //ms
 
-MDFVIDEOLOG_CLASSNAME( "CMdfVideoAdapter" )
-
 STDMETHODIMP CMdfVideoAdapter::QueryInterface( REFIID riid, void** ppvObj )
 {
     if (IsEqualIID(riid, IID_IUnknown))
@@ -98,10 +96,13 @@
   m_HwDecoderId( KUidZero ),
   m_HwPostProcessorId( KUidZero ),
   m_bWsIsConnected( FALSE ),
-  m_pContext( NULL ),
+  m_pContext( NULL ),
   m_IsDSAStarted( FALSE ),
   m_pPayloadFormatPluginDevice( NULL )
 {
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CMdfVideoAdapter" );
+    MDFVIDEOLOG_ENTERFN( "CMdfVideoAdapter" );
 #ifdef THREADS_SUPPORTED
     HXMutex::MakeMutex( m_pBltQueueMutex );
     HXMutex::MakeMutex( m_pWriteMutex );
@@ -109,12 +110,14 @@
     HXMutex::MakeStubMutex( m_pBltQueueMutex );
     HXMutex::MakeStubMutex( m_pWriteMutex );
 #endif
-    MDFVIDEOLOG_CREATE_NOWRITE
+    MDFVIDEOLOG_LEAVEFN( "CMdfVideoAdapter" );
 }
 
 CMdfVideoAdapter::~CMdfVideoAdapter()
 {
+    MDFVIDEOLOG_ENTERFN( "~CMdfVideoAdapter" );
     ClearBltQueue();
+    
     HX_DELETE( m_pDevVideoPlay );
     HX_DELETE( m_pFbsScreenDevice );
     HX_DELETE( m_pFbsBitGc );
@@ -127,14 +130,15 @@
     HX_DELETE( m_pBltQueueMutex );
     HX_DELETE( m_pWriteMutex );
     HX_RELEASE( m_pContext );
-
-    MDFVIDEOLOG_DELETE
+    
+    MDFVIDEOLOG_LEAVEFN( "~CMdfVideoAdapter" );
+    MDFVIDEOLOG_DELETE;
 }
 
 void CMdfVideoAdapter::Reset()
 {
-    MDFVIDEOLOG_ENTERFN( "Reset" )
-    MDFVIDEOLOG_LEAVEFN( "Reset" )
+    MDFVIDEOLOG_ENTERFN( "Reset" );
+    MDFVIDEOLOG_LEAVEFN( "Reset" );
 }
 
 HX_RESULT CMdfVideoAdapter::Init( const CPluginPackage& pluginPackage, 
@@ -143,7 +147,7 @@
                                   CPayloadFormatPluginDevice* pPayloadFormatPluginDevice,
                                   IUnknown*             pContext )
 {
-    MDFVIDEOLOG_ENTERFN( "Init" )
+    MDFVIDEOLOG_ENTERFN2( "Init" );
     HX_RESULT retVal = HXR_OK;
     
     m_pClockSource = pClockSource;
@@ -153,15 +157,15 @@
     {
         m_pContext->AddRef();
     }
-
+    
     TRAPD( error, retVal = InitL( pluginPackage, pStreamHeader ) );
     if( error != KErrNone || FAILED( retVal ) )
     {
         m_DevVidInitialized = EInitializedFailed;
         retVal = HXR_FAIL;
     }
-
-    MDFVIDEOLOG_RETURNFN( "Init", retVal )
+    
+    MDFVIDEOLOG_RETURNFN2( "Init", retVal );
     return retVal;
 }
 
@@ -172,7 +176,7 @@
 HX_RESULT CMdfVideoAdapter::InitL( const CPluginPackage& pluginPackage, 
                                   const TDesC8*         pStreamHeader )
 {
-    MDFVIDEOLOG_ENTERFN( "InitL" )
+    MDFVIDEOLOG_ENTERFN2( "InitL" );
     HX_RESULT retVal = HXR_OK;
     
     const TDesC8& mimetype                        = pluginPackage.GetMimeType();
@@ -181,7 +185,7 @@
     const TUncompressedVideoFormat& commonFormat  = pluginPackage.GetHwUncompressedVideoFormat();
     TVideoDataUnitType          unitType          = pluginPackage.GetVideoDataUnitType();
     TVideoDataUnitEncapsulation unitEncapsulation = pluginPackage.GetVideoDataUnitEncapsulation();
-        
+    
     if( SUCCEEDED( retVal ) && m_bWsIsConnected == FALSE )
     {
         if( m_WsSession.Connect() == KErrNone )
@@ -191,7 +195,7 @@
         }
         else
         {
-            MDFVIDEOLOG_INOUTFN( "m_WsSession.Connect failed" )
+            MDFVIDEOLOG_INOUTFN( "m_WsSession.Connect failed" );
             retVal = HXR_FAIL;
         }
     }
@@ -226,7 +230,7 @@
         }
         else
         {
-            MDFVIDEOLOG_INOUTFN( "HAL::Get failed" )
+            MDFVIDEOLOG_INOUTFN( "HAL::Get failed" );
             retVal = HXR_FAIL;
         }
     }
@@ -237,188 +241,211 @@
         m_pFbsBitGc->Activate( ( CFbsDevice* ) m_pFbsScreenDevice );
     }
     
-
+    
     if( SUCCEEDED( retVal ) )
     {
+        MDFVIDEOLOG_INOUTFN( "Initialize CMMFDevVideoPlay start ..." );
+        
         HX_DELETE( m_pDevVideoPlay );
-        m_pDevVideoPlay = CMMFDevVideoPlay::NewL(*this);
+        m_pDevVideoPlay = CMMFDevVideoPlay::NewL(*this);
+        MDFVIDEOLOG_INOUTFN( "CMMFDevVideoPlay::NewL() does not leave" );
+        
         m_DecoderHwDeviceId = m_pDevVideoPlay->SelectDecoderL( decoderId );
+        MDFVIDEOLOG_INOUTFN( "SelectDecoderL() does not leave" );
+        
         m_PostProcessorHwDeviceId = m_pDevVideoPlay->SelectPostProcessorL( postprocessorId );
-
+        MDFVIDEOLOG_INOUTFN( "SelectPostProcessorL() does not leave" );
+        
         HBufC8* convertedmimetype = CMdfPluginManager::ConvertToStandardMimeTypeL( mimetype );
         CleanupStack::PushL( convertedmimetype );
         CCompressedVideoFormat* ulDecoderInputFormat = CCompressedVideoFormat::NewL( *convertedmimetype );
         CleanupStack::PushL( ulDecoderInputFormat );
-        m_pDevVideoPlay->SetInputFormatL( m_DecoderHwDeviceId, *ulDecoderInputFormat, unitType, unitEncapsulation, ETrue );
+        m_pDevVideoPlay->SetInputFormatL( m_DecoderHwDeviceId, *ulDecoderInputFormat, unitType, unitEncapsulation, ETrue );
+        MDFVIDEOLOG_INOUTFN( "SetInputFormatL() to decoder does not leave" );
+        
         CleanupStack::PopAndDestroy( ulDecoderInputFormat );
         CleanupStack::PopAndDestroy( convertedmimetype );
-    
+        
         m_pDevVideoPlay->SetOutputFormatL( m_DecoderHwDeviceId, commonFormat );
+        MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to decoder does not leave" );
         m_pDevVideoPlay->SetInputFormatL( m_PostProcessorHwDeviceId, commonFormat );
+        MDFVIDEOLOG_INOUTFN( "SetInputFormatL() to postprocessor does not leave" );
 //        m_pDevVideoPlay->SetOutputFormatL( m_PostProcessorHwDeviceId, ulPostProcessorOutputFormat );
+        MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to postprocessor does not leave" );
         m_pDevVideoPlay->SetVideoDestScreenL( ETrue );
-    
+        MDFVIDEOLOG_INOUTFN( "SetVideoDestScreenL() does not leave" );
+        
         CMMFDevVideoPlay::TBufferOptions bufferOptions;
         bufferOptions.iMaxInputBufferSize = (352*288);
         bufferOptions.iMinNumInputBuffers = 2;
-    
+        
         m_pDevVideoPlay->SetBufferOptionsL( bufferOptions );
+        MDFVIDEOLOG_INOUTFN( "SetBufferOptionsL() does not leave" );
+        
         m_pDevVideoPlay->SetPostProcessTypesL( m_PostProcessorHwDeviceId, 
                             EPpOutputCrop | EPpScale | EPpRotate | EPpYuvToRgb);
-    
+        MDFVIDEOLOG_INOUTFN( "SetPostProcessTypesL() does not leave" );
+        
         m_pDevVideoPlay->SetClockSource( m_pClockSource );
 #ifdef SYMBIAN_MDF_API_V2
         if( pStreamHeader )
         {
             TVideoPictureHeader pictureHeader;
-            pictureHeader.iOptions = 0x00;
-            pictureHeader.iProfile = -1;
-            pictureHeader.iLevel = -1;
+            pictureHeader.iOptions = 0x00;
+            pictureHeader.iProfile = -1;
+            pictureHeader.iLevel = -1;
             pictureHeader.iVersion = -1;
-            pictureHeader.iOptional = pStreamHeader;
+            pictureHeader.iOptional = pStreamHeader;
             m_pDevVideoPlay->ConfigureDecoderL( pictureHeader );
+            MDFVIDEOLOG_INOUTFN( "ConfigureDecoderL() does not leave" );
         }
 #endif
-
+        
         m_DevVidInitialized = EInitializedOnGoingPass1;
+        
+        MDFVIDEOLOG_INOUTFN( "calls Initialize()" );
         m_pDevVideoPlay->Initialize();
-    
+        
+        MDFVIDEOLOG_INOUTFN( "Initialize CMMFDevVideoPlay end" );
     }    
-    MDFVIDEOLOG_RETURNFN( "InitL", retVal )
+    MDFVIDEOLOG_RETURNFN2( "InitL", retVal );
     return retVal;
 }
-    
+
 HX_RESULT CMdfVideoAdapter::VideoPause()
 {
-    MDFVIDEOLOG_ENTERFN( "VideoPause" )
-    if( m_pDevVideoPlay != NULL )
-    {
-        m_pDevVideoPlay->Pause();
-    }
-
-    //Following codes are inserted temporarily because of lack of path
-    //from UI to DevVideo through which DSA calls could pass
-    //In later version, this path will be built.
-    //********** Start
+    MDFVIDEOLOG_ENTERFN( "VideoPause" );
+    if( m_pDevVideoPlay != NULL )
+    {
+        m_pDevVideoPlay->Pause();
+    }
+
+    //Following codes are inserted temporarily because of lack of path
+    //from UI to DevVideo through which DSA calls could pass
+    //In later version, this path will be built.
+    //********** Start
     if( m_pDevVideoPlay != NULL && m_IsDSAStarted == TRUE )
     {
         m_pDevVideoPlay->AbortDirectScreenAccess();
-        m_IsDSAStarted = FALSE;
-    }
-    //********** End
+        m_IsDSAStarted = FALSE;
+    }
+    //********** End
 
-    MDFVIDEOLOG_LEAVEFN( "VideoPause" )
+    MDFVIDEOLOG_LEAVEFN( "VideoPause" );
     return HXR_OK;
 }
 
 HX_RESULT CMdfVideoAdapter::VideoResume()
 {
-    MDFVIDEOLOG_ENTERFN( "VideoResume" )
+    MDFVIDEOLOG_ENTERFN( "VideoResume" );
     HX_RESULT retVal = HXR_OK;
-    if( m_pDevVideoPlay != NULL )
-    {
-        m_pDevVideoPlay->Resume();
-    }
-
-    //Following codes are inserted temporarily because of lack of path
-    //from UI to DevVideo through which DSA calls could pass
-    //In later version, this path will be built.
-    //********** Start
+    if( m_pDevVideoPlay != NULL )
+    {
+        m_pDevVideoPlay->Resume();
+    }
+
+    //Following codes are inserted temporarily because of lack of path
+    //from UI to DevVideo through which DSA calls could pass
+    //In later version, this path will be built.
+    //********** Start
     if( m_pDevVideoPlay != NULL && m_IsDSAStarted == FALSE )
-    { 
-        RRegion region( m_clipRect );
-        TRAPD( error, m_pDevVideoPlay->StartDirectScreenAccessL(m_clipRect, *m_pFbsScreenDevice, region ) );
-        if( error != KErrNone )
-        {
-            retVal = HXR_FAIL;
-        }
-        else
-        {
-            m_IsDSAStarted = TRUE;
-        }
-        region.Close(); //do not use Destroy()
+    { 
+        RRegion region( m_clipRect );
+        TRAPD( error, m_pDevVideoPlay->StartDirectScreenAccessL(m_clipRect, *m_pFbsScreenDevice, region ) );
+        if( error != KErrNone )
+        {
+            retVal = HXR_FAIL;
+        }
+        else
+        {
+            m_IsDSAStarted = TRUE;
+        }
+        region.Close(); //do not use Destroy()
     }
-    //********** End
+    //********** End
     TInt number = m_BltPacketQueue.GetCount();
-    MDFVIDEOLOG_WRITE_FORMAT1( "packets left in queue that is not blitted is %d\n", number )
+    MDFVIDEOLOG_WRITE_FORMAT( "    packets left in queue that is not blitted is %d", number );
     Blt();
     
-    MDFVIDEOLOG_LEAVEFN( "VideoResume" )
+    MDFVIDEOLOG_LEAVEFN( "VideoResume" );
     return HXR_OK;
 }
 
 HX_RESULT CMdfVideoAdapter::VideoEnd( THIS_ )
 {
-    MDFVIDEOLOG_ENTERFN( "VideoEnd" )
+    MDFVIDEOLOG_ENTERFN2( "VideoEnd" );
+
     TInt number = m_BltPacketQueue.GetCount();
-    MDFVIDEOLOG_WRITE_FORMAT1( "packets left in queue that is not blitted is %d\n", number )
-
-    if( m_pDevVideoPlay && m_DevVidInitialized == EInitializedSuccess )
-    {
-        MDFVIDEOLOG_INOUTFN( "InputEnd" );
-        m_pDevVideoPlay->InputEnd(); //CallBack function MdvpoStreamEnd() will be called by DevVideo
-    }
-
-    MDFVIDEOLOG_LEAVEFN( "VideoEnd" )
+    MDFVIDEOLOG_WRITE_FORMAT( "    packets left in queue that is not blitted is %d\n", number );
+
+    if( m_pDevVideoPlay && m_DevVidInitialized == EInitializedSuccess )
+    {
+        MDFVIDEOLOG_INOUTFN( "InputEnd" );
+        m_pDevVideoPlay->InputEnd(); //CallBack function MdvpoStreamEnd() will be called by DevVideo
+    }
+
+    MDFVIDEOLOG_LEAVEFN2( "VideoEnd" );
     return HXR_OK;
 }
 
 HX_RESULT CMdfVideoAdapter::SetVideoTimePosition( const TTimeIntervalMicroSeconds& aPlaybackPosition )
-{
+{
+    MDFVIDEOLOG_ENTERFN( "SetVideoTimePosition" );
     HX_RESULT retVal = HXR_OK;
     HX_ASSERT( m_pDevVideoPlay );
     TRAPD( error, m_pDevVideoPlay->SetPosition( aPlaybackPosition ) );
     if( error != KErrNone )
     {
         HX_RESULT retVal = HXR_FAIL;
-    }
+    }
+    MDFVIDEOLOG_RETURNFN( "SetVideoTimePosition", retVal );
     return retVal;
 }
 
 void CMdfVideoAdapter::OnVideoPacket( CMediaPacket* pMediaPacket )
 {
-    MDFVIDEOLOG_ENTERFN( "OnVideoPacket" )
-        
+    MDFVIDEOLOG_ENTERFN4( "OnVideoPacket" );
+    
     if( pMediaPacket )
     {
         m_pBltQueueMutex->Lock();
         m_BltPacketQueue.AddTail( pMediaPacket );
         m_pBltQueueMutex->Unlock();
     }
-
-    MDFVIDEOLOG_LEAVEFN( "OnVideoPacket" )
+    
+    MDFVIDEOLOG_LEAVEFN4( "OnVideoPacket" );
 }
 
 HX_RESULT CMdfVideoAdapter::Blt()
 {
-    MDFVIDEOLOG_ENTERFN( "Blt" )
+    MDFVIDEOLOG_ENTERFN4( "Blt" );
     HX_RESULT retVal = HXR_OK;
-
-    if( m_IsDSAStarted == FALSE )
-    {
-        MDFVIDEOLOG_RETURNFN4( "Blt", retVal );
-        return retVal;
-    }
+
+    if( m_IsDSAStarted == FALSE )
+    {
+        MDFVIDEOLOG_RETURNFN4( "Blt", retVal );
+        return retVal;
+    }
     
     m_pWriteMutex->Lock();
-    m_pBltQueueMutex->Lock();
+    m_pBltQueueMutex->Lock();    
 
     TRAPD( error, BltL() );
     if( error != KErrNone )
     {
         retVal = HXR_FAIL;
     }
-
+    
     m_pBltQueueMutex->Unlock();
     m_pWriteMutex->Unlock();
     
-    MDFVIDEOLOG_LEAVEFN( "Blt" )
+    MDFVIDEOLOG_RETURNFN4( "Blt", retVal );
     return retVal;
 }
 
 void CMdfVideoAdapter::BltL()
 {
-    MDFVIDEOLOG_ENTERFN( "BltL" )
+    MDFVIDEOLOG_ENTERFN4( "BltL" );
     
     CMediaPacket* pPeekMediaPacket = NULL;
     UINT32 ulBufferSize = 0;
@@ -427,7 +454,7 @@
     TTimeIntervalMicroSeconds currentTime = m_pClockSource->Time();
     
     TInt number = m_BltPacketQueue.GetCount();
-    MDFVIDEOLOG_WRITE_FORMAT1( "packets left in queue that is not blitted is %d\n", number )
+    MDFVIDEOLOG_WRITE_FORMAT4( "    packets left in queue that is not blitted is %d", number );
     while( !m_BltPacketQueue.IsEmpty() )
     {
         pPeekMediaPacket = (CMediaPacket*) m_BltPacketQueue.GetHead();  //peek
@@ -438,7 +465,7 @@
             TInt64 ulTimeInMs = TInt64( ultime );
             TInt64 ulTimeInMicro = ulTimeInMs * TInt64( 1000 );
             presentationTime = ulTimeInMicro;
-
+            
             TInt64 timeInVarInMicro = ( ulTimeInMs + TInt64( MDF_FRAME_DROP_THRESHOLD ) )* TInt64( 1000 );
             TTimeIntervalMicroSeconds timeInVar = timeInVarInMicro;
 
@@ -450,7 +477,7 @@
             }
             else
             {
-                MDFVIDEOLOG_INOUTFN1( "packet dropped" )
+                MDFVIDEOLOG_INOUTFN4( "packet dropped" );
                 pPeekMediaPacket = (CMediaPacket*) m_BltPacketQueue.RemoveHead();
                 pPeekMediaPacket->Clear();
                 HX_DELETE( pPeekMediaPacket );
@@ -462,16 +489,19 @@
             HX_ASSERT( pPeekMediaPacket == NULL );
         }
     }
-
+    
     HX_ASSERT( m_pPayloadFormatPluginDevice );
-
+    
     if( ( m_DevVidInitialized == EInitializedSuccess ) && !m_BltPacketQueue.IsEmpty() )
     {
+        MDFVIDEOLOG_INOUTFN4( "Ready to write to MDF buffer" );
         HX_ASSERT( ulBufferSize );
         TVideoInputBuffer* videoInputBufferP = NULL;
+        MDFVIDEOLOG_WRITE_FORMAT4( "    Size requested is : %d", ulBufferSize );
         videoInputBufferP = m_pDevVideoPlay->GetBufferL( ulBufferSize );
         if( videoInputBufferP )
         {
+			MDFVIDEOLOG_INOUTFN4( "Start to write to MDF buffer" );
             CMediaPacket* pMediaPacket = NULL;
             pMediaPacket = (CMediaPacket*) m_BltPacketQueue.RemoveHead();
             
@@ -487,36 +517,44 @@
             videoInputBufferP->iDecodingTimestamp     = currentTime; //decode now
             videoInputBufferP->iPresentationTimestamp = presentationTime;
             
-            MDFVIDEOLOG_INOUTFN1( "WriteCodedDataL" )
+            MDFVIDEOLOG_INOUTFN4( "WriteCodedDataL" );
             m_pDevVideoPlay->WriteCodedDataL( videoInputBufferP );
+        }
+        else
+        {
+            MDFVIDEOLOG_INOUTFN4( "GetBufferL returns NULL" );
         }
+    }
+    else
+    {
+        MDFVIDEOLOG_INOUTFN4( "m_DevVidInitialized != EInitializedSuccess or m_BltPacketQueue.IsEmpty() is true" );
     }
-    MDFVIDEOLOG_LEAVEFN( "BltL" )
+    MDFVIDEOLOG_LEAVEFN4( "BltL" );
 }
-    
+
 void CMdfVideoAdapter::AttachSite( IHXSite* pSite )
 {
-    MDFVIDEOLOG_ENTERFN( "AttachSite" )
+    MDFVIDEOLOG_ENTERFN( "AttachSite" );
     HX_ASSERT( pSite );
     m_pSite = pSite;
     m_pSite->AddRef();
     SetupWindow();
-    MDFVIDEOLOG_LEAVEFN( "AttachSite" )
+    MDFVIDEOLOG_LEAVEFN( "AttachSite" );
 }
 
 void CMdfVideoAdapter::DetachSite()
 {
-    MDFVIDEOLOG_ENTERFN( "DetachSite" )
+    MDFVIDEOLOG_ENTERFN( "DetachSite" );
     HX_ASSERT( m_pSite );
     m_pSite->Release();
     m_pSite = NULL;
-    MDFVIDEOLOG_LEAVEFN( "DetachSite" )
+    MDFVIDEOLOG_LEAVEFN( "DetachSite" );
 }
 
 ///////////////////////////////////////////////////////////
 void CMdfVideoAdapter::ClearBltQueue( void )
 {
-    MDFVIDEOLOG_ENTERFN( "ClearBltQueue" )
+    MDFVIDEOLOG_ENTERFN( "ClearBltQueue" );
     CMediaPacket* pVideoPacket = NULL;
     
     m_pBltQueueMutex->Lock();
@@ -532,14 +570,14 @@
     }
     m_pBltQueueMutex->Unlock();
     
-    MDFVIDEOLOG_LEAVEFN( "ClearBltQueue" )
+    MDFVIDEOLOG_LEAVEFN( "ClearBltQueue" );
 }
 
 
 void CMdfVideoAdapter::SetupWindow()
 {
-    MDFVIDEOLOG_ENTERFN( "SetupWindow" )
-        
+    MDFVIDEOLOG_ENTERFN( "SetupWindow" );
+    
     HX_RESULT retVal = HXR_IGNORE;
     if( m_DevVidInitialized == EInitializedOnGoingPass2 && m_pSite )
     {
@@ -579,7 +617,7 @@
         RRegion region( m_clipRect );
         TRAPD( error, m_pDevVideoPlay->StartDirectScreenAccessL(m_clipRect, *m_pFbsScreenDevice, region ) );
         if( error == KErrNone )
-        {
+        {
             m_IsDSAStarted = TRUE;
             retVal = HXR_OK;
         }
@@ -587,18 +625,18 @@
 #else
         RWindow*   pWin    = (RWindow*)pHXWin->window;
         CDirectScreenAccess* pDirectScreen = pHXWin->iDSA;
-      
+        
         TRegion& aClipRegion = *pDirectScreen->DrawingRegion();
         
         m_clipRect = aClipRegion.BoundingRect() ;
         TRAPD( error, m_pDevVideoPlay->StartDirectScreenAccessL(m_clipRect, *pDirectScreen->ScreenDevice(), aClipRegion ) );
         if( error == KErrNone )
-        {
+        {
             m_IsDSAStarted = TRUE;
             retVal = HXR_OK;
         }
 #endif
-
+        
         if( SUCCEEDED( retVal ) )
         {
             TRAPD( error, m_pDevVideoPlay->SetScaleOptionsL( m_PostProcessorHwDeviceId, m_clipRect.Size(), EFalse ) );
@@ -612,8 +650,8 @@
             }
         }
     }
-        
-        
+    
+    
     if( SUCCEEDED( retVal ) )
     {
         TRAPD( error, m_pDevVideoPlay->CommitL() );
@@ -644,90 +682,90 @@
         m_DevVidInitialized = EInitializedFailed;
     }
     
-    MDFVIDEOLOG_LEAVEFN( "SetupWindow" )
+    MDFVIDEOLOG_LEAVEFN( "SetupWindow" );
 }
 
 //////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////
 void CMdfVideoAdapter::MdvpoNewBuffers()
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoNewBuffers" )
+    MDFVIDEOLOG_ENTERFN4( "MdvpoNewBuffers" );
     Blt();
-    MDFVIDEOLOG_LEAVEFN( "MdvpoNewBuffers" )
+    MDFVIDEOLOG_LEAVEFN4( "MdvpoNewBuffers" );
 }
 
 void CMdfVideoAdapter::MdvpoReturnPicture(TVideoPicture* aPicture)
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoReturnPicture" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoReturnPicture" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoReturnPicture" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoReturnPicture" );
 }
 
 void CMdfVideoAdapter::MdvpoSupplementalInformation(const TDesC8& aData, 
-    const TTimeIntervalMicroSeconds& aTimestamp, 
-    const TPictureId& aPictureId)
+                                                    const TTimeIntervalMicroSeconds& aTimestamp, 
+                                                    const TPictureId& aPictureId)
 {	
-    MDFVIDEOLOG_ENTERFN( "MdvpoSupplementalInformation" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoSupplementalInformation" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoSupplementalInformation" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoSupplementalInformation" );
 }
 
 void CMdfVideoAdapter::MdvpoPictureLoss()
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoPictureLoss" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoPictureLoss" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoPictureLoss" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoPictureLoss" );
 }
 
 void CMdfVideoAdapter::MdvpoPictureLoss(const TArray& aPictures)
 {	
-    MDFVIDEOLOG_ENTERFN( "MdvpoPictureLoss" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoPictureLoss" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoPictureLoss" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoPictureLoss" );
 }
 
 void CMdfVideoAdapter::MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture)
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoSliceLoss" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoSliceLoss" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoSliceLoss" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoSliceLoss" );
 }
 
 void CMdfVideoAdapter::MdvpoReferencePictureSelection(const TDesC8& aSelectionData)
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoReferencePictureSelection" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoReferencePictureSelection" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoReferencePictureSelection" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoReferencePictureSelection" );
 }
 
 void CMdfVideoAdapter::MdvpoTimedSnapshotComplete(TInt aError, 
-    TPictureData* aPictureData, 
-    const TTimeIntervalMicroSeconds& aPresentationTimestamp, 
-    const TPictureId& aPictureId)
+                                                  TPictureData* aPictureData, 
+                                                  const TTimeIntervalMicroSeconds& aPresentationTimestamp, 
+                                                  const TPictureId& aPictureId)
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoTimedSnapshotComplete" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoTimedSnapshotComplete" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoTimedSnapshotComplete" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoTimedSnapshotComplete" );
 }
 
 void CMdfVideoAdapter::MdvpoNewPictures()
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoNewPictures" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoNewPictures" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoNewPictures" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoNewPictures" );
 }
 
 void CMdfVideoAdapter::MdvpoFatalError(TInt aError)
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoFatalError" )
+    MDFVIDEOLOG_ENTERFN2( "MdvpoFatalError" );
     m_DevVidInitialized = EInitializedFailed;
-    MDFVIDEOLOG_LEAVEFN( "MdvpoFatalError" )
+    MDFVIDEOLOG_LEAVEFN2( "MdvpoFatalError" );
 }
 
 
 void CMdfVideoAdapter::MdvpoInitComplete(TInt aError)
 {	
-    MDFVIDEOLOG_ENTERFN( "MdvpoInitComplete" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoInitComplete" );
     //m_pWriteMutex->Unlock();
     m_DevVidInitialized = EInitializedFailed;
     
@@ -739,25 +777,25 @@
         
         SetupWindow();
     }
-    MDFVIDEOLOG_LEAVEFN( "MdvpoInitComplete" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoInitComplete" );
 }
 
 
 void CMdfVideoAdapter::MdvpoStreamEnd()
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoStreamEnd" )
-
-    if( m_pDevVideoPlay && m_DevVidInitialized == EInitializedSuccess )
-    {
-        m_pDevVideoPlay->Stop();
-        MDFVIDEOLOG_INOUTFN( "Stop" );
-        
-        m_IsDSAStarted = FALSE;
-        
-        m_DevVidInitialized = EInitializedReady;
-    }
-    
-    ClearBltQueue();
-    MDFVIDEOLOG_LEAVEFN( "MdvpoStreamEnd" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoStreamEnd" );
+
+    if( m_pDevVideoPlay && m_DevVidInitialized == EInitializedSuccess )
+    {
+        m_pDevVideoPlay->Stop();
+        MDFVIDEOLOG_INOUTFN( "Stop" );
+        
+        m_IsDSAStarted = FALSE;
+        
+        m_DevVidInitialized = EInitializedReady;
+    }
+    
+    ClearBltQueue();
+    MDFVIDEOLOG_LEAVEFN( "MdvpoStreamEnd" );
 }
 


From jwei at helixcommunity.org  Wed Feb  1 09:30:26 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:46:06 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp,1.4,1.5
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv7726

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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mdfvideoadapter.cpp	31 Jan 2006 20:59:14 -0000	1.4
+++ mdfvideoadapter.cpp	1 Feb 2006 17:30:24 -0000	1.5
@@ -50,8 +50,6 @@
 #include "mdfvideoadapter.h"
 #define MDF_FRAME_DROP_THRESHOLD 3000  //ms
 
-MDFVIDEOLOG_CLASSNAME( "CMdfVideoAdapter" )
-
 STDMETHODIMP CMdfVideoAdapter::QueryInterface( REFIID riid, void** ppvObj )
 {
     if (IsEqualIID(riid, IID_IUnknown))
@@ -98,10 +96,13 @@
   m_HwDecoderId( KUidZero ),
   m_HwPostProcessorId( KUidZero ),
   m_bWsIsConnected( FALSE ),
-  m_pContext( NULL ),
+  m_pContext( NULL ),
   m_IsDSAStarted( FALSE ),
   m_pPayloadFormatPluginDevice( NULL )
 {
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CMdfVideoAdapter" );
+    MDFVIDEOLOG_ENTERFN( "CMdfVideoAdapter" );
 #ifdef THREADS_SUPPORTED
     HXMutex::MakeMutex( m_pBltQueueMutex );
     HXMutex::MakeMutex( m_pWriteMutex );
@@ -109,12 +110,14 @@
     HXMutex::MakeStubMutex( m_pBltQueueMutex );
     HXMutex::MakeStubMutex( m_pWriteMutex );
 #endif
-    MDFVIDEOLOG_CREATE_NOWRITE
+    MDFVIDEOLOG_LEAVEFN( "CMdfVideoAdapter" );
 }
 
 CMdfVideoAdapter::~CMdfVideoAdapter()
 {
+    MDFVIDEOLOG_ENTERFN( "~CMdfVideoAdapter" );
     ClearBltQueue();
+    
     HX_DELETE( m_pDevVideoPlay );
     HX_DELETE( m_pFbsScreenDevice );
     HX_DELETE( m_pFbsBitGc );
@@ -127,14 +130,15 @@
     HX_DELETE( m_pBltQueueMutex );
     HX_DELETE( m_pWriteMutex );
     HX_RELEASE( m_pContext );
-
-    MDFVIDEOLOG_DELETE
+    
+    MDFVIDEOLOG_LEAVEFN( "~CMdfVideoAdapter" );
+    MDFVIDEOLOG_DELETE;
 }
 
 void CMdfVideoAdapter::Reset()
 {
-    MDFVIDEOLOG_ENTERFN( "Reset" )
-    MDFVIDEOLOG_LEAVEFN( "Reset" )
+    MDFVIDEOLOG_ENTERFN( "Reset" );
+    MDFVIDEOLOG_LEAVEFN( "Reset" );
 }
 
 HX_RESULT CMdfVideoAdapter::Init( const CPluginPackage& pluginPackage, 
@@ -143,7 +147,7 @@
                                   CPayloadFormatPluginDevice* pPayloadFormatPluginDevice,
                                   IUnknown*             pContext )
 {
-    MDFVIDEOLOG_ENTERFN( "Init" )
+    MDFVIDEOLOG_ENTERFN2( "Init" );
     HX_RESULT retVal = HXR_OK;
     
     m_pClockSource = pClockSource;
@@ -153,15 +157,15 @@
     {
         m_pContext->AddRef();
     }
-
+    
     TRAPD( error, retVal = InitL( pluginPackage, pStreamHeader ) );
     if( error != KErrNone || FAILED( retVal ) )
     {
         m_DevVidInitialized = EInitializedFailed;
         retVal = HXR_FAIL;
     }
-
-    MDFVIDEOLOG_RETURNFN( "Init", retVal )
+    
+    MDFVIDEOLOG_RETURNFN2( "Init", retVal );
     return retVal;
 }
 
@@ -172,7 +176,7 @@
 HX_RESULT CMdfVideoAdapter::InitL( const CPluginPackage& pluginPackage, 
                                   const TDesC8*         pStreamHeader )
 {
-    MDFVIDEOLOG_ENTERFN( "InitL" )
+    MDFVIDEOLOG_ENTERFN2( "InitL" );
     HX_RESULT retVal = HXR_OK;
     
     const TDesC8& mimetype                        = pluginPackage.GetMimeType();
@@ -181,7 +185,7 @@
     const TUncompressedVideoFormat& commonFormat  = pluginPackage.GetHwUncompressedVideoFormat();
     TVideoDataUnitType          unitType          = pluginPackage.GetVideoDataUnitType();
     TVideoDataUnitEncapsulation unitEncapsulation = pluginPackage.GetVideoDataUnitEncapsulation();
-        
+    
     if( SUCCEEDED( retVal ) && m_bWsIsConnected == FALSE )
     {
         if( m_WsSession.Connect() == KErrNone )
@@ -191,7 +195,7 @@
         }
         else
         {
-            MDFVIDEOLOG_INOUTFN( "m_WsSession.Connect failed" )
+            MDFVIDEOLOG_INOUTFN( "m_WsSession.Connect failed" );
             retVal = HXR_FAIL;
         }
     }
@@ -226,7 +230,7 @@
         }
         else
         {
-            MDFVIDEOLOG_INOUTFN( "HAL::Get failed" )
+            MDFVIDEOLOG_INOUTFN( "HAL::Get failed" );
             retVal = HXR_FAIL;
         }
     }
@@ -237,188 +241,211 @@
         m_pFbsBitGc->Activate( ( CFbsDevice* ) m_pFbsScreenDevice );
     }
     
-
+    
     if( SUCCEEDED( retVal ) )
     {
+        MDFVIDEOLOG_INOUTFN( "Initialize CMMFDevVideoPlay start ..." );
+        
         HX_DELETE( m_pDevVideoPlay );
-        m_pDevVideoPlay = CMMFDevVideoPlay::NewL(*this);
+        m_pDevVideoPlay = CMMFDevVideoPlay::NewL(*this);
+        MDFVIDEOLOG_INOUTFN( "CMMFDevVideoPlay::NewL() does not leave" );
+        
         m_DecoderHwDeviceId = m_pDevVideoPlay->SelectDecoderL( decoderId );
+        MDFVIDEOLOG_INOUTFN( "SelectDecoderL() does not leave" );
+        
         m_PostProcessorHwDeviceId = m_pDevVideoPlay->SelectPostProcessorL( postprocessorId );
-
+        MDFVIDEOLOG_INOUTFN( "SelectPostProcessorL() does not leave" );
+        
         HBufC8* convertedmimetype = CMdfPluginManager::ConvertToStandardMimeTypeL( mimetype );
         CleanupStack::PushL( convertedmimetype );
         CCompressedVideoFormat* ulDecoderInputFormat = CCompressedVideoFormat::NewL( *convertedmimetype );
         CleanupStack::PushL( ulDecoderInputFormat );
-        m_pDevVideoPlay->SetInputFormatL( m_DecoderHwDeviceId, *ulDecoderInputFormat, unitType, unitEncapsulation, ETrue );
+        m_pDevVideoPlay->SetInputFormatL( m_DecoderHwDeviceId, *ulDecoderInputFormat, unitType, unitEncapsulation, ETrue );
+        MDFVIDEOLOG_INOUTFN( "SetInputFormatL() to decoder does not leave" );
+        
         CleanupStack::PopAndDestroy( ulDecoderInputFormat );
         CleanupStack::PopAndDestroy( convertedmimetype );
-    
+        
         m_pDevVideoPlay->SetOutputFormatL( m_DecoderHwDeviceId, commonFormat );
+        MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to decoder does not leave" );
         m_pDevVideoPlay->SetInputFormatL( m_PostProcessorHwDeviceId, commonFormat );
+        MDFVIDEOLOG_INOUTFN( "SetInputFormatL() to postprocessor does not leave" );
 //        m_pDevVideoPlay->SetOutputFormatL( m_PostProcessorHwDeviceId, ulPostProcessorOutputFormat );
+        MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to postprocessor does not leave" );
         m_pDevVideoPlay->SetVideoDestScreenL( ETrue );
-    
+        MDFVIDEOLOG_INOUTFN( "SetVideoDestScreenL() does not leave" );
+        
         CMMFDevVideoPlay::TBufferOptions bufferOptions;
         bufferOptions.iMaxInputBufferSize = (352*288);
         bufferOptions.iMinNumInputBuffers = 2;
-    
+        
         m_pDevVideoPlay->SetBufferOptionsL( bufferOptions );
+        MDFVIDEOLOG_INOUTFN( "SetBufferOptionsL() does not leave" );
+        
         m_pDevVideoPlay->SetPostProcessTypesL( m_PostProcessorHwDeviceId, 
                             EPpOutputCrop | EPpScale | EPpRotate | EPpYuvToRgb);
-    
+        MDFVIDEOLOG_INOUTFN( "SetPostProcessTypesL() does not leave" );
+        
         m_pDevVideoPlay->SetClockSource( m_pClockSource );
 #ifdef SYMBIAN_MDF_API_V2
         if( pStreamHeader )
         {
             TVideoPictureHeader pictureHeader;
-            pictureHeader.iOptions = 0x00;
-            pictureHeader.iProfile = -1;
-            pictureHeader.iLevel = -1;
+            pictureHeader.iOptions = 0x00;
+            pictureHeader.iProfile = -1;
+            pictureHeader.iLevel = -1;
             pictureHeader.iVersion = -1;
-            pictureHeader.iOptional = pStreamHeader;
+            pictureHeader.iOptional = pStreamHeader;
             m_pDevVideoPlay->ConfigureDecoderL( pictureHeader );
+            MDFVIDEOLOG_INOUTFN( "ConfigureDecoderL() does not leave" );
         }
 #endif
-
+        
         m_DevVidInitialized = EInitializedOnGoingPass1;
+        
+        MDFVIDEOLOG_INOUTFN( "calls Initialize()" );
         m_pDevVideoPlay->Initialize();
-    
+        
+        MDFVIDEOLOG_INOUTFN( "Initialize CMMFDevVideoPlay end" );
     }    
-    MDFVIDEOLOG_RETURNFN( "InitL", retVal )
+    MDFVIDEOLOG_RETURNFN2( "InitL", retVal );
     return retVal;
 }
-    
+
 HX_RESULT CMdfVideoAdapter::VideoPause()
 {
-    MDFVIDEOLOG_ENTERFN( "VideoPause" )
-    if( m_pDevVideoPlay != NULL )
-    {
-        m_pDevVideoPlay->Pause();
-    }
-
-    //Following codes are inserted temporarily because of lack of path
-    //from UI to DevVideo through which DSA calls could pass
-    //In later version, this path will be built.
-    //********** Start
+    MDFVIDEOLOG_ENTERFN( "VideoPause" );
+    if( m_pDevVideoPlay != NULL )
+    {
+        m_pDevVideoPlay->Pause();
+    }
+
+    //Following codes are inserted temporarily because of lack of path
+    //from UI to DevVideo through which DSA calls could pass
+    //In later version, this path will be built.
+    //********** Start
     if( m_pDevVideoPlay != NULL && m_IsDSAStarted == TRUE )
     {
         m_pDevVideoPlay->AbortDirectScreenAccess();
-        m_IsDSAStarted = FALSE;
-    }
-    //********** End
+        m_IsDSAStarted = FALSE;
+    }
+    //********** End
 
-    MDFVIDEOLOG_LEAVEFN( "VideoPause" )
+    MDFVIDEOLOG_LEAVEFN( "VideoPause" );
     return HXR_OK;
 }
 
 HX_RESULT CMdfVideoAdapter::VideoResume()
 {
-    MDFVIDEOLOG_ENTERFN( "VideoResume" )
+    MDFVIDEOLOG_ENTERFN( "VideoResume" );
     HX_RESULT retVal = HXR_OK;
-    if( m_pDevVideoPlay != NULL )
-    {
-        m_pDevVideoPlay->Resume();
-    }
-
-    //Following codes are inserted temporarily because of lack of path
-    //from UI to DevVideo through which DSA calls could pass
-    //In later version, this path will be built.
-    //********** Start
+    if( m_pDevVideoPlay != NULL )
+    {
+        m_pDevVideoPlay->Resume();
+    }
+
+    //Following codes are inserted temporarily because of lack of path
+    //from UI to DevVideo through which DSA calls could pass
+    //In later version, this path will be built.
+    //********** Start
     if( m_pDevVideoPlay != NULL && m_IsDSAStarted == FALSE )
-    { 
-        RRegion region( m_clipRect );
-        TRAPD( error, m_pDevVideoPlay->StartDirectScreenAccessL(m_clipRect, *m_pFbsScreenDevice, region ) );
-        if( error != KErrNone )
-        {
-            retVal = HXR_FAIL;
-        }
-        else
-        {
-            m_IsDSAStarted = TRUE;
-        }
-        region.Close(); //do not use Destroy()
+    { 
+        RRegion region( m_clipRect );
+        TRAPD( error, m_pDevVideoPlay->StartDirectScreenAccessL(m_clipRect, *m_pFbsScreenDevice, region ) );
+        if( error != KErrNone )
+        {
+            retVal = HXR_FAIL;
+        }
+        else
+        {
+            m_IsDSAStarted = TRUE;
+        }
+        region.Close(); //do not use Destroy()
     }
-    //********** End
+    //********** End
     TInt number = m_BltPacketQueue.GetCount();
-    MDFVIDEOLOG_WRITE_FORMAT1( "packets left in queue that is not blitted is %d\n", number )
+    MDFVIDEOLOG_WRITE_FORMAT( "    packets left in queue that is not blitted is %d", number );
     Blt();
     
-    MDFVIDEOLOG_LEAVEFN( "VideoResume" )
+    MDFVIDEOLOG_LEAVEFN( "VideoResume" );
     return HXR_OK;
 }
 
 HX_RESULT CMdfVideoAdapter::VideoEnd( THIS_ )
 {
-    MDFVIDEOLOG_ENTERFN( "VideoEnd" )
+    MDFVIDEOLOG_ENTERFN2( "VideoEnd" );
+
     TInt number = m_BltPacketQueue.GetCount();
-    MDFVIDEOLOG_WRITE_FORMAT1( "packets left in queue that is not blitted is %d\n", number )
-
-    if( m_pDevVideoPlay && m_DevVidInitialized == EInitializedSuccess )
-    {
-        MDFVIDEOLOG_INOUTFN( "InputEnd" );
-        m_pDevVideoPlay->InputEnd(); //CallBack function MdvpoStreamEnd() will be called by DevVideo
-    }
-
-    MDFVIDEOLOG_LEAVEFN( "VideoEnd" )
+    MDFVIDEOLOG_WRITE_FORMAT( "    packets left in queue that is not blitted is %d\n", number );
+
+    if( m_pDevVideoPlay && m_DevVidInitialized == EInitializedSuccess )
+    {
+        MDFVIDEOLOG_INOUTFN( "InputEnd" );
+        m_pDevVideoPlay->InputEnd(); //CallBack function MdvpoStreamEnd() will be called by DevVideo
+    }
+
+    MDFVIDEOLOG_LEAVEFN2( "VideoEnd" );
     return HXR_OK;
 }
 
 HX_RESULT CMdfVideoAdapter::SetVideoTimePosition( const TTimeIntervalMicroSeconds& aPlaybackPosition )
-{
+{
+    MDFVIDEOLOG_ENTERFN( "SetVideoTimePosition" );
     HX_RESULT retVal = HXR_OK;
     HX_ASSERT( m_pDevVideoPlay );
     TRAPD( error, m_pDevVideoPlay->SetPosition( aPlaybackPosition ) );
     if( error != KErrNone )
     {
         HX_RESULT retVal = HXR_FAIL;
-    }
+    }
+    MDFVIDEOLOG_RETURNFN( "SetVideoTimePosition", retVal );
     return retVal;
 }
 
 void CMdfVideoAdapter::OnVideoPacket( CMediaPacket* pMediaPacket )
 {
-    MDFVIDEOLOG_ENTERFN( "OnVideoPacket" )
-        
+    MDFVIDEOLOG_ENTERFN4( "OnVideoPacket" );
+    
     if( pMediaPacket )
     {
         m_pBltQueueMutex->Lock();
         m_BltPacketQueue.AddTail( pMediaPacket );
         m_pBltQueueMutex->Unlock();
     }
-
-    MDFVIDEOLOG_LEAVEFN( "OnVideoPacket" )
+    
+    MDFVIDEOLOG_LEAVEFN4( "OnVideoPacket" );
 }
 
 HX_RESULT CMdfVideoAdapter::Blt()
 {
-    MDFVIDEOLOG_ENTERFN( "Blt" )
+    MDFVIDEOLOG_ENTERFN4( "Blt" );
     HX_RESULT retVal = HXR_OK;
-
-    if( m_IsDSAStarted == FALSE )
-    {
-        MDFVIDEOLOG_RETURNFN4( "Blt", retVal );
-        return retVal;
-    }
+
+    if( m_IsDSAStarted == FALSE )
+    {
+        MDFVIDEOLOG_RETURNFN4( "Blt", retVal );
+        return retVal;
+    }
     
     m_pWriteMutex->Lock();
-    m_pBltQueueMutex->Lock();
+    m_pBltQueueMutex->Lock();    
 
     TRAPD( error, BltL() );
     if( error != KErrNone )
     {
         retVal = HXR_FAIL;
     }
-
+    
     m_pBltQueueMutex->Unlock();
     m_pWriteMutex->Unlock();
     
-    MDFVIDEOLOG_LEAVEFN( "Blt" )
+    MDFVIDEOLOG_RETURNFN4( "Blt", retVal );
     return retVal;
 }
 
 void CMdfVideoAdapter::BltL()
 {
-    MDFVIDEOLOG_ENTERFN( "BltL" )
+    MDFVIDEOLOG_ENTERFN4( "BltL" );
     
     CMediaPacket* pPeekMediaPacket = NULL;
     UINT32 ulBufferSize = 0;
@@ -427,7 +454,7 @@
     TTimeIntervalMicroSeconds currentTime = m_pClockSource->Time();
     
     TInt number = m_BltPacketQueue.GetCount();
-    MDFVIDEOLOG_WRITE_FORMAT1( "packets left in queue that is not blitted is %d\n", number )
+    MDFVIDEOLOG_WRITE_FORMAT4( "    packets left in queue that is not blitted is %d", number );
     while( !m_BltPacketQueue.IsEmpty() )
     {
         pPeekMediaPacket = (CMediaPacket*) m_BltPacketQueue.GetHead();  //peek
@@ -438,7 +465,7 @@
             TInt64 ulTimeInMs = TInt64( ultime );
             TInt64 ulTimeInMicro = ulTimeInMs * TInt64( 1000 );
             presentationTime = ulTimeInMicro;
-
+            
             TInt64 timeInVarInMicro = ( ulTimeInMs + TInt64( MDF_FRAME_DROP_THRESHOLD ) )* TInt64( 1000 );
             TTimeIntervalMicroSeconds timeInVar = timeInVarInMicro;
 
@@ -450,7 +477,7 @@
             }
             else
             {
-                MDFVIDEOLOG_INOUTFN1( "packet dropped" )
+                MDFVIDEOLOG_INOUTFN4( "packet dropped" );
                 pPeekMediaPacket = (CMediaPacket*) m_BltPacketQueue.RemoveHead();
                 pPeekMediaPacket->Clear();
                 HX_DELETE( pPeekMediaPacket );
@@ -462,16 +489,19 @@
             HX_ASSERT( pPeekMediaPacket == NULL );
         }
     }
-
+    
     HX_ASSERT( m_pPayloadFormatPluginDevice );
-
+    
     if( ( m_DevVidInitialized == EInitializedSuccess ) && !m_BltPacketQueue.IsEmpty() )
     {
+        MDFVIDEOLOG_INOUTFN4( "Ready to write to MDF buffer" );
         HX_ASSERT( ulBufferSize );
         TVideoInputBuffer* videoInputBufferP = NULL;
+        MDFVIDEOLOG_WRITE_FORMAT4( "    Size requested is : %d", ulBufferSize );
         videoInputBufferP = m_pDevVideoPlay->GetBufferL( ulBufferSize );
         if( videoInputBufferP )
         {
+			MDFVIDEOLOG_INOUTFN4( "Start to write to MDF buffer" );
             CMediaPacket* pMediaPacket = NULL;
             pMediaPacket = (CMediaPacket*) m_BltPacketQueue.RemoveHead();
             
@@ -487,36 +517,44 @@
             videoInputBufferP->iDecodingTimestamp     = currentTime; //decode now
             videoInputBufferP->iPresentationTimestamp = presentationTime;
             
-            MDFVIDEOLOG_INOUTFN1( "WriteCodedDataL" )
+            MDFVIDEOLOG_INOUTFN4( "WriteCodedDataL" );
             m_pDevVideoPlay->WriteCodedDataL( videoInputBufferP );
+        }
+        else
+        {
+            MDFVIDEOLOG_INOUTFN4( "GetBufferL returns NULL" );
         }
+    }
+    else
+    {
+        MDFVIDEOLOG_INOUTFN4( "m_DevVidInitialized != EInitializedSuccess or m_BltPacketQueue.IsEmpty() is true" );
     }
-    MDFVIDEOLOG_LEAVEFN( "BltL" )
+    MDFVIDEOLOG_LEAVEFN4( "BltL" );
 }
-    
+
 void CMdfVideoAdapter::AttachSite( IHXSite* pSite )
 {
-    MDFVIDEOLOG_ENTERFN( "AttachSite" )
+    MDFVIDEOLOG_ENTERFN( "AttachSite" );
     HX_ASSERT( pSite );
     m_pSite = pSite;
     m_pSite->AddRef();
     SetupWindow();
-    MDFVIDEOLOG_LEAVEFN( "AttachSite" )
+    MDFVIDEOLOG_LEAVEFN( "AttachSite" );
 }
 
 void CMdfVideoAdapter::DetachSite()
 {
-    MDFVIDEOLOG_ENTERFN( "DetachSite" )
+    MDFVIDEOLOG_ENTERFN( "DetachSite" );
     HX_ASSERT( m_pSite );
     m_pSite->Release();
     m_pSite = NULL;
-    MDFVIDEOLOG_LEAVEFN( "DetachSite" )
+    MDFVIDEOLOG_LEAVEFN( "DetachSite" );
 }
 
 ///////////////////////////////////////////////////////////
 void CMdfVideoAdapter::ClearBltQueue( void )
 {
-    MDFVIDEOLOG_ENTERFN( "ClearBltQueue" )
+    MDFVIDEOLOG_ENTERFN( "ClearBltQueue" );
     CMediaPacket* pVideoPacket = NULL;
     
     m_pBltQueueMutex->Lock();
@@ -532,14 +570,14 @@
     }
     m_pBltQueueMutex->Unlock();
     
-    MDFVIDEOLOG_LEAVEFN( "ClearBltQueue" )
+    MDFVIDEOLOG_LEAVEFN( "ClearBltQueue" );
 }
 
 
 void CMdfVideoAdapter::SetupWindow()
 {
-    MDFVIDEOLOG_ENTERFN( "SetupWindow" )
-        
+    MDFVIDEOLOG_ENTERFN( "SetupWindow" );
+    
     HX_RESULT retVal = HXR_IGNORE;
     if( m_DevVidInitialized == EInitializedOnGoingPass2 && m_pSite )
     {
@@ -579,7 +617,7 @@
         RRegion region( m_clipRect );
         TRAPD( error, m_pDevVideoPlay->StartDirectScreenAccessL(m_clipRect, *m_pFbsScreenDevice, region ) );
         if( error == KErrNone )
-        {
+        {
             m_IsDSAStarted = TRUE;
             retVal = HXR_OK;
         }
@@ -587,18 +625,18 @@
 #else
         RWindow*   pWin    = (RWindow*)pHXWin->window;
         CDirectScreenAccess* pDirectScreen = pHXWin->iDSA;
-      
+        
         TRegion& aClipRegion = *pDirectScreen->DrawingRegion();
         
         m_clipRect = aClipRegion.BoundingRect() ;
         TRAPD( error, m_pDevVideoPlay->StartDirectScreenAccessL(m_clipRect, *pDirectScreen->ScreenDevice(), aClipRegion ) );
         if( error == KErrNone )
-        {
+        {
             m_IsDSAStarted = TRUE;
             retVal = HXR_OK;
         }
 #endif
-
+        
         if( SUCCEEDED( retVal ) )
         {
             TRAPD( error, m_pDevVideoPlay->SetScaleOptionsL( m_PostProcessorHwDeviceId, m_clipRect.Size(), EFalse ) );
@@ -612,8 +650,8 @@
             }
         }
     }
-        
-        
+    
+    
     if( SUCCEEDED( retVal ) )
     {
         TRAPD( error, m_pDevVideoPlay->CommitL() );
@@ -644,90 +682,90 @@
         m_DevVidInitialized = EInitializedFailed;
     }
     
-    MDFVIDEOLOG_LEAVEFN( "SetupWindow" )
+    MDFVIDEOLOG_LEAVEFN( "SetupWindow" );
 }
 
 //////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////
 void CMdfVideoAdapter::MdvpoNewBuffers()
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoNewBuffers" )
+    MDFVIDEOLOG_ENTERFN4( "MdvpoNewBuffers" );
     Blt();
-    MDFVIDEOLOG_LEAVEFN( "MdvpoNewBuffers" )
+    MDFVIDEOLOG_LEAVEFN4( "MdvpoNewBuffers" );
 }
 
 void CMdfVideoAdapter::MdvpoReturnPicture(TVideoPicture* aPicture)
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoReturnPicture" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoReturnPicture" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoReturnPicture" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoReturnPicture" );
 }
 
 void CMdfVideoAdapter::MdvpoSupplementalInformation(const TDesC8& aData, 
-    const TTimeIntervalMicroSeconds& aTimestamp, 
-    const TPictureId& aPictureId)
+                                                    const TTimeIntervalMicroSeconds& aTimestamp, 
+                                                    const TPictureId& aPictureId)
 {	
-    MDFVIDEOLOG_ENTERFN( "MdvpoSupplementalInformation" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoSupplementalInformation" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoSupplementalInformation" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoSupplementalInformation" );
 }
 
 void CMdfVideoAdapter::MdvpoPictureLoss()
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoPictureLoss" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoPictureLoss" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoPictureLoss" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoPictureLoss" );
 }
 
 void CMdfVideoAdapter::MdvpoPictureLoss(const TArray& aPictures)
 {	
-    MDFVIDEOLOG_ENTERFN( "MdvpoPictureLoss" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoPictureLoss" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoPictureLoss" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoPictureLoss" );
 }
 
 void CMdfVideoAdapter::MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture)
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoSliceLoss" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoSliceLoss" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoSliceLoss" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoSliceLoss" );
 }
 
 void CMdfVideoAdapter::MdvpoReferencePictureSelection(const TDesC8& aSelectionData)
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoReferencePictureSelection" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoReferencePictureSelection" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoReferencePictureSelection" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoReferencePictureSelection" );
 }
 
 void CMdfVideoAdapter::MdvpoTimedSnapshotComplete(TInt aError, 
-    TPictureData* aPictureData, 
-    const TTimeIntervalMicroSeconds& aPresentationTimestamp, 
-    const TPictureId& aPictureId)
+                                                  TPictureData* aPictureData, 
+                                                  const TTimeIntervalMicroSeconds& aPresentationTimestamp, 
+                                                  const TPictureId& aPictureId)
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoTimedSnapshotComplete" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoTimedSnapshotComplete" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoTimedSnapshotComplete" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoTimedSnapshotComplete" );
 }
 
 void CMdfVideoAdapter::MdvpoNewPictures()
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoNewPictures" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoNewPictures" );
     //no implementation
-    MDFVIDEOLOG_LEAVEFN( "MdvpoNewPictures" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoNewPictures" );
 }
 
 void CMdfVideoAdapter::MdvpoFatalError(TInt aError)
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoFatalError" )
+    MDFVIDEOLOG_ENTERFN2( "MdvpoFatalError" );
     m_DevVidInitialized = EInitializedFailed;
-    MDFVIDEOLOG_LEAVEFN( "MdvpoFatalError" )
+    MDFVIDEOLOG_LEAVEFN2( "MdvpoFatalError" );
 }
 
 
 void CMdfVideoAdapter::MdvpoInitComplete(TInt aError)
 {	
-    MDFVIDEOLOG_ENTERFN( "MdvpoInitComplete" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoInitComplete" );
     //m_pWriteMutex->Unlock();
     m_DevVidInitialized = EInitializedFailed;
     
@@ -739,25 +777,25 @@
         
         SetupWindow();
     }
-    MDFVIDEOLOG_LEAVEFN( "MdvpoInitComplete" )
+    MDFVIDEOLOG_LEAVEFN( "MdvpoInitComplete" );
 }
 
 
 void CMdfVideoAdapter::MdvpoStreamEnd()
 {
-    MDFVIDEOLOG_ENTERFN( "MdvpoStreamEnd" )
-
-    if( m_pDevVideoPlay && m_DevVidInitialized == EInitializedSuccess )
-    {
-        m_pDevVideoPlay->Stop();
-        MDFVIDEOLOG_INOUTFN( "Stop" );
-        
-        m_IsDSAStarted = FALSE;
-        
-        m_DevVidInitialized = EInitializedReady;
-    }
-    
-    ClearBltQueue();
-    MDFVIDEOLOG_LEAVEFN( "MdvpoStreamEnd" )
+    MDFVIDEOLOG_ENTERFN( "MdvpoStreamEnd" );
+
+    if( m_pDevVideoPlay && m_DevVidInitialized == EInitializedSuccess )
+    {
+        m_pDevVideoPlay->Stop();
+        MDFVIDEOLOG_INOUTFN( "Stop" );
+        
+        m_IsDSAStarted = FALSE;
+        
+        m_DevVidInitialized = EInitializedReady;
+    }
+    
+    ClearBltQueue();
+    MDFVIDEOLOG_LEAVEFN( "MdvpoStreamEnd" );
 }
 


From jwei at helixcommunity.org  Wed Feb  1 09:30:38 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:46:18 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvidrend.cpp,1.4.2.2,1.4.2.3
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv7739

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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfvidrend.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -u -d -r1.4.2.2 -r1.4.2.3
--- mdfvidrend.cpp	31 Jan 2006 20:24:25 -0000	1.4.2.2
+++ mdfvidrend.cpp	1 Feb 2006 17:30:36 -0000	1.4.2.3
@@ -66,8 +66,6 @@
 const char* const CMdfVideoRenderer::zm_pCopyright      = "Nokia Inc, 2005";
 const char* const CMdfVideoRenderer::zm_pMoreInfoURL    = "http://www.helixcommunity.org\0";
 
-MDFVIDEOLOG_CLASSNAME( "CMdfVideoRenderer" )
-
 CMdfVideoRenderer::CMdfVideoRenderer()
 : CHXBaseCountingObject(),
   m_pContext( NULL ),
@@ -100,18 +98,19 @@
   m_ulBufferingStopTime( 0 ),
   m_ulBytesToBuffer( 0 ),
   m_bIsThreadRunning( FALSE ),
-  m_PlayState(Stopped),
+  m_PlayState(Stopped),
   m_ulBeginTime( 0 )
 {
-    MDFVIDEOLOG_CREATE_NOWRITE
-    MDFVIDEOLOG_ENTERFN( "CMdfVideoRenderer" )
-    MDFVIDEOLOG_LEAVEFN( "CMdfVideoRenderer" )
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CMdfVideoRenderer" );
+    MDFVIDEOLOG_ENTERFN( "CMdfVideoRenderer" );
+    MDFVIDEOLOG_LEAVEFN( "CMdfVideoRenderer" );
 }
 
 CMdfVideoRenderer::~CMdfVideoRenderer()
 {
-    MDFVIDEOLOG_ENTERFN( "~CMdfVideoRenderer" )
-
+    MDFVIDEOLOG_ENTERFN( "~CMdfVideoRenderer" );
+    
     UINT16 index = 0;
     while( zm_pStreamMimeTypes != NULL && zm_pStreamMimeTypes[index] != NULL )
     {
@@ -129,8 +128,8 @@
     HX_RELEASE( m_pContext );
     HX_DELETE( m_pStateMutex );
     
-    MDFVIDEOLOG_LEAVEFN( "~CMdfVideoRenderer" )
-    MDFVIDEOLOG_DELETE
+    MDFVIDEOLOG_LEAVEFN( "~CMdfVideoRenderer" );
+    MDFVIDEOLOG_DELETE;
 }
 
 HX_RESULT STDAPICALLTYPE CMdfVideoRenderer::HXCreateInstance(IUnknown** ppIUnknown)
@@ -162,7 +161,7 @@
 /////////////////////////////////////////////////////////////////////
 STDMETHODIMP CMdfVideoRenderer::QueryInterface( THIS_ REFIID riid, void** ppvObj )
 {
-    MDFVIDEOLOG_ENTERFN( "QueryInterface" )
+    MDFVIDEOLOG_ENTERFN( "QueryInterface" );
     QInterfaceList  qiList[] =
     {
         { GET_IIDHANDLE( IID_IUnknown ),    ( IUnknown* )( IHXPlugin* ) this },
@@ -179,13 +178,13 @@
     
     if( QIFind( qiList, QILISTSIZE(qiList), riid, ppvObj ) == HXR_OK )
     {
-        MDFVIDEOLOG_LEAVEFN( "QueryInterface" )
+        MDFVIDEOLOG_LEAVEFN( "QueryInterface" );
         return HXR_OK ;
     }
     else
     {
         *ppvObj = NULL;
-        MDFVIDEOLOG_LEAVEFN( "QueryInterface" )
+        MDFVIDEOLOG_LEAVEFN( "QueryInterface" );
         return HXR_NOINTERFACE;
     }
 }
@@ -218,7 +217,7 @@
  REF(UINT32)      ulVersionNumber
  )
 {
-    MDFVIDEOLOG_ENTERFN( "GetPluginInfo" )
+    MDFVIDEOLOG_ENTERFN( "GetPluginInfo" );
     bLoadMultiple = TRUE;   // Must be true for file formats.
     
     pDescription    = zm_pDescription;
@@ -226,24 +225,24 @@
     pMoreInfoURL    = zm_pMoreInfoURL;
     ulVersionNumber = MDFVER_ULONG32_VERSION;
     
-    MDFVIDEOLOG_LEAVEFN( "GetPluginInfo" )
-        
+    MDFVIDEOLOG_LEAVEFN( "GetPluginInfo" );
+    
     return HXR_OK;
 }
 
 STDMETHODIMP CMdfVideoRenderer::InitPlugin( IUnknown* pContext )
 {
-    MDFVIDEOLOG_ENTERFN( "InitPlugin" )
-
+    MDFVIDEOLOG_ENTERFN2( "InitPlugin" );
+    
     HX_ASSERT( pContext );
-
+    
     MDF_ENABLE_LOGGING( pContext );
-        
+    
     HX_RESULT retVal = HXR_OK;
     HX_ASSERT( m_pContext == NULL );
     m_pContext = pContext;
     m_pContext->AddRef();
-
+    
     if( SUCCEEDED(retVal) && !m_pStateMutex )
     {
 #ifdef THREADS_SUPPORTED
@@ -252,7 +251,7 @@
         retVal = HXMutex::MakeStubMutex( m_pStateMutex );
 #endif  // THREADS_SUPPORTED
     }
-
+    
     if( SUCCEEDED( retVal ) )
     {
         HX_ASSERT( m_pMdfVideoAdapter == NULL );
@@ -280,7 +279,7 @@
         {
             retVal = HXR_OUTOFMEMORY;
         }
-
+        
     }
     
     if ( SUCCEEDED( retVal ) )    // Create the timesync smoother
@@ -310,7 +309,7 @@
             retVal = HXR_OUTOFMEMORY;
         }
     }
-
+    
     if( FAILED( retVal ) )
     {
         HX_RELEASE( m_pMdfVideoAdapter );
@@ -319,8 +318,8 @@
         HX_DELETE(  m_pClockSource );
         HX_RELEASE( m_pContext );
     }
-        
-    MDFVIDEOLOG_RETURNFN( "InitPlugin", retVal );
+    
+    MDFVIDEOLOG_RETURNFN2( "InitPlugin", retVal );
     
     return retVal;
 }
@@ -334,8 +333,8 @@
  REF(UINT32)       unInitialGranularity
  )
 {
-    MDFVIDEOLOG_ENTERFN( "GetRendererInfo" )
-        
+    MDFVIDEOLOG_ENTERFN2( "GetRendererInfo" );
+    
     HX_RESULT retVal = HXR_OK;
     
     if( m_bMimeTypeSearched != TRUE )
@@ -373,26 +372,26 @@
     
     unInitialGranularity = SYNC_INTERVAL;
     
-    MDFVIDEOLOG_RETURNFN( "GetRendererInfo", retVal );
+    MDFVIDEOLOG_RETURNFN2( "GetRendererInfo", retVal );
     
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoRenderer::StartStream( IHXStream* pStream, IHXPlayer* pPlayer )
 {
-    MDFVIDEOLOG_ENTERFN( "StartStream" )
-        
+    MDFVIDEOLOG_ENTERFN2( "StartStream" );
+    
     HX_RESULT retVal = HXR_OK;
     
     if( !pStream )
     {
         retVal = HXR_FAIL;
     }
-
+    
     HX_ASSERT( pStream );
     HX_ASSERT( m_pStream == NULL );
     HX_ASSERT( m_pBltrPump == NULL );
-
+    
     if( SUCCEEDED( retVal ) )
     {
         m_pStream = pStream;
@@ -418,9 +417,9 @@
             if( SUCCEEDED( retVal ) )
             {
                 retVal = m_pBltrPump->Start( this,
-                                    DFLT_PRESENT_PRIORITY,
-                                    BLTR_INTERVAL,
-                                    m_ulBltrPacemakerId );
+                    DFLT_PRESENT_PRIORITY,
+                    BLTR_INTERVAL,
+                    m_ulBltrPacemakerId );
             }
             else
             {
@@ -429,24 +428,24 @@
         }
         HX_RELEASE( pVideoPaceMaker );
     }
-
+    
     if( FAILED( retVal ) )
     {
         HX_RELEASE( m_pStream );
         HX_RELEASE( m_pBltrPump );
     }
-
-    MDFVIDEOLOG_RETURNFN( "StartStream", retVal );
+    
+    MDFVIDEOLOG_RETURNFN2( "StartStream", retVal );
     
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoRenderer::EndStream( THIS )
 {
-    MDFVIDEOLOG_ENTERFN( "EndStream" )
+    MDFVIDEOLOG_ENTERFN2( "EndStream" );
 
     HX_RESULT retVal = HXR_OK;
-        
+        
     if( m_pMdfVideoAdapter )
     {
         retVal = m_pMdfVideoAdapter->VideoEnd();
@@ -461,24 +460,24 @@
         m_pBltrPump->Signal();
         m_pBltrPump->WaitForStop();
         HX_RELEASE( m_pBltrPump );
-    }
-
-    m_pStateMutex->Lock();
-    m_PlayState = Stopped;
-    m_pStateMutex->Unlock();
-
+    }
+
+    m_pStateMutex->Lock();
+    m_PlayState = Stopped;
+    m_pStateMutex->Unlock();
+
     HX_RELEASE( m_pHeader );
     HX_RELEASE( m_pStream );
     
-    MDFVIDEOLOG_LEAVEFN( "EndStream" )
-        
+    MDFVIDEOLOG_LEAVEFN2( "EndStream" );
+    
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoRenderer::OnHeader( IHXValues* pHeader )
 {
-    MDFVIDEOLOG_ENTERFN( "OnHeader" )
-        
+    MDFVIDEOLOG_ENTERFN2( "OnHeader" );
+    
     HX_RESULT retVal = HXR_OK;
     
     if( !pHeader )
@@ -492,13 +491,13 @@
         m_pHeader = pHeader;
         m_pHeader->AddRef();
     }
-
+    
 #ifdef HELIX_FEATURE_VIDEO_ENFORCE_MAX_FRAMESIZE
     if( SUCCEEDED( retVal ) && m_pContext )
     {
         IHXPreferences* pPreferences = NULL;
         retVal = m_pContext->QueryInterface( IID_IHXPreferences, 
-                                             (void**) &pPreferences );
+            (void**) &pPreferences );
         
         if( SUCCEEDED( retVal ) )
         {
@@ -520,7 +519,8 @@
                     ULONG32 currentVidArea = (ULONG32) ( ulFrameWidth * ulFrameHeight );
                     if( currentVidArea > ulMaxVidArea )
                     {
-                        retVal = HXR_SLOW_MACHINE;
+                        retVal = HXR_SLOW_MACHINE;
+                        MDFVIDEOLOG_INOUTFN2( "HXR_SLOW_MACHINE" );
                     }
                 }
             }
@@ -528,7 +528,7 @@
         HX_RELEASE( pPreferences );
     }
 #endif 
-
+    
     
     IHXBuffer* pMimeType = NULL;
     const char* pMimeTypeData = NULL;
@@ -541,7 +541,9 @@
     
     if ( SUCCEEDED( retVal ) )
     {
-        pMimeTypeData = (char*) pMimeType->GetBuffer();
+        pMimeTypeData = (char*) pMimeType->GetBuffer();
+        MDFVIDEOLOG_WRITE_FORMAT2( "<-> Mimetype is %s", pMimeTypeData );
+        
         if( pMimeTypeData && m_pCurrentMimetype )
         {
             if( !strcmp( pMimeTypeData, m_pCurrentMimetype ) )
@@ -607,11 +609,13 @@
             TBool valid = EFalse;
             TRAPD( error2, valid = m_pPluginManager->GetIdsByMimeTypeL( *package ) );
             if( valid && error2 == KErrNone )
-            {
+            {
+                MDFVIDEOLOG_INOUTFN2( "PluginManager has package ready for this mimetype" );
                 retVal = HXR_OK;
             }
             else
             {
+                MDFVIDEOLOG_INOUTFN2( "PluginManager does not have package for this mimetype" );
                 retVal = HXR_NOTIMPL;
             }
         }
@@ -623,42 +627,45 @@
         HX_DELETE( m_pMdfPayloadFormat );
         TRAPD( error, m_pMdfPayloadFormat = CPayloadFormatPluginDevice::NewL( formatId ) );
         if( m_pMdfPayloadFormat && error == KErrNone )
-        {
+        {
+            MDFVIDEOLOG_WRITE_FORMAT2( "    Payload id 0x%08x is successfully loaded", formatId.iUid );
+            
             UINT32 ulPreroll = m_pMdfPayloadFormat->GetPreRollInMs();
             pHeader->SetPropertyULONG32( "Preroll", ulPreroll );
             retVal = HXR_OK;
         }
         else
         {
+            MDFVIDEOLOG_WRITE_FORMAT2( "    Payload id 0x%08x is failed to be loaded", formatId.iUid );
             retVal = HXR_OUTOFMEMORY;
         }
     }
-
+    
     if ( SUCCEEDED( retVal ) )
     {
         retVal = m_pMdfPayloadFormat->Init( m_pContext, m_pHeader );
     }
-
+    
     if( SUCCEEDED( retVal ) )
     {
         //do not destroy streamHeader
         const TDesC8* streamHeader = m_pMdfPayloadFormat->GetBitstreamHeader();
-
+        
         TVideoDataUnitType unitType = m_pMdfPayloadFormat->GetVideoDataUnitType();
         TVideoDataUnitEncapsulation unitEncapsulation = m_pMdfPayloadFormat->GetVideoDataUnitEncapsulation();
         
         package->SetVideoDataUnitType( unitType );
         package->SetVideoDataUnitEncapsulation( unitEncapsulation );
-
+        
         retVal = m_pMdfVideoAdapter->Init( *package, m_pClockSource, streamHeader, m_pMdfPayloadFormat, m_pContext );
     }
-        
+    
     HX_DELETE( package );
-        
+    
     if( FAILED( retVal ) )
     {
         HX_RELEASE( m_pHeader );
-
+        
         if( m_pCurrentMimetype )
         {
             delete  m_pCurrentMimetype;
@@ -671,17 +678,18 @@
         HX_DELETE( m_pMdfPayloadFormat );
     }
     
-    MDFVIDEOLOG_RETURNFN( "OnHeader", retVal );
+    MDFVIDEOLOG_RETURNFN2( "OnHeader", retVal );
     
     return retVal;
 }
-    
+
 STDMETHODIMP CMdfVideoRenderer::OnPacket( IHXPacket* pPacket, INT32 lTimeOffset )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPacket" )
-
+    MDFVIDEOLOG_ENTERFN4( "OnPacket" );
+    MDFVIDEOLOG_WRITE_FORMAT4( "    packet time: %d", pPacket->GetTime() );
+    
     HX_RESULT retVal = HXR_OK;
-
+    
     if( m_pTimeSyncSmoother )
     {
         m_pTimeSyncSmoother->SetTimelineOffset( lTimeOffset );
@@ -705,18 +713,21 @@
         retVal = m_pMdfPayloadFormat->GetLastError();
         if( FAILED( retVal ) && pMediaPckt )
         {
+            MDFVIDEOLOG_INOUTFN4( "Packet is deleted" );
             pMediaPckt->Clear();
             HX_DELETE( pMediaPckt );
         }
     }
     
     while( pMediaPckt && SUCCEEDED( retVal ) )
-    {
+    {
+        MDFVIDEOLOG_WRITE_FORMAT4( "    MediaPckt time: %d", pMediaPckt->m_ulTime );
+
 //      if( m_PlayState != Seeking && m_ulBeginTime <= pMediaPckt->m_ulTime )
 		if( m_PlayState != Seeking ) //&& m_ulBeginTime <= pMediaPckt->m_ulTime )
-		{
-            //m_PlayState is Seeking between OnPreSeek() and OnPostSeek
-            //pMediaPckt->m_ulTime is significantly smaller (upto 2 second)
+		{
+            //m_PlayState is Seeking between OnPreSeek() and OnPostSeek
+            //pMediaPckt->m_ulTime is significantly smaller (upto 2 second)
             //than m_ulBeginTime between OnBegin() and OnPostSeek()
 			m_pMdfVideoAdapter->OnVideoPacket( pMediaPckt );
 		}
@@ -741,7 +752,6 @@
         
         if( SUCCEEDED( retVal ) )
         {
-            //to flush out other packets, in MP4, not in H263
             pMediaPckt = m_pMdfPayloadFormat->CreateAssembledPacket( NULL );
             retVal = m_pMdfPayloadFormat->GetLastError();
             if( FAILED( retVal ) && pMediaPckt )
@@ -751,36 +761,56 @@
             }
         }
     }
-
-    MDFVIDEOLOG_RETURNFN( "OnPacket", retVal );
+    
+    MDFVIDEOLOG_RETURNFN4( "OnPacket", retVal );
     
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoRenderer::OnTimeSync( THIS_ UINT32 ulTime )
 {    
-    MDFVIDEOLOG_ENTERFN( "OnTimeSync" )
-        
+    MDFVIDEOLOG_ENTERFN( "OnTimeSync" );
+    
     HX_RESULT retVal = HXR_OK;
     HX_ASSERT( m_pTimeSyncSmoother );
-    HX_ASSERT( m_pClockSource );
+    HX_ASSERT( m_pClockSource );
+    MDFVIDEOLOG_WRITE_FORMAT( "    CurrentTime from OnTimeSync is %d", ulTime );
+    
+    TInt currentTime = 0;
+    
+#ifdef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
+    currentTime = (TInt) ((m_pClockSource->Time()).Int64()/1000);
+#else
+    currentTime = ((m_pClockSource->Time()).Int64()/1000).Low();
+#endif
+    
+    MDFVIDEOLOG_WRITE_FORMAT( "    CurrentTime from ClockSource before updating is %d", currentTime );
+    
     m_pTimeSyncSmoother->OnTimeSync(ulTime);
-
+    
+#ifdef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
+    currentTime = (TInt) ((m_pClockSource->Time()).Int64()/1000);
+#else
+    currentTime = ((m_pClockSource->Time()).Int64()/1000).Low();
+#endif
+    
+    MDFVIDEOLOG_WRITE_FORMAT( "    CurrentTime from ClockSource  after updating is %d", currentTime );
+    
     if( m_PlayState == PlayStarting )
     {
         m_pStateMutex->Lock();
         m_pTimeSyncSmoother->SetBaseTimeFlag();
-
+        
         // Reset the offset to avoid race condition
         // with m_ulTimeNormalizationOffset setting in OnPacket()
         if( m_pTimeSyncSmoother->WasLastSampleGood() )
         {
             m_pTimeSyncSmoother->ResetOffset();
         }
-
+        
         m_PlayState = Playing;
         m_pClockSource->Start();
-
+        
         m_pStateMutex->Unlock();
     }
     
@@ -791,11 +821,12 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnPreSeek( UINT32 ulOldTime, UINT32 ulNewTime )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPreSeek" )
+    MDFVIDEOLOG_ENTERFN( "OnPreSeek" );
+    MDFVIDEOLOG_WRITE_MULTI_FORMAT( "    old time: %d, new time: %d", ulOldTime, ulNewTime );
     
     HX_RESULT retVal = HXR_OK;
-
-    HX_ASSERT( m_pMdfVideoAdapter );
+
+    HX_ASSERT( m_pMdfVideoAdapter );
     m_pMdfVideoAdapter->ClearBltQueue();
     
     m_pStateMutex->Lock();
@@ -803,8 +834,9 @@
     m_pClockSource->Stop();
     m_pStateMutex->Unlock();
 
-    HX_ASSERT( m_pTimeSyncSmoother );
+    HX_ASSERT( m_pTimeSyncSmoother );
     m_pTimeSyncSmoother->ClearBaseTimeFlag();
+
     MDFVIDEOLOG_RETURNFN( "OnPreSeek", retVal );
     
     return retVal;
@@ -812,9 +844,11 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnPostSeek( UINT32 ulOldTime, UINT32 ulNewTime )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPostSeek" )
-        
+    MDFVIDEOLOG_ENTERFN( "OnPostSeek" );
+    MDFVIDEOLOG_WRITE_MULTI_FORMAT( "    old time: %d, new time: %d", ulOldTime, ulNewTime );
+    
     HX_RESULT retVal = HXR_OK;
+
     HX_ASSERT( m_pTimeSyncSmoother );
     m_pTimeSyncSmoother->SetBaseTime(ulNewTime);
     m_pTimeSyncSmoother->SetBaseTimeFlag();
@@ -823,14 +857,14 @@
     playBackPositionInt64 *= TInt64( 1000 );  //change to MicroSecond from MilliSecond
     TTimeIntervalMicroSeconds playBackPosition( playBackPositionInt64 );
     HX_ASSERT( m_pMdfVideoAdapter );
-
-    HX_ASSERT( m_pMdfVideoAdapter );
-    m_pMdfVideoAdapter->ClearBltQueue();
+
+    HX_ASSERT( m_pMdfVideoAdapter );
+    m_pMdfVideoAdapter->ClearBltQueue();
     retVal = m_pMdfVideoAdapter->SetVideoTimePosition( playBackPosition );
 
-    HX_ASSERT( m_pMdfPayloadFormat );
-    m_pMdfPayloadFormat->Reset( ulNewTime );
-    
+    HX_ASSERT( m_pMdfPayloadFormat );
+    m_pMdfPayloadFormat->Reset( ulNewTime );
+    
     m_pStateMutex->Lock();
     m_PlayState = PlayStarting;
     m_pClockSource->Stop();
@@ -843,19 +877,20 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnPause( UINT32 ulTime )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPause" )
-        
+    MDFVIDEOLOG_ENTERFN( "OnPause" );
+    MDFVIDEOLOG_WRITE_FORMAT( "    pause time: %d", ulTime );
+    
     HX_RESULT retVal = HXR_FAIL;
     if( m_pMdfVideoAdapter )
     {
         retVal = m_pMdfVideoAdapter->VideoPause();
     }
-
+    
     m_pStateMutex->Lock();
     m_PlayState = Paused;
     m_pClockSource->Stop();
     m_pStateMutex->Unlock();
-
+    
     MDFVIDEOLOG_RETURNFN( "OnPause", retVal );
     
     return retVal;
@@ -863,18 +898,20 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnBegin( UINT32 ulTime )
 {
-    MDFVIDEOLOG_ENTERFN( "OnBegin" )
+    MDFVIDEOLOG_ENTERFN( "OnBegin" );
+    MDFVIDEOLOG_WRITE_FORMAT( "    begin time: %d", ulTime );
         
     HX_RESULT retVal = HXR_OK;
-    
-    m_ulBeginTime = ulTime;
-
-    if( m_PlayState == Seeking || m_PlayState == Paused )
-    {
-        retVal = m_pMdfVideoAdapter->VideoResume();
-    }    
-
+    
+    m_ulBeginTime = ulTime;
+
+    if( m_PlayState == Seeking || m_PlayState == Paused )
+    {
+        retVal = m_pMdfVideoAdapter->VideoResume();
+    }
+
     m_pStateMutex->Lock();
+
     // If we are seeking, PostSeek will notify us when the play
     // will be starting
     if( m_PlayState != Seeking )
@@ -882,7 +919,7 @@
         m_PlayState = PlayStarting;
         m_pClockSource->Stop();
     }
-
+    
     m_pTimeSyncSmoother->ResetSampleCounts();
     m_pStateMutex->Unlock();
     MDFVIDEOLOG_RETURNFN( "OnBegin", retVal );
@@ -892,14 +929,15 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnBuffering(UINT32 ulFlags, UINT16 unPercentComplete)
 {
-    MDFVIDEOLOG_ENTERFN( "OnBuffering" )
-        
+    MDFVIDEOLOG_ENTERFN( "OnBuffering" );
+    MDFVIDEOLOG_WRITE_MULTI_FORMAT( "Flags: %d,  PercentComplete %d", ulFlags, unPercentComplete );
+    
     if( m_PlayState == Playing )
     {
         m_PlayState = PlayStarting;
         m_pClockSource->Stop();
     }
-
+    
     HX_RESULT retVal = HXR_OK;
     
     MDFVIDEOLOG_RETURNFN( "OnBuffering", retVal );
@@ -908,10 +946,10 @@
 }
 
 STDMETHODIMP CMdfVideoRenderer::GetDisplayType( REF(HX_DISPLAY_TYPE) ulFlags,
-    REF(IHXBuffer*) pBuffer )
+                                               REF(IHXBuffer*) pBuffer )
 {
-    MDFVIDEOLOG_ENTERFN( "GetDisplayType" )
-        
+    MDFVIDEOLOG_ENTERFN( "GetDisplayType" );
+    
     HX_RESULT retVal = HXR_OK;
     ulFlags = HX_DISPLAY_WINDOW |
         HX_DISPLAY_SUPPORTS_RESIZE;
@@ -923,7 +961,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnEndofPackets()
 {
-    MDFVIDEOLOG_ENTERFN( "OnEndofPackets" )
+    MDFVIDEOLOG_ENTERFN( "OnEndofPackets" );
     MDFVIDEOLOG_LEAVEFN( "OnEndofPackets" );
     
     return HXR_OK;
@@ -934,16 +972,16 @@
 /////////////////////////////////////////////////////////////////////
 STDMETHODIMP CMdfVideoRenderer::AttachSite( IHXSite* pSite )
 {
-    MDFVIDEOLOG_ENTERFN( "AttachSite" )
-        
+    MDFVIDEOLOG_ENTERFN2( "AttachSite" );
+    
     HX_RESULT retVal = HXR_OK;
     HX_ASSERT( pSite );
     m_pSite = pSite;
     m_pSite->AddRef();
-
+    
     HX_ASSERT( m_pMdfVideoAdapter );
     m_pMdfVideoAdapter->AttachSite( m_pSite );
-    MDFVIDEOLOG_RETURNFN( "AttachSite", retVal );
+    MDFVIDEOLOG_RETURNFN2( "AttachSite", retVal );
     
     return retVal;
 }
@@ -951,13 +989,13 @@
 
 STDMETHODIMP CMdfVideoRenderer::DetachSite()
 {
-    MDFVIDEOLOG_ENTERFN( "DetachSite" )
-        
+    MDFVIDEOLOG_ENTERFN2( "DetachSite" );
+    
     HX_RESULT retVal = HXR_OK;
     HX_ASSERT( m_pMdfVideoAdapter );
     m_pMdfVideoAdapter->DetachSite();
     HX_RELEASE( m_pSite );
-    MDFVIDEOLOG_RETURNFN( "DetachSite", retVal );
+    MDFVIDEOLOG_RETURNFN2( "DetachSite", retVal );
     
     return retVal;
 }
@@ -965,17 +1003,17 @@
 
 STDMETHODIMP CMdfVideoRenderer::HandleEvent( HXxEvent* pEvent )
 {
-    MDFVIDEOLOG_ENTERFN( "HandleEvent" )
+    MDFVIDEOLOG_ENTERFN4( "HandleEvent" );
     HX_RESULT retVal = HXR_OK;
     
-    MDFVIDEOLOG_RETURNFN( "HandleEvent", retVal );
+    MDFVIDEOLOG_RETURNFN4( "HandleEvent", retVal );
     
     return retVal;
 }
 
 STDMETHODIMP_(HXBOOL) CMdfVideoRenderer::NeedsWindowedSites()
 {
-    MDFVIDEOLOG_ENTERFN( "NeedsWindowedSites" )
+    MDFVIDEOLOG_ENTERFN( "NeedsWindowedSites" );
     HXBOOL retVal = FALSE;
     
     MDFVIDEOLOG_RETURNFN( "NeedsWindowedSites", retVal );
@@ -988,42 +1026,42 @@
 /////////////////////////////////////////////////////////////////////
 STDMETHODIMP CMdfVideoRenderer::OnPaceStart( UINT32 ulId )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPaceStart" )
-        
+    MDFVIDEOLOG_ENTERFN2( "OnPaceStart" );
+    
     if( ulId == m_ulBltrPacemakerId )
     {
         m_bIsThreadRunning = TRUE;
     }
-        
-    MDFVIDEOLOG_LEAVEFN( "OnPaceStart" )
-            
+    
+    MDFVIDEOLOG_LEAVEFN2( "OnPaceStart" );
+    
     return HXR_OK;
 }
 
 STDMETHODIMP CMdfVideoRenderer::OnPace( UINT32 ulId )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPace" )
-        
+    MDFVIDEOLOG_ENTERFN4( "OnPace" );
+    
     HX_RESULT retVal = HXR_OK;
     if ( ulId == m_ulBltrPacemakerId )
     {
         retVal = m_pMdfVideoAdapter->Blt();
     }
-    MDFVIDEOLOG_RETURNFN( "OnPace", retVal );
+    MDFVIDEOLOG_RETURNFN4( "OnPace", retVal );
     
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoRenderer::OnPaceEnd( UINT32 ulId )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPaceEnd" )
-        
+    MDFVIDEOLOG_ENTERFN2( "OnPaceEnd" );
+    
     HX_RESULT retVal = HXR_OK;
     if( ulId == m_ulBltrPacemakerId )
     {
         m_bIsThreadRunning = FALSE;
     }
-    MDFVIDEOLOG_RETURNFN( "OnPaceEnd", retVal );
+    MDFVIDEOLOG_RETURNFN2( "OnPaceEnd", retVal );
     
     return retVal;
 }
@@ -1033,8 +1071,8 @@
 /////////////////////////////////////////////////////////////////////
 STDMETHODIMP CMdfVideoRenderer::UpdatePacketTimeOffset( INT32 lTimeOffset )
 {
-    MDFVIDEOLOG_ENTERFN( "UpdatePacketTimeOffset" )
-        
+    MDFVIDEOLOG_ENTERFN( "UpdatePacketTimeOffset" );
+    
     HX_RESULT retVal = HXR_OK;
     if( m_pTimeSyncSmoother )
     {
@@ -1047,7 +1085,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::UpdatePlayTimes( IHXValues* pProps )
 {
-    MDFVIDEOLOG_ENTERFN( "UpdatePlayTimes" )
+    MDFVIDEOLOG_ENTERFN( "UpdatePlayTimes" );
     HX_RESULT retVal = HXR_OK;
     
     MDFVIDEOLOG_RETURNFN( "UpdatePlayTimes", retVal );
@@ -1061,7 +1099,7 @@
 #ifdef HELIX_FEATURE_PLAYBACK_VELOCITY
 STDMETHODIMP CMdfVideoRenderer::InitVelocityControl( THIS_ IHXPlaybackVelocityResponse* pResponse )
 {
-    MDFVIDEOLOG_ENTERFN( "InitVelocityControl" )
+    MDFVIDEOLOG_ENTERFN( "InitVelocityControl" );
     HX_RESULT retVal = HXR_NOTIMPL;
     MDFVIDEOLOG_RETURNFN( "InitVelocityControl", retVal );
     
@@ -1070,7 +1108,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::QueryVelocityCaps( THIS_ REF(IHXPlaybackVelocityCaps*) rpCaps )
 {
-    MDFVIDEOLOG_ENTERFN( "QueryVelocityCaps" )
+    MDFVIDEOLOG_ENTERFN( "QueryVelocityCaps" );
     HX_RESULT retVal = HXR_NOTIMPL;
     MDFVIDEOLOG_RETURNFN( "QueryVelocityCaps", retVal );
     
@@ -1079,7 +1117,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::SetVelocity( THIS_ INT32 lVelocity, HXBOOL bKeyFrameMode, HXBOOL bAutoSwitch )
 {
-    MDFVIDEOLOG_ENTERFN( "SetVelocity" )
+    MDFVIDEOLOG_ENTERFN( "SetVelocity" );
     HX_RESULT retVal = HXR_NOTIMPL;
     MDFVIDEOLOG_RETURNFN( "SetVelocity", retVal );
     
@@ -1088,7 +1126,7 @@
 
 STDMETHODIMP_(INT32) CMdfVideoRenderer::GetVelocity( THIS )
 {
-    MDFVIDEOLOG_ENTERFN( "GetVelocity" )
+    MDFVIDEOLOG_ENTERFN( "GetVelocity" );
     INT32 retVal = 0;
     MDFVIDEOLOG_RETURNFN( "GetVelocity", retVal );
     
@@ -1097,7 +1135,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::SetKeyFrameMode( THIS_ HXBOOL bKeyFrameMode )
 {
-    MDFVIDEOLOG_ENTERFN( "SetKeyFrameMode" )
+    MDFVIDEOLOG_ENTERFN( "SetKeyFrameMode" );
     HX_RESULT retVal = HXR_NOTIMPL;
     MDFVIDEOLOG_RETURNFN( "SetKeyFrameMode", retVal );
     
@@ -1106,7 +1144,7 @@
 
 STDMETHODIMP_(HXBOOL) CMdfVideoRenderer::GetKeyFrameMode( THIS )
 {
-    MDFVIDEOLOG_ENTERFN( "GetKeyFrameMode" )
+    MDFVIDEOLOG_ENTERFN( "GetKeyFrameMode" );
     HXBOOL retVal = FALSE;
     MDFVIDEOLOG_RETURNFN( "GetKeyFrameMode", retVal );
     
@@ -1115,7 +1153,7 @@
 
 STDMETHODIMP_(UINT32) CMdfVideoRenderer::GetKeyFrameInterval( THIS ) 
 {
-    MDFVIDEOLOG_ENTERFN( "GetKeyFrameInterval" )
+    MDFVIDEOLOG_ENTERFN( "GetKeyFrameInterval" );
     UINT32 retVal = 0;
     MDFVIDEOLOG_RETURNFN( "GetKeyFrameInterval", retVal );
     
@@ -1124,7 +1162,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::CloseVelocityControl( THIS )
 {
-    MDFVIDEOLOG_ENTERFN( "CloseVelocityControl" )
+    MDFVIDEOLOG_ENTERFN( "CloseVelocityControl" );
     HX_RESULT retVal = HXR_NOTIMPL;
     MDFVIDEOLOG_RETURNFN( "CloseVelocityControl", retVal );
     
@@ -1135,10 +1173,10 @@
 // IHXMediaPushdown  //
 /////////////////////////////////////////////////////////////////////
 STDMETHODIMP CMdfVideoRenderer::GetCurrentPushdown( THIS_
-    REF(UINT32) ulPushdownMS,
-    REF(UINT32) ulNumFrames )
+                                                   REF(UINT32) ulPushdownMS,
+                                                   REF(UINT32) ulNumFrames )
 {
-    MDFVIDEOLOG_ENTERFN( "GetCurrentPushdown" )
+    MDFVIDEOLOG_ENTERFN( "GetCurrentPushdown" );
     ulPushdownMS = MDF_RENDERER_PUSHDOWN_TIME;
     ulNumFrames  = MDF_RENDERER_PUSHDOWN_FRAME;
     HX_RESULT retVal = HXR_OK;
@@ -1149,7 +1187,7 @@
 
 STDMETHODIMP_(HXBOOL) CMdfVideoRenderer::IsG2Video( THIS )
 {
-    MDFVIDEOLOG_ENTERFN( "IsG2Video" )
+    MDFVIDEOLOG_ENTERFN( "IsG2Video" );
     HXBOOL retVal = FALSE;
     MDFVIDEOLOG_RETURNFN( "IsG2Video", retVal );
     


From jwei at helixcommunity.org  Wed Feb  1 09:30:50 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:46:30 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvidrend.cpp,1.5,1.6
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv7761

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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfvidrend.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mdfvidrend.cpp	31 Jan 2006 20:59:47 -0000	1.5
+++ mdfvidrend.cpp	1 Feb 2006 17:30:47 -0000	1.6
@@ -66,8 +66,6 @@
 const char* const CMdfVideoRenderer::zm_pCopyright      = "Nokia Inc, 2005";
 const char* const CMdfVideoRenderer::zm_pMoreInfoURL    = "http://www.helixcommunity.org\0";
 
-MDFVIDEOLOG_CLASSNAME( "CMdfVideoRenderer" )
-
 CMdfVideoRenderer::CMdfVideoRenderer()
 : CHXBaseCountingObject(),
   m_pContext( NULL ),
@@ -100,18 +98,19 @@
   m_ulBufferingStopTime( 0 ),
   m_ulBytesToBuffer( 0 ),
   m_bIsThreadRunning( FALSE ),
-  m_PlayState(Stopped),
+  m_PlayState(Stopped),
   m_ulBeginTime( 0 )
 {
-    MDFVIDEOLOG_CREATE_NOWRITE
-    MDFVIDEOLOG_ENTERFN( "CMdfVideoRenderer" )
-    MDFVIDEOLOG_LEAVEFN( "CMdfVideoRenderer" )
+    MDFVIDEOLOG_CREATE_NOWRITE;
+    MDFVIDEOLOG_CLASSNAME( "CMdfVideoRenderer" );
+    MDFVIDEOLOG_ENTERFN( "CMdfVideoRenderer" );
+    MDFVIDEOLOG_LEAVEFN( "CMdfVideoRenderer" );
 }
 
 CMdfVideoRenderer::~CMdfVideoRenderer()
 {
-    MDFVIDEOLOG_ENTERFN( "~CMdfVideoRenderer" )
-
+    MDFVIDEOLOG_ENTERFN( "~CMdfVideoRenderer" );
+    
     UINT16 index = 0;
     while( zm_pStreamMimeTypes != NULL && zm_pStreamMimeTypes[index] != NULL )
     {
@@ -129,8 +128,8 @@
     HX_RELEASE( m_pContext );
     HX_DELETE( m_pStateMutex );
     
-    MDFVIDEOLOG_LEAVEFN( "~CMdfVideoRenderer" )
-    MDFVIDEOLOG_DELETE
+    MDFVIDEOLOG_LEAVEFN( "~CMdfVideoRenderer" );
+    MDFVIDEOLOG_DELETE;
 }
 
 HX_RESULT STDAPICALLTYPE CMdfVideoRenderer::HXCreateInstance(IUnknown** ppIUnknown)
@@ -162,7 +161,7 @@
 /////////////////////////////////////////////////////////////////////
 STDMETHODIMP CMdfVideoRenderer::QueryInterface( THIS_ REFIID riid, void** ppvObj )
 {
-    MDFVIDEOLOG_ENTERFN( "QueryInterface" )
+    MDFVIDEOLOG_ENTERFN( "QueryInterface" );
     QInterfaceList  qiList[] =
     {
         { GET_IIDHANDLE( IID_IUnknown ),    ( IUnknown* )( IHXPlugin* ) this },
@@ -179,13 +178,13 @@
     
     if( QIFind( qiList, QILISTSIZE(qiList), riid, ppvObj ) == HXR_OK )
     {
-        MDFVIDEOLOG_LEAVEFN( "QueryInterface" )
+        MDFVIDEOLOG_LEAVEFN( "QueryInterface" );
         return HXR_OK ;
     }
     else
     {
         *ppvObj = NULL;
-        MDFVIDEOLOG_LEAVEFN( "QueryInterface" )
+        MDFVIDEOLOG_LEAVEFN( "QueryInterface" );
         return HXR_NOINTERFACE;
     }
 }
@@ -218,7 +217,7 @@
  REF(UINT32)      ulVersionNumber
  )
 {
-    MDFVIDEOLOG_ENTERFN( "GetPluginInfo" )
+    MDFVIDEOLOG_ENTERFN( "GetPluginInfo" );
     bLoadMultiple = TRUE;   // Must be true for file formats.
     
     pDescription    = zm_pDescription;
@@ -226,24 +225,24 @@
     pMoreInfoURL    = zm_pMoreInfoURL;
     ulVersionNumber = MDFVER_ULONG32_VERSION;
     
-    MDFVIDEOLOG_LEAVEFN( "GetPluginInfo" )
-        
+    MDFVIDEOLOG_LEAVEFN( "GetPluginInfo" );
+    
     return HXR_OK;
 }
 
 STDMETHODIMP CMdfVideoRenderer::InitPlugin( IUnknown* pContext )
 {
-    MDFVIDEOLOG_ENTERFN( "InitPlugin" )
-
+    MDFVIDEOLOG_ENTERFN2( "InitPlugin" );
+    
     HX_ASSERT( pContext );
-
+    
     MDF_ENABLE_LOGGING( pContext );
-        
+    
     HX_RESULT retVal = HXR_OK;
     HX_ASSERT( m_pContext == NULL );
     m_pContext = pContext;
     m_pContext->AddRef();
-
+    
     if( SUCCEEDED(retVal) && !m_pStateMutex )
     {
 #ifdef THREADS_SUPPORTED
@@ -252,7 +251,7 @@
         retVal = HXMutex::MakeStubMutex( m_pStateMutex );
 #endif  // THREADS_SUPPORTED
     }
-
+    
     if( SUCCEEDED( retVal ) )
     {
         HX_ASSERT( m_pMdfVideoAdapter == NULL );
@@ -280,7 +279,7 @@
         {
             retVal = HXR_OUTOFMEMORY;
         }
-
+        
     }
     
     if ( SUCCEEDED( retVal ) )    // Create the timesync smoother
@@ -310,7 +309,7 @@
             retVal = HXR_OUTOFMEMORY;
         }
     }
-
+    
     if( FAILED( retVal ) )
     {
         HX_RELEASE( m_pMdfVideoAdapter );
@@ -319,8 +318,8 @@
         HX_DELETE(  m_pClockSource );
         HX_RELEASE( m_pContext );
     }
-        
-    MDFVIDEOLOG_RETURNFN( "InitPlugin", retVal );
+    
+    MDFVIDEOLOG_RETURNFN2( "InitPlugin", retVal );
     
     return retVal;
 }
@@ -334,8 +333,8 @@
  REF(UINT32)       unInitialGranularity
  )
 {
-    MDFVIDEOLOG_ENTERFN( "GetRendererInfo" )
-        
+    MDFVIDEOLOG_ENTERFN2( "GetRendererInfo" );
+    
     HX_RESULT retVal = HXR_OK;
     
     if( m_bMimeTypeSearched != TRUE )
@@ -373,26 +372,26 @@
     
     unInitialGranularity = SYNC_INTERVAL;
     
-    MDFVIDEOLOG_RETURNFN( "GetRendererInfo", retVal );
+    MDFVIDEOLOG_RETURNFN2( "GetRendererInfo", retVal );
     
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoRenderer::StartStream( IHXStream* pStream, IHXPlayer* pPlayer )
 {
-    MDFVIDEOLOG_ENTERFN( "StartStream" )
-        
+    MDFVIDEOLOG_ENTERFN2( "StartStream" );
+    
     HX_RESULT retVal = HXR_OK;
     
     if( !pStream )
     {
         retVal = HXR_FAIL;
     }
-
+    
     HX_ASSERT( pStream );
     HX_ASSERT( m_pStream == NULL );
     HX_ASSERT( m_pBltrPump == NULL );
-
+    
     if( SUCCEEDED( retVal ) )
     {
         m_pStream = pStream;
@@ -418,9 +417,9 @@
             if( SUCCEEDED( retVal ) )
             {
                 retVal = m_pBltrPump->Start( this,
-                                    DFLT_PRESENT_PRIORITY,
-                                    BLTR_INTERVAL,
-                                    m_ulBltrPacemakerId );
+                    DFLT_PRESENT_PRIORITY,
+                    BLTR_INTERVAL,
+                    m_ulBltrPacemakerId );
             }
             else
             {
@@ -429,24 +428,24 @@
         }
         HX_RELEASE( pVideoPaceMaker );
     }
-
+    
     if( FAILED( retVal ) )
     {
         HX_RELEASE( m_pStream );
         HX_RELEASE( m_pBltrPump );
     }
-
-    MDFVIDEOLOG_RETURNFN( "StartStream", retVal );
+    
+    MDFVIDEOLOG_RETURNFN2( "StartStream", retVal );
     
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoRenderer::EndStream( THIS )
 {
-    MDFVIDEOLOG_ENTERFN( "EndStream" )
+    MDFVIDEOLOG_ENTERFN2( "EndStream" );
 
     HX_RESULT retVal = HXR_OK;
-        
+        
     if( m_pMdfVideoAdapter )
     {
         retVal = m_pMdfVideoAdapter->VideoEnd();
@@ -461,24 +460,24 @@
         m_pBltrPump->Signal();
         m_pBltrPump->WaitForStop();
         HX_RELEASE( m_pBltrPump );
-    }
-
-    m_pStateMutex->Lock();
-    m_PlayState = Stopped;
-    m_pStateMutex->Unlock();
-
+    }
+
+    m_pStateMutex->Lock();
+    m_PlayState = Stopped;
+    m_pStateMutex->Unlock();
+
     HX_RELEASE( m_pHeader );
     HX_RELEASE( m_pStream );
     
-    MDFVIDEOLOG_LEAVEFN( "EndStream" )
-        
+    MDFVIDEOLOG_LEAVEFN2( "EndStream" );
+    
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoRenderer::OnHeader( IHXValues* pHeader )
 {
-    MDFVIDEOLOG_ENTERFN( "OnHeader" )
-        
+    MDFVIDEOLOG_ENTERFN2( "OnHeader" );
+    
     HX_RESULT retVal = HXR_OK;
     
     if( !pHeader )
@@ -492,13 +491,13 @@
         m_pHeader = pHeader;
         m_pHeader->AddRef();
     }
-
+    
 #ifdef HELIX_FEATURE_VIDEO_ENFORCE_MAX_FRAMESIZE
     if( SUCCEEDED( retVal ) && m_pContext )
     {
         IHXPreferences* pPreferences = NULL;
         retVal = m_pContext->QueryInterface( IID_IHXPreferences, 
-                                             (void**) &pPreferences );
+            (void**) &pPreferences );
         
         if( SUCCEEDED( retVal ) )
         {
@@ -520,7 +519,8 @@
                     ULONG32 currentVidArea = (ULONG32) ( ulFrameWidth * ulFrameHeight );
                     if( currentVidArea > ulMaxVidArea )
                     {
-                        retVal = HXR_SLOW_MACHINE;
+                        retVal = HXR_SLOW_MACHINE;
+                        MDFVIDEOLOG_INOUTFN2( "HXR_SLOW_MACHINE" );
                     }
                 }
             }
@@ -528,7 +528,7 @@
         HX_RELEASE( pPreferences );
     }
 #endif 
-
+    
     
     IHXBuffer* pMimeType = NULL;
     const char* pMimeTypeData = NULL;
@@ -541,7 +541,9 @@
     
     if ( SUCCEEDED( retVal ) )
     {
-        pMimeTypeData = (char*) pMimeType->GetBuffer();
+        pMimeTypeData = (char*) pMimeType->GetBuffer();
+        MDFVIDEOLOG_WRITE_FORMAT2( "<-> Mimetype is %s", pMimeTypeData );
+        
         if( pMimeTypeData && m_pCurrentMimetype )
         {
             if( !strcmp( pMimeTypeData, m_pCurrentMimetype ) )
@@ -607,11 +609,13 @@
             TBool valid = EFalse;
             TRAPD( error2, valid = m_pPluginManager->GetIdsByMimeTypeL( *package ) );
             if( valid && error2 == KErrNone )
-            {
+            {
+                MDFVIDEOLOG_INOUTFN2( "PluginManager has package ready for this mimetype" );
                 retVal = HXR_OK;
             }
             else
             {
+                MDFVIDEOLOG_INOUTFN2( "PluginManager does not have package for this mimetype" );
                 retVal = HXR_NOTIMPL;
             }
         }
@@ -623,42 +627,45 @@
         HX_DELETE( m_pMdfPayloadFormat );
         TRAPD( error, m_pMdfPayloadFormat = CPayloadFormatPluginDevice::NewL( formatId ) );
         if( m_pMdfPayloadFormat && error == KErrNone )
-        {
+        {
+            MDFVIDEOLOG_WRITE_FORMAT2( "    Payload id 0x%08x is successfully loaded", formatId.iUid );
+            
             UINT32 ulPreroll = m_pMdfPayloadFormat->GetPreRollInMs();
             pHeader->SetPropertyULONG32( "Preroll", ulPreroll );
             retVal = HXR_OK;
         }
         else
         {
+            MDFVIDEOLOG_WRITE_FORMAT2( "    Payload id 0x%08x is failed to be loaded", formatId.iUid );
             retVal = HXR_OUTOFMEMORY;
         }
     }
-
+    
     if ( SUCCEEDED( retVal ) )
     {
         retVal = m_pMdfPayloadFormat->Init( m_pContext, m_pHeader );
     }
-
+    
     if( SUCCEEDED( retVal ) )
     {
         //do not destroy streamHeader
         const TDesC8* streamHeader = m_pMdfPayloadFormat->GetBitstreamHeader();
-
+        
         TVideoDataUnitType unitType = m_pMdfPayloadFormat->GetVideoDataUnitType();
         TVideoDataUnitEncapsulation unitEncapsulation = m_pMdfPayloadFormat->GetVideoDataUnitEncapsulation();
         
         package->SetVideoDataUnitType( unitType );
         package->SetVideoDataUnitEncapsulation( unitEncapsulation );
-
+        
         retVal = m_pMdfVideoAdapter->Init( *package, m_pClockSource, streamHeader, m_pMdfPayloadFormat, m_pContext );
     }
-        
+    
     HX_DELETE( package );
-        
+    
     if( FAILED( retVal ) )
     {
         HX_RELEASE( m_pHeader );
-
+        
         if( m_pCurrentMimetype )
         {
             delete  m_pCurrentMimetype;
@@ -671,17 +678,18 @@
         HX_DELETE( m_pMdfPayloadFormat );
     }
     
-    MDFVIDEOLOG_RETURNFN( "OnHeader", retVal );
+    MDFVIDEOLOG_RETURNFN2( "OnHeader", retVal );
     
     return retVal;
 }
-    
+
 STDMETHODIMP CMdfVideoRenderer::OnPacket( IHXPacket* pPacket, INT32 lTimeOffset )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPacket" )
-
+    MDFVIDEOLOG_ENTERFN4( "OnPacket" );
+    MDFVIDEOLOG_WRITE_FORMAT4( "    packet time: %d", pPacket->GetTime() );
+    
     HX_RESULT retVal = HXR_OK;
-
+    
     if( m_pTimeSyncSmoother )
     {
         m_pTimeSyncSmoother->SetTimelineOffset( lTimeOffset );
@@ -705,18 +713,21 @@
         retVal = m_pMdfPayloadFormat->GetLastError();
         if( FAILED( retVal ) && pMediaPckt )
         {
+            MDFVIDEOLOG_INOUTFN4( "Packet is deleted" );
             pMediaPckt->Clear();
             HX_DELETE( pMediaPckt );
         }
     }
     
     while( pMediaPckt && SUCCEEDED( retVal ) )
-    {
+    {
+        MDFVIDEOLOG_WRITE_FORMAT4( "    MediaPckt time: %d", pMediaPckt->m_ulTime );
+
 //      if( m_PlayState != Seeking && m_ulBeginTime <= pMediaPckt->m_ulTime )
 		if( m_PlayState != Seeking ) //&& m_ulBeginTime <= pMediaPckt->m_ulTime )
-		{
-            //m_PlayState is Seeking between OnPreSeek() and OnPostSeek
-            //pMediaPckt->m_ulTime is significantly smaller (upto 2 second)
+		{
+            //m_PlayState is Seeking between OnPreSeek() and OnPostSeek
+            //pMediaPckt->m_ulTime is significantly smaller (upto 2 second)
             //than m_ulBeginTime between OnBegin() and OnPostSeek()
 			m_pMdfVideoAdapter->OnVideoPacket( pMediaPckt );
 		}
@@ -741,7 +752,6 @@
         
         if( SUCCEEDED( retVal ) )
         {
-            //to flush out other packets, in MP4, not in H263
             pMediaPckt = m_pMdfPayloadFormat->CreateAssembledPacket( NULL );
             retVal = m_pMdfPayloadFormat->GetLastError();
             if( FAILED( retVal ) && pMediaPckt )
@@ -751,36 +761,56 @@
             }
         }
     }
-
-    MDFVIDEOLOG_RETURNFN( "OnPacket", retVal );
+    
+    MDFVIDEOLOG_RETURNFN4( "OnPacket", retVal );
     
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoRenderer::OnTimeSync( THIS_ UINT32 ulTime )
 {    
-    MDFVIDEOLOG_ENTERFN( "OnTimeSync" )
-        
+    MDFVIDEOLOG_ENTERFN( "OnTimeSync" );
+    
     HX_RESULT retVal = HXR_OK;
     HX_ASSERT( m_pTimeSyncSmoother );
-    HX_ASSERT( m_pClockSource );
+    HX_ASSERT( m_pClockSource );
+    MDFVIDEOLOG_WRITE_FORMAT( "    CurrentTime from OnTimeSync is %d", ulTime );
+    
+    TInt currentTime = 0;
+    
+#ifdef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
+    currentTime = (TInt) ((m_pClockSource->Time()).Int64()/1000);
+#else
+    currentTime = ((m_pClockSource->Time()).Int64()/1000).Low();
+#endif
+    
+    MDFVIDEOLOG_WRITE_FORMAT( "    CurrentTime from ClockSource before updating is %d", currentTime );
+    
     m_pTimeSyncSmoother->OnTimeSync(ulTime);
-
+    
+#ifdef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
+    currentTime = (TInt) ((m_pClockSource->Time()).Int64()/1000);
+#else
+    currentTime = ((m_pClockSource->Time()).Int64()/1000).Low();
+#endif
+    
+    MDFVIDEOLOG_WRITE_FORMAT( "    CurrentTime from ClockSource  after updating is %d", currentTime );
+    
     if( m_PlayState == PlayStarting )
     {
         m_pStateMutex->Lock();
         m_pTimeSyncSmoother->SetBaseTimeFlag();
-
+        
         // Reset the offset to avoid race condition
         // with m_ulTimeNormalizationOffset setting in OnPacket()
         if( m_pTimeSyncSmoother->WasLastSampleGood() )
         {
             m_pTimeSyncSmoother->ResetOffset();
         }
-
+        
         m_PlayState = Playing;
         m_pClockSource->Start();
-
+        
         m_pStateMutex->Unlock();
     }
     
@@ -791,11 +821,12 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnPreSeek( UINT32 ulOldTime, UINT32 ulNewTime )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPreSeek" )
+    MDFVIDEOLOG_ENTERFN( "OnPreSeek" );
+    MDFVIDEOLOG_WRITE_MULTI_FORMAT( "    old time: %d, new time: %d", ulOldTime, ulNewTime );
     
     HX_RESULT retVal = HXR_OK;
-
-    HX_ASSERT( m_pMdfVideoAdapter );
+
+    HX_ASSERT( m_pMdfVideoAdapter );
     m_pMdfVideoAdapter->ClearBltQueue();
     
     m_pStateMutex->Lock();
@@ -803,8 +834,9 @@
     m_pClockSource->Stop();
     m_pStateMutex->Unlock();
 
-    HX_ASSERT( m_pTimeSyncSmoother );
+    HX_ASSERT( m_pTimeSyncSmoother );
     m_pTimeSyncSmoother->ClearBaseTimeFlag();
+
     MDFVIDEOLOG_RETURNFN( "OnPreSeek", retVal );
     
     return retVal;
@@ -812,9 +844,11 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnPostSeek( UINT32 ulOldTime, UINT32 ulNewTime )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPostSeek" )
-        
+    MDFVIDEOLOG_ENTERFN( "OnPostSeek" );
+    MDFVIDEOLOG_WRITE_MULTI_FORMAT( "    old time: %d, new time: %d", ulOldTime, ulNewTime );
+    
     HX_RESULT retVal = HXR_OK;
+
     HX_ASSERT( m_pTimeSyncSmoother );
     m_pTimeSyncSmoother->SetBaseTime(ulNewTime);
     m_pTimeSyncSmoother->SetBaseTimeFlag();
@@ -823,14 +857,14 @@
     playBackPositionInt64 *= TInt64( 1000 );  //change to MicroSecond from MilliSecond
     TTimeIntervalMicroSeconds playBackPosition( playBackPositionInt64 );
     HX_ASSERT( m_pMdfVideoAdapter );
-
-    HX_ASSERT( m_pMdfVideoAdapter );
-    m_pMdfVideoAdapter->ClearBltQueue();
+
+    HX_ASSERT( m_pMdfVideoAdapter );
+    m_pMdfVideoAdapter->ClearBltQueue();
     retVal = m_pMdfVideoAdapter->SetVideoTimePosition( playBackPosition );
 
-    HX_ASSERT( m_pMdfPayloadFormat );
-    m_pMdfPayloadFormat->Reset( ulNewTime );
-    
+    HX_ASSERT( m_pMdfPayloadFormat );
+    m_pMdfPayloadFormat->Reset( ulNewTime );
+    
     m_pStateMutex->Lock();
     m_PlayState = PlayStarting;
     m_pClockSource->Stop();
@@ -843,19 +877,20 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnPause( UINT32 ulTime )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPause" )
-        
+    MDFVIDEOLOG_ENTERFN( "OnPause" );
+    MDFVIDEOLOG_WRITE_FORMAT( "    pause time: %d", ulTime );
+    
     HX_RESULT retVal = HXR_FAIL;
     if( m_pMdfVideoAdapter )
     {
         retVal = m_pMdfVideoAdapter->VideoPause();
     }
-
+    
     m_pStateMutex->Lock();
     m_PlayState = Paused;
     m_pClockSource->Stop();
     m_pStateMutex->Unlock();
-
+    
     MDFVIDEOLOG_RETURNFN( "OnPause", retVal );
     
     return retVal;
@@ -863,18 +898,20 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnBegin( UINT32 ulTime )
 {
-    MDFVIDEOLOG_ENTERFN( "OnBegin" )
+    MDFVIDEOLOG_ENTERFN( "OnBegin" );
+    MDFVIDEOLOG_WRITE_FORMAT( "    begin time: %d", ulTime );
         
     HX_RESULT retVal = HXR_OK;
-    
-    m_ulBeginTime = ulTime;
-
-    if( m_PlayState == Seeking || m_PlayState == Paused )
-    {
-        retVal = m_pMdfVideoAdapter->VideoResume();
-    }    
-
+    
+    m_ulBeginTime = ulTime;
+
+    if( m_PlayState == Seeking || m_PlayState == Paused )
+    {
+        retVal = m_pMdfVideoAdapter->VideoResume();
+    }
+
     m_pStateMutex->Lock();
+
     // If we are seeking, PostSeek will notify us when the play
     // will be starting
     if( m_PlayState != Seeking )
@@ -882,7 +919,7 @@
         m_PlayState = PlayStarting;
         m_pClockSource->Stop();
     }
-
+    
     m_pTimeSyncSmoother->ResetSampleCounts();
     m_pStateMutex->Unlock();
     MDFVIDEOLOG_RETURNFN( "OnBegin", retVal );
@@ -892,14 +929,15 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnBuffering(UINT32 ulFlags, UINT16 unPercentComplete)
 {
-    MDFVIDEOLOG_ENTERFN( "OnBuffering" )
-        
+    MDFVIDEOLOG_ENTERFN( "OnBuffering" );
+    MDFVIDEOLOG_WRITE_MULTI_FORMAT( "Flags: %d,  PercentComplete %d", ulFlags, unPercentComplete );
+    
     if( m_PlayState == Playing )
     {
         m_PlayState = PlayStarting;
         m_pClockSource->Stop();
     }
-
+    
     HX_RESULT retVal = HXR_OK;
     
     MDFVIDEOLOG_RETURNFN( "OnBuffering", retVal );
@@ -908,10 +946,10 @@
 }
 
 STDMETHODIMP CMdfVideoRenderer::GetDisplayType( REF(HX_DISPLAY_TYPE) ulFlags,
-    REF(IHXBuffer*) pBuffer )
+                                               REF(IHXBuffer*) pBuffer )
 {
-    MDFVIDEOLOG_ENTERFN( "GetDisplayType" )
-        
+    MDFVIDEOLOG_ENTERFN( "GetDisplayType" );
+    
     HX_RESULT retVal = HXR_OK;
     ulFlags = HX_DISPLAY_WINDOW |
         HX_DISPLAY_SUPPORTS_RESIZE;
@@ -923,7 +961,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::OnEndofPackets()
 {
-    MDFVIDEOLOG_ENTERFN( "OnEndofPackets" )
+    MDFVIDEOLOG_ENTERFN( "OnEndofPackets" );
     MDFVIDEOLOG_LEAVEFN( "OnEndofPackets" );
     
     return HXR_OK;
@@ -934,16 +972,16 @@
 /////////////////////////////////////////////////////////////////////
 STDMETHODIMP CMdfVideoRenderer::AttachSite( IHXSite* pSite )
 {
-    MDFVIDEOLOG_ENTERFN( "AttachSite" )
-        
+    MDFVIDEOLOG_ENTERFN2( "AttachSite" );
+    
     HX_RESULT retVal = HXR_OK;
     HX_ASSERT( pSite );
     m_pSite = pSite;
     m_pSite->AddRef();
-
+    
     HX_ASSERT( m_pMdfVideoAdapter );
     m_pMdfVideoAdapter->AttachSite( m_pSite );
-    MDFVIDEOLOG_RETURNFN( "AttachSite", retVal );
+    MDFVIDEOLOG_RETURNFN2( "AttachSite", retVal );
     
     return retVal;
 }
@@ -951,13 +989,13 @@
 
 STDMETHODIMP CMdfVideoRenderer::DetachSite()
 {
-    MDFVIDEOLOG_ENTERFN( "DetachSite" )
-        
+    MDFVIDEOLOG_ENTERFN2( "DetachSite" );
+    
     HX_RESULT retVal = HXR_OK;
     HX_ASSERT( m_pMdfVideoAdapter );
     m_pMdfVideoAdapter->DetachSite();
     HX_RELEASE( m_pSite );
-    MDFVIDEOLOG_RETURNFN( "DetachSite", retVal );
+    MDFVIDEOLOG_RETURNFN2( "DetachSite", retVal );
     
     return retVal;
 }
@@ -965,17 +1003,17 @@
 
 STDMETHODIMP CMdfVideoRenderer::HandleEvent( HXxEvent* pEvent )
 {
-    MDFVIDEOLOG_ENTERFN( "HandleEvent" )
+    MDFVIDEOLOG_ENTERFN4( "HandleEvent" );
     HX_RESULT retVal = HXR_OK;
     
-    MDFVIDEOLOG_RETURNFN( "HandleEvent", retVal );
+    MDFVIDEOLOG_RETURNFN4( "HandleEvent", retVal );
     
     return retVal;
 }
 
 STDMETHODIMP_(HXBOOL) CMdfVideoRenderer::NeedsWindowedSites()
 {
-    MDFVIDEOLOG_ENTERFN( "NeedsWindowedSites" )
+    MDFVIDEOLOG_ENTERFN( "NeedsWindowedSites" );
     HXBOOL retVal = FALSE;
     
     MDFVIDEOLOG_RETURNFN( "NeedsWindowedSites", retVal );
@@ -988,42 +1026,42 @@
 /////////////////////////////////////////////////////////////////////
 STDMETHODIMP CMdfVideoRenderer::OnPaceStart( UINT32 ulId )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPaceStart" )
-        
+    MDFVIDEOLOG_ENTERFN2( "OnPaceStart" );
+    
     if( ulId == m_ulBltrPacemakerId )
     {
         m_bIsThreadRunning = TRUE;
     }
-        
-    MDFVIDEOLOG_LEAVEFN( "OnPaceStart" )
-            
+    
+    MDFVIDEOLOG_LEAVEFN2( "OnPaceStart" );
+    
     return HXR_OK;
 }
 
 STDMETHODIMP CMdfVideoRenderer::OnPace( UINT32 ulId )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPace" )
-        
+    MDFVIDEOLOG_ENTERFN4( "OnPace" );
+    
     HX_RESULT retVal = HXR_OK;
     if ( ulId == m_ulBltrPacemakerId )
     {
         retVal = m_pMdfVideoAdapter->Blt();
     }
-    MDFVIDEOLOG_RETURNFN( "OnPace", retVal );
+    MDFVIDEOLOG_RETURNFN4( "OnPace", retVal );
     
     return retVal;
 }
 
 STDMETHODIMP CMdfVideoRenderer::OnPaceEnd( UINT32 ulId )
 {
-    MDFVIDEOLOG_ENTERFN( "OnPaceEnd" )
-        
+    MDFVIDEOLOG_ENTERFN2( "OnPaceEnd" );
+    
     HX_RESULT retVal = HXR_OK;
     if( ulId == m_ulBltrPacemakerId )
     {
         m_bIsThreadRunning = FALSE;
     }
-    MDFVIDEOLOG_RETURNFN( "OnPaceEnd", retVal );
+    MDFVIDEOLOG_RETURNFN2( "OnPaceEnd", retVal );
     
     return retVal;
 }
@@ -1033,8 +1071,8 @@
 /////////////////////////////////////////////////////////////////////
 STDMETHODIMP CMdfVideoRenderer::UpdatePacketTimeOffset( INT32 lTimeOffset )
 {
-    MDFVIDEOLOG_ENTERFN( "UpdatePacketTimeOffset" )
-        
+    MDFVIDEOLOG_ENTERFN( "UpdatePacketTimeOffset" );
+    
     HX_RESULT retVal = HXR_OK;
     if( m_pTimeSyncSmoother )
     {
@@ -1047,7 +1085,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::UpdatePlayTimes( IHXValues* pProps )
 {
-    MDFVIDEOLOG_ENTERFN( "UpdatePlayTimes" )
+    MDFVIDEOLOG_ENTERFN( "UpdatePlayTimes" );
     HX_RESULT retVal = HXR_OK;
     
     MDFVIDEOLOG_RETURNFN( "UpdatePlayTimes", retVal );
@@ -1061,7 +1099,7 @@
 #ifdef HELIX_FEATURE_PLAYBACK_VELOCITY
 STDMETHODIMP CMdfVideoRenderer::InitVelocityControl( THIS_ IHXPlaybackVelocityResponse* pResponse )
 {
-    MDFVIDEOLOG_ENTERFN( "InitVelocityControl" )
+    MDFVIDEOLOG_ENTERFN( "InitVelocityControl" );
     HX_RESULT retVal = HXR_NOTIMPL;
     MDFVIDEOLOG_RETURNFN( "InitVelocityControl", retVal );
     
@@ -1070,7 +1108,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::QueryVelocityCaps( THIS_ REF(IHXPlaybackVelocityCaps*) rpCaps )
 {
-    MDFVIDEOLOG_ENTERFN( "QueryVelocityCaps" )
+    MDFVIDEOLOG_ENTERFN( "QueryVelocityCaps" );
     HX_RESULT retVal = HXR_NOTIMPL;
     MDFVIDEOLOG_RETURNFN( "QueryVelocityCaps", retVal );
     
@@ -1079,7 +1117,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::SetVelocity( THIS_ INT32 lVelocity, HXBOOL bKeyFrameMode, HXBOOL bAutoSwitch )
 {
-    MDFVIDEOLOG_ENTERFN( "SetVelocity" )
+    MDFVIDEOLOG_ENTERFN( "SetVelocity" );
     HX_RESULT retVal = HXR_NOTIMPL;
     MDFVIDEOLOG_RETURNFN( "SetVelocity", retVal );
     
@@ -1088,7 +1126,7 @@
 
 STDMETHODIMP_(INT32) CMdfVideoRenderer::GetVelocity( THIS )
 {
-    MDFVIDEOLOG_ENTERFN( "GetVelocity" )
+    MDFVIDEOLOG_ENTERFN( "GetVelocity" );
     INT32 retVal = 0;
     MDFVIDEOLOG_RETURNFN( "GetVelocity", retVal );
     
@@ -1097,7 +1135,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::SetKeyFrameMode( THIS_ HXBOOL bKeyFrameMode )
 {
-    MDFVIDEOLOG_ENTERFN( "SetKeyFrameMode" )
+    MDFVIDEOLOG_ENTERFN( "SetKeyFrameMode" );
     HX_RESULT retVal = HXR_NOTIMPL;
     MDFVIDEOLOG_RETURNFN( "SetKeyFrameMode", retVal );
     
@@ -1106,7 +1144,7 @@
 
 STDMETHODIMP_(HXBOOL) CMdfVideoRenderer::GetKeyFrameMode( THIS )
 {
-    MDFVIDEOLOG_ENTERFN( "GetKeyFrameMode" )
+    MDFVIDEOLOG_ENTERFN( "GetKeyFrameMode" );
     HXBOOL retVal = FALSE;
     MDFVIDEOLOG_RETURNFN( "GetKeyFrameMode", retVal );
     
@@ -1115,7 +1153,7 @@
 
 STDMETHODIMP_(UINT32) CMdfVideoRenderer::GetKeyFrameInterval( THIS ) 
 {
-    MDFVIDEOLOG_ENTERFN( "GetKeyFrameInterval" )
+    MDFVIDEOLOG_ENTERFN( "GetKeyFrameInterval" );
     UINT32 retVal = 0;
     MDFVIDEOLOG_RETURNFN( "GetKeyFrameInterval", retVal );
     
@@ -1124,7 +1162,7 @@
 
 STDMETHODIMP CMdfVideoRenderer::CloseVelocityControl( THIS )
 {
-    MDFVIDEOLOG_ENTERFN( "CloseVelocityControl" )
+    MDFVIDEOLOG_ENTERFN( "CloseVelocityControl" );
     HX_RESULT retVal = HXR_NOTIMPL;
     MDFVIDEOLOG_RETURNFN( "CloseVelocityControl", retVal );
     
@@ -1135,10 +1173,10 @@
 // IHXMediaPushdown  //
 /////////////////////////////////////////////////////////////////////
 STDMETHODIMP CMdfVideoRenderer::GetCurrentPushdown( THIS_
-    REF(UINT32) ulPushdownMS,
-    REF(UINT32) ulNumFrames )
+                                                   REF(UINT32) ulPushdownMS,
+                                                   REF(UINT32) ulNumFrames )
 {
-    MDFVIDEOLOG_ENTERFN( "GetCurrentPushdown" )
+    MDFVIDEOLOG_ENTERFN( "GetCurrentPushdown" );
     ulPushdownMS = MDF_RENDERER_PUSHDOWN_TIME;
     ulNumFrames  = MDF_RENDERER_PUSHDOWN_FRAME;
     HX_RESULT retVal = HXR_OK;
@@ -1149,7 +1187,7 @@
 
 STDMETHODIMP_(HXBOOL) CMdfVideoRenderer::IsG2Video( THIS )
 {
-    MDFVIDEOLOG_ENTERFN( "IsG2Video" )
+    MDFVIDEOLOG_ENTERFN( "IsG2Video" );
     HXBOOL retVal = FALSE;
     MDFVIDEOLOG_RETURNFN( "IsG2Video", retVal );
     


From jwei at helixcommunity.org  Wed Feb  1 09:31:04 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:46:42 2006
Subject: [Datatype-cvs] mdf/video/renderer/pub mdfclocksource.h,1.3,1.3.2.1
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer/pub
In directory cvs:/tmp/cvs-serv7781

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfclocksource.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfclocksource.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfclocksource.h,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -d -r1.3 -r1.3.2.1
--- mdfclocksource.h	6 Jan 2006 22:57:10 -0000	1.3
+++ mdfclocksource.h	1 Feb 2006 17:31:02 -0000	1.3.2.1
@@ -53,6 +53,8 @@
 #include 
 #include "smoothtime.h"
 
+#include "mdfgenericlog.h"         //logging
+
 _LIT(KMdfClockSourcePanicCategory, "MdfClockSource");
 
 enum TMdfClockSourcePanicCodes
@@ -75,7 +77,7 @@
 
 
 class CMdfClockSource : public CBase,
-public MMMFClockSource
+                        public MMMFClockSource
 {
 public:
     static CMdfClockSource* NewL( CHXTimeSyncSmoother* pTimeSyncSmoother );
@@ -97,6 +99,7 @@
     CHXTimeSyncSmoother* m_pTimeSyncSmoother;
     TBool                m_bClockStarted;
     
+    MDFVIDEOLOG_DEFINE;
 };
 
 #endif  //_MDFCLOCKSOURCE_H_


From jwei at helixcommunity.org  Wed Feb  1 09:31:15 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:46:53 2006
Subject: [Datatype-cvs] mdf/video/renderer/pub mdfclocksource.h,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer/pub
In directory cvs:/tmp/cvs-serv7805

Modified Files:
	mdfclocksource.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfclocksource.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfclocksource.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mdfclocksource.h	6 Jan 2006 22:57:10 -0000	1.3
+++ mdfclocksource.h	1 Feb 2006 17:31:12 -0000	1.4
@@ -53,6 +53,8 @@
 #include 
 #include "smoothtime.h"
 
+#include "mdfgenericlog.h"         //logging
+
 _LIT(KMdfClockSourcePanicCategory, "MdfClockSource");
 
 enum TMdfClockSourcePanicCodes
@@ -75,7 +77,7 @@
 
 
 class CMdfClockSource : public CBase,
-public MMMFClockSource
+                        public MMMFClockSource
 {
 public:
     static CMdfClockSource* NewL( CHXTimeSyncSmoother* pTimeSyncSmoother );
@@ -97,6 +99,7 @@
     CHXTimeSyncSmoother* m_pTimeSyncSmoother;
     TBool                m_bClockStarted;
     
+    MDFVIDEOLOG_DEFINE;
 };
 
 #endif  //_MDFCLOCKSOURCE_H_


From jwei at helixcommunity.org  Wed Feb  1 09:31:25 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:47:03 2006
Subject: [Datatype-cvs] mdf/video/renderer/pub mdfpluginmanager.h, 1.2,
	1.2.2.1
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer/pub
In directory cvs:/tmp/cvs-serv7823

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfpluginmanager.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfpluginmanager.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfpluginmanager.h,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -d -r1.2 -r1.2.2.1
--- mdfpluginmanager.h	10 Nov 2005 16:55:07 -0000	1.2
+++ mdfpluginmanager.h	1 Feb 2006 17:31:23 -0000	1.2.2.1
@@ -170,7 +170,7 @@
         RPointerArray    m_PayloadFormatArray;
         RPointerArray        m_PluginPackageArray;
         
-        MDFVIDEOLOG_DEFINE
+        MDFVIDEOLOG_DEFINE;
             
 };
 


From jwei at helixcommunity.org  Wed Feb  1 09:31:36 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:47:14 2006
Subject: [Datatype-cvs] mdf/video/renderer/pub mdfpluginmanager.h,1.2,1.3
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer/pub
In directory cvs:/tmp/cvs-serv7841

Modified Files:
	mdfpluginmanager.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfpluginmanager.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfpluginmanager.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mdfpluginmanager.h	10 Nov 2005 16:55:07 -0000	1.2
+++ mdfpluginmanager.h	1 Feb 2006 17:31:33 -0000	1.3
@@ -170,7 +170,7 @@
         RPointerArray    m_PayloadFormatArray;
         RPointerArray        m_PluginPackageArray;
         
-        MDFVIDEOLOG_DEFINE
+        MDFVIDEOLOG_DEFINE;
             
 };
 


From jwei at helixcommunity.org  Wed Feb  1 09:31:47 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:47:25 2006
Subject: [Datatype-cvs] mdf/video/renderer/pub mdfvideoadapter.h, 1.3.2.1,
	1.3.2.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer/pub
In directory cvs:/tmp/cvs-serv7864

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfvideoadapter.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfvideoadapter.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfvideoadapter.h,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- mdfvideoadapter.h	31 Jan 2006 17:47:26 -0000	1.3.2.1
+++ mdfvideoadapter.h	1 Feb 2006 17:31:45 -0000	1.3.2.2
@@ -164,7 +164,7 @@
 
     CPayloadFormatPluginDevice* m_pPayloadFormatPluginDevice;
 
-    MDFVIDEOLOG_DEFINE
+    MDFVIDEOLOG_DEFINE;
         
 };
 


From jwei at helixcommunity.org  Wed Feb  1 09:31:58 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:47:37 2006
Subject: [Datatype-cvs] mdf/video/renderer/pub mdfvideoadapter.h,1.4,1.5
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer/pub
In directory cvs:/tmp/cvs-serv7880

Modified Files:
	mdfvideoadapter.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfvideoadapter.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfvideoadapter.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mdfvideoadapter.h	31 Jan 2006 21:00:25 -0000	1.4
+++ mdfvideoadapter.h	1 Feb 2006 17:31:56 -0000	1.5
@@ -164,7 +164,7 @@
 
     CPayloadFormatPluginDevice* m_pPayloadFormatPluginDevice;
 
-    MDFVIDEOLOG_DEFINE
+    MDFVIDEOLOG_DEFINE;
         
 };
 


From jwei at helixcommunity.org  Wed Feb  1 09:32:08 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:47:47 2006
Subject: [Datatype-cvs] mdf/video/renderer/pub mdfvidrend.h,1.3.2.1,1.3.2.2
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer/pub
In directory cvs:/tmp/cvs-serv7895

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfvidrend.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfvidrend.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfvidrend.h,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- mdfvidrend.h	31 Jan 2006 17:47:41 -0000	1.3.2.1
+++ mdfvidrend.h	1 Feb 2006 17:32:06 -0000	1.3.2.2
@@ -271,7 +271,7 @@
     PlayState           m_PlayState;
     UINT32              m_ulBeginTime;  //OnBegin() sets this value when clip starts or in seeking.
 
-    MDFVIDEOLOG_DEFINE
+    MDFVIDEOLOG_DEFINE;
         
 };
 


From jwei at helixcommunity.org  Wed Feb  1 09:32:14 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Wed Feb  1 11:47:52 2006
Subject: [Datatype-cvs] mdf/video/renderer/pub mdfvidrend.h,1.4,1.5
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer/pub
In directory cvs:/tmp/cvs-serv7921

Modified Files:
	mdfvidrend.h 
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: 01-31-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - Revise Logging Macro to support HxLog, and add more logging entries

This CR is targeting following errors and improvements:

1) Logging macro definitions are defined in datatype\mdf\video\common\include\mdfgenericlog.h. Two flags allow user to map same Macro definitions to either Series60 logging definitions (RFileLogger), Rdebug definitions, or Helix Logging definitions (HXLOGLx) at compile time. Based on a review comment, only Helix Logging definitions are retained while the rest two are removed. I attached mdfgenericlog.h with this CR.

2) New logging entries are added or existing ones are changed through out the entire MDF Video files. No codes changes are made but these log entries. All logging entries are prefixed with MDFVIDEOLOG_.

Files Modified:

datatype/mdf/video/common/include/mdfgenericlog.h
datatype/mdf/video/format/common/Umakefil
datatype/mdf/video/format/common/mdfpayloadformat.cpp
datatype/mdf/video/format/common/pub/mdfpayloadformat.h
datatype/mdf/video/format/h263/mdfh263payloadformat.cpp
datatype/mdf/video/format/h263/pub/mdfh263payloadformat.h
datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h
datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp
datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h
datatype/mdf/video/renderer/mdfclocksource.cpp
datatype/mdf/video/renderer/mdfpluginmanager.cpp
datatype/mdf/video/renderer/mdfvideoadapter.cpp
datatype/mdf/video/renderer/mdfvidrend.cpp
datatype/mdf/video/renderer/pub/mdfclocksource.h
datatype/mdf/video/renderer/pub/mdfpluginmanager.h
datatype/mdf/video/renderer/pub/mdfvideoadapter.h
datatype/mdf/video/renderer/pub/mdfvidrend.h

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted

======================================================
Following Community (ehyche@real.com) comments are incorporated:
1) mdfgenericlog.h has one typo error (MDFVIDEOLOG_WRITE49 instead of MDFVIDEOLOG_WRITE4)


Index: mdfvidrend.h
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfvidrend.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mdfvidrend.h	31 Jan 2006 21:00:54 -0000	1.4
+++ mdfvidrend.h	1 Feb 2006 17:32:11 -0000	1.5
@@ -271,7 +271,7 @@
     PlayState           m_PlayState;
     UINT32              m_ulBeginTime;  //OnBegin() sets this value when clip starts or in seeking.
 
-    MDFVIDEOLOG_DEFINE
+    MDFVIDEOLOG_DEFINE;
         
 };
 


From ping at helixcommunity.org  Wed Feb  1 15:52:00 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Wed Feb  1 18:07:36 2006
Subject: [Datatype-cvs] image/common/pub parseurl.h,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/image/common/pub
In directory cvs:/tmp/cvs-serv21316/image/common/pub

Modified Files:
	parseurl.h 
Log Message:
CHXURL has 3 types of constructor, one of them takes (const char* pszURL) but internally it calls "new CHXMiniCCF()" in order to obtain instance of CCF, as a result, CHXHeader and CHXBuffer etc classes are directly linked in and un-necessary increase the image size.

The change invovles:
- disabled the CHXURL(const char* pszURL) constructor for Helix Client applications in order to prevent it from being accidently abused.
- use the other CHXURL constructor which takes pContext
- modified couple static utility functions in CHXURL to also take pContext

CCF in Helix Media Platform is a singleton object and implemented by the media platform in client/medpltfm, CHXMiniCCF is deprecated.

CR by Erik


Index: parseurl.h
===================================================================
RCS file: /cvsroot/datatype/image/common/pub/parseurl.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- parseurl.h	14 Mar 2005 19:23:20 -0000	1.3
+++ parseurl.h	1 Feb 2006 23:51:58 -0000	1.4
@@ -69,9 +69,9 @@
 HX_RESULT ExtractValueColor(IHXValues *pValues, const char *pszAttr, const char *pszDefault, PXColor &rcValue);
 HX_RESULT ExtractValueColor(IHXValues *pValues, const char *pszAttr, UINT32 ulDefault, UINT32& rulValue);
 HX_RESULT ExtractValueOpacity(IHXValues *pValues, const char *pszAttr, UINT32 ulDefault, UINT32& rulValue);
-HXBOOL      ConvertTimeStringToULONG32(char *pTimeBuf, ULONG32 timeBufLen, ULONG32 &timeValInMillisec);
-HXBOOL      IsURLRelative(const char* pszURL);
-HX_RESULT MakeAbsoluteURL(const CHXString& rOrigURL, const CHXString& rRelURL, CHXString& rAbsURL);
+HXBOOL	  ConvertTimeStringToULONG32(char *pTimeBuf, ULONG32 timeBufLen, ULONG32 &timeValInMillisec);
+HXBOOL    IsURLRelative(const char* pszURL, IUnknown* pContext);
+HX_RESULT MakeAbsoluteURL(const CHXString& rOrigURL, const CHXString& rRelURL, CHXString& rAbsURL, IUnknown* pContext);
 HX_RESULT AddURLOrRequestParam(IHXRequest* pRequest, const char* pszParamName,
                                IUnknown* pContext, IHXValues* pValues);
 


From ping at helixcommunity.org  Wed Feb  1 15:52:01 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Wed Feb  1 18:07:36 2006
Subject: [Datatype-cvs] image/gif/renderer pxgifrnd.cpp,1.17,1.18
Message-ID: 

Update of /cvsroot/datatype/image/gif/renderer
In directory cvs:/tmp/cvs-serv21316/image/gif/renderer

Modified Files:
	pxgifrnd.cpp 
Log Message:
CHXURL has 3 types of constructor, one of them takes (const char* pszURL) but internally it calls "new CHXMiniCCF()" in order to obtain instance of CCF, as a result, CHXHeader and CHXBuffer etc classes are directly linked in and un-necessary increase the image size.

The change invovles:
- disabled the CHXURL(const char* pszURL) constructor for Helix Client applications in order to prevent it from being accidently abused.
- use the other CHXURL constructor which takes pContext
- modified couple static utility functions in CHXURL to also take pContext

CCF in Helix Media Platform is a singleton object and implemented by the media platform in client/medpltfm, CHXMiniCCF is deprecated.

CR by Erik


Index: pxgifrnd.cpp
===================================================================
RCS file: /cvsroot/datatype/image/gif/renderer/pxgifrnd.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- pxgifrnd.cpp	5 May 2005 16:15:09 -0000	1.17
+++ pxgifrnd.cpp	1 Feb 2006 23:51:58 -0000	1.18
@@ -599,12 +599,12 @@
     {
         if (m_ucTarget == kTargetPlayer)
         {
-            if (IsURLRelative(m_cURL.c_str()) &&
+            if (IsURLRelative(m_cURL.c_str(), m_pContext) &&
                 !strstr(m_cURL.c_str(), "command:"))
             {
                 CHXString cRelURL(m_cURL.c_str());
                 CHXString cAbsURL;
-                retVal = MakeAbsoluteURL(cOriginalURL, cRelURL, cAbsURL);
+                retVal = MakeAbsoluteURL(cOriginalURL, cRelURL, cAbsURL, m_pContext);
                 if (retVal == HXR_OK)
                 {
                     m_cURL = (const char *) cAbsURL;


From ping at helixcommunity.org  Wed Feb  1 15:52:01 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Wed Feb  1 18:07:36 2006
Subject: [Datatype-cvs] image/jpg/renderer pxjpgrnd.cpp,1.6,1.7
Message-ID: 

Update of /cvsroot/datatype/image/jpg/renderer
In directory cvs:/tmp/cvs-serv21316/image/jpg/renderer

Modified Files:
	pxjpgrnd.cpp 
Log Message:
CHXURL has 3 types of constructor, one of them takes (const char* pszURL) but internally it calls "new CHXMiniCCF()" in order to obtain instance of CCF, as a result, CHXHeader and CHXBuffer etc classes are directly linked in and un-necessary increase the image size.

The change invovles:
- disabled the CHXURL(const char* pszURL) constructor for Helix Client applications in order to prevent it from being accidently abused.
- use the other CHXURL constructor which takes pContext
- modified couple static utility functions in CHXURL to also take pContext

CCF in Helix Media Platform is a singleton object and implemented by the media platform in client/medpltfm, CHXMiniCCF is deprecated.

CR by Erik


Index: pxjpgrnd.cpp
===================================================================
RCS file: /cvsroot/datatype/image/jpg/renderer/pxjpgrnd.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- pxjpgrnd.cpp	14 Mar 2005 19:23:23 -0000	1.6
+++ pxjpgrnd.cpp	1 Feb 2006 23:51:59 -0000	1.7
@@ -262,11 +262,11 @@
         {
             if (m_ulTarget == kTargetPlayer)
             {
-                if (IsURLRelative((const char*) *m_pURL) &&
+                if (IsURLRelative((const char*) *m_pURL, m_pContext) &&
                     !strstr((const char*) *m_pURL, "command:"))
                 {
                     CHXString cAbsURL;
-                    retVal = MakeAbsoluteURL(cOriginalURL, *m_pURL, cAbsURL);
+                    retVal = MakeAbsoluteURL(cOriginalURL, *m_pURL, cAbsURL, m_pContext);
                     if (SUCCEEDED(retVal))
                     {
                         *m_pURL = cAbsURL;


From ping at helixcommunity.org  Wed Feb  1 15:52:01 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Wed Feb  1 18:07:37 2006
Subject: [Datatype-cvs] image/realpix/renderer pxrend.cpp,1.7,1.8
Message-ID: 

Update of /cvsroot/datatype/image/realpix/renderer
In directory cvs:/tmp/cvs-serv21316/image/realpix/renderer

Modified Files:
	pxrend.cpp 
Log Message:
CHXURL has 3 types of constructor, one of them takes (const char* pszURL) but internally it calls "new CHXMiniCCF()" in order to obtain instance of CCF, as a result, CHXHeader and CHXBuffer etc classes are directly linked in and un-necessary increase the image size.

The change invovles:
- disabled the CHXURL(const char* pszURL) constructor for Helix Client applications in order to prevent it from being accidently abused.
- use the other CHXURL constructor which takes pContext
- modified couple static utility functions in CHXURL to also take pContext

CCF in Helix Media Platform is a singleton object and implemented by the media platform in client/medpltfm, CHXMiniCCF is deprecated.

CR by Erik


Index: pxrend.cpp
===================================================================
RCS file: /cvsroot/datatype/image/realpix/renderer/pxrend.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- pxrend.cpp	14 Mar 2005 19:23:29 -0000	1.7
+++ pxrend.cpp	1 Feb 2006 23:51:59 -0000	1.8
@@ -420,10 +420,10 @@
                                     {
                                         IHXBuffer* pHostStr = NULL;
                                         IHXBuffer* pPathStr = NULL;
-                                        rv                   = GetHostAndPathFromURL((const char*) pURLStr->GetBuffer(),
-                                                                 m_pCommonClassFactory,
-                                                                                     pHostStr,
-                                                                                     pPathStr);
+                                        rv = GetHostAndPathFromURL((const char*) pURLStr->GetBuffer(),
+                                                                   m_pCommonClassFactory,
+                                                                   pHostStr,
+                                                                   pPathStr);
                                         if (SUCCEEDED(rv))
                                         {
                                             rv = pCookies->SetCookies((const char*) pHostStr->GetBuffer(),


From ping at helixcommunity.org  Wed Feb  1 15:52:01 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Wed Feb  1 18:07:37 2006
Subject: [Datatype-cvs] ram/renderer ramrendr.cpp,1.22,1.23
Message-ID: 

Update of /cvsroot/datatype/ram/renderer
In directory cvs:/tmp/cvs-serv21316/ram/renderer

Modified Files:
	ramrendr.cpp 
Log Message:
CHXURL has 3 types of constructor, one of them takes (const char* pszURL) but internally it calls "new CHXMiniCCF()" in order to obtain instance of CCF, as a result, CHXHeader and CHXBuffer etc classes are directly linked in and un-necessary increase the image size.

The change invovles:
- disabled the CHXURL(const char* pszURL) constructor for Helix Client applications in order to prevent it from being accidently abused.
- use the other CHXURL constructor which takes pContext
- modified couple static utility functions in CHXURL to also take pContext

CCF in Helix Media Platform is a singleton object and implemented by the media platform in client/medpltfm, CHXMiniCCF is deprecated.

CR by Erik


Index: ramrendr.cpp
===================================================================
RCS file: /cvsroot/datatype/ram/renderer/ramrendr.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- ramrendr.cpp	31 Jan 2006 23:38:21 -0000	1.22
+++ ramrendr.cpp	1 Feb 2006 23:51:59 -0000	1.23
@@ -1409,7 +1409,7 @@
     pTrackProperties->SetPropertyULONG32("PersistentComponentID", m_ulPersistentComponentID);
     
     // Get any TAC info in URL parameters
-    pURL = new CHXURL(pszURL);
+    pURL = new CHXURL(pszURL, m_pContext);
 
     if (pURL->GetLastError() == HXR_OK &&
 	((pURLOptions = pURL->GetOptions()) != NULL))
@@ -1484,14 +1484,16 @@
                 {
                     bPrefixGenHandled = TRUE;
                     CHXURL::GeneratePrefixRootFragment(pszURL, m_urlPrefix,
-                            m_urlRoot, m_pURLFragment);
+						       m_urlRoot, m_pURLFragment,
+						       m_pContext);
                 }
             }
 
             if (!bPrefixGenHandled)
             {
                 CHXURL::GeneratePrefixRootFragment(pURL, m_urlPrefix,
-                        m_urlRoot, m_pURLFragment);
+						   m_urlRoot, m_pURLFragment,
+						   m_pContext);
             }
         }
     }    


From ping at helixcommunity.org  Wed Feb  1 15:52:01 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Wed Feb  1 18:07:37 2006
Subject: [Datatype-cvs] smil/renderer/smil1 sm1rendr.cpp,1.9,1.10
Message-ID: 

Update of /cvsroot/datatype/smil/renderer/smil1
In directory cvs:/tmp/cvs-serv21316/smil/renderer/smil1

Modified Files:
	sm1rendr.cpp 
Log Message:
CHXURL has 3 types of constructor, one of them takes (const char* pszURL) but internally it calls "new CHXMiniCCF()" in order to obtain instance of CCF, as a result, CHXHeader and CHXBuffer etc classes are directly linked in and un-necessary increase the image size.

The change invovles:
- disabled the CHXURL(const char* pszURL) constructor for Helix Client applications in order to prevent it from being accidently abused.
- use the other CHXURL constructor which takes pContext
- modified couple static utility functions in CHXURL to also take pContext

CCF in Helix Media Platform is a singleton object and implemented by the media platform in client/medpltfm, CHXMiniCCF is deprecated.

CR by Erik


Index: sm1rendr.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil1/sm1rendr.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- sm1rendr.cpp	31 Jan 2006 23:38:23 -0000	1.9
+++ sm1rendr.cpp	1 Feb 2006 23:51:59 -0000	1.10
@@ -1619,7 +1619,8 @@
         if (pszURL)
         {
 	    CHXURL::GeneratePrefixRootFragment(pszURL, m_urlPrefix,
-                    m_urlRoot, m_pURLFragment);
+					       m_urlRoot, m_pURLFragment,
+					       m_pContext);
             bPrefixGenHandled = TRUE;
         }
     }
@@ -1627,7 +1628,8 @@
     if (!bPrefixGenHandled)
     {
         CHXURL::GeneratePrefixRootFragment(pURL, m_urlPrefix,
-                m_urlRoot, m_pURLFragment);
+					   m_urlRoot, m_pURLFragment,
+					   m_pContext);
     }
 
     HX_RELEASE(pSource);


From ping at helixcommunity.org  Wed Feb  1 15:52:02 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Wed Feb  1 18:07:39 2006
Subject: [Datatype-cvs] smil/renderer/smil2 smldoc.cpp, 1.28,
	1.29 smlparse.cpp, 1.31, 1.32 smlrendr.cpp, 1.15, 1.16
Message-ID: 

Update of /cvsroot/datatype/smil/renderer/smil2
In directory cvs:/tmp/cvs-serv21316/smil/renderer/smil2

Modified Files:
	smldoc.cpp smlparse.cpp smlrendr.cpp 
Log Message:
CHXURL has 3 types of constructor, one of them takes (const char* pszURL) but internally it calls "new CHXMiniCCF()" in order to obtain instance of CCF, as a result, CHXHeader and CHXBuffer etc classes are directly linked in and un-necessary increase the image size.

The change invovles:
- disabled the CHXURL(const char* pszURL) constructor for Helix Client applications in order to prevent it from being accidently abused.
- use the other CHXURL constructor which takes pContext
- modified couple static utility functions in CHXURL to also take pContext

CCF in Helix Media Platform is a singleton object and implemented by the media platform in client/medpltfm, CHXMiniCCF is deprecated.

CR by Erik


Index: smlrendr.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smlrendr.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- smlrendr.cpp	31 Jan 2006 23:38:23 -0000	1.15
+++ smlrendr.cpp	1 Feb 2006 23:52:00 -0000	1.16
@@ -1534,7 +1534,8 @@
         if (pszURL)
         {
 	    CHXURL::GeneratePrefixRootFragment(pszURL, m_urlPrefix,
-                    m_urlRoot, m_pURLFragment);
+					       m_urlRoot, m_pURLFragment,
+					       m_pContext);
             bPrefixGenHandled = TRUE;
         }
     }
@@ -1542,7 +1543,8 @@
     if (!bPrefixGenHandled)
     {
         CHXURL::GeneratePrefixRootFragment(pURL, m_urlPrefix,
-                m_urlRoot, m_pURLFragment);
+					   m_urlRoot, m_pURLFragment,
+					   m_pContext);
     }
 
     HX_RELEASE(pSource);

Index: smldoc.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smldoc.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- smldoc.cpp	31 Jan 2006 23:38:23 -0000	1.28
+++ smldoc.cpp	1 Feb 2006 23:51:59 -0000	1.29
@@ -2059,9 +2059,8 @@
         CHXString cNewRoot;
         char*     pszNewFrag = NULL;
         CHXURL::GeneratePrefixRootFragment((const char*) cSrc,
-                                           cNewPrefix,
-                                           cNewRoot,
-                                           pszNewFrag);
+                                           cNewPrefix, cNewRoot,
+                                           pszNewFrag, m_pContext);
         HX_VECTOR_DELETE(pszNewFrag);
         // Now make the external media marker file name
         // relative to the source
@@ -2478,7 +2477,7 @@
 {
     HX_RESULT retVal = HXR_OK;
 
-    CHXURL urlObj(pURL);
+    CHXURL urlObj(pURL, m_pContext);
     IHXValues* pHeader = urlObj.GetProperties();
     if (pHeader)
     {

Index: smlparse.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil2/smlparse.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- smlparse.cpp	31 Jan 2006 23:38:23 -0000	1.31
+++ smlparse.cpp	1 Feb 2006 23:51:59 -0000	1.32
@@ -4036,12 +4036,11 @@
         CHXString cURLRoot;
         char*     pURLFragment = NULL;
         CHXURL::GeneratePrefixRootFragment(pszSMILFileURL,
-                                           cPrefix,
-                                           cURLRoot,
-                                           pURLFragment);
+                                           cPrefix, cURLRoot,
+                                           pURLFragment, m_pContext);
         // Get the full URL for the src
         CHXString  cFullSrcURL;
-        CHXURL     urlObj(pszSrcURL);
+        CHXURL     urlObj(pszSrcURL, m_pContext);
         IHXValues* pHeader = urlObj.GetProperties();
         if (pHeader)
         {
@@ -4074,12 +4073,11 @@
         {
             HX_VECTOR_DELETE(pURLFragment);
             CHXURL::GeneratePrefixRootFragment(cFullSrcURL,
-                                               cPrefix,
-                                               cURLRoot,
-                                               pURLFragment);
+                                               cPrefix, cURLRoot,
+                                               pURLFragment, m_pContext);
             // Now we need to create the external marker file name
             CHXString  cFullMarkerURL;
-            CHXURL     urlObj2(pszMarkerFile);
+            CHXURL     urlObj2(pszMarkerFile, m_pContext);
             IHXValues* pHeader2 = urlObj2.GetProperties();
             if (pHeader2)
             {
@@ -22803,7 +22801,7 @@
 {
     HXBOOL rc = TRUE;
 
-    CHXURL urlObj(pURL);
+    CHXURL urlObj(pURL, m_pContext);
     IHXValues* pHeader = urlObj.GetProperties();
     if(pHeader)
     {


From ping at helixcommunity.org  Wed Feb  1 15:52:02 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Wed Feb  1 18:07:40 2006
Subject: [Datatype-cvs] text/realtext/renderer rtrender.cpp,1.11,1.12
Message-ID: 

Update of /cvsroot/datatype/text/realtext/renderer
In directory cvs:/tmp/cvs-serv21316/text/realtext/renderer

Modified Files:
	rtrender.cpp 
Log Message:
CHXURL has 3 types of constructor, one of them takes (const char* pszURL) but internally it calls "new CHXMiniCCF()" in order to obtain instance of CCF, as a result, CHXHeader and CHXBuffer etc classes are directly linked in and un-necessary increase the image size.

The change invovles:
- disabled the CHXURL(const char* pszURL) constructor for Helix Client applications in order to prevent it from being accidently abused.
- use the other CHXURL constructor which takes pContext
- modified couple static utility functions in CHXURL to also take pContext

CCF in Helix Media Platform is a singleton object and implemented by the media platform in client/medpltfm, CHXMiniCCF is deprecated.

CR by Erik


Index: rtrender.cpp
===================================================================
RCS file: /cvsroot/datatype/text/realtext/renderer/rtrender.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- rtrender.cpp	14 Mar 2005 19:24:52 -0000	1.11
+++ rtrender.cpp	1 Feb 2006 23:52:00 -0000	1.12
@@ -3738,7 +3738,7 @@
 
     CHXString urlRoot;
     char* pURLFragment = NULL;
-    CHXURL::GeneratePrefixRootFragment(pURL, m_urlPrefix, urlRoot, pURLFragment);
+    CHXURL::GeneratePrefixRootFragment(pURL, m_urlPrefix, urlRoot, pURLFragment, m_pContext);
     HX_VECTOR_DELETE(pURLFragment);
     HX_RELEASE(pSource);
 


From ping at helixcommunity.org  Wed Feb  1 15:52:00 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Wed Feb  1 18:08:05 2006
Subject: [Datatype-cvs] 
	image/common parseurl.cpp, 1.5, 1.6 pxcookie.cpp, 1.3, 1.4
Message-ID: 

Update of /cvsroot/datatype/image/common
In directory cvs:/tmp/cvs-serv21316/image/common

Modified Files:
	parseurl.cpp pxcookie.cpp 
Log Message:
CHXURL has 3 types of constructor, one of them takes (const char* pszURL) but internally it calls "new CHXMiniCCF()" in order to obtain instance of CCF, as a result, CHXHeader and CHXBuffer etc classes are directly linked in and un-necessary increase the image size.

The change invovles:
- disabled the CHXURL(const char* pszURL) constructor for Helix Client applications in order to prevent it from being accidently abused.
- use the other CHXURL constructor which takes pContext
- modified couple static utility functions in CHXURL to also take pContext

CCF in Helix Media Platform is a singleton object and implemented by the media platform in client/medpltfm, CHXMiniCCF is deprecated.

CR by Erik


Index: parseurl.cpp
===================================================================
RCS file: /cvsroot/datatype/image/common/parseurl.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- parseurl.cpp	14 Mar 2005 19:23:20 -0000	1.5
+++ parseurl.cpp	1 Feb 2006 23:51:58 -0000	1.6
@@ -756,10 +756,10 @@
 }
 
 //XXXLCM use HXURLRep
-HXBOOL IsURLRelative(const char* pszURL)
+HXBOOL IsURLRelative(const char* pszURL, IUnknown* pContext)
 {
     HXBOOL   bRelative = TRUE;
-    CHXURL cFullURL(pszURL);
+    CHXURL cFullURL(pszURL, pContext);
     if (cFullURL.GetLastError() == HXR_OK)
     {
         IHXValues* pHeader = cFullURL.GetProperties();
@@ -785,10 +785,10 @@
 }
 
 // XXXLCM use HXURLRep ApplyRelativeURL
-HX_RESULT MakeAbsoluteURL(const CHXString& rOrigURL, const CHXString& rRelURL, CHXString& rAbsURL)
+HX_RESULT MakeAbsoluteURL(const CHXString& rOrigURL, const CHXString& rRelURL, CHXString& rAbsURL, IUnknown* pContext)
 {
     // Create the CHXURL object
-    CHXURL     cURLObj((const char*) rOrigURL);
+    CHXURL     cURLObj((const char*) rOrigURL, pContext);
     IHXValues* pHeader = cURLObj.GetProperties();
     if(!pHeader)
     {

Index: pxcookie.cpp
===================================================================
RCS file: /cvsroot/datatype/image/common/pxcookie.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pxcookie.cpp	9 Jul 2004 18:30:42 -0000	1.3
+++ pxcookie.cpp	1 Feb 2006 23:51:58 -0000	1.4
@@ -188,7 +188,7 @@
     if (pszURL && pFactory)
     {
         // Create a CHXURL from the url
-        CHXURL* pURL = new CHXURL(pszURL);
+        CHXURL* pURL = new CHXURL(pszURL, (IUnknown*)(IHXCommonClassFactory*)pFactory);
         if (pURL)
         {
             retVal = pURL->GetLastError();


From gwright at helixcommunity.org  Thu Feb  2 14:43:18 2006
From: gwright at helixcommunity.org (gwright@helixcommunity.org)
Date: Thu Feb  2 16:58:39 2006
Subject: [Datatype-cvs] common/include mdfgenericlog.h,1.1.1.1,NONE
Message-ID: 

Update of /cvsroot/datatype/common/include
In directory cvs:/tmp/cvs-serv21790

Removed Files:
	mdfgenericlog.h 
Log Message:
Hi, Eric and Greg,

About three months ago, I put a file: mdfgenericlog.h at
datatype/common/include. It is at wrong location. Later, I always put it
in the correct locatoin: datatype/mdf/video/common/include. I remember I
could not remove datatype/common/include/mdfgenericlog.h by myself.
Could you help me out? Thanks.

Br,

--john


--- mdfgenericlog.h DELETED ---


From gwright at helixcommunity.org  Thu Feb  2 14:44:18 2006
From: gwright at helixcommunity.org (gwright@helixcommunity.org)
Date: Thu Feb  2 16:59:38 2006
Subject: [Datatype-cvs] common/include mdfgenericlog.h,1.1.1.1,NONE
Message-ID: 

Update of /cvsroot/datatype/common/include
In directory cvs:/tmp/cvs-serv21842

Removed Files:
      Tag: hxclient_2_1_0_cayennes
	mdfgenericlog.h 
Log Message:
Hi, Eric and Greg,

About three months ago, I put a file: mdfgenericlog.h at
datatype/common/include. It is at wrong location. Later, I always put it
in the correct locatoin: datatype/mdf/video/common/include. I remember I
could not remove datatype/common/include/mdfgenericlog.h by myself.
Could you help me out? Thanks.

Br,

--john


--- mdfgenericlog.h DELETED ---


From ehyche at helixcommunity.org  Fri Feb  3 14:16:14 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri Feb  3 16:31:23 2006
Subject: [Datatype-cvs] asf/fileformat/pub asf_file_factory.h, NONE,
	1.1 asf_file_system.h, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/asf/fileformat/pub
In directory cvs:/tmp/cvs-serv8180/pub

Added Files:
	asf_file_factory.h asf_file_system.h 
Log Message:
Multi-rate support in WMF-SDK-based ASF fileformat.


--- NEW FILE: asf_file_factory.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 ASF_FILE_FACTORY_H
#define ASF_FILE_FACTORY_H

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


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

    // 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);

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

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

#endif /* #ifndef ASF_FILE_FACTORY_H */

--- NEW FILE: asf_file_system.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_FILE_SYSTEM_H
#define ASF_FILE_SYSTEM_H

#include "hxplugn.h"
#include "hxfiles.h"

class CASFFileSystem : public IHXPlugin,
                       public IHXFileSystemObject
{
public:
    CASFFileSystem();
    virtual ~CASFFileSystem();

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

    // IHXPlugin methods
    STDMETHOD(GetPluginInfo) (THIS_ REF(HXBOOL)      rbMultipleLoad,
                                    REF(const char*) rpszDescription,
                                    REF(const char*) rpszCopyright,
                                    REF(const char*) rpszMoreInfoURL,
                                    REF(ULONG32)     rulVersionNumber);
    STDMETHOD(InitPlugin)    (THIS_ IUnknown* pContext);

    // IHXFileSystemObject methods
    STDMETHOD(GetFileSystemInfo) (THIS_ REF(const char*) rpszShortName,
                                        REF(const char*) rpszProtocol);
    STDMETHOD(InitFileSystem)    (THIS_ IHXValues* pOptions);
    STDMETHOD(CreateFile)        (THIS_ IUnknown** ppFileObject);
    STDMETHOD(CreateDir)         (THIS_ IUnknown** ppDirObject);

    // CASFFileSystem methods
    static HX_RESULT STDAPICALLTYPE HXCreateFSInstance(IUnknown** ppIUnknown);
private:
    INT32                    m_lRefCount;
    IUnknown*                m_pContext;
    static const char* const m_pszDescription;
    static const char* const m_pszCopyright;
    static const char* const m_pszMoreInfoURL;
    static const char* const m_pszShortName;
    static const char* const m_pszProtocol;
//    static const IID            zm_myIID;
};

class CASFFileObject : public IHXFileObject, 
                       public IHXFileStat,
                       public IHXFileExists,
                       public IHXRequestHandler,
                       public IHXFileMimeMapper
{
public:
    CASFFileObject(IUnknown* pContext);
    virtual ~CASFFileObject();

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

    // IHXFileObject methods
    STDMETHOD(Init)        (THIS_ ULONG32 ulFlags, IHXFileResponse* pResponse);
    STDMETHOD(GetFilename) (THIS_ REF(const char*) rpszFilename);
    STDMETHOD(Close)       (THIS);
    STDMETHOD(Read)        (THIS_ ULONG32 ulCount);
    STDMETHOD(Write)       (THIS_ IHXBuffer* pBuffer);
    STDMETHOD(Seek)        (THIS_ ULONG32 ulOffset, HXBOOL bRelative);
    STDMETHOD(Advise)      (THIS_ ULONG32 ulInfo);

    // IHXFileStet methods
    STDMETHOD(Stat) (THIS_ IHXFileStatResponse* pFileStatResponse);

    // IHXFileExists methods
    STDMETHOD(DoesExist) (THIS_ const char* pszPath, IHXFileExistsResponse* pFileResponse);

    // IHXRequestHandler methods
    STDMETHOD(SetRequest) (THIS_ IHXRequest* pRequest);
    STDMETHOD(GetRequest) (THIS_ REF(IHXRequest*) rpRequest);

    // IHXFileMimeMapper methods
    STDMETHOD(FindMimeType) (THIS_ const char* pURL, IHXFileMimeMapperResponse* pMimeMapperResponse);
private:
    INT32            m_lRefCount;
    IUnknown*        m_pContext;
    IHXRequest*      m_pRequest;
    IHXFileResponse* m_pResponse;
    HXBOOL           m_bFirstRead;

    static const char* const m_pszMimeType;
};

#endif /* #ifndef ASF_FILE_SYSTEM_H */


From ehyche at helixcommunity.org  Fri Feb  3 14:16:13 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri Feb  3 16:31:24 2006
Subject: [Datatype-cvs] asf/fileformat asf_file_factory.cpp, NONE,
	1.1 asf_file_system.cpp, NONE, 1.1 asf_file_format_dll.cpp,
	1.2, 1.3 asf_file_format_guids.cpp, 1.2, 1.3 asffflib, 1.2,
	1.3 asffflib_win32.pcf, 1.3, 1.4
Message-ID: 

Update of /cvsroot/datatype/asf/fileformat
In directory cvs:/tmp/cvs-serv8180

Modified Files:
	asf_file_format_dll.cpp asf_file_format_guids.cpp asffflib 
	asffflib_win32.pcf 
Added Files:
	asf_file_factory.cpp asf_file_system.cpp 
Log Message:
Multi-rate support in WMF-SDK-based ASF fileformat.


Index: asf_file_format_guids.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/asf_file_format_guids.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- asf_file_format_guids.cpp	13 Jan 2006 18:27:06 -0000	1.2
+++ asf_file_format_guids.cpp	3 Feb 2006 22:16:10 -0000	1.3
@@ -44,6 +44,8 @@
 #include "hxprefs.h"
 #include "hxccf.h"
 #include "ihxpckts.h"
+#include "hxcore.h"
+#include "hxasm.h"
 #include "ihxtlogsystem.h"
 #include "ihxtlogsystemcontext.h"
 #include "hxdllaccess.h"

Index: asf_file_format_dll.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/asf_file_format_dll.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- asf_file_format_dll.cpp	13 Jan 2006 18:27:06 -0000	1.2
+++ asf_file_format_dll.cpp	3 Feb 2006 22:16:10 -0000	1.3
@@ -39,6 +39,9 @@
 #include "hxformt.h"
 #include "hxengin.h"
 #include "baseobj.h"
+#if defined(HELIX_FEATURE_ASF_FILEFORMAT_PROVIDE_FILESYSTEM)
+#include "asf_file_factory.h"
+#endif /* #if defined(HELIX_FEATURE_ASF_FILEFORMAT_PROVIDE_FILESYSTEM) */
 #include "asf_file_format_base.h"
 #if defined(HELIX_FEATURE_ASF_FILEFORMAT_WMFSDK)
 #include "asf_file_format_wmfsdk.h"
@@ -54,6 +57,12 @@
 
 STDAPI ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
 {
+#if defined(HELIX_FEATURE_ASF_FILEFORMAT_PROVIDE_FILESYSTEM)
+
+    return CASFFilePluginFactory::HXCreateFactoryInstance(ppIUnknown);
+
+#else /* #if defined(HELIX_FEATURE_ASF_FILEFORMAT_PROVIDE_FILESYSTEM) */
+
 #if defined(_WINDOWS)
 
 #if defined(HELIX_FEATURE_ASF_FILEFORMAT_WMFSDK)
@@ -65,6 +74,7 @@
 #else /* #if defined(_WINDOWS) */
     return CASFFileFormatXPlatform::HXCreateFFInstance(ppIUnknown);
 #endif /* #if defined(_WINDOWS) */
+#endif /* #if defined(HELIX_FEATURE_ASF_FILEFORMAT_PROVIDE_FILESYSTEM) */
 }
 
 STDAPI ENTRYPOINT(CanUnload2)(void)

--- NEW FILE: asf_file_factory.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 "hxwintyp.h"
#include "hxcom.h"
#include "hxplugn.h"
#include "hxengin.h"
#include "hxformt.h"
#include "baseobj.h"
#include "asf_file_factory.h"
#include "asf_file_format_base.h"
#if defined(HELIX_FEATURE_ASF_FILEFORMAT_WMFSDK)
#include "asf_file_format_wmfsdk.h"
#else
#include "asf_file_format_xplatform.h"
#endif
#include "asf_file_system.h"

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

HX_RESULT (STDAPICALLTYPE* CASFFilePluginFactory::m_fpRMACreateInstanceArray[])(IUnknown**) =
{
#if defined(_WINDOWS)
#if defined(HELIX_FEATURE_ASF_FILEFORMAT_WMFSDK)
    CASFFileFormatWMFSDK::HXCreateFFInstance,
#else
    CASFFileFormatXPlatform::HXCreateFFInstance,
#endif
#else /* #if defined(_WINDOWS) */
    CASFFileFormatXPlatform::HXCreateFFInstance,
#endif /* #if defined(_WINDOWS) */
    CASFFileSystem::HXCreateFSInstance,
    NULL
};

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

CASFFilePluginFactory::~CASFFilePluginFactory()
{
}

STDMETHODIMP CASFFilePluginFactory::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) CASFFilePluginFactory::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}


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

    delete this;

    return 0;
}


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

STDMETHODIMP CASFFilePluginFactory::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 CASFFilePluginFactory::HXCreateFactoryInstance(IUnknown** ppIUnknown)
{
    HX_RESULT retVal = HXR_FAIL;

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

    return retVal;
}


Index: asffflib_win32.pcf
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/asffflib_win32.pcf,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- asffflib_win32.pcf	27 Jan 2006 20:51:38 -0000	1.3
+++ asffflib_win32.pcf	3 Feb 2006 22:16:10 -0000	1.4
@@ -41,7 +41,8 @@
     project.AddSources("platform/win32/asf_file_format_wmfsdk.cpp",
                        "platform/win32/ihx_inss_buffer.cpp",
                        "platform/win32/istream_fileobject.cpp",
-                       "platform/win32/hxwmreader.cpp")
+                       "platform/win32/hxwmreader.cpp",
+                       "platform/win32/asf_rule_state.cpp")
     project.AddModuleIncludes("common/system/pub/platform/win")
     project.AddIncludes("pub/platform/win32")
     wmfsdk = GetSDKPath("wmfsdk")

Index: asffflib
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/asffflib,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- asffflib	13 Jan 2006 18:27:06 -0000	1.2
+++ asffflib	3 Feb 2006 22:16:10 -0000	1.3
@@ -37,6 +37,8 @@
 
 UmakefileVersion(2,2)
 
+project.AddDefines("HXWMREADER_DEBUG_TEST_STREAMSELECTION")
+
 project.AddModuleIncludes("common/include",
                           "common/util/pub",
                           "common/container/pub",
@@ -46,6 +48,10 @@
 
 project.AddSources("asf_file_format_base.cpp")
 
+if project.IsDefined("HELIX_FEATURE_ASF_FILEFORMAT_PROVIDE_FILESYSTEM"):
+    project.AddSources("asf_file_factory.cpp",
+                       "asf_file_system.cpp")
+
 if not project.IsDefined("HELIX_FEATURE_ASF_FILEFORMAT_WMFSDK"):
     project.AddSources("asf_file_format_xplatform.cpp")
 

--- NEW FILE: asf_file_system.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 "hxfiles.h"
#include "ihxpckts.h"
#include "pckunpck.h"
#include "asf_file_system.h"
#include "asf_file_format.ver"
#include "hxver.h"

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

const char* const CASFFileSystem::m_pszDescription = "Helix ASF Dummy File System";
const char* const CASFFileSystem::m_pszCopyright   = HXVER_COPYRIGHT;
const char* const CASFFileSystem::m_pszMoreInfoURL = HXVER_MOREINFO;
const char* const CASFFileSystem::m_pszShortName   = "hx-dummyasf";
const char* const CASFFileSystem::m_pszProtocol    = "mms";
const char* const CASFFileObject::m_pszMimeType    = "application/vnd.ms-asf";

CASFFileSystem::CASFFileSystem()
    : m_lRefCount(0)
    , m_pContext(NULL)
{
}

CASFFileSystem::~CASFFileSystem()
{
    HX_RELEASE(m_pContext);
}

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

    if (ppvObj)
    {
        // Set defaults
        *ppvObj = NULL;
        retVal  = HXR_OK;
        // Switch on iid
        if (IsEqualIID(riid, IID_IUnknown))
        {
            *ppvObj = (IUnknown*) (IHXPlugin*) this;
        }
        else if (IsEqualIID(riid, IID_IHXPlugin))
        {
            *ppvObj = (IHXPlugin*) this;
        }
        else if (IsEqualIID(riid, IID_IHXFileSystemObject))
        {
            *ppvObj = (IHXFileSystemObject*) this;
        }
        else
        {
            retVal = HXR_NOINTERFACE;
        }
        if (SUCCEEDED(retVal))
        {
            AddRef();
        }
    }

    return retVal;
}

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

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

    delete this;

    return 0;
}

STDMETHODIMP CASFFileSystem::GetPluginInfo(REF(HXBOOL)      rbLoadMultiple,
                                           REF(const char*) rpszDescription,
                                           REF(const char*) rpszCopyright,
                                           REF(const char*) rpszMoreInfoURL,
                                           REF(ULONG32)     rulVersionNumber)
{
    rbLoadMultiple   = TRUE;
    rpszDescription  = m_pszDescription;
    rpszCopyright    = m_pszCopyright;
    rpszMoreInfoURL  = m_pszMoreInfoURL;
    rulVersionNumber = TARVER_ULONG32_VERSION;

    return HXR_OK;
}

STDMETHODIMP CASFFileSystem::InitPlugin(IUnknown* /*IN*/ pContext)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pContext)
    {
        HX_RELEASE(m_pContext);
        m_pContext = pContext;
        m_pContext->AddRef();
        retVal = HXR_OK;
    }

    return retVal;
}

STDMETHODIMP CASFFileSystem::GetFileSystemInfo(REF(const char*) rpszShortName,
                                               REF(const char*) rpszProtocol)
{
    rpszShortName = m_pszShortName;
    rpszProtocol  = m_pszProtocol;

    return HXR_OK;
}

STDMETHODIMP CASFFileSystem::InitFileSystem(IHXValues* pOptions)
{
    return HXR_OK;
}

STDMETHODIMP CASFFileSystem::CreateFile(IUnknown** ppFileObject)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppFileObject)
    {
        CASFFileObject* pObj = new CASFFileObject(m_pContext);
        if (pObj)
        {
            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppFileObject);
        }
        if (FAILED(retVal))
        {
            HX_DELETE(pObj);
        }
    }

    return retVal;
}

STDMETHODIMP CASFFileSystem::CreateDir(IUnknown** ppDirObject)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

HX_RESULT STDAPICALLTYPE CASFFileSystem::HXCreateFSInstance(IUnknown** ppIUnknown)
{
    HX_RESULT retVal = HXR_FAIL;

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

    return retVal;
}

CASFFileObject::CASFFileObject(IUnknown* pContext)
    : m_lRefCount(0)
      ,m_pContext(pContext)
      ,m_pRequest(NULL)
      ,m_pResponse(NULL)
      ,m_bFirstRead(TRUE)
{
    HX_ADDREF(m_pContext);
}

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

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

    if (ppvObj)
    {
        // Set defaults
        *ppvObj = NULL;
        retVal  = HXR_OK;
        // Switch on iid
        if (IsEqualIID(riid, IID_IUnknown))
        {
            *ppvObj = (IUnknown*) (IHXFileObject*) this;
        }
        else if (IsEqualIID(riid, IID_IHXFileObject))
        {
            *ppvObj = (IHXFileObject*) this;
        }
        else if (IsEqualIID(riid, IID_IHXFileStat))
        {
            *ppvObj = (IHXFileStat*) this;
        }
        else if (IsEqualIID(riid, IID_IHXFileExists))
        {
            *ppvObj = (IHXFileExists*) this;
        }
        else if(IsEqualIID(riid, IID_IHXRequestHandler))
        {
            *ppvObj = (IHXRequestHandler*) this;
        }
        else if(IsEqualIID(riid, IID_IHXFileMimeMapper))
        {
            *ppvObj = (IHXFileMimeMapper*) this;
        }
        else
        {
            retVal = HXR_NOINTERFACE;
        }
        if (SUCCEEDED(retVal))
        {
            AddRef();
        }
    }

    return retVal;
}

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

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

    delete this;

    return 0;
}

STDMETHODIMP CASFFileObject::Init(ULONG32 ulFlags, IHXFileResponse* pResponse)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pResponse)
    {
        // Clear the return value
        retVal = HXR_OK;
        // Save the response
        HX_RELEASE(m_pResponse);
        m_pResponse = pResponse;
        m_pResponse->AddRef();
        // Call back to the response
        pResponse->InitDone(HXR_OK);
    }

    return retVal;
}

STDMETHODIMP CASFFileObject::GetFilename(REF(const char*) rpszFilename)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

STDMETHODIMP CASFFileObject::Close()
{
    HX_RELEASE(m_pContext);
    HX_RELEASE(m_pRequest);
    HX_RELEASE(m_pResponse);

    return HXR_OK;
}

STDMETHODIMP CASFFileObject::Read(ULONG32 ulCount)
{
    HX_RESULT retVal = HXR_FAIL;

    if (m_pContext && m_pResponse)
    {
        if (m_bFirstRead)
        {
            // Clear the first read flag
            m_bFirstRead = FALSE;
            // Create a dummy IHXBuffer
            BYTE       ucDummy[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
            IHXBuffer* pBuf       = NULL;
            retVal = CreateAndSetBufferCCF(pBuf, &ucDummy[0], 8, m_pContext);
            if (SUCCEEDED(retVal))
            {
                // Call back to response
                m_pResponse->ReadDone(HXR_OK, pBuf);
            }
            HX_RELEASE(pBuf);
        }
        else
        {
            // Call back to response
            m_pResponse->ReadDone(HXR_FAIL, NULL);
            // Clear the return value
            retVal = HXR_OK;
        }
    }

    return retVal;
}

STDMETHODIMP CASFFileObject::Write(IHXBuffer* pBuffer)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

STDMETHODIMP CASFFileObject::Seek(ULONG32 ulOffset, HXBOOL bRelative)
{
    HX_RESULT retVal = HXR_FAIL;

    if (m_pResponse)
    {
        m_pResponse->SeekDone(HXR_OK);
        retVal = HXR_OK;
    }

    return retVal;
}

STDMETHODIMP CASFFileObject::Stat(IHXFileStatResponse* pFileStatResponse)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

STDMETHODIMP CASFFileObject::Advise(ULONG32 ulInfo)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

STDMETHODIMP CASFFileObject::DoesExist(const char* pszPath, IHXFileExistsResponse* pFileResponse)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

STDMETHODIMP CASFFileObject::SetRequest(IHXRequest* pRequest)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pRequest)
    {
        HX_RELEASE(m_pRequest);
        m_pRequest = pRequest;
        m_pRequest->AddRef();
        retVal = HXR_OK;
    }

    return retVal;
}

STDMETHODIMP CASFFileObject::GetRequest(REF(IHXRequest*) rpRequest)
{
    HX_RESULT retVal = HXR_FAIL;

    if (m_pRequest)
    {
        rpRequest = m_pRequest;
        rpRequest->AddRef();
        retVal = HXR_OK;
    }

    return retVal;
}

STDMETHODIMP CASFFileObject::FindMimeType(const char* pszURL, IHXFileMimeMapperResponse* pMimeMapperResponse)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pMimeMapperResponse)
    {
        retVal = pMimeMapperResponse->MimeTypeFound(HXR_OK, m_pszMimeType);
    }

    return retVal;
}



From ehyche at helixcommunity.org  Fri Feb  3 14:16:14 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri Feb  3 16:31:24 2006
Subject: [Datatype-cvs] asf/fileformat/pub/platform/win32 asf_rule_state.h,
	NONE, 1.1 asf_file_format_wmfsdk.h, 1.3, 1.4 hxwmreader.h, 1.2,
	1.3 ihxwmreader.h, 1.1, 1.2 ihxwmreader_response.h, 1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/asf/fileformat/pub/platform/win32
In directory cvs:/tmp/cvs-serv8180/pub/platform/win32

Modified Files:
	asf_file_format_wmfsdk.h hxwmreader.h ihxwmreader.h 
	ihxwmreader_response.h 
Added Files:
	asf_rule_state.h 
Log Message:
Multi-rate support in WMF-SDK-based ASF fileformat.


Index: ihxwmreader_response.h
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/pub/platform/win32/ihxwmreader_response.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ihxwmreader_response.h	13 Jan 2006 18:27:08 -0000	1.1
+++ ihxwmreader_response.h	3 Feb 2006 22:16:12 -0000	1.2
@@ -55,12 +55,13 @@
     STDMETHOD_(ULONG32,Release) (THIS) PURE;
 
     // IHXWMReaderResponse methods
-    STDMETHOD(OpenDone)    (THIS_ HX_RESULT status) PURE;
-    STDMETHOD(StartDone)   (THIS_ HX_RESULT status) PURE;
-    STDMETHOD(OnTime)      (THIS_ UINT32 ulTime) PURE;
-    STDMETHOD(OnPacket)    (THIS_ IHXPacket* pPacket) PURE;
-    STDMETHOD(OnEndOfFile) (THIS) PURE;
-    STDMETHOD(StopDone)    (THIS_ HX_RESULT status) PURE;
+    STDMETHOD(OpenDone)             (THIS_ HX_RESULT status) PURE;
+    STDMETHOD(StartDone)            (THIS_ HX_RESULT status) PURE;
+    STDMETHOD(OnTime)               (THIS_ UINT32 ulTime) PURE;
+    STDMETHOD(OnPacket)             (THIS_ IHXPacket* pPacket) PURE;
+    STDMETHOD(OnSubscriptionChange) (THIS_ UINT16 usStreamNum, UINT16 usNumRules, HXBOOL* pbSubscribed) PURE;
+    STDMETHOD(OnEndOfFile)          (THIS) PURE;
+    STDMETHOD(StopDone)             (THIS_ HX_RESULT status) PURE;
 };
 
 #endif /* #ifndef IHXWMREADER_RESPONSE_H */

Index: ihxwmreader.h
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/pub/platform/win32/ihxwmreader.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ihxwmreader.h	13 Jan 2006 18:27:08 -0000	1.1
+++ ihxwmreader.h	3 Feb 2006 22:16:12 -0000	1.2
@@ -63,6 +63,8 @@
                                                 IHXWMReaderResponse* pResponse) PURE;
     STDMETHOD(GetFileHeader)             (THIS_ REF(IHXValues*) rpFileHeader) PURE;
     STDMETHOD(GetStreamHeader)           (THIS_ UINT16 i, REF(IHXValues*) rpStreamHeader) PURE;
+    STDMETHOD(Subscribe)                 (THIS_ UINT16 i, UINT16 usRuleNum) PURE;
+    STDMETHOD(Unsubscribe)               (THIS_ UINT16 i, UINT16 usRuleNum) PURE;
     STDMETHOD(Start)                     (THIS_ UINT32 ulStartTime, UINT32 ulStopTime) PURE;
     STDMETHOD_(HXBOOL,UserProvidedClock) (THIS) PURE;
     STDMETHOD(DeliverTime)               (THIS_ UINT32 ulTime) PURE;

Index: asf_file_format_wmfsdk.h
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/pub/platform/win32/asf_file_format_wmfsdk.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- asf_file_format_wmfsdk.h	13 Jan 2006 18:27:08 -0000	1.3
+++ asf_file_format_wmfsdk.h	3 Feb 2006 22:16:12 -0000	1.4
@@ -38,6 +38,7 @@
 
 #include "asf_file_format_base.h"
 #include "ihxwmreader_response.h"
+#include "hxasm.h"
 
 // Forward declarations
 _INTERFACE IHXRequest;
@@ -48,6 +49,7 @@
 class CHXGenericCallback;
 class HXMutex;
 class CHXSimpleList;
+class CASFRuleState;
 
 // Defines
 #define HXWMREADER_DELIVER_TIME_INCREMENT 1000  // 1 second
@@ -61,11 +63,13 @@
     void ClearPacketQueue();
 
     CHXSimpleList* m_pPacketQueue;
+    CASFRuleState* m_pRuleState;
     HXBOOL         m_bPacketRequested;
     HXBOOL         m_bStreamDone;
 };
 
 class CASFFileFormatWMFSDK : public CASFFileFormatBase,
+                             public IHXASMSource,
                              public IHXWMReaderResponse
 {
 public:
@@ -87,13 +91,18 @@
     STDMETHOD(GetPacket)         (THIS_ UINT16 unStreamNumber);
     STDMETHOD(Seek)              (THIS_ ULONG32 ulOffset);
 
+    // IHXASMSource methods
+    STDMETHOD(Subscribe)   (THIS_ UINT16 uStreamNumber, UINT16 uRuleNumber);
+    STDMETHOD(Unsubscribe) (THIS_ UINT16 uStreamNumber, UINT16 uRuleNumber);
+
     // IHXWMReaderResponse methods
-    STDMETHOD(OpenDone)    (THIS_ HX_RESULT status);
-    STDMETHOD(StartDone)   (THIS_ HX_RESULT status);
-    STDMETHOD(OnTime)      (THIS_ UINT32 ulTime);
-    STDMETHOD(OnPacket)    (THIS_ IHXPacket* pPacket);
-    STDMETHOD(OnEndOfFile) (THIS);
-    STDMETHOD(StopDone)    (THIS_ HX_RESULT status);
+    STDMETHOD(OpenDone)             (THIS_ HX_RESULT status);
+    STDMETHOD(StartDone)            (THIS_ HX_RESULT status);
+    STDMETHOD(OnTime)               (THIS_ UINT32 ulTime);
+    STDMETHOD(OnPacket)             (THIS_ IHXPacket* pPacket);
+    STDMETHOD(OnSubscriptionChange) (THIS_ UINT16 usStreamNum, UINT16 usNumRules, HXBOOL* pbSubscribed);
+    STDMETHOD(OnEndOfFile)          (THIS);
+    STDMETHOD(StopDone)             (THIS_ HX_RESULT status);
 
     // CASFFileFormatWMFSDK methods
     static HX_RESULT STDAPICALLTYPE HXCreateFFInstance(IUnknown** ppIUnknown);
@@ -111,6 +120,8 @@
     CASFStreamInfo*     m_pStreamInfo;
     IHXWMReader*        m_pReader;
     HXMutex*            m_pPacketQueueMutex;
+    CHXSimpleList*      m_pSubChangeQueue;
+    HXMutex*            m_pSubChangeQueueMutex;
     HX_RESULT           m_status;
     UINT16              m_usNumStreams;
     UINT32              m_ulStartTime;
@@ -121,15 +132,24 @@
     HXBOOL              m_bReaderStarted;
     HXBOOL              m_bReaderStartDonePending;
     HXBOOL              m_bEndOfFile;
+#if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION)
+    UINT32              m_ulLastSwitchTick;
+    UINT32              m_ulSwitchInterval;
+    void                InitTestStreamSwitch();
+    void                CheckTestStreamSwitch();
+#endif /* #if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION) */
 
     static void  CallbackStaticFunc(void* pParam);
     HXBOOL       AnyPacketsToDeliverOnStream(UINT16 usStreamNum);
     HXBOOL       AnyPacketsToDeliver();
     HXBOOL       SendPacketFromThisQueue(UINT16 usStreamNum);
     HXBOOL       SendPacketFromAnyQueue();
-    HX_RESULT    AddPacketToQueue(CHXSimpleList*& rpList, IHXPacket* pPacket);
     void         ScheduleCallbackIfNecessary();
     void         HandleGetPacket(HXBOOL bCheckForEOF, UINT16 usStreamNum);
+    void         ClearSubChangeQueue();
+    void         CheckSubcriptionChangeQueue();
+    HX_RESULT    HandleSubscriptionChange(CASFRuleState* pState);
+    HX_RESULT    GetStreamHeaderInfo(IHXValues* pHdr, UINT16* pusNumSubStreams);
 };
 
 #endif /* #ifndef ASF_FILE_FORMAT_WMFSDK_H */

--- NEW FILE: asf_rule_state.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 ASF_RULE_STATE_H
#define ASF_RULE_STATE_H

class CASFRuleState
{
public:
    CASFRuleState(UINT16 usStreamNum, UINT16 usNumRules); // initialize all to unsubscribed
    CASFRuleState(UINT16 usStreamNum, UINT16 usNumRules, HXBOOL* pbSub);
    ~CASFRuleState();

    UINT16    GetStreamNum() const { return m_usStreamNum; }
    UINT16    GetNumRules() const { return m_usNumRules; }
    HX_RESULT SetSubscribedState(UINT16 usRuleNum, HXBOOL bSubscribed);
    HXBOOL    IsSubscribed(UINT16 usRule) const;
    HXBOOL    IsSubStreamSubscribed(UINT16 usSubStreamIndex) const;
    HX_RESULT CopyFrom(CASFRuleState* pState);
    HXBOOL    IsStateSame(CASFRuleState* pState) const;
    HXBOOL    IsOnlyOneSubStreamSubscribed() const;
private:
    UINT16  m_usStreamNum;
    UINT16  m_usNumRules;
    HXBOOL* m_pbSubscribed;
};

#endif /* #ifndef ASF_RULE_STATE_H */

Index: hxwmreader.h
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/pub/platform/win32/hxwmreader.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hxwmreader.h	27 Jan 2006 20:51:41 -0000	1.2
+++ hxwmreader.h	3 Feb 2006 22:16:12 -0000	1.3
@@ -46,6 +46,7 @@
 _INTERFACE IHXValues;
 _INTERFACE IHXBuffer;
 class CIStreamIHXFileObject;
+class CASFRuleState;
 
 class CWMReaderStreamInfo
 {
@@ -54,8 +55,10 @@
     ~CWMReaderStreamInfo();
 
     UINT16         m_usNumWMStreams;    // Number of WM streams which map to this Helix stream
-    UINT16         m_usWMStreamNumber;  // If m_usNumWMStreams == 1, WM stream number, otherwise 0.
-    UINT16*        m_pusWMStreamNumber; // If m_usNumWMStreams > 1, array of WM stream numbers, otherwise NULL.
+    UINT16*        m_pusWMStreamNumber;
+    UINT32*        m_pulBitRate;
+    UINT32*        m_pulPreroll;
+    CASFRuleState* m_pRuleState;
     IHXValues*     m_pStreamHeader;
 };
 
@@ -80,6 +83,8 @@
                                                 IHXWMReaderResponse* pResponse);
     STDMETHOD(GetFileHeader)             (THIS_ REF(IHXValues*) rpFileHeader);
     STDMETHOD(GetStreamHeader)           (THIS_ UINT16 i, REF(IHXValues*) rpStreamHeader);
+    STDMETHOD(Subscribe)                 (THIS_ UINT16 i, UINT16 usRuleNum);
+    STDMETHOD(Unsubscribe)               (THIS_ UINT16 i, UINT16 usRuleNum);
     STDMETHOD(Start)                     (THIS_ UINT32 ulStartTime, UINT32 ulStopTime);
     STDMETHOD_(HXBOOL,UserProvidedClock) (THIS) { return m_bUserProvidedClock; }
     STDMETHOD(DeliverTime)               (THIS_ UINT32 ulTime);
@@ -164,10 +169,12 @@
     HANDLE                 m_hUserResumeEvent;
     HANDLE                 m_hUserStopEvent;
     HANDLE                 m_hUserCloseEvent;
+    HANDLE                 m_hUserSubscribeEvent;
     HANDLE                 m_hReaderOpenedEvent;
     HANDLE                 m_hReaderClosedEvent;
     HANDLE                 m_hThreadFinishEvent;
     HANDLE                 m_hThread;
+    CRITICAL_SECTION       m_csRuleState;
     UINT32                 m_ulThreadID;
     QWORD                  m_qStartTime;
     QWORD                  m_qStopTime;
@@ -176,6 +183,7 @@
     HXBOOL                 m_bUserProvidedClock;
     HXBOOL                 m_bIsDRMProtected;
     BYTE                   m_pucWM2HXStreamNumberMap[64]; // WM Stream Index to Helix Stream Index
+    BYTE                   m_pucWM2HXSubStreamIndexMap[64]; // WM Stream Index to Helix substream index
 
     static const HelixWMAttributeNamePair m_pAttributeNameMap[];
     static const char* const              m_pWMReaderEventName[WMT_PROXIMITY_COMPLETED + 1];
@@ -234,6 +242,9 @@
                                         REF(HXBOOL) rbMetaDataRequested, REF(IHXValues*) rpInfo,
                                         REF(HXBOOL) rbAllInfo);
     HX_RESULT    ThreadFunc();
+    HX_RESULT    SortSubStreamsByBitRate();
+    HX_RESULT    SetRuleState(UINT16 usHXStreamNum, UINT16 usRuleNum, HXBOOL bSubscribed);
+    HX_RESULT    CallSetStreamsSelected();
 
     // Thread function
     static DWORD WINAPI ThreadStaticFunc(void* pParam);
@@ -246,4 +257,9 @@
         (a) = NULL;          \
     }
 
+#define HX_SWAP_XOR(x, y)  \
+    (x) ^= (y);            \
+    (y) ^= (x);            \
+    (x) ^= (y)
+
 #endif /* #ifndef HXWMREADER_H */


From ehyche at helixcommunity.org  Fri Feb  3 14:16:14 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri Feb  3 16:31:25 2006
Subject: [Datatype-cvs] asf/fileformat/platform/win32 asf_rule_state.cpp,
	NONE, 1.1 asf_file_format_wmfsdk.cpp, 1.4, 1.5 hxwmreader.cpp,
	1.3, 1.4
Message-ID: 

Update of /cvsroot/datatype/asf/fileformat/platform/win32
In directory cvs:/tmp/cvs-serv8180/platform/win32

Modified Files:
	asf_file_format_wmfsdk.cpp hxwmreader.cpp 
Added Files:
	asf_rule_state.cpp 
Log Message:
Multi-rate support in WMF-SDK-based ASF fileformat.


Index: hxwmreader.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/platform/win32/hxwmreader.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hxwmreader.cpp	30 Jan 2006 15:24:05 -0000	1.3
+++ hxwmreader.cpp	3 Feb 2006 22:16:11 -0000	1.4
@@ -46,14 +46,19 @@
 #include "rule2flg.h"
 #include "hxpacketflags.h"
 #include "ihx_inss_buffer.h"
-#define HELIX_FEATURE_LOGLEVEL_NONE // comment out this line to turn on logging
+//#define HELIX_FEATURE_LOGLEVEL_NONE // comment out this line to turn on logging
 #include "hxtlogutil.h"
 #include "istream_fileobject.h"
 #include "ihxwmreader.h"
 #include "ihxwmreader_response.h"
 #include "set_debugger_thread_name.h"
+#include "asf_rule_state.h"
 #include "hxwmreader.h"
 
+#define HXWMREADER_MAXSTRLEN_UINT32  10  // strlen("4294967295") where 4294967295 is MAX_UINT32
+#define HXWMREADER_MAXSTRLEN_UINT16   5  // strlen("65535") where 65535 is MAX_UINT16
+
+
 const CHXWMReader::HelixWMAttributeNamePair CHXWMReader::m_pAttributeNameMap[] =
 {
     {g_wszWMAlbumArtist,                 "Performer"       },
@@ -133,16 +138,20 @@
 CWMReaderStreamInfo::CWMReaderStreamInfo()
 {
     m_usNumWMStreams    = 0;
-    m_usWMStreamNumber  = 0;
     m_pusWMStreamNumber = NULL;
+    m_pulBitRate        = NULL;
+    m_pulPreroll        = NULL;
+    m_pRuleState        = NULL;
     m_pStreamHeader     = NULL;
 }
 
 CWMReaderStreamInfo::~CWMReaderStreamInfo()
 {
     m_usNumWMStreams    = 0;
-    m_usWMStreamNumber  = 0;
     HX_VECTOR_DELETE(m_pusWMStreamNumber);
+    HX_VECTOR_DELETE(m_pulBitRate);
+    HX_VECTOR_DELETE(m_pulPreroll);
+    HX_DELETE(m_pRuleState);
     HX_RELEASE(m_pStreamHeader);
 }
 
@@ -167,6 +176,7 @@
     m_hUserResumeEvent      = NULL;
     m_hUserStopEvent        = NULL;
     m_hUserCloseEvent       = NULL;
+    m_hUserSubscribeEvent   = NULL;
     m_hReaderOpenedEvent    = NULL;
     m_hReaderClosedEvent    = NULL;
     m_hThreadFinishEvent    = NULL;
@@ -179,11 +189,15 @@
     m_bUserProvidedClock    = FALSE;
     m_bIsDRMProtected       = FALSE;
     memset(m_pucWM2HXStreamNumberMap, 255, 64);
+    memset(m_pucWM2HXSubStreamIndexMap, 255, 64);
+    // Initialize the rule state critical section
+    ::InitializeCriticalSection(&m_csRuleState);
 }
 
 CHXWMReader::~CHXWMReader()
 {
     Close();
+    ::DeleteCriticalSection(&m_csRuleState);
 }
 
 STDMETHODIMP CHXWMReader::QueryInterface(REFIID riid, void** ppvObj)
@@ -271,12 +285,14 @@
         m_hUserResumeEvent      = ::CreateEvent(NULL, FALSE, FALSE, NULL);
         m_hUserStopEvent        = ::CreateEvent(NULL, FALSE, FALSE, NULL);
         m_hUserCloseEvent       = ::CreateEvent(NULL, FALSE, FALSE, NULL);
+        m_hUserSubscribeEvent   = ::CreateEvent(NULL, FALSE, FALSE, NULL);
         m_hReaderOpenedEvent    = ::CreateEvent(NULL, FALSE, FALSE, NULL);
         m_hReaderClosedEvent    = ::CreateEvent(NULL, FALSE, FALSE, NULL);
         m_hThreadFinishEvent    = ::CreateEvent(NULL, TRUE,  FALSE, NULL); // manual reset
         if (m_hUserStartEvent && m_hUserDeliverTimeEvent && m_hUserPauseEvent &&
             m_hUserResumeEvent && m_hUserStopEvent && m_hUserCloseEvent &&
-            m_hReaderOpenedEvent && m_hReaderClosedEvent && m_hThreadFinishEvent)
+            m_hReaderOpenedEvent && m_hReaderClosedEvent && m_hThreadFinishEvent &&
+            m_hUserSubscribeEvent)
         {
             // Start the thread. We will marshal
             // all calls to the WMReader to this thread
@@ -331,6 +347,18 @@
     return retVal;
 }
 
+STDMETHODIMP CHXWMReader::Subscribe(UINT16 i, UINT16 usRuleNum)
+{
+    HXLOGL3(HXLOG_ASFF, "CHXWMReader::Subscribe(%u,%u)", i, usRuleNum);
+    return SetRuleState(i, usRuleNum, TRUE);
+}
+
+STDMETHODIMP CHXWMReader::Unsubscribe(UINT16 i, UINT16 usRuleNum)
+{
+    HXLOGL3(HXLOG_ASFF, "CHXWMReader::Unsubscribe(%u,%u)", i, usRuleNum);
+    return SetRuleState(i, usRuleNum, FALSE);
+}
+
 STDMETHODIMP CHXWMReader::Start(UINT32 ulStartTime, UINT32 ulStopTime)
 {
     HXLOGL3(HXLOG_ASFF, "CHXWMReader::Start(%lu,%lu)", ulStartTime, ulStopTime);
@@ -455,6 +483,7 @@
     HX_CLOSE_HANDLE(m_hUserResumeEvent);
     HX_CLOSE_HANDLE(m_hUserStopEvent);
     HX_CLOSE_HANDLE(m_hUserCloseEvent);
+    HX_CLOSE_HANDLE(m_hUserSubscribeEvent);
     HX_CLOSE_HANDLE(m_hReaderOpenedEvent);
     HX_CLOSE_HANDLE(m_hReaderClosedEvent);
     HX_CLOSE_HANDLE(m_hThreadFinishEvent);
@@ -479,6 +508,7 @@
     m_bUserProvidedClock = FALSE;
     m_bIsDRMProtected    = FALSE;
     memset(m_pucWM2HXStreamNumberMap, 255, 64);
+    memset(m_pucWM2HXSubStreamIndexMap, 255, 64);
 
     return retVal;
 }
@@ -574,7 +604,8 @@
     HXLOGL4(HXLOG_ASFF, "OnTime(%I64u,0x%08x)", cnsCurrentTime, pvContext);
 
     // Convert to milliseconds
-    UINT32 ulCurrentTime = (UINT32) cnsCurrentTime / 10000;
+    QWORD  qwCurrentTimeMs = cnsCurrentTime / ((QWORD) 10000);
+    UINT32 ulCurrentTime   = (UINT32) qwCurrentTimeMs;
     // Pass to the response interface
     if (m_pResponse)
     {
@@ -590,6 +621,90 @@
                                        void*                 pvContext)
 {
     HXLOGL3(HXLOG_ASFF, "OnStreamSelection(%u,,,0x%08x)", wStreamCount, pvContext);
+
+#if 0
+    if (wStreamCount && pStreamNumbers && pSelections)
+    {
+        // These WM stream numbers could cross multiple HX streams. However,
+        // the call we need to make to IHXWMReaderResponse is on a per-stream
+        // basis. Therefore, we will run through each HX stream. We may or
+        // may not make a call to IHXWMReaderResponse::OnSubscriptionChange()
+        // for each HX stream.
+        UINT16    i  = 0;
+        UINT16    j  = 0;
+        UINT16    k  = 0;
+        HX_RESULT rv = HXR_OK;
+        for (i = 0; i < m_usHXStreamCount && SUCCEEDED(rv); i++)
+        {
+            // Count the number of WM streams which have map to this HX stream
+            UINT16 usNumWMStreamsInSelection = 0;
+            for (j = 0; j < wStreamCount && SUCCEEDED(rv); j++)
+            {
+                UINT16 usHXStreamNum = 0;
+                rv = GetHXStreamNumber(pStreamNumbers[j], &usHXStreamNum);
+                if (SUCCEEDED(rv))
+                {
+                    if (usHXStreamNum == i)
+                    {
+                        usNumWMStreamsInSelection++;
+                    }
+                }
+            }
+            if (SUCCEEDED(rv))
+            {
+                // Were there *any* streams that mapped to this HX stream?
+                // It's perfectly OK if there are not any.
+                if (usNumWMStreamsInSelection)
+                {
+                    // Get the number of WM streams for this HX stream i
+                    UINT16 usNumWMStreams = 0;
+                    rv = GetNumWMStreams(i, &usNumWMStreams);
+                    if (SUCCEEDED(rv))
+                    {
+                        // We assume that the WM reader will inform us simultaneously
+                        // about each WM stream involved in a mutual exclusion. That way,
+                        // we don't have to maintain state here on each stream. Now we
+                        // will verify this assumption.
+                        if (usNumWMStreams == usNumWMStreamsInSelection)
+                        {
+                            // Construct an array of HXBOOLs for each rule for this
+                            // stream. The number of rules is twice the number of
+                            // WM streams.
+                            UINT16  usNumRules = usNumWMStreams * 2;
+                            HXBOOL* pbSub      = new HXBOOL [usNumRules];
+                            if  (pbSub)
+                            {
+                                // Now run through each of the stream numbers and 
+                                // fill in the appropriate rules
+                                for (j = 0; j < wStreamCount && SUCCEEDED(rv); j++)
+                                {
+                                    UINT16 usHXStreamNum = 0;
+                                    rv = GetHXStreamNumber(pStreamNumbers[j], &usHXStreamNum);
+                                    if (SUCCEEDED(rv))
+                                    {
+                                        if (usHXStreamNum == i)
+                                        {
+                                        }
+                                    }
+                                }
+                            }
+                            else
+                            {
+                                rv = HXR_OUTOFMEMORY;
+                            }
+                        }
+                        else
+                        {
+                            HX_ASSERT(usNumWMStreams == usNumWMStreamsInSelection);
+                            rv = HXR_FAIL;
+                        }
+                    }
+                }
+            }
+        }
+    }
+#endif
+
     return S_OK;
 }
 
@@ -640,8 +755,22 @@
             rv = GetURLFromRequest(m_pRequest, m_pURLStr, m_pURLWideStr);
             if (SUCCEEDED(rv))
             {
+                // Get the scheme of the URL
+                CHXString cURL((const char*) m_pURLStr->GetBuffer());
+                CHXString cExt;
+                INT32 lColon = cURL.Find(':');
+                if (lColon >= 0)
+                {
+                    cExt = cURL.Left(lColon);
+                }
                 // Do we have a file object?
-                if (m_pFileObject)
+                // XXXMEH - later we will make changes to the core so that
+                // file format plugins can claim protocols. Then it will
+                // be legal to pass in a NULL file object to a file format
+                // plugin. Until then, However, we need to check the scheme
+                // of the URL. If it is "mms" or "rtsp", then we need to
+                // use IWMReader::Open() instead of IWMReaderAdvanced::OpenStream().
+                if (m_pFileObject && cExt != "mms" && cExt != "rtsp")
                 {
                     // We have a file object, so open the reader using IWMReaderAdvanced2::OpenStream().
                     //
@@ -682,10 +811,33 @@
                     if (SUCCEEDED(rv))
                     {
                         // Get all the stream headers
+                        HXBOOL bAtLeastOneStreamIsMultiRate = FALSE;
                         for (UINT16 i = 0; i < m_usHXStreamCount && SUCCEEDED(rv); i++)
                         {
                             HX_RELEASE(m_pStreamInfo[i].m_pStreamHeader);
                             rv = CreateStreamHeader(i, m_pStreamInfo[i].m_pStreamHeader);
+                            if (SUCCEEDED(rv))
+                            {
+                                // Get the number of WM streams associated with this HX stream
+                                UINT16 usNumWMStreams = 0;
+                                GetNumWMStreams(i, &usNumWMStreams);
+                                // If there are more than one WM stream are associated
+                                // with this stream, then we need to receive stream
+                                // selection callbacks
+                                if (usNumWMStreams > 1)
+                                {
+                                    bAtLeastOneStreamIsMultiRate = TRUE;
+                                }
+                            }
+                        }
+                        if (SUCCEEDED(rv) && bAtLeastOneStreamIsMultiRate)
+                        {
+                            // Call IWMReaderAdvanced::SetReceiveSelectionCallbacks() to
+                            // let the reader know we need to receive a callback
+                            // whenever stream selection occurs
+                            m_pReaderAdvanced2->SetReceiveSelectionCallbacks(TRUE);
+                            // We will manually control stream selection
+                            m_pReaderAdvanced2->SetManualStreamSelection(TRUE);
                         }
                     }
                 }
@@ -1029,6 +1181,11 @@
                 // is involved in two different mutual exclusions.
                 BYTE ucMutExMap[64];
                 memset(&ucMutExMap[0], 255, 64);
+                // Now set up the map from WM stream number to Helix stream number
+                // Initialize each entry to 255, which means this WM stream number
+                // does not map to a Helix stream number.
+                memset(&m_pucWM2HXStreamNumberMap[0], 255, 64);
+                memset(&m_pucWM2HXSubStreamIndexMap[0], 255, 64);
                 // Get the number of mutual exclusions
                 UINT32 ulMutualExclusionCount = 0;
                 hr = pProfile->GetMutualExclusionCount(&ulMutualExclusionCount);
@@ -1042,59 +1199,70 @@
                         hr = pProfile->GetMutualExclusion(i, &pMutEx);
                         if (hr == S_OK)
                         {
-                            // Get the number of streams in the mutual exclusion
-                            UINT16 usNumStreams = 0;
-                            hr = pMutEx->GetStreams(NULL, &usNumStreams);
+                            // Get the type of this mutual exclusion
+                            GUID guidMutExType;
+                            hr = pMutEx->GetType(&guidMutExType);
                             if (hr == S_OK)
                             {
-                                // Set this number into the HX stream number map
-                                pInfo[ulNumHXStreams].m_usNumWMStreams = usNumStreams;
-                                // Is the number of streams in this mutual exclusion > 1?
-                                UINT16* pStreamNumArray = NULL;
-                                if (usNumStreams > 1)
-                                {
-                                    // Allocate an array to hold the stream numbers
-                                    pStreamNumArray = new UINT16 [usNumStreams];
-                                }
-                                else
-                                {
-                                    // Just use the single entry in the map
-                                    pStreamNumArray = &pInfo[ulNumHXStreams].m_usWMStreamNumber;
-                                }
-                                if (pStreamNumArray)
+                                // Set the return value
+                                hr = E_FAIL;
+                                // We currently only support mutual exclusions
+                                // based on bitrate, not on presentation, language
+                                // or custom.
+                                HX_ASSERT(guidMutExType == CLSID_WMMUTEX_Bitrate);
+                                if (guidMutExType == CLSID_WMMUTEX_Bitrate)
                                 {
-                                    // Get the stream numbers
-                                    hr = pMutEx->GetStreams(pStreamNumArray, &usNumStreams);
+                                    // Get the number of streams in the mutual exclusion
+                                    UINT16 usNumStreams = 0;
+                                    hr = pMutEx->GetStreams(NULL, &usNumStreams);
                                     if (hr == S_OK)
                                     {
-                                        // Now set the stream numbers into the map
-                                        UINT16 j = 0;
-                                        for (j = 0; j < usNumStreams; j++)
+                                        // Set this number into the HX stream number map
+                                        pInfo[ulNumHXStreams].m_usNumWMStreams = usNumStreams;
+                                        // Allocate an array of WM stream numbers
+                                        pInfo[ulNumHXStreams].m_pusWMStreamNumber = new UINT16 [usNumStreams];
+                                        // Allocate an array of bitrates
+                                        pInfo[ulNumHXStreams].m_pulBitRate = new UINT32 [usNumStreams];
+                                        // Allocate an array of prerolls
+                                        pInfo[ulNumHXStreams].m_pulPreroll = new UINT32 [usNumStreams];
+                                        // Allocate a rule state
+                                        pInfo[ulNumHXStreams].m_pRuleState = new CASFRuleState((UINT16) ulNumHXStreams, usNumStreams * 2);
+                                        // Check that we allocated correctly
+                                        if (pInfo[ulNumHXStreams].m_pusWMStreamNumber &&
+                                            pInfo[ulNumHXStreams].m_pulBitRate        &&
+                                            pInfo[ulNumHXStreams].m_pulPreroll        &&
+                                            pInfo[ulNumHXStreams].m_pRuleState)
                                         {
-                                            // Get the stream number
-                                            UINT16 usStreamNum = pStreamNumArray[j];
-                                            // Assume that no stream is involved in more than one mutual exclusion.
-                                            // Not being 255 means that this stream number has already been mapped
-                                            // to a mutual exclusion index.
-                                            HX_ASSERT(ucMutExMap[usStreamNum] == 255);
-                                            ucMutExMap[usStreamNum] = (BYTE) i;
+                                            // Get the stream numbers
+                                            hr = pMutEx->GetStreams(pInfo[ulNumHXStreams].m_pusWMStreamNumber, &usNumStreams);
+                                            if (hr == S_OK)
+                                            {
+                                                // Now set the stream numbers into the map
+                                                UINT16 j = 0;
+                                                for (j = 0; j < usNumStreams; j++)
+                                                {
+                                                    // Get the stream number
+                                                    UINT16 usWMStreamNum = pInfo[ulNumHXStreams].m_pusWMStreamNumber[j];
+                                                    // Set this entry into the WMStreamNum -> HXStreamNum map
+                                                    m_pucWM2HXStreamNumberMap[usWMStreamNum] = (BYTE) ulNumHXStreams;
+                                                    // Set this entry into the WMStreamNum -> HX Substream map
+                                                    m_pucWM2HXSubStreamIndexMap[usWMStreamNum] = (BYTE) j;
+                                                    // Assume that no stream is involved in more than one mutual exclusion.
+                                                    // Not being 255 means that this stream number has already been mapped
+                                                    // to a mutual exclusion index.
+                                                    HX_ASSERT(ucMutExMap[usWMStreamNum] == 255);
+                                                    ucMutExMap[usWMStreamNum] = (BYTE) i;
+                                                }
+                                                // Increment the HX stream number counter
+                                                ulNumHXStreams++;
+                                            }
                                         }
-                                        // If the number of streams is > 1, then save
-                                        // the pointer into the struct. If it was equal to 1,
-                                        // then no memory was allocated and pStreamNumArray
-                                        // already points to the m_usWMStreamNumber member.
-                                        if (usNumStreams > 1)
+                                        else
                                         {
-                                            pInfo[ulNumHXStreams].m_pusWMStreamNumber = pStreamNumArray;
+                                            hr = E_OUTOFMEMORY;
                                         }
-                                        // Increment the HX stream number counter
-                                        ulNumHXStreams++;
                                     }
                                 }
-                                else
-                                {
-                                    hr = E_OUTOFMEMORY;
-                                }
                             }
                         }
                         HX_RELEASE(pMutEx);
@@ -1111,25 +1279,78 @@
                             hr = pProfile->GetStream(i, &pConfig);
                             if (hr == S_OK)
                             {
-                                // Get the stream number
-                                UINT16 usStreamNum = 0;
-                                hr = pConfig->GetStreamNumber(&usStreamNum);
+                                // Get the bitrate
+                                UINT32 ulBitRate = 0;
+                                hr = pConfig->GetBitrate(&ulBitRate);
                                 if (hr == S_OK)
                                 {
-                                    // Is this stream number already entered in the map (the
-                                    // map entry != 255), then we don't need to do anything.
-                                    // But if this stream number is not entered in the
-                                    // map, then this stream directly corresponds
-                                    // to a Helix stream.
-                                    if (ucMutExMap[usStreamNum] == 255)
+                                    // Get the preroll
+                                    UINT32 ulPreroll = 0;
+                                    hr = pConfig->GetBufferWindow(&ulPreroll);
+                                    if (hr == S_OK)
                                     {
-                                        // The number of WM streams for this Helix stream is 1
-                                        pInfo[ulNumHXStreams].m_usNumWMStreams = 1;
-                                        // Assign this stream number directly to the m_usWMStreamNumber,
-                                        // which leaves the m_pusWMStreamNumber member NULL
-                                        pInfo[ulNumHXStreams].m_usWMStreamNumber = usStreamNum;
-                                        // Increment the number of Helix streams
-                                        ulNumHXStreams++;
+                                        // Get the stream number
+                                        UINT16 usWMStreamNum = 0;
+                                        hr = pConfig->GetStreamNumber(&usWMStreamNum);
+                                        if (hr == S_OK)
+                                        {
+                                            // Is this stream number already entered in the map (the
+                                            // map entry != 255), then we don't need to do anything.
+                                            // But if this stream number is not entered in the
+                                            // map, then this stream directly corresponds
+                                            // to a Helix stream.
+                                            if (ucMutExMap[usWMStreamNum] == 255)
+                                            {
+                                                // The number of WM streams for this Helix stream is 1
+                                                UINT16 usNumWMStreams = 1;
+                                                pInfo[ulNumHXStreams].m_usNumWMStreams = usNumWMStreams;
+                                                // Allocate an array of WM stream numbers
+                                                pInfo[ulNumHXStreams].m_pusWMStreamNumber = new UINT16 [usNumWMStreams];
+                                                // Allocate an array of bitrates
+                                                pInfo[ulNumHXStreams].m_pulBitRate = new UINT32 [usNumWMStreams];
+                                                // Allocate an array of prerolls
+                                                pInfo[ulNumHXStreams].m_pulPreroll = new UINT32 [usNumWMStreams];
+                                                // Allocate a rule state
+                                                pInfo[ulNumHXStreams].m_pRuleState = new CASFRuleState((UINT16) ulNumHXStreams, usNumWMStreams * 2);
+                                                // Check that we allocated correctly
+                                                if (pInfo[ulNumHXStreams].m_pusWMStreamNumber &&
+                                                    pInfo[ulNumHXStreams].m_pulBitRate        &&
+                                                    pInfo[ulNumHXStreams].m_pulPreroll        &&
+                                                    pInfo[ulNumHXStreams].m_pRuleState)
+                                                {
+                                                    // Assign the stream number, bitrate, and preroll
+                                                    pInfo[ulNumHXStreams].m_pusWMStreamNumber[0] = usWMStreamNum;
+                                                    pInfo[ulNumHXStreams].m_pulBitRate[0]        = ulBitRate;
+                                                    pInfo[ulNumHXStreams].m_pulPreroll[0]        = ulPreroll;
+                                                    // Set this entry into the WMStreamNum -> HXStreamNum map
+                                                    m_pucWM2HXStreamNumberMap[usWMStreamNum] = (BYTE) ulNumHXStreams;
+                                                    // Set this entry into the WMStreamNum -> HX Substream map
+                                                    m_pucWM2HXSubStreamIndexMap[usWMStreamNum] = 0;
+                                                    // Increment the number of Helix streams
+                                                    ulNumHXStreams++;
+                                                }
+                                                else
+                                                {
+                                                    hr = E_OUTOFMEMORY;
+                                                }
+                                            }
+                                            else
+                                            {
+                                                // This is a WM stream already involved in
+                                                // a mutual exclusion. So we have already made entries
+                                                // into the WM -> HX maps, and we have already allocated
+                                                // the stream number, bitrate, and preroll arrays. So
+                                                // all we need to do is set the bitrate and preroll here.
+                                                //
+                                                // Get the HX stream number from the map
+                                                UINT16 usHXStreamNum = m_pucWM2HXStreamNumberMap[usWMStreamNum];
+                                                // Get the HX substream index from the map
+                                                UINT16 usSubStreamIndex = m_pucWM2HXSubStreamIndexMap[usWMStreamNum];
+                                                // Set the bitrate and preroll
+                                                pInfo[usHXStreamNum].m_pulBitRate[usSubStreamIndex] = ulBitRate;
+                                                pInfo[usHXStreamNum].m_pulPreroll[usSubStreamIndex] = ulPreroll;
+                                            }
+                                        }
                                     }
                                 }
                             }
@@ -1138,27 +1359,6 @@
                         // Make sure we didn't fail
                         if (hr == S_OK)
                         {
-                            // Now set up the map from WM stream number to Helix stream number
-                            // Initialize each entry to 255, which means this WM stream number
-                            // does not map to a Helix stream number.
-                            memset(&m_pucWM2HXStreamNumberMap[0], 255, 64);
-                            // Now set up the map. Loop through the HX streams
-                            for (i = 0; i < ulNumHXStreams; i++)
-                            {
-                                if (pInfo[i].m_usNumWMStreams > 1 &&
-                                    pInfo[i].m_pusWMStreamNumber)
-                                {
-                                    UINT16 j = 0;
-                                    for (j = 0; j < pInfo[i].m_usNumWMStreams; j++)
-                                    {
-                                        m_pucWM2HXStreamNumberMap[pInfo[i].m_pusWMStreamNumber[j]] = (BYTE) i;
-                                    }
-                                }
-                                else
-                                {
-                                    m_pucWM2HXStreamNumberMap[pInfo[i].m_usWMStreamNumber] = (BYTE) i;
-                                }
-                            }
                             // Now we can assign the member variables
                             m_usHXStreamCount  = (UINT16) ulNumHXStreams;
                             m_usWMStreamCount  = (UINT16) ulWMStreamCount;
@@ -1172,17 +1372,21 @@
                                 for (i = 0; i < ulNumHXStreams; i++)
                                 {
                                     pInfoCopy[i].m_usNumWMStreams    = pInfo[i].m_usNumWMStreams;
-                                    pInfoCopy[i].m_usWMStreamNumber  = pInfo[i].m_usWMStreamNumber;
                                     pInfoCopy[i].m_pusWMStreamNumber = pInfo[i].m_pusWMStreamNumber;
-                                    // NULL out the pInfo[i].m_pusWMStreamNumber, so it
-                                    // won't get deleted when pInfo[i] destructs
+                                    pInfoCopy[i].m_pulBitRate        = pInfo[i].m_pulBitRate;
+                                    pInfoCopy[i].m_pulPreroll        = pInfo[i].m_pulPreroll;
+                                    pInfoCopy[i].m_pRuleState        = pInfo[i].m_pRuleState;
+                                    // NULL out the src pointers
                                     pInfo[i].m_pusWMStreamNumber = NULL;
+                                    pInfo[i].m_pulBitRate        = NULL;
+                                    pInfo[i].m_pulPreroll        = NULL;
+                                    pInfo[i].m_pRuleState        = NULL;
                                 }
                                 // Copy into the member variable
                                 HX_VECTOR_DELETE(m_pStreamInfo);
                                 m_pStreamInfo = pInfoCopy;
-                                // Clear the return value
-                                retVal = HXR_OK;
+                                // Now sort the substreams by increasing bitrate
+                                retVal = SortSubStreamsByBitRate();
                             }
                         }
                     }
@@ -1515,19 +1719,11 @@
     HX_RESULT retVal = HXR_FAIL;
 
     if (m_pStreamInfo && usHXStreamNumber < m_usHXStreamCount &&
+        m_pStreamInfo[usHXStreamNumber].m_pusWMStreamNumber &&
         i < m_pStreamInfo[usHXStreamNumber].m_usNumWMStreams && pusWMStreamNumber)
     {
-        if (m_pStreamInfo[usHXStreamNumber].m_usNumWMStreams > 1 &&
-            m_pStreamInfo[usHXStreamNumber].m_pusWMStreamNumber)
-        {
-            *pusWMStreamNumber = m_pStreamInfo[usHXStreamNumber].m_pusWMStreamNumber[i];
-            retVal             = HXR_OK;
-        }
-        else if (m_pStreamInfo[usHXStreamNumber].m_usNumWMStreams == 1)
-        {
-            *pusWMStreamNumber = m_pStreamInfo[usHXStreamNumber].m_usWMStreamNumber;
-            retVal             = HXR_OK;
-        }
+        *pusWMStreamNumber = m_pStreamInfo[usHXStreamNumber].m_pusWMStreamNumber[i];
+        retVal             = HXR_OK;
     }
 
     return retVal;
@@ -2320,49 +2516,101 @@
             retVal = CreateBufferCCF(pBuffer, pContext);
             if (SUCCEEDED(retVal))
             {
-                // Compute the size needed for the ASMRuleBook (10
-                // is strlen("4294967295"), where 4294967295
-                // is 0xFFFFFFFF in decimal (MAX_UINT32). Extra
-                // + 1 is for NULL terminator.
-                const char* pszStreamFormatStr = "AverageBandwidth=%lu,Marker=0,Priority=9;" \
-                                                 "AverageBandwidth=0,Marker=1,Priority=5;";
-                UINT32 ulSize = (strlen(pszStreamFormatStr) + 10) * usNumWMStreams + 1;
-                // Size the buffer
-                retVal = pBuffer->SetSize(ulSize);
-                if (SUCCEEDED(retVal))
+                // Is there more than one substream for this HX stream?
+                if (usNumWMStreams > 1)
                 {
-                    // Set the return value
-                    retVal = HXR_OUTOFMEMORY;
-                    // Get the string buffer
-                    char* pStr = (char*) pBuffer->GetBuffer();
-                    if (pStr)
+                    // Multi-rate ASMRuleBook
+                    //
+                    // Compute the size needed for the ASMRuleBook
+                    const char* pszFormatStrFirst = "#($Bandwidth < %lu),AverageBandwidth=%lu,Priority=5;" \
+                                                    "#($Bandwidth < %lu),AverageBandwidth=0,Priority=5,OnDepend=\"0\",OffDepend=\"0\";";
+                    const char* pszFormatStrLast  = "#($Bandwidth >= %lu),AverageBandwidth=%lu,Priority=5;" \
+                                                    "#($Bandwidth >= %lu),AverageBandwidth=0,Priority=5,OnDepend=\"%u\",OffDepend=\"%u\";";
+                    const char* pszFormatStrMid   = "#($Bandwidth >= %lu) && ($Bandwidth < %lu),AverageBandwidth=%lu,Priority=5;" \
+                                                    "#($Bandwidth >= %lu) && ($Bandwidth < %lu),AverageBandwidth=0,Priority=5,OnDepend=\"%u\",OffDepend=\"%u\";";
+                    UINT32 ulSize = (strlen(pszFormatStrFirst) + 3 * HXWMREADER_MAXSTRLEN_UINT32) +
+                                    (strlen(pszFormatStrLast) + 3 * HXWMREADER_MAXSTRLEN_UINT32 + 2 * HXWMREADER_MAXSTRLEN_UINT16) +
+                                    ((strlen(pszFormatStrMid) + 5 * HXWMREADER_MAXSTRLEN_UINT32 + 2 * HXWMREADER_MAXSTRLEN_UINT16) * (usNumWMStreams - 2)) + 1;
+                    // Size the buffer
+                    retVal = pBuffer->SetSize(ulSize);
+                    if (SUCCEEDED(retVal))
                     {
-                        // Clear the return value
-                        retVal = HXR_OK;
-                        // Now loop through the WM streams, setting the
-                        // average bit rate into the string
-                        for (UINT16 i = 0; i < usNumWMStreams && SUCCEEDED(retVal); i++)
+                        // Set the return value
+                        retVal = HXR_OUTOFMEMORY;
+                        // Get the string buffer
+                        char* pWholeStr = (char*) pBuffer->GetBuffer();
+                        if (pWholeStr)
                         {
-                            // Get the WM stream number
-                            UINT16 usWMStreamNum = 0;
-                            retVal = GetWMStreamNumber(usHXStreamNum, i, &usWMStreamNum);
-                            if (SUCCEEDED(retVal))
+                            char* pStr = pWholeStr;
+                            // Run through the substreams, filling in the proper rule
+                            for (UINT16 i = 0; i < usNumWMStreams; i++)
                             {
-                                UINT32 ulBitRate = 0;
-                                retVal = GetWMStreamBitRate(pReader, usWMStreamNum, &ulBitRate);
-                                if (SUCCEEDED(retVal))
+                                if (i == 0)
                                 {
-                                    pStr += sprintf(pStr, pszStreamFormatStr, ulBitRate);
+                                    pStr += sprintf(pStr,
+                                                    pszFormatStrFirst,
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i + 1],
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i],
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i + 1]);
+                                }
+                                else if (i == usNumWMStreams - 1)
+                                {
+                                    UINT16 usDependRule = i * 2;
+                                    pStr += sprintf(pStr,
+                                                    pszFormatStrLast,
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i],
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i],
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i],
+                                                    usDependRule,
+                                                    usDependRule);
+                                }
+                                else
+                                {
+                                    UINT16 usDependRule = i * 2;
+                                    pStr += sprintf(pStr,
+                                                    pszFormatStrMid,
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i],
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i + 1],
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i],
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i],
+                                                    m_pStreamInfo[usHXStreamNum].m_pulBitRate[i + 1],
+                                                    usDependRule,
+                                                    usDependRule);
                                 }
                             }
+                            // Clear the return value
+                            retVal = HXR_OK;
                         }
                     }
+                }
+                else
+                {
+                    // Single-rate stream ASMRuleBook
+                    //
+                    // Compute the size of the ASMRuleBook
+                    const char* pszFormatStr = "AverageBandwidth=%lu,Marker=0,Priority=5;" \
+                                               "AverageBandwidth=0,Marker=1,Priority=5;";
+                    UINT32 ulSize = (strlen(pszFormatStr) + HXWMREADER_MAXSTRLEN_UINT32) + 1;
+                    // Size the buffer
+                    retVal = pBuffer->SetSize(ulSize);
                     if (SUCCEEDED(retVal))
                     {
-                        // Set the property
-                        retVal = pHdr->SetPropertyCString("ASMRuleBook", pBuffer);
+                        // Get the string buffer
+                        char* pStr = (char*) pBuffer->GetBuffer();
+                        if (pStr)
+                        {
+                            // Fill in the bitrate into the format string
+                            sprintf(pStr, pszFormatStr, m_pStreamInfo[usHXStreamNum].m_pulBitRate[0]);
+                            // Clear the return value
+                            retVal = HXR_OK;
+                        }
                     }
                 }
+                if (SUCCEEDED(retVal))
+                {
+                    // Set the property
+                    retVal = pHdr->SetPropertyCString("ASMRuleBook", pBuffer);
+                }
             }
             HX_RELEASE(pBuffer);
         }
@@ -2550,7 +2798,8 @@
                 if (SUCCEEDED(retVal))
                 {
                     // Convert the time to milliseconds
-                    UINT32 ulTime = (UINT32) cnsSampleTime / 10000;
+                    QWORD  qTimeMs = cnsSampleTime / ((QWORD) 10000);
+                    UINT32 ulTime  = (UINT32) qTimeMs;
                     // Get the ASM rule number
                     UINT16 usASMRuleNum = 0;
                     HXBOOL bKeyFrame    = ((dwFlags & WM_SF_CLEANPOINT) ? TRUE : FALSE);
@@ -2778,17 +3027,18 @@
             // Clear the return value
             retVal = HXR_OK;
             // Main thread loop.
-            HANDLE hEvents[7] = {m_hUserStartEvent,
+            HANDLE hEvents[8] = {m_hUserStartEvent,
                                  m_hUserDeliverTimeEvent,
                                  m_hUserPauseEvent,
                                  m_hUserResumeEvent,
                                  m_hUserStopEvent,
                                  m_hUserCloseEvent,
+                                 m_hUserSubscribeEvent,
                                  m_hThreadFinishEvent};
             HXBOOL bDone = FALSE;
             while (!bDone && SUCCEEDED(hr))
             {
-                DWORD ulRet = ::WaitForMultipleObjects(7, hEvents, FALSE, INFINITE);
+                DWORD ulRet = ::WaitForMultipleObjects(8, hEvents, FALSE, INFINITE);
                 switch (ulRet)
                 {
                     case WAIT_OBJECT_0:
@@ -2822,6 +3072,11 @@
                         hr = m_pReader->Close();
                         break;
                     case WAIT_OBJECT_0 + 6:
+                        // User called enough Subscribe() or Unsubscribe() events
+                        HXLOGL3(HXLOG_ASFF, "m_hUserSubscribeEvent fired");
+                        CallSetStreamsSelected();
+                        break;
+                    case WAIT_OBJECT_0 + 7:
                         // This event tells us to break out of the loop
                         HXLOGL3(HXLOG_ASFF, "Thread Finish Event fired, exiting thread loop");
                         bDone = TRUE;
@@ -2866,3 +3121,192 @@
 
     return ulRet;
 }
+
+HX_RESULT CHXWMReader::SortSubStreamsByBitRate()
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (m_usHXStreamCount && m_usWMStreamCount && m_pStreamInfo)
+    {
+        // Clear the return value
+        retVal = HXR_OK;
+        // Loop through each HX stream
+        for (UINT16 i = 0; i < m_usHXStreamCount && SUCCEEDED(retVal); i++)
+        {
+            UINT16 usNumWMStreams = m_pStreamInfo[i].m_usNumWMStreams;
+            // Do we have more than one WM stream for this HX stream?
+            // If not, then there's no sorting to be done.
+            if (usNumWMStreams > 1)
+            {
+                // We use a simple brute-force insertion sort
+                UINT16 j = 0;
+                for (j = 0; j < usNumWMStreams - 1; j++)
+                {
+                    // Find the index of the minimum bitrate from [j,usNumWMStreams-1]
+                    UINT16 usMinIndex   = usNumWMStreams;
+                    UINT32 ulMinBitRate = MAX_UINT32;
+                    for (UINT16 k = j; k < usNumWMStreams; k++)
+                    {
+                        UINT32 ulBitRate = m_pStreamInfo[i].m_pulBitRate[k];
+                        if (ulBitRate < ulMinBitRate)
+                        {
+                            ulMinBitRate = ulBitRate;
+                            usMinIndex   = k;
+                        }
+                    }
+                    // Swap the j-th entries with the usMinIndex-th entries (if necessary)
+                    if (j != usMinIndex)
+                    {
+                        HX_SWAP_XOR(m_pStreamInfo[i].m_pusWMStreamNumber[j],
+                                    m_pStreamInfo[i].m_pusWMStreamNumber[usMinIndex]);
+                        HX_SWAP_XOR(m_pStreamInfo[i].m_pulBitRate[j],
+                                    m_pStreamInfo[i].m_pulBitRate[usMinIndex]);
+                        HX_SWAP_XOR(m_pStreamInfo[i].m_pulPreroll[j],
+                                    m_pStreamInfo[i].m_pulPreroll[usMinIndex]);
+                    }
+                }
+                // Now we need to update the WM -> HX substream map
+                for (j = 0; j < usNumWMStreams; j++)
+                {
+                    m_pucWM2HXSubStreamIndexMap[m_pStreamInfo[i].m_pusWMStreamNumber[j]] = (BYTE) j;
+                }
+            }
+        }   
+    }
+
+    return retVal;
+}
+
+HX_RESULT CHXWMReader::SetRuleState(UINT16 usHXStreamNum, UINT16 usRuleNum, HXBOOL bSubscribed)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    // Enter the rule state critical section
+    ::EnterCriticalSection(&m_csRuleState); 
+
+    if (m_pStreamInfo && usHXStreamNum < m_usHXStreamCount &&
+        m_pStreamInfo[usHXStreamNum].m_pRuleState && m_hUserSubscribeEvent)
+    {
+        // Set the rule state
+        retVal = m_pStreamInfo[usHXStreamNum].m_pRuleState->SetSubscribedState(usRuleNum, bSubscribed);
+        if (SUCCEEDED(retVal))
+        {
+            // We want one and only one subscribed substream per
+            // HX Stream. When we reach that state, then we 
+            // are ready to make a call to the WM reader.
+            if (m_pStreamInfo[usHXStreamNum].m_pRuleState->IsOnlyOneSubStreamSubscribed())
+            {
+                // We want to call IWMReaderAdvanced::SetStreamsSelected(), but we
+                // need to do that on the reader thread, so set the event
+                ::SetEvent(m_hUserSubscribeEvent);
+            }
+        }
+    }
+
+    // Leave the rule state critical section
+    ::LeaveCriticalSection(&m_csRuleState); 
+
+    return retVal;
+}
+
+HX_RESULT CHXWMReader::CallSetStreamsSelected()
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (m_pStreamInfo && m_usHXStreamCount && m_pReaderAdvanced2)
+    {
+        // Determine the number of WM streams we will set now.
+        // We only want to set streams that for which one and only
+        // one substream is fully subscribed
+        UINT16 usTotalNumWMStreams = 0;
+        UINT16 i              = 0;
+        for (i = 0; i < m_usHXStreamCount; i++)
+        {
+            if (m_pStreamInfo[i].m_pRuleState &&
+                m_pStreamInfo[i].m_pRuleState->IsOnlyOneSubStreamSubscribed())
+            {
+                // Get the number of WM streams for this HX stream
+                UINT16 usNumWMStreams = 0;
+                GetNumWMStreams(i, &usNumWMStreams);
+                // Add this number to the total
+                usTotalNumWMStreams += usNumWMStreams;
+            }
+        }
+        // Now allocate an array of UINT16's and an array
+        // of WMT_STREAM_SELECTION enums
+        UINT16*               pusWMStreamNum = new UINT16 [usTotalNumWMStreams];
+        WMT_STREAM_SELECTION* peSelect       = new WMT_STREAM_SELECTION [usTotalNumWMStreams];
+        if (pusWMStreamNum && peSelect)
+        {
+            // Fill in the arrays with proper streams numbers
+            UINT16 usIndx = 0;
+            for (i = 0; i < m_usHXStreamCount; i++)
+            {
+                if (m_pStreamInfo[i].m_pRuleState &&
+                    m_pStreamInfo[i].m_pRuleState->IsOnlyOneSubStreamSubscribed())
+                {
+                    // Get the number of WM streams for this HX stream
+                    UINT16 usNumWMStreams = 0;
+                    GetNumWMStreams(i, &usNumWMStreams);
+                    // Loop through each of these WM streams
+                    for (UINT16 j = 0; j < usNumWMStreams; j++)
+                    {
+                        // Get the WM stream number
+                        UINT16 usWMStreamNum = 0;
+                        GetWMStreamNumber(i, j, &usWMStreamNum);
+                        // Fill it into the array
+                        pusWMStreamNum[usIndx] = usWMStreamNum;
+                        // Get the subscribed state
+                        HXBOOL bIsSubscribed = m_pStreamInfo[i].m_pRuleState->IsSubStreamSubscribed(j);
+                        // Set the proper value into the array
+                        peSelect[usIndx] = (bIsSubscribed ? WMT_ON : WMT_OFF);
+                        // Increment the counter index
+                        usIndx++;
+                    }
+                }
+            }
+#if defined(HELIX_FEATURE_LOGLEVEL_3) || defined(HELIX_FEATURE_LOGLEVEL_3) || defined(HELIX_FEATURE_LOGLEVEL_ALL)
+            const char* pszLogFormatStr      = "Calling IWMReaderAdvanced2::SetStreamsSelected(%u,,) wmStreamNum=(%s) wmSelect=(%s)";
+            UINT32      ulStreamNumStrLen    = usTotalNumWMStreams * (HXWMREADER_MAXSTRLEN_UINT16 + 1);
+            UINT32      ulStreamSelectStrLen = usTotalNumWMStreams * 8;
+            UINT32      ulLogStrLen          = strlen(pszLogFormatStr) + HXWMREADER_MAXSTRLEN_UINT16 +
+                                               ulStreamNumStrLen + ulStreamSelectStrLen;
+            char* pszStreamNumStr    = new char [ulStreamNumStrLen + 1];
+            char* pszStreamSelectStr = new char [ulStreamSelectStrLen + 1];
+            char* pszLogStr          = new char [ulLogStrLen + 1];
+            if (pszStreamNumStr && pszStreamSelectStr && pszLogStr)
+            {
+                char* pszTmp1 = pszStreamNumStr;
+                char* pszTmp2 = pszStreamSelectStr;
+                for (i = 0; i < usTotalNumWMStreams; i++)
+                {
+                    const char* pszSelect = "WMT_OFF";
+                    if (peSelect[i] == WMT_ON)
+                    {
+                        pszSelect = "WMT_ON";
+                    }
+                    pszTmp1 += sprintf(pszTmp1, "%u ", pusWMStreamNum[i]);
+                    pszTmp2 += sprintf(pszTmp2, "%s ", pszSelect);
+                }
+                HXLOGL3(HXLOG_ASFF, pszLogFormatStr, usTotalNumWMStreams, pszStreamNumStr, pszStreamSelectStr);
+            }
+            HX_VECTOR_DELETE(pszStreamNumStr);
+            HX_VECTOR_DELETE(pszStreamSelectStr);
+            HX_VECTOR_DELETE(pszLogStr);
+#endif
+            // Now call IWMReaderAdvanced::SetStreamsSelected()
+            HRESULT hr = m_pReaderAdvanced2->SetStreamsSelected(usTotalNumWMStreams,
+                                                                pusWMStreamNum,
+                                                                peSelect);
+            if (hr == S_OK)
+            {
+                retVal = HXR_OK;
+            }
+        }
+        HX_VECTOR_DELETE(pusWMStreamNum);
+        HX_VECTOR_DELETE(peSelect);
+    }
+
+    return retVal;
+}
+

--- NEW FILE: asf_rule_state.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 "hxresult.h"
#include "asf_rule_state.h"

CASFRuleState::CASFRuleState(UINT16 usStreamNum, UINT16 usNumRules)
    : m_usStreamNum(usStreamNum)
    , m_usNumRules(usNumRules)
    , m_pbSubscribed(NULL)
{
    if (m_usNumRules)
    {
        m_pbSubscribed = new HXBOOL [m_usNumRules];
        if (m_pbSubscribed)
        {
            memset((void*) m_pbSubscribed, 0, m_usNumRules * sizeof(HXBOOL));
        }
    }
}

CASFRuleState::CASFRuleState(UINT16 usStreamNum, UINT16 usNumRules, HXBOOL* pbSub)
    : m_usStreamNum(usStreamNum)
    , m_usNumRules(usNumRules)
    , m_pbSubscribed(NULL)
{
    if (m_usNumRules)
    {
        m_pbSubscribed = new HXBOOL [m_usNumRules];
        if (m_pbSubscribed)
        {
            memcpy(m_pbSubscribed, pbSub, m_usNumRules * sizeof(HXBOOL)); /* Flawfinder: ignore */
        }
    }
}

CASFRuleState::~CASFRuleState()
{
    HX_VECTOR_DELETE(m_pbSubscribed);
}

HX_RESULT CASFRuleState::SetSubscribedState(UINT16 usRuleNum, HXBOOL bSubscribed)
{
    HX_RESULT retVal = HXR_FAIL;

    if (m_pbSubscribed && usRuleNum < m_usNumRules)
    {
        m_pbSubscribed[usRuleNum] = bSubscribed;
        retVal = HXR_OK;
    }

    return retVal;
}

HXBOOL CASFRuleState::IsSubscribed(UINT16 usRule) const
{
    HXBOOL bRet = FALSE;

    if (m_pbSubscribed && usRule < m_usNumRules)
    {
        bRet = m_pbSubscribed[usRule];
    }

    return bRet;
}

HXBOOL CASFRuleState::IsSubStreamSubscribed(UINT16 usSubStreamIndex) const
{
    HXBOOL bRet = FALSE;

    if (m_pbSubscribed && m_usNumRules)
    {
        UINT16 usNumSubStreams = m_usNumRules >> 1;
        if (usSubStreamIndex < usNumSubStreams)
        {
            if (usNumSubStreams == 1)
            {
                bRet = TRUE;
            }
            else
            {
                UINT16 usRule = usSubStreamIndex << 1;
                if (m_pbSubscribed[usRule] && m_pbSubscribed[usRule + 1])
                {
                    bRet = TRUE;
                }
            }
        }
    }

    return bRet;
}

HX_RESULT CASFRuleState::CopyFrom(CASFRuleState* pState)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pState)
    {
        // Copy the stream number and the number of rules
        m_usStreamNum = pState->GetStreamNum();
        m_usNumRules  = pState->GetNumRules();
        // Create a new subscription array
        HX_VECTOR_DELETE(m_pbSubscribed);
        m_pbSubscribed = new HXBOOL [m_usNumRules];
        if (m_pbSubscribed)
        {
            // Copy the subscription array
            for (UINT16 i = 0; i < m_usNumRules; i++)
            {
                m_pbSubscribed[i] = pState->IsSubscribed(i);
            }
            // Clear the return value
            retVal = HXR_OK;
        }
    }

    return retVal;
}

HXBOOL CASFRuleState::IsStateSame(CASFRuleState* pState) const
{
    HXBOOL bRet = FALSE;

    if (pState && m_usNumRules && m_pbSubscribed &&
        m_usStreamNum == pState->GetStreamNum() &&
        m_usNumRules  == pState->GetNumRules())
    {
        UINT16 i = 0;
        for (i = 0; i < m_usNumRules; i++)
        {
            if (m_pbSubscribed[i] != pState->IsSubscribed(i))
            {
                break;
            }
        }
        // If some rules were different, then we would have
        // broken out of the for loop above before i >= m_usNumRules
        if (i >= m_usNumRules)
        {
            bRet = TRUE;
        }
    }

    return bRet;
}

HXBOOL CASFRuleState::IsOnlyOneSubStreamSubscribed() const
{
    HXBOOL bRet = FALSE;

    if (m_pbSubscribed && m_usNumRules)
    {
        // Number of substreams is half the number of rules
        UINT16 usNumSubStreams = m_usNumRules >> 1;
        // Do we have more than one substream?
        if (usNumSubStreams == 1)
        {
            // We're always subscribed to one substream
            bRet = TRUE;
        }
        else if (usNumSubStreams > 1)
        {
            // Loop through the rules. Only one pair of
            // all rules should be TRUE, and the rest FALSE.
            //
            // First find a fully subscribed substream
            UINT16 usSubscribedSubStream = usNumSubStreams;
            UINT16 i = 0;
            for (i = 0; i < usNumSubStreams; i++)
            {
                UINT16 usRule = i * 2;
                if (m_pbSubscribed[usRule] && m_pbSubscribed[usRule + 1])
                {
                    usSubscribedSubStream = i;
                    break;
                }
            }
            // Did we find a fully subscribed substream?
            if (usSubscribedSubStream < usNumSubStreams)
            {
                // Now find if this is the ONLY subscribed substream
                for (i = 0; i < usNumSubStreams; i++)
                {
                    if (i != usSubscribedSubStream)
                    {
                        UINT16 usRule = i * 2;
                        if (m_pbSubscribed[usRule] || m_pbSubscribed[usRule + 1])
                        {
                            break;
                        }
                    }
                }
                if (i >= usNumSubStreams)
                {
                    // We didn't find another subscribed or partially subscribed
                    // substream, so we only have one subscribed substream.
                    bRet = TRUE;
                }
            }
        }
    }

    return bRet;
}

Index: asf_file_format_wmfsdk.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/platform/win32/asf_file_format_wmfsdk.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- asf_file_format_wmfsdk.cpp	30 Jan 2006 15:24:55 -0000	1.4
+++ asf_file_format_wmfsdk.cpp	3 Feb 2006 22:16:11 -0000	1.5
@@ -41,14 +41,22 @@
 #include "hxccf.h"
 #include "hxfiles.h"
 #include "hxthread.h"
+#include "hxcore.h"
+#include "hxasm.h"
 #include "hxcbobj.h"
 #include "hxslist.h"
+#include "pckunpck.h"
+#if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION)
+#include "hxtick.h"
+#endif /* #if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION) */
 #include "baseobj.h"
 #include "hxver.h"
+#include "asf_rule_state.h"
 #include "hxwmreader.h"
 #include "asf_file_format_base.h"
 #include "asf_file_format_wmfsdk.h"
 #include "hxtlogutil.h"
+#include "hlxclib/stdlib.h"
 
 #include "hxheap.h"
 #ifdef _DEBUG
@@ -56,9 +64,13 @@
 static const char HX_THIS_FILE[] = __FILE__;
 #endif
 
+#define HXWMREADER_DEBUG_TEST_STREAMSELECTION_INTERVAL_MIN  10000
+#define HXWMREADER_DEBUG_TEST_STREAMSELECTION_INTERVAL_MAX  20000
+
 CASFStreamInfo::CASFStreamInfo()
 {
     m_pPacketQueue     = NULL;
+    m_pRuleState       = NULL;
     m_bPacketRequested = FALSE;
     m_bStreamDone      = FALSE;
 }
@@ -67,6 +79,7 @@
 {
     ClearPacketQueue();
     HX_DELETE(m_pPacketQueue);
+    HX_DELETE(m_pRuleState);
     m_bPacketRequested = FALSE;
     m_bStreamDone      = FALSE;
 }
@@ -90,6 +103,8 @@
     m_pStreamInfo             = NULL;
     m_pReader                 = NULL;
     m_pPacketQueueMutex       = NULL;
+    m_pSubChangeQueue         = NULL;
+    m_pSubChangeQueueMutex    = NULL;
     m_status                  = HXR_OK;
     m_usNumStreams            = 0;
     m_ulStartTime             = 0;
@@ -100,6 +115,11 @@
     m_bReaderStarted          = FALSE;
     m_bReaderStartDonePending = FALSE;
     m_bEndOfFile              = FALSE;
+#if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION)
+    m_ulLastSwitchTick        = 0;
+    m_ulSwitchInterval        = 0;
+    srand((unsigned int) this);
+#endif /* #if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION) */
 }
 
 CASFFileFormatWMFSDK::~CASFFileFormatWMFSDK()
@@ -117,7 +137,12 @@
         // NULL out by default
         *ppvObj = NULL;
         // Switch based on IID
-        if (IsEqualIID(riid, IID_IHXWMReaderResponse))
+        if (IsEqualIID(riid, IID_IHXASMSource))
+        {
+            AddRef();
+            *ppvObj = (IHXASMSource*) this;
+        }
+        else if (IsEqualIID(riid, IID_IHXWMReaderResponse))
         {
             AddRef();
             *ppvObj = (IHXWMReaderResponse*) this;
@@ -221,11 +246,15 @@
         m_pReader->Stop();
         m_pReader->Close();
     }
+    // Clear the subcription change queue
+    ClearSubChangeQueue();
+    HX_DELETE(m_pSubChangeQueue);
     // Release all objects
     HX_RELEASE(m_pCallback);
     HX_RELEASE(m_pReader);
     HX_RELEASE(m_pScheduler);
     HX_DELETE(m_pPacketQueueMutex);
+    HX_DELETE(m_pSubChangeQueueMutex);
     HX_VECTOR_DELETE(m_pStreamInfo);
     // Reset member variables
     m_status                  = HXR_OK;
@@ -249,6 +278,9 @@
 
     if (m_ulState == kStateReady && m_pReader && m_pFormatResponse)
     {
+#if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION)
+        InitTestStreamSwitch();
+#endif /* #if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION) */
         // Get the file header
         IHXValues* pHdr = NULL;
         retVal = m_pReader->GetFileHeader(pHdr);
@@ -282,8 +314,22 @@
                         }
                         if (SUCCEEDED(retVal))
                         {
-                            // Callback to the format response
-                            m_pFormatResponse->FileHeaderReady(retVal, pHdr);
+                            // Create the stream subcription change mutex
+                            HX_DELETE(m_pSubChangeQueueMutex);
+                            retVal = HXMutex::MakeMutex(m_pSubChangeQueueMutex);
+                            if (SUCCEEDED(retVal))
+                            {
+                                // Create the stream subscription change queue
+                                ClearSubChangeQueue();
+                                HX_DELETE(m_pSubChangeQueue);
+                                m_pSubChangeQueue = new CHXSimpleList();
+                                if (!m_pSubChangeQueue)
+                                {
+                                    retVal = HXR_FAIL;
+                                }
+                                // Callback to the format response
+                                m_pFormatResponse->FileHeaderReady(retVal, pHdr);
+                            }
                         }
                     }
                     else
@@ -304,15 +350,35 @@
     HXLOGL3(HXLOG_ASFF, "GetStreamHeader(%u)", unStreamNumber);
     HX_RESULT retVal = HXR_UNEXPECTED;
 
-    if (m_ulState == kStateReady && m_pReader && m_pFormatResponse && unStreamNumber < m_usNumStreams)
+    if (m_ulState == kStateReady && m_pReader && m_pFormatResponse &&
+        unStreamNumber < m_usNumStreams && m_pStreamInfo)
     {
         // Get the stream header
         IHXValues* pHdr = NULL;
         retVal = m_pReader->GetStreamHeader(unStreamNumber, pHdr);
         if (SUCCEEDED(retVal))
         {
-            // Call back to the response interface
-            m_pFormatResponse->StreamHeaderReady(retVal, pHdr);
+            // Get some info from this stream header
+            UINT16 usNumSubStreams = 0;
+            retVal = GetStreamHeaderInfo(pHdr, &usNumSubStreams);
+            if (SUCCEEDED(retVal))
+            {
+                // Set the return value
+                retVal = HXR_OUTOFMEMORY;
+                // Number of rules is 2x the number of substreams
+                UINT16 usNumRules = usNumSubStreams * 2;
+                // Create a rule state for each stream, and 
+                // initialize all rules to unsubscribed
+                HX_DELETE(m_pStreamInfo[unStreamNumber].m_pRuleState);
+                m_pStreamInfo[unStreamNumber].m_pRuleState = new CASFRuleState(unStreamNumber, usNumRules);
+                if (m_pStreamInfo[unStreamNumber].m_pRuleState)
+                {
+                    // Clear the return value
+                    retVal = HXR_OK;
+                    // Call back to the response interface
+                    m_pFormatResponse->StreamHeaderReady(retVal, pHdr);
+                }
+            }
         }
         HX_RELEASE(pHdr);
     }
@@ -327,6 +393,9 @@
 
     if (m_pStreamInfo && unStreamNumber < m_usNumStreams && m_pFormatResponse)
     {
+#if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION)
+        CheckTestStreamSwitch();
+#endif /* #if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION) */
         // Assert if we get a packet request if there's
         // still an outstanding request or we have
         // already issued a StreamDone on this stream
@@ -417,6 +486,48 @@
     return retVal;
 }
 
+STDMETHODIMP CASFFileFormatWMFSDK::Subscribe(UINT16 uStreamNumber, UINT16 uRuleNumber)
+{
+    HXLOGL3(HXLOG_ASFF, "Subscribe(%u,%u)", uStreamNumber, uRuleNumber);
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (m_pStreamInfo                             &&
+        uStreamNumber < m_usNumStreams            &&
+        m_pReader                                 &&
+        m_pStreamInfo[uStreamNumber].m_pRuleState &&
+        uRuleNumber < m_pStreamInfo[uStreamNumber].m_pRuleState->GetNumRules())
+    {
+        retVal = m_pStreamInfo[uStreamNumber].m_pRuleState->SetSubscribedState(uRuleNumber, TRUE);
+        if (SUCCEEDED(retVal))
+        {
+            retVal = m_pReader->Subscribe(uStreamNumber, uRuleNumber);
+        }
+    }
+
+    return retVal;
+}
+
+STDMETHODIMP CASFFileFormatWMFSDK::Unsubscribe(UINT16 uStreamNumber, UINT16 uRuleNumber)
+{
+    HXLOGL3(HXLOG_ASFF, "Unsubscribe(%u,%u)", uStreamNumber, uRuleNumber);
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (m_pStreamInfo                             &&
+        uStreamNumber < m_usNumStreams            &&
+        m_pReader                                 &&
+        m_pStreamInfo[uStreamNumber].m_pRuleState &&
+        uRuleNumber < m_pStreamInfo[uStreamNumber].m_pRuleState->GetNumRules())
+    {
+        retVal = m_pStreamInfo[uStreamNumber].m_pRuleState->SetSubscribedState(uRuleNumber, FALSE);
+        if (SUCCEEDED(retVal))
+        {
+            retVal = m_pReader->Unsubscribe(uStreamNumber, uRuleNumber);
+        }
+    }
+
+    return retVal;
+}
+
 STDMETHODIMP CASFFileFormatWMFSDK::OpenDone(HX_RESULT status)
 {
     HXLOGL3(HXLOG_ASFF, "IHXWMReaderResponse::OpenDone(0x%08x)", status);
@@ -470,8 +581,11 @@
 
 STDMETHODIMP CASFFileFormatWMFSDK::OnPacket(IHXPacket* pPacket)
 {
-    HXLOGL4(HXLOG_ASFF, "IHXWMReaderResponse::OnPacket(0x%08x) ts=%lu",
-            pPacket, (pPacket ? pPacket->GetTime() : 0));
+    HXLOGL4(HXLOG_ASFF, "IHXWMReaderResponse::OnPacket(0x%08x) ts=%lu asmRule=%u asmFlags=0x%02x",
+            pPacket,
+            (pPacket ? pPacket->GetTime() : 0),
+            (pPacket ? pPacket->GetASMRuleNumber() : 0),
+            (pPacket ? pPacket->GetASMFlags() : 0));
     HX_RESULT retVal = HXR_FAIL;
 
     if (pPacket)
@@ -508,6 +622,57 @@
     return retVal;
 }
 
+STDMETHODIMP CASFFileFormatWMFSDK::OnSubscriptionChange(UINT16 usStreamNum, UINT16 usNumRules, HXBOOL* pbSubscribed)
+{
+    char* pszTmp = NULL;
+    if (usNumRules && pbSubscribed)
+    {
+        UINT16 usTmpSize = usNumRules * 2 + 1;
+        pszTmp = new char [usTmpSize];
+        if (pszTmp)
+        {
+            memset(pszTmp, 0, usTmpSize);
+            for (UINT16 i = 0; i < usNumRules; i++)
+            {
+                if (pbSubscribed[i])
+                {
+                    strcat(pszTmp, "1 ");
+                }
+                else
+                {
+                    strcat(pszTmp, "0 ");
+                }
+            }
+        }
+    }
+    HXLOGL2(HXLOG_ASFF, "IHXWMReaderResponse::OnSubscriptionChange() strm=%u numRules=%u pbSubscribed=[%s]",
+            usStreamNum, usNumRules, (pszTmp ? pszTmp : "NULL"));
+    HX_VECTOR_DELETE(pszTmp);
+
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (usStreamNum < m_usNumStreams && usNumRules && pbSubscribed && m_pSubChangeQueue)
+    {
+        // Create a CASFRuleState object
+        CASFRuleState* pState = new CASFRuleState(usStreamNum, usNumRules, pbSubscribed);
+        if (pState)
+        {
+            // Lock the sub change queue mutex
+            HX_LOCK(m_pSubChangeQueueMutex);
+            // Add this CASFRuleState object to the queue
+            m_pSubChangeQueue->AddTail((void*) pState);
+            // Schedule a callback if necessary
+            ScheduleCallbackIfNecessary();
+            // Unlock the sub change queue mutex
+            HX_UNLOCK(m_pSubChangeQueueMutex);
+            // Clear the return value
+            retVal = HXR_OK;
+        }
+    }
+
+    return retVal;
+}
+
 STDMETHODIMP CASFFileFormatWMFSDK::OnEndOfFile()
 {
     HXLOGL4(HXLOG_ASFF, "IHXWMReaderResponse::OnEndOfFile()");
@@ -575,10 +740,12 @@
     }
     else
     {
-        // We received a packet when there was
-        // an outstanding request for one, so now
-        // we need to send one or more packets
-        //
+        // Lock the subscription change mutex
+        HX_LOCK(m_pSubChangeQueueMutex);
+        // Check to see if there are any subscription changes pending
+        CheckSubcriptionChangeQueue();
+        // Unlock the subscription change mutex
+        HX_UNLOCK(m_pSubChangeQueueMutex);
         // Lock the packet queue mutex
         HX_LOCK(m_pPacketQueueMutex);
         // Handle the packet request
@@ -795,3 +962,207 @@
         }
     }
 }
+
+void CASFFileFormatWMFSDK::ClearSubChangeQueue()
+{
+    if (m_pSubChangeQueue)
+    {
+        while (m_pSubChangeQueue->GetCount() > 0)
+        {
+            CASFRuleState* pState = (CASFRuleState*) m_pSubChangeQueue->RemoveHead();
+            HX_DELETE(pState);
+        }
+    }
+}
+
+void CASFFileFormatWMFSDK::CheckSubcriptionChangeQueue()
+{
+    if (m_pSubChangeQueue)
+    {
+        while (m_pSubChangeQueue->GetCount() > 0)
+        {
+            CASFRuleState* pState = (CASFRuleState*) m_pSubChangeQueue->RemoveHead();
+            if (pState)
+            {
+                HandleSubscriptionChange(pState);
+            }
+            HX_DELETE(pState);
+        }
+    }
+}
+
+HX_RESULT CASFFileFormatWMFSDK::HandleSubscriptionChange(CASFRuleState* pState)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pState && m_pContext)
+    {
+        // Get the stream number
+        UINT16 usStreamNum = pState->GetStreamNum();
+        // Sanity check
+        if (m_pStreamInfo && usStreamNum < m_usNumStreams)
+        {
+            // QI our context for IHXStreamSource
+            IHXStreamSource* pStreamSource = NULL;
+            retVal = m_pContext->QueryInterface(IID_IHXStreamSource, (void**) &pStreamSource);
+            if (SUCCEEDED(retVal))
+            {
+                // Get the stream from the stream source
+                IUnknown* pUnk = NULL;
+                retVal = pStreamSource->GetStream(usStreamNum, pUnk);
+                if (SUCCEEDED(retVal))
+                {
+                    // QI this object for IHXASMStream
+                    IHXASMStream* pASMStream = NULL;
+                    retVal = pUnk->QueryInterface(IID_IHXASMStream, (void**) &pASMStream);
+                    if (SUCCEEDED(retVal))
+                    {
+                        // Do we have a rule state for this stream?
+                        if (!m_pStreamInfo[usStreamNum].m_pRuleState)
+                        {
+                            // Create a rule state (these will all be initialized to unsubscribed)
+                            m_pStreamInfo[usStreamNum].m_pRuleState = new CASFRuleState(pState->GetStreamNum(),
+                                                                                        pState->GetNumRules());
+                        }
+                        if (m_pStreamInfo[usStreamNum].m_pRuleState)
+                        {
+                            // Is this state different than the current state?
+                            if (!m_pStreamInfo[usStreamNum].m_pRuleState->IsStateSame(pState))
+                            {
+                                // Something in this rule state is different.
+                                // Run through each of the rules. If it is different
+                                // than the current state, then inform IHXASMStream
+                                for (UINT16 i = 0; i < pState->GetNumRules() && SUCCEEDED(retVal); i++)
+                                {
+                                    // Is the rule the same?
+                                    HXBOOL bCur = m_pStreamInfo[usStreamNum].m_pRuleState->IsSubscribed(i);
+                                    HXBOOL bNew = pState->IsSubscribed(i);
+                                    if (bNew != bCur)
+                                    {
+                                        // Is this rule getting subscribed or unsubscribed?
+                                        if (bCur && !bNew)
+                                        {
+                                            // This rule is getting unsubscribed
+                                            retVal = pASMStream->Unsubscribe(i);
+                                        }
+                                        else
+                                        {
+                                            // This rule is getting subscribed
+                                            retVal = pASMStream->Subscribe(i);
+                                        }
+                                    }
+                                }
+                                if (SUCCEEDED(retVal))
+                                {
+                                    // Copy the new state
+                                    retVal = m_pStreamInfo[usStreamNum].m_pRuleState->CopyFrom(pState);
+                                }
+                            }
+                        }
+                        else
+                        {
+                            retVal = HXR_FAIL;
+                        }
+                    }
+                    HX_RELEASE(pASMStream);
+                }
+                HX_RELEASE(pUnk);
+            }
+            HX_RELEASE(pStreamSource);
+        }
+    }
+
+    return retVal;
+}
+
+HX_RESULT CASFFileFormatWMFSDK::GetStreamHeaderInfo(IHXValues* pHdr, UINT16* pusNumSubStreams)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pHdr && pusNumSubStreams)
+    {
+        // Get the opaque data
+        IHXBuffer* pOpaque = NULL;
+        retVal = pHdr->GetPropertyBuffer("OpaqueData", pOpaque);
+        if (SUCCEEDED(retVal))
+        {
+            // Set the return value
+            retVal = HXR_FAIL;
+            // Get the buffer
+            BYTE*  pBuf  = pOpaque->GetBuffer();
+            UINT32 ulLen = pOpaque->GetSize();
+            if (pBuf && ulLen)
+            {
+                retVal = UnpackUINT16BE(pBuf, ulLen, pusNumSubStreams);
+            }
+        }
+        HX_RELEASE(pOpaque);
+    }
+
+    return retVal;
+}
+
+#if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION)
+
+void CASFFileFormatWMFSDK::InitTestStreamSwitch()
+{
+    // Init the tick count
+    m_ulLastSwitchTick = HX_GET_BETTERTICKCOUNT();
+    // Compute new switch interval
+    UINT32 ulRand       = (UINT32) rand();
+    UINT32 ulMaxMinDiff = HXWMREADER_DEBUG_TEST_STREAMSELECTION_INTERVAL_MAX -
+                          HXWMREADER_DEBUG_TEST_STREAMSELECTION_INTERVAL_MIN;
+    UINT32 ulScaledDiff = ulRand * ulMaxMinDiff / ((UINT32) RAND_MAX);
+    m_ulSwitchInterval  = HXWMREADER_DEBUG_TEST_STREAMSELECTION_INTERVAL_MIN + ulScaledDiff;
+    HXLOGL4(HXLOG_ASFF, "InitTestStreamSwitch lastTick=%lu switchInterval=%lu",
+            m_ulLastSwitchTick, m_ulSwitchInterval);
+}
+
+void CASFFileFormatWMFSDK::CheckTestStreamSwitch()
+{
+    UINT32 ulCurTick = HX_GET_BETTERTICKCOUNT();
+    UINT32 ulDiff    = ulCurTick - m_ulLastSwitchTick;
+    if (ulDiff > m_ulSwitchInterval)
+    {
+        // Loop through all the streams
+        UINT16 i = 0;
+        UINT16 j = 0;
+        for (i = 0; i < m_usNumStreams; i++)
+        {
+            UINT16 usNumSubStreams = m_pStreamInfo[i].m_pRuleState->GetNumRules() >> 1;
+            if (usNumSubStreams > 1)
+            {
+                for (j = 0; j < usNumSubStreams; j++)
+                {
+                    if (m_pStreamInfo[i].m_pRuleState->IsSubStreamSubscribed(j))
+                    {
+                        break;
+                    }
+                }
+                if (j < usNumSubStreams)
+                {
+                    UINT16 usOld = j;
+                    UINT16 usNew = (j + 1) % usNumSubStreams;
+                    // Unsubscribe from the current rules
+                    Unsubscribe(i, usOld * 2);
+                    Unsubscribe(i, usOld * 2 + 1);
+                    // Subscribe to the current rules
+                    Subscribe(i, usNew * 2);
+                    Subscribe(i, usNew * 2 + 1);
+                }
+            }
+        }
+        // Update the last switch tick
+        m_ulLastSwitchTick = ulCurTick;
+        // Recompute new switch interval
+        UINT32 ulRand       = (UINT32) rand();
+        UINT32 ulMaxMinDiff = HXWMREADER_DEBUG_TEST_STREAMSELECTION_INTERVAL_MAX -
+                              HXWMREADER_DEBUG_TEST_STREAMSELECTION_INTERVAL_MIN;
+        UINT32 ulScaledDiff = ulRand * ulMaxMinDiff / ((UINT32) RAND_MAX);
+        m_ulSwitchInterval  = HXWMREADER_DEBUG_TEST_STREAMSELECTION_INTERVAL_MIN + ulScaledDiff;
+        HXLOGL4(HXLOG_ASFF, "CheckTestStreamSwitch newLastTick=%lu newSwitchInterval=%lu",
+                m_ulLastSwitchTick, m_ulSwitchInterval);
+    }
+}
+
+#endif /* #if defined(HXWMREADER_DEBUG_TEST_STREAMSELECTION) */


From ehyche at helixcommunity.org  Fri Feb  3 14:17:36 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Fri Feb  3 16:32:42 2006
Subject: [Datatype-cvs] asf/audio/renderer wmaformat.cpp, 1.3,
	1.4 wmaformat.h, 1.2, 1.3
Message-ID: 

Update of /cvsroot/datatype/asf/audio/renderer
In directory cvs:/tmp/cvs-serv8430

Modified Files:
	wmaformat.cpp wmaformat.h 
Log Message:
Fixes for multi-rate stream switching support.


Index: wmaformat.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/audio/renderer/wmaformat.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- wmaformat.cpp	30 Jan 2006 15:25:45 -0000	1.3
+++ wmaformat.cpp	3 Feb 2006 22:17:33 -0000	1.4
@@ -46,9 +46,11 @@
 //#define HELIX_FEATURE_LOGLEVEL_NONE // uncomment to disable all logging
 #include "hxtlogutil.h"
 
-#define MIN_ACCEPTBALE_DATA_REMAINDER   1       // in bytes
-#define WMA_DEFAULT_AUDIO_PREROLL       2000    // in milliseconds
-#define MAX_TOLERABLE_TIME_GAP          5       // in milliseconds
+#define MIN_ACCEPTBALE_DATA_REMAINDER            1    // in bytes
+#define WMA_DEFAULT_AUDIO_PREROLL             2000    // in milliseconds
+#define MAX_TOLERABLE_TIME_GAP                   5    // in milliseconds
+#define WMA_DEFAULT_SUBSTREAM_TRANSITION_TIME 1000    // in milliseconds
+#define WMA_DEFAULT_SUBSTREAM_OVERLAP_FUDGE      5    // in milliseconds
 
 
 CWMAudioFormat::CWMAudioFormat(IHXCommonClassFactory* pCommonClassFactory,
@@ -64,15 +66,18 @@
     , m_bCanChangeAudioStream(FALSE)
     , m_bActiveSubStreamChanged(FALSE)
     , m_bNewAssembledFrame(FALSE)
+    , m_bSubStreamTransition(FALSE)
     , m_ulMaxDecoderOutputSamples(0)
     , m_ulMaxDecoderOutputBytes(0)
     , m_ulAUDurationInSamples(0)
     , m_ulCodecDelayInMs(0)
     , m_ulDecoderBufferSize(0)
+    , m_ulSubStreamTransitionTimeInMs(WMA_DEFAULT_SUBSTREAM_TRANSITION_TIME)
+    , m_ulNewSubStreamFirstPacketTimeInMs(0)
     , m_pDecoderBuffer(NULL)
     , m_ulLastDecodedEndTimeInSamples(0)
     , m_ulLastFrameTimeInSamples(0)
-
+    , m_ulLastDecodedEndTimeInMs(0)
 {
     HX_ASSERT(m_pCommonClassFactory);
 }
@@ -192,7 +197,7 @@
     return bRet;
 }
 
-HX_RESULT CWMAudioFormat::UpdateAudioFormat(UINT32& rulAnchorTime, HXBOOL bForceUpdate)
+HX_RESULT CWMAudioFormat::UpdateAudioFormat(UINT32& rulAnchorTimeInSamples, HXBOOL bForceUpdate)
 {
     HX_RESULT retVal = HXR_FAIL;
 
@@ -227,12 +232,12 @@
                 if (m_pAudioFmt->ulSamplesPerSec != ulSampleRate || bForceUpdate)
                 {
                     // Convert to ms before we change the sample rate
-                    UINT32 ulAnchorInMs = CAudioFormat::ConvertTimeToMs(rulAnchorTime);
+                    UINT32 ulAnchorInMs = CAudioFormat::ConvertTimeToMs(rulAnchorTimeInSamples);
                     // Re-assign the audio format channels and sample rate
                     m_pAudioFmt->uChannels       = usNumChannels;
                     m_pAudioFmt->ulSamplesPerSec = ulSampleRate;
                     // Convert the anchor time back to samples
-                    rulAnchorTime =  CAudioFormat::ConvertMsToTime(ulAnchorInMs);
+                    rulAnchorTimeInSamples =  CAudioFormat::ConvertMsToTime(ulAnchorInMs);
                     // Set the format changed flag
                     bFormatChanged = TRUE;
                 }
@@ -333,9 +338,7 @@
 {
     HX_RESULT retVal = HXR_NO_DATA;
 
-    if (m_ppWMAudioDecoder &&
-        m_ulActiveSubStreamIndex < m_ulNumSubStreams &&
-        m_ppWMAudioDecoder[m_ulActiveSubStreamIndex])
+    if (m_ppWMAudioDecoder && m_ulNumSubStreams && m_pRuleToSubStreamMap)
     {
         // Init local variables
         UINT32           ulBytesDecoded                   = 0;
@@ -345,16 +348,26 @@
         UINT32           ulPacketDecodeStartTimeInSamples = 0;
         INT32            lDecodeStartOffsetInSamples      = 0;
         HX_RESULT        hrCheckStatus                    = HXR_OK;
+        HXBOOL           bSubStreamSwitch                 = FALSE;
+        HXBOOL           bSkipDecodedAudio                = FALSE;
         CMediaPacket*    pAssembledFrame                  = NULL;
-        CWMAudioDecoder* pDecoder = m_ppWMAudioDecoder[m_ulActiveSubStreamIndex];
+        CWMAudioDecoder* pDecoder                         = NULL;
 
-        // See if there's an encoded sample to read
-        pAssembledFrame = CAudioFormat::PeekAudioPacket();
+        // Get the next assembled frame (there may not be one)
+        pAssembledFrame = GetNextAssembledFrame(bSubStreamSwitch);
+
+        // Get the decoder for the active substream index
+        pDecoder = m_ppWMAudioDecoder[m_ulActiveSubStreamIndex];
 
         // Loop while there are still encoded frames to decode
-        while (pAssembledFrame && retVal == HXR_NO_DATA && SUCCEEDED(hrCheckStatus))
+        while (pDecoder && pAssembledFrame && retVal == HXR_NO_DATA && SUCCEEDED(hrCheckStatus))
         {
-            HXLOGL4(HXLOG_WMAR, "DecodeAudioData() ts=%lu", pAssembledFrame->m_ulTime);
+            UINT32 ulSampleDesc = (UINT32) pAssembledFrame->m_pSampleDesc;
+            UINT16 usASMRule    = (UINT16) (ulSampleDesc & 0x0000FFFF);
+            HXLOGL4(HXLOG_WMAR, "DecodeAudioData() ts=%lu rule=%u lastEndSamp=%lu lastEndMs=%lu packSamp=%lu",
+                                 pAssembledFrame->m_ulTime, usASMRule, m_ulLastDecodedEndTimeInSamples,
+                                 m_ulLastDecodedEndTimeInMs,
+                                 CAudioFormat::ConvertMsToTime(pAssembledFrame->m_ulTime));
             // Init loop variables
             ulBytesDecoded                 = 0;
             ulSamplesProduced              = 0;
@@ -379,9 +392,9 @@
                 lDecodeStartOffsetInSamples = ulPacketDecodeStartTimeInSamples - ulNextDecodeStartTimeInSamples;
                 // Is this time greater than the number of samples
                 // in the last decoded frame?
-                if (lDecodeStartOffsetInSamples >= ((INT32) m_ulLastFrameTimeInSamples))
+                if (lDecodeStartOffsetInSamples >= ((INT32) m_ulLastFrameTimeInSamples) || bSubStreamSwitch)
                 {
-                    // There is a significant gap, so set the starting
+                    // There is a significant gap (or we switched substreams), so set the starting
                     // decode time in samples to the packet timestamp in samples.
                     ulNextDecodeStartTimeInSamples = ulPacketDecodeStartTimeInSamples;
                 }
@@ -494,14 +507,53 @@
                         }
                     }
                 }
+                // Is this the first audio decode on the new substream?
+                if (bSubStreamSwitch && ulSamplesProduced > 0)
+                {
+                    // If we are switching substreams, there may be some overlap
+                    // between the end of the last decoded audio on the previous
+                    // substream and the beginning of the first decoded audio
+                    // on the new substream.
+                    INT32 lOverlapInMs = (INT32) m_ulLastDecodedEndTimeInMs - audioData.ulAudioTime;
+                    HXLOGL4(HXLOG_WMAR, "\t%ld ms of overlap", lOverlapInMs);
+                    // Does this audio write overlap the end of the last decoded audio?
+                    if (lOverlapInMs > WMA_DEFAULT_SUBSTREAM_OVERLAP_FUDGE)
+                    {
+                        // Clip off some from the beginning of this audio data
+                        HXBOOL bRet = CAudioFormat::ClipAudioBuffer(&audioData,
+                                                                    m_ulLastDecodedEndTimeInMs,
+                                                                    TRUE);
+                        if (bRet)
+                        {
+                            // We successfully clipped the buffer. Update the samples produced
+                            ulSamplesProduced = CAudioFormat::ConvertBytesToSamples(audioData.pData->GetSize());
+                            // Update the decode start time
+                            ulNextDecodeStartTimeInSamples = CAudioFormat::ConvertMsToTime(audioData.ulAudioTime);
+                        }
+                        else
+                        {
+                            // We did not clip the buffer. This means that
+                            // the previous decoded audio end time was later than
+                            // the end of this decoded audio buffer. Therefore,
+                            // we should skip this decoded audio entirely.
+                            // We allow ulSamplesProduced and
+                            // ulNextDecodeStartTimeInSamples to remain the same
+                            // so that the end times will match up.
+                            bSkipDecodedAudio = TRUE;
+                            HX_RELEASE(audioData.pData);
+                        }
+                    }
+                }
                 // Compute the duration that this call to 
                 // the decoder produced in samples. ConvertSamplesToTime()
                 // simply accounts for the number of channels.
-                m_ulLastFrameTimeInSamples      = CAudioFormat::ConvertSamplesToTime(ulSamplesProduced);
+                m_ulLastFrameTimeInSamples = CAudioFormat::ConvertSamplesToTime(ulSamplesProduced);
                 // Add the duration in samples to the decode
                 // start time in samples to give us the
                 // decoded end time in samples.
                 m_ulLastDecodedEndTimeInSamples = ulNextDecodeStartTimeInSamples + m_ulLastFrameTimeInSamples;
+                // Convert the last decoded end time to milliseconds
+                m_ulLastDecodedEndTimeInMs = CAudioFormat::ConvertTimeToMs(m_ulLastDecodedEndTimeInSamples);
                 // Is there any data left in this encoded frame? Normally
                 // we will consume all the input encoded data in one
                 // call to Decode().
@@ -516,12 +568,14 @@
                     m_bNewAssembledFrame = TRUE;
                 }
                 // If we produced some output samples, then break out
-                if (ulSamplesProduced > 0)
+                if (ulSamplesProduced > 0 && !bSkipDecodedAudio)
                 {
                     break;
                 }
+                // Clear the skip decoded audio flag
+                bSkipDecodedAudio = FALSE;
                 // See if there's another encoded sample to read
-                pAssembledFrame = CAudioFormat::PeekAudioPacket();
+                pAssembledFrame = GetNextAssembledFrame(bSubStreamSwitch);
             }
         }
     }
@@ -803,7 +857,7 @@
             const char* psz4CC = m_ppWMAudioDecoder[m_ulActiveSubStreamIndex]->GetCodecFourCC();
             if (psz4CC && m_pCommonClassFactory)
             {
-                SetCStringProperty(pSrcProps, "SrcCodec", psz4CC, m_pCommonClassFactory, FALSE);
+                SetCStringPropertyCCF(pSrcProps, "SrcCodec", psz4CC, m_pContext, FALSE);
             }
         }
         HX_RELEASE(pSrcProps);
@@ -892,3 +946,90 @@
 
     return retVal;
 }
+
+CMediaPacket* CWMAudioFormat::GetNextAssembledFrame(HXBOOL& rbSubStreamSwitch)
+{
+    CMediaPacket* pRet = NULL;
+
+    // Set the out parameter to the default value
+    rbSubStreamSwitch = FALSE;
+
+    HXBOOL bQueueEmpty = FALSE;
+    while (!pRet && !bQueueEmpty)
+    {
+        // Assume the queue is empty
+        bQueueEmpty = TRUE;
+        // See if there's an encoded sample to read
+        pRet = CAudioFormat::PeekAudioPacket();
+        if (pRet)
+        {
+            // No, the queue is not empty
+            bQueueEmpty = FALSE;
+            // Check the substream of this assembled frame in
+            // order to find out if we need to do a stream switch
+            // Get the ASM rule for this packet
+            UINT32 ulSampleDesc = (UINT32) pRet->m_pSampleDesc;
+            UINT16 usASMRule    = (UINT16) (ulSampleDesc & 0x0000FFFF);
+            // Get the substream from the ASM rule
+            UINT32 ulSubStreamIndex = m_ulActiveSubStreamIndex;
+            if (usASMRule < m_pRuleToSubStreamMap->num_rules)
+            {
+                ulSubStreamIndex = (UINT32) m_pRuleToSubStreamMap->rule_to_flag_map[usASMRule];
+            }
+            // Is this substream index different than our active substream index?
+            if (ulSubStreamIndex != m_ulActiveSubStreamIndex)
+            {
+                // The substream index is different. Are we already currently in transition?
+                // If we have already received the first packet of the new substream
+                // and then other packets from the old substream arrive, then we
+                // want to throw them away.
+                if (m_bSubStreamTransition)
+                {
+                    // Remove from the queue
+                    CMediaPacket* pDeadAssembledFrame = CAudioFormat::GetAudioPacket();
+                    // Delete the encoded sample
+                    HX_ASSERT(pRet == pDeadAssembledFrame);
+                    CMediaPacket::DeletePacket(pDeadAssembledFrame);
+                    // NULL out the pointer
+                    pRet = NULL;
+                }
+                else
+                {
+                    // We are not in transition. Therefore, this is the 
+                    // first packet of a new substream. So set the flag
+                    // saying we are in transition
+                    m_bSubStreamTransition = TRUE;
+                    // Save the packet time
+                    m_ulNewSubStreamFirstPacketTimeInMs = pRet->m_ulTime;
+                    // Save the new active substream index
+                    m_ulActiveSubStreamIndex = ulSubStreamIndex;
+                    // Set the new assembled flag
+                    m_bNewAssembledFrame = TRUE;
+                    // Set the flag saying we are switching substreams
+                    rbSubStreamSwitch = TRUE;
+                }
+            }
+            else
+            {
+                // Same substream as the active substream
+                //
+                // Were we transitioning to a new substream?
+                if (m_bSubStreamTransition)
+                {
+                    // If the difference between this timestamp and the
+                    // first timestamp of the new substream is greater
+                    // than m_ulSubStreamTransitionTimeInMs, then turn off
+                    // the substream transition
+                    INT32 lDiff = (INT32) pRet->m_ulTime - m_ulNewSubStreamFirstPacketTimeInMs;
+                    if (lDiff > ((INT32) m_ulSubStreamTransitionTimeInMs))
+                    {
+                        // We are not in transition any more
+                        m_bSubStreamTransition = FALSE;
+                    }
+                }
+            }
+        }
+    }
+
+    return pRet;
+}

Index: wmaformat.h
===================================================================
RCS file: /cvsroot/datatype/asf/audio/renderer/wmaformat.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- wmaformat.h	27 Jan 2006 20:49:08 -0000	1.2
+++ wmaformat.h	3 Feb 2006 22:17:33 -0000	1.3
@@ -74,14 +74,18 @@
     HXBOOL            m_bCanChangeAudioStream;
     HXBOOL            m_bActiveSubStreamChanged;
     HXBOOL            m_bNewAssembledFrame;
+    HXBOOL            m_bSubStreamTransition;
     UINT32            m_ulMaxDecoderOutputSamples;
     UINT32            m_ulMaxDecoderOutputBytes;
     UINT32            m_ulAUDurationInSamples;
     UINT32            m_ulCodecDelayInMs;
     UINT32            m_ulDecoderBufferSize;
+    UINT32            m_ulNewSubStreamFirstPacketTimeInMs;
+    UINT32            m_ulSubStreamTransitionTimeInMs;
     BYTE*             m_pDecoderBuffer;
     UINT32            m_ulLastDecodedEndTimeInSamples;
     UINT32            m_ulLastFrameTimeInSamples;
+    UINT32            m_ulLastDecodedEndTimeInMs;
 
     // Protected methods overridden from base audio format
     virtual CMediaPacket* CreateAssembledPacket(IHXPacket* pCodecData);
@@ -93,15 +97,16 @@
     virtual HX_RESULT        CheckDecoder(CWMAudioDecoder* pDecoder) { return HXR_OK; }
 
     // Protected CWMAudioFormat methods
-    void      _Reset(void);
-    void      ClearDecoderArray(void);
-    HX_RESULT UpdateAudioFormat(UINT32& rulAnchorTime, HXBOOL bForceUpdate = FALSE);
-    HX_RESULT ParseOpaqueData(IHXBuffer* pBuffer);
-    HX_RESULT ChooseInitialActiveSubStream(void);
-    void      UpdateCodecStats(void);
-    HX_RESULT SetSourceProperties(IHXValues* pStreamHdr);
-    HXBOOL    AllSubStreamsSameFormat();
-    HX_RESULT BuildRuleToFlagMap(IHXValues* pStreamHdr);
+    void          _Reset(void);
+    void          ClearDecoderArray(void);
+    HX_RESULT     UpdateAudioFormat(UINT32& rulAnchorTime, HXBOOL bForceUpdate = FALSE);
+    HX_RESULT     ParseOpaqueData(IHXBuffer* pBuffer);
+    HX_RESULT     ChooseInitialActiveSubStream(void);
+    void          UpdateCodecStats(void);
+    HX_RESULT     SetSourceProperties(IHXValues* pStreamHdr);
+    HXBOOL        AllSubStreamsSameFormat();
+    HX_RESULT     BuildRuleToFlagMap(IHXValues* pStreamHdr);
+    CMediaPacket* GetNextAssembledFrame(HXBOOL& rbSubStreamSwitch);
 };
 
 #endif  /* #ifndef WMAFORMAT_H */


From jwei at helixcommunity.org  Tue Feb  7 08:34:16 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Tue Feb  7 10:48:29 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp, 1.3.2.2,
	1.3.2.3
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv30484

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: 06-02-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - mapping Symbian error to Helix Error and setting correct TUncompressedVideoFormat value

This CR is targeting following errors and improvements:

1) If CMdfVideoAdapter::InitL() left due to error, its error was mapped to HXR_FAIL. This CR proposes that error KErrNotSupported is mapped to HXHXR_HXR_UNSUPPORTED_VIDEO while the rest of errors are mapped to HXR_FAIL.
2) value ulPostProcessorOutputFormat of TUncompressedVideoFormat type was set wrongly in CMdfVideoAdapter::InitL(). It is corrected in this CR. And call m_pDevVideoPlay->SetOutputFormatL() is uncommented out accordingly.

Files Modified:

datatype/mdf/video/renderer/mdfvideoadapter.cpp

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, 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.2
retrieving revision 1.3.2.3
diff -u -d -r1.3.2.2 -r1.3.2.3
--- mdfvideoadapter.cpp	1 Feb 2006 17:30:13 -0000	1.3.2.2
+++ mdfvideoadapter.cpp	7 Feb 2006 16:34:14 -0000	1.3.2.3
@@ -162,7 +162,16 @@
     if( error != KErrNone || FAILED( retVal ) )
     {
         m_DevVidInitialized = EInitializedFailed;
-        retVal = HXR_FAIL;
+        MDFVIDEOLOG_WRITE_FORMAT( "Error in Init is %d", error );
+
+        if( error == KErrNotSupported )
+        {
+            retVal = HXR_UNSUPPORTED_VIDEO;
+        }
+        else
+        {
+            retVal = HXR_FAIL;
+        }
     }
     
     MDFVIDEOLOG_RETURNFN2( "Init", retVal );
@@ -216,15 +225,15 @@
             switch (colors)
             {
             case 65536:
-                ulPostProcessorOutputFormat.iDataFormat = ERgbFbsBitmap;
-                ulPostProcessorOutputFormat.iRgbFormat = EFbsBitmapColor64K; //ERgb16bit565;
+                ulPostProcessorOutputFormat.iDataFormat = ERgbRawData;
+                ulPostProcessorOutputFormat.iRgbFormat = ERgb16bit565;
                 displayMode = EColor64K;
                 break;
             case 16777216:
             default:
                 displayMode = EColor16MU;
-                ulPostProcessorOutputFormat.iDataFormat = ERgbFbsBitmap;
-                ulPostProcessorOutputFormat.iRgbFormat = EFbsBitmapColor16MU; //ERgb32bit888;
+                ulPostProcessorOutputFormat.iDataFormat = ERgbRawData;
+                ulPostProcessorOutputFormat.iRgbFormat = ERgb32bit888;
             }
             retVal = HXR_OK;
         }
@@ -270,7 +279,7 @@
         MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to decoder does not leave" );
         m_pDevVideoPlay->SetInputFormatL( m_PostProcessorHwDeviceId, commonFormat );
         MDFVIDEOLOG_INOUTFN( "SetInputFormatL() to postprocessor does not leave" );
-//        m_pDevVideoPlay->SetOutputFormatL( m_PostProcessorHwDeviceId, ulPostProcessorOutputFormat );
+        m_pDevVideoPlay->SetOutputFormatL( m_PostProcessorHwDeviceId, ulPostProcessorOutputFormat );
         MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to postprocessor does not leave" );
         m_pDevVideoPlay->SetVideoDestScreenL( ETrue );
         MDFVIDEOLOG_INOUTFN( "SetVideoDestScreenL() does not leave" );


From jwei at helixcommunity.org  Tue Feb  7 08:35:19 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Tue Feb  7 10:49:30 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfvideoadapter.cpp,1.5,1.6
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv30516

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: 06-02-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - mapping Symbian error to Helix Error and setting correct TUncompressedVideoFormat value

This CR is targeting following errors and improvements:

1) If CMdfVideoAdapter::InitL() left due to error, its error was mapped to HXR_FAIL. This CR proposes that error KErrNotSupported is mapped to HXHXR_HXR_UNSUPPORTED_VIDEO while the rest of errors are mapped to HXR_FAIL.
2) value ulPostProcessorOutputFormat of TUncompressedVideoFormat type was set wrongly in CMdfVideoAdapter::InitL(). It is corrected in this CR. And call m_pDevVideoPlay->SetOutputFormatL() is uncommented out accordingly.

Files Modified:

datatype/mdf/video/renderer/mdfvideoadapter.cpp

======================================================
Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, 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.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mdfvideoadapter.cpp	1 Feb 2006 17:30:24 -0000	1.5
+++ mdfvideoadapter.cpp	7 Feb 2006 16:35:17 -0000	1.6
@@ -162,7 +162,16 @@
     if( error != KErrNone || FAILED( retVal ) )
     {
         m_DevVidInitialized = EInitializedFailed;
-        retVal = HXR_FAIL;
+        MDFVIDEOLOG_WRITE_FORMAT( "Error in Init is %d", error );
+
+        if( error == KErrNotSupported )
+        {
+            retVal = HXR_UNSUPPORTED_VIDEO;
+        }
+        else
+        {
+            retVal = HXR_FAIL;
+        }
     }
     
     MDFVIDEOLOG_RETURNFN2( "Init", retVal );
@@ -216,15 +225,15 @@
             switch (colors)
             {
             case 65536:
-                ulPostProcessorOutputFormat.iDataFormat = ERgbFbsBitmap;
-                ulPostProcessorOutputFormat.iRgbFormat = EFbsBitmapColor64K; //ERgb16bit565;
+                ulPostProcessorOutputFormat.iDataFormat = ERgbRawData;
+                ulPostProcessorOutputFormat.iRgbFormat = ERgb16bit565;
                 displayMode = EColor64K;
                 break;
             case 16777216:
             default:
                 displayMode = EColor16MU;
-                ulPostProcessorOutputFormat.iDataFormat = ERgbFbsBitmap;
-                ulPostProcessorOutputFormat.iRgbFormat = EFbsBitmapColor16MU; //ERgb32bit888;
+                ulPostProcessorOutputFormat.iDataFormat = ERgbRawData;
+                ulPostProcessorOutputFormat.iRgbFormat = ERgb32bit888;
             }
             retVal = HXR_OK;
         }
@@ -270,7 +279,7 @@
         MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to decoder does not leave" );
         m_pDevVideoPlay->SetInputFormatL( m_PostProcessorHwDeviceId, commonFormat );
         MDFVIDEOLOG_INOUTFN( "SetInputFormatL() to postprocessor does not leave" );
-//        m_pDevVideoPlay->SetOutputFormatL( m_PostProcessorHwDeviceId, ulPostProcessorOutputFormat );
+        m_pDevVideoPlay->SetOutputFormatL( m_PostProcessorHwDeviceId, ulPostProcessorOutputFormat );
         MDFVIDEOLOG_INOUTFN( "SetOutputFormatL() to postprocessor does not leave" );
         m_pDevVideoPlay->SetVideoDestScreenL( ETrue );
         MDFVIDEOLOG_INOUTFN( "SetVideoDestScreenL() does not leave" );


From ehyche at helixcommunity.org  Tue Feb  7 09:05:34 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 11:19:44 2006
Subject: [Datatype-cvs] asf/video - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/video
In directory cvs:/tmp/cvs-serv10331/video

Log Message:
Directory /cvsroot/datatype/asf/video added to the repository



From ehyche at helixcommunity.org  Tue Feb  7 09:14:56 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 11:29:06 2006
Subject: [Datatype-cvs] asf/video/renderer - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/video/renderer
In directory cvs:/tmp/cvs-serv17730/renderer

Log Message:
Directory /cvsroot/datatype/asf/video/renderer added to the repository



From ehyche at helixcommunity.org  Tue Feb  7 09:18:48 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 11:32:58 2006
Subject: [Datatype-cvs] asf/video/renderer/platform - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/video/renderer/platform
In directory cvs:/tmp/cvs-serv17994/platform

Log Message:
Directory /cvsroot/datatype/asf/video/renderer/platform added to the repository



From ehyche at helixcommunity.org  Tue Feb  7 09:18:48 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 11:32:58 2006
Subject: [Datatype-cvs] asf/video/renderer/pub - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/video/renderer/pub
In directory cvs:/tmp/cvs-serv17994/pub

Log Message:
Directory /cvsroot/datatype/asf/video/renderer/pub added to the repository



From ehyche at helixcommunity.org  Tue Feb  7 09:18:59 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 11:33:09 2006
Subject: [Datatype-cvs] asf/video/renderer/platform/win32 - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/video/renderer/platform/win32
In directory cvs:/tmp/cvs-serv18011/win32

Log Message:
Directory /cvsroot/datatype/asf/video/renderer/platform/win32 added to the repository



From ehyche at helixcommunity.org  Tue Feb  7 09:24:17 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 11:38:39 2006
Subject: [Datatype-cvs] asf/video/renderer/platform/win32 LICENSE.txt, NONE,
	1.1 RCSL.txt, NONE, 1.1 RPSL.txt, NONE, 1.1 wmvrender.rc, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/asf/video/renderer/platform/win32
In directory cvs:/tmp/cvs-serv18870/renderer/platform/win32

Added Files:
	LICENSE.txt RCSL.txt RPSL.txt wmvrender.rc 
Log Message:
Initial checkin of WMV renderer - not functional yet.


--- NEW FILE: wmvrender.rc ---
/* ***** 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 ***** */ 

#ifdef APSTUDIO_INVOKED
	#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...

/////////////////////////////////////////////////////////////////////////////
// Version stamp for this deliverable

#ifdef WIN32
#include       // Defines for 32bit windows version resources
#else
#include         // Defines for 16bit windows version resources
#endif

#include "hxver.h"        // Defines for standard deliverables
#include "wmvrender.ver"    // Defines for this deliverable created by GETFILES

VS_VERSION_INFO         VERSIONINFO
    FILEVERSION         TARVER_LIST_VERSION
    PRODUCTVERSION      TARVER_LIST_VERSION
    FILEFLAGSMASK       VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
    FILEFLAGS           VS_FF_DEBUG|VS_FF_PRIVATEBUILD|VS_FF_PRERELEASE
#else
    FILEFLAGS           0 // final version
#endif

    FILEOS              VER_FILEOS
    FILETYPE            0   // not needed
    FILESUBTYPE         0   // not needed

BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904E4" // Lang=US English, CharSet=Windows Multilingual
        BEGIN 
            VALUE "FileDescription", "Helix Windows Media Video Renderer plugin"
            VALUE "InternalName",    "wmvrender\0"
            VALUE "OriginalFilename","wmvrender.DLL\0"
            VALUE "ProductName",     "Helix Windows Media Video Renderer plugin" 
                                     STRPLATFORM TARVER_STR_BUILD_NAME STREND

            VALUE "FileVersion",     TARVER_STRING_VERSION
            VALUE "ProductVersion",  TARVER_STRING_VERSION

            VALUE "CompanyName",     HXVER_COMPANY
            VALUE "LegalCopyright",  HXVER_COPYRIGHT
            VALUE "LegalTrademarks", HXVER_TRADEMARKS
            VALUE "DistCode",       "PN01\0"
        END
    END
    BLOCK "VarFileInfo" 
    BEGIN 
        VALUE "Translation", 0x409, 1252
            // English language (0x409) and the Windows ANSI codepage (1252)
    END
END

/////////////////////////////////////////////////////////////////////////////

--- NEW FILE: RCSL.txt ---
The RCSL is made up of a base agreement and a few Attachments.

For Research and Development use, you agree to the terms of the
RCSL R&D License (base RCSL and Attachments A, B, and C) 

For Commercial Use (either distribution or internal commercial
deployment) of the Helix DNA with or without support for RealNetworks'
RealAudio and RealVideo Add-on Technology, you agree to the
terms of the same RCSL R&D license
and execute one or more additional Commercial Use License attachments
.

------------------------------------------------------------------------


    REALNETWORKS COMMUNITY SOURCE LICENSE

Version 1.2 (Rev. Date: January 22, 2003).


  RECITALS

Original Contributor has developed Specifications, Source Code
implementations and Executables of certain Technology; and

Original Contributor desires to license the Technology to a large
community to facilitate research, innovation and product development
while maintaining compatibility of such products with the Technology as
delivered by Original Contributor; and

Original Contributor desires to license certain Trademarks for the
purpose of branding products that are compatible with the relevant
Technology delivered by Original Contributor; and

You desire to license the Technology and possibly certain Trademarks
from Original Contributor on the terms and conditions specified in this
License.

In consideration for the mutual covenants contained herein, You and
Original Contributor agree as follows:


  AGREEMENT

*1. Introduction.*

The RealNetworks Community Source License ("RCSL") and effective
attachments ("License") may include five distinct licenses:

i) Research Use license -- License plus Attachments A, B and C only.

ii) Commercial Use and Trademark License, which may be for Internal
Deployment Use or external distribution, or both -- License plus
Attachments A, B, C, and D.

iii) Technology Compatibility Kit (TCK) license -- Attachment C.

iv) Add-On Technology License (Executable) Commercial Use License
-Attachment F.

v) Add-On Technology Source Code Porting and Optimization
License-Attachment G.

The Research Use license is effective when You click and accept this
License. The TCK is effective when You click and accept this License,
unless otherwise specified in the TCK attachments. The Commercial Use
and Trademark, Add-On Technology License, and the Add-On Technology
Source Code Porting and Optimization licenses must each be signed by You
and Original Contributor to become effective. Once effective, these
licenses and the associated requirements and responsibilities are
cumulative. Capitalized terms used in this License are defined in the
Glossary.

*2. License Grants.*

2.1 Original Contributor Grant.

Subject to Your compliance with Sections 3, 8.10 and Attachment A of
this License, Original Contributor grants to You a worldwide,
royalty-free, non-exclusive license, to the extent of Original
Contributor's Intellectual Property Rights covering the Original Code,
Upgraded Code and Specifications, to do the following:

(a) Research Use License:

(i) use, reproduce and modify the Original Code, Upgraded Code and
Specifications to create Modifications and Reformatted Specifications
for Research Use by You;

(ii) publish and display Original Code, Upgraded Code and Specifications
with, or as part of Modifications, as permitted under Section 3.1(b) below;

(iii) reproduce and distribute copies of Original Code and Upgraded Code
to Licensees and students for Research Use by You;

(iv) compile, reproduce and distribute Original Code and Upgraded Code
in Executable form, and Reformatted Specifications to anyone for
Research Use by You.

(b) Other than the licenses expressly granted in this License, Original
Contributor retains all right, title, and interest in Original Code and
Upgraded Code and Specifications.

2.2 Your Grants.

(a) To Other Licensees. You hereby grant to each Licensee a license to
Your Error Corrections and Shared Modifications, of the same scope and
extent as Original Contributor's licenses under Section 2.1 a) above
relative to Research Use and Attachment D relative to Commercial Use.

(b) To Original Contributor. You hereby grant to Original Contributor a
worldwide, royalty-free, non-exclusive, perpetual and irrevocable
license, to the extent of Your Intellectual Property Rights covering
Your Error Corrections, Shared Modifications and Reformatted
Specifications, to use, reproduce, modify, display and distribute Your
Error Corrections, Shared Modifications and Reformatted Specifications,
in any form, including the right to sublicense such rights through
multiple tiers of distribution.

(c) Other than the licenses expressly granted in Sections 2.2(a) and (b)
above, and the restrictions set forth in Section 3.1(d)(iv) below, You
retain all right, title, and interest in Your Error Corrections, Shared
Modifications and Reformatted Specifications.

2.3 Contributor Modifications.

You may use, reproduce, modify, display and distribute Contributor Error
Corrections, Shared Modifications and Reformatted Specifications,
obtained by You under this License, to the same scope and extent as with
Original Code, Upgraded Code and Specifications.

2.4 Subcontracting.

You may deliver the Source Code of Covered Code to other Licensees
having at least a Research Use license, for the sole purpose of
furnishing development services to You in connection with Your rights
granted in this License. All such Licensees must execute appropriate
documents with respect to such work consistent with the terms of this
License, and acknowledging their work-made-for-hire status or assigning
exclusive right to the work product and associated Intellectual Property
Rights to You.

*3. Requirements and Responsibilities*.

3.1 Research Use License.

As a condition of exercising the rights granted under Section 2.1(a)
above, You agree to comply with the following:

(a) Your Contribution to the Community. All Error Corrections and Shared
Modifications which You create or contribute to are automatically
subject to the licenses granted under Section 2.2 above. You are
encouraged to license all of Your other Modifications under Section 2.2
as Shared Modifications, but are not required to do so. You agree to
notify Original Contributor of any errors in the Specification.

(b) Source Code Availability. You agree to provide all Your Error
Corrections to Original Contributor as soon as reasonably practicable
and, in any event, prior to Internal Deployment Use or Commercial Use,
if applicable. Original Contributor may, at its discretion, post Source
Code for Your Error Corrections and Shared Modifications on the
Community Webserver. You may also post Error Corrections and Shared
Modifications on a web-server of Your choice; provided, that You must
take reasonable precautions to ensure that only Licensees have access to
such Error Corrections and Shared Modifications. Such precautions shall
include, without limitation, a password protection scheme limited to
Licensees and a click-on, download certification of Licensee status
required of those attempting to download from the server. An example of
an acceptable certification is attached as Attachment A-2.

(c) Notices. All Error Corrections and Shared Modifications You create
or contribute to must include a file documenting the additions and
changes You made and the date of such additions and changes. You must
also include the notice set forth in Attachment A-1 in the file header.
If it is not possible to put the notice in a particular Source Code file
due to its structure, then You must include the notice in a location
(such as a relevant directory file), where a recipient would be most
likely to look for such a notice.

(d) Redistribution.

(i) Source. Covered Code may be distributed in Source Code form only to
another Licensee (except for students as provided below). You may not
offer or impose any terms on any Covered Code that alter the rights,
requirements, or responsibilities of such Licensee. You may distribute
Covered Code to students for use in connection with their course work
and research projects undertaken at accredited educational institutions.
Such students need not be Licensees, but must be given a copy of the
notice set forth in Attachment A-3 and such notice must also be included
in a file header or prominent location in the Source Code made available
to such students.

(ii) Executable. You may distribute Executable version(s) of Covered
Code to Licensees and other third parties only for the purpose of
evaluation and comment in connection with Research Use by You and under
a license of Your choice, but which limits use of such Executable
version(s) of Covered Code only to that purpose.

(iii) Modified Class, Interface and Package Naming. In connection with
Research Use by You only, You may use Original Contributor's class,
Interface and package names only to accurately reference or invoke the
Source Code files You modify. Original Contributor grants to You a
limited license to the extent necessary for such purposes.

(iv) You expressly agree that any distribution, in whole or in part, of
Modifications developed by You shall only be done pursuant to the terms
and conditions of this License.

(e) Extensions.

(i) Covered Code. You may not include any Source Code of Community Code
in any Extensions. You may include the compiled Header Files of
Community Code in an Extension provided that Your use of the Covered
Code, including Heading Files, complies with the Commercial Use License,
the TCK and all other terms of this License.

(ii) Publication. No later than the date on which You first distribute
such Extension for Commercial Use, You must publish to the industry, on
a non-confidential basis and free of all copyright restrictions with
respect to reproduction and use, an accurate and current specification
for any Extension. In addition, You must make available an appropriate
test suite, pursuant to the same rights as the specification,
sufficiently detailed to allow any third party reasonably skilled in the
technology to produce implementations of the Extension compatible with
the specification. Such test suites must be made available as soon as
reasonably practicable but, in no event, later than ninety (90) days
after Your first Commercial Use of the Extension. You must use
reasonable efforts to promptly clarify and correct the specification and
the test suite upon written request by Original Contributor.

(iii) Open. You agree to refrain from enforcing any Intellectual
Property Rights You may have covering any interface(s) of Your
Extension, which would prevent the implementation of such interface(s)
by Original Contributor or any Licensee. This obligation does not
prevent You from enforcing any Intellectual Property Right You have that
would otherwise be infringed by an implementation of Your Extension.

(iv) Interface Modifications and Naming. You may not modify or add to
the GUID space * * "xxxxxxxx-0901-11d1-8B06-00A024406D59" or any other
GUID space designated by Original Contributor. You may not modify any
Interface prefix provided with the Covered Code or any other prefix
designated by Original Contributor.* *

* *

(f) You agree that any Specifications provided to You by Original
Contributor are confidential and proprietary information of Original
Contributor. You must maintain the confidentiality of the Specifications
and may not disclose them to any third party without Original
Contributor's prior written consent. You may only use the Specifications
under the terms of this License and only for the purpose of implementing
the terms of this License with respect to Covered Code. You agree not
use, copy or distribute any such Specifications except as provided in
writing by Original Contributor.

3.2 Commercial Use License.

You may not make Commercial Use of any Covered Code unless You and
Original Contributor have executed a copy of the Commercial Use and
Trademark License attached as Attachment D.

*4. Versions of the License.*

4.1 License Versions.

Original Contributor may publish revised versions of the License from
time to time. Each version will be given a distinguishing version number.

4.2 Effect.

Once a particular version of Covered Code has been provided under a
version of the License, You may always continue to use such Covered Code
under the terms of that version of the License. You may also choose to
use such Covered Code under the terms of any subsequent version of the
License. No one other than Original Contributor has the right to
promulgate License versions.

4.3 Multiple-Licensed Code.

Original Contributor may designate portions of the Covered Code as
"Multiple-Licensed." "Multiple-Licensed" means that the Original
Contributor permits You to utilize those designated portions of the
Covered Code under Your choice of this License or the alternative
license(s), if any, specified by the Original Contributor in an
Attachment to this License.

*5. Disclaimer of Warranty.*

5.1 COVERED CODE PROVIDED AS IS.

COVERED CODE IS PROVIDED UNDER THIS LICENSE "AS IS," WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT
FOR A PARTICULAR PURPOSE OR NON-INFRINGING. YOU AGREE TO BEAR THE ENTIRE
RISK IN CONNECTION WITH YOUR USE AND DISTRIBUTION OF COVERED CODE UNDER
THIS LICENSE. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART
OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER
EXCEPT SUBJECT TO THIS DISCLAIMER.

5.2 Not Designed for High Risk Activities.

You acknowledge that Original Code, Upgraded Code and Specifications are
not designed or intended for use in high risk activities including, but
not limited to: (i) on-line control of aircraft, air traffic, aircraft
navigation or aircraft communications; or (ii) in the design,
construction, operation or maintenance of any nuclear facility. Original
Contributor disclaims any express or implied warranty of fitness for
such uses.

*6. Termination.*

6.1 By You.

You may terminate this Research Use license at anytime by providing
written notice to Original Contributor.

6.2 By Original Contributor.

This License and the rights granted hereunder will terminate:

(i) automatically if You fail to comply with the terms of this License
and fail to cure such breach within 30 days of receipt of written notice
of the breach;

(ii) immediately in the event of circumstances specified in Sections 7.1
and 8.4; or

(iii) at Original Contributor's discretion upon any action initiated by
You (including by cross-claim or counter claim) alleging that use or
distribution by Original Contributor or any Licensee, of Original Code,
Upgraded Code, Error Corrections, Shared Modifications or Specifications
infringe a patent owned or controlled by You.

6.3 Effective of Termination.

Upon termination, You agree to discontinue use of and destroy all copies
of Covered Code in Your possession. All sublicenses to the Covered Code
which You have properly granted shall survive any termination of this
License. Provisions that, by their nature, should remain in effect
beyond the termination of this License shall survive including, without
limitation, Sections 2.2, 3, 5, 7 and 8.

6.4 No Compensation.

Each party waives and releases the other from any claim to compensation
or indemnity for permitted or lawful termination of the business
relationship established by this License.

*7. Liability.*

7.1 Infringement. Should any of the Original Code, Upgraded Code, TCK or
Specifications ("Materials") become the subject of a claim of
infringement, Original Contributor may, at its sole option, (i) attempt
to procure the rights necessary for You to continue using the Materials,
(ii) modify the Materials so that they are no longer infringing, or
(iii) terminate Your right to use the Materials, immediately upon
written notice, and refund to You the amount, if any, having then
actually been paid by You to Original Contributor for the Original Code,
Upgraded Code and TCK, depreciated on a straight line, five year basis.

7.2 LIMITATION OF LIABILITY. TO THE FULL EXTENT ALLOWED BY APPLICABLE
LAW, ORIGINAL CONTRIBUTOR'S LIABILITY TO YOU FOR CLAIMS RELATING TO THIS
LICENSE, WHETHER FOR BREACH OR IN TORT, SHALL BE LIMITED TO ONE HUNDRED
PERCENT (100%) OF THE AMOUNT HAVING THEN ACTUALLY BEEN PAID BY YOU TO
ORIGINAL CONTRIBUTOR FOR ALL COPIES LICENSED HEREUNDER OF THE PARTICULAR
ITEMS GIVING RISE TO SUCH CLAIM, IF ANY, DURING THE TWELVE MONTHS
PRECEDING THE CLAIMED BREACH. IN NO EVENT WILL YOU (RELATIVE TO YOUR
SHARED MODIFICATIONS OR ERROR CORRECTIONS) OR ORIGINAL CONTRIBUTOR BE
LIABLE FOR ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
DAMAGES IN CONNECTION WITH OR RISING OUT OF THIS LICENSE (INCLUDING,
WITHOUT LIMITATION, LOSS OF PROFITS, USE, DATA, OR OTHER ECONOMIC
ADVANTAGE), HOWEVER IT ARISES AND ON ANY THEORY OF LIABILITY, WHETHER IN
AN ACTION FOR CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE)
OR OTHERWISE, WHETHER OR NOT YOU OR ORIGINAL CONTRIBUTOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE AND NOTWITHSTANDING THE
FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY.

*8. Miscellaneous.*

8.1 Trademark.

You shall not use any Trademark unless You and Original Contributor
execute a copy of the Commercial Use and Trademark License Agreement
attached hereto as Attachment D. Except as expressly provided in the
License, You are granted no right, title or license to, or interest in,
any Trademarks. Whether or not You and Original Contributor enter into
the Trademark License, You agree not to (i) challenge Original
Contributor's ownership or use of Trademarks; (ii) attempt to register
any Trademarks, or any mark or logo substantially similar thereto; or
(iii) incorporate any Trademarks into Your own trademarks, product
names, service marks, company names, or domain names.

8.2 Integration.

This License represents the complete agreement concerning the subject
matter hereof.

8.3 Assignment.

Original Contributor may assign this License, and its rights and
obligations hereunder, in its sole discretion. You may assign the
Research Use portions of this License and the TCK license to a third
party upon prior written notice to Original Contributor (which may be
provided electronically via the Community Web-Server). You may not
assign the Commercial Use and Trademark license, the Add-On Technology
License, or the Add-On Technology Source Code Porting License, including
by way of merger (regardless of whether You are the surviving entity) or
acquisition, without Original Contributor's prior written consent.

8.4 Severability.

If any provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it
enforceable. Notwithstanding the foregoing, if You are prohibited by law
from fully and specifically complying with Sections 2.2 or 3, this
License will immediately terminate and You must immediately discontinue
any use of Covered Code.

8.5 Governing Law.

This License shall be governed by the laws of the United States and the
State of Washington, as applied to contracts entered into and to be
performed in Washington between Washington residents. The application of
the United Nations Convention on Contracts for the International Sale of
Goods is expressly excluded. You agree that the state and federal courts
located in Seattle, Washington have exclusive jurisdiction over any
claim relating to the License, including contract and tort claims.

8.6 Dispute Resolution.

a) Arbitration. Any dispute arising out of or relating to this License
shall be finally settled by arbitration as set out herein, except that
either party may bring any action, in a court of competent jurisdiction
(which jurisdiction shall be exclusive), with respect to any dispute
relating to such party's Intellectual Property Rights or with respect to
Your compliance with the TCK license. Arbitration shall be administered:
(i) by the American Arbitration Association (AAA), (ii) in accordance
with the rules of the United Nations Commission on International Trade
Law (UNCITRAL) (the "Rules") in effect at the time of arbitration as
modified herein; and (iii) the arbitrator will apply the substantive
laws of Washington and the United States. Judgment upon the award
rendered by the arbitrator may be entered in any court having
jurisdiction to enforce such award.

b) Arbitration language, venue and damages. All arbitration proceedings
shall be conducted in English by a single arbitrator selected in
accordance with the Rules, who must be fluent in English and be either a
retired judge or practicing attorney having at least ten (10) years
litigation experience and be reasonably familiar with the technology
matters relative to the dispute. Unless otherwise agreed, arbitration
venue shall be in Seattle, Washington. The arbitrator may award monetary
damages only and nothing shall preclude either party from seeking
provisional or emergency relief from a court of competent jurisdiction.
The arbitrator shall have no authority to award damages in excess of
those permitted in this License and any such award in excess is void.
All awards will be payable in U.S. dollars and may include, for the
prevailing party (i) pre-judgment award interest, (ii) reasonable
attorneys' fees incurred in connection with the arbitration, and (iii)
reasonable costs and expenses incurred in enforcing the award. The
arbitrator will order each party to produce identified documents and
respond to no more than twenty-five single question interrogatories.

8.7 Construction.

Any law or regulation, which provides that the language of a contract
shall be construed against the drafter, shall not apply to this License.

8.8 U.S. Government End Users.

The Covered Code is a "commercial item," as that term is defined in 48
C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software"
and "commercial computer software documentation," as such terms are used
in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and
48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government
End Users acquire Covered Code with only those rights set forth herein.
You agree to pass this notice to our licensees.

8.9 Marketing Activities.

Licensee hereby grants Original Contributor a non-exclusive,
non-transferable, limited license to use the Licensee's company name and
logo ("Licensee Marks") in any presentations, press releases, or
marketing materials solely for the purpose of identifying Licensee as a
member of the Helix Community. Licensee shall provide samples of
Licensee Marks to Original Contributor upon request by Original
Contributor. Original Contributor acknowledges that the Licensee Marks
are the trademarks of Licensee. Original Contributor shall not use the
Licensee Marks in a way that may imply that Original Contributor is an
agency or branch of Licensee. Original Contributor understands and
agrees that the use of any Licensee Marks in connection with this
Agreement shall not create any right, title or interest, in, or to the
Licensee Marks or any Licensee trademarks and that all such use and
goodwill associated with any such trademarks will inure to the benefit
of Licensee. Further the Original Contributor will stop usage of the
Licensee Marks upon Licensee's request.

8.10 Press Announcements.

You may make press announcements or other public statements regarding
this License without the prior written consent of the Original
Contributor, if Your statement is limited to announcing the licensing of
the Covered Code or the availability of Your Product and its
compatibility with the Covered Code. All other public announcements
regarding this license require the prior written consent of the Original
Contributor. Consent requests are welcome at press@helixcommunity.org.

8.11 International Use.

a) Export/Import laws. Covered Code is subject to U.S. export control
laws and may be subject to export or import regulations in other
countries. Each party agrees to comply strictly with all such laws and
regulations and acknowledges their responsibility to obtain such
licenses to export, re-export, or import as may be required. You agree
to pass these obligations to Your licensees.

b) Intellectual Property Protection. Due to limited intellectual
property protection and enforcement in certain countries, You agree not
to redistribute the Original Code, Upgraded Code, TCK and Specifications
to any country on the list of restricted countries on the Community Web
Server.

8.12 Language.

This License is in the English language only, which language shall be
controlling in all respects, and all versions of this License in any
other language shall be for accommodation only and shall not be binding
on the parties to this License. All communications and notices made or
given pursuant to this License, and all documentation and support to be
provided, unless otherwise noted, shall be in the English language.

PLEASE READ THE TERMS OF THIS LICENSE CAREFULLY. BY CLICKING ON THE
"ACCEPT" BUTTON BELOW YOU ARE ACCEPTING AND AGREEING TO THE TERMS AND
CONDITIONS OF THIS LICENSE WITH REALNETWORKS, INC. IF YOU ARE AGREEING
TO THIS LICENSE ON BEHALF OF A COMPANY, YOU REPRESENT THAT YOU ARE
AUTHORIZED TO BIND THE COMPANY TO SUCH A LICENSE. WHETHER YOU ARE ACTING
ON YOUR OWN BEHALF, OR REPRESENTING A COMPANY, YOU MUST BE OF MAJORITY
AGE AND BE OTHERWISE COMPETENT TO ENTER INTO CONTRACTS. IF YOU DO NOT
MEET THIS CRITERIA OR YOU DO NOT AGREE TO ANY OF THE TERMS AND
CONDITIONS OF THIS LICENSE, CLICK ON THE REJECT BUTTON TO EXIT.


    GLOSSARY

1. *"Added Value"* means code which:

(i) has a principal purpose which is substantially different from that
of the stand-alone Technology;

(ii) represents a significant functional and value enhancement to the
Technology;

(iii) operates in conjunction with the Technology; and

(iv) is not marketed as a technology which replaces or substitutes for
the Technology

2. "*Applicable Patent Rights*" mean: (a) in the case where Original
Contributor is the grantor of rights, claims of patents that (i) are now
or hereafter acquired, owned by or assigned to Original Contributor and
(ii) are necessarily infringed by using or making the Original Code or
Upgraded Code, including Modifications provided by Original Contributor,
alone and not in combination with other software or hardware; and (b) in
the case where Licensee is the grantor of rights, claims of patents that
(i) are now or hereafter acquired, owned by or assigned to Licensee and
(ii) are infringed (directly or indirectly) by using or making
Licensee's Modifications or Error Corrections, taken alone or in
combination with Covered Code.

3. "*Application Programming Interfaces (APIs)"* means the interfaces,
associated header files, service provider interfaces, and protocols that
enable a device, application, Operating System, or other program to
obtain services from or make requests of (or provide services in
response to requests from) other programs, and to use, benefit from, or
rely on the resources, facilities, and capabilities of the relevant
programs using the APIs. APIs includes the technical documentation
describing the APIs, the Source Code constituting the API, and any
Header Files used with the APIs.

4. "*Commercial Use*" means any use (internal or external), copying,
sublicensing or distribution (internal or external), directly or
indirectly of Covered Code by You other than Your Research Use of
Covered Code within Your business or organization or in conjunction with
other Licensees with equivalent Research Use rights. Commercial Use
includes any use of the Covered Code for direct or indirect commercial
or strategic gain, advantage or other business purpose. Any Commercial
Use requires execution of Attachment D by You and Original Contributor.

5. "*Community Code*" means the Original Code, Upgraded Code, Error
Corrections, Shared Modifications, or any combination thereof.

6. "*Community Webserver(s)"* means the webservers designated by
Original Contributor for access to the Original Code, Upgraded Code, TCK
and Specifications and for posting Error Corrections and Shared
Modifications.

7. "*Compliant Covered Code*" means Covered Code that complies with the
requirements of the TCK.

8. "*Contributor*" means each Licensee that creates or contributes to
the creation of any Error Correction or Shared Modification.

9. "*Covered Code*" means the Original Code, Upgraded Code,
Modifications, or any combination thereof.

10. "*Error Correction*" means any change made to Community Code which
conforms to the Specification and corrects the adverse effect of a
failure of Community Code to perform any function set forth in or
required by the Specifications.

11. "*Executable*" means Covered Code that has been converted from
Source Code to the preferred form for execution by a computer or digital
processor (e.g. binary form).

12. "*Extension(s)"* means any additional Interfaces developed by or for
You which: (i) are designed for use with the Technology; (ii) constitute
an API for a library of computing functions or services; and (iii) are
disclosed or otherwise made available to third party software developers
for the purpose of developing software which invokes such additional
Interfaces. The foregoing shall not apply to software developed by Your
subcontractors to be exclusively used by You.

13. "*Header File(s)"* means that portion of the Source Code that
provides the names and types of member functions, data members, class
definitions, and interface definitions necessary to implement the APIs
for the Covered Code. Header Files include, files specifically
designated by Original Contributor as Header Files. Header Files do not
include the code necessary to implement the functionality underlying the
Interface.

14. *"Helix DNA Server Technology"* means the program(s) that implement
the Helix Universal Server streaming engine for the Technology as
defined in the Specification.

15. *"Helix DNA Client Technology"* means the Covered Code that
implements the RealOne Player engine as defined in the Specification.

16. *"Helix DNA Producer Technology"* means the Covered Code that
implements the Helix Producer engine as defined in the Specification.

17. *"Helix DNA Technology"* means the Helix DNA Server Technology, the
Helix DNA Client Technology, the Helix DNA Producer Technology and other
Helix technologies designated by Original Contributor.

18. "*Intellectual Property Rights*" means worldwide statutory and
common law rights associated solely with (i) Applicable Patent Rights;
(ii) works of authorship including copyrights, copyright applications,
copyright registrations and "moral rights"; (iii) the protection of
trade and industrial secrets and confidential information; and (iv)
divisions, continuations, renewals, and re-issuances of the foregoing
now existing or acquired in the future.

19. *"Interface*" means interfaces, functions, properties, class
definitions, APIs, Header Files, GUIDs, V-Tables, and/or protocols
allowing one piece of software, firmware or hardware to communicate or
interoperate with another piece of software, firmware or hardware.

20. "*Internal Deployment Use*" means use of Compliant Covered Code
(excluding Research Use) within Your business or organization only by
Your employees and/or agents on behalf of Your business or organization,
but not to provide services, including content distribution, to third
parties, subject to execution of Attachment D by You and Original
Contributor, if required.

21. "*Licensee*" means any party that has entered into and has in effect
a version of this License with Original Contributor.

22. "*MIME type*" means a description of what type of media or other
content is in a file, including by way of example but not limited to
'audio/x-pn-realaudio-plugin.'

23. "*Modification(s)"* means (i) any addition to, deletion from and/or
change to the substance and/or structure of the Covered Code, including
Interfaces; (ii) the combination of any Covered Code and any previous
Modifications; (iii) any new file or other representation of computer
program statements that contains any portion of Covered Code; and/or
(iv) any new Source Code implementing any portion of the Specifications.

24. "*MP3 Patents*" means any patents necessary to make, use or sell
technology implementing any portion of the specification developed by
the Moving Picture Experts Group known as MPEG-1 Audio Layer-3 or MP3,
including but not limited to all past and future versions, profiles,
extensions, parts and amendments relating to the MP3 specification.

25. "*MPEG-4 Patents*" means any patents necessary to make, use or sell
technology implementing any portion of the specification developed by
the Moving Pictures Experts Group known as MPEG-4, including but not
limited to all past and future versions, profiles, extensions, parts and
amendments relating to the MPEG-4 specification.

26. "*Original Code*" means the initial Source Code for the Technology
as described on the Community Web Server.

27. "*Original Contributor*" means RealNetworks, Inc., its affiliates
and its successors and assigns.

28. "*Original Contributor MIME Type*" means the MIME registry, browser
preferences, or local file/protocol associations invoking any Helix DNA
Client-based application, including the RealOne Player, for playback of
RealAudio, RealVideo, other RealMedia MIME types or datatypes (e.g.,
.ram, .rnx, .rpm, .ra, .rm, .rp, .rt, .rf, .prx, .mpe, .rmp, .rmj, .rav,
.rjs, .rmx, .rjt, .rms), and any other Original Contributor-specific or
proprietary MIME types that Original Contributor may introduce in the
future.

29. "*Personal Use*" means use of Covered Code by an individual solely
for his or her personal, private and non-commercial purposes. An
individual's use of Covered Code in his or her capacity as an officer,
employee, member, independent contractor or agent of a corporation,
business or organization (commercial or non-commercial) does not qualify
as Personal Use.

30. "*RealMedia File Format*" means the file format designed and
developed by RealNetworks for storing multimedia data and used to store
RealAudio and RealVideo encoded streams. Valid RealMedia File Format
extensions include: .rm, .rmj, .rmc, .rmvb, .rms.

31. "*RCSL Webpage*" means the RealNetworks Community Source License
webpage located at https://www.helixcommunity.org/content/rcsl or such
other URL that Original Contributor may designate from time to time.

32. "*Reformatted Specifications*" means any revision to the
Specifications which translates or reformats the Specifications (as for
example in connection with Your documentation) but which does not alter,
subset or superset * *the functional or operational aspects of the
Specifications.

33. "*Research Use*" means use and distribution of Covered Code only for
Your Personal Use, research or development use and expressly excludes
Internal Deployment Use and Commercial Use. Research Use also includes
use of Covered Code to teach individuals how to use Covered Code.

34. "*Shared Modifications*" means Modifications that You distribute or
use for a Commercial Use, in addition to any Modifications provided by
You, at Your option, pursuant to Section 2.2, or received by You from a
Contributor pursuant to Section 2.3.

35. "*Source Code*" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus any
associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.

36. "*Specifications*" means the specifications for the Technology and
other documentation, as designated on the Community Web Server, as may
be revised by Original Contributor from time to time.

37. "*Trademarks*" means Original Contributor's trademarks and logos,
including, but not limited to, RealNetworks, RealAudio, RealVideo,
RealOne, RealSystem, SureStream, Helix, Helix DNA and other trademarks
whether now used or adopted in the future.

38. "*Technology*" means the technology described in Attachment B, and
Upgrades.

39. "*Technology Compatibility Kit"* or *"TCK*" means the test programs,
procedures, acceptance criteria and/or other requirements, designated by
Original Contributor for use in verifying compliance of Covered Code
with the Specifications, in conjunction with the Original Code and
Upgraded Code. Original Contributor may, in its sole discretion and from
time to time, revise a TCK to correct errors and/or omissions and in
connection with Upgrades.

40. "*Upgrade(s)"* means new versions of Technology designated
exclusively by Original Contributor as an "Upgrade" and released by
Original Contributor from time to time under the terms of the License.

41. "*Upgraded Code*" means the Source Code and/or Executables for
Upgrades, possibly including Modifications made by Contributors.

42. *"User's Guide"* means the users guide for the TCK which Original
Contributor makes available to You to provide direction in how to run
the TCK and properly interpret the results, as may be revised by
Original Contributor from time to time.

43. "*You(r)*" means an individual, or a legal entity acting by and
through an individual or individuals, exercising rights either under
this License or under a future version of this License issued pursuant
to Section 4.1. For legal entities, "You(r)" includes any entity that by
majority voting interest controls, is controlled by, or is under common
control with You.

44. "*Your Products*" means any (i) hardware products You distribute
integrating the Covered Code; (ii) any software products You distribute
with the Covered Code that utilize the APIs of the Covered Code; or
(iii) any services You provide using the Covered Code.


  ATTACHMENT A

REQUIRED NOTICES


    ATTACHMENT A-1

REQUIRED IN ALL CASES

Notice to be included in header file of all Error Corrections and Shared
Modifications:

Portions Copyright 1994-2003 © RealNetworks, Inc. All rights reserved.

The contents of this file, and the files included with this file, are
subject to the current version of RealNetworks Community Source License
Version 1.1 (the "License"). You may not use this file except in
compliance with the License executed by both You and RealNetworks. You
may obtain a copy of the License at *
https://www.helixcommunity.org/content/rcsl.* You may also obtain a copy
of the License by contacting RealNetworks directly. Please see the
License for the rights, obligations and limitations governing use of the
contents of the file.

This file is part of the Helix DNA technology. RealNetworks, Inc., 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, are distributed 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.

Contributor(s):

_______________________________________________

Technology Compatibility Kit Test Suite(s) Location:

________________________________


    ATTACHMENT A-2

SAMPLE LICENSEE CERTIFICATION

"By clicking the `Agree' button below, You certify that You are a
Licensee in good standing under the RealNetworks Community Source
License, ("License") and that Your access, use and distribution of code
and information You may obtain at this site is subject to the License.
If You are not a Licensee under the RealNetworks Community Source
License You agree not to download, copy or use the Helix DNA technology.


    ATTACHMENT A-3

REQUIRED STUDENT NOTIFICATION

"This software and related documentation has been obtained by Your
educational institution subject to the RealNetworks Community Source
License. You have been provided access to the software and related
documentation for use only in connection with your course work and
research activities as a matriculated student of Your educational
institution. Any other use is expressly prohibited.

THIS SOFTWARE AND RELATED DOCUMENTATION CONTAINS PROPRIETARY MATERIAL OF
REALNETWORKS, INC, WHICH ARE PROTECTED BY VARIOUS INTELLECTUAL PROPERTY
RIGHTS.

You may not use this file except in compliance with the License. You may
obtain a copy of the License on the web at
https://www.helixcommunity.org/content/rcsl.

*
*


  ATTACHMENT B

Description of Technology

Helix DNA, which consists of Helix DNA Client, Helix DNA Server and
Helix DNA Producer.

Description of "Technology"

Helix DNA Technology v1.0 as described on the Community Web Server.


  ATTACHMENT C

TECHNOLOGY COMPATIBILITY KIT LICENSE

The following license is effective for the *Helix DNA* Technology
Compatibility Kit - as described on the Community Web Server. The
Technology Compatibility Kit(s) for the Technology specified in
Attachment B may be accessed at the Community Web Server.

1. TCK License.

1.1 Grants to use TCK

Subject to the terms and restrictions set forth below and the
RealNetworks Community Source License, and the Research Use license,
Original Contributor grants to You a worldwide, non-exclusive,
non-transferable license, to the extent of Original Contributor's
Intellectual Property Rights in the TCK (without the right to
sublicense), to use the TCK to develop and test Covered Code.

1.2 TCK Use Restrictions.

You are not authorized to create derivative works of the TCK or use the
TCK to test any implementation of the Specification that is not Covered
Code. You may not publish Your test results or make claims of
comparative compatibility with respect to other implementations of the
Specification. In consideration for the license grant in Section 1.1
above You agree not to develop Your own tests that are intended to
validate conformation with the Specification.

2. Test Results.

You agree to provide to Original Contributor or the third party test
facility if applicable, Your test results that demonstrate that Covered
Code is Compliant Covered Code and that Original Contributor may publish
or otherwise distribute such test results.

PLEASE READ THE TERMS OF THIS LICENSE CAREFULLY. BY CLICKING ON THE
"ACCEPT" BUTTON BELOW YOU ARE ACCEPTING AND AGREEING TO THE TERMS AND
CONDITIONS OF THIS LICENSE WITH THE ORIGINAL CONTRIBUTOR, REALNETWORKS,
INC. IF YOU ARE AGREEING TO THIS LICENSE ON BEHALF OF A COMPANY, YOU
REPRESENT THAT YOU ARE AUTHORIZED TO BIND THE COMPANY TO SUCH A LICENSE.
WHETHER YOU ARE ACTING ON YOUR OWN BEHALF, OR REPRESENTING A COMPANY,
YOU MUST BE OF MAJORITY AGE AND BE OTHERWISE COMPETENT TO ENTER INTO
CONTRACTS. IF YOU DO NOT MEET THIS CRITERIA OR YOU DO NOT AGREE TO ANY
OF THE TERMS AND CONDITIONS OF THIS LICENSE, CLICK ON THE REJECT BUTTON
TO EXIT.

*ACCEPT / REJECT
*

*
*

*To agree to the R&D/academic terms of this license, please register
 on the site --
you will then be given a chance to agree to the clickwrap RCSL

R&D License

and gain access to the RCSL-licensed source code.  To build or deploy
commercial applications based on the RCSL, you will need to agree to the
Commercial Use license attachments
*




--- NEW FILE: LICENSE.txt ---
 Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.  
        
 The contents of this directory, and (except where otherwise
 indicated) the directories included within this directory, are
 subject to the current version of the RealNetworks Public Source
 License (the "RPSL") available at RPSL.txt in this directory, unless
 you have licensed the directory under the current version of the
 RealNetworks Community Source License (the "RCSL") available at
 RCSL.txt in this directory, in which case the RCSL will apply. You
 may also obtain the license terms directly from RealNetworks.  You
 may not use the files in this directory except in compliance with the
 RPSL or, if you have a valid RCSL with RealNetworks applicable to
 this directory, the RCSL.  Please see the applicable RPSL or RCSL for
 the rights, obligations and limitations governing use of the contents
 of the directory.
 
 This directory 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 directory, and the directories included with this directory, are
 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  


--- NEW FILE: RPSL.txt ---
RealNetworks Public Source License Version 1.0
(Rev. Date October 28, 2002)

1. General Definitions. This License applies to any program or other work which
RealNetworks, Inc., or any other entity that elects to use this license,
("Licensor") makes publicly available and which contains a notice placed by
Licensor identifying such program or work as "Original Code" and stating that it
is subject to the terms of this RealNetworks Public Source License version 1.0
(or subsequent version thereof) ("License"). You are not required to accept this
License. However, nothing else grants You permission to use, copy, modify or
distribute the software or its derivative works. These actions are prohibited by
law if You do not accept this License. Therefore, by modifying, copying or
distributing the software (or any work based on the software), You indicate your
acceptance of this License to do so, and all its terms and conditions. In
addition, you agree to the terms of this License by clicking the Accept button
or downloading the software. As used in this License:

1.1 "Applicable Patent Rights" mean: (a) in the case where Licensor is the
grantor of rights, claims of patents that (i) are now or hereafter acquired,
owned by or assigned to Licensor and (ii) are necessarily infringed by using or
making the Original Code alone and not in combination with other software or
hardware; and (b) in the case where You are the grantor of rights, claims of
patents that (i) are now or hereafter acquired, owned by or assigned to You and
(ii) are infringed (directly or indirectly) by using or making Your
Modifications, taken alone or in combination with Original Code.

1.2 "Compatible Source License" means any one of the licenses listed on Exhibit
B or at https://www.helixcommunity.org/content/complicense or other licenses
specifically identified by Licensor in writing. Notwithstanding any term to the
contrary in any Compatible Source License, any code covered by any Compatible
Source License that is used with Covered Code must be made readily available in
Source Code format for royalty-free use under the terms of the Compatible Source
License or this License.

1.3 "Contributor" means any person or entity that creates or contributes to the
creation of Modifications.

1.4 "Covered Code" means the Original Code, Modifications, the combination of
Original Code and any Modifications, and/or any respective portions thereof.

1.5 "Deploy" means to use, sublicense or distribute Covered Code other than for
Your internal research and development (R&D) and/or Personal Use, and includes
without limitation, any and all internal use or distribution of Covered Code
within Your business or organization except for R&D use and/or Personal Use, as
well as direct or indirect sublicensing or distribution of Covered Code by You
to any third party in any form or manner.

1.6 "Derivative Work" means either the Covered Code or any derivative work under
United States copyright law, and including any work containing or including any
portion of the Covered Code or Modifications, either verbatim or with
modifications and/or translated into another language. Derivative Work also
includes any work which combines any portion of Covered Code or Modifications
with code not otherwise governed by the terms of this License.

1.7 "Externally Deploy" means to Deploy the Covered Code in any way that may be
accessed or used by anyone other than You, used to provide any services to
anyone other than You, or used in any way to deliver any content to anyone other
than You, whether the Covered Code is distributed to those parties, made
available as an application intended for use over a computer network, or used to
provide services or otherwise deliver content to anyone other than You.

1.8. "Interface" means interfaces, functions, properties, class definitions,
APIs, header files, GUIDs, V-Tables, and/or protocols allowing one piece of
software, firmware or hardware to communicate or interoperate with another piece
of software, firmware or hardware.

1.9 "Modifications" mean any addition to, deletion from, and/or change to, the
substance and/or structure of the Original Code, any previous Modifications, the
combination of Original Code and any previous Modifications, and/or any
respective portions thereof. When code is released as a series of files, a
Modification is: (a) any addition to or deletion from the contents of a file
containing Covered Code; and/or (b) any new file or other representation of
computer program statements that contains any part of Covered Code.

1.10 "Original Code" means (a) the Source Code of a program or other work as
originally made available by Licensor under this License, including the Source
Code of any updates or upgrades to such programs or works made available by
Licensor under this License, and that has been expressly identified by Licensor
as such in the header file(s) of such work; and (b) the object code compiled
from such Source Code and originally made available by Licensor under this
License.

1.11 "Personal Use" means use of Covered Code by an individual solely for his or
her personal, private and non-commercial purposes. An individual's use of
Covered Code in his or her capacity as an officer, employee, member, independent
contractor or agent of a corporation, business or organization (commercial or
non-commercial) does not qualify as Personal Use.

1.12 "Source Code" means the human readable form of a program or other work that
is suitable for making modifications to it, including all modules it contains,
plus any associated interface definition files, scripts used to control
compilation and installation of an executable (object code).

1.13 "You" or "Your" means an individual or a legal entity exercising rights
under this License. For legal entities, "You" or "Your" includes any entity
which controls, is controlled by, or is under common control with, You, where
"control" means (a) the power, direct or indirect, to cause the direction or
management of such entity, whether by contract or otherwise, or (b) ownership of
fifty percent (50%) or more of the outstanding shares or beneficial ownership of
such entity.

2. Permitted Uses; Conditions & Restrictions. Subject to the terms and
conditions of this License, Licensor hereby grants You, effective on the date
You accept this License (via downloading or using Covered Code or otherwise
indicating your acceptance of this License), a worldwide, royalty-free,
non-exclusive copyright license, to the extent of Licensor's copyrights cover
the Original Code, to do the following:

2.1 You may reproduce, display, perform, modify and Deploy Covered Code,
provided that in each instance:

(a) You must retain and reproduce in all copies of Original Code the copyright
and other proprietary notices and disclaimers of Licensor as they appear in the
Original Code, and keep intact all notices in the Original Code that refer to
this License;

(b) You must include a copy of this License with every copy of Source Code of
Covered Code and documentation You distribute, and You may not offer or impose
any terms on such Source Code that alter or restrict this License or the
recipients' rights hereunder, except as permitted under Section 6;

(c) You must duplicate, to the extent it does not already exist, the notice in
Exhibit A in each file of the Source Code of all Your Modifications, and cause
the modified files to carry prominent notices stating that You changed the files
and the date of any change;

(d) You must make Source Code of all Your Externally Deployed Modifications
publicly available under the terms of this License, including the license grants
set forth in Section 3 below, for as long as you Deploy the Covered Code or
twelve (12) months from the date of initial Deployment, whichever is longer. You
should preferably distribute the Source Code of Your Deployed Modifications
electronically (e.g. download from a web site); and

(e) if You Deploy Covered Code in object code, executable form only, You must
include a prominent notice, in the code itself as well as in related
documentation, stating that Source Code of the Covered Code is available under
the terms of this License with information on how and where to obtain such
Source Code. You must also include the Object Code Notice set forth in Exhibit A
in the "about" box or other appropriate place where other copyright notices are
placed, including any packaging materials.

2.2 You expressly acknowledge and agree that although Licensor and each
Contributor grants the licenses to their respective portions of the Covered Code
set forth herein, no assurances are provided by Licensor or any Contributor that
the Covered Code does not infringe the patent or other intellectual property
rights of any other entity. Licensor and each Contributor disclaim any liability
to You for claims brought by any other entity based on infringement of
intellectual property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, You hereby assume sole responsibility to
secure any other intellectual property rights needed, if any. For example, if a
third party patent license is required to allow You to make, use, sell, import
or offer for sale the Covered Code, it is Your responsibility to acquire such
license(s).

2.3 Subject to the terms and conditions of this License, Licensor hereby grants
You, effective on the date You accept this License (via downloading or using
Covered Code or otherwise indicating your acceptance of this License), a
worldwide, royalty-free, perpetual, non-exclusive patent license under
Licensor's Applicable Patent Rights to make, use, sell, offer for sale and
import the Covered Code, provided that in each instance you comply with the
terms of this License.

3. Your Grants. In consideration of, and as a condition to, the licenses granted
to You under this License:

(a) You grant to Licensor and all third parties a non-exclusive, perpetual,
irrevocable, royalty free license under Your Applicable Patent Rights and other
intellectual property rights owned or controlled by You, to make, sell, offer
for sale, use, import, reproduce, display, perform, modify, distribute and
Deploy Your Modifications of the same scope and extent as Licensor's licenses
under Sections 2.1 and 2.2; and

(b) You grant to Licensor and its subsidiaries a non-exclusive, worldwide,
royalty-free, perpetual and irrevocable license, under Your Applicable Patent
Rights and other intellectual property rights owned or controlled by You, to
make, use, sell, offer for sale, import, reproduce, display, perform,
distribute, modify or have modified (for Licensor and/or its subsidiaries),
sublicense and distribute Your Modifications, in any form and for any purpose,
through multiple tiers of distribution.

(c) You agree not use any information derived from Your use and review of the
Covered Code, including but not limited to any algorithms or inventions that may
be contained in the Covered Code, for the purpose of asserting any of Your
patent rights, or assisting a third party to assert any of its patent rights,
against Licensor or any Contributor.

4. Derivative Works. You may create a Derivative Work by combining Covered Code
with other code not otherwise governed by the terms of this License and
distribute the Derivative Work as an integrated product. In each such instance,
You must make sure the requirements of this License are fulfilled for the
Covered Code or any portion thereof, including all Modifications.

4.1 You must cause any Derivative Work that you distribute, publish or
Externally Deploy, that in whole or in part contains or is derived from the
Covered Code or any part thereof, to be licensed as a whole at no charge to all
third parties under the terms of this License and no other license except as
provided in Section 4.2. You also must make Source Code available for the
Derivative Work under the same terms as Modifications, described in Sections 2
and 3, above.

4.2 Compatible Source Licenses. Software modules that have been independently
developed without any use of Covered Code and which contain no portion of the
Covered Code, Modifications or other Derivative Works, but are used or combined
in any way wtih the Covered Code or any Derivative Work to form a larger
Derivative Work, are exempt from the conditions described in Section 4.1 but
only to the extent that: the software module, including any software that is
linked to, integrated with, or part of the same applications as, the software
module by any method must be wholly subject to one of the Compatible Source
Licenses. Notwithstanding the foregoing, all Covered Code must be subject to the
terms of this License. Thus, the entire Derivative Work must be licensed under a
combination of the RPSL (for Covered Code) and a Compatible Source License for
any independently developed software modules within the Derivative Work. The
foregoing requirement applies even if the Compatible Source License would
ordinarily allow the software module to link with, or form larger works with,
other software that is not subject to the Compatible Source License. For
example, although the Mozilla Public License v1.1 allows Mozilla code to be
combined with proprietary software that is not subject to the MPL, if
MPL-licensed code is used with Covered Code the MPL-licensed code could not be
combined or linked with any code not governed by the MPL. The general intent of
this section 4.2 is to enable use of Covered Code with applications that are
wholly subject to an acceptable open source license. You are responsible for
determining whether your use of software with Covered Code is allowed under Your
license to such software.

4.3 Mere aggregation of another work not based on the Covered Code with the
Covered Code (or with a work based on the Covered Code) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License. If You deliver the Covered Code for combination and/or integration with
an application previously provided by You (for example, via automatic updating
technology), such combination and/or integration constitutes a Derivative Work
subject to the terms of this License.

5. Exclusions From License Grant. Nothing in this License shall be deemed to
grant any rights to trademarks, copyrights, patents, trade secrets or any other
intellectual property of Licensor or any Contributor except as expressly stated
herein. No right is granted to the trademarks of Licensor or any Contributor
even if such marks are included in the Covered Code. Nothing in this License
shall be interpreted to prohibit Licensor from licensing under different terms
from this License any code that Licensor otherwise would have a right to
license. Modifications, Derivative Works and/or any use or combination of
Covered Code with other technology provided by Licensor or third parties may
require additional patent licenses from Licensor which Licensor may grant in its
sole discretion. No patent license is granted separate from the Original Code or
combinations of the Original Code with other software or hardware.

5.1. Trademarks. This License does not grant any rights to use the trademarks or
trade names owned by Licensor ("Licensor Marks" defined in Exhibit C) or to any
trademark or trade name belonging to any Contributor. No Licensor Marks may be
used to endorse or promote products derived from the Original Code other than as
permitted by the Licensor Trademark Policy defined in Exhibit C.

6. Additional Terms. You may choose to offer, and to charge a fee for, warranty,
support, indemnity or liability obligations and/or other rights consistent with
the scope of the license granted herein ("Additional Terms") to one or more
recipients of Covered Code. However, You may do so only on Your own behalf and
as Your sole responsibility, and not on behalf of Licensor or any Contributor.
You must obtain the recipient's agreement that any such Additional Terms are
offered by You alone, and You hereby agree to indemnify, defend and hold
Licensor and every Contributor harmless for any liability incurred by or claims
asserted against Licensor or such Contributor by reason of any such Additional
Terms.

7. Versions of the License. Licensor may publish revised and/or new versions of
this License from time to time. Each version will be given a distinguishing
version number. Once Original Code has been published under a particular version
of this License, You may continue to use it under the terms of that version. You
may also choose to use such Original Code under the terms of any subsequent
version of this License published by Licensor. No one other than Licensor has
the right to modify the terms applicable to Covered Code created under this
License.

8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part
pre-release, untested, or not fully tested works. The Covered Code may contain
errors that could cause failures or loss of data, and may be incomplete or
contain inaccuracies. You expressly acknowledge and agree that use of the
Covered Code, or any portion thereof, is at Your sole and entire risk. THE
COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF
ANY KIND AND LICENSOR AND LICENSOR'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS
"LICENSOR" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY
DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF
SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET
ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. LICENSOR AND EACH
CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE
COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR
REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR
ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR
WRITTEN DOCUMENTATION, INFORMATION OR ADVICE GIVEN BY LICENSOR, A LICENSOR
AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You
acknowledge that the Covered Code is not intended for use in high risk
activities, including, but not limited to, the design, construction, operation
or maintenance of nuclear facilities, aircraft navigation, aircraft
communication systems, or air traffic control machines in which case the failure
of the Covered Code could lead to death, personal injury, or severe physical or
environmental damage. Licensor disclaims any express or implied warranty of
fitness for such uses.

9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT
SHALL LICENSOR OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR
YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER
UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE OR STRICT
LIABILITY), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF LICENSOR OR SUCH
CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND
NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME
JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR
CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event
shall Licensor's total liability to You for all damages (other than as may be
required by applicable law) under this License exceed the amount of ten dollars
($10.00).

10. Ownership. Subject to the licenses granted under this License, each
Contributor retains all rights, title and interest in and to any Modifications
made by such Contributor. Licensor retains all rights, title and interest in and
to the Original Code and any Modifications made by or on behalf of Licensor
("Licensor Modifications"), and such Licensor Modifications will not be
automatically subject to this License. Licensor may, at its sole discretion,
choose to license such Licensor Modifications under this License, or on
different terms from those contained in this License or may choose not to
license them at all.

11. Termination. 

11.1 Term and Termination. The term of this License is perpetual unless
terminated as provided below. This License and the rights granted hereunder will
terminate:

(a) automatically without notice from Licensor if You fail to comply with any
term(s) of this License and fail to cure such breach within 30 days of becoming
aware of such breach;

(b) immediately in the event of the circumstances described in Section 12.5(b);
or

(c) automatically without notice from Licensor if You, at any time during the
term of this License, commence an action for patent infringement against
Licensor (including by cross-claim or counter claim in a lawsuit);

(d) upon written notice from Licensor if You, at any time during the term of
this License, commence an action for patent infringement against any third party
alleging that the Covered Code itself (excluding combinations with other
software or hardware) infringes any patent (including by cross-claim or counter
claim in a lawsuit).

11.2 Effect of Termination. Upon termination, You agree to immediately stop any
further use, reproduction, modification, sublicensing and distribution of the
Covered Code and to destroy all copies of the Covered Code that are in your
possession or control. All sublicenses to the Covered Code which have been
properly granted prior to termination shall survive any termination of this
License. Provisions which, by their nature, should remain in effect beyond the
termination of this License shall survive, including but not limited to Sections
3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for
compensation, indemnity or damages of any sort solely as a result of terminating
this License in accordance with its terms, and termination of this License will
be without prejudice to any other right or remedy of any party.

12. Miscellaneous.

12.1 Government End Users. The Covered Code is a "commercial item" as defined in
FAR 2.101. Government software and technical data rights in the Covered Code
include only those rights customarily provided to the public as defined in this
License. This customary commercial license in technical data and software is
provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer
Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical
Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software
or Computer Software Documentation). Accordingly, all U.S. Government End Users
acquire Covered Code with only those rights set forth herein.

12.2 Relationship of Parties. This License will not be construed as creating an
agency, partnership, joint venture or any other form of legal association
between or among You, Licensor or any Contributor, and You will not represent to
the contrary, whether expressly, by implication, appearance or otherwise.

12.3 Independent Development. Nothing in this License will impair Licensor's
right to acquire, license, develop, have others develop for it, market and/or
distribute technology or products that perform the same or similar functions as,
or otherwise compete with, Modifications, Derivative Works, technology or
products that You may develop, produce, market or distribute.

12.4 Waiver; Construction. Failure by Licensor or any Contributor to enforce any
provision of this License will not be deemed a waiver of future enforcement of
that or any other provision. Any law or regulation which provides that the
language of a contract shall be construed against the drafter will not apply to
this License.

12.5 Severability. (a) If for any reason a court of competent jurisdiction finds
any provision of this License, or portion thereof, to be unenforceable, that
provision of the License will be enforced to the maximum extent permissible so
as to effect the economic benefits and intent of the parties, and the remainder
of this License will continue in full force and effect. (b) Notwithstanding the
foregoing, if applicable law prohibits or restricts You from fully and/or
specifically complying with Sections 2 and/or 3 or prevents the enforceability
of either of those Sections, this License will immediately terminate and You
must immediately discontinue any use of the Covered Code and destroy all copies
of it that are in your possession or control.

12.6 Dispute Resolution. Any litigation or other dispute resolution between You
and Licensor relating to this License shall take place in the Seattle,
Washington, and You and Licensor hereby consent to the personal jurisdiction of,
and venue in, the state and federal courts within that District with respect to
this License. The application of the United Nations Convention on Contracts for
the International Sale of Goods is expressly excluded.

12.7 Export/Import Laws. This software is subject to all export and import laws
and restrictions and regulations of the country in which you receive the Covered
Code and You are solely responsible for ensuring that You do not export,
re-export or import the Covered Code or any direct product thereof in violation
of any such restrictions, laws or regulations, or without all necessary
authorizations.

12.8 Entire Agreement; Governing Law. This License constitutes the entire
agreement between the parties with respect to the subject matter hereof. This
License shall be governed by the laws of the United States and the State of
Washington.

Where You are located in the province of Quebec, Canada, the following clause
applies: The parties hereby confirm that they have requested that this License
and all related documents be drafted in English. Les parties ont exigé
que le présent contrat et tous les documents connexes soient
rédigés en anglais.

								EXHIBIT A.  

"Copyright © 1995-2002
RealNetworks, Inc. and/or its licensors. 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 https://www.helixcommunity.org/content/rpsl unless you have
licensed the file under the RealNetworks Community Source License Version 1.0
(the "RCSL") available at https://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.

Contributor(s): ____________________________________ 

Technology Compatibility Kit Test
Suite(s) Location (if licensed under the RCSL): ______________________________ 

Object Code Notice: Helix DNA Client technology included. Copyright (c)
RealNetworks, Inc., 1995-2002. All rights reserved.


								EXHIBIT B 

Compatible Source Licenses for the RealNetworks Public Source License. The
following list applies to the most recent version of the license as of October
25, 2002, unless otherwise indicated.

* Academic Free License
* Apache Software License
* Apple Public Source License
* Artistic license
* Attribution Assurance Licenses
* BSD license
* Common Public License (1)
* Eiffel Forum License
* GNU General Public License (GPL) (1)
* GNU Library or "Lesser" General Public License (LGPL) (1)
* IBM Public License
* Intel Open Source License
* Jabber Open Source License
* MIT license
* MITRE Collaborative Virtual Workspace License (CVW License)
* Motosoto License
* Mozilla Public License 1.0 (MPL)
* Mozilla Public License 1.1 (MPL)
* Nokia Open Source License
* Open Group Test Suite License
* Python Software Foundation License
* Ricoh Source Code Public License
* Sun Industry Standards Source License (SISSL)
* Sun Public License
* University of Illinois/NCSA Open Source License
* Vovida Software License v. 1.0
* W3C License
* X.Net License
* Zope Public License
* zlib/libpng license

(1) Note: because this license contains certain reciprocal licensing terms that
purport to extend to independently developed code, You may be prohibited under
the terms of this otherwise compatible license from using code licensed under
its terms with Covered Code because Covered Code may only be licensed under the
RealNetworks Public Source License. Any attempt to apply non RPSL license terms,
including without limitation the GPL, to Covered Code is expressly forbidden.
You are responsible for ensuring that Your use of Compatible Source Licensed
code does not violate either the RPSL or the Compatible Source License.

The latest version of this list can be found at:
https://www.helixcommunity.org/content/complicense

								EXHIBIT C 

RealNetworks' Trademark policy.  

RealNetworks defines the following trademarks collectively as "Licensor
Trademarks": "RealNetworks", "RealPlayer", "RealJukebox", "RealSystem",
"RealAudio", "RealVideo", "RealOne Player", "RealMedia", "Helix" or any other
trademarks or trade names belonging to RealNetworks.

RealNetworks "Licensor Trademark Policy" forbids any use of Licensor Trademarks
except as permitted by and in strict compliance at all times with RealNetworks'
third party trademark usage guidelines which are posted at
http://www.realnetworks.com/info/helixlogo.html.



From ehyche at helixcommunity.org  Tue Feb  7 09:24:17 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 11:38:39 2006
Subject: [Datatype-cvs] asf/video/renderer/pub LICENSE.txt, NONE,
	1.1 RCSL.txt, NONE, 1.1 RPSL.txt, NONE, 1.1 wmvdecoder.h, NONE,
	1.1 wmvformat.h, NONE, 1.1 wmvrender.h, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/asf/video/renderer/pub
In directory cvs:/tmp/cvs-serv18870/renderer/pub

Added Files:
	LICENSE.txt RCSL.txt RPSL.txt wmvdecoder.h wmvformat.h 
	wmvrender.h 
Log Message:
Initial checkin of WMV renderer - not functional yet.


--- NEW FILE: RPSL.txt ---
RealNetworks Public Source License Version 1.0
(Rev. Date October 28, 2002)

1. General Definitions. This License applies to any program or other work which
RealNetworks, Inc., or any other entity that elects to use this license,
("Licensor") makes publicly available and which contains a notice placed by
Licensor identifying such program or work as "Original Code" and stating that it
is subject to the terms of this RealNetworks Public Source License version 1.0
(or subsequent version thereof) ("License"). You are not required to accept this
License. However, nothing else grants You permission to use, copy, modify or
distribute the software or its derivative works. These actions are prohibited by
law if You do not accept this License. Therefore, by modifying, copying or
distributing the software (or any work based on the software), You indicate your
acceptance of this License to do so, and all its terms and conditions. In
addition, you agree to the terms of this License by clicking the Accept button
or downloading the software. As used in this License:

1.1 "Applicable Patent Rights" mean: (a) in the case where Licensor is the
grantor of rights, claims of patents that (i) are now or hereafter acquired,
owned by or assigned to Licensor and (ii) are necessarily infringed by using or
making the Original Code alone and not in combination with other software or
hardware; and (b) in the case where You are the grantor of rights, claims of
patents that (i) are now or hereafter acquired, owned by or assigned to You and
(ii) are infringed (directly or indirectly) by using or making Your
Modifications, taken alone or in combination with Original Code.

1.2 "Compatible Source License" means any one of the licenses listed on Exhibit
B or at https://www.helixcommunity.org/content/complicense or other licenses
specifically identified by Licensor in writing. Notwithstanding any term to the
contrary in any Compatible Source License, any code covered by any Compatible
Source License that is used with Covered Code must be made readily available in
Source Code format for royalty-free use under the terms of the Compatible Source
License or this License.

1.3 "Contributor" means any person or entity that creates or contributes to the
creation of Modifications.

1.4 "Covered Code" means the Original Code, Modifications, the combination of
Original Code and any Modifications, and/or any respective portions thereof.

1.5 "Deploy" means to use, sublicense or distribute Covered Code other than for
Your internal research and development (R&D) and/or Personal Use, and includes
without limitation, any and all internal use or distribution of Covered Code
within Your business or organization except for R&D use and/or Personal Use, as
well as direct or indirect sublicensing or distribution of Covered Code by You
to any third party in any form or manner.

1.6 "Derivative Work" means either the Covered Code or any derivative work under
United States copyright law, and including any work containing or including any
portion of the Covered Code or Modifications, either verbatim or with
modifications and/or translated into another language. Derivative Work also
includes any work which combines any portion of Covered Code or Modifications
with code not otherwise governed by the terms of this License.

1.7 "Externally Deploy" means to Deploy the Covered Code in any way that may be
accessed or used by anyone other than You, used to provide any services to
anyone other than You, or used in any way to deliver any content to anyone other
than You, whether the Covered Code is distributed to those parties, made
available as an application intended for use over a computer network, or used to
provide services or otherwise deliver content to anyone other than You.

1.8. "Interface" means interfaces, functions, properties, class definitions,
APIs, header files, GUIDs, V-Tables, and/or protocols allowing one piece of
software, firmware or hardware to communicate or interoperate with another piece
of software, firmware or hardware.

1.9 "Modifications" mean any addition to, deletion from, and/or change to, the
substance and/or structure of the Original Code, any previous Modifications, the
combination of Original Code and any previous Modifications, and/or any
respective portions thereof. When code is released as a series of files, a
Modification is: (a) any addition to or deletion from the contents of a file
containing Covered Code; and/or (b) any new file or other representation of
computer program statements that contains any part of Covered Code.

1.10 "Original Code" means (a) the Source Code of a program or other work as
originally made available by Licensor under this License, including the Source
Code of any updates or upgrades to such programs or works made available by
Licensor under this License, and that has been expressly identified by Licensor
as such in the header file(s) of such work; and (b) the object code compiled
from such Source Code and originally made available by Licensor under this
License.

1.11 "Personal Use" means use of Covered Code by an individual solely for his or
her personal, private and non-commercial purposes. An individual's use of
Covered Code in his or her capacity as an officer, employee, member, independent
contractor or agent of a corporation, business or organization (commercial or
non-commercial) does not qualify as Personal Use.

1.12 "Source Code" means the human readable form of a program or other work that
is suitable for making modifications to it, including all modules it contains,
plus any associated interface definition files, scripts used to control
compilation and installation of an executable (object code).

1.13 "You" or "Your" means an individual or a legal entity exercising rights
under this License. For legal entities, "You" or "Your" includes any entity
which controls, is controlled by, or is under common control with, You, where
"control" means (a) the power, direct or indirect, to cause the direction or
management of such entity, whether by contract or otherwise, or (b) ownership of
fifty percent (50%) or more of the outstanding shares or beneficial ownership of
such entity.

2. Permitted Uses; Conditions & Restrictions. Subject to the terms and
conditions of this License, Licensor hereby grants You, effective on the date
You accept this License (via downloading or using Covered Code or otherwise
indicating your acceptance of this License), a worldwide, royalty-free,
non-exclusive copyright license, to the extent of Licensor's copyrights cover
the Original Code, to do the following:

2.1 You may reproduce, display, perform, modify and Deploy Covered Code,
provided that in each instance:

(a) You must retain and reproduce in all copies of Original Code the copyright
and other proprietary notices and disclaimers of Licensor as they appear in the
Original Code, and keep intact all notices in the Original Code that refer to
this License;

(b) You must include a copy of this License with every copy of Source Code of
Covered Code and documentation You distribute, and You may not offer or impose
any terms on such Source Code that alter or restrict this License or the
recipients' rights hereunder, except as permitted under Section 6;

(c) You must duplicate, to the extent it does not already exist, the notice in
Exhibit A in each file of the Source Code of all Your Modifications, and cause
the modified files to carry prominent notices stating that You changed the files
and the date of any change;

(d) You must make Source Code of all Your Externally Deployed Modifications
publicly available under the terms of this License, including the license grants
set forth in Section 3 below, for as long as you Deploy the Covered Code or
twelve (12) months from the date of initial Deployment, whichever is longer. You
should preferably distribute the Source Code of Your Deployed Modifications
electronically (e.g. download from a web site); and

(e) if You Deploy Covered Code in object code, executable form only, You must
include a prominent notice, in the code itself as well as in related
documentation, stating that Source Code of the Covered Code is available under
the terms of this License with information on how and where to obtain such
Source Code. You must also include the Object Code Notice set forth in Exhibit A
in the "about" box or other appropriate place where other copyright notices are
placed, including any packaging materials.

2.2 You expressly acknowledge and agree that although Licensor and each
Contributor grants the licenses to their respective portions of the Covered Code
set forth herein, no assurances are provided by Licensor or any Contributor that
the Covered Code does not infringe the patent or other intellectual property
rights of any other entity. Licensor and each Contributor disclaim any liability
to You for claims brought by any other entity based on infringement of
intellectual property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, You hereby assume sole responsibility to
secure any other intellectual property rights needed, if any. For example, if a
third party patent license is required to allow You to make, use, sell, import
or offer for sale the Covered Code, it is Your responsibility to acquire such
license(s).

2.3 Subject to the terms and conditions of this License, Licensor hereby grants
You, effective on the date You accept this License (via downloading or using
Covered Code or otherwise indicating your acceptance of this License), a
worldwide, royalty-free, perpetual, non-exclusive patent license under
Licensor's Applicable Patent Rights to make, use, sell, offer for sale and
import the Covered Code, provided that in each instance you comply with the
terms of this License.

3. Your Grants. In consideration of, and as a condition to, the licenses granted
to You under this License:

(a) You grant to Licensor and all third parties a non-exclusive, perpetual,
irrevocable, royalty free license under Your Applicable Patent Rights and other
intellectual property rights owned or controlled by You, to make, sell, offer
for sale, use, import, reproduce, display, perform, modify, distribute and
Deploy Your Modifications of the same scope and extent as Licensor's licenses
under Sections 2.1 and 2.2; and

(b) You grant to Licensor and its subsidiaries a non-exclusive, worldwide,
royalty-free, perpetual and irrevocable license, under Your Applicable Patent
Rights and other intellectual property rights owned or controlled by You, to
make, use, sell, offer for sale, import, reproduce, display, perform,
distribute, modify or have modified (for Licensor and/or its subsidiaries),
sublicense and distribute Your Modifications, in any form and for any purpose,
through multiple tiers of distribution.

(c) You agree not use any information derived from Your use and review of the
Covered Code, including but not limited to any algorithms or inventions that may
be contained in the Covered Code, for the purpose of asserting any of Your
patent rights, or assisting a third party to assert any of its patent rights,
against Licensor or any Contributor.

4. Derivative Works. You may create a Derivative Work by combining Covered Code
with other code not otherwise governed by the terms of this License and
distribute the Derivative Work as an integrated product. In each such instance,
You must make sure the requirements of this License are fulfilled for the
Covered Code or any portion thereof, including all Modifications.

4.1 You must cause any Derivative Work that you distribute, publish or
Externally Deploy, that in whole or in part contains or is derived from the
Covered Code or any part thereof, to be licensed as a whole at no charge to all
third parties under the terms of this License and no other license except as
provided in Section 4.2. You also must make Source Code available for the
Derivative Work under the same terms as Modifications, described in Sections 2
and 3, above.

4.2 Compatible Source Licenses. Software modules that have been independently
developed without any use of Covered Code and which contain no portion of the
Covered Code, Modifications or other Derivative Works, but are used or combined
in any way wtih the Covered Code or any Derivative Work to form a larger
Derivative Work, are exempt from the conditions described in Section 4.1 but
only to the extent that: the software module, including any software that is
linked to, integrated with, or part of the same applications as, the software
module by any method must be wholly subject to one of the Compatible Source
Licenses. Notwithstanding the foregoing, all Covered Code must be subject to the
terms of this License. Thus, the entire Derivative Work must be licensed under a
combination of the RPSL (for Covered Code) and a Compatible Source License for
any independently developed software modules within the Derivative Work. The
foregoing requirement applies even if the Compatible Source License would
ordinarily allow the software module to link with, or form larger works with,
other software that is not subject to the Compatible Source License. For
example, although the Mozilla Public License v1.1 allows Mozilla code to be
combined with proprietary software that is not subject to the MPL, if
MPL-licensed code is used with Covered Code the MPL-licensed code could not be
combined or linked with any code not governed by the MPL. The general intent of
this section 4.2 is to enable use of Covered Code with applications that are
wholly subject to an acceptable open source license. You are responsible for
determining whether your use of software with Covered Code is allowed under Your
license to such software.

4.3 Mere aggregation of another work not based on the Covered Code with the
Covered Code (or with a work based on the Covered Code) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License. If You deliver the Covered Code for combination and/or integration with
an application previously provided by You (for example, via automatic updating
technology), such combination and/or integration constitutes a Derivative Work
subject to the terms of this License.

5. Exclusions From License Grant. Nothing in this License shall be deemed to
grant any rights to trademarks, copyrights, patents, trade secrets or any other
intellectual property of Licensor or any Contributor except as expressly stated
herein. No right is granted to the trademarks of Licensor or any Contributor
even if such marks are included in the Covered Code. Nothing in this License
shall be interpreted to prohibit Licensor from licensing under different terms
from this License any code that Licensor otherwise would have a right to
license. Modifications, Derivative Works and/or any use or combination of
Covered Code with other technology provided by Licensor or third parties may
require additional patent licenses from Licensor which Licensor may grant in its
sole discretion. No patent license is granted separate from the Original Code or
combinations of the Original Code with other software or hardware.

5.1. Trademarks. This License does not grant any rights to use the trademarks or
trade names owned by Licensor ("Licensor Marks" defined in Exhibit C) or to any
trademark or trade name belonging to any Contributor. No Licensor Marks may be
used to endorse or promote products derived from the Original Code other than as
permitted by the Licensor Trademark Policy defined in Exhibit C.

6. Additional Terms. You may choose to offer, and to charge a fee for, warranty,
support, indemnity or liability obligations and/or other rights consistent with
the scope of the license granted herein ("Additional Terms") to one or more
recipients of Covered Code. However, You may do so only on Your own behalf and
as Your sole responsibility, and not on behalf of Licensor or any Contributor.
You must obtain the recipient's agreement that any such Additional Terms are
offered by You alone, and You hereby agree to indemnify, defend and hold
Licensor and every Contributor harmless for any liability incurred by or claims
asserted against Licensor or such Contributor by reason of any such Additional
Terms.

7. Versions of the License. Licensor may publish revised and/or new versions of
this License from time to time. Each version will be given a distinguishing
version number. Once Original Code has been published under a particular version
of this License, You may continue to use it under the terms of that version. You
may also choose to use such Original Code under the terms of any subsequent
version of this License published by Licensor. No one other than Licensor has
the right to modify the terms applicable to Covered Code created under this
License.

8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part
pre-release, untested, or not fully tested works. The Covered Code may contain
errors that could cause failures or loss of data, and may be incomplete or
contain inaccuracies. You expressly acknowledge and agree that use of the
Covered Code, or any portion thereof, is at Your sole and entire risk. THE
COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF
ANY KIND AND LICENSOR AND LICENSOR'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS
"LICENSOR" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY
DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF
SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET
ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. LICENSOR AND EACH
CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE
COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR
REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR
ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR
WRITTEN DOCUMENTATION, INFORMATION OR ADVICE GIVEN BY LICENSOR, A LICENSOR
AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You
acknowledge that the Covered Code is not intended for use in high risk
activities, including, but not limited to, the design, construction, operation
or maintenance of nuclear facilities, aircraft navigation, aircraft
communication systems, or air traffic control machines in which case the failure
of the Covered Code could lead to death, personal injury, or severe physical or
environmental damage. Licensor disclaims any express or implied warranty of
fitness for such uses.

9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT
SHALL LICENSOR OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR
YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER
UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE OR STRICT
LIABILITY), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF LICENSOR OR SUCH
CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND
NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME
JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR
CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event
shall Licensor's total liability to You for all damages (other than as may be
required by applicable law) under this License exceed the amount of ten dollars
($10.00).

10. Ownership. Subject to the licenses granted under this License, each
Contributor retains all rights, title and interest in and to any Modifications
made by such Contributor. Licensor retains all rights, title and interest in and
to the Original Code and any Modifications made by or on behalf of Licensor
("Licensor Modifications"), and such Licensor Modifications will not be
automatically subject to this License. Licensor may, at its sole discretion,
choose to license such Licensor Modifications under this License, or on
different terms from those contained in this License or may choose not to
license them at all.

11. Termination. 

11.1 Term and Termination. The term of this License is perpetual unless
terminated as provided below. This License and the rights granted hereunder will
terminate:

(a) automatically without notice from Licensor if You fail to comply with any
term(s) of this License and fail to cure such breach within 30 days of becoming
aware of such breach;

(b) immediately in the event of the circumstances described in Section 12.5(b);
or

(c) automatically without notice from Licensor if You, at any time during the
term of this License, commence an action for patent infringement against
Licensor (including by cross-claim or counter claim in a lawsuit);

(d) upon written notice from Licensor if You, at any time during the term of
this License, commence an action for patent infringement against any third party
alleging that the Covered Code itself (excluding combinations with other
software or hardware) infringes any patent (including by cross-claim or counter
claim in a lawsuit).

11.2 Effect of Termination. Upon termination, You agree to immediately stop any
further use, reproduction, modification, sublicensing and distribution of the
Covered Code and to destroy all copies of the Covered Code that are in your
possession or control. All sublicenses to the Covered Code which have been
properly granted prior to termination shall survive any termination of this
License. Provisions which, by their nature, should remain in effect beyond the
termination of this License shall survive, including but not limited to Sections
3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for
compensation, indemnity or damages of any sort solely as a result of terminating
this License in accordance with its terms, and termination of this License will
be without prejudice to any other right or remedy of any party.

12. Miscellaneous.

12.1 Government End Users. The Covered Code is a "commercial item" as defined in
FAR 2.101. Government software and technical data rights in the Covered Code
include only those rights customarily provided to the public as defined in this
License. This customary commercial license in technical data and software is
provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer
Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical
Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software
or Computer Software Documentation). Accordingly, all U.S. Government End Users
acquire Covered Code with only those rights set forth herein.

12.2 Relationship of Parties. This License will not be construed as creating an
agency, partnership, joint venture or any other form of legal association
between or among You, Licensor or any Contributor, and You will not represent to
the contrary, whether expressly, by implication, appearance or otherwise.

12.3 Independent Development. Nothing in this License will impair Licensor's
right to acquire, license, develop, have others develop for it, market and/or
distribute technology or products that perform the same or similar functions as,
or otherwise compete with, Modifications, Derivative Works, technology or
products that You may develop, produce, market or distribute.

12.4 Waiver; Construction. Failure by Licensor or any Contributor to enforce any
provision of this License will not be deemed a waiver of future enforcement of
that or any other provision. Any law or regulation which provides that the
language of a contract shall be construed against the drafter will not apply to
this License.

12.5 Severability. (a) If for any reason a court of competent jurisdiction finds
any provision of this License, or portion thereof, to be unenforceable, that
provision of the License will be enforced to the maximum extent permissible so
as to effect the economic benefits and intent of the parties, and the remainder
of this License will continue in full force and effect. (b) Notwithstanding the
foregoing, if applicable law prohibits or restricts You from fully and/or
specifically complying with Sections 2 and/or 3 or prevents the enforceability
of either of those Sections, this License will immediately terminate and You
must immediately discontinue any use of the Covered Code and destroy all copies
of it that are in your possession or control.

12.6 Dispute Resolution. Any litigation or other dispute resolution between You
and Licensor relating to this License shall take place in the Seattle,
Washington, and You and Licensor hereby consent to the personal jurisdiction of,
and venue in, the state and federal courts within that District with respect to
this License. The application of the United Nations Convention on Contracts for
the International Sale of Goods is expressly excluded.

12.7 Export/Import Laws. This software is subject to all export and import laws
and restrictions and regulations of the country in which you receive the Covered
Code and You are solely responsible for ensuring that You do not export,
re-export or import the Covered Code or any direct product thereof in violation
of any such restrictions, laws or regulations, or without all necessary
authorizations.

12.8 Entire Agreement; Governing Law. This License constitutes the entire
agreement between the parties with respect to the subject matter hereof. This
License shall be governed by the laws of the United States and the State of
Washington.

Where You are located in the province of Quebec, Canada, the following clause
applies: The parties hereby confirm that they have requested that this License
and all related documents be drafted in English. Les parties ont exigé
que le présent contrat et tous les documents connexes soient
rédigés en anglais.

								EXHIBIT A.  

"Copyright © 1995-2002
RealNetworks, Inc. and/or its licensors. 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 https://www.helixcommunity.org/content/rpsl unless you have
licensed the file under the RealNetworks Community Source License Version 1.0
(the "RCSL") available at https://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.

Contributor(s): ____________________________________ 

Technology Compatibility Kit Test
Suite(s) Location (if licensed under the RCSL): ______________________________ 

Object Code Notice: Helix DNA Client technology included. Copyright (c)
RealNetworks, Inc., 1995-2002. All rights reserved.


								EXHIBIT B 

Compatible Source Licenses for the RealNetworks Public Source License. The
following list applies to the most recent version of the license as of October
25, 2002, unless otherwise indicated.

* Academic Free License
* Apache Software License
* Apple Public Source License
* Artistic license
* Attribution Assurance Licenses
* BSD license
* Common Public License (1)
* Eiffel Forum License
* GNU General Public License (GPL) (1)
* GNU Library or "Lesser" General Public License (LGPL) (1)
* IBM Public License
* Intel Open Source License
* Jabber Open Source License
* MIT license
* MITRE Collaborative Virtual Workspace License (CVW License)
* Motosoto License
* Mozilla Public License 1.0 (MPL)
* Mozilla Public License 1.1 (MPL)
* Nokia Open Source License
* Open Group Test Suite License
* Python Software Foundation License
* Ricoh Source Code Public License
* Sun Industry Standards Source License (SISSL)
* Sun Public License
* University of Illinois/NCSA Open Source License
* Vovida Software License v. 1.0
* W3C License
* X.Net License
* Zope Public License
* zlib/libpng license

(1) Note: because this license contains certain reciprocal licensing terms that
purport to extend to independently developed code, You may be prohibited under
the terms of this otherwise compatible license from using code licensed under
its terms with Covered Code because Covered Code may only be licensed under the
RealNetworks Public Source License. Any attempt to apply non RPSL license terms,
including without limitation the GPL, to Covered Code is expressly forbidden.
You are responsible for ensuring that Your use of Compatible Source Licensed
code does not violate either the RPSL or the Compatible Source License.

The latest version of this list can be found at:
https://www.helixcommunity.org/content/complicense

								EXHIBIT C 

RealNetworks' Trademark policy.  

RealNetworks defines the following trademarks collectively as "Licensor
Trademarks": "RealNetworks", "RealPlayer", "RealJukebox", "RealSystem",
"RealAudio", "RealVideo", "RealOne Player", "RealMedia", "Helix" or any other
trademarks or trade names belonging to RealNetworks.

RealNetworks "Licensor Trademark Policy" forbids any use of Licensor Trademarks
except as permitted by and in strict compliance at all times with RealNetworks'
third party trademark usage guidelines which are posted at
http://www.realnetworks.com/info/helixlogo.html.


--- NEW FILE: RCSL.txt ---
The RCSL is made up of a base agreement and a few Attachments.

For Research and Development use, you agree to the terms of the
RCSL R&D License (base RCSL and Attachments A, B, and C) 

For Commercial Use (either distribution or internal commercial
deployment) of the Helix DNA with or without support for RealNetworks'
RealAudio and RealVideo Add-on Technology, you agree to the
terms of the same RCSL R&D license
and execute one or more additional Commercial Use License attachments
.

------------------------------------------------------------------------


    REALNETWORKS COMMUNITY SOURCE LICENSE

Version 1.2 (Rev. Date: January 22, 2003).


  RECITALS

Original Contributor has developed Specifications, Source Code
implementations and Executables of certain Technology; and

Original Contributor desires to license the Technology to a large
community to facilitate research, innovation and product development
while maintaining compatibility of such products with the Technology as
delivered by Original Contributor; and

Original Contributor desires to license certain Trademarks for the
purpose of branding products that are compatible with the relevant
Technology delivered by Original Contributor; and

You desire to license the Technology and possibly certain Trademarks
from Original Contributor on the terms and conditions specified in this
License.

In consideration for the mutual covenants contained herein, You and
Original Contributor agree as follows:


  AGREEMENT

*1. Introduction.*

The RealNetworks Community Source License ("RCSL") and effective
attachments ("License") may include five distinct licenses:

i) Research Use license -- License plus Attachments A, B and C only.

ii) Commercial Use and Trademark License, which may be for Internal
Deployment Use or external distribution, or both -- License plus
Attachments A, B, C, and D.

iii) Technology Compatibility Kit (TCK) license -- Attachment C.

iv) Add-On Technology License (Executable) Commercial Use License
-Attachment F.

v) Add-On Technology Source Code Porting and Optimization
License-Attachment G.

The Research Use license is effective when You click and accept this
License. The TCK is effective when You click and accept this License,
unless otherwise specified in the TCK attachments. The Commercial Use
and Trademark, Add-On Technology License, and the Add-On Technology
Source Code Porting and Optimization licenses must each be signed by You
and Original Contributor to become effective. Once effective, these
licenses and the associated requirements and responsibilities are
cumulative. Capitalized terms used in this License are defined in the
Glossary.

*2. License Grants.*

2.1 Original Contributor Grant.

Subject to Your compliance with Sections 3, 8.10 and Attachment A of
this License, Original Contributor grants to You a worldwide,
royalty-free, non-exclusive license, to the extent of Original
Contributor's Intellectual Property Rights covering the Original Code,
Upgraded Code and Specifications, to do the following:

(a) Research Use License:

(i) use, reproduce and modify the Original Code, Upgraded Code and
Specifications to create Modifications and Reformatted Specifications
for Research Use by You;

(ii) publish and display Original Code, Upgraded Code and Specifications
with, or as part of Modifications, as permitted under Section 3.1(b) below;

(iii) reproduce and distribute copies of Original Code and Upgraded Code
to Licensees and students for Research Use by You;

(iv) compile, reproduce and distribute Original Code and Upgraded Code
in Executable form, and Reformatted Specifications to anyone for
Research Use by You.

(b) Other than the licenses expressly granted in this License, Original
Contributor retains all right, title, and interest in Original Code and
Upgraded Code and Specifications.

2.2 Your Grants.

(a) To Other Licensees. You hereby grant to each Licensee a license to
Your Error Corrections and Shared Modifications, of the same scope and
extent as Original Contributor's licenses under Section 2.1 a) above
relative to Research Use and Attachment D relative to Commercial Use.

(b) To Original Contributor. You hereby grant to Original Contributor a
worldwide, royalty-free, non-exclusive, perpetual and irrevocable
license, to the extent of Your Intellectual Property Rights covering
Your Error Corrections, Shared Modifications and Reformatted
Specifications, to use, reproduce, modify, display and distribute Your
Error Corrections, Shared Modifications and Reformatted Specifications,
in any form, including the right to sublicense such rights through
multiple tiers of distribution.

(c) Other than the licenses expressly granted in Sections 2.2(a) and (b)
above, and the restrictions set forth in Section 3.1(d)(iv) below, You
retain all right, title, and interest in Your Error Corrections, Shared
Modifications and Reformatted Specifications.

2.3 Contributor Modifications.

You may use, reproduce, modify, display and distribute Contributor Error
Corrections, Shared Modifications and Reformatted Specifications,
obtained by You under this License, to the same scope and extent as with
Original Code, Upgraded Code and Specifications.

2.4 Subcontracting.

You may deliver the Source Code of Covered Code to other Licensees
having at least a Research Use license, for the sole purpose of
furnishing development services to You in connection with Your rights
granted in this License. All such Licensees must execute appropriate
documents with respect to such work consistent with the terms of this
License, and acknowledging their work-made-for-hire status or assigning
exclusive right to the work product and associated Intellectual Property
Rights to You.

*3. Requirements and Responsibilities*.

3.1 Research Use License.

As a condition of exercising the rights granted under Section 2.1(a)
above, You agree to comply with the following:

(a) Your Contribution to the Community. All Error Corrections and Shared
Modifications which You create or contribute to are automatically
subject to the licenses granted under Section 2.2 above. You are
encouraged to license all of Your other Modifications under Section 2.2
as Shared Modifications, but are not required to do so. You agree to
notify Original Contributor of any errors in the Specification.

(b) Source Code Availability. You agree to provide all Your Error
Corrections to Original Contributor as soon as reasonably practicable
and, in any event, prior to Internal Deployment Use or Commercial Use,
if applicable. Original Contributor may, at its discretion, post Source
Code for Your Error Corrections and Shared Modifications on the
Community Webserver. You may also post Error Corrections and Shared
Modifications on a web-server of Your choice; provided, that You must
take reasonable precautions to ensure that only Licensees have access to
such Error Corrections and Shared Modifications. Such precautions shall
include, without limitation, a password protection scheme limited to
Licensees and a click-on, download certification of Licensee status
required of those attempting to download from the server. An example of
an acceptable certification is attached as Attachment A-2.

(c) Notices. All Error Corrections and Shared Modifications You create
or contribute to must include a file documenting the additions and
changes You made and the date of such additions and changes. You must
also include the notice set forth in Attachment A-1 in the file header.
If it is not possible to put the notice in a particular Source Code file
due to its structure, then You must include the notice in a location
(such as a relevant directory file), where a recipient would be most
likely to look for such a notice.

(d) Redistribution.

(i) Source. Covered Code may be distributed in Source Code form only to
another Licensee (except for students as provided below). You may not
offer or impose any terms on any Covered Code that alter the rights,
requirements, or responsibilities of such Licensee. You may distribute
Covered Code to students for use in connection with their course work
and research projects undertaken at accredited educational institutions.
Such students need not be Licensees, but must be given a copy of the
notice set forth in Attachment A-3 and such notice must also be included
in a file header or prominent location in the Source Code made available
to such students.

(ii) Executable. You may distribute Executable version(s) of Covered
Code to Licensees and other third parties only for the purpose of
evaluation and comment in connection with Research Use by You and under
a license of Your choice, but which limits use of such Executable
version(s) of Covered Code only to that purpose.

(iii) Modified Class, Interface and Package Naming. In connection with
Research Use by You only, You may use Original Contributor's class,
Interface and package names only to accurately reference or invoke the
Source Code files You modify. Original Contributor grants to You a
limited license to the extent necessary for such purposes.

(iv) You expressly agree that any distribution, in whole or in part, of
Modifications developed by You shall only be done pursuant to the terms
and conditions of this License.

(e) Extensions.

(i) Covered Code. You may not include any Source Code of Community Code
in any Extensions. You may include the compiled Header Files of
Community Code in an Extension provided that Your use of the Covered
Code, including Heading Files, complies with the Commercial Use License,
the TCK and all other terms of this License.

(ii) Publication. No later than the date on which You first distribute
such Extension for Commercial Use, You must publish to the industry, on
a non-confidential basis and free of all copyright restrictions with
respect to reproduction and use, an accurate and current specification
for any Extension. In addition, You must make available an appropriate
test suite, pursuant to the same rights as the specification,
sufficiently detailed to allow any third party reasonably skilled in the
technology to produce implementations of the Extension compatible with
the specification. Such test suites must be made available as soon as
reasonably practicable but, in no event, later than ninety (90) days
after Your first Commercial Use of the Extension. You must use
reasonable efforts to promptly clarify and correct the specification and
the test suite upon written request by Original Contributor.

(iii) Open. You agree to refrain from enforcing any Intellectual
Property Rights You may have covering any interface(s) of Your
Extension, which would prevent the implementation of such interface(s)
by Original Contributor or any Licensee. This obligation does not
prevent You from enforcing any Intellectual Property Right You have that
would otherwise be infringed by an implementation of Your Extension.

(iv) Interface Modifications and Naming. You may not modify or add to
the GUID space * * "xxxxxxxx-0901-11d1-8B06-00A024406D59" or any other
GUID space designated by Original Contributor. You may not modify any
Interface prefix provided with the Covered Code or any other prefix
designated by Original Contributor.* *

* *

(f) You agree that any Specifications provided to You by Original
Contributor are confidential and proprietary information of Original
Contributor. You must maintain the confidentiality of the Specifications
and may not disclose them to any third party without Original
Contributor's prior written consent. You may only use the Specifications
under the terms of this License and only for the purpose of implementing
the terms of this License with respect to Covered Code. You agree not
use, copy or distribute any such Specifications except as provided in
writing by Original Contributor.

3.2 Commercial Use License.

You may not make Commercial Use of any Covered Code unless You and
Original Contributor have executed a copy of the Commercial Use and
Trademark License attached as Attachment D.

*4. Versions of the License.*

4.1 License Versions.

Original Contributor may publish revised versions of the License from
time to time. Each version will be given a distinguishing version number.

4.2 Effect.

Once a particular version of Covered Code has been provided under a
version of the License, You may always continue to use such Covered Code
under the terms of that version of the License. You may also choose to
use such Covered Code under the terms of any subsequent version of the
License. No one other than Original Contributor has the right to
promulgate License versions.

4.3 Multiple-Licensed Code.

Original Contributor may designate portions of the Covered Code as
"Multiple-Licensed." "Multiple-Licensed" means that the Original
Contributor permits You to utilize those designated portions of the
Covered Code under Your choice of this License or the alternative
license(s), if any, specified by the Original Contributor in an
Attachment to this License.

*5. Disclaimer of Warranty.*

5.1 COVERED CODE PROVIDED AS IS.

COVERED CODE IS PROVIDED UNDER THIS LICENSE "AS IS," WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT
FOR A PARTICULAR PURPOSE OR NON-INFRINGING. YOU AGREE TO BEAR THE ENTIRE
RISK IN CONNECTION WITH YOUR USE AND DISTRIBUTION OF COVERED CODE UNDER
THIS LICENSE. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART
OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER
EXCEPT SUBJECT TO THIS DISCLAIMER.

5.2 Not Designed for High Risk Activities.

You acknowledge that Original Code, Upgraded Code and Specifications are
not designed or intended for use in high risk activities including, but
not limited to: (i) on-line control of aircraft, air traffic, aircraft
navigation or aircraft communications; or (ii) in the design,
construction, operation or maintenance of any nuclear facility. Original
Contributor disclaims any express or implied warranty of fitness for
such uses.

*6. Termination.*

6.1 By You.

You may terminate this Research Use license at anytime by providing
written notice to Original Contributor.

6.2 By Original Contributor.

This License and the rights granted hereunder will terminate:

(i) automatically if You fail to comply with the terms of this License
and fail to cure such breach within 30 days of receipt of written notice
of the breach;

(ii) immediately in the event of circumstances specified in Sections 7.1
and 8.4; or

(iii) at Original Contributor's discretion upon any action initiated by
You (including by cross-claim or counter claim) alleging that use or
distribution by Original Contributor or any Licensee, of Original Code,
Upgraded Code, Error Corrections, Shared Modifications or Specifications
infringe a patent owned or controlled by You.

6.3 Effective of Termination.

Upon termination, You agree to discontinue use of and destroy all copies
of Covered Code in Your possession. All sublicenses to the Covered Code
which You have properly granted shall survive any termination of this
License. Provisions that, by their nature, should remain in effect
beyond the termination of this License shall survive including, without
limitation, Sections 2.2, 3, 5, 7 and 8.

6.4 No Compensation.

Each party waives and releases the other from any claim to compensation
or indemnity for permitted or lawful termination of the business
relationship established by this License.

*7. Liability.*

7.1 Infringement. Should any of the Original Code, Upgraded Code, TCK or
Specifications ("Materials") become the subject of a claim of
infringement, Original Contributor may, at its sole option, (i) attempt
to procure the rights necessary for You to continue using the Materials,
(ii) modify the Materials so that they are no longer infringing, or
(iii) terminate Your right to use the Materials, immediately upon
written notice, and refund to You the amount, if any, having then
actually been paid by You to Original Contributor for the Original Code,
Upgraded Code and TCK, depreciated on a straight line, five year basis.

7.2 LIMITATION OF LIABILITY. TO THE FULL EXTENT ALLOWED BY APPLICABLE
LAW, ORIGINAL CONTRIBUTOR'S LIABILITY TO YOU FOR CLAIMS RELATING TO THIS
LICENSE, WHETHER FOR BREACH OR IN TORT, SHALL BE LIMITED TO ONE HUNDRED
PERCENT (100%) OF THE AMOUNT HAVING THEN ACTUALLY BEEN PAID BY YOU TO
ORIGINAL CONTRIBUTOR FOR ALL COPIES LICENSED HEREUNDER OF THE PARTICULAR
ITEMS GIVING RISE TO SUCH CLAIM, IF ANY, DURING THE TWELVE MONTHS
PRECEDING THE CLAIMED BREACH. IN NO EVENT WILL YOU (RELATIVE TO YOUR
SHARED MODIFICATIONS OR ERROR CORRECTIONS) OR ORIGINAL CONTRIBUTOR BE
LIABLE FOR ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
DAMAGES IN CONNECTION WITH OR RISING OUT OF THIS LICENSE (INCLUDING,
WITHOUT LIMITATION, LOSS OF PROFITS, USE, DATA, OR OTHER ECONOMIC
ADVANTAGE), HOWEVER IT ARISES AND ON ANY THEORY OF LIABILITY, WHETHER IN
AN ACTION FOR CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE)
OR OTHERWISE, WHETHER OR NOT YOU OR ORIGINAL CONTRIBUTOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE AND NOTWITHSTANDING THE
FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY.

*8. Miscellaneous.*

8.1 Trademark.

You shall not use any Trademark unless You and Original Contributor
execute a copy of the Commercial Use and Trademark License Agreement
attached hereto as Attachment D. Except as expressly provided in the
License, You are granted no right, title or license to, or interest in,
any Trademarks. Whether or not You and Original Contributor enter into
the Trademark License, You agree not to (i) challenge Original
Contributor's ownership or use of Trademarks; (ii) attempt to register
any Trademarks, or any mark or logo substantially similar thereto; or
(iii) incorporate any Trademarks into Your own trademarks, product
names, service marks, company names, or domain names.

8.2 Integration.

This License represents the complete agreement concerning the subject
matter hereof.

8.3 Assignment.

Original Contributor may assign this License, and its rights and
obligations hereunder, in its sole discretion. You may assign the
Research Use portions of this License and the TCK license to a third
party upon prior written notice to Original Contributor (which may be
provided electronically via the Community Web-Server). You may not
assign the Commercial Use and Trademark license, the Add-On Technology
License, or the Add-On Technology Source Code Porting License, including
by way of merger (regardless of whether You are the surviving entity) or
acquisition, without Original Contributor's prior written consent.

8.4 Severability.

If any provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it
enforceable. Notwithstanding the foregoing, if You are prohibited by law
from fully and specifically complying with Sections 2.2 or 3, this
License will immediately terminate and You must immediately discontinue
any use of Covered Code.

8.5 Governing Law.

This License shall be governed by the laws of the United States and the
State of Washington, as applied to contracts entered into and to be
performed in Washington between Washington residents. The application of
the United Nations Convention on Contracts for the International Sale of
Goods is expressly excluded. You agree that the state and federal courts
located in Seattle, Washington have exclusive jurisdiction over any
claim relating to the License, including contract and tort claims.

8.6 Dispute Resolution.

a) Arbitration. Any dispute arising out of or relating to this License
shall be finally settled by arbitration as set out herein, except that
either party may bring any action, in a court of competent jurisdiction
(which jurisdiction shall be exclusive), with respect to any dispute
relating to such party's Intellectual Property Rights or with respect to
Your compliance with the TCK license. Arbitration shall be administered:
(i) by the American Arbitration Association (AAA), (ii) in accordance
with the rules of the United Nations Commission on International Trade
Law (UNCITRAL) (the "Rules") in effect at the time of arbitration as
modified herein; and (iii) the arbitrator will apply the substantive
laws of Washington and the United States. Judgment upon the award
rendered by the arbitrator may be entered in any court having
jurisdiction to enforce such award.

b) Arbitration language, venue and damages. All arbitration proceedings
shall be conducted in English by a single arbitrator selected in
accordance with the Rules, who must be fluent in English and be either a
retired judge or practicing attorney having at least ten (10) years
litigation experience and be reasonably familiar with the technology
matters relative to the dispute. Unless otherwise agreed, arbitration
venue shall be in Seattle, Washington. The arbitrator may award monetary
damages only and nothing shall preclude either party from seeking
provisional or emergency relief from a court of competent jurisdiction.
The arbitrator shall have no authority to award damages in excess of
those permitted in this License and any such award in excess is void.
All awards will be payable in U.S. dollars and may include, for the
prevailing party (i) pre-judgment award interest, (ii) reasonable
attorneys' fees incurred in connection with the arbitration, and (iii)
reasonable costs and expenses incurred in enforcing the award. The
arbitrator will order each party to produce identified documents and
respond to no more than twenty-five single question interrogatories.

8.7 Construction.

Any law or regulation, which provides that the language of a contract
shall be construed against the drafter, shall not apply to this License.

8.8 U.S. Government End Users.

The Covered Code is a "commercial item," as that term is defined in 48
C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software"
and "commercial computer software documentation," as such terms are used
in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and
48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government
End Users acquire Covered Code with only those rights set forth herein.
You agree to pass this notice to our licensees.

8.9 Marketing Activities.

Licensee hereby grants Original Contributor a non-exclusive,
non-transferable, limited license to use the Licensee's company name and
logo ("Licensee Marks") in any presentations, press releases, or
marketing materials solely for the purpose of identifying Licensee as a
member of the Helix Community. Licensee shall provide samples of
Licensee Marks to Original Contributor upon request by Original
Contributor. Original Contributor acknowledges that the Licensee Marks
are the trademarks of Licensee. Original Contributor shall not use the
Licensee Marks in a way that may imply that Original Contributor is an
agency or branch of Licensee. Original Contributor understands and
agrees that the use of any Licensee Marks in connection with this
Agreement shall not create any right, title or interest, in, or to the
Licensee Marks or any Licensee trademarks and that all such use and
goodwill associated with any such trademarks will inure to the benefit
of Licensee. Further the Original Contributor will stop usage of the
Licensee Marks upon Licensee's request.

8.10 Press Announcements.

You may make press announcements or other public statements regarding
this License without the prior written consent of the Original
Contributor, if Your statement is limited to announcing the licensing of
the Covered Code or the availability of Your Product and its
compatibility with the Covered Code. All other public announcements
regarding this license require the prior written consent of the Original
Contributor. Consent requests are welcome at press@helixcommunity.org.

8.11 International Use.

a) Export/Import laws. Covered Code is subject to U.S. export control
laws and may be subject to export or import regulations in other
countries. Each party agrees to comply strictly with all such laws and
regulations and acknowledges their responsibility to obtain such
licenses to export, re-export, or import as may be required. You agree
to pass these obligations to Your licensees.

b) Intellectual Property Protection. Due to limited intellectual
property protection and enforcement in certain countries, You agree not
to redistribute the Original Code, Upgraded Code, TCK and Specifications
to any country on the list of restricted countries on the Community Web
Server.

8.12 Language.

This License is in the English language only, which language shall be
controlling in all respects, and all versions of this License in any
other language shall be for accommodation only and shall not be binding
on the parties to this License. All communications and notices made or
given pursuant to this License, and all documentation and support to be
provided, unless otherwise noted, shall be in the English language.

PLEASE READ THE TERMS OF THIS LICENSE CAREFULLY. BY CLICKING ON THE
"ACCEPT" BUTTON BELOW YOU ARE ACCEPTING AND AGREEING TO THE TERMS AND
CONDITIONS OF THIS LICENSE WITH REALNETWORKS, INC. IF YOU ARE AGREEING
TO THIS LICENSE ON BEHALF OF A COMPANY, YOU REPRESENT THAT YOU ARE
AUTHORIZED TO BIND THE COMPANY TO SUCH A LICENSE. WHETHER YOU ARE ACTING
ON YOUR OWN BEHALF, OR REPRESENTING A COMPANY, YOU MUST BE OF MAJORITY
AGE AND BE OTHERWISE COMPETENT TO ENTER INTO CONTRACTS. IF YOU DO NOT
MEET THIS CRITERIA OR YOU DO NOT AGREE TO ANY OF THE TERMS AND
CONDITIONS OF THIS LICENSE, CLICK ON THE REJECT BUTTON TO EXIT.


    GLOSSARY

1. *"Added Value"* means code which:

(i) has a principal purpose which is substantially different from that
of the stand-alone Technology;

(ii) represents a significant functional and value enhancement to the
Technology;

(iii) operates in conjunction with the Technology; and

(iv) is not marketed as a technology which replaces or substitutes for
the Technology

2. "*Applicable Patent Rights*" mean: (a) in the case where Original
Contributor is the grantor of rights, claims of patents that (i) are now
or hereafter acquired, owned by or assigned to Original Contributor and
(ii) are necessarily infringed by using or making the Original Code or
Upgraded Code, including Modifications provided by Original Contributor,
alone and not in combination with other software or hardware; and (b) in
the case where Licensee is the grantor of rights, claims of patents that
(i) are now or hereafter acquired, owned by or assigned to Licensee and
(ii) are infringed (directly or indirectly) by using or making
Licensee's Modifications or Error Corrections, taken alone or in
combination with Covered Code.

3. "*Application Programming Interfaces (APIs)"* means the interfaces,
associated header files, service provider interfaces, and protocols that
enable a device, application, Operating System, or other program to
obtain services from or make requests of (or provide services in
response to requests from) other programs, and to use, benefit from, or
rely on the resources, facilities, and capabilities of the relevant
programs using the APIs. APIs includes the technical documentation
describing the APIs, the Source Code constituting the API, and any
Header Files used with the APIs.

4. "*Commercial Use*" means any use (internal or external), copying,
sublicensing or distribution (internal or external), directly or
indirectly of Covered Code by You other than Your Research Use of
Covered Code within Your business or organization or in conjunction with
other Licensees with equivalent Research Use rights. Commercial Use
includes any use of the Covered Code for direct or indirect commercial
or strategic gain, advantage or other business purpose. Any Commercial
Use requires execution of Attachment D by You and Original Contributor.

5. "*Community Code*" means the Original Code, Upgraded Code, Error
Corrections, Shared Modifications, or any combination thereof.

6. "*Community Webserver(s)"* means the webservers designated by
Original Contributor for access to the Original Code, Upgraded Code, TCK
and Specifications and for posting Error Corrections and Shared
Modifications.

7. "*Compliant Covered Code*" means Covered Code that complies with the
requirements of the TCK.

8. "*Contributor*" means each Licensee that creates or contributes to
the creation of any Error Correction or Shared Modification.

9. "*Covered Code*" means the Original Code, Upgraded Code,
Modifications, or any combination thereof.

10. "*Error Correction*" means any change made to Community Code which
conforms to the Specification and corrects the adverse effect of a
failure of Community Code to perform any function set forth in or
required by the Specifications.

11. "*Executable*" means Covered Code that has been converted from
Source Code to the preferred form for execution by a computer or digital
processor (e.g. binary form).

12. "*Extension(s)"* means any additional Interfaces developed by or for
You which: (i) are designed for use with the Technology; (ii) constitute
an API for a library of computing functions or services; and (iii) are
disclosed or otherwise made available to third party software developers
for the purpose of developing software which invokes such additional
Interfaces. The foregoing shall not apply to software developed by Your
subcontractors to be exclusively used by You.

13. "*Header File(s)"* means that portion of the Source Code that
provides the names and types of member functions, data members, class
definitions, and interface definitions necessary to implement the APIs
for the Covered Code. Header Files include, files specifically
designated by Original Contributor as Header Files. Header Files do not
include the code necessary to implement the functionality underlying the
Interface.

14. *"Helix DNA Server Technology"* means the program(s) that implement
the Helix Universal Server streaming engine for the Technology as
defined in the Specification.

15. *"Helix DNA Client Technology"* means the Covered Code that
implements the RealOne Player engine as defined in the Specification.

16. *"Helix DNA Producer Technology"* means the Covered Code that
implements the Helix Producer engine as defined in the Specification.

17. *"Helix DNA Technology"* means the Helix DNA Server Technology, the
Helix DNA Client Technology, the Helix DNA Producer Technology and other
Helix technologies designated by Original Contributor.

18. "*Intellectual Property Rights*" means worldwide statutory and
common law rights associated solely with (i) Applicable Patent Rights;
(ii) works of authorship including copyrights, copyright applications,
copyright registrations and "moral rights"; (iii) the protection of
trade and industrial secrets and confidential information; and (iv)
divisions, continuations, renewals, and re-issuances of the foregoing
now existing or acquired in the future.

19. *"Interface*" means interfaces, functions, properties, class
definitions, APIs, Header Files, GUIDs, V-Tables, and/or protocols
allowing one piece of software, firmware or hardware to communicate or
interoperate with another piece of software, firmware or hardware.

20. "*Internal Deployment Use*" means use of Compliant Covered Code
(excluding Research Use) within Your business or organization only by
Your employees and/or agents on behalf of Your business or organization,
but not to provide services, including content distribution, to third
parties, subject to execution of Attachment D by You and Original
Contributor, if required.

21. "*Licensee*" means any party that has entered into and has in effect
a version of this License with Original Contributor.

22. "*MIME type*" means a description of what type of media or other
content is in a file, including by way of example but not limited to
'audio/x-pn-realaudio-plugin.'

23. "*Modification(s)"* means (i) any addition to, deletion from and/or
change to the substance and/or structure of the Covered Code, including
Interfaces; (ii) the combination of any Covered Code and any previous
Modifications; (iii) any new file or other representation of computer
program statements that contains any portion of Covered Code; and/or
(iv) any new Source Code implementing any portion of the Specifications.

24. "*MP3 Patents*" means any patents necessary to make, use or sell
technology implementing any portion of the specification developed by
the Moving Picture Experts Group known as MPEG-1 Audio Layer-3 or MP3,
including but not limited to all past and future versions, profiles,
extensions, parts and amendments relating to the MP3 specification.

25. "*MPEG-4 Patents*" means any patents necessary to make, use or sell
technology implementing any portion of the specification developed by
the Moving Pictures Experts Group known as MPEG-4, including but not
limited to all past and future versions, profiles, extensions, parts and
amendments relating to the MPEG-4 specification.

26. "*Original Code*" means the initial Source Code for the Technology
as described on the Community Web Server.

27. "*Original Contributor*" means RealNetworks, Inc., its affiliates
and its successors and assigns.

28. "*Original Contributor MIME Type*" means the MIME registry, browser
preferences, or local file/protocol associations invoking any Helix DNA
Client-based application, including the RealOne Player, for playback of
RealAudio, RealVideo, other RealMedia MIME types or datatypes (e.g.,
.ram, .rnx, .rpm, .ra, .rm, .rp, .rt, .rf, .prx, .mpe, .rmp, .rmj, .rav,
.rjs, .rmx, .rjt, .rms), and any other Original Contributor-specific or
proprietary MIME types that Original Contributor may introduce in the
future.

29. "*Personal Use*" means use of Covered Code by an individual solely
for his or her personal, private and non-commercial purposes. An
individual's use of Covered Code in his or her capacity as an officer,
employee, member, independent contractor or agent of a corporation,
business or organization (commercial or non-commercial) does not qualify
as Personal Use.

30. "*RealMedia File Format*" means the file format designed and
developed by RealNetworks for storing multimedia data and used to store
RealAudio and RealVideo encoded streams. Valid RealMedia File Format
extensions include: .rm, .rmj, .rmc, .rmvb, .rms.

31. "*RCSL Webpage*" means the RealNetworks Community Source License
webpage located at https://www.helixcommunity.org/content/rcsl or such
other URL that Original Contributor may designate from time to time.

32. "*Reformatted Specifications*" means any revision to the
Specifications which translates or reformats the Specifications (as for
example in connection with Your documentation) but which does not alter,
subset or superset * *the functional or operational aspects of the
Specifications.

33. "*Research Use*" means use and distribution of Covered Code only for
Your Personal Use, research or development use and expressly excludes
Internal Deployment Use and Commercial Use. Research Use also includes
use of Covered Code to teach individuals how to use Covered Code.

34. "*Shared Modifications*" means Modifications that You distribute or
use for a Commercial Use, in addition to any Modifications provided by
You, at Your option, pursuant to Section 2.2, or received by You from a
Contributor pursuant to Section 2.3.

35. "*Source Code*" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus any
associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.

36. "*Specifications*" means the specifications for the Technology and
other documentation, as designated on the Community Web Server, as may
be revised by Original Contributor from time to time.

37. "*Trademarks*" means Original Contributor's trademarks and logos,
including, but not limited to, RealNetworks, RealAudio, RealVideo,
RealOne, RealSystem, SureStream, Helix, Helix DNA and other trademarks
whether now used or adopted in the future.

38. "*Technology*" means the technology described in Attachment B, and
Upgrades.

39. "*Technology Compatibility Kit"* or *"TCK*" means the test programs,
procedures, acceptance criteria and/or other requirements, designated by
Original Contributor for use in verifying compliance of Covered Code
with the Specifications, in conjunction with the Original Code and
Upgraded Code. Original Contributor may, in its sole discretion and from
time to time, revise a TCK to correct errors and/or omissions and in
connection with Upgrades.

40. "*Upgrade(s)"* means new versions of Technology designated
exclusively by Original Contributor as an "Upgrade" and released by
Original Contributor from time to time under the terms of the License.

41. "*Upgraded Code*" means the Source Code and/or Executables for
Upgrades, possibly including Modifications made by Contributors.

42. *"User's Guide"* means the users guide for the TCK which Original
Contributor makes available to You to provide direction in how to run
the TCK and properly interpret the results, as may be revised by
Original Contributor from time to time.

43. "*You(r)*" means an individual, or a legal entity acting by and
through an individual or individuals, exercising rights either under
this License or under a future version of this License issued pursuant
to Section 4.1. For legal entities, "You(r)" includes any entity that by
majority voting interest controls, is controlled by, or is under common
control with You.

44. "*Your Products*" means any (i) hardware products You distribute
integrating the Covered Code; (ii) any software products You distribute
with the Covered Code that utilize the APIs of the Covered Code; or
(iii) any services You provide using the Covered Code.


  ATTACHMENT A

REQUIRED NOTICES


    ATTACHMENT A-1

REQUIRED IN ALL CASES

Notice to be included in header file of all Error Corrections and Shared
Modifications:

Portions Copyright 1994-2003 © RealNetworks, Inc. All rights reserved.

The contents of this file, and the files included with this file, are
subject to the current version of RealNetworks Community Source License
Version 1.1 (the "License"). You may not use this file except in
compliance with the License executed by both You and RealNetworks. You
may obtain a copy of the License at *
https://www.helixcommunity.org/content/rcsl.* You may also obtain a copy
of the License by contacting RealNetworks directly. Please see the
License for the rights, obligations and limitations governing use of the
contents of the file.

This file is part of the Helix DNA technology. RealNetworks, Inc., 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, are distributed 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.

Contributor(s):

_______________________________________________

Technology Compatibility Kit Test Suite(s) Location:

________________________________


    ATTACHMENT A-2

SAMPLE LICENSEE CERTIFICATION

"By clicking the `Agree' button below, You certify that You are a
Licensee in good standing under the RealNetworks Community Source
License, ("License") and that Your access, use and distribution of code
and information You may obtain at this site is subject to the License.
If You are not a Licensee under the RealNetworks Community Source
License You agree not to download, copy or use the Helix DNA technology.


    ATTACHMENT A-3

REQUIRED STUDENT NOTIFICATION

"This software and related documentation has been obtained by Your
educational institution subject to the RealNetworks Community Source
License. You have been provided access to the software and related
documentation for use only in connection with your course work and
research activities as a matriculated student of Your educational
institution. Any other use is expressly prohibited.

THIS SOFTWARE AND RELATED DOCUMENTATION CONTAINS PROPRIETARY MATERIAL OF
REALNETWORKS, INC, WHICH ARE PROTECTED BY VARIOUS INTELLECTUAL PROPERTY
RIGHTS.

You may not use this file except in compliance with the License. You may
obtain a copy of the License on the web at
https://www.helixcommunity.org/content/rcsl.

*
*


  ATTACHMENT B

Description of Technology

Helix DNA, which consists of Helix DNA Client, Helix DNA Server and
Helix DNA Producer.

Description of "Technology"

Helix DNA Technology v1.0 as described on the Community Web Server.


  ATTACHMENT C

TECHNOLOGY COMPATIBILITY KIT LICENSE

The following license is effective for the *Helix DNA* Technology
Compatibility Kit - as described on the Community Web Server. The
Technology Compatibility Kit(s) for the Technology specified in
Attachment B may be accessed at the Community Web Server.

1. TCK License.

1.1 Grants to use TCK

Subject to the terms and restrictions set forth below and the
RealNetworks Community Source License, and the Research Use license,
Original Contributor grants to You a worldwide, non-exclusive,
non-transferable license, to the extent of Original Contributor's
Intellectual Property Rights in the TCK (without the right to
sublicense), to use the TCK to develop and test Covered Code.

1.2 TCK Use Restrictions.

You are not authorized to create derivative works of the TCK or use the
TCK to test any implementation of the Specification that is not Covered
Code. You may not publish Your test results or make claims of
comparative compatibility with respect to other implementations of the
Specification. In consideration for the license grant in Section 1.1
above You agree not to develop Your own tests that are intended to
validate conformation with the Specification.

2. Test Results.

You agree to provide to Original Contributor or the third party test
facility if applicable, Your test results that demonstrate that Covered
Code is Compliant Covered Code and that Original Contributor may publish
or otherwise distribute such test results.

PLEASE READ THE TERMS OF THIS LICENSE CAREFULLY. BY CLICKING ON THE
"ACCEPT" BUTTON BELOW YOU ARE ACCEPTING AND AGREEING TO THE TERMS AND
CONDITIONS OF THIS LICENSE WITH THE ORIGINAL CONTRIBUTOR, REALNETWORKS,
INC. IF YOU ARE AGREEING TO THIS LICENSE ON BEHALF OF A COMPANY, YOU
REPRESENT THAT YOU ARE AUTHORIZED TO BIND THE COMPANY TO SUCH A LICENSE.
WHETHER YOU ARE ACTING ON YOUR OWN BEHALF, OR REPRESENTING A COMPANY,
YOU MUST BE OF MAJORITY AGE AND BE OTHERWISE COMPETENT TO ENTER INTO
CONTRACTS. IF YOU DO NOT MEET THIS CRITERIA OR YOU DO NOT AGREE TO ANY
OF THE TERMS AND CONDITIONS OF THIS LICENSE, CLICK ON THE REJECT BUTTON
TO EXIT.

*ACCEPT / REJECT
*

*
*

*To agree to the R&D/academic terms of this license, please register
 on the site --
you will then be given a chance to agree to the clickwrap RCSL

R&D License

and gain access to the RCSL-licensed source code.  To build or deploy
commercial applications based on the RCSL, you will need to agree to the
Commercial Use license attachments
*




--- NEW FILE: wmvrender.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 WMVRENDER_H
#define WMVRENDER_H

// Includes
#include "vidrend.h"
#include "baseobj.h"

// Forward declarations
class CHXMemoryAllocator;

class CWMVideoRenderer : public CVideoRenderer,
                         public CHXBaseCountingObject          
{
public:
    CWMVideoRenderer(void);
    virtual ~CWMVideoRenderer();

    // Overridden IHXPlugin methods
    STDMETHOD(GetPluginInfo) (THIS_ REF(HXBOOL)      rbLoadMultiple,
                                    REF(const char*) rpszDescription,
                                    REF(const char*) rpszCopyright,
                                    REF(const char*) rpszMoreInfoURL,
                                    REF(UINT32)      rulVersionNumber);

    // Overridden IHXRenderer methods
    STDMETHOD(GetRendererInfo) (THIS_ REF(const char**) rppszStreamMimeTypes,
                                      REF(UINT32)       rulInitialGranularity);

    // CWMVideoRenderer methods
    static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppUnk);
    HX_RESULT                       GetOutputAllocator(CHXMemoryAllocator** ppAlloc);
    HX_RESULT                       SetOutputAllocator(CHXMemoryAllocator* pAlloc);
protected:
    CHXMemoryAllocator* m_pOutputAllocator;

    static const char* const m_pszDescription;
    static const char* const m_ppszStreamMimeTypes[];

    // Overridden CVideoRenderer protected methods
    virtual CVideoFormat* CreateFormatObject(IHXValues* pHeader);
    virtual const char*   GetRendererName(void);
    virtual void          SetupBitmapDefaults(IHXValues*          pHeader,
                                              HXBitmapInfoHeader& rBitmapInfoHeader);
};

#endif /* #ifndef WMVRENDER_H */

--- NEW FILE: wmvformat.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 WMVFORMAT_H
#define WMVFORMAT_H

// Includes
#include "vidrendf.h"

// Forward declarations
_INTERFACE IHXCommonClassFactory;
_INTERFACE IHXValues;
_INTERFACE IHXPacket;
class CWMVideoRenderer;
class CWMVideoDecoder;
class CMediaPacket;
class CHXBufferMemoryAllocator;
class CRingBuffer;

// Defines
#define HX_WMV_DEFAULT_PIXEL_SIZE         12
#define HX_WMV_DEFAULT_PIXEL_FORMAT  HX_I420


class CWMVideoFormat : public CVideoFormat
{
public:
    CWMVideoFormat(IHXCommonClassFactory* pCommonClassFactory,
                   CWMVideoRenderer*      pWMVideoRenderer,
                   HXBOOL                 bSecure = FALSE);
    virtual ~CWMVideoFormat();

    // Overridden CVideoFormat methods
    virtual HX_RESULT Init(IHXValues* pHeader);
    virtual void      OnDecodedPacketRelease(CMediaPacket*& rpPacket);
    virtual void      Reset(void);
    virtual void      Close(void);
    virtual HX_RESULT InitBitmapInfoHeader(HXBitmapInfoHeader& rBitmapInfoHeader,
                                           CMediaPacket*       pVideoPacket);
    virtual HXBOOL    IsBitmapFormatChanged(HXBitmapInfoHeader& rBitmapInfoHeader,
                                            CMediaPacket*       pVideoPacket);
    virtual ULONG32   GetDefaultPreroll(IHXValues* pValues);
    virtual ULONG32   GetMaxDecodedFrames(void);
    virtual ULONG32   GetMaxDecodedFramesInStep(void);

    // CWMVideoFormat methods
    HX_RESULT           DecodeDone(HXCODEC_DATA* pData);
    virtual const char* GetCodecId(void);
    UINT32              GetBitstreamHeaderSize(void);
    const BYTE*         GetBitstreamHeader(void);
protected:
    CWMVideoDecoder*          m_pDecoder;
    CWMVideoRenderer*         m_pWMVideoRenderer;
    CRingBuffer*              m_pDecodedRingBuffer;
    UINT32                    m_ulMaxDecodedFrames;
    HXxSize                   m_MediaSize;
    UINT32                    m_ulWidthContainedInSegment;
    UINT32                    m_ulHeightContainedInSegment;
    HXBitmapInfoHeader*       m_pCodecOutputBitmapInfoHeader;
    HXBOOL                    m_bFirstDecode;
    HXCODEC_DATA              m_DecodedPacket;
    HXxSize                   m_DecoderDimensions;

    // Overridden protected CVideoFormat methods
    virtual CMediaPacket* CreateAssembledPacket(IHXPacket* pPacket);
    virtual CMediaPacket* CreateDecodedPacket(CMediaPacket* pFrameToDecode);

    // CWMVideoFormat protected methods
    virtual CWMVideoDecoder* CreateDecoder();
    virtual void             ProcessAssembledFrame(CMediaPacket* pAssembledFrame) {};
    HX_RESULT                SetupOutputFormat(HX_MOF* pMof);
    HX_RESULT                CreateAllocators(void);
    void                     FlushDecodedRingBuffer(void);
    void                     _Reset(void);
    void                     ReleaseDecodedPacket(HXCODEC_DATA*& rpDecodedData);

    static void KillWMVSampleDesc(void* pSampleDesc, void* pUserData);
    static void KillWMVOutputBuffer(void* pBuffer, void* pUserData);
};

#endif  /* #ifndef WMVFORMAT_H */

--- NEW FILE: wmvdecoder.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 WMVDECODER_H
#define WMVDECODER_H

// Includes
#include "hxcodec.h"

// Forward declarations
class IHX20MemoryAllocator;
class CWMVideoRenderer;
class CWMVideoFormat;
class CRADynamicCodecLibrary;
class CMediaPacket;

#define HX_WMV_MAX_DECODE_QUALITY 100

class CWMVideoDecoder
{
public:
    CWMVideoDecoder();
    virtual ~CWMVideoDecoder();

    // CWMVideoDecoder methods
    HX_RESULT Init(IUnknown*             pContext,
                   CWMVideoRenderer*     pVideoRenderer,
                   CWMVideoFormat*       pVideoFormat,
                   HXxSize*              pSize,
                   IHX20MemoryAllocator* pOutputAllocator);
    HX_RESULT Decode(CMediaPacket* pFrameToDeocde, UINT32 ulQuality);
    HX_RESULT DecodeDone(HXCODEC_DATA* pData);
    HX_RESULT GetImageInfo(HX_MOF*& rpImageInfo);
    HX_RESULT Close(void);

    // This the function that the codec will call back to
    static HX_RESULT STDMETHODCALLTYPE OnNewImage(HXSTREAM      streamRef,
                                                  HXSTREAM      fromStreamRef,
                                                  HXCODEC_DATA* pData);
protected:
    IUnknown*               m_pContext;
    CWMVideoRenderer*       m_pVideoRenderer;
    CWMVideoFormat*         m_pVideoFormat;
    IHX20MemoryAllocator*   m_pOutputAllocator;
    CRADynamicCodecLibrary* m_pCodecLib;
    HXCODEC                 m_pCodec;
    HXSTREAM                m_pStream;
    const char*             m_pCodecId;
    HX_MOFTAG               m_moftagOut;
    UINT32*                 m_pImageInfoBuffer;
    UINT32                  m_ulLastTimeStamp;

    HX_RESULT                       OpenCodec(HX_MOFTAG pmofTag);
    HX_RESULT                       OpenStream(void);
    virtual CRADynamicCodecLibrary* CreateCodecLibrary();
    void                            SetCodecQuality(void);
    HX_RESULT                       GetQualityPreference(UINT16& rusQuality);
};

#endif /* #ifndef WMVDECODER_H */

--- NEW FILE: LICENSE.txt ---
 Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.  
        
 The contents of this directory, and (except where otherwise
 indicated) the directories included within this directory, are
 subject to the current version of the RealNetworks Public Source
 License (the "RPSL") available at RPSL.txt in this directory, unless
 you have licensed the directory under the current version of the
 RealNetworks Community Source License (the "RCSL") available at
 RCSL.txt in this directory, in which case the RCSL will apply. You
 may also obtain the license terms directly from RealNetworks.  You
 may not use the files in this directory except in compliance with the
 RPSL or, if you have a valid RCSL with RealNetworks applicable to
 this directory, the RCSL.  Please see the applicable RPSL or RCSL for
 the rights, obligations and limitations governing use of the contents
 of the directory.
 
 This directory 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 directory, and the directories included with this directory, are
 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  



From ehyche at helixcommunity.org  Tue Feb  7 09:24:16 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 12:49:08 2006
Subject: [Datatype-cvs] asf/video/renderer LICENSE.txt, NONE, 1.1 RCSL.txt,
	NONE, 1.1 RPSL.txt, NONE, 1.1 Umakefil, NONE,
	1.1 wmvdecoder.cpp, NONE, 1.1 wmvformat.cpp, NONE,
	1.1 wmvrender.cpp, NONE, 1.1 wmvrender.ver, NONE,
	1.1 wmvrender_dll.cpp, NONE, 1.1 wmvrender_guids.cpp, NONE,
	1.1 wmvrenderdll, NONE, 1.1 wmvrenderdll_win32.pcf, NONE,
	1.1 wmvrenderlib, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/asf/video/renderer
In directory cvs:/tmp/cvs-serv18870/renderer

Added Files:
	LICENSE.txt RCSL.txt RPSL.txt Umakefil wmvdecoder.cpp 
	wmvformat.cpp wmvrender.cpp wmvrender.ver wmvrender_dll.cpp 
	wmvrender_guids.cpp wmvrenderdll wmvrenderdll_win32.pcf 
	wmvrenderlib 
Log Message:
Initial checkin of WMV renderer - not functional yet.


--- NEW FILE: wmvrenderdll_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/wmvrender.rc")

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


--- NEW FILE: wmvrender_dll.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 "hxresult.h"
#include "hxcom.h"
#include "hxplugn.h"
#include "baseobj.h"
#include "wmvrender.h"


STDAPI ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)   
{
    return CWMVideoRenderer::HXCreateInstance(ppIUnknown);
}   

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


--- NEW FILE: wmvrenderdll ---
# 
# ***** 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.AddModuleIncludes("common/include",
                          "client/include",
                          "client/videosvc/include",
                          "client/common/container/pub",
                          "datatype/common/container/pub",
                          "datatype/common/util/pub",
                          "datatype/rm/video/common/pub",
                          "datatype/common/vidrend/pub",
                          "datatype/rm/include",
                          "datatype/rm/common/util/pub")

project.AddModuleLibraries("common/runtime[runtlib]",
                           "common/dbgtool[debuglib]", 
                           "common/util[utillib]", 
                           "common/container[contlib]",
                           "common/system[syslib]",
                           "common/log/logutil[logutillib]",
                           "video/vidutil[vidutillib]",
                           "datatype/common/vidrend[vidrend]",
                           "datatype/common/util[dtutillib]",
                           "datatype/rm/common[rmcomlib]",
                           "datatype/asf/video/renderer[wmvrenderlib]")

project.AddLibraries(GetSDKPath("rmvidcom_lib"))

project.AddSources("wmvrender_guids.cpp",
                   "wmvrender_dll.cpp")

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")

DLLTarget("wmvrender")

DependTarget()

--- NEW FILE: LICENSE.txt ---
 Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.  
        
 The contents of this directory, and (except where otherwise
 indicated) the directories included within this directory, are
 subject to the current version of the RealNetworks Public Source
 License (the "RPSL") available at RPSL.txt in this directory, unless
 you have licensed the directory under the current version of the
 RealNetworks Community Source License (the "RCSL") available at
 RCSL.txt in this directory, in which case the RCSL will apply. You
 may also obtain the license terms directly from RealNetworks.  You
 may not use the files in this directory except in compliance with the
 RPSL or, if you have a valid RCSL with RealNetworks applicable to
 this directory, the RCSL.  Please see the applicable RPSL or RCSL for
 the rights, obligations and limitations governing use of the contents
 of the directory.
 
 This directory 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 directory, and the directories included with this directory, are
 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  


--- NEW FILE: wmvrender.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)|7362)
#else
#define TARVER_ULONG32_VERSION (UINT32)((10L<<28L)|(0L<<20L)|(0L<< 12L)|7362L)
#endif
#define TARVER_LIST_VERSION 10,0,0,7362
#define TARVER_MAJOR_VERSION 10
#define TARVER_MINOR_VERSION 0
#define TARVER_STRING_VERSION "10.0.0.7362"
#define TARVER_STR_BUILD_NAME ""

--- NEW FILE: wmvformat.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 "hlxclib/memory.h"
#include "hxtypes.h"
#include "hxwintyp.h"
#include "hxcom.h"
#include "hxevent.h"
#include "hxvsurf.h"
#include "hxwin.h"
#include "hxvsurf.h"
#include "hxalloc.h"
#include "hxtick.h"
#include "hxcodec.h"
#include "hxtlogutil.h"
#include "wmvdecoder.h"
#include "wmvrender.h"
#include "wmvformat.h"

#if defined(HELIX_FEATURE_MIN_HEAP)
#define HX_WMV_MAX_BUFFERED_DECODED_FRAMES           4
#define HX_WMV_MAX_DECODED_FRAMES_IN_STEP            3
#define HX_WMV_DECODE_CALLBACK_RNGBUF_SIZE          10
#else /* #if defined(HELIX_FEATURE_MIN_HEAP) */
#define HX_WMV_MAX_BUFFERED_DECODED_FRAMES          14
#define HX_WMV_MAX_DECODED_FRAMES_IN_STEP            3
#define HX_WMV_DECODE_CALLBACK_RNGBUF_SIZE          10
#endif /* #if defined(HELIX_FEATURE_MIN_HEAP) */

#define HX_WMV_NON_KEYFRM_DCDE_FALLBEHIND_THRSHLD   33  // in milliseconds
#define HX_WMV_MAX_NONKEY_CODED_FRAME_FALLBEHIND  -800
#if defined(HELIX_FEATURE_MIN_HEAP)
#define HX_WMV_DEFAULT_PREROLL                    2000  // in milliseconds
#else
#define HX_WMV_DEFAULT_PREROLL                    3500  // in milliseconds
#endif


CWMVideoFormat::CWMVideoFormat(IHXCommonClassFactory* pCommonClassFactory,
                               CWMVideoRenderer*      pWMVideoRenderer,
                               HXBOOL                 bSecure)
    : CVideoFormat(pCommonClassFactory, pWMVideoRenderer)
{
    m_pDecoder                     = NULL;
    m_pWMVideoRenderer             = pWMVideoRenderer;
    m_pDecodedRingBuffer           = NULL;
    m_ulMaxDecodedFrames           = 0;
    m_ulWidthContainedInSegment    = 0;
    m_ulHeightContainedInSegment   = 0;
    m_pCodecOutputBitmapInfoHeader = NULL;
    m_bFirstDecode                 = TRUE;
    // Sanity check
    HX_ASSERT(m_pCommonClassFactory);
    HX_ASSERT(m_pWMVideoRenderer);
    // NULL out the member structs
    memset(&m_MediaSize, 0, sizeof(HXxSize));
    memset(&m_DecoderDimensions, 0, sizeof(HXxSize));
    memset(&m_DecodedPacket, 0, sizeof(HXCODEC_DATA));
    // Put a ref on the video renderer
    HX_ADDREF(m_pWMVideoRenderer);
}

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

HX_RESULT CWMVideoFormat::Init(IHXValues* pHeader)
{
    // Init the base format
    HX_RESULT retVal = CVideoFormat::Init(pHeader);
    if (SUCCEEDED(retVal))
    {
        // Set the return value
        retVal = HXR_OUTOFMEMORY;
        // Create the ring buffer to hold decoded frames
        HX_DELETE(m_pDecodedRingBuffer);
        m_pDecodedRingBuffer = new CRingBuffer(HX_WMV_DECODE_CALLBACK_RNGBUF_SIZE);
        if (m_pFramePool && m_pDecodedRingBuffer)
        {
            // Create memory allocators
            retVal = CreateAllocators();
            if (SUCCEEDED(retVal))
            {
                // Set the return value
                retVal = HXR_OUTOFMEMORY;
                // Create the CWMVideoDecoder object
                HX_DELETE(m_pDecoder);
                m_pDecoder = CreateDecoder();
                if (m_pDecoder)
                {
                    // Get the output allocator from the renderer
                    CHXMemoryAllocator* pAlloc = NULL;
                    retVal = m_pWMVideoRenderer->GetOutputAllocator(&pAlloc);
                    if (SUCCEEDED(retVal))
                    {
                        // Init the decoder
                        retVal = m_pDecoder->Init(m_pWMVideoRenderer->GetContext(),
                                                  m_pWMVideoRenderer,
                                                  this,
                                                  NULL,
                                                  pAlloc);
                        if (SUCCEEDED(retVal))
                        {
                            // Get the decoder format info
                            HX_MOF* pImageInfo = NULL;
                            retVal = m_pDecoder->GetImageInfo(pImageInfo);
                            if (SUCCEEDED(retVal))
                            {
                                // Set the output format
                                retVal = SetupOutputFormat(pImageInfo);
                                if (SUCCEEDED(retVal))
                                {
                                    // If we have a valid frame size, resize the view frame
                                    if (m_MediaSize.cx && m_MediaSize.cy)
                                    {
                                        m_pWMVideoRenderer->ResizeViewFrame(m_MediaSize);
                                    }
                                    // Get the max decoded frames
                                    m_ulMaxDecodedFrames = GetDecodedFrameQueueCapacity();
                                    // Set the first decode flag
                                    m_bFirstDecode = TRUE;
                                }
                            }
                        }
                    }
                    HX_RELEASE(pAlloc);
                }
            }
        }
    }

    return retVal;
}

void CWMVideoFormat::OnDecodedPacketRelease(CMediaPacket*& rpPacket)
{
    if (rpPacket)
    {
        rpPacket->Clear();
    }
    CVideoFormat::OnDecodedPacketRelease(rpPacket);
}

void CWMVideoFormat::Reset()
{
    _Reset();
    CVideoFormat::Reset();
}

void CWMVideoFormat::Close(void)
{
    CVideoFormat::Close();

    HX_RELEASE(m_pWMVideoRenderer);

    FlushDecodedRingBuffer();
    HX_DELETE(m_pDecodedRingBuffer);
    HX_DELETE(m_pDecoder);

    _Reset();

    HX_DELETE(m_pCodecOutputBitmapInfoHeader);
}

HX_RESULT CWMVideoFormat::InitBitmapInfoHeader(HXBitmapInfoHeader& rBitmapInfoHeader,
                                               CMediaPacket*       pVideoPacket)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pVideoPacket && m_pCodecOutputBitmapInfoHeader)
    {
        HXCODEC_DATA* pData = (HXCODEC_DATA*) pVideoPacket->m_pSampleDesc;
        if (pData && (pData->flags & HX_SEGMENT_CONTAINS_OUTPUT_SIZE_FLAG))
        {
            if (m_ulWidthContainedInSegment  != pData->Segments[1].ulSegmentOffset ||
                m_ulHeightContainedInSegment != (UINT32) pData->Segments[1].bIsValid)
            {
                UINT32 ulWidth    = pData->Segments[1].ulSegmentOffset;
                UINT32 ulHeight   = (UINT32) pData->Segments[1].bIsValid;
                UINT32 ulBitCount = (UINT32) m_pCodecOutputBitmapInfoHeader->biBitCount;

                m_pCodecOutputBitmapInfoHeader->biWidth     = (INT32) ulWidth;
                m_pCodecOutputBitmapInfoHeader->biHeight    = (INT32) ulHeight;
                m_pCodecOutputBitmapInfoHeader->biSizeImage = (ulWidth * ulHeight * ulBitCount + 7) >> 3;
                m_ulWidthContainedInSegment                 = ulWidth;
                m_ulHeightContainedInSegment                = ulHeight;
            }
        }
        else
        {
            m_ulWidthContainedInSegment  = (UINT32) m_pCodecOutputBitmapInfoHeader->biWidth;
            m_ulHeightContainedInSegment = (UINT32) m_pCodecOutputBitmapInfoHeader->biHeight;
        }
        // Copy into out parameter
        rBitmapInfoHeader = *m_pCodecOutputBitmapInfoHeader;
        // Clear return value
        retVal = HXR_OK;
    }

    return retVal;
}

HXBOOL CWMVideoFormat::IsBitmapFormatChanged(HXBitmapInfoHeader& rBitmapInfoHeader,
                                             CMediaPacket*       pVideoPacket)
{
    HXBOOL        bRet  = (m_ulWidthContainedInSegment == 0);
    HXCODEC_DATA* pData = (HXCODEC_DATA*) pVideoPacket->m_pSampleDesc;
    if (pData && (pData->flags & HX_SEGMENT_CONTAINS_OUTPUT_SIZE_FLAG))
    {
        bRet = (bRet ||
                (m_ulWidthContainedInSegment  != pData->Segments[1].ulSegmentOffset ||
                 m_ulHeightContainedInSegment != (UINT32) pData->Segments[1].bIsValid));
    }

    return bRet;
}

ULONG32 CWMVideoFormat::GetDefaultPreroll(IHXValues* pValues)
{
    return HX_WMV_DEFAULT_PREROLL;
}

ULONG32 CWMVideoFormat::GetMaxDecodedFrames(void)
{
    return HX_WMV_MAX_BUFFERED_DECODED_FRAMES;
}

ULONG32 CWMVideoFormat::GetMaxDecodedFramesInStep(void)
{
    return HX_WMV_MAX_DECODED_FRAMES_IN_STEP;
}

HX_RESULT CWMVideoFormat::DecodeDone(HXCODEC_DATA* pData)
{
    HX_RESULT retVal = HXR_OK;

    m_pWMVideoRenderer->BltIfNeeded();

    if (pData)
    {
        // Report a decoded frame
        m_pWMVideoRenderer->ReportDecodedFrame();
        // Allocate buffer to copy HXCODEC_DATA
        UINT32        ulFrameSize = HXCODEC_PTR_POPULATED_SIZE(pData);
        HXCODEC_DATA* pFrame      = (HXCODEC_DATA*) new UINT32 [ulFrameSize / 4 + 1];
        if (pFrame)
        {
            // Copy the HXCODEC_DATA
            memcpy(pFrame, pData, ulFrameSize); /* Flawfinder: ignore */
            // Put the decoded frame into the decoded ring buffer
            if (!m_pDecodedRingBuffer->Put(pFrame))
            {
                ReleaseDecodedPacket(pFrame);
                m_pWMVideoRenderer->ReportDroppedFrame();
            }
        }
        else
        {
            if (pData->data)
            {
                CHXMemoryAllocator* pAlloc = NULL;
                HX_RESULT rv = m_pWMVideoRenderer->GetOutputAllocator(&pAlloc);
                if (pAlloc)
                {
                    pAlloc->ReleasePacketPtr(pData->data);
                }
                HX_RELEASE(pAlloc);
                m_pWMVideoRenderer->ReportDroppedFrame();
            }
        }
    }

    return retVal;
}

const char* CWMVideoFormat::GetCodecId(void)
{
    const char* pszRet = NULL;

    return pszRet;
}

ULONG32 CWMVideoFormat::GetBitstreamHeaderSize(void)
{
    return 0;
}

const BYTE* CWMVideoFormat::GetBitstreamHeader(void)
{
    return NULL;
}

CMediaPacket* CWMVideoFormat::CreateAssembledPacket(IHXPacket* pPacket)
{
    CMediaPacket* pRet = NULL;

    if (pPacket)
    {
        IHXBuffer* pBuffer = pPacket->GetBuffer();
        if (pBuffer)
        {
            UINT32 ulFlags = MDPCKT_USES_IHXBUFFER_FLAG;
            pRet = new CMediaPacket(pBuffer,
                                    (UINT8*) pBuffer->GetBuffer(),
                                    pBuffer->GetSize(),
                                    pBuffer->GetSize(),
                                    pPacket->GetTime(),
                                    ulFlags,
                                    NULL);
            if (pRet)
            {
                pRet->m_pUserData = this;
            }
        }
        HX_RELEASE(pBuffer);
    }

    return pRet;
}

CMediaPacket* CWMVideoFormat::CreateDecodedPacket(CMediaPacket* pFrameToDecode)
{
    CMediaPacket* pDecodedFrame        = NULL;
    HXCODEC_DATA* pDecodedPacket       = NULL;
    HXBOOL        bInputFrameProcessed = FALSE;
    HX_RESULT     status               = HXR_OK;
 
    // Handle restart
    if (m_bFirstDecode)
    {
        m_bFirstDecode = FALSE;
        FlushDecodedRingBuffer();
    }

    // Check for decoded frames already available
    pDecodedPacket = (HXCODEC_DATA*) m_pDecodedRingBuffer->Get();

    // Loop processing frames in the following order:
    // 1. Return (queue) currently outstanding decoded frames (mormally is 0)
    // 2. Decode input frame (must do unless frame dropped pre-decode)
    // 3. Return (queue) frames produced synchronously with this decode
    // The proces wil stop short if the frames can no longer be returned
    // (queued).  This may occur due to output queue becomming full when
    // MAX_DECODED_FRAMES_IN_STEP is set too low and decoder is performing
    // frame rate upsampling.
    do
    {
        // Give time to blt
        m_pWMVideoRenderer->BltIfNeeded();
        // If frame is decoded, return it to be queued
        if (pDecodedFrame)
        {
            if (!ReturnDecodedPacket(pDecodedFrame))
            {
                // Unable to return decoded frame - throw it away
                m_pFramePool->Put(pDecodedFrame);
                m_pWMVideoRenderer->ReportDroppedFrame();
            }
            pDecodedFrame = NULL;
        }
        // If decoded packet isn't available, create one by decoding the
        // frame to decode
        if (!pDecodedPacket && pFrameToDecode)
        {
            ProcessAssembledFrame(pFrameToDecode);
            // Decode the frame. This will call back to DecodeDone().
            status = m_pDecoder->Decode(pFrameToDecode, HX_WMV_MAX_DECODE_QUALITY);
            // Set the flag saying we processed an input frame
            bInputFrameProcessed = TRUE;
            // Check the error return
            if (status == HXR_OUTOFMEMORY)
            {
                m_LastError = HXR_OUTOFMEMORY;
            }
            // Get the first decoded frame in the ring buffer
            pDecodedPacket = (HXCODEC_DATA*) m_pDecodedRingBuffer->Get();
        }

        if (pDecodedPacket)
        {
            INT32 lTimeAhead = m_pWMVideoRenderer->ComputeTimeAhead(pDecodedPacket->timestamp, 0);
            if (lTimeAhead < HX_WMV_NON_KEYFRM_DCDE_FALLBEHIND_THRSHLD)
            {
                ReleaseDecodedPacket(pDecodedPacket);
            }
        }
        // Package the decoded frame into a media packet
        if (pDecodedPacket)
        {
            CMediaPacket* pVideoPacket = NULL;
            // Obtain frame dimensions if not set
            if (m_MediaSize.cx == 0) 
            {
                HX_MOF* pImageInfo = NULL;
                HX_RESULT rv = m_pDecoder->GetImageInfo(pImageInfo);
                if (SUCCEEDED(rv))
                {
                    status = SetupOutputFormat(pImageInfo);
                    if (SUCCEEDED(status))
                    {
                        if (m_MediaSize.cx && m_MediaSize.cy)
                        {
                            m_pWMVideoRenderer->ResizeViewFrame(m_MediaSize);
                        }
                    }
                }
            }
            // Form decoded media packets if dimensions set
            if (m_MediaSize.cx)
            {
                pVideoPacket = (CMediaPacket*) m_pFramePool->Get(0);
                if (pVideoPacket == NULL)
                {
                    if (bInputFrameProcessed && pFrameToDecode)
                    {
                        // Reuse media packet from coded frame for decoded frame
                        pVideoPacket = pFrameToDecode;
                        pFrameToDecode = NULL;
                    }
                    else
                    {
                        // Create new media packet to store decoded frame
                        pVideoPacket = new CMediaPacket();
                        if (!pVideoPacket)
                        {
                            status = HXR_OUTOFMEMORY;
                            m_LastError = status;
                        }
                    }
                }
            }

            if (pVideoPacket)
            {
                pVideoPacket->SetBuffer(pDecodedPacket->data,
                                        pDecodedPacket->data,
                                        pDecodedPacket->dataLength,
                                        pDecodedPacket->dataLength,
                                        FALSE);
                
                pVideoPacket->Init(pDecodedPacket->data,
                                   pDecodedPacket->dataLength,
                                   pDecodedPacket->timestamp,
                                   0,
                                   pDecodedPacket); // sample description
                // Data is now linked through VideoPacket
                pDecodedPacket->data = NULL;
                pDecodedPacket->dataLength = 0;
                // Set the necessary function pointers
                pVideoPacket->SetBufferKiller(KillWMVOutputBuffer);
                pVideoPacket->SetSampleDescKiller(KillWMVSampleDesc);
                // Set the user data
                pVideoPacket->m_pUserData = m_pWMVideoRenderer;
                // NULL out the decoded packet pointer
                pDecodedPacket = NULL;
                // Assign the decoded frame pointer
                pDecodedFrame = pVideoPacket;
                pVideoPacket = NULL;
            }
            
            if (pVideoPacket)
            {
                delete pVideoPacket;
            }
        }

        // Decoded packet should be packaged inside of a media packet.
        // If still present here, release it as something has gone wrong.
        if (pDecodedPacket)
        {
            ReleaseDecodedPacket(pDecodedPacket);
            m_pWMVideoRenderer->ReportDroppedFrame();
        }
        
        // See if more decoded frames are avaialable
        if (CanReturnDecodedPacket())
        {
            pDecodedPacket = (HXCODEC_DATA*) m_pDecodedRingBuffer->Get();
        }
    }
    while ((pDecodedPacket || !bInputFrameProcessed) && (status == HXR_OK));

    if (pFrameToDecode != NULL)
    {
        pFrameToDecode->Clear(); 
        delete pFrameToDecode;
    }

    if (pDecodedPacket && !CanReturnDecodedPacket())
    {
        // Unable to return decoded frame - throw it away
        m_pFramePool->Put(pDecodedFrame);
        m_pWMVideoRenderer->ReportDroppedFrame();
        pDecodedFrame = NULL;
    }
                
    return pDecodedFrame;
}

CWMVideoDecoder* CWMVideoFormat::CreateDecoder()
{
    return new CWMVideoDecoder();
}

HX_RESULT CWMVideoFormat::SetupOutputFormat(HX_MOF* pMOF)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pMOF)
    {
        if (!m_pCodecOutputBitmapInfoHeader)
        {
            m_pCodecOutputBitmapInfoHeader = new HXBitmapInfoHeader;
            if (m_pCodecOutputBitmapInfoHeader)
            {
                memset(m_pCodecOutputBitmapInfoHeader, 0, sizeof(HXBitmapInfoHeader));
            }
        }
        if (m_pCodecOutputBitmapInfoHeader)
        {
            // Clear the return value
            retVal = HXR_OK;
            // Get the media size
            HX_FORMAT_IMAGE* pFormatImage = (HX_FORMAT_IMAGE*) pMOF;
            m_MediaSize.cy = pFormatImage->uiHeight;
            m_MediaSize.cx = pFormatImage->uiWidth;
            // Set the HXBitmapInfoHeader struct
            m_pCodecOutputBitmapInfoHeader->biBitCount    = pFormatImage->uiBitCount;
            m_pCodecOutputBitmapInfoHeader->biCompression = HX_I420;
            m_pCodecOutputBitmapInfoHeader->biWidth       = pFormatImage->uiWidth;
            m_pCodecOutputBitmapInfoHeader->biHeight      = pFormatImage->uiHeight;
            m_pCodecOutputBitmapInfoHeader->biPlanes      = 1;
            m_pCodecOutputBitmapInfoHeader->biSizeImage   = (m_pCodecOutputBitmapInfoHeader->biWidth * 
                                                             m_pCodecOutputBitmapInfoHeader->biBitCount * 
                                                             m_pCodecOutputBitmapInfoHeader->biHeight + 7) / 8;
        }
    }

    return retVal;
}

HX_RESULT CWMVideoFormat::CreateAllocators(void)
{
    HX_RESULT retVal = HXR_OUTOFMEMORY;

    // Create a CHXMemoryAllocator object
    CHXMemoryAllocator* pAlloc = new CHXMemoryAllocator(TRUE);
    if (pAlloc)
    {
        // AddRef our local copy
        pAlloc->AddRef();
        // Get the alloc properties
        HX20ALLOCPROPS allocRequest;
        HX20ALLOCPROPS allocActual;
        pAlloc->GetProperties(&allocRequest);
        // Allocate sufficient number of buffers to retain 
        // (does not hur to overallocateas memory is not spent - this is a
        //  only a container):
        // 1 for active frame (displayed)
        // 1 for frame in transit
        // 3 for frames retained by codec
        // 5 for frames upsampled by codec
        // post decode queue depth * 2 (x2 to be on safe side)
        // Note: it does not really hurt the memory consumption to set the
        // allocator pooling high since the system is designed not to
        // build the pool beyond what it needs.
        allocRequest.nNumBuffers = 10 + GetMaxDecodedFrames() * 2;
        pAlloc->SetProperties(&allocRequest, &allocActual);
        // Set this allocator into the renderer
        retVal = m_pWMVideoRenderer->SetOutputAllocator(pAlloc);
    }
    HX_RELEASE(pAlloc);

    return retVal;
}

void CWMVideoFormat::FlushDecodedRingBuffer(void)
{
    if (m_pDecodedRingBuffer)
    {
        while (m_pDecodedRingBuffer->Count() > 0)
        {
            HXCODEC_DATA* pFrame = (HXCODEC_DATA*) m_pDecodedRingBuffer->Get();
            ReleaseDecodedPacket(pFrame);
        }
    }
}

void CWMVideoFormat::_Reset(void)
{
    m_bFirstDecode               = TRUE;
    m_ulWidthContainedInSegment  = 0;
    m_ulHeightContainedInSegment = 0;
    m_MediaSize.cx               = 0;
    m_MediaSize.cy               = 0;
}

void CWMVideoFormat::ReleaseDecodedPacket(HXCODEC_DATA*& rpDecodedPacket)
{
    HX_ASSERT(rpDecodedPacket);
    if (rpDecodedPacket)
    {
        KillWMVSampleDesc(rpDecodedPacket, m_pWMVideoRenderer);
        rpDecodedPacket = NULL;
    }
}

void CWMVideoFormat::KillWMVSampleDesc(void* pSampleDesc, void* pUserData)
{
    if (pSampleDesc)
    {
        HXCODEC_DATA* pFrame     = (HXCODEC_DATA*) pSampleDesc;
        UINT32*       pFrameData = (UINT32*) pFrame;

        if (pFrame->data)
        {
            KillWMVOutputBuffer(pFrame->data, pUserData);
        }

        delete [] pFrameData;
    }
}

void CWMVideoFormat::KillWMVOutputBuffer(void* pBuffer, void* pUserData)
{
    if (pBuffer)
    {
        CWMVideoRenderer* pRenderer = (CWMVideoRenderer*) pUserData;
        HX_ASSERT(pRenderer);
        if (pRenderer)
        {
            // Get the allocator
            CHXMemoryAllocator* pAlloc = NULL;
            pRenderer->GetOutputAllocator(&pAlloc);
            if (pAlloc)
            {
                pAlloc->ReleasePacketPtr((BYTE*) pBuffer);
            }
            HX_RELEASE(pAlloc);
        }
    }
}


--- NEW FILE: RPSL.txt ---
RealNetworks Public Source License Version 1.0
(Rev. Date October 28, 2002)

1. General Definitions. This License applies to any program or other work which
RealNetworks, Inc., or any other entity that elects to use this license,
("Licensor") makes publicly available and which contains a notice placed by
Licensor identifying such program or work as "Original Code" and stating that it
is subject to the terms of this RealNetworks Public Source License version 1.0
(or subsequent version thereof) ("License"). You are not required to accept this
License. However, nothing else grants You permission to use, copy, modify or
distribute the software or its derivative works. These actions are prohibited by
law if You do not accept this License. Therefore, by modifying, copying or
distributing the software (or any work based on the software), You indicate your
acceptance of this License to do so, and all its terms and conditions. In
addition, you agree to the terms of this License by clicking the Accept button
or downloading the software. As used in this License:

1.1 "Applicable Patent Rights" mean: (a) in the case where Licensor is the
grantor of rights, claims of patents that (i) are now or hereafter acquired,
owned by or assigned to Licensor and (ii) are necessarily infringed by using or
making the Original Code alone and not in combination with other software or
hardware; and (b) in the case where You are the grantor of rights, claims of
patents that (i) are now or hereafter acquired, owned by or assigned to You and
(ii) are infringed (directly or indirectly) by using or making Your
Modifications, taken alone or in combination with Original Code.

1.2 "Compatible Source License" means any one of the licenses listed on Exhibit
B or at https://www.helixcommunity.org/content/complicense or other licenses
specifically identified by Licensor in writing. Notwithstanding any term to the
contrary in any Compatible Source License, any code covered by any Compatible
Source License that is used with Covered Code must be made readily available in
Source Code format for royalty-free use under the terms of the Compatible Source
License or this License.

1.3 "Contributor" means any person or entity that creates or contributes to the
creation of Modifications.

1.4 "Covered Code" means the Original Code, Modifications, the combination of
Original Code and any Modifications, and/or any respective portions thereof.

1.5 "Deploy" means to use, sublicense or distribute Covered Code other than for
Your internal research and development (R&D) and/or Personal Use, and includes
without limitation, any and all internal use or distribution of Covered Code
within Your business or organization except for R&D use and/or Personal Use, as
well as direct or indirect sublicensing or distribution of Covered Code by You
to any third party in any form or manner.

1.6 "Derivative Work" means either the Covered Code or any derivative work under
United States copyright law, and including any work containing or including any
portion of the Covered Code or Modifications, either verbatim or with
modifications and/or translated into another language. Derivative Work also
includes any work which combines any portion of Covered Code or Modifications
with code not otherwise governed by the terms of this License.

1.7 "Externally Deploy" means to Deploy the Covered Code in any way that may be
accessed or used by anyone other than You, used to provide any services to
anyone other than You, or used in any way to deliver any content to anyone other
than You, whether the Covered Code is distributed to those parties, made
available as an application intended for use over a computer network, or used to
provide services or otherwise deliver content to anyone other than You.

1.8. "Interface" means interfaces, functions, properties, class definitions,
APIs, header files, GUIDs, V-Tables, and/or protocols allowing one piece of
software, firmware or hardware to communicate or interoperate with another piece
of software, firmware or hardware.

1.9 "Modifications" mean any addition to, deletion from, and/or change to, the
substance and/or structure of the Original Code, any previous Modifications, the
combination of Original Code and any previous Modifications, and/or any
respective portions thereof. When code is released as a series of files, a
Modification is: (a) any addition to or deletion from the contents of a file
containing Covered Code; and/or (b) any new file or other representation of
computer program statements that contains any part of Covered Code.

1.10 "Original Code" means (a) the Source Code of a program or other work as
originally made available by Licensor under this License, including the Source
Code of any updates or upgrades to such programs or works made available by
Licensor under this License, and that has been expressly identified by Licensor
as such in the header file(s) of such work; and (b) the object code compiled
from such Source Code and originally made available by Licensor under this
License.

1.11 "Personal Use" means use of Covered Code by an individual solely for his or
her personal, private and non-commercial purposes. An individual's use of
Covered Code in his or her capacity as an officer, employee, member, independent
contractor or agent of a corporation, business or organization (commercial or
non-commercial) does not qualify as Personal Use.

1.12 "Source Code" means the human readable form of a program or other work that
is suitable for making modifications to it, including all modules it contains,
plus any associated interface definition files, scripts used to control
compilation and installation of an executable (object code).

1.13 "You" or "Your" means an individual or a legal entity exercising rights
under this License. For legal entities, "You" or "Your" includes any entity
which controls, is controlled by, or is under common control with, You, where
"control" means (a) the power, direct or indirect, to cause the direction or
management of such entity, whether by contract or otherwise, or (b) ownership of
fifty percent (50%) or more of the outstanding shares or beneficial ownership of
such entity.

2. Permitted Uses; Conditions & Restrictions. Subject to the terms and
conditions of this License, Licensor hereby grants You, effective on the date
You accept this License (via downloading or using Covered Code or otherwise
indicating your acceptance of this License), a worldwide, royalty-free,
non-exclusive copyright license, to the extent of Licensor's copyrights cover
the Original Code, to do the following:

2.1 You may reproduce, display, perform, modify and Deploy Covered Code,
provided that in each instance:

(a) You must retain and reproduce in all copies of Original Code the copyright
and other proprietary notices and disclaimers of Licensor as they appear in the
Original Code, and keep intact all notices in the Original Code that refer to
this License;

(b) You must include a copy of this License with every copy of Source Code of
Covered Code and documentation You distribute, and You may not offer or impose
any terms on such Source Code that alter or restrict this License or the
recipients' rights hereunder, except as permitted under Section 6;

(c) You must duplicate, to the extent it does not already exist, the notice in
Exhibit A in each file of the Source Code of all Your Modifications, and cause
the modified files to carry prominent notices stating that You changed the files
and the date of any change;

(d) You must make Source Code of all Your Externally Deployed Modifications
publicly available under the terms of this License, including the license grants
set forth in Section 3 below, for as long as you Deploy the Covered Code or
twelve (12) months from the date of initial Deployment, whichever is longer. You
should preferably distribute the Source Code of Your Deployed Modifications
electronically (e.g. download from a web site); and

(e) if You Deploy Covered Code in object code, executable form only, You must
include a prominent notice, in the code itself as well as in related
documentation, stating that Source Code of the Covered Code is available under
the terms of this License with information on how and where to obtain such
Source Code. You must also include the Object Code Notice set forth in Exhibit A
in the "about" box or other appropriate place where other copyright notices are
placed, including any packaging materials.

2.2 You expressly acknowledge and agree that although Licensor and each
Contributor grants the licenses to their respective portions of the Covered Code
set forth herein, no assurances are provided by Licensor or any Contributor that
the Covered Code does not infringe the patent or other intellectual property
rights of any other entity. Licensor and each Contributor disclaim any liability
to You for claims brought by any other entity based on infringement of
intellectual property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, You hereby assume sole responsibility to
secure any other intellectual property rights needed, if any. For example, if a
third party patent license is required to allow You to make, use, sell, import
or offer for sale the Covered Code, it is Your responsibility to acquire such
license(s).

2.3 Subject to the terms and conditions of this License, Licensor hereby grants
You, effective on the date You accept this License (via downloading or using
Covered Code or otherwise indicating your acceptance of this License), a
worldwide, royalty-free, perpetual, non-exclusive patent license under
Licensor's Applicable Patent Rights to make, use, sell, offer for sale and
import the Covered Code, provided that in each instance you comply with the
terms of this License.

3. Your Grants. In consideration of, and as a condition to, the licenses granted
to You under this License:

(a) You grant to Licensor and all third parties a non-exclusive, perpetual,
irrevocable, royalty free license under Your Applicable Patent Rights and other
intellectual property rights owned or controlled by You, to make, sell, offer
for sale, use, import, reproduce, display, perform, modify, distribute and
Deploy Your Modifications of the same scope and extent as Licensor's licenses
under Sections 2.1 and 2.2; and

(b) You grant to Licensor and its subsidiaries a non-exclusive, worldwide,
royalty-free, perpetual and irrevocable license, under Your Applicable Patent
Rights and other intellectual property rights owned or controlled by You, to
make, use, sell, offer for sale, import, reproduce, display, perform,
distribute, modify or have modified (for Licensor and/or its subsidiaries),
sublicense and distribute Your Modifications, in any form and for any purpose,
through multiple tiers of distribution.

(c) You agree not use any information derived from Your use and review of the
Covered Code, including but not limited to any algorithms or inventions that may
be contained in the Covered Code, for the purpose of asserting any of Your
patent rights, or assisting a third party to assert any of its patent rights,
against Licensor or any Contributor.

4. Derivative Works. You may create a Derivative Work by combining Covered Code
with other code not otherwise governed by the terms of this License and
distribute the Derivative Work as an integrated product. In each such instance,
You must make sure the requirements of this License are fulfilled for the
Covered Code or any portion thereof, including all Modifications.

4.1 You must cause any Derivative Work that you distribute, publish or
Externally Deploy, that in whole or in part contains or is derived from the
Covered Code or any part thereof, to be licensed as a whole at no charge to all
third parties under the terms of this License and no other license except as
provided in Section 4.2. You also must make Source Code available for the
Derivative Work under the same terms as Modifications, described in Sections 2
and 3, above.

4.2 Compatible Source Licenses. Software modules that have been independently
developed without any use of Covered Code and which contain no portion of the
Covered Code, Modifications or other Derivative Works, but are used or combined
in any way wtih the Covered Code or any Derivative Work to form a larger
Derivative Work, are exempt from the conditions described in Section 4.1 but
only to the extent that: the software module, including any software that is
linked to, integrated with, or part of the same applications as, the software
module by any method must be wholly subject to one of the Compatible Source
Licenses. Notwithstanding the foregoing, all Covered Code must be subject to the
terms of this License. Thus, the entire Derivative Work must be licensed under a
combination of the RPSL (for Covered Code) and a Compatible Source License for
any independently developed software modules within the Derivative Work. The
foregoing requirement applies even if the Compatible Source License would
ordinarily allow the software module to link with, or form larger works with,
other software that is not subject to the Compatible Source License. For
example, although the Mozilla Public License v1.1 allows Mozilla code to be
combined with proprietary software that is not subject to the MPL, if
MPL-licensed code is used with Covered Code the MPL-licensed code could not be
combined or linked with any code not governed by the MPL. The general intent of
this section 4.2 is to enable use of Covered Code with applications that are
wholly subject to an acceptable open source license. You are responsible for
determining whether your use of software with Covered Code is allowed under Your
license to such software.

4.3 Mere aggregation of another work not based on the Covered Code with the
Covered Code (or with a work based on the Covered Code) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License. If You deliver the Covered Code for combination and/or integration with
an application previously provided by You (for example, via automatic updating
technology), such combination and/or integration constitutes a Derivative Work
subject to the terms of this License.

5. Exclusions From License Grant. Nothing in this License shall be deemed to
grant any rights to trademarks, copyrights, patents, trade secrets or any other
intellectual property of Licensor or any Contributor except as expressly stated
herein. No right is granted to the trademarks of Licensor or any Contributor
even if such marks are included in the Covered Code. Nothing in this License
shall be interpreted to prohibit Licensor from licensing under different terms
from this License any code that Licensor otherwise would have a right to
license. Modifications, Derivative Works and/or any use or combination of
Covered Code with other technology provided by Licensor or third parties may
require additional patent licenses from Licensor which Licensor may grant in its
sole discretion. No patent license is granted separate from the Original Code or
combinations of the Original Code with other software or hardware.

5.1. Trademarks. This License does not grant any rights to use the trademarks or
trade names owned by Licensor ("Licensor Marks" defined in Exhibit C) or to any
trademark or trade name belonging to any Contributor. No Licensor Marks may be
used to endorse or promote products derived from the Original Code other than as
permitted by the Licensor Trademark Policy defined in Exhibit C.

6. Additional Terms. You may choose to offer, and to charge a fee for, warranty,
support, indemnity or liability obligations and/or other rights consistent with
the scope of the license granted herein ("Additional Terms") to one or more
recipients of Covered Code. However, You may do so only on Your own behalf and
as Your sole responsibility, and not on behalf of Licensor or any Contributor.
You must obtain the recipient's agreement that any such Additional Terms are
offered by You alone, and You hereby agree to indemnify, defend and hold
Licensor and every Contributor harmless for any liability incurred by or claims
asserted against Licensor or such Contributor by reason of any such Additional
Terms.

7. Versions of the License. Licensor may publish revised and/or new versions of
this License from time to time. Each version will be given a distinguishing
version number. Once Original Code has been published under a particular version
of this License, You may continue to use it under the terms of that version. You
may also choose to use such Original Code under the terms of any subsequent
version of this License published by Licensor. No one other than Licensor has
the right to modify the terms applicable to Covered Code created under this
License.

8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part
pre-release, untested, or not fully tested works. The Covered Code may contain
errors that could cause failures or loss of data, and may be incomplete or
contain inaccuracies. You expressly acknowledge and agree that use of the
Covered Code, or any portion thereof, is at Your sole and entire risk. THE
COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF
ANY KIND AND LICENSOR AND LICENSOR'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS
"LICENSOR" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY
DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF
SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET
ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. LICENSOR AND EACH
CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE
COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR
REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR
ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR
WRITTEN DOCUMENTATION, INFORMATION OR ADVICE GIVEN BY LICENSOR, A LICENSOR
AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You
acknowledge that the Covered Code is not intended for use in high risk
activities, including, but not limited to, the design, construction, operation
or maintenance of nuclear facilities, aircraft navigation, aircraft
communication systems, or air traffic control machines in which case the failure
of the Covered Code could lead to death, personal injury, or severe physical or
environmental damage. Licensor disclaims any express or implied warranty of
fitness for such uses.

9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT
SHALL LICENSOR OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR
YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER
UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE OR STRICT
LIABILITY), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF LICENSOR OR SUCH
CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND
NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME
JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR
CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event
shall Licensor's total liability to You for all damages (other than as may be
required by applicable law) under this License exceed the amount of ten dollars
($10.00).

10. Ownership. Subject to the licenses granted under this License, each
Contributor retains all rights, title and interest in and to any Modifications
made by such Contributor. Licensor retains all rights, title and interest in and
to the Original Code and any Modifications made by or on behalf of Licensor
("Licensor Modifications"), and such Licensor Modifications will not be
automatically subject to this License. Licensor may, at its sole discretion,
choose to license such Licensor Modifications under this License, or on
different terms from those contained in this License or may choose not to
license them at all.

11. Termination. 

11.1 Term and Termination. The term of this License is perpetual unless
terminated as provided below. This License and the rights granted hereunder will
terminate:

(a) automatically without notice from Licensor if You fail to comply with any
term(s) of this License and fail to cure such breach within 30 days of becoming
aware of such breach;

(b) immediately in the event of the circumstances described in Section 12.5(b);
or

(c) automatically without notice from Licensor if You, at any time during the
term of this License, commence an action for patent infringement against
Licensor (including by cross-claim or counter claim in a lawsuit);

(d) upon written notice from Licensor if You, at any time during the term of
this License, commence an action for patent infringement against any third party
alleging that the Covered Code itself (excluding combinations with other
software or hardware) infringes any patent (including by cross-claim or counter
claim in a lawsuit).

11.2 Effect of Termination. Upon termination, You agree to immediately stop any
further use, reproduction, modification, sublicensing and distribution of the
Covered Code and to destroy all copies of the Covered Code that are in your
possession or control. All sublicenses to the Covered Code which have been
properly granted prior to termination shall survive any termination of this
License. Provisions which, by their nature, should remain in effect beyond the
termination of this License shall survive, including but not limited to Sections
3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for
compensation, indemnity or damages of any sort solely as a result of terminating
this License in accordance with its terms, and termination of this License will
be without prejudice to any other right or remedy of any party.

12. Miscellaneous.

12.1 Government End Users. The Covered Code is a "commercial item" as defined in
FAR 2.101. Government software and technical data rights in the Covered Code
include only those rights customarily provided to the public as defined in this
License. This customary commercial license in technical data and software is
provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer
Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical
Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software
or Computer Software Documentation). Accordingly, all U.S. Government End Users
acquire Covered Code with only those rights set forth herein.

12.2 Relationship of Parties. This License will not be construed as creating an
agency, partnership, joint venture or any other form of legal association
between or among You, Licensor or any Contributor, and You will not represent to
the contrary, whether expressly, by implication, appearance or otherwise.

12.3 Independent Development. Nothing in this License will impair Licensor's
right to acquire, license, develop, have others develop for it, market and/or
distribute technology or products that perform the same or similar functions as,
or otherwise compete with, Modifications, Derivative Works, technology or
products that You may develop, produce, market or distribute.

12.4 Waiver; Construction. Failure by Licensor or any Contributor to enforce any
provision of this License will not be deemed a waiver of future enforcement of
that or any other provision. Any law or regulation which provides that the
language of a contract shall be construed against the drafter will not apply to
this License.

12.5 Severability. (a) If for any reason a court of competent jurisdiction finds
any provision of this License, or portion thereof, to be unenforceable, that
provision of the License will be enforced to the maximum extent permissible so
as to effect the economic benefits and intent of the parties, and the remainder
of this License will continue in full force and effect. (b) Notwithstanding the
foregoing, if applicable law prohibits or restricts You from fully and/or
specifically complying with Sections 2 and/or 3 or prevents the enforceability
of either of those Sections, this License will immediately terminate and You
must immediately discontinue any use of the Covered Code and destroy all copies
of it that are in your possession or control.

12.6 Dispute Resolution. Any litigation or other dispute resolution between You
and Licensor relating to this License shall take place in the Seattle,
Washington, and You and Licensor hereby consent to the personal jurisdiction of,
and venue in, the state and federal courts within that District with respect to
this License. The application of the United Nations Convention on Contracts for
the International Sale of Goods is expressly excluded.

12.7 Export/Import Laws. This software is subject to all export and import laws
and restrictions and regulations of the country in which you receive the Covered
Code and You are solely responsible for ensuring that You do not export,
re-export or import the Covered Code or any direct product thereof in violation
of any such restrictions, laws or regulations, or without all necessary
authorizations.

12.8 Entire Agreement; Governing Law. This License constitutes the entire
agreement between the parties with respect to the subject matter hereof. This
License shall be governed by the laws of the United States and the State of
Washington.

Where You are located in the province of Quebec, Canada, the following clause
applies: The parties hereby confirm that they have requested that this License
and all related documents be drafted in English. Les parties ont exigé
que le présent contrat et tous les documents connexes soient
rédigés en anglais.

								EXHIBIT A.  

"Copyright © 1995-2002
RealNetworks, Inc. and/or its licensors. 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 https://www.helixcommunity.org/content/rpsl unless you have
licensed the file under the RealNetworks Community Source License Version 1.0
(the "RCSL") available at https://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.

Contributor(s): ____________________________________ 

Technology Compatibility Kit Test
Suite(s) Location (if licensed under the RCSL): ______________________________ 

Object Code Notice: Helix DNA Client technology included. Copyright (c)
RealNetworks, Inc., 1995-2002. All rights reserved.


								EXHIBIT B 

Compatible Source Licenses for the RealNetworks Public Source License. The
following list applies to the most recent version of the license as of October
25, 2002, unless otherwise indicated.

* Academic Free License
* Apache Software License
* Apple Public Source License
* Artistic license
* Attribution Assurance Licenses
* BSD license
* Common Public License (1)
* Eiffel Forum License
* GNU General Public License (GPL) (1)
* GNU Library or "Lesser" General Public License (LGPL) (1)
* IBM Public License
* Intel Open Source License
* Jabber Open Source License
* MIT license
* MITRE Collaborative Virtual Workspace License (CVW License)
* Motosoto License
* Mozilla Public License 1.0 (MPL)
* Mozilla Public License 1.1 (MPL)
* Nokia Open Source License
* Open Group Test Suite License
* Python Software Foundation License
* Ricoh Source Code Public License
* Sun Industry Standards Source License (SISSL)
* Sun Public License
* University of Illinois/NCSA Open Source License
* Vovida Software License v. 1.0
* W3C License
* X.Net License
* Zope Public License
* zlib/libpng license

(1) Note: because this license contains certain reciprocal licensing terms that
purport to extend to independently developed code, You may be prohibited under
the terms of this otherwise compatible license from using code licensed under
its terms with Covered Code because Covered Code may only be licensed under the
RealNetworks Public Source License. Any attempt to apply non RPSL license terms,
including without limitation the GPL, to Covered Code is expressly forbidden.
You are responsible for ensuring that Your use of Compatible Source Licensed
code does not violate either the RPSL or the Compatible Source License.

The latest version of this list can be found at:
https://www.helixcommunity.org/content/complicense

								EXHIBIT C 

RealNetworks' Trademark policy.  

RealNetworks defines the following trademarks collectively as "Licensor
Trademarks": "RealNetworks", "RealPlayer", "RealJukebox", "RealSystem",
"RealAudio", "RealVideo", "RealOne Player", "RealMedia", "Helix" or any other
trademarks or trade names belonging to RealNetworks.

RealNetworks "Licensor Trademark Policy" forbids any use of Licensor Trademarks
except as permitted by and in strict compliance at all times with RealNetworks'
third party trademark usage guidelines which are posted at
http://www.realnetworks.com/info/helixlogo.html.


--- NEW FILE: RCSL.txt ---
The RCSL is made up of a base agreement and a few Attachments.

For Research and Development use, you agree to the terms of the
RCSL R&D License (base RCSL and Attachments A, B, and C) 

For Commercial Use (either distribution or internal commercial
deployment) of the Helix DNA with or without support for RealNetworks'
RealAudio and RealVideo Add-on Technology, you agree to the
terms of the same RCSL R&D license
and execute one or more additional Commercial Use License attachments
.

------------------------------------------------------------------------


    REALNETWORKS COMMUNITY SOURCE LICENSE

Version 1.2 (Rev. Date: January 22, 2003).


  RECITALS

Original Contributor has developed Specifications, Source Code
implementations and Executables of certain Technology; and

Original Contributor desires to license the Technology to a large
community to facilitate research, innovation and product development
while maintaining compatibility of such products with the Technology as
delivered by Original Contributor; and

Original Contributor desires to license certain Trademarks for the
purpose of branding products that are compatible with the relevant
Technology delivered by Original Contributor; and

You desire to license the Technology and possibly certain Trademarks
from Original Contributor on the terms and conditions specified in this
License.

In consideration for the mutual covenants contained herein, You and
Original Contributor agree as follows:


  AGREEMENT

*1. Introduction.*

The RealNetworks Community Source License ("RCSL") and effective
attachments ("License") may include five distinct licenses:

i) Research Use license -- License plus Attachments A, B and C only.

ii) Commercial Use and Trademark License, which may be for Internal
Deployment Use or external distribution, or both -- License plus
Attachments A, B, C, and D.

iii) Technology Compatibility Kit (TCK) license -- Attachment C.

iv) Add-On Technology License (Executable) Commercial Use License
-Attachment F.

v) Add-On Technology Source Code Porting and Optimization
License-Attachment G.

The Research Use license is effective when You click and accept this
License. The TCK is effective when You click and accept this License,
unless otherwise specified in the TCK attachments. The Commercial Use
and Trademark, Add-On Technology License, and the Add-On Technology
Source Code Porting and Optimization licenses must each be signed by You
and Original Contributor to become effective. Once effective, these
licenses and the associated requirements and responsibilities are
cumulative. Capitalized terms used in this License are defined in the
Glossary.

*2. License Grants.*

2.1 Original Contributor Grant.

Subject to Your compliance with Sections 3, 8.10 and Attachment A of
this License, Original Contributor grants to You a worldwide,
royalty-free, non-exclusive license, to the extent of Original
Contributor's Intellectual Property Rights covering the Original Code,
Upgraded Code and Specifications, to do the following:

(a) Research Use License:

(i) use, reproduce and modify the Original Code, Upgraded Code and
Specifications to create Modifications and Reformatted Specifications
for Research Use by You;

(ii) publish and display Original Code, Upgraded Code and Specifications
with, or as part of Modifications, as permitted under Section 3.1(b) below;

(iii) reproduce and distribute copies of Original Code and Upgraded Code
to Licensees and students for Research Use by You;

(iv) compile, reproduce and distribute Original Code and Upgraded Code
in Executable form, and Reformatted Specifications to anyone for
Research Use by You.

(b) Other than the licenses expressly granted in this License, Original
Contributor retains all right, title, and interest in Original Code and
Upgraded Code and Specifications.

2.2 Your Grants.

(a) To Other Licensees. You hereby grant to each Licensee a license to
Your Error Corrections and Shared Modifications, of the same scope and
extent as Original Contributor's licenses under Section 2.1 a) above
relative to Research Use and Attachment D relative to Commercial Use.

(b) To Original Contributor. You hereby grant to Original Contributor a
worldwide, royalty-free, non-exclusive, perpetual and irrevocable
license, to the extent of Your Intellectual Property Rights covering
Your Error Corrections, Shared Modifications and Reformatted
Specifications, to use, reproduce, modify, display and distribute Your
Error Corrections, Shared Modifications and Reformatted Specifications,
in any form, including the right to sublicense such rights through
multiple tiers of distribution.

(c) Other than the licenses expressly granted in Sections 2.2(a) and (b)
above, and the restrictions set forth in Section 3.1(d)(iv) below, You
retain all right, title, and interest in Your Error Corrections, Shared
Modifications and Reformatted Specifications.

2.3 Contributor Modifications.

You may use, reproduce, modify, display and distribute Contributor Error
Corrections, Shared Modifications and Reformatted Specifications,
obtained by You under this License, to the same scope and extent as with
Original Code, Upgraded Code and Specifications.

2.4 Subcontracting.

You may deliver the Source Code of Covered Code to other Licensees
having at least a Research Use license, for the sole purpose of
furnishing development services to You in connection with Your rights
granted in this License. All such Licensees must execute appropriate
documents with respect to such work consistent with the terms of this
License, and acknowledging their work-made-for-hire status or assigning
exclusive right to the work product and associated Intellectual Property
Rights to You.

*3. Requirements and Responsibilities*.

3.1 Research Use License.

As a condition of exercising the rights granted under Section 2.1(a)
above, You agree to comply with the following:

(a) Your Contribution to the Community. All Error Corrections and Shared
Modifications which You create or contribute to are automatically
subject to the licenses granted under Section 2.2 above. You are
encouraged to license all of Your other Modifications under Section 2.2
as Shared Modifications, but are not required to do so. You agree to
notify Original Contributor of any errors in the Specification.

(b) Source Code Availability. You agree to provide all Your Error
Corrections to Original Contributor as soon as reasonably practicable
and, in any event, prior to Internal Deployment Use or Commercial Use,
if applicable. Original Contributor may, at its discretion, post Source
Code for Your Error Corrections and Shared Modifications on the
Community Webserver. You may also post Error Corrections and Shared
Modifications on a web-server of Your choice; provided, that You must
take reasonable precautions to ensure that only Licensees have access to
such Error Corrections and Shared Modifications. Such precautions shall
include, without limitation, a password protection scheme limited to
Licensees and a click-on, download certification of Licensee status
required of those attempting to download from the server. An example of
an acceptable certification is attached as Attachment A-2.

(c) Notices. All Error Corrections and Shared Modifications You create
or contribute to must include a file documenting the additions and
changes You made and the date of such additions and changes. You must
also include the notice set forth in Attachment A-1 in the file header.
If it is not possible to put the notice in a particular Source Code file
due to its structure, then You must include the notice in a location
(such as a relevant directory file), where a recipient would be most
likely to look for such a notice.

(d) Redistribution.

(i) Source. Covered Code may be distributed in Source Code form only to
another Licensee (except for students as provided below). You may not
offer or impose any terms on any Covered Code that alter the rights,
requirements, or responsibilities of such Licensee. You may distribute
Covered Code to students for use in connection with their course work
and research projects undertaken at accredited educational institutions.
Such students need not be Licensees, but must be given a copy of the
notice set forth in Attachment A-3 and such notice must also be included
in a file header or prominent location in the Source Code made available
to such students.

(ii) Executable. You may distribute Executable version(s) of Covered
Code to Licensees and other third parties only for the purpose of
evaluation and comment in connection with Research Use by You and under
a license of Your choice, but which limits use of such Executable
version(s) of Covered Code only to that purpose.

(iii) Modified Class, Interface and Package Naming. In connection with
Research Use by You only, You may use Original Contributor's class,
Interface and package names only to accurately reference or invoke the
Source Code files You modify. Original Contributor grants to You a
limited license to the extent necessary for such purposes.

(iv) You expressly agree that any distribution, in whole or in part, of
Modifications developed by You shall only be done pursuant to the terms
and conditions of this License.

(e) Extensions.

(i) Covered Code. You may not include any Source Code of Community Code
in any Extensions. You may include the compiled Header Files of
Community Code in an Extension provided that Your use of the Covered
Code, including Heading Files, complies with the Commercial Use License,
the TCK and all other terms of this License.

(ii) Publication. No later than the date on which You first distribute
such Extension for Commercial Use, You must publish to the industry, on
a non-confidential basis and free of all copyright restrictions with
respect to reproduction and use, an accurate and current specification
for any Extension. In addition, You must make available an appropriate
test suite, pursuant to the same rights as the specification,
sufficiently detailed to allow any third party reasonably skilled in the
technology to produce implementations of the Extension compatible with
the specification. Such test suites must be made available as soon as
reasonably practicable but, in no event, later than ninety (90) days
after Your first Commercial Use of the Extension. You must use
reasonable efforts to promptly clarify and correct the specification and
the test suite upon written request by Original Contributor.

(iii) Open. You agree to refrain from enforcing any Intellectual
Property Rights You may have covering any interface(s) of Your
Extension, which would prevent the implementation of such interface(s)
by Original Contributor or any Licensee. This obligation does not
prevent You from enforcing any Intellectual Property Right You have that
would otherwise be infringed by an implementation of Your Extension.

(iv) Interface Modifications and Naming. You may not modify or add to
the GUID space * * "xxxxxxxx-0901-11d1-8B06-00A024406D59" or any other
GUID space designated by Original Contributor. You may not modify any
Interface prefix provided with the Covered Code or any other prefix
designated by Original Contributor.* *

* *

(f) You agree that any Specifications provided to You by Original
Contributor are confidential and proprietary information of Original
Contributor. You must maintain the confidentiality of the Specifications
and may not disclose them to any third party without Original
Contributor's prior written consent. You may only use the Specifications
under the terms of this License and only for the purpose of implementing
the terms of this License with respect to Covered Code. You agree not
use, copy or distribute any such Specifications except as provided in
writing by Original Contributor.

3.2 Commercial Use License.

You may not make Commercial Use of any Covered Code unless You and
Original Contributor have executed a copy of the Commercial Use and
Trademark License attached as Attachment D.

*4. Versions of the License.*

4.1 License Versions.

Original Contributor may publish revised versions of the License from
time to time. Each version will be given a distinguishing version number.

4.2 Effect.

Once a particular version of Covered Code has been provided under a
version of the License, You may always continue to use such Covered Code
under the terms of that version of the License. You may also choose to
use such Covered Code under the terms of any subsequent version of the
License. No one other than Original Contributor has the right to
promulgate License versions.

4.3 Multiple-Licensed Code.

Original Contributor may designate portions of the Covered Code as
"Multiple-Licensed." "Multiple-Licensed" means that the Original
Contributor permits You to utilize those designated portions of the
Covered Code under Your choice of this License or the alternative
license(s), if any, specified by the Original Contributor in an
Attachment to this License.

*5. Disclaimer of Warranty.*

5.1 COVERED CODE PROVIDED AS IS.

COVERED CODE IS PROVIDED UNDER THIS LICENSE "AS IS," WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT
FOR A PARTICULAR PURPOSE OR NON-INFRINGING. YOU AGREE TO BEAR THE ENTIRE
RISK IN CONNECTION WITH YOUR USE AND DISTRIBUTION OF COVERED CODE UNDER
THIS LICENSE. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART
OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER
EXCEPT SUBJECT TO THIS DISCLAIMER.

5.2 Not Designed for High Risk Activities.

You acknowledge that Original Code, Upgraded Code and Specifications are
not designed or intended for use in high risk activities including, but
not limited to: (i) on-line control of aircraft, air traffic, aircraft
navigation or aircraft communications; or (ii) in the design,
construction, operation or maintenance of any nuclear facility. Original
Contributor disclaims any express or implied warranty of fitness for
such uses.

*6. Termination.*

6.1 By You.

You may terminate this Research Use license at anytime by providing
written notice to Original Contributor.

6.2 By Original Contributor.

This License and the rights granted hereunder will terminate:

(i) automatically if You fail to comply with the terms of this License
and fail to cure such breach within 30 days of receipt of written notice
of the breach;

(ii) immediately in the event of circumstances specified in Sections 7.1
and 8.4; or

(iii) at Original Contributor's discretion upon any action initiated by
You (including by cross-claim or counter claim) alleging that use or
distribution by Original Contributor or any Licensee, of Original Code,
Upgraded Code, Error Corrections, Shared Modifications or Specifications
infringe a patent owned or controlled by You.

6.3 Effective of Termination.

Upon termination, You agree to discontinue use of and destroy all copies
of Covered Code in Your possession. All sublicenses to the Covered Code
which You have properly granted shall survive any termination of this
License. Provisions that, by their nature, should remain in effect
beyond the termination of this License shall survive including, without
limitation, Sections 2.2, 3, 5, 7 and 8.

6.4 No Compensation.

Each party waives and releases the other from any claim to compensation
or indemnity for permitted or lawful termination of the business
relationship established by this License.

*7. Liability.*

7.1 Infringement. Should any of the Original Code, Upgraded Code, TCK or
Specifications ("Materials") become the subject of a claim of
infringement, Original Contributor may, at its sole option, (i) attempt
to procure the rights necessary for You to continue using the Materials,
(ii) modify the Materials so that they are no longer infringing, or
(iii) terminate Your right to use the Materials, immediately upon
written notice, and refund to You the amount, if any, having then
actually been paid by You to Original Contributor for the Original Code,
Upgraded Code and TCK, depreciated on a straight line, five year basis.

7.2 LIMITATION OF LIABILITY. TO THE FULL EXTENT ALLOWED BY APPLICABLE
LAW, ORIGINAL CONTRIBUTOR'S LIABILITY TO YOU FOR CLAIMS RELATING TO THIS
LICENSE, WHETHER FOR BREACH OR IN TORT, SHALL BE LIMITED TO ONE HUNDRED
PERCENT (100%) OF THE AMOUNT HAVING THEN ACTUALLY BEEN PAID BY YOU TO
ORIGINAL CONTRIBUTOR FOR ALL COPIES LICENSED HEREUNDER OF THE PARTICULAR
ITEMS GIVING RISE TO SUCH CLAIM, IF ANY, DURING THE TWELVE MONTHS
PRECEDING THE CLAIMED BREACH. IN NO EVENT WILL YOU (RELATIVE TO YOUR
SHARED MODIFICATIONS OR ERROR CORRECTIONS) OR ORIGINAL CONTRIBUTOR BE
LIABLE FOR ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
DAMAGES IN CONNECTION WITH OR RISING OUT OF THIS LICENSE (INCLUDING,
WITHOUT LIMITATION, LOSS OF PROFITS, USE, DATA, OR OTHER ECONOMIC
ADVANTAGE), HOWEVER IT ARISES AND ON ANY THEORY OF LIABILITY, WHETHER IN
AN ACTION FOR CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE)
OR OTHERWISE, WHETHER OR NOT YOU OR ORIGINAL CONTRIBUTOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE AND NOTWITHSTANDING THE
FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY.

*8. Miscellaneous.*

8.1 Trademark.

You shall not use any Trademark unless You and Original Contributor
execute a copy of the Commercial Use and Trademark License Agreement
attached hereto as Attachment D. Except as expressly provided in the
License, You are granted no right, title or license to, or interest in,
any Trademarks. Whether or not You and Original Contributor enter into
the Trademark License, You agree not to (i) challenge Original
Contributor's ownership or use of Trademarks; (ii) attempt to register
any Trademarks, or any mark or logo substantially similar thereto; or
(iii) incorporate any Trademarks into Your own trademarks, product
names, service marks, company names, or domain names.

8.2 Integration.

This License represents the complete agreement concerning the subject
matter hereof.

8.3 Assignment.

Original Contributor may assign this License, and its rights and
obligations hereunder, in its sole discretion. You may assign the
Research Use portions of this License and the TCK license to a third
party upon prior written notice to Original Contributor (which may be
provided electronically via the Community Web-Server). You may not
assign the Commercial Use and Trademark license, the Add-On Technology
License, or the Add-On Technology Source Code Porting License, including
by way of merger (regardless of whether You are the surviving entity) or
acquisition, without Original Contributor's prior written consent.

8.4 Severability.

If any provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it
enforceable. Notwithstanding the foregoing, if You are prohibited by law
from fully and specifically complying with Sections 2.2 or 3, this
License will immediately terminate and You must immediately discontinue
any use of Covered Code.

8.5 Governing Law.

This License shall be governed by the laws of the United States and the
State of Washington, as applied to contracts entered into and to be
performed in Washington between Washington residents. The application of
the United Nations Convention on Contracts for the International Sale of
Goods is expressly excluded. You agree that the state and federal courts
located in Seattle, Washington have exclusive jurisdiction over any
claim relating to the License, including contract and tort claims.

8.6 Dispute Resolution.

a) Arbitration. Any dispute arising out of or relating to this License
shall be finally settled by arbitration as set out herein, except that
either party may bring any action, in a court of competent jurisdiction
(which jurisdiction shall be exclusive), with respect to any dispute
relating to such party's Intellectual Property Rights or with respect to
Your compliance with the TCK license. Arbitration shall be administered:
(i) by the American Arbitration Association (AAA), (ii) in accordance
with the rules of the United Nations Commission on International Trade
Law (UNCITRAL) (the "Rules") in effect at the time of arbitration as
modified herein; and (iii) the arbitrator will apply the substantive
laws of Washington and the United States. Judgment upon the award
rendered by the arbitrator may be entered in any court having
jurisdiction to enforce such award.

b) Arbitration language, venue and damages. All arbitration proceedings
shall be conducted in English by a single arbitrator selected in
accordance with the Rules, who must be fluent in English and be either a
retired judge or practicing attorney having at least ten (10) years
litigation experience and be reasonably familiar with the technology
matters relative to the dispute. Unless otherwise agreed, arbitration
venue shall be in Seattle, Washington. The arbitrator may award monetary
damages only and nothing shall preclude either party from seeking
provisional or emergency relief from a court of competent jurisdiction.
The arbitrator shall have no authority to award damages in excess of
those permitted in this License and any such award in excess is void.
All awards will be payable in U.S. dollars and may include, for the
prevailing party (i) pre-judgment award interest, (ii) reasonable
attorneys' fees incurred in connection with the arbitration, and (iii)
reasonable costs and expenses incurred in enforcing the award. The
arbitrator will order each party to produce identified documents and
respond to no more than twenty-five single question interrogatories.

8.7 Construction.

Any law or regulation, which provides that the language of a contract
shall be construed against the drafter, shall not apply to this License.

8.8 U.S. Government End Users.

The Covered Code is a "commercial item," as that term is defined in 48
C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software"
and "commercial computer software documentation," as such terms are used
in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and
48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government
End Users acquire Covered Code with only those rights set forth herein.
You agree to pass this notice to our licensees.

8.9 Marketing Activities.

Licensee hereby grants Original Contributor a non-exclusive,
non-transferable, limited license to use the Licensee's company name and
logo ("Licensee Marks") in any presentations, press releases, or
marketing materials solely for the purpose of identifying Licensee as a
member of the Helix Community. Licensee shall provide samples of
Licensee Marks to Original Contributor upon request by Original
Contributor. Original Contributor acknowledges that the Licensee Marks
are the trademarks of Licensee. Original Contributor shall not use the
Licensee Marks in a way that may imply that Original Contributor is an
agency or branch of Licensee. Original Contributor understands and
agrees that the use of any Licensee Marks in connection with this
Agreement shall not create any right, title or interest, in, or to the
Licensee Marks or any Licensee trademarks and that all such use and
goodwill associated with any such trademarks will inure to the benefit
of Licensee. Further the Original Contributor will stop usage of the
Licensee Marks upon Licensee's request.

8.10 Press Announcements.

You may make press announcements or other public statements regarding
this License without the prior written consent of the Original
Contributor, if Your statement is limited to announcing the licensing of
the Covered Code or the availability of Your Product and its
compatibility with the Covered Code. All other public announcements
regarding this license require the prior written consent of the Original
Contributor. Consent requests are welcome at press@helixcommunity.org.

8.11 International Use.

a) Export/Import laws. Covered Code is subject to U.S. export control
laws and may be subject to export or import regulations in other
countries. Each party agrees to comply strictly with all such laws and
regulations and acknowledges their responsibility to obtain such
licenses to export, re-export, or import as may be required. You agree
to pass these obligations to Your licensees.

b) Intellectual Property Protection. Due to limited intellectual
property protection and enforcement in certain countries, You agree not
to redistribute the Original Code, Upgraded Code, TCK and Specifications
to any country on the list of restricted countries on the Community Web
Server.

8.12 Language.

This License is in the English language only, which language shall be
controlling in all respects, and all versions of this License in any
other language shall be for accommodation only and shall not be binding
on the parties to this License. All communications and notices made or
given pursuant to this License, and all documentation and support to be
provided, unless otherwise noted, shall be in the English language.

PLEASE READ THE TERMS OF THIS LICENSE CAREFULLY. BY CLICKING ON THE
"ACCEPT" BUTTON BELOW YOU ARE ACCEPTING AND AGREEING TO THE TERMS AND
CONDITIONS OF THIS LICENSE WITH REALNETWORKS, INC. IF YOU ARE AGREEING
TO THIS LICENSE ON BEHALF OF A COMPANY, YOU REPRESENT THAT YOU ARE
AUTHORIZED TO BIND THE COMPANY TO SUCH A LICENSE. WHETHER YOU ARE ACTING
ON YOUR OWN BEHALF, OR REPRESENTING A COMPANY, YOU MUST BE OF MAJORITY
AGE AND BE OTHERWISE COMPETENT TO ENTER INTO CONTRACTS. IF YOU DO NOT
MEET THIS CRITERIA OR YOU DO NOT AGREE TO ANY OF THE TERMS AND
CONDITIONS OF THIS LICENSE, CLICK ON THE REJECT BUTTON TO EXIT.


    GLOSSARY

1. *"Added Value"* means code which:

(i) has a principal purpose which is substantially different from that
of the stand-alone Technology;

(ii) represents a significant functional and value enhancement to the
Technology;

(iii) operates in conjunction with the Technology; and

(iv) is not marketed as a technology which replaces or substitutes for
the Technology

2. "*Applicable Patent Rights*" mean: (a) in the case where Original
Contributor is the grantor of rights, claims of patents that (i) are now
or hereafter acquired, owned by or assigned to Original Contributor and
(ii) are necessarily infringed by using or making the Original Code or
Upgraded Code, including Modifications provided by Original Contributor,
alone and not in combination with other software or hardware; and (b) in
the case where Licensee is the grantor of rights, claims of patents that
(i) are now or hereafter acquired, owned by or assigned to Licensee and
(ii) are infringed (directly or indirectly) by using or making
Licensee's Modifications or Error Corrections, taken alone or in
combination with Covered Code.

3. "*Application Programming Interfaces (APIs)"* means the interfaces,
associated header files, service provider interfaces, and protocols that
enable a device, application, Operating System, or other program to
obtain services from or make requests of (or provide services in
response to requests from) other programs, and to use, benefit from, or
rely on the resources, facilities, and capabilities of the relevant
programs using the APIs. APIs includes the technical documentation
describing the APIs, the Source Code constituting the API, and any
Header Files used with the APIs.

4. "*Commercial Use*" means any use (internal or external), copying,
sublicensing or distribution (internal or external), directly or
indirectly of Covered Code by You other than Your Research Use of
Covered Code within Your business or organization or in conjunction with
other Licensees with equivalent Research Use rights. Commercial Use
includes any use of the Covered Code for direct or indirect commercial
or strategic gain, advantage or other business purpose. Any Commercial
Use requires execution of Attachment D by You and Original Contributor.

5. "*Community Code*" means the Original Code, Upgraded Code, Error
Corrections, Shared Modifications, or any combination thereof.

6. "*Community Webserver(s)"* means the webservers designated by
Original Contributor for access to the Original Code, Upgraded Code, TCK
and Specifications and for posting Error Corrections and Shared
Modifications.

7. "*Compliant Covered Code*" means Covered Code that complies with the
requirements of the TCK.

8. "*Contributor*" means each Licensee that creates or contributes to
the creation of any Error Correction or Shared Modification.

9. "*Covered Code*" means the Original Code, Upgraded Code,
Modifications, or any combination thereof.

10. "*Error Correction*" means any change made to Community Code which
conforms to the Specification and corrects the adverse effect of a
failure of Community Code to perform any function set forth in or
required by the Specifications.

11. "*Executable*" means Covered Code that has been converted from
Source Code to the preferred form for execution by a computer or digital
processor (e.g. binary form).

12. "*Extension(s)"* means any additional Interfaces developed by or for
You which: (i) are designed for use with the Technology; (ii) constitute
an API for a library of computing functions or services; and (iii) are
disclosed or otherwise made available to third party software developers
for the purpose of developing software which invokes such additional
Interfaces. The foregoing shall not apply to software developed by Your
subcontractors to be exclusively used by You.

13. "*Header File(s)"* means that portion of the Source Code that
provides the names and types of member functions, data members, class
definitions, and interface definitions necessary to implement the APIs
for the Covered Code. Header Files include, files specifically
designated by Original Contributor as Header Files. Header Files do not
include the code necessary to implement the functionality underlying the
Interface.

14. *"Helix DNA Server Technology"* means the program(s) that implement
the Helix Universal Server streaming engine for the Technology as
defined in the Specification.

15. *"Helix DNA Client Technology"* means the Covered Code that
implements the RealOne Player engine as defined in the Specification.

16. *"Helix DNA Producer Technology"* means the Covered Code that
implements the Helix Producer engine as defined in the Specification.

17. *"Helix DNA Technology"* means the Helix DNA Server Technology, the
Helix DNA Client Technology, the Helix DNA Producer Technology and other
Helix technologies designated by Original Contributor.

18. "*Intellectual Property Rights*" means worldwide statutory and
common law rights associated solely with (i) Applicable Patent Rights;
(ii) works of authorship including copyrights, copyright applications,
copyright registrations and "moral rights"; (iii) the protection of
trade and industrial secrets and confidential information; and (iv)
divisions, continuations, renewals, and re-issuances of the foregoing
now existing or acquired in the future.

19. *"Interface*" means interfaces, functions, properties, class
definitions, APIs, Header Files, GUIDs, V-Tables, and/or protocols
allowing one piece of software, firmware or hardware to communicate or
interoperate with another piece of software, firmware or hardware.

20. "*Internal Deployment Use*" means use of Compliant Covered Code
(excluding Research Use) within Your business or organization only by
Your employees and/or agents on behalf of Your business or organization,
but not to provide services, including content distribution, to third
parties, subject to execution of Attachment D by You and Original
Contributor, if required.

21. "*Licensee*" means any party that has entered into and has in effect
a version of this License with Original Contributor.

22. "*MIME type*" means a description of what type of media or other
content is in a file, including by way of example but not limited to
'audio/x-pn-realaudio-plugin.'

23. "*Modification(s)"* means (i) any addition to, deletion from and/or
change to the substance and/or structure of the Covered Code, including
Interfaces; (ii) the combination of any Covered Code and any previous
Modifications; (iii) any new file or other representation of computer
program statements that contains any portion of Covered Code; and/or
(iv) any new Source Code implementing any portion of the Specifications.

24. "*MP3 Patents*" means any patents necessary to make, use or sell
technology implementing any portion of the specification developed by
the Moving Picture Experts Group known as MPEG-1 Audio Layer-3 or MP3,
including but not limited to all past and future versions, profiles,
extensions, parts and amendments relating to the MP3 specification.

25. "*MPEG-4 Patents*" means any patents necessary to make, use or sell
technology implementing any portion of the specification developed by
the Moving Pictures Experts Group known as MPEG-4, including but not
limited to all past and future versions, profiles, extensions, parts and
amendments relating to the MPEG-4 specification.

26. "*Original Code*" means the initial Source Code for the Technology
as described on the Community Web Server.

27. "*Original Contributor*" means RealNetworks, Inc., its affiliates
and its successors and assigns.

28. "*Original Contributor MIME Type*" means the MIME registry, browser
preferences, or local file/protocol associations invoking any Helix DNA
Client-based application, including the RealOne Player, for playback of
RealAudio, RealVideo, other RealMedia MIME types or datatypes (e.g.,
.ram, .rnx, .rpm, .ra, .rm, .rp, .rt, .rf, .prx, .mpe, .rmp, .rmj, .rav,
.rjs, .rmx, .rjt, .rms), and any other Original Contributor-specific or
proprietary MIME types that Original Contributor may introduce in the
future.

29. "*Personal Use*" means use of Covered Code by an individual solely
for his or her personal, private and non-commercial purposes. An
individual's use of Covered Code in his or her capacity as an officer,
employee, member, independent contractor or agent of a corporation,
business or organization (commercial or non-commercial) does not qualify
as Personal Use.

30. "*RealMedia File Format*" means the file format designed and
developed by RealNetworks for storing multimedia data and used to store
RealAudio and RealVideo encoded streams. Valid RealMedia File Format
extensions include: .rm, .rmj, .rmc, .rmvb, .rms.

31. "*RCSL Webpage*" means the RealNetworks Community Source License
webpage located at https://www.helixcommunity.org/content/rcsl or such
other URL that Original Contributor may designate from time to time.

32. "*Reformatted Specifications*" means any revision to the
Specifications which translates or reformats the Specifications (as for
example in connection with Your documentation) but which does not alter,
subset or superset * *the functional or operational aspects of the
Specifications.

33. "*Research Use*" means use and distribution of Covered Code only for
Your Personal Use, research or development use and expressly excludes
Internal Deployment Use and Commercial Use. Research Use also includes
use of Covered Code to teach individuals how to use Covered Code.

34. "*Shared Modifications*" means Modifications that You distribute or
use for a Commercial Use, in addition to any Modifications provided by
You, at Your option, pursuant to Section 2.2, or received by You from a
Contributor pursuant to Section 2.3.

35. "*Source Code*" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus any
associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.

36. "*Specifications*" means the specifications for the Technology and
other documentation, as designated on the Community Web Server, as may
be revised by Original Contributor from time to time.

37. "*Trademarks*" means Original Contributor's trademarks and logos,
including, but not limited to, RealNetworks, RealAudio, RealVideo,
RealOne, RealSystem, SureStream, Helix, Helix DNA and other trademarks
whether now used or adopted in the future.

38. "*Technology*" means the technology described in Attachment B, and
Upgrades.

39. "*Technology Compatibility Kit"* or *"TCK*" means the test programs,
procedures, acceptance criteria and/or other requirements, designated by
Original Contributor for use in verifying compliance of Covered Code
with the Specifications, in conjunction with the Original Code and
Upgraded Code. Original Contributor may, in its sole discretion and from
time to time, revise a TCK to correct errors and/or omissions and in
connection with Upgrades.

40. "*Upgrade(s)"* means new versions of Technology designated
exclusively by Original Contributor as an "Upgrade" and released by
Original Contributor from time to time under the terms of the License.

41. "*Upgraded Code*" means the Source Code and/or Executables for
Upgrades, possibly including Modifications made by Contributors.

42. *"User's Guide"* means the users guide for the TCK which Original
Contributor makes available to You to provide direction in how to run
the TCK and properly interpret the results, as may be revised by
Original Contributor from time to time.

43. "*You(r)*" means an individual, or a legal entity acting by and
through an individual or individuals, exercising rights either under
this License or under a future version of this License issued pursuant
to Section 4.1. For legal entities, "You(r)" includes any entity that by
majority voting interest controls, is controlled by, or is under common
control with You.

44. "*Your Products*" means any (i) hardware products You distribute
integrating the Covered Code; (ii) any software products You distribute
with the Covered Code that utilize the APIs of the Covered Code; or
(iii) any services You provide using the Covered Code.


  ATTACHMENT A

REQUIRED NOTICES


    ATTACHMENT A-1

REQUIRED IN ALL CASES

Notice to be included in header file of all Error Corrections and Shared
Modifications:

Portions Copyright 1994-2003 © RealNetworks, Inc. All rights reserved.

The contents of this file, and the files included with this file, are
subject to the current version of RealNetworks Community Source License
Version 1.1 (the "License"). You may not use this file except in
compliance with the License executed by both You and RealNetworks. You
may obtain a copy of the License at *
https://www.helixcommunity.org/content/rcsl.* You may also obtain a copy
of the License by contacting RealNetworks directly. Please see the
License for the rights, obligations and limitations governing use of the
contents of the file.

This file is part of the Helix DNA technology. RealNetworks, Inc., 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, are distributed 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.

Contributor(s):

_______________________________________________

Technology Compatibility Kit Test Suite(s) Location:

________________________________


    ATTACHMENT A-2

SAMPLE LICENSEE CERTIFICATION

"By clicking the `Agree' button below, You certify that You are a
Licensee in good standing under the RealNetworks Community Source
License, ("License") and that Your access, use and distribution of code
and information You may obtain at this site is subject to the License.
If You are not a Licensee under the RealNetworks Community Source
License You agree not to download, copy or use the Helix DNA technology.


    ATTACHMENT A-3

REQUIRED STUDENT NOTIFICATION

"This software and related documentation has been obtained by Your
educational institution subject to the RealNetworks Community Source
License. You have been provided access to the software and related
documentation for use only in connection with your course work and
research activities as a matriculated student of Your educational
institution. Any other use is expressly prohibited.

THIS SOFTWARE AND RELATED DOCUMENTATION CONTAINS PROPRIETARY MATERIAL OF
REALNETWORKS, INC, WHICH ARE PROTECTED BY VARIOUS INTELLECTUAL PROPERTY
RIGHTS.

You may not use this file except in compliance with the License. You may
obtain a copy of the License on the web at
https://www.helixcommunity.org/content/rcsl.

*
*


  ATTACHMENT B

Description of Technology

Helix DNA, which consists of Helix DNA Client, Helix DNA Server and
Helix DNA Producer.

Description of "Technology"

Helix DNA Technology v1.0 as described on the Community Web Server.


  ATTACHMENT C

TECHNOLOGY COMPATIBILITY KIT LICENSE

The following license is effective for the *Helix DNA* Technology
Compatibility Kit - as described on the Community Web Server. The
Technology Compatibility Kit(s) for the Technology specified in
Attachment B may be accessed at the Community Web Server.

1. TCK License.

1.1 Grants to use TCK

Subject to the terms and restrictions set forth below and the
RealNetworks Community Source License, and the Research Use license,
Original Contributor grants to You a worldwide, non-exclusive,
non-transferable license, to the extent of Original Contributor's
Intellectual Property Rights in the TCK (without the right to
sublicense), to use the TCK to develop and test Covered Code.

1.2 TCK Use Restrictions.

You are not authorized to create derivative works of the TCK or use the
TCK to test any implementation of the Specification that is not Covered
Code. You may not publish Your test results or make claims of
comparative compatibility with respect to other implementations of the
Specification. In consideration for the license grant in Section 1.1
above You agree not to develop Your own tests that are intended to
validate conformation with the Specification.

2. Test Results.

You agree to provide to Original Contributor or the third party test
facility if applicable, Your test results that demonstrate that Covered
Code is Compliant Covered Code and that Original Contributor may publish
or otherwise distribute such test results.

PLEASE READ THE TERMS OF THIS LICENSE CAREFULLY. BY CLICKING ON THE
"ACCEPT" BUTTON BELOW YOU ARE ACCEPTING AND AGREEING TO THE TERMS AND
CONDITIONS OF THIS LICENSE WITH THE ORIGINAL CONTRIBUTOR, REALNETWORKS,
INC. IF YOU ARE AGREEING TO THIS LICENSE ON BEHALF OF A COMPANY, YOU
REPRESENT THAT YOU ARE AUTHORIZED TO BIND THE COMPANY TO SUCH A LICENSE.
WHETHER YOU ARE ACTING ON YOUR OWN BEHALF, OR REPRESENTING A COMPANY,
YOU MUST BE OF MAJORITY AGE AND BE OTHERWISE COMPETENT TO ENTER INTO
CONTRACTS. IF YOU DO NOT MEET THIS CRITERIA OR YOU DO NOT AGREE TO ANY
OF THE TERMS AND CONDITIONS OF THIS LICENSE, CLICK ON THE REJECT BUTTON
TO EXIT.

*ACCEPT / REJECT
*

*
*

*To agree to the R&D/academic terms of this license, please register
 on the site --
you will then be given a chance to agree to the clickwrap RCSL

R&D License

and gain access to the RCSL-licensed source code.  To build or deploy
commercial applications based on the RCSL, you will need to agree to the
Commercial Use license attachments
*




--- NEW FILE: wmvrenderlib ---
# 
# ***** 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.AddModuleIncludes("common/include",
                          "common/runtime/pub",
                          "common/dbgtool/pub",
                          "common/util/pub",
                          "common/container/pub",
                          "common/system/pub",
                          "common/log/logutil/pub",
                          "video/include",
                          "client/include",
                          "client/videosvc/include",
                          "client/common/container/pub",
                          "datatype/rm/include",
                          "datatype/rm/common/pub",
                          "datatype/rm/video/common/pub",
                          "datatype/common/container/pub",
                          "datatype/common/util/pub",
                          "datatype/common/vidrend/pub")

project.AddSources("wmvrender.cpp",
                   "wmvformat.cpp",
                   "wmvdecoder.cpp")

LibraryTarget("wmvrenderlib")

DependTarget()

--- NEW FILE: wmvrender.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 "hlxclib/stdio.h"
#include "hlxclib/string.h"
#include "hxtypes.h"
#include "hxwintyp.h"
#include "hxresult.h"
#include "hxcom.h"
#include "ihxpckts.h"
#include "hxrendr.h"
#include "hxplugn.h"
#include "hxwin.h"
#include "hxvsurf.h"
#include "hxcodec.h"
#include "hxalloc.h"
#include "wmvformat.h"
#include "wmvrender.h"
#include "dllpath.h"
#include "wmvrender.ver"

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

#ifndef HX_WIDTHBYTES_32BITALIGNED
#define HX_WIDTHBYTES_32BITALIGNED(i) ((UINT32)((i+31)&(~31))/8)    /* 32-bit aligned ! */
#endif
#define HX_WMV_RENDERER_NAME   "Windows Media Video"

const char* const CWMVideoRenderer::m_pszDescription        = "RealNetworks MPEG-4 Video Renderer Plugin";
const char* const CWMVideoRenderer::m_ppszStreamMimeTypes[] = {"application/vnd.rn-wmv", NULL};


CWMVideoRenderer::CWMVideoRenderer(void)
{
    m_pOutputAllocator = NULL;
}

CWMVideoRenderer::~CWMVideoRenderer()
{
    if (m_pActiveVideoPacket)
    {
        m_pActiveVideoPacket->Clear();
        delete m_pActiveVideoPacket;
        m_pActiveVideoPacket = NULL;
    }
    HX_DELETE(m_pOutputAllocator);
}

STDMETHODIMP CWMVideoRenderer::GetPluginInfo(REF(HXBOOL)      rbLoadMultiple,
                                             REF(const char*) rpszDescription,
                                             REF(const char*) rpszCopyright,
                                             REF(const char*) rpszMoreInfoURL,
                                             REF(UINT32)      rulVersionNumber)
{
    HX_RESULT retVal = CVideoRenderer::GetPluginInfo(rbLoadMultiple,
                                                     rpszDescription,
                                                     rpszCopyright,
                                                     rpszMoreInfoURL,
                                                     rulVersionNumber);
    if (SUCCEEDED(retVal))
    {
        rpszDescription  = (const char*) m_pszDescription;
        rulVersionNumber = TARVER_ULONG32_VERSION;
    }
    
    return retVal;
}

STDMETHODIMP CWMVideoRenderer::GetRendererInfo(REF(const char**) rppszStreamMimeTypes,
                                               REF(UINT32)       rulInitialGranularity)
{
    HX_RESULT retVal = CVideoRenderer::GetRendererInfo(rppszStreamMimeTypes,
                                                       rulInitialGranularity);
    if (SUCCEEDED(retVal))
    {
        rppszStreamMimeTypes = (const char**) m_ppszStreamMimeTypes;
    }
    
    return retVal;
}

HX_RESULT STDAPICALLTYPE CWMVideoRenderer::HXCreateInstance(IUnknown** ppUnk)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppUnk)
    {
        CWMVideoRenderer* pObj = new CWMVideoRenderer();
        if (pObj)
        {
            retVal = pObj->QueryInterface(IID_IUnknown, (void**) ppUnk);
        }
        if (FAILED(retVal))
        {
            HX_DELETE(pObj);
        }
    }

    return retVal;
}

HX_RESULT CWMVideoRenderer::GetOutputAllocator(CHXMemoryAllocator** ppAlloc)
{
    HX_RESULT retVal = HXR_FAIL;

    if (ppAlloc && m_pOutputAllocator)
    {
        *ppAlloc = m_pOutputAllocator;
        (*ppAlloc)->AddRef();
        retVal = HXR_OK;
    }

    return retVal;
}

HX_RESULT CWMVideoRenderer::SetOutputAllocator(CHXMemoryAllocator* pAlloc)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pAlloc)
    {
        HX_DELETE(m_pOutputAllocator);
        m_pOutputAllocator = pAlloc;
        m_pOutputAllocator->AddRef();
        retVal = HXR_OK;
    }

    return retVal;
}

CVideoFormat* CWMVideoRenderer::CreateFormatObject(IHXValues* pHeader)
{
    return new CWMVideoFormat(m_pCommonClassFactory, this);
}

const char* CWMVideoRenderer::GetRendererName(void)
{
    return HX_WMV_RENDERER_NAME;
}

void CWMVideoRenderer::SetupBitmapDefaults(IHXValues*          pHeader,
                                           HXBitmapInfoHeader& rBitmapInfoHeader)
{
    // Call the base video renderer bitmap defaults
    CVideoRenderer::SetupBitmapDefaults(pHeader, rBitmapInfoHeader);
    // Now update any WMV-specific defaults. We only need
    // to update the bitcount, compression, and image size.
    rBitmapInfoHeader.biBitCount    = HX_WMV_DEFAULT_PIXEL_SIZE;
    rBitmapInfoHeader.biCompression = HX_WMV_DEFAULT_PIXEL_FORMAT;
    rBitmapInfoHeader.biSizeImage   = (rBitmapInfoHeader.biWidth * 
                                       rBitmapInfoHeader.biHeight * 
                                       rBitmapInfoHeader.biBitCount + 7) / 8;
}

--- NEW FILE: wmvdecoder.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 "hlxclib/string.h"
#include "hxtypes.h"
#include "hxresult.h"
#include "hxassert.h"
#include "hxwintyp.h"
#include "hxcom.h"
#include "hxmtypes.h"
#include "hxcomm.h"
#include "ihxpckts.h"
#include "hxplugn.h"
#include "hxengin.h"
#include "hxerror.h"
#include "hxformt.h"
#include "hxprefs.h"
#include "hxprefutil.h"
#include "codeclib.h"
#include "wmvdecoder.h"
#include "wmvformat.h"
#include "wmvrender.h"
#include "addupcol.h"

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


CWMVideoDecoder::CWMVideoDecoder()
{
    m_pContext         = NULL;
    m_pVideoRenderer   = NULL;
    m_pVideoFormat     = NULL;
    m_pOutputAllocator = NULL;
    m_pCodecLib        = NULL;
    m_pCodec           = NULL;
    m_pStream          = NULL;
    m_pCodecId         = NULL;
    m_moftagOut        = 0;
    m_pImageInfoBuffer = NULL;
    m_ulLastTimeStamp  = 0;
}

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

HX_RESULT CWMVideoDecoder::Init(IUnknown*             pContext,
                                CWMVideoRenderer*     pVideoRenderer,
                                CWMVideoFormat*       pVideoFormat,
                                HXxSize*              pSize,
                                IHX20MemoryAllocator* pOutputAllocator)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pContext && pVideoFormat && pOutputAllocator)
    {
        // Save the context
        HX_RELEASE(m_pContext);
        m_pContext = pContext;
        m_pContext->AddRef();
        // Save a pointer to the video renderer
        m_pVideoRenderer = pVideoRenderer;
        // Save a pointer to the video format
        m_pVideoFormat = pVideoFormat;
        // Get a pointer the codec id string from the video format
        m_pCodecId = m_pVideoFormat->GetCodecId();
        // Save the output allocator
        m_pOutputAllocator = pOutputAllocator;
        m_pOutputAllocator->AddRef();
        // Open the codec
        retVal = OpenCodec(STRINGTOMOFTAG(m_pCodecId));
        if (SUCCEEDED(retVal))
        {
            // Open a stream
            retVal = OpenStream();
        }
    }

    return retVal;
}

HX_RESULT CWMVideoDecoder::Decode(CMediaPacket* pFrameToDecode, UINT32 ulQuality) 
{
    HX_RESULT retVal = HXR_FAIL;

    if (m_pVideoFormat && m_pVideoRenderer && pFrameToDecode)
    {
        // Get the next frame time from the format
        UINT32 ulFirstTimeStamp = 0;
        m_pVideoFormat->GetNextFrameTime(ulFirstTimeStamp);
        // Tell the stream about renderer status so it can scale its processing
        HX_OQS2 theOutputQueueStatus;
        theOutputQueueStatus.queueDepth                  = m_pVideoFormat->GetDecodedFrameQueueDepth();
        theOutputQueueStatus.newestQueueElementTimeStamp = m_ulLastTimeStamp;
        theOutputQueueStatus.oldestQueueElementTimeStamp = ulFirstTimeStamp;
        theOutputQueueStatus.maxQueueDepth               = m_pVideoFormat->GetMaxDecodedFrames();
        theOutputQueueStatus.currentTimeStamp            = -m_pVideoRenderer->ComputeTimeAhead(0, 0);
        theOutputQueueStatus.nonFRUDroppedFrames         = 0;
        theOutputQueueStatus.TotalDroppedFrames          = 0;
        m_pCodecLib->PNStream_SetProperty(m_pStream, SP_OUPUT_QUEUE_STATUS2, &theOutputQueueStatus);
        // Pass the input data into the codec
        m_pCodecLib->PNStream_Input(m_pStream, NULL, (HXCODEC_DATA*) pFrameToDecode->m_pData);
        // NULL out the pointer so it doesn't get deleted yet
        ((HXCODEC_DATA*) pFrameToDecode->m_pData)->data = NULL;
    }
        
    return retVal;
}

HX_RESULT CWMVideoDecoder::DecodeDone(HXCODEC_DATA* pData)
{
    if (pData)
    {
        m_ulLastTimeStamp = pData->timestamp;
    }

    return m_pVideoFormat->DecodeDone(pData);
}

HX_RESULT CWMVideoDecoder::GetImageInfo(HX_MOF*& rpImageInfo)
{
    HX_RESULT retVal = HXR_FAIL;

    if (m_pCodecLib)
    {
        UINT32 ulSize = 0;
        retVal = m_pCodecLib->PNStream_GetStreamHeaderSize(m_pStream, &ulSize);
        if (SUCCEEDED(retVal))
        {
            // Set the return value
            retVal = HXR_FAIL;
            // Allocate a image info buffer
            HX_ASSERT((ulSize == sizeof(HX_FORMAT_IMAGE)) || (ulSize == sizeof(HX_FORMAT_IMAGE2)));
            UINT32* pMOFBuf = new UINT32 [ulSize / 4 + 1];
            if (pMOFBuf)
            {
                retVal = m_pCodecLib->PNStream_GetStreamHeader(m_pStream, (HX_MOF*) pMOFBuf);
                if (SUCCEEDED(retVal))
                {
                    HX_VECTOR_DELETE(m_pImageInfoBuffer);
                    m_pImageInfoBuffer = pMOFBuf;
                    rpImageInfo        = (HX_MOF*) m_pImageInfoBuffer;
                }
            }
            if (FAILED(retVal))
            {
                HX_VECTOR_DELETE(pMOFBuf);
            }
        }
    }

    return retVal;
}

HX_RESULT CWMVideoDecoder::Close(void)
{
    if (m_pStream)
    {
        m_pCodecLib->PNStream_Close(m_pStream);
        m_pStream = NULL;
    }
    if (m_pCodec)
    {
        m_pCodecLib->PNCodec_Close(m_pCodec);
        m_pCodec = NULL;
    }
    HX_RELEASE(m_pContext);
    HX_DELETE(m_pCodecLib);
    HX_RELEASE(m_pOutputAllocator);
    HX_VECTOR_DELETE(m_pImageInfoBuffer);

    return HXR_OK;
}

HX_RESULT CWMVideoDecoder::OnNewImage(HXSTREAM streamRef, HXSTREAM fromStreamRef, HXCODEC_DATA* pData)
{
    HX_RESULT retVal = HXR_FAIL;

    CWMVideoDecoder* pDecoder = (CWMVideoDecoder*) streamRef;
    if (pDecoder)
    {
        retVal = pDecoder->DecodeDone(pData);
    }
    
    return retVal;
}

HX_RESULT CWMVideoDecoder::OpenCodec(HX_MOFTAG mofTag)
{
    HX_RESULT retVal = HXR_FAIL;

    // Create Codec Library
    HX_DELETE(m_pCodecLib);
    m_pCodecLib = CreateCodecLibrary();
    if (m_pCodecLib)
    {
        // Tell the codec library what codec to load
        retVal = m_pCodecLib->LoadCodecLib(mofTag);
        if (SUCCEEDED(retVal))
        {
            // Open the codec
            retVal = m_pCodecLib->PNCodec_Open(mofTag, &m_pCodec);
            if (FAILED(retVal))
            {
                retVal = HXR_REQUEST_UPGRADE;
            }
        }
        else
        {
            // Generate the string
            // XXXMEH - we really should centralize this code
            // into CRADynamicCodecLibrary
            char szAUStr[5]; /* Flawfinder: ignore */
            szAUStr[0] = (char) ((mofTag >> 24) & 0x000000FF);
            szAUStr[1] = (char) ((mofTag >> 16) & 0x000000FF);
            szAUStr[2] = (char) ((mofTag >>  8) & 0x000000FF);
            szAUStr[3] = (char) ( mofTag        & 0x000000FF);
            szAUStr[4] = '\0';
            // Make sure it's lower-case
            strlwr(szAUStr);
            // We failed to load the codec binary, so
            // we need to add the string to the upgrade collection
            AddToAutoUpgradeCollection(szAUStr, m_pContext);
            // Make sure we return HXR_REQUEST_UPGRADE
            // so that we know we failed due to not being able
            // to load the codec as opposed to some other reason
            retVal = HXR_REQUEST_UPGRADE;
        }
    }

    return retVal;
}

HX_RESULT CWMVideoDecoder::OpenStream(void)
{
    HX_RESULT retVal = HXR_FAIL;

    if (m_pVideoFormat)
    {
        UINT32 ulMofInDataSize = (m_pVideoFormat->GetBitstreamHeaderSize() / 4) + 1;
        ulMofInDataSize       += sizeof(HX_FORMAT_NATIVE);
        UINT32* pMofInData     = new UINT32 [ulMofInDataSize];
        if (pMofInData)
        {
            // Set the input MOF
            HX_FORMAT_NATIVE* pMofIn = (HX_FORMAT_NATIVE*) pMofInData;
            pMofIn->cbLength  = m_pVideoFormat->GetBitstreamHeaderSize() + (pMofIn->data - ((UINT8*) pMofIn));
            pMofIn->moftag    = HX_MEDIA_NATIVE;
            pMofIn->submoftag = STRINGTOMOFTAG(m_pCodecId);
            memcpy(pMofIn->data, m_pVideoFormat->GetBitstreamHeader(), m_pVideoFormat->GetBitstreamHeaderSize());
            // Set the output MOF
            HX_FORMAT_IMAGE2 mofOut;
            mofOut.cbLength  = sizeof(HX_FORMAT_IMAGE2);
            mofOut.moftag    = HX_MEDIA_IMAGE2;
            mofOut.submoftag = HX_YUV420_ID;
            m_moftagOut      = HX_YUV420_ID;
            // Set up the codec init struct
            HXCODEC_INIT codecInit;
            codecInit.pInMof    = (HX_MOF*) pMofIn;
            codecInit.pOutMof   = (HX_MOF*) &mofOut;
//            codecInit.memoryRef = (HXMEMORY) m_pInputAllocator;
            codecInit.memoryRef = NULL;
            codecInit.pContext  = m_pContext;
            // Open the stream
            retVal = m_pCodecLib->PNCodec_StreamOpen(m_pCodec, &m_pStream, &codecInit);
            if (SUCCEEDED(retVal))
            {
                // Set the callback which the codec will call us back on
                retVal = m_pCodecLib->PNStream_SetDataCallback(m_pStream, this,
                                                               (HXMEMORY) m_pOutputAllocator,
                                                               OnNewImage);
                if (SUCCEEDED(retVal))
                {
                    // Set the codec quality
                    SetCodecQuality();
                    // Tell the codec we can handle different output sizes
                    HXBOOL bAllowDifferentOutputSizes = TRUE; 
                    m_pCodecLib->PNStream_SetProperty(m_pStream, 
                                                      SP_ALLOW_DIFFERENT_OUPUT_SIZES, 
                                                      &bAllowDifferentOutputSizes); 
                }
            }
        }
        HX_VECTOR_DELETE(pMofInData);
    }

    return retVal;
}

CRADynamicCodecLibrary* CWMVideoDecoder::CreateCodecLibrary()
{
    return new CRADynamicCodecLibrary(m_pContext);
}

void CWMVideoDecoder::SetCodecQuality(void)
{
    UINT16 usQualityPreference = 4;
    GetQualityPreference(usQualityPreference);
    
    // Turn on or off post filter based on flags in source URL
    // if the URL turns off post filter or the TLC quality
    // preference is < 2 we turn off the post filter
    HXBOOL bTmp = (usQualityPreference >= 2);
    m_pCodecLib->PNStream_SetProperty(m_pStream, SP_POSTFILTER, &bTmp);

    // Turn on or off FRU based on flags in source URL
    bTmp = (usQualityPreference >= 2);
    m_pCodecLib->PNStream_SetProperty(m_pStream, SP_TEMPORALINTERP, &bTmp);

    // Turn on or off decode of B-frames based on flags in source URL
    bTmp = (usQualityPreference >= 2);
    m_pCodecLib->PNStream_SetProperty(m_pStream, SP_DECODE_B_FRAMES, &bTmp);
}

HX_RESULT CWMVideoDecoder::GetQualityPreference(UINT16& rusQuality)
{
    HX_RESULT retVal = HXR_FAIL;

    if (m_pContext)
    {
        IHXPreferences* pPref = NULL;
        retVal = m_pContext->QueryInterface(IID_IHXPreferences, (void**) &pPref);
        if (SUCCEEDED(retVal))
        {
            retVal = ReadPrefUINT16(pPref, "Quality", rusQuality);
        }
        HX_RELEASE(pPref);
    }
    
    return retVal;
}

--- 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("wmvrenderlib", "wmvrenderdll")


--- NEW FILE: wmvrender_guids.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 ***** */ 

#define INITGUID

#include "hxtypes.h"
#include "hxwintyp.h"
#include "hxcom.h"
#include "hxplugn.h"
#include "hxprefs.h"
#include "ihxpckts.h"
#include "hxccf.h"
#include "hxupgrd.h"
#include "hxengin.h"
#include "hxmon.h"
#include "hxrendr.h"
#include "hxasm.h"
#include "hxvsurf.h"
#include "hxpcmkr.h"
#include "hxwin.h"
#include "ihxtlogsystem.h"
#include "ihxtlogsystemcontext.h"
#include "hxdllaccess.h"
#include "hxplayvelocity.h"
#include "hxerror.h"
#include "hxcore.h"
#include "hxsite2.h"

#if !defined(HELIX_FEATURE_DLLACCESS_CLIENT)
#include "dllpath.h"
ENABLE_DLLACCESS_PATHS(wmvrender);
#endif	// HELIX_FEATURE_DLLACCESS_CLIENT


From ehyche at helixcommunity.org  Tue Feb  7 11:25:40 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 13:39:49 2006
Subject: [Datatype-cvs] common/audrend Umakefil, 1.4, 1.5 audrend.cpp, 1.42,
	1.43 audrendf.cpp, 1.18, 1.19
Message-ID: 

Update of /cvsroot/datatype/common/audrend
In directory cvs:/tmp/cvs-serv10076

Modified Files:
	Umakefil audrend.cpp audrendf.cpp 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Erik Hodge (ehodge@real.com)

Description
-------------------------------
Previously the base audio renderer used the old MLOG-style
of logging. This change updates the base audio renderer
to use HXLOG logging. It also adds the necessary GUIDs
and includes and libs in each of the derived renderers.
It also adds a target in helix.bif which allows you to
build all the audrend-derived renderers, which is handy
if you ever make a change to the base audio renderer
and want to check that you haven't broken anything in
one of the derived renderers.

Files Modified
-------------------------------
common/include/ihxtlogsystem.h
datatype/common/audrend/Umakefil
datatype/common/audrend/audrend.cpp
datatype/common/audrend/audrendf.cpp
datatype/common/audrend/pub/audrend.h
datatype/group/audio/Umakefil
datatype/group/audio/audplin.cpp
datatype/mp4/audio/renderer/audiids.cpp
datatype/mp4/audio/renderer/dllumakefil
datatype/mp4/audio/renderer/libumakefil
datatype/wav/renderer/pcm/dllumakefil
datatype/wav/renderer/pcm/pcmrenddll.cpp
helix.bif

Branches
-------------------------------
HEAD only



Index: audrend.cpp
===================================================================
RCS file: /cvsroot/datatype/common/audrend/audrend.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- audrend.cpp	27 Apr 2005 13:57:37 -0000	1.42
+++ audrend.cpp	7 Feb 2006 19:25:37 -0000	1.43
@@ -80,6 +80,7 @@
 #include "hxausvc.h"
 #include "hxthread.h"
 #include "hxstrutl.h"
+#include "hxtlogutil.h"
 
 #include "hxtick.h"
 #include "hxassert.h"
@@ -90,7 +91,6 @@
 
 #include "hxver.h"
 
-#include "audrmlog.h"
 #include "audrend.h"
 
 #include "hxheap.h"
@@ -111,7 +111,13 @@
     "audio/NULL",
     NULL
 };
-
+const char* const CAudioRenderer::zm_pAudioStreamType[AUDREND_NUM_STREAMTYPESTRINGS] =
+{
+    "STREAMING_AUDIO",                // = 0
+    "INSTANTANEOUS_AUDIO",            // = 1
+    "TIMED_AUDIO",                    // = 2
+    "STREAMING_INSTANTANEOUS_AUDIO"   // = 3
+};
 
 /************************************************************************
  *  CAudioRenderer
@@ -124,6 +130,7 @@
 	, m_ppAudioStream(NULL)
 	, m_ulNumAudioStreams(0)
 	, m_ulCurAudioStream(0)
+        , m_ulNumAudioStreamPtrAlloc(0)
 	, m_ulPreroll(0)
 	, m_ulDelay(0)
 	, m_ulDuration(0)
@@ -159,7 +166,7 @@
     if (m_ppAudioStream)
     {
         memset((void*) m_ppAudioStream, 0, AUDREND_INITIAL_NUMSTREAMPTRS * sizeof(IHXAudioStream*));
-        m_ulNumAudioStreams = AUDREND_INITIAL_NUMSTREAMPTRS;
+        m_ulNumAudioStreamPtrAlloc = AUDREND_INITIAL_NUMSTREAMPTRS;
     }
 }
 
@@ -548,7 +555,11 @@
 
     if (SUCCEEDED(retVal))
     {
-	retVal = InitAudioStream(pHeader, &m_ppAudioStream[m_ulCurAudioStream]);
+        retVal = CreateAndAddNewAudioStream(m_ulCurAudioStream);
+        if (SUCCEEDED(retVal))
+        {
+            retVal = InitAudioStream(pHeader, &m_ppAudioStream[m_ulCurAudioStream]);
+        }
     }
 
     // Setup preroll
@@ -713,7 +724,7 @@
 //
 STDMETHODIMP CAudioRenderer::OnTimeSync(ULONG32 ulTime)
 {
-    MLOG_MISCEX(m_pErrorMessages, "OTS(%lu)\n", ulTime);
+    HXLOGL4(HXLOG_BAUD, "OnTimeSync(%lu)", ulTime);
     // we never enter the play state on Mac so that we write audio
     // in both packet and timesync
 #ifndef _MACINTOSH
@@ -921,8 +932,7 @@
 {
     HX_RESULT hr = HXR_OK;
 
-    MLOG_MISC(m_pErrorMessages, "ODN (%lu,%lu)\n",
-              ulCurrentStreamTime, ulMinimumDurationRequired);
+    HXLOGL2(HXLOG_BAUD, "OnDryNotification(%lu,%lu)", ulCurrentStreamTime, ulMinimumDurationRequired);
     /* If the renderer is delayed, do not report rebuffer status until the
      * packets are really due i.e. until Current time + Preroll is greater
      * than the Delay time.
@@ -1206,9 +1216,9 @@
 
 	HX_ASSERT(SUCCEEDED(retVal));
 
-        MLOG_MISC(m_pErrorMessages, "AS Init (%u,%u,%lu,%u)\n",
-                  audioFmt.uChannels, audioFmt.uBitsPerSample,
-                  audioFmt.ulSamplesPerSec, audioFmt.uMaxBlockSize);
+        HXLOGL2(HXLOG_BAUD, "IHXAudioStream(0x%08x)::Init((%u,%u,%lu,%u))",
+                *ppAudioStream, audioFmt.uChannels, audioFmt.uBitsPerSample,
+                audioFmt.ulSamplesPerSec, audioFmt.uMaxBlockSize);
 
 	retVal = (*ppAudioStream)->Init(&audioFmt, pHeader);
 
@@ -1256,20 +1266,14 @@
             return pnr;
         }
 
-        MLOG_MISC(m_pErrorMessages, "AS Write (%lu,%lu,%lu) ms=%lu tick=%lu\n",
-                  (pAudioData->pData ? pAudioData->pData->GetSize() : 0),
-                  pAudioData->ulAudioTime,
-                  pAudioData->uAudioStreamType,
-                  m_pAudioFormat->ConvertBytesToMs((pAudioData->pData ? pAudioData->pData->GetSize() : 0)),
-                  HX_GET_BETTERTICKCOUNT());
-
-	DEBUG_OUTF_IDX(m_ulCurAudioStream, AUDREND_FLOW_FILE, 
-		       (s, "Audio Write: Time=%u, Bytes=%u, Duration=%u, %s\n",
-			    pAudioData->ulAudioTime,
-			    (pAudioData->pData ? pAudioData->pData->GetSize() : 0),
-			    m_pAudioFormat->ConvertBytesToMs((pAudioData->pData ? pAudioData->pData->GetSize() : 0)),
-			    ((pAudioData->uAudioStreamType == STREAMING_AUDIO) ? "STREAMING" : "TIMED")
-			    ));
+        HXLOGL4(HXLOG_BAUD, "IHXAudioStream(0x%08x)::Write((0x%08x,%lu,%s)) bytes=%lu ms=%lu samps=%lu",
+                m_ppAudioStream[m_ulCurAudioStream],
+                pAudioData->pData,
+                pAudioData->ulAudioTime,
+                GetAudioStreamTypeString(pAudioData->uAudioStreamType),
+                (pAudioData->pData ? pAudioData->pData->GetSize() : 0),
+                m_pAudioFormat->ConvertBytesToMs((pAudioData->pData ? pAudioData->pData->GetSize() : 0)),
+                m_pAudioFormat->ConvertBytesToSamples((pAudioData->pData ? pAudioData->pData->GetSize() : 0)));
 
         // Write to AS
         if (m_ppAudioStream[m_ulCurAudioStream])
@@ -1378,7 +1382,7 @@
 		lTimeDelta = audioData.ulAudioTime -
 			     m_ulLastWriteTime;
 
-		HX_ASSERT(lTimeDelta >= (-TIME_FUDGE));
+//		HX_ASSERT(lTimeDelta >= (-TIME_FUDGE));
 
 		if (lTimeDelta <= TIME_FUDGE)
 		{
@@ -1451,14 +1455,37 @@
 
     if (m_pAudioFormat)
     {
+        // Clear the return value
 	retVal = HXR_OK;
-
 	// Check to see if the audio format has changed
 	if (HasAudioFormatChanged())
 	{
-	    // Transfer the current audio stream to
-	    // a newly created audio stream
-	    retVal = IncrementAudioStream();
+            // See if we can find a compatible audio stream from
+            // the currently allocated array of audio streams.
+            // If we are switching formats for the first time,
+            // we will not expect to find a compatible format.
+            // If, however, we are switching for a second time
+            // (or more), then we may be able to find a compatible
+            // audio stream from the currently allocated array.
+            UINT32 ulNewAudioStreamIndex = 0;
+            HX_RESULT rv = FindCompatibleAudioStream(ulNewAudioStreamIndex);
+            if (FAILED(rv))
+            {
+                // We didn't find a compatible audio stream, so
+                // we need to create an additional audio stream.
+                retVal = CreateAndAddNewAudioStream(ulNewAudioStreamIndex);
+            }
+            if (SUCCEEDED(retVal))
+            {
+                // Switch to the new audio stream
+                retVal = SwitchToNewAudioStream(m_ulCurAudioStream, ulNewAudioStreamIndex);
+                if (SUCCEEDED(retVal))
+                {
+                    // Set the current audio stream index
+                    m_ulCurAudioStream = ulNewAudioStreamIndex;
+                }
+            }
+            // Set the out parameter
 	    rbAudioStreamChanged = SUCCEEDED(retVal);
 	}
     }
@@ -1466,108 +1493,197 @@
     return retVal;
 }
 
-HXBOOL CAudioRenderer::HasAudioFormatChanged()
+HX_RESULT CAudioRenderer::IsAudioStreamFormatCompatible(UINT32 i, HXBOOL& rbIsCompatible)
 {
-    HXBOOL bRet = FALSE;
+    HX_RESULT retVal = HXR_FAIL;
 
-    if (m_pAudioFormat)
+    if (m_pAudioFormat && m_ppAudioStream && i < m_ulNumAudioStreams &&  m_ppAudioStream[i])
     {
         // Get the audio format from the CAudioFormat object
         HXAudioFormat cAudioFormat1;
-        HX_RESULT retVal = m_pAudioFormat->GetAudioFormat(cAudioFormat1);
+        retVal = m_pAudioFormat->GetAudioFormat(cAudioFormat1);
         if (SUCCEEDED(retVal))
         {
-            // Get the audio format from the current IHXAudioStream object
-            if (m_ppAudioStream &&
-                m_ulCurAudioStream < m_ulNumAudioStreams &&
-                m_ppAudioStream[m_ulCurAudioStream])
+            IHXAudioStream2* pStream2 = NULL;
+            retVal = m_ppAudioStream[i]->QueryInterface(IID_IHXAudioStream2, (void**) &pStream2);
+            if (SUCCEEDED(retVal))
             {
-                IHXAudioStream2* pStream2 = NULL;
-                retVal = m_ppAudioStream[m_ulCurAudioStream]->QueryInterface(IID_IHXAudioStream2,
-                                                                             (void**) &pStream2);
+                HXAudioFormat cAudioFormat2;
+                retVal = pStream2->GetAudioFormat(&cAudioFormat2);
                 if (SUCCEEDED(retVal))
                 {
-                    HXAudioFormat cAudioFormat2;
-                    retVal = pStream2->GetAudioFormat(&cAudioFormat2);
-                    if (SUCCEEDED(retVal))
+                    // Check if the formats are different
+                    if (cAudioFormat1.uChannels       != cAudioFormat2.uChannels       ||
+                        cAudioFormat1.uBitsPerSample  != cAudioFormat2.uBitsPerSample  ||
+                        cAudioFormat1.ulSamplesPerSec != cAudioFormat2.ulSamplesPerSec ||
+                        cAudioFormat1.uMaxBlockSize    > cAudioFormat2.uMaxBlockSize)
                     {
-                        // Check if the formats are different
-                        if (cAudioFormat1.uChannels       != cAudioFormat2.uChannels       ||
-                            cAudioFormat1.uBitsPerSample  != cAudioFormat2.uBitsPerSample  ||
-                            cAudioFormat1.ulSamplesPerSec != cAudioFormat2.ulSamplesPerSec ||
-                            cAudioFormat1.uMaxBlockSize    > cAudioFormat2.uMaxBlockSize)
-                        {
-                            bRet = TRUE;
-                        }
+                        // This audio stream is not compatible with the current format
+                        rbIsCompatible = FALSE;
+                    }
+                    else
+                    {
+                        // This audio stream is compatible with the current format
+                        rbIsCompatible = TRUE;
                     }
                 }
-                HX_RELEASE(pStream2);
             }
+            HX_RELEASE(pStream2);
+        }
+    }
+
+    return retVal;
+}
+
+HX_RESULT CAudioRenderer::FindCompatibleAudioStream(UINT32& rulAudioStreamIndex)
+{
+    // Look through all audio streams until we
+    // either run out of audio streams, fail,
+    // or find a compatible audio stream.
+    HX_RESULT retVal        = HXR_OK;
+    HXBOOL    bIsCompatible = FALSE;
+    UINT32    i             = 0;
+    for (i = 0; i < m_ulNumAudioStreams && SUCCEEDED(retVal); i++)
+    {
+        retVal = IsAudioStreamFormatCompatible(i, bIsCompatible);
+        if (SUCCEEDED(retVal) && bIsCompatible)
+        {
+            break;
+        }
+    }
+    if (SUCCEEDED(retVal))
+    {
+        // If we examined all the audio streams and didn't
+        // find a compatible stream, then i == m_ulNumAudioStreams
+        // If we found a compatible stream, then i < m_ulNumAudioStreams
+        if (i < m_ulNumAudioStreams)
+        {
+            // Set the out parameter and leave the
+            // return value as successful
+            rulAudioStreamIndex = i;
+        }
+        else
+        {
+            // We didn't find a compatible audio stream,
+            // so change the return value to failure
+            retVal = HXR_FAIL;
+        }
+    }
+
+    return retVal;
+}
+
+HX_RESULT CAudioRenderer::SwitchToNewAudioStream(UINT32 ulOldStreamIndex, UINT32 ulNewStreamIndex)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (m_ppAudioStream &&
+        ulOldStreamIndex < m_ulNumAudioStreams &&
+        ulNewStreamIndex < m_ulNumAudioStreams &&
+        m_ppAudioStream[ulOldStreamIndex])
+    {
+        // Remove the dry notification from the old stream
+        IHXAudioStream2* pStream2 = NULL;
+        retVal = m_ppAudioStream[ulOldStreamIndex]->QueryInterface(IID_IHXAudioStream2, (void**) &pStream2);
+        if (SUCCEEDED(retVal))
+        {
+            // Get our own IHXDryNotification interface
+            IHXDryNotification* pDryNot = NULL;
+            retVal = QueryInterface(IID_IHXDryNotification, (void**) &pDryNot);
+            if (SUCCEEDED(retVal))
+            {
+                // Remove the dry notification
+                retVal = pStream2->RemoveDryNotification(pDryNot);
+                if (SUCCEEDED(retVal))
+                {
+                    // Init the new stream
+                    retVal = InitAudioStream(m_pHeader, &m_ppAudioStream[ulNewStreamIndex]);
+                }
+            }
+            HX_RELEASE(pDryNot);
         }
+        HX_RELEASE(pStream2);
+    }
+
+    return retVal;
+}
+
+HXBOOL CAudioRenderer::HasAudioFormatChanged()
+{
+    HXBOOL bRet = FALSE;
+
+    HXBOOL    bCompat = FALSE;
+    HX_RESULT rv      = IsAudioStreamFormatCompatible(m_ulCurAudioStream, bCompat);
+    if (SUCCEEDED(rv))
+    {
+        // If the current format is not compatible, then
+        // the audio format has changed. If the current
+        // format IS compatible, then the audio format
+        // has NOT changed. So the return value is
+        // the logical NOT of bCompat.
+        bRet = !bCompat;
     }
 
     return bRet;
 }
 
-HX_RESULT CAudioRenderer::IncrementAudioStream()
+HX_RESULT CAudioRenderer::CreateAndAddNewAudioStream(UINT32& rulNewAudioStreamIndex)
 {
     HX_RESULT retVal = HXR_FAIL;
 
-    if (m_ulCurAudioStream + 1 >= m_ulNumAudioStreams)
+    // Get the next audio stream index we will assign
+    UINT32 ulNextAudioStreamIndex = m_ulNumAudioStreams;
+    // Is our buffer of audio stream pointers big enough?
+    if (ulNextAudioStreamIndex >= m_ulNumAudioStreamPtrAlloc)
     {
         // We need to create a larger buffer to hold the
-        // audio stream pointers
-        UINT32 ulNewSize = m_ulNumAudioStreams * 2;
+        // audio stream pointers. Double the current allocation
+        UINT32 ulNewSize = m_ulNumAudioStreamPtrAlloc * 2;
         IHXAudioStream** ppAudioStream = new IHXAudioStream* [ulNewSize];
         if (ppAudioStream)
         {
             // NULL out the buffer
             memset((void*) ppAudioStream, 0, ulNewSize * sizeof(IHXAudioStream*));
-            // Copy the current pointers
-            memcpy((void*) ppAudioStream, /* Flawfinder: ignore */
-                   (const void*) m_ppAudioStream,
-                   m_ulNumAudioStreams * sizeof(IHXAudioStream*));
+            // Copy the current pointers (if there are any)
+            if (m_ppAudioStream && m_ulNumAudioStreams)
+            {
+                memcpy((void*) ppAudioStream, /* Flawfinder: ignore */
+                    (const void*) m_ppAudioStream,
+                    m_ulNumAudioStreams * sizeof(IHXAudioStream*));
+            }
             // Delete the old array
             HX_VECTOR_DELETE(m_ppAudioStream);
             // Assign the new one
             m_ppAudioStream = ppAudioStream;
-            // Assign the new size
-            m_ulNumAudioStreams = ulNewSize;
+            // Assign the new number of allocated pointers
+            m_ulNumAudioStreamPtrAlloc = ulNewSize;
         }
     }
-    if (m_ulCurAudioStream + 1 < m_ulNumAudioStreams)
+    if (ulNextAudioStreamIndex < m_ulNumAudioStreamPtrAlloc)
     {
-        // Remove the dry notification from the old stream
-        if (m_ppAudioStream[m_ulCurAudioStream])
-        {
-            IHXAudioStream2* pStream2 = NULL;
-            m_ppAudioStream[m_ulCurAudioStream]->QueryInterface(IID_IHXAudioStream2,
-                                                                (void**) &pStream2);
-            if (pStream2)
-            {
-                // Get our own IHXDryNotification interface
-                IHXDryNotification* pDryNot = NULL;
-                QueryInterface(IID_IHXDryNotification, (void**) &pDryNot);
-                if (pDryNot)
-                {
-                    pStream2->RemoveDryNotification(pDryNot);
-                }
-                HX_RELEASE(pDryNot);
-            }
-            HX_RELEASE(pStream2);
-        }
-        // Init the new stream
-        retVal = InitAudioStream(m_pHeader, &m_ppAudioStream[m_ulCurAudioStream + 1]);
-        if (SUCCEEDED(retVal))
-        {
-            // Increment the current audio stream index
-            m_ulCurAudioStream += 1;
-        }
+        // Set the out parameter
+        rulNewAudioStreamIndex = ulNextAudioStreamIndex;
+        // Increment the number of active streams
+        m_ulNumAudioStreams++;
+        // Clear the return value
+        retVal = HXR_OK;
     }
 
     return retVal;
 }
 
+const char* CAudioRenderer::GetAudioStreamTypeString(AudioStreamType eType)
+{
+    const char* pszRet = "Unknown";
+
+    if (eType < AUDREND_NUM_STREAMTYPESTRINGS)
+    {
+        pszRet = zm_pAudioStreamType[eType];
+    }
+
+    return pszRet;
+}
+
 HXBOOL CAudioRenderer::IsRebuffering() const
 {
     return (NO_TIME_SET != m_ulAudioWantedTime) ? TRUE : FALSE;

Index: audrendf.cpp
===================================================================
RCS file: /cvsroot/datatype/common/audrend/audrendf.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- audrendf.cpp	5 May 2005 16:15:07 -0000	1.18
+++ audrendf.cpp	7 Feb 2006 19:25:37 -0000	1.19
@@ -84,6 +84,7 @@
 #include "hxassert.h"
 
 #include "hxstrutl.h"
+#include "hxtlogutil.h"
 
 #include "hxheap.h"
 

Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/common/audrend/Umakefil,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Umakefil	17 Jul 2003 20:30:46 -0000	1.4
+++ Umakefil	7 Feb 2006 19:25:37 -0000	1.5
@@ -43,6 +43,7 @@
 			    "common/dbgtool/pub",
 			    "common/util/pub",
 			    "common/system/pub",
+			    "common/log/logutil/pub",
 			    "client/common/container/pub",
 			    "protocol/sdp/pub",
 			    "video/include")


From ehyche at helixcommunity.org  Tue Feb  7 11:25:41 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 13:39:49 2006
Subject: [Datatype-cvs] common/audrend/pub audrend.h,1.14,1.15
Message-ID: 

Update of /cvsroot/datatype/common/audrend/pub
In directory cvs:/tmp/cvs-serv10076/pub

Modified Files:
	audrend.h 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Erik Hodge (ehodge@real.com)

Description
-------------------------------
Previously the base audio renderer used the old MLOG-style
of logging. This change updates the base audio renderer
to use HXLOG logging. It also adds the necessary GUIDs
and includes and libs in each of the derived renderers.
It also adds a target in helix.bif which allows you to
build all the audrend-derived renderers, which is handy
if you ever make a change to the base audio renderer
and want to check that you haven't broken anything in
one of the derived renderers.

Files Modified
-------------------------------
common/include/ihxtlogsystem.h
datatype/common/audrend/Umakefil
datatype/common/audrend/audrend.cpp
datatype/common/audrend/audrendf.cpp
datatype/common/audrend/pub/audrend.h
datatype/group/audio/Umakefil
datatype/group/audio/audplin.cpp
datatype/mp4/audio/renderer/audiids.cpp
datatype/mp4/audio/renderer/dllumakefil
datatype/mp4/audio/renderer/libumakefil
datatype/wav/renderer/pcm/dllumakefil
datatype/wav/renderer/pcm/pcmrenddll.cpp
helix.bif

Branches
-------------------------------
HEAD only



Index: audrend.h
===================================================================
RCS file: /cvsroot/datatype/common/audrend/pub/audrend.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- audrend.h	24 Mar 2005 01:27:06 -0000	1.14
+++ audrend.h	7 Feb 2006 19:25:38 -0000	1.15
@@ -51,6 +51,7 @@
 #include "audstats.h"
 
 #define AUDREND_INITIAL_NUMSTREAMPTRS  4
+#define AUDREND_NUM_STREAMTYPESTRINGS  4
 
 
 /****************************************************************************
@@ -76,6 +77,7 @@
     static const char*	const zm_pCopyright;
     static const char*	const zm_pMoreInfoURL;
     static const char*	const zm_pStreamMimeTypes[];
+    static const char*  const zm_pAudioStreamType[AUDREND_NUM_STREAMTYPESTRINGS];
 
     HX_RESULT InitAudioStream (IHXValues* pHeader,
 			       IHXAudioStream** ppAudioStream);
@@ -90,8 +92,12 @@
     void CalculateMaxTimeStamp(HXAudioData* pAudioData);
 
     HX_RESULT CheckForAudioStreamChange(REF(HXBOOL) rbAudioStreamChanged);
-    HXBOOL      HasAudioFormatChanged();
-    HX_RESULT IncrementAudioStream();
+    HX_RESULT IsAudioStreamFormatCompatible(UINT32 i, HXBOOL& rbIsCompatible);
+    HX_RESULT FindCompatibleAudioStream(UINT32& rulAudioStreamIndex);
+    HX_RESULT SwitchToNewAudioStream(UINT32 ulOldStreamIndex, UINT32 ulNewStreamIndex);
+    HXBOOL    HasAudioFormatChanged();
+    HX_RESULT CreateAndAddNewAudioStream(UINT32& rulNewAudioStreamIndex);
+    const char* GetAudioStreamTypeString(AudioStreamType eType);
 
     HXBOOL IsRebuffering() const;
     void StartRebuffer(UINT32 ulAudioWantedTime);
@@ -101,6 +107,7 @@
     IHXAudioStream**        m_ppAudioStream;
     UINT32                  m_ulNumAudioStreams;
     UINT32                  m_ulCurAudioStream;
+    UINT32                  m_ulNumAudioStreamPtrAlloc;
     
     UINT32		    m_ulPreroll;
     UINT32		    m_ulDelay;


From ehyche at helixcommunity.org  Tue Feb  7 11:26:07 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 13:40:16 2006
Subject: [Datatype-cvs] group/audio Umakefil,1.10,1.11 audplin.cpp,1.7,1.8
Message-ID: 

Update of /cvsroot/datatype/group/audio
In directory cvs:/tmp/cvs-serv10371

Modified Files:
	Umakefil audplin.cpp 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Erik Hodge (ehodge@real.com)

Description
-------------------------------
Previously the base audio renderer used the old MLOG-style
of logging. This change updates the base audio renderer
to use HXLOG logging. It also adds the necessary GUIDs
and includes and libs in each of the derived renderers.
It also adds a target in helix.bif which allows you to
build all the audrend-derived renderers, which is handy
if you ever make a change to the base audio renderer
and want to check that you haven't broken anything in
one of the derived renderers.

Files Modified
-------------------------------
common/include/ihxtlogsystem.h
datatype/common/audrend/Umakefil
datatype/common/audrend/audrend.cpp
datatype/common/audrend/audrendf.cpp
datatype/common/audrend/pub/audrend.h
datatype/group/audio/Umakefil
datatype/group/audio/audplin.cpp
datatype/mp4/audio/renderer/audiids.cpp
datatype/mp4/audio/renderer/dllumakefil
datatype/mp4/audio/renderer/libumakefil
datatype/wav/renderer/pcm/dllumakefil
datatype/wav/renderer/pcm/pcmrenddll.cpp
helix.bif

Branches
-------------------------------
HEAD only



Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/group/audio/Umakefil,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Umakefil	11 Feb 2005 00:28:04 -0000	1.10
+++ Umakefil	7 Feb 2006 19:26:05 -0000	1.11
@@ -49,7 +49,8 @@
                            "common/dbgtool[debuglib]",
                            "common/util[utillib]",
                            "common/container[contlib]",
-                           "common/runtime[runtlib]")
+                           "common/runtime[runtlib]",
+                           "common/log/logutil[logutillib]")
 
 if bIncludeAMR:
         project.AddModuleIncludes("datatype/common/container/pub")

Index: audplin.cpp
===================================================================
RCS file: /cvsroot/datatype/group/audio/audplin.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- audplin.cpp	20 May 2004 09:42:00 -0000	1.7
+++ audplin.cpp	7 Feb 2006 19:26:05 -0000	1.8
@@ -62,6 +62,10 @@
 #include "hxwin.h"
 #include "hxvalue.h"
 #include "baseobj.h"
+#include "ihxtlogsystem.h"
+#include "ihxtlogsystemcontext.h"
+#include "hxdllaccess.h"
+#include "hxplgns.h"
 
 #if defined(HELIX_FEATURE_AUDIO_WAVE) || defined(HELIX_FEATURE_AUDIO_AU) || defined(HELIX_FEATURE_AUDIO_AIFF)
 #include "audrend.h"


From ehyche at helixcommunity.org  Tue Feb  7 11:26:26 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 13:40:35 2006
Subject: [Datatype-cvs] 
	mp4/audio/renderer audiids.cpp, 1.9, 1.10 dllumakefil,
	1.6, 1.7 libumakefil, 1.13, 1.14
Message-ID: 

Update of /cvsroot/datatype/mp4/audio/renderer
In directory cvs:/tmp/cvs-serv10542

Modified Files:
	audiids.cpp dllumakefil libumakefil 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Erik Hodge (ehodge@real.com)

Description
-------------------------------
Previously the base audio renderer used the old MLOG-style
of logging. This change updates the base audio renderer
to use HXLOG logging. It also adds the necessary GUIDs
and includes and libs in each of the derived renderers.
It also adds a target in helix.bif which allows you to
build all the audrend-derived renderers, which is handy
if you ever make a change to the base audio renderer
and want to check that you haven't broken anything in
one of the derived renderers.

Files Modified
-------------------------------
common/include/ihxtlogsystem.h
datatype/common/audrend/Umakefil
datatype/common/audrend/audrend.cpp
datatype/common/audrend/audrendf.cpp
datatype/common/audrend/pub/audrend.h
datatype/group/audio/Umakefil
datatype/group/audio/audplin.cpp
datatype/mp4/audio/renderer/audiids.cpp
datatype/mp4/audio/renderer/dllumakefil
datatype/mp4/audio/renderer/libumakefil
datatype/wav/renderer/pcm/dllumakefil
datatype/wav/renderer/pcm/pcmrenddll.cpp
helix.bif

Branches
-------------------------------
HEAD only



Index: audiids.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/audiids.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- audiids.cpp	10 Oct 2005 19:11:14 -0000	1.9
+++ audiids.cpp	7 Feb 2006 19:26:22 -0000	1.10
@@ -61,6 +61,9 @@
 #include "hxformt.h"
 #include "hxacodec.h"
 #include "hxplgns.h"
+#include "ihxtlogsystem.h"
+#include "ihxtlogsystemcontext.h"
+#include "hxdllaccess.h"
 #undef INITGUID
 
 #include "mp4arender.ver"

Index: libumakefil
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/libumakefil,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- libumakefil	28 Dec 2005 17:23:49 -0000	1.13
+++ libumakefil	7 Feb 2006 19:26:22 -0000	1.14
@@ -51,6 +51,7 @@
                           "common/util/pub",
                           "common/container/pub",
                           "common/system/pub",
+                          "common/log/logutil/pub",
                           "datatype/common/util/pub",
                           "datatype/common/container/pub",
                           "datatype/common/audrend/pub",

Index: dllumakefil
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/dllumakefil,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dllumakefil	28 Oct 2005 10:56:54 -0000	1.6
+++ dllumakefil	7 Feb 2006 19:26:22 -0000	1.7
@@ -50,6 +50,7 @@
                            "common/util[utillib]", 
                            "common/container[contlib]",
                            "common/system[syslib]",
+                           "common/log/logutil[logutillib]",
                            "protocol/common/util[protutillib]",
                            "protocol/sdp[sdplib]",
                            "protocol/rtsp[rtsplib]",


From ehyche at helixcommunity.org  Tue Feb  7 11:26:45 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Tue Feb  7 13:40:54 2006
Subject: [Datatype-cvs] 
	wav/renderer/pcm dllumakefil, 1.3, 1.4 pcmrenddll.cpp, 1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/wav/renderer/pcm
In directory cvs:/tmp/cvs-serv10733/pcm

Modified Files:
	dllumakefil pcmrenddll.cpp 
Log Message:
Modified by: Eric Hyche (ehyche@real.com)
Reviewed by: Erik Hodge (ehodge@real.com)

Description
-------------------------------
Previously the base audio renderer used the old MLOG-style
of logging. This change updates the base audio renderer
to use HXLOG logging. It also adds the necessary GUIDs
and includes and libs in each of the derived renderers.
It also adds a target in helix.bif which allows you to
build all the audrend-derived renderers, which is handy
if you ever make a change to the base audio renderer
and want to check that you haven't broken anything in
one of the derived renderers.

Files Modified
-------------------------------
common/include/ihxtlogsystem.h
datatype/common/audrend/Umakefil
datatype/common/audrend/audrend.cpp
datatype/common/audrend/audrendf.cpp
datatype/common/audrend/pub/audrend.h
datatype/group/audio/Umakefil
datatype/group/audio/audplin.cpp
datatype/mp4/audio/renderer/audiids.cpp
datatype/mp4/audio/renderer/dllumakefil
datatype/mp4/audio/renderer/libumakefil
datatype/wav/renderer/pcm/dllumakefil
datatype/wav/renderer/pcm/pcmrenddll.cpp
helix.bif

Branches
-------------------------------
HEAD only



Index: pcmrenddll.cpp
===================================================================
RCS file: /cvsroot/datatype/wav/renderer/pcm/pcmrenddll.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pcmrenddll.cpp	28 Oct 2003 15:22:26 -0000	1.1
+++ pcmrenddll.cpp	7 Feb 2006 19:26:42 -0000	1.2
@@ -42,6 +42,9 @@
 #include "hxprefs.h"
 #include "hxupgrd.h"
 #include "ihxpckts.h"
+#include "ihxtlogsystem.h"
+#include "ihxtlogsystemcontext.h"
+#include "hxdllaccess.h"
 #include "hxrendr.h"
 #include "hxplugn.h"
 #include "hxver.h"

Index: dllumakefil
===================================================================
RCS file: /cvsroot/datatype/wav/renderer/pcm/dllumakefil,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- dllumakefil	16 Apr 2004 17:40:55 -0000	1.3
+++ dllumakefil	7 Feb 2006 19:26:42 -0000	1.4
@@ -48,7 +48,8 @@
                            "common/dbgtool[debuglib]",
                            "common/util[utillib]",
                            "common/container[contlib]",
-                           "common/system[syslib]")
+                           "common/system[syslib]",
+                           "common/log/logutil[logutillib]")
 
 project.AddSources("pcmrenddll.cpp")
 


From ping at helixcommunity.org  Tue Feb  7 12:50:20 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:04:28 2006
Subject: [Datatype-cvs] rm/audio/renderer raibufs.cpp,1.19,1.20
Message-ID: 

Update of /cvsroot/datatype/rm/audio/renderer
In directory cvs:/tmp/cvs-serv10563/audio/renderer

Modified Files:
	raibufs.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric


Index: raibufs.cpp
===================================================================
RCS file: /cvsroot/datatype/rm/audio/renderer/raibufs.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- raibufs.cpp	27 Apr 2005 13:57:44 -0000	1.19
+++ raibufs.cpp	7 Feb 2006 20:50:18 -0000	1.20
@@ -66,7 +66,6 @@
 static const char HX_THIS_FILE[] = __FILE__;
 #endif
 
-#include "hxstat.h"
 #define LOG_INFO 0
 // Add this back and make it work if you turn on LOG_VIDEO_INFO
 


From ping at helixcommunity.org  Tue Feb  7 12:50:20 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:04:28 2006
Subject: [Datatype-cvs] rm/events/renderer csyncad.cpp,1.5,1.6
Message-ID: 

Update of /cvsroot/datatype/rm/events/renderer
In directory cvs:/tmp/cvs-serv10563/events/renderer

Modified Files:
	csyncad.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric


Index: csyncad.cpp
===================================================================
RCS file: /cvsroot/datatype/rm/events/renderer/csyncad.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- csyncad.cpp	14 Mar 2005 19:15:54 -0000	1.5
+++ csyncad.cpp	7 Feb 2006 20:50:18 -0000	1.6
@@ -346,8 +346,6 @@
     {
         pTmpAdInfo = (AdInfo*) m_pAdList->GetNext(position);
 
-//      HXStaticStatLog::StatPrintf("list %lu event %lu\n",m_pAdList, pTmpAdInfo->m_ulStartTime);
-
         // This event must be valid or else it shouldn't be
         // in this list!
         HX_ASSERT_VALID_PTR(pTmpAdInfo);


From ping at helixcommunity.org  Tue Feb  7 12:50:21 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:04:29 2006
Subject: [Datatype-cvs] rm/imagemap/renderer imgmaprd.cpp, 1.6,
	1.7 imgmaprddll.cpp, 1.4, 1.5
Message-ID: 

Update of /cvsroot/datatype/rm/imagemap/renderer
In directory cvs:/tmp/cvs-serv10563/imagemap/renderer

Modified Files:
	imgmaprd.cpp imgmaprddll.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric


Index: imgmaprd.cpp
===================================================================
RCS file: /cvsroot/datatype/rm/imagemap/renderer/imgmaprd.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- imgmaprd.cpp	16 May 2005 20:13:06 -0000	1.6
+++ imgmaprd.cpp	7 Feb 2006 20:50:18 -0000	1.7
@@ -361,7 +361,7 @@
     }
 
     // Read any paths from preferences that weren't set by our loader
-    ReadUnsetPathsFromPrefs();
+    ReadUnsetPathsFromPrefs(m_pContext);
 
     return HXR_OK;
 }

Index: imgmaprddll.cpp
===================================================================
RCS file: /cvsroot/datatype/rm/imagemap/renderer/imgmaprddll.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- imgmaprddll.cpp	31 Mar 2005 21:53:03 -0000	1.4
+++ imgmaprddll.cpp	7 Feb 2006 20:50:18 -0000	1.5
@@ -79,6 +79,8 @@
 #include "hxupgrd.h"
 #include "hxphook.h"
 #include "hxmon.h"
+#include "hxprefs.h"
+#include "ihxfgbuf.h"
 
 #ifdef _WINDOWS
 #include "platform\win\resource.h"


From ping at helixcommunity.org  Tue Feb  7 12:50:54 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:05:02 2006
Subject: [Datatype-cvs] tools/dtdriver/dtdrplin datatypedr.cpp, 1.12,
	1.13 dtdrplin.cpp, 1.2, 1.3
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/dtdrplin
In directory cvs:/tmp/cvs-serv10677/dtdriver/dtdrplin

Modified Files:
	datatypedr.cpp dtdrplin.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric



Index: datatypedr.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/datatypedr.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- datatypedr.cpp	30 Jan 2006 21:11:05 -0000	1.12
+++ datatypedr.cpp	7 Feb 2006 20:50:52 -0000	1.13
@@ -54,7 +54,6 @@
 #include "hxsrcin.h"
 #include "hxdtdr.h"
 #include "progsink.h"
-#include "hxcommn.h"
 
 #include "thrdcbmgr.h"
 #include "datatypedr.h"

Index: dtdrplin.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/dtdrplin.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- dtdrplin.cpp	19 Aug 2005 02:40:54 -0000	1.2
+++ dtdrplin.cpp	7 Feb 2006 20:50:52 -0000	1.3
@@ -54,7 +54,6 @@
 #include "hxsrcin.h"
 #include "hxdtdr.h"
 #include "progsink.h"
-#include "hxcommn.h"
 
 #include "datatypedr.h"
 


From ping at helixcommunity.org  Tue Feb  7 12:50:55 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:05:03 2006
Subject: [Datatype-cvs] tools/dtdriver/dtdrplin/platform/unix thrdcbmgr.cpp,
	1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/dtdrplin/platform/unix
In directory cvs:/tmp/cvs-serv10677/dtdriver/dtdrplin/platform/unix

Modified Files:
	thrdcbmgr.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric



Index: thrdcbmgr.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/platform/unix/thrdcbmgr.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- thrdcbmgr.cpp	19 Aug 2005 02:24:39 -0000	1.1
+++ thrdcbmgr.cpp	7 Feb 2006 20:50:52 -0000	1.2
@@ -44,7 +44,6 @@
 #include "progsink.h"
 #include "hxdtdr.h"
 
-#include "hxcommn.h"
 #include "hxthread.h"
 #include "hxassert.h"	
 #include "hxmsgs.h"


From ping at helixcommunity.org  Tue Feb  7 12:50:56 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:05:04 2006
Subject: [Datatype-cvs] tools/dtdriver/dtdrplin/platform/win thrdcbmgr.cpp,
	1.2, 1.3
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/dtdrplin/platform/win
In directory cvs:/tmp/cvs-serv10677/dtdriver/dtdrplin/platform/win

Modified Files:
	thrdcbmgr.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric



Index: thrdcbmgr.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/platform/win/thrdcbmgr.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- thrdcbmgr.cpp	19 May 2004 18:46:41 -0000	1.2
+++ thrdcbmgr.cpp	7 Feb 2006 20:50:53 -0000	1.3
@@ -44,7 +44,6 @@
 #include "progsink.h"
 #include "hxdtdr.h"
 
-#include "hxcommn.h"
 #include "hxthread.h"
 #include "hxassert.h"	
 #include "messages.h"


From ping at helixcommunity.org  Tue Feb  7 12:50:56 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:05:05 2006
Subject: [Datatype-cvs] tools/dtdriver/dtdrplin/pub datatypedr.h,1.4,1.5
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/dtdrplin/pub
In directory cvs:/tmp/cvs-serv10677/dtdriver/dtdrplin/pub

Modified Files:
	datatypedr.h 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric



Index: datatypedr.h
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/dtdrplin/pub/datatypedr.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- datatypedr.h	19 Aug 2005 02:40:55 -0000	1.4
+++ datatypedr.h	7 Feb 2006 20:50:54 -0000	1.5
@@ -38,6 +38,7 @@
 
 #include "hxplugn.h"
 #include "hxplgns.h"
+#include "hxcommn.h"
 
 /****************************************************************************
  * Constants


From ping at helixcommunity.org  Tue Feb  7 12:50:56 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:05:05 2006
Subject: [Datatype-cvs] tools/minicntx minicntx.cpp,1.17,1.18
Message-ID: 

Update of /cvsroot/datatype/tools/minicntx
In directory cvs:/tmp/cvs-serv10677/minicntx

Modified Files:
	minicntx.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric



Index: minicntx.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/minicntx/minicntx.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- minicntx.cpp	31 Jan 2006 23:38:24 -0000	1.17
+++ minicntx.cpp	7 Feb 2006 20:50:54 -0000	1.18
@@ -170,7 +170,7 @@
     m_pPreferences->AddRef();
 
     /* set dll access paths */
-    ReadUnsetPathsFromPrefs();
+    ReadUnsetPathsFromPrefs(pClientContext);
     
     res = m_pPreferences->Open(pCompanyName, pProductName, nMajVer, nMinVer);
     if (FAILED(res))


From ping at helixcommunity.org  Tue Feb  7 12:56:21 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:01 2006
Subject: [Datatype-cvs] aac/fileformat aacffdll.cpp,1.6,1.7
Message-ID: 

Update of /cvsroot/datatype/aac/fileformat
In directory cvs:/tmp/cvs-serv11395/aac/fileformat

Modified Files:
	aacffdll.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric


Index: aacffdll.cpp
===================================================================
RCS file: /cvsroot/datatype/aac/fileformat/aacffdll.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- aacffdll.cpp	14 Feb 2005 15:07:40 -0000	1.6
+++ aacffdll.cpp	7 Feb 2006 20:56:19 -0000	1.7
@@ -43,6 +43,7 @@
 #include "hxprefs.h"
 #include "hxccf.h"
 #include "ihxpckts.h"
+#include "ihxfgbuf.h"
 #include "hxtlogutil.h"
 #include "baseobj.h"
 #if defined(HELIX_FEATURE_PROGRESSIVE_DOWNLD_STATUS)


From ping at helixcommunity.org  Tue Feb  7 12:56:21 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:01 2006
Subject: [Datatype-cvs] amr/fileformat amrffdll.cpp,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/amr/fileformat
In directory cvs:/tmp/cvs-serv11395/amr/fileformat

Modified Files:
	amrffdll.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:21 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:01 2006
Subject: [Datatype-cvs] common/audrend audstats.cpp,1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/common/audrend
In directory cvs:/tmp/cvs-serv11395/common/audrend

Modified Files:
	audstats.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:22 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:02 2006
Subject: [Datatype-cvs] common/util rendstats.cpp,1.5,1.6
Message-ID: 

Update of /cvsroot/datatype/common/util
In directory cvs:/tmp/cvs-serv11395/common/util

Modified Files:
	rendstats.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:22 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:02 2006
Subject: [Datatype-cvs] common/util/pub rendstats.h,1.5,1.6
Message-ID: 

Update of /cvsroot/datatype/common/util/pub
In directory cvs:/tmp/cvs-serv11395/common/util/pub

Modified Files:
	rendstats.h 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:22 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:03 2006
Subject: [Datatype-cvs] h261/renderer plugin.cpp,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/h261/renderer
In directory cvs:/tmp/cvs-serv11395/h261/renderer

Modified Files:
	plugin.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:22 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:03 2006
Subject: [Datatype-cvs] common/vidrend vidstats.cpp,1.9,1.10
Message-ID: 

Update of /cvsroot/datatype/common/vidrend
In directory cvs:/tmp/cvs-serv11395/common/vidrend

Modified Files:
	vidstats.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:23 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:04 2006
Subject: [Datatype-cvs] image/gif/renderer gifrdll.cpp,1.6,1.7
Message-ID: 

Update of /cvsroot/datatype/image/gif/renderer
In directory cvs:/tmp/cvs-serv11395/image/gif/renderer

Modified Files:
	gifrdll.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:23 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:04 2006
Subject: [Datatype-cvs] image/gif/fileformat pxgifff.cpp,1.8,1.9
Message-ID: 

Update of /cvsroot/datatype/image/gif/fileformat
In directory cvs:/tmp/cvs-serv11395/image/gif/fileformat

Modified Files:
	pxgifff.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:24 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:10 2006
Subject: [Datatype-cvs] image/realpix/fileformat/pub escrp.h, 1.3,
	1.4 shadvsrc.h, 1.3, 1.4
Message-ID: 

Update of /cvsroot/datatype/image/realpix/fileformat/pub
In directory cvs:/tmp/cvs-serv11395/image/realpix/fileformat/pub

Modified Files:
	escrp.h shadvsrc.h 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric





From ping at helixcommunity.org  Tue Feb  7 12:56:24 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:10 2006
Subject: [Datatype-cvs] image/png/renderer pngrdll.cpp,1.4,1.5
Message-ID: 

Update of /cvsroot/datatype/image/png/renderer
In directory cvs:/tmp/cvs-serv11395/image/png/renderer

Modified Files:
	pngrdll.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:23 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:11 2006
Subject: [Datatype-cvs] image/jpg/fileformat jpegvsrc.cpp,1.4,1.5
Message-ID: 

Update of /cvsroot/datatype/image/jpg/fileformat
In directory cvs:/tmp/cvs-serv11395/image/jpg/fileformat

Modified Files:
	jpegvsrc.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:24 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:11 2006
Subject: [Datatype-cvs] image/realpix/fileformat filehdlr.cpp, 1.4,
	1.5 shadvsrc.cpp, 1.4, 1.5
Message-ID: 

Update of /cvsroot/datatype/image/realpix/fileformat
In directory cvs:/tmp/cvs-serv11395/image/realpix/fileformat

Modified Files:
	filehdlr.cpp shadvsrc.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric





From ping at helixcommunity.org  Tue Feb  7 12:56:24 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:11 2006
Subject: [Datatype-cvs] image/png/fileformat pxpngff.cpp,1.7,1.8
Message-ID: 

Update of /cvsroot/datatype/image/png/fileformat
In directory cvs:/tmp/cvs-serv11395/image/png/fileformat

Modified Files:
	pxpngff.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:25 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:12 2006
Subject: [Datatype-cvs] image/wbmp/fileformat wbmpffdll.cpp,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/image/wbmp/fileformat
In directory cvs:/tmp/cvs-serv11395/image/wbmp/fileformat

Modified Files:
	wbmpffdll.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:24 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:12 2006
Subject: [Datatype-cvs] image/jpg/renderer jpgrdll.cpp,1.5,1.6
Message-ID: 

Update of /cvsroot/datatype/image/jpg/renderer
In directory cvs:/tmp/cvs-serv11395/image/jpg/renderer

Modified Files:
	jpgrdll.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:26 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:13 2006
Subject: [Datatype-cvs] mjpeg/renderer guids.cpp,1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/mjpeg/renderer
In directory cvs:/tmp/cvs-serv11395/mjpeg/renderer

Modified Files:
	guids.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:27 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:13 2006
Subject: [Datatype-cvs] mp3/fileformat mp3ff.cpp,1.49,1.50
Message-ID: 

Update of /cvsroot/datatype/mp3/fileformat
In directory cvs:/tmp/cvs-serv11395/mp3/fileformat

Modified Files:
	mp3ff.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From ping at helixcommunity.org  Tue Feb  7 12:56:25 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Tue Feb  7 15:11:13 2006
Subject: [Datatype-cvs] image/wbmp/renderer wbmprenddll.cpp,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/image/wbmp/renderer
In directory cvs:/tmp/cvs-serv11395/image/wbmp/renderer

Modified Files:
	wbmprenddll.cpp 
Log Message:
CHXBuffer implements IHXBuffer and is creatable from the common class factory. Unfortunately, there are many places in our code where IHXBuffer* is instantiated via "new CHXBuffer" instead of being created from CCF.

Same goes to the CHXFragmentedBuffer.

This diff focus on common, diff in rest of modules simply reflect the changes in common:
1. Created CreateFragmentedBufferCCF() utility function in pckunpck.cpp 2. Create IHXBuffer2, it defines a new flavor of Set() which takes HXBOOL bOwnBuffer.
3. Created a variation of CreateAndSetBufferCCF()in pckunpck.cpp which takes additional paramter(HXBOOL bOwnBuffer) and internally calls the IHXBuffer2 4. Modified several objects' constructor to take IUnknown* pContext 5. Rest of changes are just replacing new CHXBuffer/CHXFragmentedBuffer with CreateBufferCCF/CreateAndSetBufferCCF/CreateFragmentedBufferCCF which create them from the CCF.

CR by Eric




From nhunshyal at helixcommunity.org  Wed Feb  8 15:32:57 2006
From: nhunshyal at helixcommunity.org (nhunshyal@helixcommunity.org)
Date: Wed Feb  8 17:46:47 2006
Subject: [Datatype-cvs] mp3/common mp3format.cpp,1.11,1.12
Message-ID: 

Update of /cvsroot/datatype/mp3/common
In directory cvs:/tmp/cvs-serv26185

Modified Files:
	mp3format.cpp 
Log Message:

Synopsis
========
Media General: Server crashes when reading particular mp3 file

Fix for: Bug #153762

Branches: SERVER_9_0_GOLD, SERVER_11_1_RN, HEAD

Suggested Reviewers: Jamie Gordon, Sujeet Kharkar.


Description
===========
Media General: Server crashes when reading particular mp3 file

Helix Server 9 & 11, were crashing while trying to play the bad mp3 file from real player client. In function ReformatMP3Frame of file mp3format.cpp, while calculating the next frames data offset, the offset was coming too big which points to previous frames data. So, while calculating the current frame size from this offset, it was giving a negative value. 
Note: This negative value was coming due to bad mp3 file.
 
Solution: During the calculation of the frame size if the frame size is negative then we will return zero and the frame is skipped. After skipping the frame, rest of the file will be played as usual.

Files Affected
==============
for 9 branch:
rmp3lib/mp3format.cpp

for 11 branch:
datatype/mp3/common/mp3format.cpp

Testing Performed
=================
Unit Tests: Line coverage testing done
Integration Tests: I played bad mp3 and correct mp3 file from the real player client accessing the Helix server.
Leak Tests: n/a
Performance Tests: n/a

Platform tested: win32-i386-vc7, sunos-5.9-sparc-server, linux-rhel4-i686, sunos-5.8-sparc-server
Build Verified: win32-i386-vc7, sunos-5.9-sparc-server, linux-rhel4-i686, sunos-5.8-sparc-server

QA Hints
========
Need to test the mp3 related test cases for Helix Server.



Index: mp3format.cpp
===================================================================
RCS file: /cvsroot/datatype/mp3/common/mp3format.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- mp3format.cpp	4 Apr 2005 18:30:23 -0000	1.11
+++ mp3format.cpp	8 Feb 2006 23:32:54 -0000	1.12
@@ -287,6 +287,10 @@
     // Calculate the new frame size
     nFrameSize = (pNextFrame - nDataOffset2) -
                  *ppFrame;
+    if ( nFrameSize < 0)
+    {
+        return 0;
+    }
     return nFrameSize * bAcceptFrame;
 
 }


From nhunshyal at helixcommunity.org  Wed Feb  8 15:34:55 2006
From: nhunshyal at helixcommunity.org (nhunshyal@helixcommunity.org)
Date: Wed Feb  8 17:48:47 2006
Subject: [Datatype-cvs] mp3/common mp3format.cpp,1.8,1.8.22.1
Message-ID: 

Update of /cvsroot/datatype/mp3/common
In directory cvs:/tmp/cvs-serv26401

Modified Files:
      Tag: SERVER_11_1
	mp3format.cpp 
Log Message:

Synopsis
========
Media General: Server crashes when reading particular mp3 file

Fix for: Bug #153762

Branches: SERVER_9_0_GOLD, SERVER_11_1_RN, HEAD

Suggested Reviewers: Jamie Gordon, Sujeet Kharkar.


Description
===========
Media General: Server crashes when reading particular mp3 file

Helix Server 9 & 11, were crashing while trying to play the bad mp3 file from real player client. In function ReformatMP3Frame of file mp3format.cpp, while calculating the next frames data offset, the offset was coming too big which points to previous frames data. So, while calculating the current frame size from this offset, it was giving a negative value. 
Note: This negative value was coming due to bad mp3 file.
 
Solution: During the calculation of the frame size if the frame size is negative then we will return zero and the frame is skipped. After skipping the frame, rest of the file will be played as usual.

Files Affected
==============
for 9 branch:
rmp3lib/mp3format.cpp

for 11 branch:
datatype/mp3/common/mp3format.cpp

Testing Performed
=================
Unit Tests: Line coverage testing done
Integration Tests: I played bad mp3 and correct mp3 file from the real player client accessing the Helix server.
Leak Tests: n/a
Performance Tests: n/a

Platform tested: win32-i386-vc7, sunos-5.9-sparc-server, linux-rhel4-i686, sunos-5.8-sparc-server
Build Verified: win32-i386-vc7, sunos-5.9-sparc-server, linux-rhel4-i686, sunos-5.8-sparc-server

QA Hints
========
Need to test the mp3 related test cases for Helix Server.



Index: mp3format.cpp
===================================================================
RCS file: /cvsroot/datatype/mp3/common/mp3format.cpp,v
retrieving revision 1.8
retrieving revision 1.8.22.1
diff -u -d -r1.8 -r1.8.22.1
--- mp3format.cpp	2 Nov 2004 22:53:05 -0000	1.8
+++ mp3format.cpp	8 Feb 2006 23:34:53 -0000	1.8.22.1
@@ -287,6 +287,10 @@
     // Calculate the new frame size
     nFrameSize = (pNextFrame - nDataOffset2) -
                  *ppFrame;
+    if ( nFrameSize < 0)
+    {
+        return 0;
+    }
     return nFrameSize * bAcceptFrame;
 
 }


From ping at helixcommunity.org  Wed Feb  8 17:52:56 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Wed Feb  8 20:06:46 2006
Subject: [Datatype-cvs] smil/renderer/smil1 smlparse.cpp,1.13,1.14
Message-ID: 

Update of /cvsroot/datatype/smil/renderer/smil1
In directory cvs:/tmp/cvs-serv1312

Modified Files:
	smlparse.cpp 
Log Message:
fixed build buster



Index: smlparse.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/renderer/smil1/smlparse.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- smlparse.cpp	31 Jan 2006 23:38:23 -0000	1.13
+++ smlparse.cpp	9 Feb 2006 01:52:54 -0000	1.14
@@ -2662,7 +2662,7 @@
 CSmil1Parser::systemComponentFailed(IHXBuffer* pRequiredValue)
 {
     HXBOOL bFailed = TRUE;
-    IHXUpgradeCollection* pUpgradeCollection = new HXUpgradeCollection;
+    IHXUpgradeCollection* pUpgradeCollection = new HXUpgradeCollection(m_pContext);
     pUpgradeCollection->AddRef();
 
     pUpgradeCollection->Add(eUT_Required, pRequiredValue, 0, 0);


From ehyche at helixcommunity.org  Thu Feb  9 09:07:46 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 11:21:27 2006
Subject: [Datatype-cvs] asf/fileformat asf_file_format_guids.cpp,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/asf/fileformat
In directory cvs:/tmp/cvs-serv1253

Modified Files:
	asf_file_format_guids.cpp 
Log Message:
Add fragmented buffer GUID.


Index: asf_file_format_guids.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/fileformat/asf_file_format_guids.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- asf_file_format_guids.cpp	3 Feb 2006 22:16:10 -0000	1.3
+++ asf_file_format_guids.cpp	9 Feb 2006 17:07:43 -0000	1.4
@@ -46,6 +46,7 @@
 #include "ihxpckts.h"
 #include "hxcore.h"
 #include "hxasm.h"
+#include "ihxfgbuf.h"
 #include "ihxtlogsystem.h"
 #include "ihxtlogsystemcontext.h"
 #include "hxdllaccess.h"


From ehyche at helixcommunity.org  Thu Feb  9 09:08:13 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 11:21:52 2006
Subject: [Datatype-cvs] asf/audio/renderer wmarender_guids.cpp,1.2,1.3
Message-ID: 

Update of /cvsroot/datatype/asf/audio/renderer
In directory cvs:/tmp/cvs-serv1797

Modified Files:
	wmarender_guids.cpp 
Log Message:
Add fragmented buffer GUID.


Index: wmarender_guids.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/audio/renderer/wmarender_guids.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- wmarender_guids.cpp	27 Jan 2006 20:49:08 -0000	1.2
+++ wmarender_guids.cpp	9 Feb 2006 17:08:10 -0000	1.3
@@ -52,6 +52,7 @@
 #include "hxerror.h"
 #include "hxwin.h"
 #include "hxthread.h"
+#include "ihxfgbuf.h"
 #include "hxmon.h"
 #include "hxformt.h"
 #include "hxacodec.h"


From ehyche at helixcommunity.org  Thu Feb  9 09:08:49 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 11:22:30 2006
Subject: [Datatype-cvs] asf/audio/codec/wma9 wma9_decoder_guids.cpp,1.1,1.2
Message-ID: 

Update of /cvsroot/datatype/asf/audio/codec/wma9
In directory cvs:/tmp/cvs-serv2429

Modified Files:
	wma9_decoder_guids.cpp 
Log Message:
Add fragmented buffer GUID.


Index: wma9_decoder_guids.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/audio/codec/wma9/wma9_decoder_guids.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wma9_decoder_guids.cpp	27 Jan 2006 20:48:18 -0000	1.1
+++ wma9_decoder_guids.cpp	9 Feb 2006 17:08:47 -0000	1.2
@@ -40,6 +40,7 @@
 #include "hxacodec.h"
 #include "ihxtlogsystem.h"
 #include "ihxtlogsystemcontext.h"
+#include "ihxfgbuf.h"
 #include "hxdllaccess.h"
 #include "hxplgns.h"
 #include "hxplugn.h"


From ehyche at helixcommunity.org  Thu Feb  9 14:04:57 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:18:36 2006
Subject: [Datatype-cvs] asf/video/renderer/pub wmvdecoder.h, 1.1,
	1.2 wmvformat.h, 1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/asf/video/renderer/pub
In directory cvs:/tmp/cvs-serv24362/pub

Modified Files:
	wmvdecoder.h wmvformat.h 
Log Message:
Further updates to get building - not functional yet.


Index: wmvdecoder.h
===================================================================
RCS file: /cvsroot/datatype/asf/video/renderer/pub/wmvdecoder.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmvdecoder.h	7 Feb 2006 17:24:15 -0000	1.1
+++ wmvdecoder.h	9 Feb 2006 22:04:55 -0000	1.2
@@ -38,6 +38,7 @@
 
 // Includes
 #include "hxcodec.h"
+#include "hxvsurf.h"
 
 // Forward declarations
 class IHX20MemoryAllocator;
@@ -48,6 +49,37 @@
 
 #define HX_WMV_MAX_DECODE_QUALITY 100
 
+// Typedefs
+typedef struct _HXWM_MEDIA_TYPE
+{
+    GUID   m_guidMajorType;
+    GUID   m_guidSubType;
+    HXBOOL m_bFixedSizeSamples;
+    HXBOOL m_bTemporalCompression;
+    UINT32 m_ulSampleSize;
+    GUID   m_guidFormatType;
+    UINT32 m_ulDummy;
+    UINT32 m_ulFormatSize;
+    BYTE*  m_pFormat;
+} HXWM_MEDIA_TYPE;
+
+typedef struct _HXWMVIDEOINFOHEADER
+{
+    HXxRect            m_SourceRect;
+    HXxRect            m_TargetRect;
+    UINT32             m_ulBitRate;
+    UINT32             m_ulBitErrorRate;
+    UINT64             m_ullAvgTimePerFrame;
+    HXBitmapInfoHeader m_bmiHeader;
+} HXWMVIDEOINFOHEADER;
+
+typedef struct _HXWMGUID2FOURCC
+{
+    GUID   m_guid;
+    UINT32 m_ul4CC;
+}
+HXWMGUID2FOURCC;
+
 class CWMVideoDecoder
 {
 public:
@@ -58,8 +90,12 @@
     HX_RESULT Init(IUnknown*             pContext,
                    CWMVideoRenderer*     pVideoRenderer,
                    CWMVideoFormat*       pVideoFormat,
-                   HXxSize*              pSize,
+                   IHXBuffer*            pHeader,
+                   IHX20MemoryAllocator* pInputAllocator,
                    IHX20MemoryAllocator* pOutputAllocator);
+    HX_RESULT GetAvgBitRate(UINT32* pulBitRate);
+    HX_RESULT GetCodecNameString(IHXBuffer** ppBufStr);
+    HX_RESULT Open();
     HX_RESULT Decode(CMediaPacket* pFrameToDeocde, UINT32 ulQuality);
     HX_RESULT DecodeDone(HXCODEC_DATA* pData);
     HX_RESULT GetImageInfo(HX_MOF*& rpImageInfo);
@@ -73,20 +109,32 @@
     IUnknown*               m_pContext;
     CWMVideoRenderer*       m_pVideoRenderer;
     CWMVideoFormat*         m_pVideoFormat;
+    IHX20MemoryAllocator*   m_pInputAllocator;
     IHX20MemoryAllocator*   m_pOutputAllocator;
     CRADynamicCodecLibrary* m_pCodecLib;
+    IHXBuffer*              m_pInitBuffer;
+    HXWM_MEDIA_TYPE         m_MediaType;
+    HXWMVIDEOINFOHEADER     m_VideoInfoHeader;
     HXCODEC                 m_pCodec;
     HXSTREAM                m_pStream;
-    const char*             m_pCodecId;
     HX_MOFTAG               m_moftagOut;
     UINT32*                 m_pImageInfoBuffer;
     UINT32                  m_ulLastTimeStamp;
+    UINT32                  m_ulCodec4CC;
+    IHXBuffer*              m_pCodecNameStr;
+    HXBOOL                  m_bInitialized;
 
-    HX_RESULT                       OpenCodec(HX_MOFTAG pmofTag);
+    static const GUID            m_guidVideoInfo;
+    static const HXWMGUID2FOURCC m_guid2FourCC[];
+
+    HX_RESULT                       ParseInitBuffer(IHXBuffer* pBuffer);
+    HX_RESULT                       OpenCodec(UINT32 ulCodec4CC);
     HX_RESULT                       OpenStream(void);
     virtual CRADynamicCodecLibrary* CreateCodecLibrary();
     void                            SetCodecQuality(void);
     HX_RESULT                       GetQualityPreference(UINT16& rusQuality);
+    HX_RESULT                       GetCodec4CC(GUID* pSubTypeGUID, UINT32* pulCodec4CC);
+    HX_RESULT                       CreateCodecNameString(IUnknown* pContext, UINT32 ul4CC, IHXBuffer** ppStr);
 };
 
 #endif /* #ifndef WMVDECODER_H */

Index: wmvformat.h
===================================================================
RCS file: /cvsroot/datatype/asf/video/renderer/pub/wmvformat.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmvformat.h	7 Feb 2006 17:24:15 -0000	1.1
+++ wmvformat.h	9 Feb 2006 22:04:55 -0000	1.2
@@ -48,12 +48,12 @@
 class CMediaPacket;
 class CHXBufferMemoryAllocator;
 class CRingBuffer;
+class RuleToFlagMap;
 
 // Defines
 #define HX_WMV_DEFAULT_PIXEL_SIZE         12
 #define HX_WMV_DEFAULT_PIXEL_FORMAT  HX_I420
 
-
 class CWMVideoFormat : public CVideoFormat
 {
 public:
@@ -76,28 +76,34 @@
     virtual ULONG32   GetMaxDecodedFramesInStep(void);
 
     // CWMVideoFormat methods
-    HX_RESULT           DecodeDone(HXCODEC_DATA* pData);
-    virtual const char* GetCodecId(void);
-    UINT32              GetBitstreamHeaderSize(void);
-    const BYTE*         GetBitstreamHeader(void);
+    HX_RESULT DecodeDone(HXCODEC_DATA* pData);
 protected:
-    CWMVideoDecoder*          m_pDecoder;
+    IUnknown*                 m_pContext;
     CWMVideoRenderer*         m_pWMVideoRenderer;
+    CHXBufferMemoryAllocator* m_pInputAllocator;
     CRingBuffer*              m_pDecodedRingBuffer;
-    UINT32                    m_ulMaxDecodedFrames;
+    UINT32                    m_ulNumSubStreams;
+    UINT32                    m_ulActiveSubStreamIndex;
+    UINT16                    m_usNumRules;
+    RuleToFlagMap*            m_pRuleToSubStreamMap;
+    RuleToFlagMap*            m_pRuleToFlagMap;
+    CWMVideoDecoder**         m_ppWMVideoDecoder;
     HXxSize                   m_MediaSize;
+    UINT32                    m_ulMaxDecodedFrames;
     UINT32                    m_ulWidthContainedInSegment;
     UINT32                    m_ulHeightContainedInSegment;
     HXBitmapInfoHeader*       m_pCodecOutputBitmapInfoHeader;
     HXBOOL                    m_bFirstDecode;
     HXCODEC_DATA              m_DecodedPacket;
     HXxSize                   m_DecoderDimensions;
+    UINT16                    m_usSeqNum;
 
     // Overridden protected CVideoFormat methods
     virtual CMediaPacket* CreateAssembledPacket(IHXPacket* pPacket);
     virtual CMediaPacket* CreateDecodedPacket(CMediaPacket* pFrameToDecode);
 
     // CWMVideoFormat protected methods
+    void                     ClearDecoderArray(void);
     virtual CWMVideoDecoder* CreateDecoder();
     virtual void             ProcessAssembledFrame(CMediaPacket* pAssembledFrame) {};
     HX_RESULT                SetupOutputFormat(HX_MOF* pMof);
@@ -105,8 +111,11 @@
     void                     FlushDecodedRingBuffer(void);
     void                     _Reset(void);
     void                     ReleaseDecodedPacket(HXCODEC_DATA*& rpDecodedData);
+    HX_RESULT                GetInitialActiveSubStream(UINT32* pulInitialSubStreamIndex);
+    HX_RESULT                BuildRuleToFlagMap(IHXValues* pStreamHdr);
 
     static void KillWMVSampleDesc(void* pSampleDesc, void* pUserData);
+    static void KillWMVInputBuffer(void* pBuffer, void* pUserData);
     static void KillWMVOutputBuffer(void* pBuffer, void* pUserData);
 };
 


From ehyche at helixcommunity.org  Thu Feb  9 14:04:57 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:18:36 2006
Subject: [Datatype-cvs] asf/video/renderer wmvdecoder.cpp, 1.1,
	1.2 wmvformat.cpp, 1.1, 1.2 wmvrender_guids.cpp, 1.1,
	1.2 wmvrenderdll, 1.1, 1.2 wmvrenderlib, 1.1, 1.2
Message-ID: 

Update of /cvsroot/datatype/asf/video/renderer
In directory cvs:/tmp/cvs-serv24362

Modified Files:
	wmvdecoder.cpp wmvformat.cpp wmvrender_guids.cpp wmvrenderdll 
	wmvrenderlib 
Log Message:
Further updates to get building - not functional yet.


Index: wmvrender_guids.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/video/renderer/wmvrender_guids.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmvrender_guids.cpp	7 Feb 2006 17:24:13 -0000	1.1
+++ wmvrender_guids.cpp	9 Feb 2006 22:04:54 -0000	1.2
@@ -47,6 +47,7 @@
 #include "hxmon.h"
 #include "hxrendr.h"
 #include "hxasm.h"
+#include "ihxfgbuf.h"
 #include "hxvsurf.h"
 #include "hxpcmkr.h"
 #include "hxwin.h"

Index: wmvrenderlib
===================================================================
RCS file: /cvsroot/datatype/asf/video/renderer/wmvrenderlib,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmvrenderlib	7 Feb 2006 17:24:13 -0000	1.1
+++ wmvrenderlib	9 Feb 2006 22:04:54 -0000	1.2
@@ -53,7 +53,8 @@
                           "datatype/rm/video/common/pub",
                           "datatype/common/container/pub",
                           "datatype/common/util/pub",
-                          "datatype/common/vidrend/pub")
+                          "datatype/common/vidrend/pub",
+                          "datatype/asf/common/pub")
 
 project.AddSources("wmvrender.cpp",
                    "wmvformat.cpp",

Index: wmvformat.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/video/renderer/wmvformat.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmvformat.cpp	7 Feb 2006 17:24:13 -0000	1.1
+++ wmvformat.cpp	9 Feb 2006 22:04:54 -0000	1.2
@@ -45,6 +45,8 @@
 #include "hxtick.h"
 #include "hxcodec.h"
 #include "hxtlogutil.h"
+#include "rule2flg.h"
+#include "parse_opaque.h"
 #include "wmvdecoder.h"
 #include "wmvrender.h"
 #include "wmvformat.h"
@@ -73,14 +75,22 @@
                                HXBOOL                 bSecure)
     : CVideoFormat(pCommonClassFactory, pWMVideoRenderer)
 {
-    m_pDecoder                     = NULL;
     m_pWMVideoRenderer             = pWMVideoRenderer;
+    m_pInputAllocator              = NULL;
+    m_ppWMVideoDecoder             = NULL;
     m_pDecodedRingBuffer           = NULL;
+    m_ulNumSubStreams              = 0;
+    m_ulActiveSubStreamIndex       = 0;
+    m_usNumRules                   = 0;
+    m_pRuleToSubStreamMap          = NULL;
+    m_pRuleToFlagMap               = NULL;
     m_ulMaxDecodedFrames           = 0;
     m_ulWidthContainedInSegment    = 0;
     m_ulHeightContainedInSegment   = 0;
     m_pCodecOutputBitmapInfoHeader = NULL;
     m_bFirstDecode                 = TRUE;
+    m_usSeqNum                     = 0;
+    m_pContext                     = NULL;
     // Sanity check
     HX_ASSERT(m_pCommonClassFactory);
     HX_ASSERT(m_pWMVideoRenderer);
@@ -88,8 +98,21 @@
     memset(&m_MediaSize, 0, sizeof(HXxSize));
     memset(&m_DecoderDimensions, 0, sizeof(HXxSize));
     memset(&m_DecodedPacket, 0, sizeof(HXCODEC_DATA));
-    // Put a ref on the video renderer
-    HX_ADDREF(m_pWMVideoRenderer);
+    if (m_pWMVideoRenderer)
+    {
+        // Put a ref on the renderer
+        m_pWMVideoRenderer->AddRef();
+        // Get the context from the renderer
+        // XXXMEH - this method violates COM conventions
+        // since it does not AddRef() context before returning
+        // it, so we have to AddRef() it. When we fix GetContext(),
+        // remember to remove this ref.
+        m_pContext = m_pWMVideoRenderer->GetContext();
+        if (m_pContext)
+        {
+            m_pContext->AddRef();
+        }
+    }
 }
 
 CWMVideoFormat::~CWMVideoFormat()
@@ -103,63 +126,136 @@
     HX_RESULT retVal = CVideoFormat::Init(pHeader);
     if (SUCCEEDED(retVal))
     {
-        // Set the return value
-        retVal = HXR_OUTOFMEMORY;
-        // Create the ring buffer to hold decoded frames
-        HX_DELETE(m_pDecodedRingBuffer);
-        m_pDecodedRingBuffer = new CRingBuffer(HX_WMV_DECODE_CALLBACK_RNGBUF_SIZE);
-        if (m_pFramePool && m_pDecodedRingBuffer)
+        // Get the opaque data
+        IHXBuffer* pOpaqueData = NULL;
+        retVal = pHeader->GetPropertyBuffer("OpaqueData", pOpaqueData);
+        if (SUCCEEDED(retVal))
         {
-            // Create memory allocators
-            retVal = CreateAllocators();
+            // Parse the opaque data.
+            HXWMOpaqueDataInfo cInfo = {0, NULL, NULL};
+            retVal = ParseWMOpaqueData((IUnknown*) m_pCommonClassFactory,
+                                       pOpaqueData, &cInfo);
             if (SUCCEEDED(retVal))
             {
+                // Assign the number of substreams
+                m_ulNumSubStreams = cInfo.m_ulNumSubStreams;
+                // Initialize the active substream to the number
+                // of substreams - an illegal value. We will pick
+                // the initial substream later once we initialize
+                // the decoders.
+                m_ulActiveSubStreamIndex = m_ulNumSubStreams;
+                // Save the rule to substream index map
+                HX_DELETE(m_pRuleToSubStreamMap);
+                m_pRuleToSubStreamMap = cInfo.m_pRuleToSubStreamMap;
+                // Null the pointer out in the HXWMOpaqueDataInfo so
+                // the object won't get deleted when we call
+                // ClearWMOpaqueDataInfo() below.
+                cInfo.m_pRuleToSubStreamMap = NULL;
                 // Set the return value
                 retVal = HXR_OUTOFMEMORY;
-                // Create the CWMVideoDecoder object
-                HX_DELETE(m_pDecoder);
-                m_pDecoder = CreateDecoder();
-                if (m_pDecoder)
+                // Create the ring buffer to hold decoded frames
+                HX_DELETE(m_pDecodedRingBuffer);
+                m_pDecodedRingBuffer = new CRingBuffer(HX_WMV_DECODE_CALLBACK_RNGBUF_SIZE);
+                if (m_pFramePool && m_pDecodedRingBuffer)
                 {
-                    // Get the output allocator from the renderer
-                    CHXMemoryAllocator* pAlloc = NULL;
-                    retVal = m_pWMVideoRenderer->GetOutputAllocator(&pAlloc);
+                    // Create memory allocators
+                    retVal = CreateAllocators();
                     if (SUCCEEDED(retVal))
                     {
-                        // Init the decoder
-                        retVal = m_pDecoder->Init(m_pWMVideoRenderer->GetContext(),
-                                                  m_pWMVideoRenderer,
-                                                  this,
-                                                  NULL,
-                                                  pAlloc);
-                        if (SUCCEEDED(retVal))
+                        // Set the return value
+                        retVal = HXR_OUTOFMEMORY;
+                        // Create the array of decoders
+                        ClearDecoderArray();
+                        m_ppWMVideoDecoder = new CWMVideoDecoder* [m_ulNumSubStreams];
+                        if (m_ppWMVideoDecoder)
                         {
-                            // Get the decoder format info
-                            HX_MOF* pImageInfo = NULL;
-                            retVal = m_pDecoder->GetImageInfo(pImageInfo);
+                            // NULL out the array
+                            memset(m_ppWMVideoDecoder, 0, sizeof(CWMVideoDecoder*) * m_ulNumSubStreams);
+                            // Get the output allocator from the renderer
+                            CHXMemoryAllocator* pOutputAlloc = NULL;
+                            retVal = m_pWMVideoRenderer->GetOutputAllocator(&pOutputAlloc);
                             if (SUCCEEDED(retVal))
                             {
-                                // Set the output format
-                                retVal = SetupOutputFormat(pImageInfo);
+                                // Now loop through each decoder, creating and initializing it
+                                for (UINT32 i = 0; i < m_ulNumSubStreams && SUCCEEDED(retVal); i++)
+                                {
+                                    m_ppWMVideoDecoder[i] = CreateDecoder();
+                                    if (m_ppWMVideoDecoder[i])
+                                    {
+                                        // Initialize the decoder. This does not
+                                        // yet load the codec dll
+                                        retVal = m_ppWMVideoDecoder[i]->Init(m_pContext,
+                                                                             m_pWMVideoRenderer,
+                                                                             this,
+                                                                             cInfo.m_ppSubStreamHdr[i],
+                                                                             m_pInputAllocator,
+                                                                             pOutputAlloc);
+                                        if (SUCCEEDED(retVal))
+                                        {
+                                            // Open the decoder
+                                            // XXXMEH - later for optimization, we may want to
+                                            // delay the opening of the codec until we actually need it.
+                                            retVal = m_ppWMVideoDecoder[i]->Open();
+                                        }
+                                    }
+                                    else
+                                    {
+                                        retVal = HXR_OUTOFMEMORY;
+                                    }
+                                }
                                 if (SUCCEEDED(retVal))
                                 {
-                                    // If we have a valid frame size, resize the view frame
-                                    if (m_MediaSize.cx && m_MediaSize.cy)
+                                    // Now that we've initialized all the decoders, choose
+                                    // the initial active substream
+                                    retVal = GetInitialActiveSubStream(&m_ulActiveSubStreamIndex);
+                                    if (SUCCEEDED(retVal))
                                     {
-                                        m_pWMVideoRenderer->ResizeViewFrame(m_MediaSize);
+                                        // Set up the rule->flag map
+                                        retVal = BuildRuleToFlagMap(pHeader);
+                                        if (SUCCEEDED(retVal))
+                                        {
+                                            // Set the return value
+                                            retVal = HXR_FAIL;
+                                            // Sanity Check to make sure rule->flag and rule->substream maps
+                                            // have same number of rules
+                                            if (m_pRuleToFlagMap->num_rules == m_pRuleToSubStreamMap->num_rules)
+                                            {
+                                                // Save the number of rule
+                                                m_usNumRules = m_pRuleToFlagMap->num_rules;
+                                                // Get the decoder format info
+                                                HX_MOF* pImageInfo = NULL;
+                                                retVal = m_ppWMVideoDecoder[m_ulActiveSubStreamIndex]->GetImageInfo(pImageInfo);
+                                                if (SUCCEEDED(retVal))
+                                                {
+                                                    // Set the output format
+                                                    retVal = SetupOutputFormat(pImageInfo);
+                                                    if (SUCCEEDED(retVal))
+                                                    {
+                                                        // If we have a valid frame size, resize the view frame
+                                                        if (m_MediaSize.cx && m_MediaSize.cy)
+                                                        {
+                                                            m_pWMVideoRenderer->ResizeViewFrame(m_MediaSize);
+                                                        }
+                                                        // Get the max decoded frames
+                                                        m_ulMaxDecodedFrames = GetDecodedFrameQueueCapacity();
+                                                        // Set the first decode flag
+                                                        m_bFirstDecode = TRUE;
+                                                    }
+                                                }
+                                            }
+                                        }
                                     }
-                                    // Get the max decoded frames
-                                    m_ulMaxDecodedFrames = GetDecodedFrameQueueCapacity();
-                                    // Set the first decode flag
-                                    m_bFirstDecode = TRUE;
                                 }
                             }
+                            HX_RELEASE(pOutputAlloc);
                         }
                     }
-                    HX_RELEASE(pAlloc);
                 }
             }
+            // Clear the opaque data info struct
+            ClearWMOpaqueDataInfo(&cInfo);
         }
+        HX_RELEASE(pOpaqueData);
     }
 
     return retVal;
@@ -188,11 +284,17 @@
 
     FlushDecodedRingBuffer();
     HX_DELETE(m_pDecodedRingBuffer);
-    HX_DELETE(m_pDecoder);
+    ClearDecoderArray();
 
     _Reset();
 
+    HX_DELETE(m_pInputAllocator);
     HX_DELETE(m_pCodecOutputBitmapInfoHeader);
+    HX_DELETE(m_pRuleToSubStreamMap);
+    HX_DELETE(m_pRuleToFlagMap);
+    HX_RELEASE(m_pContext);
+    m_usNumRules         = 0;
+    m_ulMaxDecodedFrames = 0;
 }
 
 HX_RESULT CWMVideoFormat::InitBitmapInfoHeader(HXBitmapInfoHeader& rBitmapInfoHeader,
@@ -306,51 +408,97 @@
     return retVal;
 }
 
-const char* CWMVideoFormat::GetCodecId(void)
-{
-    const char* pszRet = NULL;
-
-    return pszRet;
-}
-
-ULONG32 CWMVideoFormat::GetBitstreamHeaderSize(void)
-{
-    return 0;
-}
-
-const BYTE* CWMVideoFormat::GetBitstreamHeader(void)
-{
-    return NULL;
-}
-
 CMediaPacket* CWMVideoFormat::CreateAssembledPacket(IHXPacket* pPacket)
 {
     CMediaPacket* pRet = NULL;
 
-    if (pPacket)
+    if (pPacket && m_pInputAllocator)
     {
-        IHXBuffer* pBuffer = pPacket->GetBuffer();
-        if (pBuffer)
+        if (!pPacket->IsLost())
         {
-            UINT32 ulFlags = MDPCKT_USES_IHXBUFFER_FLAG;
-            pRet = new CMediaPacket(pBuffer,
-                                    (UINT8*) pBuffer->GetBuffer(),
-                                    pBuffer->GetSize(),
-                                    pBuffer->GetSize(),
-                                    pPacket->GetTime(),
-                                    ulFlags,
-                                    NULL);
-            if (pRet)
+            IHXBuffer* pBuffer = pPacket->GetBuffer();
+            if (pBuffer)
             {
-                pRet->m_pUserData = this;
+                // Create an HXCODEC_DATA struct
+                UINT32  ulSize  = sizeof(HXCODEC_DATA) / 4 + 1;
+                UINT32* pulData = new UINT32[ulSize];
+                if (pulData)
+                {
+                    // Null out the data
+                    memset(pulData, 0, sizeof(UINT32) * ulSize);
+                    // Fill in the HXCODEC_DATA struct
+                    HXCODEC_DATA* pCodecData = (HXCODEC_DATA*) pulData;
+                    pCodecData->dataLength  = pBuffer->GetSize();
+                    pCodecData->timestamp   = pPacket->GetTime();
+                    pCodecData->sequenceNum = m_usSeqNum;
+                    pCodecData->flags       = 0;
+                    pCodecData->lastPacket  = FALSE;
+                    pCodecData->numSegments = 1;
+                    // Get a buffer from the input allocator
+                    IHXUnknown*    pDummy = NULL;
+                    HX20ALLOCPROPS allocRequest;
+                    HX20ALLOCPROPS allocActual;
+                    allocRequest.uBufferSize = pCodecData->dataLength;
+                    allocRequest.nNumBuffers = 0;
+                    m_pInputAllocator->SetProperties(&allocRequest, &allocActual);
+                    pCodecData->data = m_pInputAllocator->GetPacketBuffer(&pDummy);
+                    if (pCodecData->data)
+                    {
+                        // Copy the packet buffer into the HXCODEC_DATA data field
+                        memcpy(pCodecData->data, pBuffer->GetBuffer(), pBuffer->GetSize());
+                        // Now create the CMediaPacket object
+                        pRet = new CMediaPacket(pCodecData,
+                                                (UINT8*) pCodecData, 
+                                                pCodecData->dataLength,
+                                                pCodecData->dataLength,
+                                                pCodecData->timestamp,
+                                                pCodecData->flags,
+                                                NULL);
+                        if (pRet)
+                        {
+                            // Set the user data
+                            pRet->m_pUserData = this;
+                            // Set the function pointer to delete the HXCODEC_DATA
+                            pRet->SetBufferKiller(KillWMVInputBuffer);
+                        }
+                        else
+                        {
+                            // Delete the HXCODEC_DATA
+                            KillWMVInputBuffer(pCodecData, this);
+                        }
+                    }
+                }
             }
+            HX_RELEASE(pBuffer);
+        }
+        else
+        {
+            // This packet was lost, so just increment the sequence number
+            m_usSeqNum++;
         }
-        HX_RELEASE(pBuffer);
     }
 
     return pRet;
 }
 
+void CWMVideoFormat::ClearDecoderArray(void)
+{
+    if (m_ppWMVideoDecoder && m_ulNumSubStreams)
+    {
+        for (UINT32 i = 0; i < m_ulNumSubStreams; i++)
+        {
+            if (m_ppWMVideoDecoder[i])
+            {
+                m_ppWMVideoDecoder[i]->Close();
+            }
+            HX_DELETE(m_ppWMVideoDecoder[i]);
+        }
+        HX_VECTOR_DELETE(m_ppWMVideoDecoder);
+        m_ulNumSubStreams        = 0;
+        m_ulActiveSubStreamIndex = 0;
+    }
+}
+
 CMediaPacket* CWMVideoFormat::CreateDecodedPacket(CMediaPacket* pFrameToDecode)
 {
     CMediaPacket* pDecodedFrame        = NULL;
@@ -397,7 +545,7 @@
         {
             ProcessAssembledFrame(pFrameToDecode);
             // Decode the frame. This will call back to DecodeDone().
-            status = m_pDecoder->Decode(pFrameToDecode, HX_WMV_MAX_DECODE_QUALITY);
+            status = m_ppWMVideoDecoder[m_ulActiveSubStreamIndex]->Decode(pFrameToDecode, HX_WMV_MAX_DECODE_QUALITY);
             // Set the flag saying we processed an input frame
             bInputFrameProcessed = TRUE;
             // Check the error return
@@ -425,7 +573,7 @@
             if (m_MediaSize.cx == 0) 
             {
                 HX_MOF* pImageInfo = NULL;
-                HX_RESULT rv = m_pDecoder->GetImageInfo(pImageInfo);
+                HX_RESULT rv = m_ppWMVideoDecoder[m_ulActiveSubStreamIndex]->GetImageInfo(pImageInfo);
                 if (SUCCEEDED(rv))
                 {
                     status = SetupOutputFormat(pImageInfo);
@@ -576,33 +724,45 @@
 {
     HX_RESULT retVal = HXR_OUTOFMEMORY;
 
-    // Create a CHXMemoryAllocator object
-    CHXMemoryAllocator* pAlloc = new CHXMemoryAllocator(TRUE);
-    if (pAlloc)
+    // Create the input allocator
+    HX_RELEASE(m_pInputAllocator);
+    m_pInputAllocator = new CHXBufferMemoryAllocator(TRUE);
+    if (m_pInputAllocator)
     {
-        // AddRef our local copy
-        pAlloc->AddRef();
-        // Get the alloc properties
+        // Put our ref on the input allocator
+        m_pInputAllocator->AddRef();
+        // Set up the input allocator
         HX20ALLOCPROPS allocRequest;
         HX20ALLOCPROPS allocActual;
-        pAlloc->GetProperties(&allocRequest);
-        // Allocate sufficient number of buffers to retain 
-        // (does not hur to overallocateas memory is not spent - this is a
-        //  only a container):
-        // 1 for active frame (displayed)
-        // 1 for frame in transit
-        // 3 for frames retained by codec
-        // 5 for frames upsampled by codec
-        // post decode queue depth * 2 (x2 to be on safe side)
-        // Note: it does not really hurt the memory consumption to set the
-        // allocator pooling high since the system is designed not to
-        // build the pool beyond what it needs.
-        allocRequest.nNumBuffers = 10 + GetMaxDecodedFrames() * 2;
-        pAlloc->SetProperties(&allocRequest, &allocActual);
-        // Set this allocator into the renderer
-        retVal = m_pWMVideoRenderer->SetOutputAllocator(pAlloc);
+        m_pInputAllocator->GetProperties(&allocRequest);
+        allocRequest.nNumBuffers = 0;   // No retention
+        m_pInputAllocator->SetProperties(&allocRequest, &allocActual);
+        // Create a CHXMemoryAllocator object
+        CHXMemoryAllocator* pAlloc = new CHXMemoryAllocator(TRUE);
+        if (pAlloc)
+        {
+            // AddRef our local copy
+            pAlloc->AddRef();
+            // Get the alloc properties
+            pAlloc->GetProperties(&allocRequest);
+            // Allocate sufficient number of buffers to retain 
+            // (does not hur to overallocateas memory is not spent - this is a
+            //  only a container):
+            // 1 for active frame (displayed)
+            // 1 for frame in transit
+            // 3 for frames retained by codec
+            // 5 for frames upsampled by codec
+            // post decode queue depth * 2 (x2 to be on safe side)
+            // Note: it does not really hurt the memory consumption to set the
+            // allocator pooling high since the system is designed not to
+            // build the pool beyond what it needs.
+            allocRequest.nNumBuffers = 10 + GetMaxDecodedFrames() * 2;
+            pAlloc->SetProperties(&allocRequest, &allocActual);
+            // Set this allocator into the renderer
+            retVal = m_pWMVideoRenderer->SetOutputAllocator(pAlloc);
+        }
+        HX_RELEASE(pAlloc);
     }
-    HX_RELEASE(pAlloc);
 
     return retVal;
 }
@@ -622,6 +782,7 @@
 void CWMVideoFormat::_Reset(void)
 {
     m_bFirstDecode               = TRUE;
+    m_usSeqNum                   = 0;
     m_ulWidthContainedInSegment  = 0;
     m_ulHeightContainedInSegment = 0;
     m_MediaSize.cx               = 0;
@@ -638,6 +799,89 @@
     }
 }
 
+HX_RESULT CWMVideoFormat::GetInitialActiveSubStream(UINT32* pulInitialSubStreamIndex)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pulInitialSubStreamIndex && m_ulNumSubStreams && m_ppWMVideoDecoder)
+    {
+        // Clear the return value
+        retVal = HXR_OK;
+        // Find the max bitrate over all the sub streams
+        UINT32 ulMaxAvgBitRate  = 0;
+        UINT32 ulSubStreamIndex = m_ulNumSubStreams;
+        for (UINT32 i = 0; i < m_ulNumSubStreams && SUCCEEDED(retVal); i++)
+        {
+            // Set the return value
+            retVal = HXR_FAIL;
+            // Sanity check
+            if (m_ppWMVideoDecoder[i])
+            {
+                // Get the average bitrate of this substream
+                UINT32 ulAvgBitRate = 0;
+                retVal = m_ppWMVideoDecoder[i]->GetAvgBitRate(&ulAvgBitRate);
+                if (SUCCEEDED(retVal))
+                {
+                    if (ulAvgBitRate > ulMaxAvgBitRate)
+                    {
+                        ulMaxAvgBitRate  = ulAvgBitRate;
+                        ulSubStreamIndex = i;
+                    }
+                }
+            }
+        }
+        if (SUCCEEDED(retVal))
+        {
+            // Set the return value
+            retVal = HXR_FAIL;
+            // Sanity check
+            if (ulSubStreamIndex < m_ulNumSubStreams)
+            {
+                // Assign the out parameter
+                *pulInitialSubStreamIndex = ulSubStreamIndex;
+                // Clear the return value
+                retVal = HXR_OK;
+            }
+        }
+    }
+
+    return retVal;
+}
+
+HX_RESULT CWMVideoFormat::BuildRuleToFlagMap(IHXValues* pStreamHdr)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pStreamHdr)
+    {
+        // Get the "ASFFlags" buffer property
+        IHXBuffer* pFlagsBuf = NULL;
+        retVal = pStreamHdr->GetPropertyBuffer("ASFFlags", pFlagsBuf);
+        if (SUCCEEDED(retVal))
+        {
+            // Set the return value
+            retVal = HXR_FAIL;
+            // Allocate a RuleToFlagMap
+            HX_DELETE(m_pRuleToFlagMap);
+            m_pRuleToFlagMap = new RuleToFlagMap;
+            if (m_pRuleToFlagMap)
+            {
+                // Unpack the buffer
+                BYTE* pRet = m_pRuleToFlagMap->unpack(pFlagsBuf->GetBuffer(),
+                                                      pFlagsBuf->GetSize());
+                if (pRet)
+                {
+                    // Clear the return value
+                    retVal = HXR_OK;
+                }
+            }
+        }
+        HX_RELEASE(pFlagsBuf);
+    }
+
+    return retVal;
+}
+
 void CWMVideoFormat::KillWMVSampleDesc(void* pSampleDesc, void* pUserData)
 {
     if (pSampleDesc)
@@ -654,6 +898,26 @@
     }
 }
 
+void CWMVideoFormat::KillWMVInputBuffer(void* pBuffer, void* pUserData)
+{
+    if (pBuffer)
+    {
+        UINT32*         pUINT32Buf   = (UINT32*) pBuffer;
+        HXCODEC_DATA*   pCodecData   = (HXCODEC_DATA*) pBuffer;
+
+        if (pCodecData->data && pUserData)
+        {
+            CWMVideoFormat* pFormat = (CWMVideoFormat*) pUserData;
+            if (pFormat->m_pInputAllocator)
+            {
+                pFormat->m_pInputAllocator->ReleasePacketPtr(pCodecData->data);
+            }
+        }
+
+        HX_VECTOR_DELETE(pUINT32Buf);
+    }
+}
+
 void CWMVideoFormat::KillWMVOutputBuffer(void* pBuffer, void* pUserData)
 {
     if (pBuffer)

Index: wmvrenderdll
===================================================================
RCS file: /cvsroot/datatype/asf/video/renderer/wmvrenderdll,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmvrenderdll	7 Feb 2006 17:24:13 -0000	1.1
+++ wmvrenderdll	9 Feb 2006 22:04:54 -0000	1.2
@@ -58,6 +58,7 @@
                            "datatype/common/vidrend[vidrend]",
                            "datatype/common/util[dtutillib]",
                            "datatype/rm/common[rmcomlib]",
+                           "datatype/asf/common[asfcomlib]",
                            "datatype/asf/video/renderer[wmvrenderlib]")
 
 project.AddLibraries(GetSDKPath("rmvidcom_lib"))

Index: wmvdecoder.cpp
===================================================================
RCS file: /cvsroot/datatype/asf/video/renderer/wmvdecoder.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wmvdecoder.cpp	7 Feb 2006 17:24:13 -0000	1.1
+++ wmvdecoder.cpp	9 Feb 2006 22:04:54 -0000	1.2
@@ -48,6 +48,7 @@
 #include "hxformt.h"
 #include "hxprefs.h"
 #include "hxprefutil.h"
+#include "pckunpck.h"
 #include "codeclib.h"
 #include "wmvdecoder.h"
 #include "wmvformat.h"
@@ -60,20 +61,37 @@
 static const char HX_THIS_FILE[] = __FILE__;
 #endif
 
+const GUID CWMVideoDecoder::m_guidVideoInfo = {0x05589f80, 0xc356, 0x1ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
+const HXWMGUID2FOURCC CWMVideoDecoder::m_guid2FourCC[] =
+{
+    {{0x31564D57, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}}, 0x776D7639}, // WMV1 -> 'wmv9' (WM Video 9)
+    {{0x32564D57, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}}, 0x776D7639}, // WMV2 -> 'wmv9' (WM Video 9)
+    {{0x33564D57, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}}, 0x776D7639}, // WMV3 -> 'wmv9' (WM Video 9)
+    {{0x3153534D, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}}, 0x776D7673}, // MSS1 -> 'wmvs' (WM Video Screen)
+    {{0x3253534D, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}}, 0x776D7673}, // MSS2 -> 'wmvs' (WM Video Screen)
+    {{0x41564D57, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}}, 0x776D7661}, // WMVA -> 'wmva' (WM Video Advanced Profile)
+    {{0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, 0x00000000}  // Marks the end of the array
+};
 
 CWMVideoDecoder::CWMVideoDecoder()
 {
     m_pContext         = NULL;
     m_pVideoRenderer   = NULL;
     m_pVideoFormat     = NULL;
+    m_pInputAllocator  = NULL;
     m_pOutputAllocator = NULL;
     m_pCodecLib        = NULL;
+    m_pInitBuffer      = NULL;
     m_pCodec           = NULL;
     m_pStream          = NULL;
-    m_pCodecId         = NULL;
     m_moftagOut        = 0;
     m_pImageInfoBuffer = NULL;
     m_ulLastTimeStamp  = 0;
+    m_ulCodec4CC       = 0;
+    m_pCodecNameStr    = NULL;
+    m_bInitialized     = FALSE;
+    memset(&m_MediaType, 0, sizeof(HXWM_MEDIA_TYPE));
+    memset(&m_VideoInfoHeader, 0, sizeof(HXWMVIDEOINFOHEADER));
 }
 
 CWMVideoDecoder::~CWMVideoDecoder()
@@ -84,31 +102,98 @@
 HX_RESULT CWMVideoDecoder::Init(IUnknown*             pContext,
                                 CWMVideoRenderer*     pVideoRenderer,
                                 CWMVideoFormat*       pVideoFormat,
-                                HXxSize*              pSize,
+                                IHXBuffer*            pHeader,
+                                IHX20MemoryAllocator* pInputAllocator,
                                 IHX20MemoryAllocator* pOutputAllocator)
 {
     HX_RESULT retVal = HXR_FAIL;
 
-    if (pContext && pVideoFormat && pOutputAllocator)
+    if (pContext && pVideoRenderer && pVideoFormat &&
+        pHeader && pInputAllocator && pOutputAllocator)
     {
         // Save the context
         HX_RELEASE(m_pContext);
         m_pContext = pContext;
         m_pContext->AddRef();
-        // Save a pointer to the video renderer
+        // Save a pointer to the video renderer (no ref)
         m_pVideoRenderer = pVideoRenderer;
-        // Save a pointer to the video format
+        // Save a pointer to the video format (no ref)
         m_pVideoFormat = pVideoFormat;
-        // Get a pointer the codec id string from the video format
-        m_pCodecId = m_pVideoFormat->GetCodecId();
+        // Save the init buffer
+        HX_RELEASE(m_pInitBuffer);
+        m_pInitBuffer = pHeader;
+        m_pInitBuffer->AddRef();
+        // Save the input allocator
+        HX_RELEASE(m_pInputAllocator);
+        m_pInputAllocator = pInputAllocator;
+        m_pInputAllocator->AddRef();
         // Save the output allocator
+        HX_RELEASE(m_pOutputAllocator);
         m_pOutputAllocator = pOutputAllocator;
         m_pOutputAllocator->AddRef();
-        // Open the codec
-        retVal = OpenCodec(STRINGTOMOFTAG(m_pCodecId));
+        // Parse the codec init buffer
+        retVal = ParseInitBuffer(m_pInitBuffer);
         if (SUCCEEDED(retVal))
         {
-            // Open a stream
+            // Get the codec 4cc
+            retVal = GetCodec4CC(&m_MediaType.m_guidSubType, &m_ulCodec4CC);
+            if (SUCCEEDED(retVal))
+            {
+                // Create the codec string from the codec 4cc
+                HX_RELEASE(m_pCodecNameStr);
+                retVal = CreateCodecNameString(m_pContext, m_ulCodec4CC, &m_pCodecNameStr);
+                if (SUCCEEDED(retVal))
+                {
+                    // Set the initialized flag
+                    m_bInitialized = TRUE;
+                }
+            }
+        }
+    }
+
+    return retVal;
+}
+
+HX_RESULT CWMVideoDecoder::GetAvgBitRate(UINT32* pulBitRate)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pulBitRate && m_bInitialized)
+    {
+        *pulBitRate = m_VideoInfoHeader.m_ulBitRate;
+        retVal      = HXR_OK;
+    }
+
+    return retVal;
+}
+
+HX_RESULT CWMVideoDecoder::GetCodecNameString(IHXBuffer** ppBufStr)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (ppBufStr && m_pCodecNameStr)
+    {
+        // Place an additional ref on the buffer
+        m_pCodecNameStr->AddRef();
+        // Assign the out parameter
+        *ppBufStr = m_pCodecNameStr;
+        retVal    = HXR_OK;
+    }
+
+    return retVal;
+}
+
+HX_RESULT CWMVideoDecoder::Open()
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (m_bInitialized)
+    {
+        // Load the codec dll
+        retVal = OpenCodec(m_ulCodec4CC);
+        if (SUCCEEDED(retVal))
+        {
+            // Create a single stream
             retVal = OpenStream();
         }
     }
@@ -158,7 +243,7 @@
 {
     HX_RESULT retVal = HXR_FAIL;
 
-    if (m_pCodecLib)
+    if (m_pCodecLib && m_pStream)
     {
         UINT32 ulSize = 0;
         retVal = m_pCodecLib->PNStream_GetStreamHeaderSize(m_pStream, &ulSize);
@@ -167,7 +252,7 @@
             // Set the return value
             retVal = HXR_FAIL;
             // Allocate a image info buffer
-            HX_ASSERT((ulSize == sizeof(HX_FORMAT_IMAGE)) || (ulSize == sizeof(HX_FORMAT_IMAGE2)));
+            HX_ASSERT(ulSize == sizeof(HX_FORMAT_IMAGE) || ulSize == sizeof(HX_FORMAT_IMAGE2));
             UINT32* pMOFBuf = new UINT32 [ulSize / 4 + 1];
             if (pMOFBuf)
             {
@@ -203,8 +288,19 @@
     }
     HX_RELEASE(m_pContext);
     HX_DELETE(m_pCodecLib);
+    HX_RELEASE(m_pInitBuffer);
+    HX_RELEASE(m_pInputAllocator);
     HX_RELEASE(m_pOutputAllocator);
     HX_VECTOR_DELETE(m_pImageInfoBuffer);
+    HX_RELEASE(m_pCodecNameStr);
+    m_pVideoRenderer  = NULL;
+    m_pVideoFormat    = NULL;
+    m_ulLastTimeStamp = 0;
+    m_ulCodec4CC      = 0;
+    m_moftagOut       = 0;
+    m_bInitialized    = FALSE;
+    memset(&m_MediaType, 0, sizeof(HXWM_MEDIA_TYPE));
+    memset(&m_VideoInfoHeader, 0, sizeof(HXWMVIDEOINFOHEADER));
 
     return HXR_OK;
 }
@@ -222,7 +318,105 @@
     return retVal;
 }
 
-HX_RESULT CWMVideoDecoder::OpenCodec(HX_MOFTAG mofTag)
+HX_RESULT CWMVideoDecoder::ParseInitBuffer(IHXBuffer* pBuffer)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pBuffer)
+    {
+        // Unpack parts of the HXWM_MEDIA_TYPE struct
+        //
+        UINT32 ulTmp = 0;
+        BYTE*  pBuf  = pBuffer->GetBuffer();
+        UINT32 ulLen = pBuffer->GetSize();
+        // Unpack the majortype guid
+        UnpackUINT32LEInc(&pBuf, &ulLen, &m_MediaType.m_guidMajorType.Data1);
+        UnpackUINT16LEInc(&pBuf, &ulLen, &m_MediaType.m_guidMajorType.Data2);
+        UnpackUINT16LEInc(&pBuf, &ulLen, &m_MediaType.m_guidMajorType.Data3);
+        if (ulLen >= 8)
+        {
+            memcpy(m_MediaType.m_guidMajorType.Data4, pBuf, 8);
+            pBuf  += 8;
+            ulLen -= 8;
+            // Unpack the subtype guid
+            UnpackUINT32LEInc(&pBuf, &ulLen, &m_MediaType.m_guidSubType.Data1);
+            UnpackUINT16LEInc(&pBuf, &ulLen, &m_MediaType.m_guidSubType.Data2);
+            UnpackUINT16LEInc(&pBuf, &ulLen, &m_MediaType.m_guidSubType.Data3);
+            if (ulLen >= 8)
+            {
+                memcpy(m_MediaType.m_guidSubType.Data4, pBuf, 8);
+                pBuf  += 8;
+                ulLen -= 8;
+                // Unpack the rest of the HXWM_MEDIA_TYPE struct
+                UnpackUINT32LEInc(&pBuf, &ulLen, &ulTmp);
+                m_MediaType.m_bFixedSizeSamples = ulTmp;
+                UnpackUINT32LEInc(&pBuf, &ulLen, &ulTmp);
+                m_MediaType.m_bTemporalCompression = ulTmp;
+                UnpackUINT32LEInc(&pBuf, &ulLen, &m_MediaType.m_ulSampleSize);
+                // Unpack the formattype guid
+                UnpackUINT32LEInc(&pBuf, &ulLen, &m_MediaType.m_guidFormatType.Data1);
+                UnpackUINT16LEInc(&pBuf, &ulLen, &m_MediaType.m_guidFormatType.Data2);
+                UnpackUINT16LEInc(&pBuf, &ulLen, &m_MediaType.m_guidFormatType.Data3);
+                if (ulLen >= 8)
+                {
+                    memcpy(m_MediaType.m_guidFormatType.Data4, pBuf, 8);
+                    pBuf  += 8;
+                    ulLen -= 8;
+                    // Unpack the unused IUnknown pointer
+                    UINT32 ulDummy = 0;
+                    UnpackUINT32LEInc(&pBuf, &ulLen, &ulDummy);
+                    // Unpack the format size
+                    UnpackUINT32LEInc(&pBuf, &ulLen, &m_MediaType.m_ulFormatSize);
+                    // Unpack the unused pointer to the format data
+                    UnpackUINT32LEInc(&pBuf, &ulLen, &ulDummy);
+                    // Make sure we have the format type we are expecting
+                    if (IsEqualIID(m_MediaType.m_guidFormatType, m_guidVideoInfo))
+                    {
+                        // Unpack the HXWMVIDEOINFOHEADER struct
+                        //
+                        // Unpack the source rectangle
+                        UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_SourceRect.left);
+                        UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_SourceRect.top);
+                        UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_SourceRect.right);
+                        UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_SourceRect.bottom);
+                        // Unpack the target rectangle
+                        UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_TargetRect.left);
+                        UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_TargetRect.top);
+                        UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_TargetRect.right);
+                        UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_TargetRect.bottom);
+                        // Unpack the bit rate and bit error rate
+                        UnpackUINT32LEInc(&pBuf, &ulLen, &m_VideoInfoHeader.m_ulBitRate);
+                        UnpackUINT32LEInc(&pBuf, &ulLen, &m_VideoInfoHeader.m_ulBitErrorRate);
+                        // Skip the average time per frame
+                        if (ulLen >= 8)
+                        {
+                            m_VideoInfoHeader.m_ullAvgTimePerFrame = 0;
+                            pBuf  += 8;
+                            ulLen -= 8;
+                            // Unpack the bitmap info header
+                            UnpackUINT32LEInc(&pBuf, &ulLen, &m_VideoInfoHeader.m_bmiHeader.biSize);
+                            UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_bmiHeader.biWidth);
+                            UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_bmiHeader.biHeight);
+                            UnpackUINT16LEInc(&pBuf, &ulLen, &m_VideoInfoHeader.m_bmiHeader.biPlanes);
+                            UnpackUINT16LEInc(&pBuf, &ulLen, &m_VideoInfoHeader.m_bmiHeader.biBitCount);
+                            UnpackUINT32LEInc(&pBuf, &ulLen, &m_VideoInfoHeader.m_bmiHeader.biCompression);
+                            UnpackUINT32LEInc(&pBuf, &ulLen, &m_VideoInfoHeader.m_bmiHeader.biSizeImage);
+                            UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_bmiHeader.biXPelsPerMeter);
+                            UnpackUINT32LEInc(&pBuf, &ulLen, (UINT32*) &m_VideoInfoHeader.m_bmiHeader.biXPelsPerMeter);
+                            UnpackUINT32LEInc(&pBuf, &ulLen, &m_VideoInfoHeader.m_bmiHeader.biClrUsed);
+                            // Save return on last one
+                            retVal = UnpackUINT32LEInc(&pBuf, &ulLen, &m_VideoInfoHeader.m_bmiHeader.biClrImportant);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    return retVal;
+}
+
+HX_RESULT CWMVideoDecoder::OpenCodec(UINT32 ulCodec4CC)
 {
     HX_RESULT retVal = HXR_FAIL;
 
@@ -232,36 +426,24 @@
     if (m_pCodecLib)
     {
         // Tell the codec library what codec to load
+        HX_MOFTAG mofTag = (HX_MOFTAG) ulCodec4CC;
         retVal = m_pCodecLib->LoadCodecLib(mofTag);
         if (SUCCEEDED(retVal))
         {
             // Open the codec
             retVal = m_pCodecLib->PNCodec_Open(mofTag, &m_pCodec);
-            if (FAILED(retVal))
-            {
-                retVal = HXR_REQUEST_UPGRADE;
-            }
         }
-        else
+        if (FAILED(retVal))
         {
-            // Generate the string
-            // XXXMEH - we really should centralize this code
-            // into CRADynamicCodecLibrary
-            char szAUStr[5]; /* Flawfinder: ignore */
-            szAUStr[0] = (char) ((mofTag >> 24) & 0x000000FF);
-            szAUStr[1] = (char) ((mofTag >> 16) & 0x000000FF);
-            szAUStr[2] = (char) ((mofTag >>  8) & 0x000000FF);
-            szAUStr[3] = (char) ( mofTag        & 0x000000FF);
-            szAUStr[4] = '\0';
-            // Make sure it's lower-case
-            strlwr(szAUStr);
-            // We failed to load the codec binary, so
-            // we need to add the string to the upgrade collection
-            AddToAutoUpgradeCollection(szAUStr, m_pContext);
-            // Make sure we return HXR_REQUEST_UPGRADE
-            // so that we know we failed due to not being able
-            // to load the codec as opposed to some other reason
+            // Set the return value to request upgrade
             retVal = HXR_REQUEST_UPGRADE;
+            // Do we have a codec name string?
+            if (m_pCodecNameStr)
+            {
+                // Add the string to the upgrade collection
+                AddToAutoUpgradeCollection((const char*) m_pCodecNameStr->GetBuffer(),
+                                        m_pContext);
+            }
         }
     }
 
@@ -272,19 +454,19 @@
 {
     HX_RESULT retVal = HXR_FAIL;
 
-    if (m_pVideoFormat)
+    if (m_pVideoFormat && m_pInitBuffer)
     {
-        UINT32 ulMofInDataSize = (m_pVideoFormat->GetBitstreamHeaderSize() / 4) + 1;
+        UINT32 ulMofInDataSize = (m_pInitBuffer->GetSize() / 4) + 1;
         ulMofInDataSize       += sizeof(HX_FORMAT_NATIVE);
         UINT32* pMofInData     = new UINT32 [ulMofInDataSize];
         if (pMofInData)
         {
             // Set the input MOF
             HX_FORMAT_NATIVE* pMofIn = (HX_FORMAT_NATIVE*) pMofInData;
-            pMofIn->cbLength  = m_pVideoFormat->GetBitstreamHeaderSize() + (pMofIn->data - ((UINT8*) pMofIn));
-            pMofIn->moftag    = HX_MEDIA_NATIVE;
-            pMofIn->submoftag = STRINGTOMOFTAG(m_pCodecId);
-            memcpy(pMofIn->data, m_pVideoFormat->GetBitstreamHeader(), m_pVideoFormat->GetBitstreamHeaderSize());
+            pMofIn->cbLength         = m_pInitBuffer->GetSize() + (pMofIn->data - ((UINT8*) pMofIn));
+            pMofIn->moftag           = HX_MEDIA_NATIVE;
+            pMofIn->submoftag        = (HX_MOFTAG) m_ulCodec4CC;
+            memcpy(pMofIn->data, m_pInitBuffer->GetBuffer(), m_pInitBuffer->GetSize());
             // Set the output MOF
             HX_FORMAT_IMAGE2 mofOut;
             mofOut.cbLength  = sizeof(HX_FORMAT_IMAGE2);
@@ -295,8 +477,7 @@
             HXCODEC_INIT codecInit;
             codecInit.pInMof    = (HX_MOF*) pMofIn;
             codecInit.pOutMof   = (HX_MOF*) &mofOut;
-//            codecInit.memoryRef = (HXMEMORY) m_pInputAllocator;
-            codecInit.memoryRef = NULL;
+            codecInit.memoryRef = (HXMEMORY) m_pInputAllocator;
             codecInit.pContext  = m_pContext;
             // Open the stream
             retVal = m_pCodecLib->PNCodec_StreamOpen(m_pCodec, &m_pStream, &codecInit);
@@ -311,10 +492,10 @@
                     // Set the codec quality
                     SetCodecQuality();
                     // Tell the codec we can handle different output sizes
-                    HXBOOL bAllowDifferentOutputSizes = TRUE; 
-                    m_pCodecLib->PNStream_SetProperty(m_pStream, 
-                                                      SP_ALLOW_DIFFERENT_OUPUT_SIZES, 
-                                                      &bAllowDifferentOutputSizes); 
+                    HXBOOL bAllowDifferentOutputSizes = TRUE;
+                    m_pCodecLib->PNStream_SetProperty(m_pStream,
+                                                      SP_ALLOW_DIFFERENT_OUPUT_SIZES,
+                                                      &bAllowDifferentOutputSizes);
                 }
             }
         }
@@ -366,3 +547,59 @@
     
     return retVal;
 }
+
+HX_RESULT CWMVideoDecoder::GetCodec4CC(GUID* pSubTypeGUID, UINT32* pulCodec4CC)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pSubTypeGUID && pulCodec4CC)
+    {
+        // See if the GUID matches a supported GUID in our table
+        HXBOOL           bFound = FALSE;
+        HXWMGUID2FOURCC* pEntry = (HXWMGUID2FOURCC*) &m_guid2FourCC[0];
+        while (pEntry && pEntry->m_ul4CC)
+        {
+            if (IsEqualIID(*pSubTypeGUID, pEntry->m_guid))
+            {
+                *pulCodec4CC = pEntry->m_ul4CC;
+                bFound       = TRUE;
+                break;
+            }
+        }
+        if (bFound)
+        {
+            // Clear the return value
+            retVal = HXR_OK;
+        }
+    }
+
+    return retVal;
+}
+
+HX_RESULT CWMVideoDecoder::CreateCodecNameString(IUnknown* pContext, UINT32 ul4CC, IHXBuffer** ppStr)
+{
+    HX_RESULT retVal = HXR_FAIL;
+
+    if (pContext && ul4CC && ppStr)
+    {
+        // Get the characters of the fourcc
+        char szFourCC[5];
+        szFourCC[0] = (char) ((ul4CC & 0xFF000000) >> 24);
+        szFourCC[1] = (char) ((ul4CC & 0x00FF0000) >> 16);
+        szFourCC[2] = (char) ((ul4CC & 0x0000FF00) >>  8);
+        szFourCC[3] = (char)  (ul4CC & 0x000000FF);
+        szFourCC[4] = '\0';
+        // Create a string
+        IHXBuffer* pStrBuf = NULL;
+        retVal = CreateStringBufferCCF(pStrBuf, (const char*) szFourCC, pContext);
+        if (SUCCEEDED(retVal))
+        {
+            // Assign the out parameter
+            *ppStr = pStrBuf;
+            (*ppStr)->AddRef();
+        }
+        HX_RELEASE(pStrBuf);
+    }
+
+    return retVal;
+}


From ehyche at helixcommunity.org  Thu Feb  9 14:05:15 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:18:53 2006
Subject: [Datatype-cvs] asf/video/codec - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/video/codec
In directory cvs:/tmp/cvs-serv25030/codec

Log Message:
Directory /cvsroot/datatype/asf/video/codec added to the repository



From ehyche at helixcommunity.org  Thu Feb  9 14:05:25 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:19:02 2006
Subject: [Datatype-cvs] asf/video/codec/wmv9 - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/video/codec/wmv9
In directory cvs:/tmp/cvs-serv25233/wmv9

Log Message:
Directory /cvsroot/datatype/asf/video/codec/wmv9 added to the repository



From ehyche at helixcommunity.org  Thu Feb  9 14:05:57 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:19:39 2006
Subject: [Datatype-cvs] asf/video/codec/wmv9/platform - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/video/codec/wmv9/platform
In directory cvs:/tmp/cvs-serv25928/platform

Log Message:
Directory /cvsroot/datatype/asf/video/codec/wmv9/platform added to the repository



From ehyche at helixcommunity.org  Thu Feb  9 14:06:09 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:19:46 2006
Subject: [Datatype-cvs] asf/video/codec/wmv9/platform/win32 - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/video/codec/wmv9/platform/win32
In directory cvs:/tmp/cvs-serv26194/win32

Log Message:
Directory /cvsroot/datatype/asf/video/codec/wmv9/platform/win32 added to the repository



From ehyche at helixcommunity.org  Thu Feb  9 14:07:04 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:20:44 2006
Subject: [Datatype-cvs] asf/video/codec/wmv9 Umakefil, NONE,
	1.1 wmv9_decoder_entry.cpp, NONE, 1.1 wmv9_decoder_guids.cpp,
	NONE, 1.1 wmv9decoderdll, NONE, 1.1 wmv9decoderdll_win32.pcf,
	NONE, 1.1 wmv9decoderlib, NONE, 1.1 wmv9decoderlib_win32.pcf,
	NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/asf/video/codec/wmv9
In directory cvs:/tmp/cvs-serv26973/codec/wmv9

Added Files:
	Umakefil wmv9_decoder_entry.cpp wmv9_decoder_guids.cpp 
	wmv9decoderdll wmv9decoderdll_win32.pcf wmv9decoderlib 
	wmv9decoderlib_win32.pcf 
Log Message:
Safekeeping checkin - not functional yet.


--- NEW FILE: wmv9decoderdll ---
# 
# ***** 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.AddModuleIncludes("common/include",
                          "datatype/include",
                          "datatype/rm/include")

project.AddModuleLibraries("common/runtime[runtlib]", 
                           "common/dbgtool[debuglib]", 
                           "common/util[utillib]", 
                           "common/container[contlib]",
                           "common/system[syslib]",
                           "common/log/logutil[logutillib]",
                           "datatype/asf/video/codec/wmv9[wmv9decoderlib]")

project.AddSources("wmv9_decoder_guids.cpp",
                   "wmv9_decoder_entry.cpp")

project.ExportFunction("PNCodec_Open",
                       "HX_MOFTAG moftFormatTag,HXCODEC *codecRef",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNCodec_Close",
                       "HXCODEC codecRef",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNCodec_GetUIName",
                       "HXCODEC codecRef,char *nameBuf",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNCodec_GetVersion",
                       "HXCODEC codecRef, ULONG32 *pVersion",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNCodec_QueryMediaFormat",
                       "HXCODEC codecRef,HX_MOF * pmofIn, " \
                       "HX_MOF * pmofOut, UINT16 ioDirection",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNCodec_PreferredMediaFormat",
                       "HXCODEC codecRef,HX_MOF * pmofIn, " \
                       "HX_MOF * pmofOut, UINT16 ioDirection",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNCodec_GetMediaFormats",
                       "HXCODEC codecRef, UINT16 ioDirection, " \
                       "FP_MEDIAFORMATSCALLBACK fpCallback, void *userData",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNCodec_StreamOpen",
                       "HXCODEC codecRef,HXSTREAM *streamRef,HXCODEC_INIT *params",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNCodec_Input",
                       "HXCODEC codecRef, HXCODEC_DATA *pData",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_Close",
                       "HXSTREAM streamRef",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_SetDataCallback",
                       "HXSTREAM streamRef,HXSTREAM callbackRef," \
                       "HXMEMORY memoryRef, FP_STREAM_DATA data_callback",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_GetStreamHeaderSize",
                       "HXSTREAM streamRef, ULONG32 *puSize",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_GetStreamHeader",
                       "HXSTREAM streamRef, HX_MOF *pHeader",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_Input",
                       "HXSTREAM streamRef, HXSTREAM fromStreamRef, " \
                       "HXCODEC_DATA *pData",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_SetOutputPacketSize",
                       "HXSTREAM streamRef,ULONG32 prefSize, " \
                       "ULONG32 maxSize,ULONG32 *actualSize",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_GetInputBufferSize",
                       "HXSTREAM streamRef,ULONG32 *puSize",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_GetProperty",
                       "HXSTREAM streamRef, ULONG32 prop, void *pValue",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_SetProperty",
                       "HXSTREAM streamRef, ULONG32 prop, void *pValue",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_OpenSettingsBox",
                       "HXSTREAM streamRef, void * platformData",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_GetIPNUnknown",
                       "HXSTREAM streamRef",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_PostProcess",
                       "HXSTREAM streamRef, HXCODEC_DATA *pncData, ULONG32 uCurrentTime, " \
                       "UCHAR *pDestBuffer, UINT32 uDestPitch, INT32 cidDestColorFormat",
                       "datatype/rm/include",
                       "hxcodec.h")
project.ExportFunction("PNStream_ReleaseFrame",
                       "HXSTREAM streamRef, HXCODEC_DATA *pncData",
                       "datatype/rm/include",
                       "hxcodec.h")

DLLTarget("wmv9")

DependTarget()

--- NEW FILE: wmv9decoderdll_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

if project.IsDefined("HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO"):
    project.AddIncludes("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)
    wmfsdk_lib = os.path.join(wmfsdk, "lib", "wmvcore.lib")
    project.AddLibraries(wmfsdk_lib)
    project.AddSystemLibraries("msdmo.lib", "dmoguids.lib")

project.AddSystemLibraries("user32.lib", 
                           "advapi32.lib")


--- NEW FILE: wmv9decoderlib_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

if project.IsDefined("HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO"):
    project.AddSources("platform/win32/wmv9_decoder_dmo.cpp",
                       "platform/win32/mediabuffer.cpp")
    project.AddIncludes("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: wmv9decoderlib ---
# 
# ***** 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.AddModuleIncludes("common/include",
                          "common/runtime/pub",
                          "common/dbgtool/pub",
                          "common/util/pub",
                          "common/container/pub",
                          "common/system/pub",
                          "common/log/logutil/pub",
                          "datatype/include")

LibraryTarget("wmv9decoderlib")

DependTarget()

--- 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("wmv9decoderlib", "wmv9decoderdll")

--- NEW FILE: wmv9_decoder_entry.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 "hxresult.h"
#include "hxcodec.h"
#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
#include "wmv9_decoder_dmo.h"
#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */


HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_Open)(HX_MOFTAG moftFormatTag, HXCODEC* pCodecRef)
{
    HX_RESULT retVal = HXR_FAIL;

    if (pCodecRef)
    {
        // Assign a dummy reference
        *pCodecRef = (HXCODEC) 0xdeadbeef;
        // Clear the return value
        retVal = HXR_OK;
    }

    return retVal;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_Close)(HXCODEC codecRef)
{
    HX_RESULT retVal = HXR_FAIL;

    if (codecRef)
    {
        retVal = HXR_OK;
    }

    return retVal;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_GetUIName)(HXCODEC codecRef, char* pszNameBuf)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_GetVersion)(HXCODEC codecRef, ULONG32 *pVersion)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_QueryMediaFormat)(HXCODEC codecRef, HX_MOF* pMofIn,
                                                        HX_MOF* pMofOut, UINT16 usIODirection)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_PreferredMediaFormat)(HXCODEC codecRef, HX_MOF* pMofIn,
                                                            HX_MOF* pMofOut, UINT16 usIODirection)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_GetMediaFormats)(HXCODEC codecRef, UINT16 usIODirection,
                                                       FP_MEDIAFORMATSCALLBACK fpCallback, void* pUserData)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_StreamOpen)(HXCODEC codecRef, HXSTREAM* pStreamRef, HXCODEC_INIT* pParams)
{
    HX_RESULT retVal = HXR_FAIL;

    if (codecRef)
    {
#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
        CWMV9DecoderDMO* pObj = new CWMV9DecoderDMO();
        if (pObj)
        {
            // Init the DMO decoder
            retVal = pObj->Init(pParams);
            if (SUCCEEDED(retVal))
            {
                // The HXSTREAM is just the pointer to the CWMV9DecoderDMO
                *pStreamRef = (HXSTREAM) pObj;
            }
        }
#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
    }

    return retVal;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_Input)(HXCODEC codecRef, HXCODEC_DATA* pData)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_Close)(HXSTREAM streamRef)
{
    HX_RESULT retVal = HXR_FAIL;

    if (streamRef)
    {
#if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO)
        CWMV9DecoderDMO* pObj = (CWMV9DecoderDMO*) streamRef;
        // Close the object
        pObj->Close();
        // Delete the object
        HX_DELETE(pObj);
        // Clear the return value
        retVal = HXR_OK;
#endif /* #if defined(HELIX_FEATURE_ASF_VIDEO_CODEC_WMV9_DMO) */
    }

    return retVal;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_SetDataCallback)(HXSTREAM streamRef, HXSTREAM callbackRef,
                                                        HXMEMORY memoryRef, FP_STREAM_DATA fpDataCallback)
{
    HX_RESULT retVal = HXR_FAIL;

    if (streamRef)
    {
#if defined(HELIX_FEATURE_ASF_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) */
    }

    return retVal;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_GetStreamHeaderSize)(HXSTREAM streamRef, ULONG32* pulSize)
{
    HX_RESULT retVal = HXR_FAIL;

    if (streamRef)
    {
#if defined(HELIX_FEATURE_ASF_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) */
    }

    return retVal;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_GetStreamHeader)(HXSTREAM streamRef, HX_MOF* pHeader)
{
    HX_RESULT retVal = HXR_FAIL;

    if (streamRef)
    {
#if defined(HELIX_FEATURE_ASF_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) */
    }

    return retVal;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_Input)(HXSTREAM streamRef, HXSTREAM fromStreamRef, HXCODEC_DATA* pData)
{
    HX_RESULT retVal = HXR_FAIL;

    if (streamRef)
    {
#if defined(HELIX_FEATURE_ASF_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) */
    }

    return retVal;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_SetOutputPacketSize)(HXSTREAM streamRef, ULONG32 PrefSize,
                                                            ULONG32 MaxSize, ULONG32* pActualSize)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_GetInputBufferSize)(HXSTREAM streamRef, ULONG32* pulSize)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_GetProperty)(HXSTREAM streamRef, ULONG32 prop, void *pValue)
{
    HX_RESULT retVal = HXR_FAIL;

    if (streamRef)
    {
#if defined(HELIX_FEATURE_ASF_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) */
    }

    return retVal;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_SetProperty)(HXSTREAM streamRef, ULONG32 prop, void* pValue)
{
    HX_RESULT retVal = HXR_FAIL;

    if (streamRef)
    {
#if defined(HELIX_FEATURE_ASF_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) */
    }

    return retVal;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_OpenSettingsBox)(HXSTREAM streamRef, void * pPlatformData)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

IHXUnknown * HXEXPORT ENTRYPOINT(PNStream_GetIPNUnknown)(HXSTREAM streamRef)
{
    HX_ASSERT(FALSE);
    return NULL;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_PostProcess)(HXSTREAM streamRef, HXCODEC_DATA* pncData,
                                                    ULONG32 uCurrentTime, UCHAR* pDestBuffer,
                                                    UINT32 uDestPitch, INT32 cidDestColorFormat)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}

HX_RESULT HXEXPORT ENTRYPOINT(PNStream_ReleaseFrame)(HXSTREAM streamRef, HXCODEC_DATA *pncData)
{
    HX_ASSERT(FALSE);
    return HXR_NOTIMPL;
}


--- NEW FILE: wmv9_decoder_guids.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 ***** */ 

#define INITGUID

#include "hxtypes.h"
#include "hxcom.h"
#include "hxcodec.h"
#include "ihxtlogsystem.h"
#include "ihxtlogsystemcontext.h"
#include "ihxfgbuf.h"
#include "hxdllaccess.h"
#include "hxplgns.h"
#include "hxplugn.h"
#include "hxccf.h"
// #include "dmo.h" // we include dmoguids.lib to get these GUIDs


From ehyche at helixcommunity.org  Thu Feb  9 14:07:05 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:20:45 2006
Subject: [Datatype-cvs] asf/video/codec/wmv9/platform/win32
	wmv9_decoder_dmo.cpp, NONE, 1.1 wmv9_decoder_dmo.h, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/asf/video/codec/wmv9/platform/win32
In directory cvs:/tmp/cvs-serv26973/codec/wmv9/platform/win32

Added Files:
	wmv9_decoder_dmo.cpp wmv9_decoder_dmo.h 
Log Message:
Safekeeping checkin - not functional yet.


--- NEW FILE: wmv9_decoder_dmo.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 "hxresult.h"
#include "hxcodec.h"
#include "mediabuffer.h"
#include "wmv9_decoder_dmo.h"
#include "wmsdk.h"
#include "dmo.h"
#include "wmcodecconst.h"
#define HELIX_FEATURE_LOGLEVEL_NONE // comment out to use logging
#include "hxtlogutil.h"

CWMV9DecoderDMO::CWMV9DecoderDMO()
{
    m_pInputAllocator              = NULL;
    m_pContext                     = NULL;
    m_pMediaObject                 = NULL;
    m_ulOutputBufferSize           = 0;
    m_ulOutputBufferAlignment      = 0;
    m_ulMaxSamplesOut              = 0;
    m_ulMinimumInputBufferSize     = 0;
    m_ulMaximumInputLookaheadBytes = 0;
    m_ulInputBufferAlignment       = 0;
    m_ulInputStreamInfoFlags       = 0;
    m_ulOutputStreamInfoFlags      = 0;
    memset((void*) &m_OutputType, 0, sizeof(WM_MEDIA_TYPE));
}

CWMV9DecoderDMO::~CWMV9DecoderDMO()
{
    Close();
    ::CoUninitialize();
}

HX_RESULT CWMV9DecoderDMO::Init(HXCODEC_INIT* pParams)
{
    HXLOGL2(HXLOG_WMV9, "Init(0x%08x)", pParams);
    HX_RESULT retVal = HXR_FAIL;

    if (pParams)
    {
        // Get the allocator
        HX_RELEASE(m_pInputAllocator);
        m_pInputAllocator = (IHX20MemoryAllocator*) pParams->memoryRef;
        HX_ADDREF(m_pInputAllocator);
        // Get the context
        HX_RELEASE(m_pContext);
        m_pContext = pParams->pContext;
        HX_ADDREF(m_pContext);
        // Get the input MOF
        HX_FORMAT_NATIVE* pInMof = (HX_FORMAT_NATIVE*) pParams->pInMof;
        // Sanity check
        if (pInMof                               &&
            pInMof->moftag    == HX_MEDIA_NATIVE &&
            pInMof->submoftag == 0x776D7639      && // 'wmv9' 4cc
            pInMof->data)
        {
            // The passed-in buffer is a WM_MEDIA_TYPE struct, laid
            // out in memory. But we should fix up the buffer pointer.
            WM_MEDIA_TYPE* pInputMediaType = (WM_MEDIA_TYPE*) pInMof->data;
            pInputMediaType->pbFormat = ((BYTE*) pInMof->data) + sizeof(WM_MEDIA_TYPE);
            // Initialize COM
            HRESULT hr = ::CoInitialize(NULL);
            if (hr == S_OK || hr == S_FALSE)
            {
                // Create the WMA decoder DMO
                HX_RELEASE(m_pMediaObject);
                hr = CoCreateInstance(CLSID_CWMVDecMediaObject,
                                      NULL,
                                      CLSCTX_INPROC_SERVER, 
                                      IID_IMediaObject, 
                                      (void**) &m_pMediaObject);
                if (hr == S_OK)
                {
                    // Set the input type
                    hr = m_pMediaObject->SetInputType(0, (DMO_MEDIA_TYPE*) pInputMediaType, 0);
                    if (hr == S_OK)
                    {
                        // Get the preferred output type
                        hr = m_pMediaObject->GetOutputType(0, 0, (DMO_MEDIA_TYPE*) &m_OutputType);
                        if (hr == S_OK)
                        {
                            // Set that output type
                            hr = m_pMediaObject->SetOutputType(0, (const DMO_MEDIA_TYPE*) &m_OutputType, 0);
                            if (hr == S_OK)
                            {
                                // Get the input buffer size, lookahead, and alignment
                                hr = m_pMediaObject->GetInputSizeInfo(0,
                                                                      &m_ulMinimumInputBufferSize,
                                                                      &m_ulMaximumInputLookaheadBytes,
                                                                      &m_ulInputBufferAlignment);
                                if (hr == S_OK)
                                {
                                    // Get the output buffer size and alignment
                                    hr = m_pMediaObject->GetOutputSizeInfo(0,
                                                                           &m_ulOutputBufferSize,
                                                                           &m_ulOutputBufferAlignment);
                                    if (hr == S_OK)
                                    {
                                        // Get the input stream info
                                        hr = m_pMediaObject->GetInputStreamInfo(0, &m_ulInputStreamInfoFlags);
                                        if (hr == S_OK)
                                        {
                                            // Get the output stream info
                                            hr = m_pMediaObject->GetOutputStreamInfo(0, &m_ulOutputStreamInfoFlags);
                                            if (hr == S_OK)
                                            {
                                                // Get the output parameters
                                                if (m_OutputType.formattype == WMFORMAT_VideoInfo &&
                                                    m_OutputType.pbFormat)
                                                {
                                                    WMVIDEOINFOHEADER* pVideoInfo = (WMVIDEOINFOHEADER*) m_OutputType.pbFormat;

                                                    // Clear the return value
                                                    retVal = HXR_OK;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    return retVal;
}

HX_RESULT CWMV9DecoderDMO::Close()
{
    MoFreeMediaType((DMO_MEDIA_TYPE*) &m_OutputType);
    HX_RELEASE(m_pContext);
    HX_RELEASE(m_pInputAllocator);
    HX_RELEASE(m_pMediaObject);

    return HXR_OK;
}

HX_RESULT CWMV9DecoderDMO::SetDataCallback(HXSTREAM callbackRef, HXMEMORY memoryRef, FP_STREAM_DATA fpDataCallback)
{
}

HX_RESULT CWMV9DecoderDMO::GetStreamHeaderSize(UINT32* pulSize)
{
}

HX_RESULT CWMV9DecoderDMO::GetStreamHeader(HX_MOF* pHdr)
{
}

HX_RESULT CWMV9DecoderDMO::Input(HXCODEC_DATA* pData)
{
}

HX_RESULT CWMV9DecoderDMO::GetProperty(UINT32 ulProp, void* pValue)
{
}

HX_RESULT CWMV9DecoderDMO::SetProperty(UINT32 ulProp, void* pValue)
{
}

STDMETHODIMP CWMV9DecoderDMO::OpenDecoder(UINT32 ulConfigType, const void* pConfig, UINT32 ulNumConfigBytes)
{
    HXLOGL2(HXLOG_WMA9, "OpenDecoder(%lu,0x%08x,%lu)", ulConfigType, pConfig, ulNumConfigBytes);
    HX_RESULT retVal = HXR_FAIL;

    if (pConfig && ulNumConfigBytes)
    {
        // The passed-in buffer is a WM_MEDIA_TYPE struct, laid
        // out in memory. But we should fix up the buffer pointer.
        WM_MEDIA_TYPE* pInputMediaType = (WM_MEDIA_TYPE*) pConfig;
        pInputMediaType->pbFormat = ((BYTE*) pConfig) + sizeof(WM_MEDIA_TYPE);
        // Initialize COM
        HRESULT hr = ::CoInitialize(NULL);
        if (hr == S_OK || hr == S_FALSE)
        {
            // Create the WMA decoder DMO
            HX_RELEASE(m_pMediaObject);
            hr = CoCreateInstance(CLSID_CWMADecMediaObject,
                                  NULL,
                                  CLSCTX_INPROC_SERVER, 
                                  IID_IMediaObject, 
                                  (void**) &m_pMediaObject);
            if (hr == S_OK)
            {
                // Set the input type
                hr = m_pMediaObject->SetInputType(0, (DMO_MEDIA_TYPE*) pInputMediaType, 0);
                if (hr == S_OK)
                {
                    // Get the preferred output type
                    hr = m_pMediaObject->GetOutputType(0, 0, (DMO_MEDIA_TYPE*) &m_OutputType);
                    if (hr == S_OK)
                    {
                        // Set that output type
                        hr = m_pMediaObject->SetOutputType(0, (const DMO_MEDIA_TYPE*) &m_OutputType, 0);
                        if (hr == S_OK)
                        {
                            // Get the input buffer size, lookahead, and alignment
                            hr = m_pMediaObject->GetInputSizeInfo(0,
                                                                  &m_ulMinimumInputBufferSize,
                                                                  &m_ulMaximumInputLookaheadBytes,
                                                                  &m_ulInputBufferAlignment);
                            if (hr == S_OK)
                            {
                                // Get the output buffer size and alignment
                                hr = m_pMediaObject->GetOutputSizeInfo(0,
                                                                       &m_ulOutputBufferSize,
                                                                       &m_ulOutputBufferAlignment);
                                if (hr == S_OK)
                                {
                                    // Get the input stream info
                                    hr = m_pMediaObject->GetInputStreamInfo(0, &m_ulInputStreamInfoFlags);
                                    if (hr == S_OK)
                                    {
                                        // Get the output stream info
                                        hr = m_pMediaObject->GetOutputStreamInfo(0, &m_ulOutputStreamInfoFlags);
                                        if (hr == S_OK)
                                        {
                                            // Get the output parameters
                                            if (m_OutputType.formattype == WMFORMAT_WaveFormatEx &&
                                                m_OutputType.pbFormat)
                                            {
                                                // Get the output audio parameters
                                                WAVEFORMATEX* pWave = (WAVEFORMATEX*) m_OutputType.pbFormat;
                                                m_ulSampleRate    = pWave->nSamplesPerSec;
                                                m_ulNumChannels   = (UINT32) pWave->nChannels;
                                                m_ulBitsPerSample = (UINT32) pWave->wBitsPerSample;
                                                // Compute the max samples out
                                                if (m_ulBitsPerSample)
                                                {
                                                    m_ulMaxSamplesOut = m_ulOutputBufferSize * 8 / m_ulBitsPerSample;
                                                }
                                                // Clear the return value
                                                retVal = HXR_OK;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    return retVal;
}

STDMETHODIMP CWMV9DecoderDMO::Reset()
{
    HXLOGL2(HXLOG_WMA9, "Reset()");
    HX_RESULT retVal = HXR_FAIL;

    if (m_pMediaObject)
    {
        // Flush the DMO
//        m_pMediaObject->Flush();
        // Issue a discontinuity
        m_pMediaObject->Discontinuity(0);
        // Clear the return value
        retVal = HXR_OK;
    }

    return retVal;
}

STDMETHODIMP CWMV9DecoderDMO::Conceal(UINT32 nSamples)
{
    HXLOGL2(HXLOG_WMA9, "Conceal(%lu)", nSamples);
    return HXR_NOTIMPL;
}

STDMETHODIMP CWMV9DecoderDMO::Decode(const UCHAR* pData, UINT32 ulNumDataBytes, UINT32& rulBytesConsumed,
                                    INT16* pusSamplesOut, UINT32& rulSamplesOut, HXBOOL bEOF)
{
    HXLOGL4(HXLOG_WMA9, "Decode(0x%08x,%lu,%lu,0x%08x,%lu,%lu)",
            pData, ulNumDataBytes, rulBytesConsumed, pusSamplesOut, rulSamplesOut, bEOF);
    HX_RESULT retVal = HXR_UNEXPECTED;

    if (pData && ulNumDataBytes && pusSamplesOut && m_pMediaObject)
    {
        // Create an IMediaBuffer of the input buffer. bCopy = TRUE
        // means that the CMediaBuffer makes a copy of the buffer
        // and owns its own copy. The DMO will release this buffer
        // when it wants to - we will release our reference on it
        // at the end of this method.
        IMediaBuffer* pInputMediaBuffer = NULL;
        retVal = CMediaBuffer::CreateMediaBuffer((BYTE*) pData, ulNumDataBytes, TRUE, &pInputMediaBuffer);
        if (SUCCEEDED(retVal))
        {
            // Create an IMediaBuffer for the output buffer. bCopy = FALSE
            // means that the CMediaBuffer object will only hold a pointer
            // to the buffer and not attempt to delete it on destruction
            IMediaBuffer* pOutputMediaBuffer = NULL;
            retVal = CMediaBuffer::CreateMediaBuffer((BYTE*) pusSamplesOut, rulSamplesOut * 2, FALSE, &pOutputMediaBuffer);
            if (SUCCEEDED(retVal))
            {
                // Set the return value
                retVal = HXR_FAIL;
                // Set the length to zero in the output buffer,
                // indicating that is it currently empty
                HRESULT hr = pOutputMediaBuffer->SetLength(0);
                if (hr == S_OK)
                {
                    // Call ProcessInput
                    DWORD dwFlags = DMO_INPUT_DATA_BUFFERF_SYNCPOINT;
                    hr = m_pMediaObject->ProcessInput(0,
                                                      pInputMediaBuffer,
                                                      dwFlags,
                                                      0,  // Don't know the timestamp
                                                      0); // Don't know the duration
                    if (hr == S_OK)
                    {
                        // Set up the DMO_OUTPUT_DATA_BUFFER struct
                        DMO_OUTPUT_DATA_BUFFER cOutput;
                        cOutput.pBuffer      = pOutputMediaBuffer;
                        cOutput.dwStatus     = 0;
                        cOutput.rtTimestamp  = 0;
                        cOutput.rtTimelength = 0;
                        // Call ProcessOutput until it says it doesn't have any more output
                        DWORD dwDummy = 0;
                        hr = m_pMediaObject->ProcessOutput(0, 1, &cOutput, &dwDummy);
                        if (hr == S_OK)
                        {
                            // Determine how many (if any) output samples were generated
                            UINT32 ulNumOutBytes = 0;
                            hr = pOutputMediaBuffer->GetBufferAndLength(NULL, &ulNumOutBytes);
                            if (hr == S_OK)
                            {
                                // Compute the number of samples we output (assume 16 bits per sample)
                                rulSamplesOut = ulNumOutBytes >> 1;
                                retVal        = HXR_OK;
                            }
                        }
                        else if (hr == S_FALSE)
                        {
                            // No output was generated. That's not an error
                            rulSamplesOut = 0;
                            retVal        = HXR_OK;
                        }
                        // Assume we decoded all the data
                        rulBytesConsumed = ulNumDataBytes;
                    }
                }
            }
            HX_RELEASE(pOutputMediaBuffer);
        }
        HX_RELEASE(pInputMediaBuffer);
    }
    HXLOGL4(HXLOG_WMA9, "\tDecode() returned 0x%08x (bytesConsumed=%lu,samplesOut=%lu)",
            retVal, rulBytesConsumed, rulSamplesOut);

    return retVal;
}

STDMETHODIMP CWMV9DecoderDMO::GetMaxSamplesOut(UINT32& rulNumSamples) CONSTMETHOD
{
    HX_RESULT retVal = HXR_UNEXPECTED;

    if (m_ulMaxSamplesOut)
    {
        rulNumSamples = m_ulMaxSamplesOut;
        retVal        = HXR_OK;
    }

    return retVal;
}

STDMETHODIMP CWMV9DecoderDMO::GetNChannels(UINT32& rulNumChannels) CONSTMETHOD
{
    HX_RESULT retVal = HXR_UNEXPECTED;

    if (m_ulNumChannels)
    {
        rulNumChannels = m_ulNumChannels;
        retVal         = HXR_OK;
    }

    return retVal;
}

STDMETHODIMP CWMV9DecoderDMO::GetSampleRate(UINT32& rulSampleRate) CONSTMETHOD
{
    HX_RESULT retVal = HXR_UNEXPECTED;

    if (m_ulSampleRate)
    {
        rulSampleRate = m_ulSampleRate;
        retVal        = HXR_OK;
    }

    return retVal;
}

STDMETHODIMP CWMV9DecoderDMO::GetDelay(UINT32& rulNumSamples) CONSTMETHOD
{
    // XXXMEH - TODO: investigate further
    rulNumSamples = 0;

    return HXR_OK;
}

STDMETHODIMP CWMV9DecoderDMO::SetContext(IUnknown* pContext)
{
    HXLOGL2(HXLOG_WMA9, "SetContext(0x%08x)", pContext);
    HX_RESULT retVal = HXR_FAIL;

    if (pContext)
    {
        // Save the context
        HX_RELEASE(m_pContext);
        m_pContext = pContext;
        m_pContext->AddRef();
        // Clear the return value
        retVal = HXR_OK;
        // Initialize logging
        HX_ENABLE_LOGGING(m_pContext);
    }

    return retVal;
}

STDMETHODIMP CWMV9DecoderDMO::SetConfiguration(IHXValues* pConfiguration)
{
    HXLOGL2(HXLOG_WMA9, "SetConfiguration(0x%08x)", pConfiguration);
    // Current don't have any need for config info
    return HXR_OK;
}

UINT32 CWMV9DecoderDMO::ComputeByteSum(BYTE* pBuf, UINT32 ulLen)
{
    UINT32 ulRet = 0;

    if (pBuf && ulLen)
    {
        for (UINT32 i = 0; i < ulLen; i++)
        {
            ulRet += pBuf[i];
        }
    }

    return ulRet;
}

void CWMV9DecoderDMO::PrintMediaType(FILE* fp, DMO_MEDIA_TYPE* pType)
{
    fprintf(fp, "\tmajortype            = ");
    PrintGUID(fp, pType->majortype);
    fprintf(fp, "\n");
    fprintf(fp, "\tsubtype              = ");
    PrintGUID(fp, pType->subtype);
    fprintf(fp, "\n");
    fprintf(fp, "\tFixed size samples   = %lu\n", pType->bFixedSizeSamples);
    fprintf(fp, "\tTemporal compression = %lu\n", pType->bTemporalCompression);
    fprintf(fp, "\tSample Size          = %lu\n", pType->lSampleSize);
    fprintf(fp, "\tformattype           = ");
    PrintGUID(fp, pType->formattype);
    fprintf(fp, "\n");
    fprintf(fp, "\tpUnk                 = 0x%08x\n", pType->pUnk);
    fprintf(fp, "\tcbFormat             = %lu\n",    pType->cbFormat);
    fprintf(fp, "\tpbFormat             = 0x%08x\n", pType->pbFormat);
    if (pType->formattype == WMFORMAT_WaveFormatEx)
    {
        WAVEFORMATEX* pEx = (WAVEFORMATEX*) pType->pbFormat;
        fprintf(fp, "\t\twFormatTag        = %u\n",  pEx->wFormatTag);
        fprintf(fp, "\t\tnChannels         = %u\n",  pEx->nChannels);
        fprintf(fp, "\t\tnSamplesPerSec    = %lu\n", pEx->nSamplesPerSec);
        fprintf(fp, "\t\tnAvgBytesPerSec   = %lu\n", pEx->nAvgBytesPerSec);
        fprintf(fp, "\t\tnBlockAlign       = %u\n",  pEx->nBlockAlign);
        fprintf(fp, "\t\twBitsPerSample    = %u\n",  pEx->wBitsPerSample);
        fprintf(fp, "\t\tcbSize            = %lu\n", pEx->cbSize);
        if (pEx->cbSize)
        {
            fprintf(fp, "\t\tExtra Format Info = ");
            BYTE* pTmp = pType->pbFormat + sizeof(WAVEFORMATEX);
            for (unsigned long i = 0; i < pEx->cbSize; i++)
            {
                fprintf(fp, "%02x ", pTmp[i]);
            }
            fprintf(fp, "\n");
        }
    }
 }

void CWMV9DecoderDMO::PrintGUID(FILE* fp, GUID g)
{
    const char* pszName = NULL;
    if (g == WMMEDIATYPE_Video)
    {
        pszName = "WMMEDIATYPE_Video";
    }
    else if (g == WMMEDIATYPE_Audio)
    {
        pszName = "WMMEDIATYPE_Audio";
    }
    else if (g == WMMEDIATYPE_Script)
    {
        pszName = "WMMEDIATYPE_Script";
    }
    else if (g == WMMEDIATYPE_FileTransfer)
    {
        pszName = "WMMEDIATYPE_FileTransfer";
    }
    else if (g == WMMEDIATYPE_Image)
    {
        pszName = "WMMEDIATYPE_Image";
    }
    else if (g == WMMEDIATYPE_Text)
    {
        pszName = "WMMEDIATYPE_Text";
    }
    else if (g == WMMEDIASUBTYPE_PCM)
    {
        pszName = "WMMEDIASUBTYPE_PCM";
    }
    else if (g == WMMEDIASUBTYPE_ACELPnet)
    {
        pszName = "WMMEDIASUBTYPE_ACELPnet";
    }
    else if (g == WMMEDIASUBTYPE_WMAudio_Lossless)
    {
        pszName = "WMMEDIASUBTYPE_WMAudio_Lossless";
    }
    else if (g == WMMEDIASUBTYPE_WMAudioV8)
    {
        pszName = "WMMEDIASUBTYPE_WMAudioV8";
    }
    else if (g == WMMEDIASUBTYPE_WMAudioV9)
    {
        pszName = "WMMEDIASUBTYPE_WMAudioV9";
    }
    else if (g == WMMEDIASUBTYPE_WMSP1)
    {
        pszName = "WMMEDIASUBTYPE_WMSP1";
    }
    else if (g == WMFORMAT_VideoInfo)
    {
        pszName = "WMFORMAT_VideoInfo";
    }
    else if (g == WMFORMAT_WaveFormatEx)
    {
        pszName = "WMFORMAT_WaveFormatEx";
    }
    else if (g == WMFORMAT_MPEG2Video)
    {
        pszName = "WMFORMAT_MPEG2Video";
    }
    else if (g == WMFORMAT_WebStream)
    {
        pszName = "WMFORMAT_WebStream";
    }
    else if (g == WMFORMAT_Script)
    {
        pszName = "WMFORMAT_Script";
    }
    if (pszName)
    {
        fprintf(fp, "%s", pszName);
    }
    else
    {
        fprintf(fp, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
                 g.Data1, g.Data2, g.Data3, g.Data4[0], g.Data4[1],
                 g.Data4[2], g.Data4[3], g.Data4[4],
                 g.Data4[5], g.Data4[6], g.Data4[7]);
    }
}

--- NEW FILE: wmv9_decoder_dmo.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 WMV9_DECODER_DMO_H
#define WMV9_DECODER_DMO_H

// Includes
#include "dmo.h"
#include "wmsdk.h"

class CWMV9DecoderDMO
{
public:
    CWMA9DecoderDMO();
    ~CWMA9DecoderDMO();

    HX_RESULT Init(HXCODEC_INIT* pParams);
    HX_RESULT Close();
    HX_RESULT SetDataCallback(HXSTREAM callbackRef, HXMEMORY memoryRef, FP_STREAM_DATA fpDataCallback);
    HX_RESULT GetStreamHeaderSize(UINT32* pulSize);
    HX_RESULT GetStreamHeader(HX_MOF* pHdr);
    HX_RESULT Input(HXCODEC_DATA* pData);
    HX_RESULT GetProperty(UINT32 ulProp, void* pValue);
    HX_RESULT SetProperty(UINT32 ulProp, void* pValue);
protected:
    IHX20MemoryAllocator* m_pInputAllocator;
    IUnknown*             m_pContext;
    IMediaObject*         m_pMediaObject;
    WM_MEDIA_TYPE         m_OutputType;
    UINT32                m_ulOutputBufferSize;
    UINT32                m_ulOutputBufferAlignment;
    UINT32                m_ulMaxSamplesOut;
    UINT32                m_ulMinimumInputBufferSize;
    UINT32                m_ulMaximumInputLookaheadBytes;
    UINT32                m_ulInputBufferAlignment;
    UINT32                m_ulInputStreamInfoFlags;
    UINT32                m_ulOutputStreamInfoFlags;

    void PrintMediaType(FILE* fp, DMO_MEDIA_TYPE* pType);
    void PrintGUID(FILE* fp, GUID g);
};

#endif /* #ifndef WMV9_DECODER_DMO_H */



From ehyche at helixcommunity.org  Thu Feb  9 14:07:25 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:21:02 2006
Subject: [Datatype-cvs] asf/common - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/common
In directory cvs:/tmp/cvs-serv27741/common

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



From ehyche at helixcommunity.org  Thu Feb  9 14:08:16 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:21:53 2006
Subject: [Datatype-cvs] asf/common/pub - New directory
Message-ID: 

Update of /cvsroot/datatype/asf/common/pub
In directory cvs:/tmp/cvs-serv28698/pub

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



From ehyche at helixcommunity.org  Thu Feb  9 14:08:50 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:22:28 2006
Subject: [Datatype-cvs] 
	asf/common Umakefil, NONE, 1.1 parse_opaque.cpp, NONE, 1.1
Message-ID: 

Update of /cvsroot/datatype/asf/common
In directory cvs:/tmp/cvs-serv29197

Added Files:
	Umakefil parse_opaque.cpp 
Log Message:
Safekeeping checkin.


--- 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")

project.AddSources("parse_opaque.cpp")

LibraryTarget("asfcomlib")

DependTarget()

--- 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;
    }
}


From ehyche at helixcommunity.org  Thu Feb  9 14:08:50 2006
From: ehyche at helixcommunity.org (ehyche@helixcommunity.org)
Date: Thu Feb  9 16:22:28 2006
Subject: [Datatype-cvs] asf/common/pub parse_opaque.h,NONE,1.1
Message-ID: 

Update of /cvsroot/datatype/asf/common/pub
In directory cvs:/tmp/cvs-serv29197/pub

Added Files:
	parse_opaque.h 
Log Message:
Safekeeping checkin.


--- 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 jwei at helixcommunity.org  Fri Feb 10 09:05:54 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Fri Feb 10 11:19:21 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfclocksource.cpp, 1.3.2.2,
	1.3.2.3
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv21426

Modified Files:
      Tag: hxclient_2_1_0_cayennes
	mdfclocksource.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-02-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - correct Logging file format from %l to %u

This CR is targeting following errors and improvements:

1) In one instance of Logging entries, output file format %l is used. It should be corrected to %u.

Files Modified:

datatype/mdf/video/renderer/mdfclocksource.cpp

? mdf.diff
Index: mdfclocksource.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp,v
retrieving revision 1.3.2.2
diff -u -w -b -r1.3.2.2 mdfclocksource.cpp
--- mdfclocksource.cpp	1 Feb 2006 17:29:23 -0000	1.3.2.2
+++ mdfclocksource.cpp	8 Feb 2006 23:05:53 -0000
@@ -92,7 +92,7 @@
     currentTimeInMs64  = TInt64( currentTimeInMsTUint );
     currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
     
-    MDFVIDEOLOG_WRITE_FORMAT4( "<-  Time, return %l", currentTimeInMsTUint );
+    MDFVIDEOLOG_WRITE_FORMAT4( "<-  Time, return %u", currentTimeInMsTUint );
     return currentTimeInMicro;
 }

======================================================
Image Size and Heap Use impact: none

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted




Index: mdfclocksource.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -d -r1.3.2.2 -r1.3.2.3
--- mdfclocksource.cpp	1 Feb 2006 17:29:23 -0000	1.3.2.2
+++ mdfclocksource.cpp	10 Feb 2006 17:05:51 -0000	1.3.2.3
@@ -92,7 +92,7 @@
     currentTimeInMs64  = TInt64( currentTimeInMsTUint );
     currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
     
-    MDFVIDEOLOG_WRITE_FORMAT4( "<-  Time, return %l", currentTimeInMsTUint );
+    MDFVIDEOLOG_WRITE_FORMAT4( "<-  Time, return %u", currentTimeInMsTUint );
     return currentTimeInMicro;
 }
 


From jwei at helixcommunity.org  Fri Feb 10 09:06:55 2006
From: jwei at helixcommunity.org (jwei@helixcommunity.org)
Date: Fri Feb 10 11:20:21 2006
Subject: [Datatype-cvs] mdf/video/renderer mdfclocksource.cpp,1.5,1.6
Message-ID: 

Update of /cvsroot/datatype/mdf/video/renderer
In directory cvs:/tmp/cvs-serv22763

Modified Files:
	mdfclocksource.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-02-2006.

Project: Helix plugin for Symbian

Synopsis: MDF Video Renderer - correct Logging file format from %l to %u

This CR is targeting following errors and improvements:

1) In one instance of Logging entries, output file format %l is used. It should be corrected to %u.

Files Modified:

datatype/mdf/video/renderer/mdfclocksource.cpp

? mdf.diff
Index: mdfclocksource.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp,v
retrieving revision 1.3.2.2
diff -u -w -b -r1.3.2.2 mdfclocksource.cpp
--- mdfclocksource.cpp	1 Feb 2006 17:29:23 -0000	1.3.2.2
+++ mdfclocksource.cpp	8 Feb 2006 23:05:53 -0000
@@ -92,7 +92,7 @@
     currentTimeInMs64  = TInt64( currentTimeInMsTUint );
     currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
     
-    MDFVIDEOLOG_WRITE_FORMAT4( "<-  Time, return %l", currentTimeInMsTUint );
+    MDFVIDEOLOG_WRITE_FORMAT4( "<-  Time, return %u", currentTimeInMsTUint );
     return currentTimeInMicro;
 }

======================================================
Image Size and Heap Use impact: none

Platforms and Profiles Build Verified: helix-client-s60-mmf-mdf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: hxclient_2_1_0_cayennes_restricted




Index: mdfclocksource.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mdfclocksource.cpp	1 Feb 2006 17:29:34 -0000	1.5
+++ mdfclocksource.cpp	10 Feb 2006 17:06:53 -0000	1.6
@@ -92,7 +92,7 @@
     currentTimeInMs64  = TInt64( currentTimeInMsTUint );
     currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
     
-    MDFVIDEOLOG_WRITE_FORMAT4( "<-  Time, return %l", currentTimeInMsTUint );
+    MDFVIDEOLOG_WRITE_FORMAT4( "<-  Time, return %u", currentTimeInMsTUint );
     return currentTimeInMicro;
 }
 


From ping at helixcommunity.org  Fri Feb 10 09:30:12 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:43:40 2006
Subject: [Datatype-cvs] mp4/video/renderer mp4vdfmt.cpp,1.15,1.16
Message-ID: 

Update of /cvsroot/datatype/mp4/video/renderer
In directory cvs:/tmp/cvs-serv30680/mp4/video/renderer

Modified Files:
	mp4vdfmt.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: mp4vdfmt.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/video/renderer/mp4vdfmt.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- mp4vdfmt.cpp	31 Oct 2005 22:02:40 -0000	1.15
+++ mp4vdfmt.cpp	10 Feb 2006 17:30:10 -0000	1.16
@@ -911,7 +911,7 @@
     // setup the input allocator for the codec
     if (retVal == HXR_OK)
     {
-	m_pInputAllocator = new CHXBufferMemoryAllocator(TRUE);
+	m_pInputAllocator = new CHXBufferMemoryAllocator(m_pMP4VideoRenderer->GetContext(), TRUE);
 
 	retVal = HXR_OUTOFMEMORY;
 	if (m_pInputAllocator)


From ping at helixcommunity.org  Fri Feb 10 09:30:12 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:43:40 2006
Subject: [Datatype-cvs] rm/audio/renderer rarender.cpp,1.62,1.63
Message-ID: 

Update of /cvsroot/datatype/rm/audio/renderer
In directory cvs:/tmp/cvs-serv30680/rm/audio/renderer

Modified Files:
	rarender.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: rarender.cpp
===================================================================
RCS file: /cvsroot/datatype/rm/audio/renderer/rarender.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- rarender.cpp	30 Jan 2006 21:11:02 -0000	1.62
+++ rarender.cpp	10 Feb 2006 17:30:10 -0000	1.63
@@ -1133,7 +1133,7 @@
 	   (HXR_OK == m_pContext->QueryInterface(IID_IHXUpgradeCollection,
 		(void**)&pUpColl)))
 	{
-		CHXBuffer* pBuffer = NULL;
+		IHXBuffer* pBuffer = NULL;
                 m_pCommonClassFactory->CreateInstance(IID_IHXBuffer, (void**) &pBuffer);
 
 		if (pBuffer)


From ping at helixcommunity.org  Fri Feb 10 09:30:12 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:43:41 2006
Subject: [Datatype-cvs] rm/common hxalloc.cpp,1.7,1.8
Message-ID: 

Update of /cvsroot/datatype/rm/common
In directory cvs:/tmp/cvs-serv30680/rm/common

Modified Files:
	hxalloc.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: hxalloc.cpp
===================================================================
RCS file: /cvsroot/datatype/rm/common/hxalloc.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- hxalloc.cpp	27 Apr 2005 13:57:44 -0000	1.7
+++ hxalloc.cpp	10 Feb 2006 17:30:10 -0000	1.8
@@ -43,6 +43,7 @@
 #include "hxheap.h" 
 #include "hxtick.h"
 #include "chxpckts.h"
+#include "pckunpck.h"
 #include "hxstrutl.h"
 
 #if defined(_WINDOWS)
@@ -829,7 +830,7 @@
     INT32	m_lRefCount;
 };
 
-CHXBufferMemoryAllocator::CHXBufferMemoryAllocator(HXBOOL bThreadSafe)
+CHXBufferMemoryAllocator::CHXBufferMemoryAllocator(IUnknown* pContext, HXBOOL bThreadSafe)
 #ifndef WIN32
     : m_pMutex(NULL)
 #else	// WIN32
@@ -838,8 +839,11 @@
     , m_uSize(0)
     , m_Count(0)
     , m_ref(0)
-
+    , m_pContext(NULL)
 {
+    m_pContext = pContext;
+    HX_ADDREF(m_pContext);
+
 #ifdef WIN32
     if (m_bThreadSafe) InitializeCriticalSection(&m_critsec);
 #else	// WIN32
@@ -881,6 +885,7 @@
 #else	// WIN32
     HX_DELETE(m_pMutex);
 #endif	// WIN32
+    HX_RELEASE(m_pContext);
 }
 
 HX_RESULT CHXBufferMemoryAllocator::SetProperties(HX20ALLOCPROPS* pRequest, 
@@ -910,12 +915,11 @@
     if (m_uSize > 0)
     {
         BufferBlock* pBufBlock = new BufferBlock();
-        IHXBuffer* pBuffer = new CHXBuffer();
+        IHXBuffer* pBuffer = NULL;
+	CreateBufferCCF(pBuffer, m_pContext);
         HX_ASSERT(pBufBlock && pBuffer);
         if (pBuffer && pBufBlock)
         {
-                pBuffer->AddRef();
-
                 pBufBlock->m_pBuf = pBuffer;
                 pBufBlock->m_lRefCount = 1;
 


From ping at helixcommunity.org  Fri Feb 10 09:30:13 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:43:41 2006
Subject: [Datatype-cvs] rm/common/pub hxalloc.h,1.5,1.6
Message-ID: 

Update of /cvsroot/datatype/rm/common/pub
In directory cvs:/tmp/cvs-serv30680/rm/common/pub

Modified Files:
	hxalloc.h 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: hxalloc.h
===================================================================
RCS file: /cvsroot/datatype/rm/common/pub/hxalloc.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- hxalloc.h	14 Mar 2005 19:15:54 -0000	1.5
+++ hxalloc.h	10 Feb 2006 17:30:10 -0000	1.6
@@ -171,7 +171,7 @@
     ULONG32	AddRef();
     ULONG32	Release();
 
-    CHXBufferMemoryAllocator(HXBOOL bThreadSafe = FALSE);
+    CHXBufferMemoryAllocator(IUnknown* pContext, HXBOOL bThreadSafe = FALSE);
     ~CHXBufferMemoryAllocator();
 
     UCHAR * 		GetPacketBuffer(IHXUnknown ** pPacketBuffer);
@@ -184,6 +184,7 @@
     IHXBuffer*		GetBuffer(UCHAR* memPtr);
 
 protected:
+    IUnknown*		m_pContext;
 #ifdef WIN32
     CRITICAL_SECTION    m_critsec;
     HXBOOL		m_bThreadSafe;


From ping at helixcommunity.org  Fri Feb 10 09:30:13 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:43:42 2006
Subject: [Datatype-cvs] 
	rm/events/renderer csyncad.cpp, 1.6, 1.7 csyncmm.cpp, 1.6, 1.7
Message-ID: 

Update of /cvsroot/datatype/rm/events/renderer
In directory cvs:/tmp/cvs-serv30680/rm/events/renderer

Modified Files:
	csyncad.cpp csyncmm.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: csyncmm.cpp
===================================================================
RCS file: /cvsroot/datatype/rm/events/renderer/csyncmm.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- csyncmm.cpp	30 Jan 2006 21:11:02 -0000	1.6
+++ csyncmm.cpp	10 Feb 2006 17:30:11 -0000	1.7
@@ -584,10 +584,8 @@
 			        if (HXR_OK == m_pRegistry->GetPropName(m_ulRegistryID, 
 				    pszParentName))
 			        {
-				    IHXBuffer* pValue = new CHXBuffer();
-				    pValue->AddRef();
-
-				    pValue->Set((const UCHAR*)pURL, strlen(pURL)+1);
+				    IHXBuffer* pValue = NULL;
+				    CreateAndSetBufferCCF(pValue,(UCHAR*)pURL, strlen(pURL)+1, m_pContext);
 				    SafeSprintf(szTACName, MAX_DISPLAY_NAME, "%s.Author", pszParentName->GetBuffer());
 				    m_pRegistry->SetStrByName(szTACName, pValue);
 				    pValue->Release();
@@ -605,10 +603,8 @@
 			        if (HXR_OK == m_pRegistry->GetPropName(m_ulRegistryID, 
 				    pszParentName))
 			        {
-				    IHXBuffer* pValue = new CHXBuffer();
-				    pValue->AddRef();
-
-				    pValue->Set((const UCHAR*)pURL, strlen(pURL)+1);
+				    IHXBuffer* pValue = NULL;
+				    CreateAndSetBufferCCF(pValue,(UCHAR*)pURL, strlen(pURL)+1, m_pContext);
 				    SafeSprintf(szTACName, MAX_DISPLAY_NAME, "%s.Copyright", pszParentName->GetBuffer());
 				    m_pRegistry->SetStrByName(szTACName, pValue);
 				    pValue->Release();
@@ -626,10 +622,8 @@
 			        if (HXR_OK == m_pRegistry->GetPropName(m_ulRegistryID, 
 				    pszParentName))
 			        {
-				    IHXBuffer* pValue = new CHXBuffer();
-				    pValue->AddRef();
-
-				    pValue->Set((const UCHAR*)pURL, strlen(pURL)+1);
+				    IHXBuffer* pValue = NULL;
+				    CreateAndSetBufferCCF(pValue,(UCHAR*)pURL, strlen(pURL)+1, m_pContext);				    
 				    SafeSprintf(szTACName, MAX_DISPLAY_NAME, "%s.Title", pszParentName->GetBuffer());
 				    m_pRegistry->SetStrByName(szTACName, pValue);
 				    pValue->Release();
@@ -1070,12 +1064,10 @@
 	// Get the current registry key name
 	if (HXR_OK == m_pRegistry->GetPropName(ulRegistryID, pszRegistryName))
 	{
-	    IHXBuffer* pValue = new CHXBuffer();
-	    pValue->AddRef();
+	    IHXBuffer* pValue = NULL;
+	    CreateAndSetBufferCCF(pValue, (UCHAR*)zm_pName, strlen(zm_pName) + 1, m_pContext);	    
 
 	    SafeSprintf(szRegistryEntry, MAX_DISPLAY_NAME, "%s.name", pszRegistryName->GetBuffer());
-
-	    pValue->Set((const UCHAR*)zm_pName, strlen(zm_pName) + 1);
 	    m_pRegistry->AddStr(szRegistryEntry, pValue);
 
 	    HX_RELEASE(pValue);

Index: csyncad.cpp
===================================================================
RCS file: /cvsroot/datatype/rm/events/renderer/csyncad.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- csyncad.cpp	7 Feb 2006 20:50:18 -0000	1.6
+++ csyncad.cpp	10 Feb 2006 17:30:11 -0000	1.7
@@ -45,6 +45,7 @@
 #include "hxcomm.h"
 
 #include "ihxpckts.h"
+#include "pckunpck.h"
 #include "hxbuffer.h"
 #include "hxslist.h"
 #include "hxhyper.h"
@@ -412,6 +413,10 @@
 HX_RESULT
 CSyncAd::InitializeStatistics(UINT32 ulRegistryID)
 {
+    IUnknown* pContext = NULL;
+
+    m_pOwner->GetContext(pContext);
+
     if (HXR_OK == m_pOwner->QueryInterface(IID_IHXRegistry, (void**)&m_pRegistry))
     {
 	char	    szRegistryEntry[MAX_DISPLAY_NAME] = {0}; /* Flawfinder: ignore */
@@ -420,9 +425,9 @@
 	// Get the current registry key name
 	if (HXR_OK == m_pRegistry->GetPropName(ulRegistryID, pszRegistryName))
 	{
-	    IHXBuffer* pValue = new CHXBuffer();
-	    pValue->AddRef();
+	    IHXBuffer* pValue = NULL;
 
+	    CreateBufferCCF(pValue, pContext);
 	    SafeSprintf(szRegistryEntry, MAX_DISPLAY_NAME, "%s.name", pszRegistryName->GetBuffer());
 
 	    pValue->Set((const UCHAR*)zm_pName, strlen(zm_pName) + 1);
@@ -433,6 +438,7 @@
 	}
     }
 
+    HX_RELEASE(pContext);
     return HXR_OK;
 }
 


From ping at helixcommunity.org  Fri Feb 10 09:30:13 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:43:42 2006
Subject: [Datatype-cvs] sdp/plugin/fileformat sdpfformat.cpp,1.6,1.7
Message-ID: 

Update of /cvsroot/datatype/sdp/plugin/fileformat
In directory cvs:/tmp/cvs-serv30680/sdp/plugin/fileformat

Modified Files:
	sdpfformat.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: sdpfformat.cpp
===================================================================
RCS file: /cvsroot/datatype/sdp/plugin/fileformat/sdpfformat.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- sdpfformat.cpp	14 Mar 2005 19:24:50 -0000	1.6
+++ sdpfformat.cpp	10 Feb 2006 17:30:11 -0000	1.7
@@ -56,6 +56,7 @@
 #include "hxcom.h"
 #include "hxcomm.h"
 #include "ihxpckts.h"
+#include "pckunpck.h"
 #include "hxcore.h"
 #include "hxgroup.h"
 #include "hxbuffer.h"
@@ -466,9 +467,7 @@
 
     if (SUCCEEDED(status))
     {
-	pMergedBuffer = new CHXBuffer();
-	pMergedBuffer->AddRef();
-
+	CreateBufferCCF(pMergedBuffer, m_pContext);
 	if (!m_pBuffer)
 	{
 	    pMergedBuffer->SetSize(pBuffer->GetSize());


From ping at helixcommunity.org  Fri Feb 10 09:30:13 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:43:43 2006
Subject: [Datatype-cvs] sdp/plugin/renderer sdprendr.cpp,1.9,1.10
Message-ID: 

Update of /cvsroot/datatype/sdp/plugin/renderer
In directory cvs:/tmp/cvs-serv30680/sdp/plugin/renderer

Modified Files:
	sdprendr.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: sdprendr.cpp
===================================================================
RCS file: /cvsroot/datatype/sdp/plugin/renderer/sdprendr.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- sdprendr.cpp	31 Jan 2006 23:38:22 -0000	1.9
+++ sdprendr.cpp	10 Feb 2006 17:30:11 -0000	1.10
@@ -489,7 +489,7 @@
     CHXString           escapedSDP;
     CHXString           url;
     IHXValues*          pTrackProps = NULL;
-    CHXBuffer*          pBuffer = NULL;
+    IHXBuffer*          pBuffer = NULL;
     IHXGroupManager*    pGroupManager = NULL;
     IHXGroup*           pGroup = NULL;
 
@@ -538,10 +538,13 @@
 	goto cleanup;
     }
 
-    pBuffer = new CHXBuffer();
-    pBuffer->AddRef();
+    rc = CreateAndSetBufferCCF(pBuffer, (UCHAR*)(const char*)url, 
+			       url.GetLength() + 1, m_pContext);
+    if (HXR_OK != rc)
+    {
+	goto cleanup;
+    }
 
-    pBuffer->Set((UCHAR*)(const char*)url, url.GetLength() + 1);
     pTrackProps->SetPropertyCString("src", pBuffer);
 
     pGroup->AddTrack(pTrackProps);


From ping at helixcommunity.org  Fri Feb 10 09:30:13 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:43:43 2006
Subject: [Datatype-cvs] smil/common smlpkt.cpp,1.9,1.10
Message-ID: 

Update of /cvsroot/datatype/smil/common
In directory cvs:/tmp/cvs-serv30680/smil/common

Modified Files:
	smlpkt.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: smlpkt.cpp
===================================================================
RCS file: /cvsroot/datatype/smil/common/smlpkt.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- smlpkt.cpp	31 Jan 2006 23:38:22 -0000	1.9
+++ smlpkt.cpp	10 Feb 2006 17:30:11 -0000	1.10
@@ -177,12 +177,13 @@
 {
     if(nValues >= 1)
     {
-        CHXBuffer* pBuffer = new CHXBuffer;
-        pBuffer->AddRef();
-        pBuffer->Set((BYTE*)pValues[0], strlen(pValues[0])+1);
-
-        m_pValues->SetPropertyCString(pName, pBuffer);
-        pBuffer->Release();
+        IHXBuffer* pBuffer = NULL;
+	if (HXR_OK == CreateAndSetBufferCCF(pBuffer, (BYTE*)pValues[0], 
+					    strlen(pValues[0])+1, m_pContext))
+	{
+	    m_pValues->SetPropertyCString(pName, pBuffer);
+	    pBuffer->Release();
+	}
     }
 }
 


From ping at helixcommunity.org  Fri Feb 10 09:30:14 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:43:44 2006
Subject: [Datatype-cvs] tools/binwrtr binwrtr.cpp,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/tools/binwrtr
In directory cvs:/tmp/cvs-serv30680/tools/binwrtr

Modified Files:
	binwrtr.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: binwrtr.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/binwrtr/binwrtr.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- binwrtr.cpp	30 Jan 2006 21:11:03 -0000	1.3
+++ binwrtr.cpp	10 Feb 2006 17:30:11 -0000	1.4
@@ -996,18 +996,11 @@
 	{
 	    if (strcmp(pPropertyName, "FileExtension") == 0)
 	    {
-		CHXBuffer* pExtensionBuffer = NULL;
+		IHXBuffer* pExtensionBuffer = NULL;
 		const char* pzExtension = ".bin";
 		
 		// Report the extension
-		pExtensionBuffer = new CHXBuffer();
-		retVal = HXR_OUTOFMEMORY;
-		if (pExtensionBuffer)
-		{
-		    retVal = HXR_OK;
-		    pExtensionBuffer->AddRef();
-		}
-		
+		retVal = CreateBufferCCF(pExtensionBuffer, m_pContext);
 		if (SUCCEEDED(retVal))
 		{
 		    retVal = pExtensionBuffer->Set((UINT8*) pzExtension, 


From ping at helixcommunity.org  Fri Feb 10 09:30:14 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:43:45 2006
Subject: [Datatype-cvs] tools/dtdriver/engine ffdriver.cpp,1.27,1.28
Message-ID: 

Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs:/tmp/cvs-serv30680/tools/dtdriver/engine

Modified Files:
	ffdriver.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: ffdriver.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/ffdriver.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- ffdriver.cpp	31 Jan 2006 23:38:24 -0000	1.27
+++ ffdriver.cpp	10 Feb 2006 17:30:12 -0000	1.28
@@ -1337,7 +1337,9 @@
     {
         if (m_pInputFileName)
         {
-            CHXBuffer* pTempURLBuffer = new CHXBuffer;
+            IHXBuffer* pTempURLBuffer = NULL;
+	    CreateBufferCCF(pTempURLBuffer, (IUnknown*)(IHXPlayer*)m_pContext);
+
             ULONG32 ulURLLength = strlen(m_pInputFileName);
 
             if (m_pInputFileProtocol)
@@ -1349,8 +1351,7 @@
             retVal = HXR_OUTOFMEMORY;
             if (pTempURLBuffer)
             {
-                retVal = HXR_OK;
-                pTempURLBuffer->AddRef();
+                retVal = HXR_OK;                
                 if (ulURLLength != 0)
                 {
                     retVal = pTempURLBuffer->SetSize(ulURLLength + 1);
@@ -1603,12 +1604,10 @@
     {
         if (m_pTempDirName)
         {
-            CHXBuffer* pTempDirBuffer = new CHXBuffer;
-
-            retVal = HXR_OUTOFMEMORY;
+            IHXBuffer* pTempDirBuffer = NULL;
+	    CreateBufferCCF(pTempDirBuffer, (IUnknown*)(IHXPlayer*)m_pContext);
             if (pTempDirBuffer)
             {
-                pTempDirBuffer->AddRef();
                 retVal = pTempDirBuffer->Set((UINT8*) m_pTempDirName, 
                                  strlen(m_pTempDirName) + 1);
             }


From ping at helixcommunity.org  Fri Feb 10 09:30:09 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:44:04 2006
Subject: [Datatype-cvs] common/baserend baserend.cpp,1.9,1.10
Message-ID: 

Update of /cvsroot/datatype/common/baserend
In directory cvs:/tmp/cvs-serv30680/common/baserend

Modified Files:
	baserend.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: baserend.cpp
===================================================================
RCS file: /cvsroot/datatype/common/baserend/baserend.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- baserend.cpp	30 Jan 2006 21:10:59 -0000	1.9
+++ baserend.cpp	10 Feb 2006 17:30:07 -0000	1.10
@@ -283,12 +283,9 @@
         if (SUCCEEDED(retVal))
         {
             // Create an IHXBuffer to hold the name
-            pValue = new CHXBuffer();
+	    CreateBufferCCF(pValue, m_pContext);
             if (pValue)
             {
-                // Addref the object
-                pValue->AddRef();
-
                 // Create the key name
                 char szRegistryEntry[MAX_DISPLAY_NAME] = {0}; /* Flawfinder: ignore */
                 SafeSprintf(szRegistryEntry, MAX_DISPLAY_NAME, "%s.name", pszRegistryName->GetBuffer());


From ping at helixcommunity.org  Fri Feb 10 09:30:09 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:44:07 2006
Subject: [Datatype-cvs] common/filewriter archivr2.cpp, 1.13,
	1.14 flcreatr.cpp, 1.5, 1.6
Message-ID: 

Update of /cvsroot/datatype/common/filewriter
In directory cvs:/tmp/cvs-serv30680/common/filewriter

Modified Files:
	archivr2.cpp flcreatr.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: archivr2.cpp
===================================================================
RCS file: /cvsroot/datatype/common/filewriter/archivr2.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- archivr2.cpp	31 Jan 2006 23:38:21 -0000	1.13
+++ archivr2.cpp	10 Feb 2006 17:30:07 -0000	1.14
@@ -51,6 +51,7 @@
 #include "hxmime.h"
 #include "hxcomm.h"
 #include "ihxpckts.h"
+#include "pckunpck.h"
 #include "hxfiles.h"
 #include "hxengin.h"
 #include "hxerror.h"
@@ -1445,7 +1446,7 @@
 
 
 IHXBuffer*
-CBaseArchiver2::CreateTrimmedBuffer(IHXBuffer* pBuffer)
+CBaseArchiver2::CreateTrimmedBuffer(IHXBuffer* pBuffer, IUnknown* pContext)
 {
     IHXBuffer* pRetBuffer = NULL;
 
@@ -1455,14 +1456,10 @@
 
 	if (ulSize > 0)
 	{
-	    CHXBuffer* pNewBuffer = new CHXBuffer();
-	    HX_RESULT retVal = HXR_OUTOFMEMORY;
-	    if (pNewBuffer)
-	    {
-		pNewBuffer->AddRef();
-		retVal = HXR_OK;
-	    }
+	    IHXBuffer* pNewBuffer = NULL;
+	    HX_RESULT retVal = HXR_OK;
 
+	    retVal = CreateBufferCCF(pNewBuffer, pContext);
 	    if (SUCCEEDED(retVal))
 	    {	
 		retVal = pNewBuffer->SetSize(ulSize);
@@ -1649,11 +1646,11 @@
 
 		if(pStatusInfo)
 		{
-			IHXBuffer* pBufTempFile = new CHXBuffer();
+			IHXBuffer* pBufTempFile = NULL;
+			CreateBufferCCF(pBufTempFile, m_pContext);
 			HX_ASSERT(pBufTempFile);
 			if(pBufTempFile)
 			{
-				pBufTempFile->AddRef();
 				res = pBufTempFile->Set((UCHAR*)pszTempFileName, strlen(pszTempFileName) + 1);
 				HX_ASSERT(SUCCEEDED(res));
 				if(SUCCEEDED(res))

Index: flcreatr.cpp
===================================================================
RCS file: /cvsroot/datatype/common/filewriter/flcreatr.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- flcreatr.cpp	6 Aug 2005 00:47:46 -0000	1.5
+++ flcreatr.cpp	10 Feb 2006 17:30:07 -0000	1.6
@@ -52,6 +52,7 @@
 #include "hxbuffer.h"
 #include "hxcomm.h"
 #include "ihxpckts.h"
+#include "pckunpck.h"
 #include "hxfiles.h"
 #include "hxerror.h"
 #include "hxsrc.h"
@@ -827,16 +828,10 @@
 
 		    if (pAdviser)
 		    {
-			CHXBuffer* pBaseNameBuffer = new CHXBuffer();
+			IHXBuffer* pBaseNameBuffer = NULL;
 			IHXBuffer* pTargetNameBuffer = NULL;
 
-			hResult = HXR_OUTOFMEMORY;
-			if (pBaseNameBuffer)
-			{
-			    pBaseNameBuffer->AddRef();
-			    hResult = HXR_OK;
-			}
-			
+			hResult = CreateBufferCCF(pBaseNameBuffer, m_pContext);
 			if (SUCCEEDED(hResult))
 			{	
 			    hResult = pBaseNameBuffer->


From ping at helixcommunity.org  Fri Feb 10 09:30:09 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:44:07 2006
Subject: [Datatype-cvs] common/filewriter/pub archivr2.h,1.7,1.8
Message-ID: 

Update of /cvsroot/datatype/common/filewriter/pub
In directory cvs:/tmp/cvs-serv30680/common/filewriter/pub

Modified Files:
	archivr2.h 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: archivr2.h
===================================================================
RCS file: /cvsroot/datatype/common/filewriter/pub/archivr2.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- archivr2.h	31 Jan 2006 23:38:21 -0000	1.7
+++ archivr2.h	10 Feb 2006 17:30:07 -0000	1.8
@@ -139,7 +139,7 @@
     static HXBOOL IsSetEmpty		(IHXValues* pValues);
 
     static ULONG32 BufferStringLength	    (IHXBuffer* pBuffer);
-    static IHXBuffer* CreateTrimmedBuffer  (IHXBuffer* pBuffer);
+    static IHXBuffer* CreateTrimmedBuffer  (IHXBuffer* pBuffer, IUnknown* pContext);
     static void Hash64ToFileName	    (char* pHash64);
     static HX_RESULT GenGUIDFileName	    (char* pFileName);
     static const char* FileObjectToName	    (IHXFileObject* pFileObject);


From ping at helixcommunity.org  Fri Feb 10 09:30:10 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:44:08 2006
Subject: [Datatype-cvs] image/common Umakefil, 1.2, 1.3 makebomb.cpp, 1.3,
	1.4 pximage.cpp, 1.5, 1.6 pxutil.cpp, 1.4, 1.5 rpfile.cpp, 1.3,
	1.4 wirefmgr.cpp, 1.5, 1.6
Message-ID: 

Update of /cvsroot/datatype/image/common
In directory cvs:/tmp/cvs-serv30680/image/common

Modified Files:
	Umakefil makebomb.cpp pximage.cpp pxutil.cpp rpfile.cpp 
	wirefmgr.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: makebomb.cpp
===================================================================
RCS file: /cvsroot/datatype/image/common/makebomb.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- makebomb.cpp	14 Mar 2005 19:23:20 -0000	1.3
+++ makebomb.cpp	10 Feb 2006 17:30:07 -0000	1.4
@@ -179,6 +179,7 @@
                 {
                     // AddRef the object
                     pImage->AddRef();
+		    pImage->Init(pContext);
                     // Set the dimensions, color, etc.
                     retVal = pImage->Create((INT32) ulW, (INT32) ulH, 32, HX_RGB,
                                             m_bRowsInverted, TRUE);

Index: pximage.cpp
===================================================================
RCS file: /cvsroot/datatype/image/common/pximage.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pximage.cpp	5 May 2005 16:15:09 -0000	1.5
+++ pximage.cpp	10 Feb 2006 17:30:07 -0000	1.6
@@ -53,6 +53,7 @@
 #include "hxresult.h"
 #include "hxcom.h"
 #include "ihxpckts.h"
+#include "pckunpck.h"
 #include "hxvsurf.h"
 
 // hxcont
@@ -80,6 +81,7 @@
     ResetMembers();
     m_lRefCount   = 0;
     m_pImageStore = NULL;
+    m_pContext = NULL;
 }
 
 PXImage::~PXImage()
@@ -124,6 +126,17 @@
     return retVal;
 }
 
+HX_RESULT
+PXImage::Init(IUnknown* pContext)
+{
+    HX_RELEASE(m_pContext);
+
+    m_pContext = pContext;
+    HX_ADDREF(m_pContext);
+
+    return HXR_OK;
+}
+
 STDMETHODIMP PXImage::QueryInterface(REFIID riid, void** ppvObj)
 {
     HX_RESULT retVal = HXR_OK;
@@ -223,13 +236,12 @@
     {
         // Now create the storage object
         HX_RELEASE(m_pImageStore);
-        m_pImageStore = (IHXBuffer *) new CHXBuffer();
+	CreateBufferCCF(m_pImageStore, m_pContext);
         if (!m_pImageStore)
         {
             ResetMembers();
             return HXR_OUTOFMEMORY;
         }
-        m_pImageStore->AddRef();
 
         // Set its size
         HX_RESULT retVal = m_pImageStore->SetSize(ulNumBytes);
@@ -395,13 +407,12 @@
         {
             // Create a new image store
             HX_RELEASE(m_pImageStore);
-            m_pImageStore = (IHXBuffer *) new CHXBuffer();
+	    CreateBufferCCF(m_pImageStore, m_pContext);
             if (!m_pImageStore)
             {
                 ResetMembers();
                 return HXR_OUTOFMEMORY;
             }
-            m_pImageStore->AddRef();
 
             // Set its size
             HX_RESULT retVal     = m_pImageStore->SetSize(ulNumBytes);
@@ -594,6 +605,7 @@
 void PXImage::Destroy()
 {
     HX_RELEASE(m_pImageStore);
+    HX_RELEASE(m_pContext);
     ResetMembers();
 }
 

Index: wirefmgr.cpp
===================================================================
RCS file: /cvsroot/datatype/image/common/wirefmgr.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- wirefmgr.cpp	14 Mar 2005 19:23:20 -0000	1.5
+++ wirefmgr.cpp	10 Feb 2006 17:30:07 -0000	1.6
@@ -415,7 +415,7 @@
 
                 // Get default URL
                 HX_RELEASE(m_pDefaultURLStr);
-                retVal = UnPackStringBuffer(pBuf, &m_pDefaultURLStr);
+                retVal = UnPackStringBuffer(pBuf, &m_pDefaultURLStr, m_pContext);
                 if (SUCCEEDED(retVal))
                 {
                     // Unpack total mimes
@@ -431,7 +431,7 @@
                         for (UINT32 i = 0; i < ulNumCodecs; i++)
                         {
                             IHXBuffer* pMime = NULL;
-                            retVal            = UnPackStringBuffer(pBuf, &pMime);
+                            retVal            = UnPackStringBuffer(pBuf, &pMime, m_pContext);
                             if (SUCCEEDED(retVal))
                             {
                                 retVal = AddCodecMime(pMime);
@@ -456,7 +456,7 @@
                             for (UINT32 i = 0; i < ulNumFXPackages; i++)
                             {
                                 IHXBuffer* pMime = NULL;
-                                retVal            = UnPackStringBuffer(pBuf, &pMime);
+                                retVal            = UnPackStringBuffer(pBuf, &pMime, m_pContext);
                                 if (SUCCEEDED(retVal))
                                 {
                                     retVal = AddFXPackageMime(pMime);
@@ -564,7 +564,7 @@
                     UnPack32(pBuf, ulLength);
                     UnPack32(pBuf, ulFlags);
 
-                    retVal = UnPackStringBuffer(pBuf, &pMimeStr);
+                    retVal = UnPackStringBuffer(pBuf, &pMimeStr, m_pContext);
                     if (SUCCEEDED(retVal))
                     {
                         // Assign out parameters

Index: rpfile.cpp
===================================================================
RCS file: /cvsroot/datatype/image/common/rpfile.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rpfile.cpp	14 Mar 2005 19:23:20 -0000	1.3
+++ rpfile.cpp	10 Feb 2006 17:30:07 -0000	1.4
@@ -82,6 +82,7 @@
 
 PXRealPixFile::PXRealPixFile()
 {
+    m_pContext		  = NULL;
     m_pTitleStr           = NULL;
     m_pAuthorStr          = NULL;
     m_pCopyrightStr       = NULL;
@@ -115,6 +116,17 @@
     HX_DELETE(m_pImageMap);
     HX_DELETE(m_pEffectsList);
     HX_RELEASE(m_pFileNameStr);
+    HX_RELEASE(m_pContext);
+}
+
+HX_RESULT
+PXRealPixFile::Init(IUnknown* pContext)
+{
+    HX_RELEASE(m_pContext);
+
+    m_pContext = pContext;
+    HX_ADDREF(m_pContext);
+    return HXR_OK;
 }
 
 void PXRealPixFile::ClearImageMap()

Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/image/common/Umakefil,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Umakefil	9 Jul 2004 18:30:42 -0000	1.2
+++ Umakefil	10 Feb 2006 17:30:07 -0000	1.3
@@ -75,7 +75,6 @@
                    "pxparse.cpp",
                    "rpfile.cpp",
                    "rpparser.cpp",
-                   "pxcontxt.cpp",
                    "pxcookie.cpp",
                    "pxerror.cpp",
                    "pxffcmgr.cpp",

Index: pxutil.cpp
===================================================================
RCS file: /cvsroot/datatype/image/common/pxutil.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pxutil.cpp	14 Mar 2005 19:23:20 -0000	1.4
+++ pxutil.cpp	10 Feb 2006 17:30:07 -0000	1.5
@@ -52,6 +52,7 @@
 #include "hxcom.h"
 #include "hxresult.h"
 #include "ihxpckts.h"
+#include "pckunpck.h"
 
 // From hxcont
 #include "hxstring.h"
@@ -238,7 +239,7 @@
     }
 }
 
-HX_RESULT UnPackStringBuffer(BYTE * &pBuffer, IHXBuffer** ppIHXBuffer)
+HX_RESULT UnPackStringBuffer(BYTE * &pBuffer, IHXBuffer** ppIHXBuffer, IUnknown* pContext)
 {
     HX_RESULT   retVal = HXR_OK;
 
@@ -247,10 +248,10 @@
 
     if (usLength > 0)
     {
-        IHXBuffer* pBuf   = (IHXBuffer*) new CHXBuffer();
+        IHXBuffer* pBuf   = NULL;
+	CreateBufferCCF(pBuf, pContext);
         if (pBuf)
         {
-            pBuf->AddRef();
             retVal = pBuf->Set(pBuffer, (UINT32) usLength + 1);
             if (SUCCEEDED(retVal))
             {
@@ -267,7 +268,7 @@
     return retVal;
 }
 
-HX_RESULT UnPackStringBufferNoNullTerm(BYTE * &pBuffer, IHXBuffer** ppIHXBuffer)
+HX_RESULT UnPackStringBufferNoNullTerm(BYTE * &pBuffer, IHXBuffer** ppIHXBuffer, IUnknown* pContext)
 {
     HX_RESULT   retVal = HXR_OK;
 
@@ -276,10 +277,10 @@
 
     if (usLength > 0)
     {
-        IHXBuffer* pBuf   = (IHXBuffer*) new CHXBuffer();
+        IHXBuffer* pBuf   = NULL;
+	CreateBufferCCF(pBuf, pContext);
         if (pBuf)
         {
-            pBuf->AddRef();
             retVal = pBuf->Set(pBuffer, (UINT32) usLength);
             if (SUCCEEDED(retVal))
             {


From ping at helixcommunity.org  Fri Feb 10 09:30:10 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:44:08 2006
Subject: [Datatype-cvs] image/jpg/common ijglwrap.cpp,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/image/jpg/common
In directory cvs:/tmp/cvs-serv30680/image/jpg/common

Modified Files:
	ijglwrap.cpp 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: ijglwrap.cpp
===================================================================
RCS file: /cvsroot/datatype/image/jpg/common/ijglwrap.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ijglwrap.cpp	14 Mar 2005 19:23:22 -0000	1.3
+++ ijglwrap.cpp	10 Feb 2006 17:30:08 -0000	1.4
@@ -56,6 +56,7 @@
 #include "hxcom.h"
 #include "hxresult.h"
 #include "ihxpckts.h"
+#include "pckunpck.h"
 
 // pnmisc
 #include "netbyte.h"
@@ -84,8 +85,11 @@
 static char HX_THIS_FILE[] = __FILE__;
 #endif
 
-CIJGLibraryWrapper::CIJGLibraryWrapper()
+CIJGLibraryWrapper::CIJGLibraryWrapper(IUnknown* pContext)
 {
+    m_pContext = pContext;
+    HX_ADDREF(m_pContext);
+
     // Set the state
     m_lRefCount           = 0;
     m_ulState             = kStateNotCreated;
@@ -225,6 +229,7 @@
 
     /* Set the state */
     m_ulState = kStateNotCreated;
+    HX_RELEASE(m_pContext);
 }
 
 void CIJGLibraryWrapper::AppendBuffer(IHXBuffer *pBuffer)
@@ -662,8 +667,9 @@
     /* No work to do here */
 }
 
-HX_RESULT CIJGLibraryWrapper::TranscodeToRestartInterval(IHXBuffer *      pInputImage,
-                                                         UINT32            ulRestartInterval,
+HX_RESULT CIJGLibraryWrapper::TranscodeToRestartInterval(IUnknown*	  pContext,
+							 IHXBuffer *      pInputImage,
+                                                         UINT32           ulRestartInterval,
                                                          REF(IHXBuffer *) rpOutputImage)
 {
     // Initialize the decompression error manager
@@ -760,13 +766,13 @@
     jpeg_destroy_decompress(&cSrcInfo);
 
     // Create an output IHXBuffer
-    IHXBuffer *pBuffer = new CHXBuffer();
+    IHXBuffer *pBuffer = NULL;
+    CreateBufferCCF(pBuffer, pContext);
     if (!pBuffer)
     {
         HX_VECTOR_DELETE(pDstBuf);
         return HXR_OUTOFMEMORY;
     }
-    pBuffer->AddRef();
 
     // Set the output IHXBuffer to the output data
     HX_RESULT retVal = pBuffer->Set(pDstBuf, ulOutSize);


From ping at helixcommunity.org  Fri Feb 10 09:30:10 2006
From: ping at helixcommunity.org (ping@helixcommunity.org)
Date: Fri Feb 10 11:44:12 2006
Subject: [Datatype-cvs] image/jpg/common/pub ijglwrap.h,1.3,1.4
Message-ID: 

Update of /cvsroot/datatype/image/jpg/common/pub
In directory cvs:/tmp/cvs-serv30680/image/jpg/common/pub

Modified Files:
	ijglwrap.h 
Log Message:
CHXBuffer cleanup, the changes involves:
- modified objects&functions to take IUnknown* pContext as input parameter
- replacing "new CHXBuffer()" with either CreateBufferCCF() or CreateAndSetBufferCCF()

CR by Erik


Index: ijglwrap.h
===================================================================
RCS file: /cvsroot/datatype/image/jpg/common/pub/ijglwrap.h,v
retrievin