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

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

Christina Dunn cdunn at real.com
Fri Nov 17 14:47:54 PST 2006


Checked into HEAD with printf's and BeginPaint/EndPaint omitted.

thanks,
christina

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?
>
>>+            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.
>
>
>>@@ -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?
>
>
>>              // 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.
>
>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?
>
>>+#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.
>
>
>--greg.





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.