[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-datatype-cvs
Subject:    [Datatype-cvs]
From:       ckarusala () helixcommunity ! org
Date:       2011-12-29 9:43:01
[Download RAW message or body]

Update of /cvsroot/datatype/mpeg2ts/stream
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv14408

Modified Files:
      Tag: SERVER_14_2_GLOBECOMM_LR
	Umakefil tsstreamff.cpp 
Added Files:
      Tag: SERVER_14_2_GLOBECOMM_LR
	dllumakefil libumakefil 
Log Message:

MPEG2TS Stream format changes
==============================
Updated the Umakefile to create a static library only when built with server. 

Added server debug messages corresponding to all the HXLOG messages.

Updated to read the timeout config values from the incoming IHXRequest instead of \
from Preferences while running in server.

The logic of sending StreamDones when the stream times-out is not always sending \
StreamDone on all the streams. Fixed this.



Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/mpeg2ts/stream/Umakefil,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.4.2.1
diff -u -d -r1.1.2.4 -r1.1.2.4.2.1
--- Umakefil	9 Jul 2011 01:00:10 -0000	1.1.2.4
+++ Umakefil	29 Dec 2011 09:42:57 -0000	1.1.2.4.2.1
@@ -1,85 +1,46 @@
 # 
-# ***** BEGIN LICENSE BLOCK *****
-# Source last modified: $Id$
-# 
-# Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
-# 
-# The contents of this file, and the files included with this file,
-# are subject to the current version of the RealNetworks Public
-# Source License (the "RPSL") available at
-# http://www.helixcommunity.org/content/rpsl unless you have licensed
-# the file under the current version of the RealNetworks Community
-# Source License (the "RCSL") available at
-# 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 (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
+# ***** BEGIN LICENSE BLOCK ***** 
+# Version: RCSL 1.0/RPSL 1.0 
+#  
+# Portions Copyright (c) 1995-2012 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. 
 # 
-# Contributor(s):
+# Technology Compatibility Kit Test Suite(s) Location: 
+#    http://www.helixcommunity.org/content/tck 
 # 
-# ***** END LICENSE BLOCK *****
+# Contributor(s): 
+#  
+# ***** END LICENSE BLOCK ***** 
 # 
 
-UmakefileVersion(2,2)
-
-project.AddModuleIncludes("common/include")
-                          
-                          
-project.AddSources("tsstreamff.cpp",
-                   "guids.cpp")
+UmakefileVersion(2,1)
 
-project.AddModuleLibraries("common/container[contlib]",
-                           "common/dbgtool[debuglib]",
-                           "common/fileio[fileiolib]",
-                           "common/runtime[runtlib]",
-                           "common/system[syslib]",
-                           "common/util[utillib]",
-                           "common/log/logutil[logutillib]",
-                           "common/netio[netiolib]",
-                           "datatype/common/util[dtutillib]",
-                           "datatype/mpeg2ts/demuxer[tsdemuxerlib]",
-                           "datatype/mpg/common[mpgcommon]",
-                           "datatype/mp3/common[mp3lib]",
-                           "datatype/ac3/common[ac3lib]",
-                           "datatype/h264/common[h264comlib]")
-                          
-project.ExportFunction("RMACreateInstance",
-                       "IUnknown** ppObj",
-                       "common/include",
-                       "hxcom.h")
-                       
-project.ExportFunction("CanUnload", "void")
-project.ExportFunction("RMAShutdown", "void")
+if project.IsDefined("HELIX_FEATURE_SERVER"):
+    MultiTargetMake("libumakefil")
+else:
+    MultiTargetMake("libumakefil",
+                    "dllumakefil")
 
-DLLTarget("tsstream")
 
-DependTarget()

--- NEW FILE: libumakefil ---
# 
# ***** BEGIN LICENSE BLOCK *****
# Source last modified: $Id: libumakefil,v 1.1.2.1 2011/12/29 09:42:58 ckarusala Exp \
$ # 
# Portions Copyright (c) 1995-2012 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 (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/container/pub",
                          "common/dbgtool/pub",
                          "common/fileio/pub",
                          "common/runtime/pub",
                          "common/system/pub",
                          "common/util/pub",
                          "common/log/logutil/pub",
                          "common/netio/pub/",
                          "datatype/common/util/pub",
                          "datatype/mpeg2ts/demuxer/pub",
                          "datatype/mpg/common/pub",
                          "datatype/mp3/common/pub",
                          "datatype/ac3/common/pub",
                          "datatype/h264/common/pub")

