[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-datatype-cvs
Subject: [Datatype-cvs] flash/flashhost/platform/win32
From: cdunn () helixcommunity ! org
Date: 2007-09-28 21:13:56
Message-ID: 200709282114.l8SLESLv032109 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/datatype/flash/flashhost/platform/win32
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv11843/platform/win32
Modified Files:
flash_guest_player_ax.cpp flashhost.rc hxurlmoniker.cpp
Log Message:
FLVPlayback fixes.
Index: hxurlmoniker.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flashhost/platform/win32/hxurlmoniker.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hxurlmoniker.cpp 6 Jul 2007 22:00:26 -0000 1.2
+++ hxurlmoniker.cpp 28 Sep 2007 21:13:54 -0000 1.3
@@ -459,9 +459,8 @@
STDMETHODIMP CHXURLMoniker::Abort()
{
HXLOGL4(HXLOG_FPHR, "CHXURLMoniker[%p]::Abort()", this);
- HX_ASSERT(FALSE && "CHXURLMoniker::Abort() not implemented");
// XXXMEH - TODO: implement IBinding::Abort()
- return E_NOTIMPL;
+ return S_OK;
}
STDMETHODIMP CHXURLMoniker::GetBindResult(CLSID* pclsidProtocol, DWORD* pdwResult, \
LPOLESTR* pszResult, DWORD* pdwReserved)
Index: flash_guest_player_ax.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flashhost/platform/win32/flash_guest_player_ax.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- flash_guest_player_ax.cpp 27 Sep 2007 03:29:12 -0000 1.25
+++ flash_guest_player_ax.cpp 28 Sep 2007 21:13:54 -0000 1.26
@@ -417,11 +417,6 @@
DetermineIfFLVSource(pRequest, m_pFileObject);
- if (m_bIsFLVSource)
- {
- //m_ulPacingInterval = FLASH_FLV_PACING_INTERVAL;
- }
-
// Save the request
HX_RELEASE(m_pRequest);
m_pRequest = pRequest;
@@ -544,73 +539,6 @@
}
//
-// IHXGuestPlayer::GetMetaData
-//
-STDMETHODIMP CFlashGuestPlayerAX::GetMetaData(REF(IHXValues*) rpData)
-{
- HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerAX::GetMetaData(%p)", rpData);
- HX_RESULT retVal = HXR_OK;
-
- HX_ASSERT(rpData == NULL);
-
- if (m_ulDuration == 0 && m_pContext)
- {
- // Add HasSubordinateLifetime property
-
- // Create an IHXValues
- IHXValues* pData = NULL;
- retVal = CreateValuesCCF(pData, m_pContext);
- if (SUCCEEDED(retVal))
- {
- retVal = pData->SetPropertyULONG32("HasSubordinateLifetime", TRUE);
- if (retVal == HXR_OK)
- {
- // Assign the out parameter
- rpData = pData;
- rpData->AddRef();
- }
- }
- HX_RELEASE(pData);
- }
-
- return retVal;
-}
-
-//
-// IHXGuestPlayer::GetPlayerCaps
-//
-STDMETHODIMP_(UINT32) CFlashGuestPlayerAX::GetPlayerCaps()
-{
- UINT32 ulRet = 0;
-
- if (m_bWindowless)
- {
- // Guest player can draw into an offscreen buffer
- ulRet |= HXGUEST_CAPS_OFFSCREENBUFFER;
- }
-
- HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerAX::GetPlayerCaps() returns %lu", ulRet);
- return ulRet;
-}
-
-//
-// IHXGuestPlayer::QueryCaps
-//
-STDMETHODIMP_(HXBOOL) CFlashGuestPlayerAX::QueryCaps(UINT32 ulCaps)
-{
- HXBOOL bRet = FALSE;
-
- UINT32 ulPlayerCaps = GetPlayerCaps();
- if (ulCaps & ulPlayerCaps)
- {
- bRet = TRUE;
- }
-
- HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerAX::QueryCaps(0x%08x) returns %lu", \
ulCaps, bRet);
- return bRet;
-}
-
-//
// IHXGuestPlayer::GetBufferingStatus
//
STDMETHODIMP CFlashGuestPlayerAX::GetBufferingStatus(REF(UINT16) rusStatusCode, \
REF(UINT16) rusPercentDone) @@ -982,84 +910,45 @@
if (m_bIsFLVSource)
{
- /*
- INT32 lTimeDelta = 0x0FFFFFFF;
-
- if ((m_ulGuestPlayerState == HXGUEST_STATE_MEDIA_PLAYING) ||
- (m_ulGuestPlayerState == HXGUEST_STATE_MEDIA_PAUSED))
- {
- UINT32 ulCurrentTime = m_ulLastReportedPlayTime;
-
- GetPlaybackTime(ulCurrentTime);
- lTimeDelta = ulSeekTo - ulCurrentTime;
- if (lTimeDelta < 0)
- {
- lTimeDelta = -lTimeDelta;
- }
- }
-
- retVal = HXR_OK;
- */
-
- // If we are playing, do not seek if seek point is within
- // the seek granularity window.
- // This allows us not to double-seek when snapping back to the
- // time-line reported by the flash player.
- if (((m_ulGuestPlayerState != HXGUEST_STATE_MEDIA_PLAYING) &&
- (m_ulGuestPlayerState != HXGUEST_STATE_MEDIA_PAUSED))
- ) //|| (lTimeDelta >= FLV_SEEK_GRANULARITY))
- {
- char pSeekTime[12];
-
- pSeekTime[0] = '\0';
-
- sprintf(pSeekTime, "%lu", ulSeekTo);
-
- /*
- m_ulLastUpdatedPlayTime = ulSeekTo;
- m_ulLastReportedPlayTime = ulSeekTo;
- m_ulLastPlayTimeUpdateTick = 0;
- */
-
- retVal = SendFlashMessage("SeekFLV", pSeekTime);
- }
+ char pSeekTime[12];
+ sprintf(pSeekTime, "%lu", ulSeekTo);
+ retVal = SendFlashMessage("SeekFLV", pSeekTime);
}
else
{
-
- // Get the current frame
- INT32 lCurFrame = (INT32) m_pFlashPlayer->CurrentFrame();
- HXLOGL4(HXLOG_FPHR, "IShockwaveFlash::CurrentFrame() returned %ld", lCurFrame);
- // Get the total number of frames
- INT32 lTotalFrames = 0;
- HRESULT hr = m_pFlashPlayer->get_TotalFrames((long*) &lTotalFrames);
- HXLOGL4(HXLOG_FPHR, "IShockwaveFlash::TotalFrames() returned %ld", lTotalFrames);
- if (hr == S_OK)
+ // Get the current frame
+ INT32 lCurFrame = (INT32) m_pFlashPlayer->CurrentFrame();
+ HXLOGL4(HXLOG_FPHR, "IShockwaveFlash::CurrentFrame() returned %ld", lCurFrame);
+ // Get the total number of frames
+ INT32 lTotalFrames = 0;
+ HRESULT hr = m_pFlashPlayer->get_TotalFrames((long*) &lTotalFrames);
+ HXLOGL4(HXLOG_FPHR, "IShockwaveFlash::TotalFrames() returned %ld", \
lTotalFrames); + if (hr == S_OK)
+ {
+ // Compute the frame to seek to using the frame rate
+ INT32 lSeekFrame = (INT32) (ulSeekTo * m_dFrameRate / 1000.0);
+ // Sanity check on seek frame
+ if (lSeekFrame < 0)
{
- // Compute the frame to seek to using the frame rate
- INT32 lSeekFrame = (INT32) (ulSeekTo * m_dFrameRate / 1000.0);
- // Sanity check on seek frame
- if (lSeekFrame < 0)
- {
- lSeekFrame = 0;
- }
- else if (lSeekFrame >= lTotalFrames)
- {
- lSeekFrame = lTotalFrames - 1;
- }
- // Go to that frame
- HXLOGL4(HXLOG_FPHR, "Calling IShockwaveFlash::GotoFrame(%ld)", lSeekFrame);
- HRESULT hr = m_pFlashPlayer->GotoFrame((long) lSeekFrame);
- if (SUCCEEDED(hr))
- {
- // Clear the return value
- retVal = HXR_OK;
- }
+ lSeekFrame = 0;
}
- else
+ else if (lSeekFrame >= lTotalFrames)
{
- HXLOGL4(HXLOG_FPHR, "\tget_TotalFrames() returned 0x%08x", hr);
+ lSeekFrame = lTotalFrames - 1;
}
+ // Go to that frame
+ HXLOGL4(HXLOG_FPHR, "Calling IShockwaveFlash::GotoFrame(%ld)", lSeekFrame);
+ HRESULT hr = m_pFlashPlayer->GotoFrame((long) lSeekFrame);
+ if (SUCCEEDED(hr))
+ {
+ // Clear the return value
+ retVal = HXR_OK;
+ }
+ }
+ else
+ {
+ HXLOGL4(HXLOG_FPHR, "\tget_TotalFrames() returned 0x%08x", hr);
+ }
}
}
@@ -2279,6 +2168,8 @@
#if defined(_DEBUG)
|| strstr(pFunction, "HXDebug")
#endif
+ || strstr(pFunction, "HXError")
+ || strstr(pFunction, "HXPosition")
|| strstr(pFunction, "HXBufferingChanged"))
{
HX_RESULT res=HXR_OK;
@@ -2298,19 +2189,19 @@
if (SUCCEEDED(res) && !strInvokeName.IsEmpty())
{
+ bHandled = TRUE;
if (!strcmp(strInvokeName, "HXMetaChanged"))
{
- if (SUCCEEDED(OnMetaDataChanged(strInvokeArgs)))
+ if (FAILED(OnMetaDataChanged(strInvokeArgs)))
{
- bHandled = TRUE;
+ bHandled = FALSE;
}
}
else if (!strcmp(strInvokeName, "HXBufferingChanged"))
{
- if (strInvokeArgs.IsEmpty())
+ if (!strInvokeArgs.IsEmpty())
{
OnBufferingChanged(atoi((const char*)strInvokeArgs));
- bHandled = TRUE;
}
}
#if defined(_DEBUG)
@@ -2319,106 +2210,22 @@
HXLOGL4(HXLOG_FPHR, "CHXFlashGuestPlayerAX::HandleFlashMessage HXDebug (%s)", \
(const char*) strInvokeArgs); }
#endif
- }
- }
-
- }
- return bHandled;
-}
-
-HX_RESULT
-CFlashGuestPlayerAX::OnMetaDataChanged(CHXString strInvokeArgs)
-{
- HX_RESULT retVal = HXR_UNEXPECTED;
-
- HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerNS::OnMetaDataChanged %s", (const char*) \
strInvokeArgs);
-
- HX_ASSERT(m_bIsFLVSource);
-
- if (m_bIsFLVSource)
- {
- INT32 lWidth = 0;
- INT32 lHeight = 0;
- INT32 lDuration = 0;
-
- CHXStringList strList;
- HXStringUtil::Split(strInvokeArgs, ";", strList);
- CHXSimpleList::Iterator i;
-
- for (i = strList.Begin(); i != strList.End(); ++i)
- {
- // Split the name value into another list
- CHXStringList strNameValueList;
- HXStringUtil::Split(*((CHXString*) (*i)), ",", strNameValueList);
-
- CHXSimpleList::Iterator j = strNameValueList.Begin();
- if (j != strNameValueList.End())
+ else if (!strcmp(strInvokeName, "HXError"))
{
- CHXString* strName = (CHXString*) (*j);
- ++j;
-
- if (j != strNameValueList.End())
+ HXLOGL4(HXLOG_FPHR, "CHXFlashGuestPlayerAX::HandleFlashMessage HXError (%s)", \
(const char*) strInvokeArgs); + }
+ else if (!strcmp(strInvokeName, "HXPosition"))
+ {
+ if (!strInvokeArgs.IsEmpty())
{
- CHXString* strValue = (CHXString*) (*j);
-
- //*strName, *strValue;
- if (!strcasecmp(*strName, "width"))
- {
- lWidth = atoi((const char*)*strValue);
- }
- else if (!strcasecmp(*strName, "height"))
- {
- lHeight = atoi((const char*)*strValue);
- }
- else if (!strcasecmp(*strName, "duration"))
- {
- lDuration = atoi((const char*)*strValue);
- }
+ m_ulLastUpdatedPlayTime = atoi((const char*)strInvokeArgs);
}
}
}
-
- /*
- if ((lWidth > 0) && (lHeight > 0))
- {
- m_MediaSize.cx = (UINT32) lWidth;
- m_MediaSize.cy = (UINT32) lHeight;
}
- */
-
- if (lDuration > 0)
- {
- m_ulDuration = (UINT32) lDuration;
- HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerNS::OnMetaDataChanged Duration=%ld", \
m_ulDuration);
- }
-
- retVal = HXR_OK;
- }
-
- return retVal;
-}
-HX_RESULT
-CFlashGuestPlayerAX::OnBufferingChanged(INT32 lInBuffering)
-{
- HX_RESULT retVal = HXR_UNEXPECTED;
-
- HX_ASSERT(m_bIsFLVSource);
-
- if (m_bIsFLVSource)
- {
- // Obtain the buffering status
- //Invoke("GetVariable", "/_level0:FLVInBuffering", lInBuffering);
-
- // Base host state machine needs to be reworked for re-buffering
- // state to be handled properly.
- // We do nothing for now. The caviat is the bufferng status does
- // not get propagated to GUI.
-
- retVal = HXR_OK;
}
-
- return retVal;
+ return bHandled;
}
// IHXExternalInterface::CallExternalFunction
@@ -2899,3 +2706,22 @@
}
}
+//
+// IHXGuestPlayer::GetPlaybackTime
+//
+STDMETHODIMP
+CFlashGuestPlayerAX::GetPlaybackTime(REF(UINT32) rulTime)
+{
+ HX_RESULT retVal = HXR_OK;
+
+ rulTime = m_ulLastUpdatedPlayTime;
+
+ if (m_ulLastUpdatedPlayTime > m_ulDuration) {
+ m_ulDuration = m_ulLastUpdatedPlayTime;
+ }
+
+ HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerAX::GetPlaybackTime() time=%ld", rulTime);
+
+ return retVal;
+}
+
Index: flashhost.rc
===================================================================
RCS file: /cvsroot/datatype/flash/flashhost/platform/win32/flashhost.rc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- flashhost.rc 4 Sep 2007 23:37:07 -0000 1.1
+++ flashhost.rc 28 Sep 2007 21:13:54 -0000 1.2
@@ -52,7 +52,23 @@
// SWF
//
// Put paths relative for player_rn/plugin/rvviewer/platform/win/nprvviewer.rc \
context +// or
+// (splay) datatype/flash/flashhost/platform/win32/flashhost.rc
+//#if defined(FLASH_HOST_FLVWRAPPER)
+//#if defined(_STATICALLY_LINKED)
IDR_SWF_FLVWRAPPER SWF \
"..\\..\\..\\..\\..\\..\\datatype\\flash\\flashhost\\flash\\flvwrapper.swf" +//#else
+//IDR_SWF_FLVWRAPPER SWF "..\\..\\flash\\flvwrapper.swf"
+//#endif // _STATICALLY_LINKED
+//#endif // FLASH_HOST_FLVWRAPPER
+
+//#if defined(FLASH_HOST_FLVPLAYBACK)
+//#if defined(_STATICALLY_LINKED)
+IDR_SWF_FLVPLAYBACK SWF \
"..\\..\\..\\..\\..\\..\\datatype\\flash\\flashhost\\flash\\flvplayback.swf" +//#else
+//IDR_SWF_FLVPLAYBACK SWF "..\\..\\flash\\flvplayback.swf"
+//#endif // _STATICALLY_LINKED
+//#endif // FLASH_HOST_FLVPLAYBACK
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
_______________________________________________
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