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

List:       helix-server-cvs
Subject:    [Server-cvs] engine/session clientsession.cpp,1.113,1.114
From:       jzeng () helixcommunity ! org
Date:       2008-08-07 19:20:35
Message-ID: 200808071923.m77JNZFZ028791 () dommarcmx ! xen ! 10east ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/session
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv29413/server/engine/session

Modified Files:
	clientsession.cpp 
Log Message:
Synopsis
========
sspl initial playback: putting hooks in clientsession
Branches:  head, server_12_1
Suggested Reviewer: Srinivas, Shantha 

Description
===========
This is the first step to integrate PlaylistControl with ClientSession.  Inside
ClientSession::OnURLDone, it the url is a playlist, then we will get the first clip and go through
the normal path.

Currently I can play back the playlist.  The player will play the first clip.


Files Affected
==============

server/engine/session/clientsession.cpp,v
server/engine/session/pub/clientsession.h,v
server-restricted/datatype/playlist/playlist_control.cpp,v
server-restricted/datatype/playlist/pub/playlist_control.h,v
server-restricted/protocol/http-ctrl/ssplutil.cpp,v
server-restricted/protocol/http-ctrl/pub/ssplutil.h,v

Testing Performed
=================

Unit Tests:
None.

Integration Tests:

play back test.hpl shows the first clip.


Leak Tests:

None.  Will do it later.

Performance Tests:
- None

Platforms Tested: linux-rhel4-i686, win32-vc7-i686 Build verified: linux-rhel4-i686, win32-vc7-i686





Index: clientsession.cpp
===================================================================
RCS file: /cvsroot/server/engine/session/clientsession.cpp,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- clientsession.cpp	30 Jul 2008 22:39:32 -0000	1.113
+++ clientsession.cpp	7 Aug 2008 19:20:33 -0000	1.114
@@ -93,6 +93,7 @@
 
 #ifdef HELIX_FEATURE_SERVER_SSPL
 #include "playlist_control.h"
+#include "ssplutil.h"
 #endif // HELIX_FEATURE_SERVER_SSPL
 
 #ifdef WIN32
@@ -195,7 +196,8 @@
       m_ulSwitchCount(0),
       m_bIsWirePayload(FALSE),
       m_szPath(NULL),
-      m_bPerStreamAdaptationReceived(FALSE)
+      m_bPerStreamAdaptationReceived(FALSE),
+      m_bIsPlaylist(FALSE)
 #ifdef HELIX_FEATURE_SERVER_FCS
       , m_pCurrentSwitch(NULL)
       , m_pCompletedSwitch(NULL)
@@ -209,6 +211,7 @@
 
 #ifdef HELIX_FEATURE_SERVER_SSPL
       , m_pPlaylistControl(NULL)
+      , m_bGettingFirstClip(FALSE)
 #endif // HELIX_FEATURE_SERVER_SSPL
 {
     m_pClient->AddRef();
@@ -1040,7 +1043,7 @@
     }
 
 #ifdef HELIX_FEATURE_SERVER_FCS
-    if(m_bIsFCSURL)
+    if(m_bIsFCSURL || m_bIsPlaylist)
     {
         pStreamHeader->GetPropertyULONG32("SamplesPerSecond", (*ppSlot)->m_sampleRate);
         pStreamHeader->GetPropertyULONG32("RTPTimestampConversionFactor", (*ppSlot)->m_RTPFactor);
@@ -1876,12 +1879,23 @@
 
     if(FAILED(status))
     {
+#ifdef HELIX_FEATURE_SERVER_SSPL
+        if(m_bIsPlaylist && m_pPlaylistControl && status != HXR_NO_MORE_FILES)
+        {
+            m_bGettingFirstClip = TRUE;
+            m_pPlaylistControl->GetNextMediaClip();
+            //continue on SSPLMediaClipReady();
+        }
+        else
+#endif //HELIX_FEATURE_SERVER_SSPL
+        {
         if (m_pSourceControl)
         {
             m_pSourceControl->Done();
         }
         m_pClient->GetProtocol()->setupStreams(0, this, CONVERT_HXR_ERROR(status));
     }
+    }
 
     // Left Function
     --m_ulFunctionsInUse;
@@ -2989,6 +3003,8 @@
     }
 
 #ifdef HELIX_FEATURE_SERVER_FCS
+    if (m_bIsFCSURL || m_bIsPlaylist)
+    {
     if (m_bIsFCSURL)
     {
         fcsRequestCheck.RetrieveQueryParams(pURL, NULL, &m_sGuid, NULL, NULL, &bAllowMDP);
@@ -3006,6 +3022,7 @@
                 HX_RELEASE(pGUID);
             }
         }