if project.IsDefined("HELIX_FEATURE_SERVER"):
    project.AddModuleIncludes("server/common/util/pub")

project.AddSources("tsstreamff.cpp")
				                             
LibraryTarget("tsstreamlib")

DependTarget()

--- NEW FILE: dllumakefil ---
# 
# ***** BEGIN LICENSE BLOCK *****
# Source last modified: $Id: dllumakefil,v 1.1.2.1 2011/12/29 09:42:57 ckarusala Exp \
$ # 
# Portions Copyright (c) 1995-2012 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 (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")
                          
                          
project.AddSources("tsstreamff.cpp",
                   "guids.cpp")

project.AddModuleLibraries("common/container[contlib]",
                           "common/dbgtool[debuglib]",
                           "common/fileio[fileiolib]",
                           "common/runtime[runtlib]",
                           "common/system[syslib]",
                           "common/util[utillib]",
                           "common/log/logutil[logutillib]",
                           "common/netio[netiolib]",
                           "datatype/common/util[dtutillib]",
                           "datatype/mpeg2ts/demuxer[tsdemuxerlib]",
                           "datatype/mpg/common[mpgcommon]",
                           "datatype/mp3/common[mp3lib]",
                           "datatype/ac3/common[ac3lib]",
                           "datatype/h264/common[h264comlib]")
                          
project.ExportFunction("RMACreateInstance",
                       "IUnknown** ppObj",
                       "common/include",
                       "hxcom.h")
                       
project.ExportFunction("CanUnload", "void")
project.ExportFunction("RMAShutdown", "void")

DLLTarget("tsstream")

DependTarget()

Index: tsstreamff.cpp
===================================================================
RCS file: /cvsroot/datatype/mpeg2ts/stream/tsstreamff.cpp,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.14.2.1
diff -u -d -r1.1.2.14 -r1.1.2.14.2.1
--- tsstreamff.cpp	21 Nov 2011 02:34:54 -0000	1.1.2.14
+++ tsstreamff.cpp	29 Dec 2011 09:42:58 -0000	1.1.2.14.2.1
@@ -71,6 +71,10 @@
 #include "hxprefutil.h"
 #include "hxtick.h"
 
+#ifdef HELIX_FEATURE_SERVER
+#include "mp2tsdebug.h"
+#endif
+
 #include "hxver.h"
 #include "tsstreamff.ver"
 
@@ -91,7 +95,7 @@
 const char* const CTSStreamFF::zm_pFileOpenNames[]  = {NULL};
 const char* const CTSStreamFF::zm_szURISchemes      = "mpts|m2ts";
 
