[hxdatatype] Diff for adding core debug output to events renderer

[hxdatatype] Diff for adding core debug output to events renderer

Eric Hyche ehyche at real.com
Fri Jul 11 09:22:26 PDT 2003


dev at datatype:

The following diff (and new file) enable core debug output
from the events renderer. After adding this code multiple
times to debug events issues, I finally decided to add
it permanently.

I will be checking this into head and KH by EOD Friday
if there are no objections.

Eric


======================================
M. Eric Hyche (ehyche at real.com)
Core Technologies
RealNetworks, Inc.
-------------- next part --------------
? datatype/rm/events/renderer/smmrmlog.h
Index: common/dbgtool/pub/errdbg.h
===================================================================
RCS file: /cvs/common/dbgtool/pub/errdbg.h,v
retrieving revision 1.9
diff -u -w -u -w -r1.9 errdbg.h
--- common/dbgtool/pub/errdbg.h	16 Jun 2003 22:52:28 -0000	1.9
+++ common/dbgtool/pub/errdbg.h	11 Jul 2003 16:19:08 -0000
@@ -143,7 +143,9 @@
 #define DOL_CORELOADTIME           24
 #define DOL_RTSP                   25
 #define DOL_STREAMSOURCEMAP        26
-#define NUM_DOL_CODES              27 // Make sure this is updated when
+#define DOL_REALEVENTS             27
+#define DOL_REALEVENTS_EXTENDED    28
+#define NUM_DOL_CODES              29 // Make sure this is updated when
                                       // new user codes are added
 
 
@@ -178,6 +180,8 @@
     "Core Load Time",
     "RTSP",
     "Stream and Source",
+    "RealEvents Renderer",
+    "RealEvents Renderer Extended",
     0
 };
 
@@ -216,6 +220,8 @@
     FALSE,      // Core Load Time
     FALSE,      // RTSP
     FALSE,      // Stream and Source Info
+    TRUE,       // RealEvents Renderer
+    FALSE,      // RealEvents Renderer Extended
     0
 };
 #endif
Index: datatype/rm/events/renderer/Umakefil
===================================================================
RCS file: /cvs/datatype/rm/events/renderer/Umakefil,v
retrieving revision 1.3
diff -u -w -u -w -r1.3 Umakefil
--- datatype/rm/events/renderer/Umakefil	7 Feb 2003 01:03:17 -0000	1.3
+++ datatype/rm/events/renderer/Umakefil	11 Jul 2003 16:19:09 -0000
@@ -36,8 +36,7 @@
 # 
 UmakefileVersion(2,1)
 