+        }
 
         IHXRegistry* pReg = NULL;
         m_pProc->pc->server_context->QueryInterface(IID_IHXRegistry, (void **)&pReg);
@@ -3538,7 +3555,28 @@
 
     HX_RESULT theErr = HXR_OK;
 
+#ifdef HELIX_FEATURE_SERVER_SSPL
+    if (m_pSrcFinder)
+    {
+        //for sspl, the first clip may not exist, so we need to release
+        //m_pSrcFinder and create another one to find the second clip
+
+        //for other cases, the assert is preserved.
+        if(m_bIsPlaylist)
+        {
+            m_pSrcFinder->Close();
+            HX_RELEASE(m_pSrcFinder);
+        }
+        else
+        {
+            HX_ASSERT(!m_pSrcFinder);
+        }
+    }
+#else
     HX_ASSERT(!m_pSrcFinder);
+#endif //HELIX_FEATURE_SERVER_SSPL
+
+
     m_pSrcFinder = new BasicSourceFinder(m_pProc, this);
 
     if (!m_pSrcFinder)
@@ -3967,7 +4005,7 @@
         // Make sure OnUrlDone callback can work.
         AddRef();
 #ifdef HELIX_FEATURE_SERVER_FCS
-        if(m_pStack->GetSize())
+        if(m_pStack->GetSize() || m_bGettingFirstClip)
         {
             HX_RELEASE(m_url);
             m_url = pURL;
@@ -4031,14 +4069,40 @@
 
         case AllowanceSerializer::allow_playback:
  #ifdef HELIX_FEATURE_SERVER_SSPL
+            if(SSPLUtil::IsSSPLURL(pRequest))
+            {
             m_pPlaylistControl = new CPlaylistControl(this, m_pProc->pc->server_context);
             m_pPlaylistControl->AddRef();
+
+                ServerRequestWrapper* pWrapper = NULL;
+                pWrapper = new ServerRequestWrapper(FS_HEADERS, pRequest);
+                pWrapper->AddRef();
+
+                m_pPlaylistControl->SetPlaylistFile(pWrapper);
+                pWrapper->Release();
+
+                m_bGettingFirstClip = TRUE;
+                m_bIsPlaylist = TRUE;
+                m_pPlaylistControl->GetNextMediaClip();
+                //continue on SSPLMediaClipReady();
+                break;
+            }
  #endif //HELIX_FEATURE_SERVER_SSPL
             FindSource(pSourceURL, pRequest);
             break;
 
         case AllowanceSerializer::reject_playback:
             HX_ASSERT(status != HXR_OK);
+
+#ifdef HELIX_FEATURE_SERVER_SSPL
+            if(m_bIsPlaylist && m_pPlaylistControl)
+            {
+                m_bGettingFirstClip = TRUE;
+                m_pPlaylistControl->GetNextMediaClip();
+                //continue on SSPLMediaClipReady();
+                break;
+            }
+#endif //HELIX_FEATURE_SERVER_SSPL
             FindDone(status, NULL, NULL);
             break;
         }
@@ -6227,7 +6291,8 @@
         * if it wants to
         */
 #ifdef HELIX_FEATURE_SERVER_FCS
-        if (m_pRealSourceControl->IsLive() && m_pClientSession->m_bIsFCSURL == FALSE)
+        if (m_pRealSourceControl->IsLive() &&
+            (m_pClientSession->m_bIsFCSURL == FALSE || m_pClientSession->m_bIsPlaylist == FALSE))
 #else
         if (m_pRealSourceControl->IsLive())
 #endif
@@ -6887,3 +6952,31 @@
 }
 
 #endif //HELIX_FEATURE_SERVER_FCS
+
+#ifdef HELIX_FEATURE_SERVER_SSPL
+HX_RESULT ClientSession::SSPLMediaClipReady(HX_RESULT status, IHXBuffer* pPath)
+{
+    if(FAILED(status) || !pPath)
+    {
+        return FindDone(HXR_NO_MORE_FILES, NULL, NULL);
+    }
+
+    ServerRequest* pRequest = NULL;
+    const char* pUrl = (const char*)pPath->GetBuffer();
+
+    while (pUrl && *pUrl && *pUrl == '/')
+    {
+        pUrl++;
+    }
+
+    pRequest = CloneRequest(pUrl);
+
+    IHXURL *pTempURL = new CHXURLParser((const char*)pUrl, strlen(pUrl));
+    pTempURL->AddRef();
+    OnURL(pTempURL, pRequest);
+    pTempURL->Release();
+
+    return HXR_OK;
+}
+
+#endif // HELIX_FEATURE_SERVER_SSPL


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

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