-
+#ifndef HELIX_FEATURE_SERVER
 STDAPI ENTRYPOINTCALLTYPE ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
 {
     *ppIUnknown = (IUnknown*)(IHXPlugin*)new CTSStreamFF();
@@ -112,6 +116,7 @@
 {
     return HXR_OK;
 }
+#endif
 
 /*
  *  constructor, destructor
@@ -158,11 +163,21 @@
     , m_ulThreadID(0)
 #endif
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_CONS,
+        ("%p: CTSStreamFF::CTSStreamFF()\n", this));
+#endif
+
     memset(m_szLanguage, 0, 4);
 }
 
 CTSStreamFF::~CTSStreamFF()
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_CONS,
+        ("%p: CTSStreamFF::~CTSStreamFF()\n", this));
+#endif
+
     ShutDown();
 }
 
@@ -240,6 +255,11 @@
 STDMETHODIMP
 CTSStreamFF::InitPlugin(IUnknown* pContext)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::InitPlugin()\n", this));
+#endif
+
     if (pContext)
     {
         HX_RELEASE(m_pContext);
@@ -273,6 +293,11 @@
     REF(UINT32)             ulVersionNumber
 )
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::GetPluginInfo()\n", this));
+#endif
+
     bLoadMultiple = TRUE;
 
     pDescription    = zm_szDescription;
@@ -288,6 +313,11 @@
  */
 STDMETHODIMP CTSStreamFF::GetProperties(REF(IHXValues*) rpProps)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::GetProperties()\n", this));
+#endif
+
     HX_RESULT retVal = HXR_UNEXPECTED;
 
     if (m_pCCF && zm_szURISchemes)
@@ -327,6 +357,11 @@
  */
 STDMETHODIMP CTSStreamFF::Close(void)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::Close()\n", this));
+#endif
+
     // Make sure I don't get deleted in the Close methods
     AddRef();
     ShutDown();
@@ -337,6 +372,11 @@
 
 void CTSStreamFF::ShutDown()
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::ShutDown()\n", this));
+#endif
+
     m_eState = Closed;
     m_bConnected = FALSE;
     m_ulProgramCount = 0;
@@ -375,6 +415,11 @@
 
 void CTSStreamFF::CloseSocket()
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::CloseSocket()\n", this));
+#endif
+
     m_bConnected = FALSE;
     if (m_pMCastSocket)
     {
@@ -399,6 +444,11 @@
     REF(const char**)   pFileOpenNames
 )
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::GetFileFormatInfo()\n", this));
+#endif
+
     pFileMimeTypes  = (const char**)zm_pFileMimeTypes;
     pFileExtensions = (const char**)zm_pFileExtensions;
     pFileOpenNames  = (const char**)zm_pFileOpenNames;
@@ -413,6 +463,12 @@
     IHXFileObject*          pFileObject
 )
 {
+
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::InitFileFormat() - Entry\n", this));
+#endif
+
 #ifdef _DEBUG
     m_ulThreadID = HXGetCurrentThreadID();
 #endif
@@ -518,6 +574,17 @@
         }
         HX_RELEASE(pReqHeaders);
     }
+
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_INFO,("%p: Requested URI: %s\n", 
+        this, pszRequestURI ? pszRequestURI : "unknown"));
+
+    TSDPRINTF(B_INFO,
+        ("%p: MetaDataOnly: %d, ProgramNum: %u, AudioStream: %u, VideoStream: %u, \
AudioPID: %u, VideoPID: %u\n",  +        this, m_bFullMetaRequest, m_usProgramNum, \
m_usAudioStream, m_usVideoStream,  +        m_usAudioPID, m_usVideoPID));
+#endif
+
     if (SUCCEEDED(rc))
     {
         HX_RELEASE(m_pNetServices);
@@ -559,12 +626,22 @@
         m_pFFResponse->InitDone(rc);
     }
 
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::InitFileFormat() - Exit. Status: 0x%x\n", this, rc));
+#endif
+
     return rc;
 }
 
 STDMETHODIMP CTSStreamFF::GetFileHeader(void)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::GetFileHeader\n", this));
+#else
     HXLOGL4(HXLOG_MPTS, "CTSStreamFF::GetFileHeader");
+#endif
 
     HX_RESULT rc = HXR_OK;
     if (m_eState == RequestReady)
@@ -593,7 +670,12 @@
 
 STDMETHODIMP CTSStreamFF::GetStreamHeader(UINT16 streamNo)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::GetStreamHeader\n", this));
+#else
     HXLOGL4(HXLOG_MPTS, "CTSStreamFF::GetStreamHeader(%hu)", streamNo);
