[datatype-dev] CR: Flash Guest Player - enable windowless mode

[datatype-dev] CR: Flash Guest Player - enable windowless mode

Christina Dunn cdunn at real.com
Thu Nov 16 18:05:48 PST 2006


At 05:25 PM 11/16/2006, Greg Wright wrote:
>Christina Dunn wrote:
>>Synopsis: Flash Guest Player did not support windowless mode.
>>Overview: The UserAgent string that was being returned to the Flash 
>>plugin was incorrect, or not in the form that it expected. Because 
>>of this, windowless mode did not render.
>>Added code to render in windowed mode if the plugin instance could 
>>not be windowless; if the UA string is bad, or if the Flash plugin 
>>does not support windowless.
>>Files:
>>datatype/flash/flashhost/flash_guest_player.cpp
>>datatype/flash/flashhost/pub/flash_guest_player.h
>>datatype/flash/flashhost/pub/flash_runtime.h
>>     - small prep for FSCommand
>>datatype/common/basehost/base_hosted_renderer.cpp
>>     - pass through window events to the guest player
>>Branch: HEAD
>...
>>+        case  WM_KILLFOCUS:
>>+        {
>>+            NPEvent evt;
>>+            evt.event = (UINT16) pEvent->event;
>>+            evt.wParam = (WPARAM) pEvent->param1;
>>+            evt.lParam = (LPARAM) pEvent->param2;
>>+            uint16 dVal = m_PluginFuncs.event(&m_NPP, &evt);
>>+            if (dVal)
>>+            {
>>+            printf ("****************Handled: %x %d\n", evt.event, dVal);
>
>
>You really want the printf?

Nope. I took out all the printf's, forgot to update the diff. I'm 
actually looking at why this is not
working, currently. None of the mousing events are being handled by 
the plugin. This is
for the next checkin, though.


>>+            NPEvent evt;
>>+            evt.event = (UINT16) pEvent->event;
>>+            evt.wParam = (WPARAM) 0;
>>+            evt.lParam = (LPARAM) ℘
>>+            uint16 dVal = m_PluginFuncs.event(&m_NPP, &evt);
>>+            if (dVal)
>>+            {
>>+            printf ("****************Handled: %x %d\n", evt.event, dVal);
>
>same here....
>
>
>>+        case  WM_PAINT:
>>+        {
>>+            PAINTSTRUCT ps;
>>+            BeginPaint( m_hwnd, &ps );
>>+
>>+            NPRect rc;
>>+            rc.left    = (UINT16) ps.rcPaint.left;
>>+            rc.top    = (UINT16) ps.rcPaint.top;
>>+            rc.right    = (UINT16) ps.rcPaint.right;
>>+            rc.bottom    = (UINT16) ps.rcPaint.bottom;
>>+
>>+            pEvent->handled = SendPaintEvent(&m_NPP, &rc);
>>+
>>+                EndPaint( m_hwnd, &ps );
>
>You might want to check with JeffL about using Begin/EndPaint().
>The site use to do that and it breaks the player. I am not sure
>what window or parent these are for, so it might be ok, but we
>should make sure.

The HWND is from AttachWindow.
I'll check with JeffL.



>>@@ -1826,11 +1945,19 @@
>>  // NPN_InvalidateRect Invalidates specified drawing area prior to 
>> repainting or refreshing a windowless plugin.
>>  //
>>  void
>>  CFlashGuestPlayer::NPN_InvalidateRect(NPP npp, NPRect *invalidRect)
>>  {
>>-    HXLOGL4(HXLOG_FPHR, "NPN_InvalidateRect NOT IMPLEMENTED");
>>+//    HXLOGL4(HXLOG_FPHR, "NPN_InvalidateRect");
>
>still need that?

No, since this gets a lot of calls, especially for movies that need a 
paint message every frame.



>>              // TARVER_STR_PLATFORM is defined in common/include/platform.h
>>+        //
>>+        // Example for win32:
>>+        // "RealMedia Player HelixDNAClient/10.0.0.9544 (Windows; 
>>U; WinNT; EN; rv:10.0.0.9544) Gecko/20060608"
>>+        // The Flash plug-in is expecting the UA to be in this form :
> > +        // "{appname/version} ({platform}; {securitycode}; 
> {OSCPU}; {lang}; rv:{%d.%d}) Gecko/{geckobuildID}"
>>+
>>+        CHXString strPlatformInfo;
>>+        HXVERSIONINFO versionInfo;
>>+            HXGetWinVer(&versionInfo);
>>+
>>+#if defined(_WINDOWS)
>>+        strPlatformInfo = "Windows";
>>+#elif defined(_MACINTOSH)
>>+        strPlatformInfo = "Macintosh";
>>+#elif defined(_UNIX)
>>+        strPlatformInfo = "X11";
>
>Do we have to use X11 for Un*x? X11 is just the GUI some of the UN*xes
>use.

I took this from the Mozilla source code, since that is what Flash is 
expecting.
I can check it in with "UNIX" and add a note for when it's tested on 
that platform.


>Also, how well does this match the user agent string defined
>in hxver and rnver? Can we just add onto the end of that maybe?

There are defines for the UA string, and I used those from hxver in a 
method I copied
from Eric's WM-RTSP fileformat code. I kind of used the old form, but 
changed the
platform comment and appended the Gecko string.

Old version:

RealMedia Player HelixDNAClient/10.0.0.9544 (win32)

New version:

RealMedia Player HelixDNAClient/10.0.0.9544 (Windows; U; WinNT; EN; 
rv:10.0.0.9544) Gecko/20060608


>>+#else
>>+        strPlatformInfo = "Unknown Platform";
>>+#endif
>>+        strPlatformInfo += "; U; "; // App security
>>+        strPlatformInfo += HXGetOSName(versionInfo.dwPlatformId);
>>+
>>              strUserAgent = USER_AGENT_PREFIX
>>                             USER_AGENT_STRING
>>                             USER_AGENT_POSTFIX "/"
>>-                           TARVER_STRING_VERSION " ("
>>-                           TARVER_STR_PLATFORM ")";
>>+                           TARVER_STRING_VERSION
>>+               " ("
>>+               + strPlatformInfo +
>>+               "; " LANGUAGE_CODE
>>+               "; rv:" TARVER_STRING_VERSION
>>+               ")";
>>          }
>>+
>>+    // Add Gecko info
>>+    char strGeckoExt[80];
>>+    sprintf(strGeckoExt, " Gecko/%d", NS_BUILD_ID/100);
>>+        strUserAgent += strGeckoExt;
>>+
>>          // Read the "UserAgentExtn" preference (if any)
>>          CHXString strUserAgentExt;
>>          ReadPrefCSTRING(m_pContext, "UserAgentExtn", strUserAgentExt);
>
>We use the same pref name, "UserAgentExtn", in rtspprotocol.cpp, was
>that intentional? We also have a "UserAgent" pref as well.

The code was coped from there, so it was intentional.
The "UserAgent" pref is used, it's the containing 'if' block that 
wasn't shown in the diff.



>--greg.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20061116/186faef0/attachment.html


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.