-project.AddModuleIncludes("common/include",
-                          "common/runtime/pub")
+project.AddModuleIncludes("common/include")
 
 project.AddSources("smmrendr.cpp",
                    "csync.cpp",
Index: datatype/rm/events/renderer/csyncmm.cpp
===================================================================
RCS file: /cvs/datatype/rm/events/renderer/csyncmm.cpp,v
retrieving revision 1.2
diff -u -w -u -w -r1.2 csyncmm.cpp
--- datatype/rm/events/renderer/csyncmm.cpp	19 Feb 2003 13:47:51 -0000	1.2
+++ datatype/rm/events/renderer/csyncmm.cpp	11 Jul 2003 16:19:09 -0000
@@ -48,6 +48,7 @@
 
 #include "ihxpckts.h"
 #include "hxbuffer.h"
+#include "hxerror.h"
 #include "hxhyper.h"
 #include "hxprefs.h"
 #include "hxrendr.h"
@@ -76,6 +77,7 @@
 #include "cmmevent.h"  // for CSyncMMEvent
 #include "netbyte.h"   // For byte order swapping
 #include "hxevtype.h"  // new home for event types
+#include "smmrmlog.h"
 
 #include "hxheap.h"
 #ifdef _DEBUG
@@ -94,6 +96,7 @@
     m_pContext            = NULL;
     m_pLastPacket         = NULL;
     m_pHyperNavigate      = NULL;
+    m_pErrorMessages      = NULL;
     m_ulLastTime          = 0;
     m_ulRegistryID        = 0;
     m_pScheduler          = NULL;
@@ -113,6 +116,10 @@
     // Get the context from the actual renderer
     theOwner->GetContext(m_pContext);
 
+    // QI for IHXErrorMessages - ok if not implemented
+    m_pContext->QueryInterface(IID_IHXErrorMessages,
+                               (void**) &m_pErrorMessages);
+
     if (HXR_OK != m_pOwner->QueryInterface(IID_IHXHyperNavigate, (void**)&m_pHyperNavigate))
     {
 	m_pHyperNavigate = NULL;
@@ -175,6 +182,7 @@
 
     HX_RELEASE(m_pRegistry);
     HX_RELEASE(m_pHyperNavigate);
+    HX_RELEASE(m_pErrorMessages);
 #if defined(HELIX_FEATURE_MEDIAMARKER)
     HX_RELEASE(m_pMediaMarkerManager);
 #endif /* #if defined(HELIX_FEATURE_MEDIAMARKER) */
@@ -390,6 +398,8 @@
 HX_RESULT 
 CSyncMM::OnPacket(IHXPacket* pPacket, LONG32 lTimeOffset)
 {
+    MLOG_EVENTEX(m_pErrorMessages, "CSyncMM::OnPacket(0x%08x,%ld) ts=%lu\n",
+                 pPacket, lTimeOffset, (pPacket ? pPacket->GetTime() : 0));
     UINT16	    uiSequenceNum   = 0;
     CSyncMMEvent*   pEvent	    = NULL;
     IHXBuffer*	    pBuffer	    = 0;
@@ -418,6 +428,13 @@
 	if (pEvent)
 	{
 	    pEvent->OnPacket(pchData,pBuffer->GetSize(), lTimeOffset);
+            MLOG_EVENT(m_pErrorMessages,
+                       "Event Inserted (%u,%u,%lu,%lu,%s)\n",
+                       pEvent->GetSequenceNum(),
+                       pEvent->GetEventID(),
+                       pEvent->GetStartTime(),
+                       pEvent->GetEndTime(),
+                       (pEvent->GetText() ? pEvent->GetText() : "NULL"));
 #if defined(HELIX_FEATURE_MEDIAMARKER)
             if (pEvent->GetEventID() == HXEventMediaSample_URL &&
                 !strncmp(pEvent->GetText(), "marker://", 9))
@@ -480,6 +497,7 @@
 HX_RESULT 
 CSyncMM::OnTimeSync(ULONG32 ulTime)
 {
+    MLOG_EVENTEX(m_pErrorMessages, "CSyncMM::OnTimeSync(%lu)\n", ulTime);
     int		    nNumElements    = 0;
     CSyncMMEvent*   pEvent          = NULL;
     LISTPOSITION    lpPosition      = 0;
@@ -500,6 +518,13 @@
 	    {
 		if (pEvent->IsEventOver(ulTime))
 		{
+                    MLOG_EVENT(m_pErrorMessages,
+                               "Event over - Deleting event (%u,%u,%lu,%lu,%s)\n",
+                               pEvent->GetSequenceNum(),
+                               pEvent->GetEventID(),
+                               pEvent->GetStartTime(),
+                               pEvent->GetEndTime(),
+                               (pEvent->GetText() ? pEvent->GetText() : "NULL"));
 		    DeleteEventFromList(pEvent);
 		    HX_DELETE(pEvent);
 		}
@@ -514,6 +539,13 @@
 		    SafeStrCpy(m_szString, pURL, 500);
 		    ////////////////REMOVE///////////
 
+                    MLOG_EVENT(m_pErrorMessages,
+                               "Rendering event (%u,%u,%lu,%lu,%s)\n",
+                               pEvent->GetSequenceNum(),
+                               pEvent->GetEventID(),
+                               pEvent->GetStartTime(),
+                               pEvent->GetEndTime(),
+                               (pEvent->GetText() ? pEvent->GetText() : "NULL"));
 		    //DeleteEventFromList(pEvent);
 		    //mark event as rendered and keep it in list
 		    //received events with the same sequence number will 
Index: datatype/rm/events/renderer/csyncmm.h
===================================================================
RCS file: /cvs/datatype/rm/events/renderer/csyncmm.h,v
retrieving revision 1.2
diff -u -w -u -w -r1.2 csyncmm.h
--- datatype/rm/events/renderer/csyncmm.h	19 Feb 2003 13:47:51 -0000	1.2
+++ datatype/rm/events/renderer/csyncmm.h	11 Jul 2003 16:19:09 -0000
@@ -48,6 +48,7 @@
 typedef _INTERFACE IHXMediaMarkerManager   IHXMediaMarkerManager;
 #endif /* #if defined(HELIX_FEATURE_MEDIAMARKER) */
 typedef _INTERFACE IHXScheduler	    IHXScheduler;
+typedef _INTERFACE IHXErrorMessages IHXErrorMessages;
 
 /////////////////////////////////////////////////////////////////////////////
 // 
@@ -67,6 +68,7 @@
     IUnknown*		m_pContext; 
     IHXPacket*		m_pLastPacket;
     IHXHyperNavigate*	m_pHyperNavigate;
+    IHXErrorMessages*   m_pErrorMessages;
     ULONG32		m_ulLastTime;
     UINT32		m_ulRegistryID;
     CHXString		m_ActualURL;
Index: datatype/rm/events/renderer/plugin.cpp
===================================================================
RCS file: /cvs/datatype/rm/events/renderer/plugin.cpp,v
retrieving revision 1.1.1.1
diff -u -w -u -w -r1.1.1.1 plugin.cpp
--- datatype/rm/events/renderer/plugin.cpp	18 Oct 2002 01:56:32 -0000	1.1.1.1
+++ datatype/rm/events/renderer/plugin.cpp	11 Jul 2003 16:19:09 -0000
@@ -43,6 +43,7 @@
 #include "hxplugn.h"
 #include "hxccf.h"
 #include "hxhyper.h"
+#include "hxerror.h"
 #include "hxmon.h"
 #include "hxengin.h"
 #include "hxprefs.h"
-------------- next part --------------
/* ***** 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 SMMRMLOG_H
#define SMMRMLOG_H

// Include files
// Usually we don't include header files from
// other header files. However, the idea here is
// to produce a single header file on a per-module
// basis that can be used to include all the logging
// definitions necessary for that module.
#include "multilog.h"

//
// For debugging event issues in the SMIL renderer
//
//#define MLOG_EVENT_COMPILED_OUT
#if defined(_DEBUG)
#define EVENT_TARGET_FILE      0
#define EVENT_TARGET_DEBUGGER  1
#define EVENT_TARGET_COREDEBUG 0
#else
#define EVENT_TARGET_FILE      0
#define EVENT_TARGET_DEBUGGER  0
#define EVENT_TARGET_COREDEBUG 1
#endif

// Create an inline MLOG_EVENT() function
#ifndef MLOG_EVENT_COMPILED_OUT
INIT_MULTILOG_GROUP(EVENT,
                    EVENT_TARGET_FILE,
                    EVENT_TARGET_DEBUGGER,
                    EVENT_TARGET_COREDEBUG,
                    "smmrendr_event.log",
                    DOL_REALEVENTS,
                    NULL);
#else
#define MLOG_EVENT if(0)
#endif

//
// For debugging event issues in the SMIL renderer
//
//#define MLOG_EVENTEX_COMPILED_OUT
#if defined(_DEBUG)
#define EVENTEX_TARGET_FILE      0
#define EVENTEX_TARGET_DEBUGGER  1
#define EVENTEX_TARGET_COREDEBUG 0
#else
#define EVENTEX_TARGET_FILE      0
#define EVENTEX_TARGET_DEBUGGER  0
#define EVENTEX_TARGET_COREDEBUG 1
#endif

// Create an inline MLOG_EVENT() function
#ifndef MLOG_EVENTEX_COMPILED_OUT
INIT_MULTILOG_GROUP(EVENTEX,
                    EVENTEX_TARGET_FILE,
                    EVENTEX_TARGET_DEBUGGER,
                    EVENTEX_TARGET_COREDEBUG,
                    "smmrendr_eventex.log",
                    DOL_REALEVENTS_EXTENDED,
                    NULL);
#else
#define MLOG_EVENTEX if(0)
#endif

#endif // #ifndef SMMRMLOG_H

-------------- next part --------------
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at datatype.helixcommunity.org
For additional commands, e-mail: dev-help at datatype.helixcommunity.org


More information about the Datatype-dev mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.