+#endif
 
     // file header must be sent before we can process GetStreamHeader request
     if (!m_pTSDemuxer->IsSeenPMT() || streamNo >= m_ulStreamCount
@@ -620,7 +702,12 @@
                 retVal = PrepareStreamHeader(streamNo, pStreamHeader);
                 if (retVal == HXR_OK)
                 {
+#ifdef HELIX_FEATURE_SERVER
+                    TSDPRINTF(B_INFO,
+                        ("%p: StreamHeaderReady for %hu\n", this, streamNo));
+#else
                     HXLOGL4(HXLOG_MPTS, "StreamHeaderReady(%hu)", streamNo);
+#endif
 
                     m_eState = Ready;
                     m_pFFResponse->StreamHeaderReady(retVal, pStreamHeader);
@@ -629,8 +716,12 @@
                 }
 
                 HX_RELEASE(pStreamHeader);
-
+#ifdef HELIX_FEATURE_SERVER
+                TSDPRINTF(B_ENTRY,
+                        ("%p: GetStreamHeader for %hu waiting for data\n", this, \
streamNo)); +#else
                 HXLOGL4(HXLOG_MPTS, "GetStreamHeader(%hu) waiting for data", \
streamNo); +#endif
                 m_eState = GetStreamHeaderPending;
                 m_pStreamInfo[streamNo].m_bHeaderPending = TRUE;
                 ++m_usTotalPendingHeaders;
@@ -725,6 +816,7 @@
     else if (m_eState == TimedOut)
     {
         // Timeout at this point is taken to be end of stream.
+        m_pStreamInfo[usStreamNo].m_bPacketRequested = TRUE;
         SendPacketsEOS();
     }
     else
@@ -748,6 +840,11 @@
                              UINT32 ulVecLen, 
                              IHXSockAddr** ppAddrVec)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::GetAddrInfoDone() - Entry\n", this));
+#endif
+
     HX_ASSERT(HXGetCurrentThreadID() == m_ulThreadID);
 
     HX_RESULT rc = HXR_OK;
@@ -807,6 +904,11 @@
         m_pFFResponse->InitDone(status);
     }
 
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::GetAddrInfoDone() - Exit\n", this));
+#endif
+
     return HXR_OK;
 }
 
@@ -840,7 +942,7 @@
             while(m_pSocket && --nCount >= 0 && SUCCEEDED(m_pSocket->Read(&pBuf)))
             {
                 ReadDone(pBuf);
-                pBuf->Release();
+                HX_RELEASE(pBuf);
             }
         }
         break;
@@ -887,6 +989,11 @@
 CTSStreamFF::ParseURI(const char* pszRequestURI, 
                       char*& pszAddress, UINT16& usPort)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::ParseURI()\n", this));
+#endif
+
     HX_RESULT rc = HXR_OUTOFMEMORY;
 
     pszAddress = new char [strlen(pszRequestURI)];
@@ -960,6 +1067,11 @@
 HX_RESULT 
 CTSStreamFF::Connect(IHXSockAddr* pAddr)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::Connect() - Entry\n", this));
+#endif
+
     m_bConnected = FALSE;
 
     CloseSocket();
@@ -1016,6 +1128,36 @@
         rc = m_pSocket->SelectEvents(HX_SOCK_EVENT_READ | HX_SOCK_EVENT_CLOSE);
     }
     
+#ifdef HELIX_FEATURE_SERVER
+    if (SUCCEEDED(rc) && m_pRequest)
+    {
+        //Let's get the timeout values from m_pRequest
+        IHXValues* pReqHeaders = NULL;
+        if (SUCCEEDED(m_pRequest->GetRequestHeaders(pReqHeaders)) && pReqHeaders)
+        {
+            UINT32 ulVal = 0;
+            
+            if (SUCCEEDED(pReqHeaders->GetPropertyULONG32("StartupTimeout", ulVal)) \
&& +                ulVal > 0)
+            {
+                m_ulStartupTimeout = ulVal;
+            }
+
+            if (SUCCEEDED(pReqHeaders->GetPropertyULONG32("PacketTimeout", ulVal)) \
&& +                ulVal > 0)
+            {
+                m_ulPacketTimeout = ulVal;
+            }
+
+            if (SUCCEEDED(pReqHeaders->GetPropertyULONG32("InitTimeout", ulVal)) &&
+                ulVal > 0)
+            {
+                m_ulInitTimeout = ulVal;
+            }
+        }
+        HX_RELEASE(pReqHeaders);
+    }
+#else
     if (SUCCEEDED(rc))
     {
         rc = m_pContext->QueryInterface(IID_IHXPreferences, (void**)&pPrefs);
@@ -1025,7 +1167,11 @@
         ReadPrefUINT32(pPrefs, "MPTS\\ConnectionTimeout", m_ulStartupTimeout);
         ReadPrefUINT32(pPrefs, "MPTS\\PacketTimeout", m_ulPacketTimeout);
         ReadPrefUINT32(pPrefs, "MPTS\\InitTimeout", m_ulInitTimeout);
+    }
+#endif
 
+    if (SUCCEEDED(rc))
+    {
         if (m_ulInitTimeout < m_ulPacketTimeout)
         {
             m_ulInitTimeout = m_ulPacketTimeout;
@@ -1049,7 +1195,14 @@
             pszRequestURI = "[unknown]";
         }
 
+#ifdef HELIX_FEATURE_SERVER
+        TSDPRINTF(B_INFO,
+            ("%p: Looking for stream at %s. ", this, pszRequestURI));
+        TSDPRINTF(B_INFO, ("StartupTimeOut: %u, PacketTimeout: %u, InitTimeout: %u, \
CBInterval: %u\n", +            m_ulStartupTimeout, m_ulPacketTimeout, \
m_ulInitTimeout, m_ulCBInterval)); +#else
         HXTLOG(LC_APP_INFO, NETINPUT, 8520, "Looking for stream at %s.", \
pszRequestURI); +#endif
 
         m_ulCBCountTimeOut = (m_ulStartupTimeout + m_ulCBInterval/2) / \
                m_ulCBInterval;
         m_ulTimeOutCB = m_pScheduler->RelativeEnter((IHXCallback*) this, \
m_ulCBInterval); @@ -1061,6 +1214,12 @@
     {
         CloseSocket();
     }
+
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::Connect() - Exit. Status: 0x%x\n", this, rc));
+#endif
+
     return rc;
 }
 
@@ -1198,13 +1357,22 @@
 HX_RESULT
 CTSStreamFF::FindMediaInfo(BYTE* pData, UINT32 ulReadSize, UINT32& ulDataUsed)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::FindMediaInfo()\n", this));
+#endif
+
     HX_RESULT rc = HXR_NO_DATA;
     ulDataUsed = 0;
 
     if (!m_pTSDemuxer->IsSeenPAT())
     {
         // search and process PAT
+#ifdef HELIX_FEATURE_SERVER
+        TSDPRINTF(B_INFO, ("%p: Looking for PAT\n", this));
+#else
         HXLOGL3(HXLOG_MPTS, "Looking for PAT...");
+#endif
         rc = m_pTSDemuxer->ParsePAT(pData, ulReadSize, &ulDataUsed);
         if (rc == HXR_OK)
         {
@@ -1225,7 +1393,11 @@
                 rc = HXR_FAIL;
             }
 
+#ifdef HELIX_FEATURE_SERVER
+            TSDPRINTF(B_INFO, ("%p: Found PAT with %lu programs\n", this, \
m_ulProgramCount)); +#else
             HXLOGL4(HXLOG_MPTS, "Found PAT with %lu programs", m_ulProgramCount);
+#endif
         }
     }
 
@@ -1233,7 +1405,11 @@
         !m_pTSDemuxer->IsSeenPMT())
     {
         // search and process PMT
+#ifdef HELIX_FEATURE_SERVER
+        TSDPRINTF(B_INFO, ("%p: Looking for PMT...\n", this));
+#else
         HXLOGL3(HXLOG_MPTS, "Looking for PMT...");
+#endif
         UINT32 ulPMTUsed = 0;
         rc = m_pTSDemuxer->ParsePMT(pData + ulDataUsed, 
                 ulReadSize - ulDataUsed, &ulPMTUsed);
@@ -1296,7 +1472,11 @@
             if (SUCCEEDED(rc))
             {
                 m_ulStreamCount = m_pTSDemuxer->GetStreamCount();
+#ifdef HELIX_FEATURE_SERVER
+                TSDPRINTF(B_INFO, ("%p: Found PMT with %lu streams\n", this, \
m_ulStreamCount)); +#else
                 HXLOGL4(HXLOG_MPTS, "Found PMT, %lu streams", m_ulStreamCount);
+#endif
             }
         }
     }
@@ -1307,6 +1487,11 @@
 HX_RESULT
 CTSStreamFF::HandleProgramData()
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::HandleProgramData()\n", this));
+#endif
+
     // make sure we have at least the decoder setup info from all streams
     for (UINT16 i=0; i<m_ulStreamCount; i++)
     {
@@ -1359,6 +1544,11 @@
 HX_RESULT
 CTSStreamFF::HandleStreamData()
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::HandleStreamData()\n", this));
+#endif
+
     HX_ASSERT(m_pStreamInfo);
     if (!m_pStreamInfo)
     {
@@ -1401,6 +1591,11 @@
 HX_RESULT
 CTSStreamFF::PrepareFileHeader(REF(IHXValues*) pFileHeader)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::PrepareFileHeader()\n", this));
+#endif
+
     HX_RESULT retVal = HXR_UNEXPECTED;
 
     // require at least one stream
@@ -1452,6 +1647,11 @@
 HX_RESULT
 CTSStreamFF::PrepareStreamHeader(UINT16 streamNo, REF(IHXValues*) pStreamHeader)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::PrepareStreamHeader() for Stream: %u\n", this, \
streamNo)); +#endif
+
     HX_RESULT retVal = HXR_UNEXPECTED;
 
     if (streamNo < m_ulStreamCount)
@@ -1560,6 +1760,11 @@
 void
 CTSStreamFF::SendPacketsEOS()
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::SendPacketsEOS() - Entry\n", this));
+#endif
+
     IHXRTPPacket* pPacket = NULL;
     IHXRTPPacket* pNextPacket = NULL;
     UINT16 usStreamNo = 0;
@@ -1590,6 +1795,7 @@
         {
             // This stream is done now.
             m_pStreamInfo[i].m_bStreamDone = TRUE;
+            m_pStreamInfo[i].m_bPacketRequested = FALSE;
             m_pFFResponse->StreamDone(i);
         }
     }
@@ -1615,18 +1821,30 @@
         m_pFFResponse->PacketReady(HXR_OK, pPacket);
         HX_RELEASE(pPacket);
 
-        if (!pNextPacket)
+        if (!pNextPacket && !m_pStreamInfo[usStreamNo].m_bStreamDone)
         {
             // This stream is done now.
-            m_pStreamInfo->m_bStreamDone = TRUE;
+            m_pStreamInfo[usStreamNo].m_bStreamDone = TRUE;
+            m_pStreamInfo[usStreamNo].m_bPacketRequested = FALSE;
             m_pFFResponse->StreamDone(usStreamNo);
         }
     }
+
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::SendPacketsEOS() - Exit\n", this));
+#endif
+
 }
 
 void
 CTSStreamFF::StopStreamFF()
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::StopStreamFF()\n", this));
+#endif
+
     if (m_ulTimeOutCB)
     {
         m_pScheduler->Remove(m_ulTimeOutCB);
@@ -1638,6 +1856,11 @@
 void
 CTSStreamFF::CheckStreamInfoTimeout()
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::CheckStreamInfoTimeout()\n", this));
+#endif
+
     if (!m_bStreamInfoReady && m_ulInitTimeout <
         CALCULATE_ELAPSED_TICKS(m_ulStartTime, HX_GET_TICKCOUNT()))
     {
@@ -1653,6 +1876,11 @@
 void
 CTSStreamFF::HandleTimeout(HXBOOL bStreamInfo)
 {
+#ifdef HELIX_FEATURE_SERVER
+    TSDPRINTF(B_ENTRY,
+        ("%p: CTSStreamFF::HandleTimeout()\n", this));
+#endif
+
     // XXXJDG There is no real way to map client logs to producer logs
     // or vice versa. And there's no decent way to get proper errors
     // or anything propogated through dtdriver. So for now I have to
@@ -1689,8 +1917,12 @@
         case Ready:
         case GetPacketPending:
         {
+#ifdef HELIX_FEATURE_SERVER
+            TSDPRINTF(B_TIMEOUT, ("%p: The stream at \"%s\" has ended.\n", this, \
pszRequestURI)); +#else
             HXLOGL3(HXLOG_MPTS, "The stream at \"%s\" has ended.", pszRequestURI);
             HXTLOG(LC_APP_INFO, NETINPUT, 8522, "The stream at %s has been \
interrupted.", pszRequestURI); +#endif
             
             // Keep sending the packets we have.
             SendPacketsEOS();
@@ -1699,8 +1931,13 @@
 
         case GetStreamHeaderPending:
         {
+#ifdef HELIX_FEATURE_SERVER
+            TSDPRINTF(B_TIMEOUT, ("%p: ", this));
+            TSDPRINTF(B_TIMEOUT, (szLogMessage, pszRequestURI));
+#else
             HXLOGL1(HXLOG_MPTS, szLogMessage, pszRequestURI);
             HXTLOG(LC_APP_INFO, NETINPUT, ulMsgID, szLogMessage, pszRequestURI);
+#endif
             m_pFFResponse->StreamHeaderReady(HXR_SERVER_TIMEOUT, NULL);
         }
         break;
@@ -1710,9 +1947,13 @@
             if (!bStreamInfo && !m_bConnected)
             {
                 // We have not received anything on the specified port.
+#ifdef HELIX_FEATURE_SERVER
+                TSDPRINTF(B_TIMEOUT, ("%p: No stream could be found at \"%s\"\n", \
this, pszRequestURI)); +#else
                 HXLOGL1(HXLOG_MPTS, "No stream could be found at \"%s\".", 
                         pszRequestURI);
                 HXTLOG(LC_APP_INFO, NETINPUT, 8521, szLogMessage, pszRequestURI);
+#endif
 
                 HX_RESULT err = m_pSocket->GetType() == HX_SOCK_TYPE_MCAST ? 
                                     HXR_MULTICAST_UDP : HXR_NET_UDP;
@@ -1720,8 +1961,13 @@
             }
             else
             {
+#ifdef HELIX_FEATURE_SERVER
+                TSDPRINTF(B_TIMEOUT, ("%p: ", this));
+                TSDPRINTF(B_TIMEOUT, (szLogMessage, pszRequestURI));
+#else
                 HXLOGL1(HXLOG_MPTS, szLogMessage, pszRequestURI);
                 HXTLOG(LC_APP_INFO, NETINPUT, ulMsgID, szLogMessage, pszRequestURI);
+#endif
 
                 m_pFFResponse->FileHeaderReady(HXR_SERVER_TIMEOUT, NULL);
             }
@@ -1738,23 +1984,36 @@
             // We should never have scheduled a timeout before or during 
             // this state!
             HX_ASSERT(state != InitPending);
+#ifdef HELIX_FEATURE_SERVER
+            TSDPRINTF(B_TIMEOUT, ("%p: ", this));
+            TSDPRINTF(B_TIMEOUT, (szLogMessage, pszRequestURI));
+            TSDPRINTF(B_TIMEOUT, ("%p: Unexpected Timeout in InitPending state\n", \
this)); +#else
             HXLOGL1(HXLOG_MPTS, szLogMessage, pszRequestURI);
             HXTLOG(LC_APP_INFO, NETINPUT, ulMsgID, szLogMessage, pszRequestURI);
 
             HXLOGL4(HXLOG_MPTS, "Unexpected Timeout in InitPending state");
-    
+#endif
             m_pFFResponse->InitDone(HXR_SERVER_TIMEOUT);
         }
         break;
         default:
         {
             HX_ASSERT(FALSE);
+#ifdef HELIX_FEATURE_SERVER
+            TSDPRINTF(B_TIMEOUT, ("%p: ", this));
+            TSDPRINTF(B_TIMEOUT, (szLogMessage, pszRequestURI));
+            TSDPRINTF(B_TIMEOUT, ("%p: Unexpected Timeout in %s state\n", 
+                this, state == Error ? "Error" : state == TimedOut ? "TimedOut" : 
+                state == Closed ? "Closed" : "UNDEFINED"));
+#else
             HXLOGL1(HXLOG_MPTS, szLogMessage, pszRequestURI);
             HXTLOG(LC_APP_INFO, NETINPUT, ulMsgID, szLogMessage, pszRequestURI);
 
             HXLOGL4(HXLOG_MPTS, "Unexpected Timeout in %s state",
                 state == Error ? "Error" : state == TimedOut ? "TimedOut" : 
                 state == Closed ? "Closed" : "UNDEFINED");
+#endif
         }
         break;
     }


_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic