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

List:       helix-datatype-dev
Subject:    Re: [datatype-dev] Flashhost realplay_gtk_current.bif build
From:       Christina Dunn <cdunn () real ! com>
Date:       2007-04-27 19:55:56
Message-ID: 6.2.5.6.2.20070427125349.04d3aa48 () real ! com
[Download RAW message or body]

You can ifdef _WIN32 the guts of 
CFlashGuestPlayerNS::SurfaceUpdate(IHXVideoSurface* pVideoSurface), 
since it is used for windowless mode, which is not supported on Linux.

--christina

At 12:29 PM 4/27/2007, Daniel Yek wrote:
>Hi,
>
>The _WIN32 stuffs broke Linux RealPlayer nightly build.
>
>m_ulDIBitsSize can be moved into _WIN32 section.
>
>What should happen for m_pDIBits?
>     BYTE* pBuf = (BYTE*) (m_bUseDoubleBuffer ? 
> m_pOffscreenBuffer->GetBuffer() : m_pDIBits);
>
>BUILD ERROR:
>   entering directory datatype/flash/flashhost
>   UNIXCompile(datatype/flash/flashhost): making copy
>   ...
>   flash_guest_player_ns.cpp:2626: error: `m_ulDIBitsSize' undeclared
>     (first use this function)
>   ...
>   flash_guest_player_ns.cpp:2640: error: `m_pDIBits' undeclared
>     (first use this function)
>   flash_guest_player_ns.cpp:2611: warning: unused variable 'nResult'
>   ...
>   make[1]: *** [rel/obj/flashhostlib/flash_guest_player_ns.o] Error 1
>   ...
>   --- Build System Error ------------------------------------
>   Make failed.
>   -----------------------------------------------------------
>
>Thanks.
>
>
>--
>Daniel Yek
>
>
>At 06:00 PM 4/26/2007, Eric Hyche wrote:
>
>>This is now checked into HEAD and 150Cay.
>>
>>=============================================
>>Eric Hyche (ehyche@real.com)
>>Technical Lead
>>RealNetworks, Inc.
>>
>> > -----Original Message-----
>> > From: datatype-dev-bounces@helixcommunity.org
>> > [mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of
>> > Eric Hyche
>> > Sent: Thursday, April 26, 2007 11:19 AM
>> > To: datatype-dev@lists.helixcommunity.org
>> > Subject: [datatype-dev] CR-Client: optimize bltting in
>> > NSPlugin-based Flashguest player
>> >
>> >
>> > Description
>> > ----------------------------------------------
>> > These are changes similar to the ones made
>> > recently for the ActiveX-based Flash guest player.
>> > These changes do two things: a) they implement
>> > a player preference to tell the guest player to
>> > not use the double buffer (using the double buffer
>> > remains the default); and b) they optimize bltting
>> > from the DIBSection to the double buffer, only copying
>> > the damaged rectangle instead of the entire buffer.
>> >
>> > Files Modified
>> > ----------------------------------------------
>> > datatype/flash/flashhost/flash_guest_player_ns.cpp
>> > datatype/flash/flashhost/pub/flash_guest_player_ns.h
>> >
>> > Branches
>> > ----------------------------------------------
>> > HEAD and 150Cay (don't need this for 204Cay)
>> >
>> > Index: flash_guest_player_ns.cpp
>> > ===================================================================
>> > RCS file:
>> > /cvsroot/datatype/flash/flashhost/flash_guest_player_ns.cpp,v
>> > retrieving revision 1.10
>> > diff -u -w -u -w -r1.10 flash_guest_player_ns.cpp
>> > --- flash_guest_player_ns.cpp   23 Apr 2007 15:15:02 -0000      1.10
>> > +++ flash_guest_player_ns.cpp   26 Apr 2007 15:15:16 -0000
>> > @@ -208,6 +208,9 @@
>> >      , m_hdcmem(0)
>> >      , m_hBitmap(0)
>> >      , m_pDIBits(0)
>> > +    , m_ulDIBitsWidth(0)
>> > +    , m_ulDIBitsHeight(0)
>> > +    , m_ulDIBitsSize(0)
>> >      , m_hOldBitmap(0)
>> >  #endif
>> >  {
>> > @@ -292,7 +295,10 @@
>> >          m_pContext->QueryInterface(IID_IHXCommonClassFactory,
>> > (void**)&m_pCCF);
>> >
>> >          // Create offscreen buffers and its mutex
>> > +        if (m_bUseDoubleBuffer)
>> > +        {
>> >          CreateBufferCCF(m_pOffscreenBuffer, m_pContext);
>> > +        }
>> >          CreateInstanceCCF(CLSID_IHXMutex, (void**)&m_pMutex,
>> > m_pContext);
>> >
>> >          BuildUserAgentString();
>> > @@ -1198,6 +1204,10 @@
>> >  HXBOOL
>> >  CFlashGuestPlayerNS::SendPaintEvent(NPP npp, NPRect* pInvalidRect)
>> >  {
>> > +    HXLOGL4(HXLOG_FPHR,
>> > "CFlashGuestPlayerNS::SendPaintEvent(npp=0x%08x,pInvalidRect=%p)
>> > (l=%u,t=%u,r=%u,b=%u)",
>> > +            npp, pInvalidRect, (pInvalidRect ?
>> > pInvalidRect->left : 0),
>> > +            (pInvalidRect ? pInvalidRect->top : 0), (pInvalidRect ?
>> > pInvalidRect->right : 0),
>> > +            (pInvalidRect ? pInvalidRect->bottom : 0));
>> >      HXBOOL bHandled=FALSE;
>> >
>> >      if (m_PluginFuncs.event == NULL)
>> > @@ -1206,12 +1216,6 @@
>> >      }
>> >
>> >  #if defined(_WIN32)
>> > -    if (m_pDIBits && m_pOffscreenBuffer)
>> > -    {
>> > -        // Clear out the bits, prevent shadowing
>> > -        memset(m_pDIBits, 0, m_pOffscreenBuffer->GetSize());
>> > -    }
>> > -
>> >      NPEvent evt;
>> >      memset(&evt,0,sizeof(evt));
>> >      evt.event = WM_PAINT;
>> > @@ -1267,6 +1271,8 @@
>> >
>> >      if (m_ulGuestPlayerState == HXGUEST_STATE_MEDIA_INITIALIZED)
>> >      {
>> > +        // Clear the return value
>> > +        retVal = HXR_OK;
>> >          // Set the state to MediaBuffering
>> >          SetGuestPlayerState(HXGUEST_STATE_MEDIA_BUFFERING);
>> >          // If we have already completed reading the file, then
>> > @@ -1507,7 +1513,7 @@
>> >
>> >  STDMETHODIMP CFlashGuestPlayerNS::DetachSite()
>> >  {
>> > -    HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerNSDetachSite()");
>> > +    HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerNS::DetachSite()");
>> >
>> >      // Remove ourselves as a passive site watcher
>> >      AddRemovePassiveSiteWatcher(m_pSite, FALSE);
>> > @@ -1594,7 +1600,10 @@
>> >          }
>> >          case  WM_PAINT:
>> >          {
>> > +            if (!m_bWindowless)
>> > +            {
>> >              SendPaintEvent(&m_NPP, NULL);
>> > +            }
>> >              break;
>> >          }
>> >  #endif // _WIN32
>> > @@ -1876,7 +1885,7 @@
>> >  void
>> >  CFlashGuestPlayerNS::NPN_InvalidateRect(NPP npp, NPRect *invalidRect)
>> >  {
>> > -//    HXLOGL4(HXLOG_FPHR, "NPN_InvalidateRect");
>> > +    HXLOGL4(HXLOG_FPHR,
>> > "CFlashGuestPlayerNS::NPN_InvalidateRect(npp=0x%08x,invalidRec
>> > t=%p)", npp,
>> > invalidRect);
>> >      if (npp)
>> >      {
>> >          CFlashGuestPlayerNS* pPlayer =
>> > (CFlashGuestPlayerNS*) npp->ndata;
>> > @@ -2402,7 +2411,7 @@
>> >
>> >          m_pUserAgentStr = strUserAgent;
>> >
>> > -        HXLOGL4(HXLOG_FPHR,
>> > "FlashGuestPlayer::BuildUserAgent  str=%s\n",
>> > (const char*) strUserAgent);
>> > +        HXLOGL4(HXLOG_FPHR,
>> > "FlashGuestPlayer::BuildUserAgent  str=%s",
>> > (const char*) strUserAgent);
>> >
>> >          retVal = HXR_OK;
>> >      }
>> > @@ -2495,6 +2504,10 @@
>> >  HXBOOL
>> >  CFlashGuestPlayerNS::CopyBitmapToOffscreenBuffer(NPRect*
>> > pInvalidRect)
>> >  {
>> > +    HXLOGL4(HXLOG_FPHR,
>> > "CFlashGuestPlayerNS::CopyBitmapToOffscreenBuffer(pRect=%p)
>> > (l=%u,t=%u,r=%u,b=%u)",
>> > +            pInvalidRect, (pInvalidRect ? pInvalidRect->left : 0),
>> > +            (pInvalidRect ? pInvalidRect->top : 0), (pInvalidRect ?
>> > pInvalidRect->right : 0),
>> > +            (pInvalidRect ? pInvalidRect->bottom : 0));
>> >      if (m_pSite == NULL)
>> >      {
>> >          return FALSE;
>> > @@ -2507,21 +2520,54 @@
>> >      {
>> >          bStatus = TRUE;
>> >
>> > +        if (m_bUseDoubleBuffer)
>> > +        {
>> >          m_pMutex->Lock();
>> >
>> > -        // Copy the bitmap bits to our blt buf
>> > -        m_pOffscreenBuffer->Set((UCHAR*)m_pDIBits,
>> > m_pOffscreenBuffer->GetSize());
>> > -
>> > -        // Inverse the alpha channel, transparency for helix is 0xFF,
>> > windows is 0x00
>> > -        UINT32* buf = (UINT32*) m_pOffscreenBuffer->GetBuffer();
>> > -        UINT32  ulNumPix = m_pOffscreenBuffer->GetSize() >> 2;
>> > -        UINT32 i;
>> > -        for (i=0; i<ulNumPix; i++)
>> > +            // Copy the rectangle
>> > +            NPRect rDrawRect = {0, 0, 0, 0};
>> > +            if (pInvalidRect)
>> >          {
>> > -            buf[i] = buf[i] ^ 0xFF000000;
>> > +                rDrawRect = *pInvalidRect;
>> > +            }
>> > +            // Compute the rectangle width and height
>> > +            UINT32 ulRectWidth  = (UINT32) (rDrawRect.right -
>> > rDrawRect.left);
>> > +            UINT32 ulRectHeight = (UINT32) (rDrawRect.bottom -
>> > rDrawRect.top);
>> > +            // Sanity check on the size of the rect
>> > +            if (ulRectWidth > m_ulDIBitsWidth || ulRectHeight >
>> > m_ulDIBitsHeight)
>> > +            {
>> > +                // Make the rect the full size of the DIBSection
>> > +                rDrawRect.left   = 0;
>> > +                rDrawRect.top    = 0;
>> > +                rDrawRect.right  = (uint16) m_ulDIBitsWidth;
>> > +                rDrawRect.bottom = (uint16) m_ulDIBitsHeight;
>> > +                ulRectWidth      = m_ulDIBitsWidth;
>> > +                ulRectHeight     = m_ulDIBitsHeight;
>> > +            }
>> > +            if (ulRectWidth && ulRectHeight)
>> > +            {
>> > +                // Get the base src and dst pointers
>> > +                UINT32* pSrcBase = (UINT32*) m_pDIBits;
>> > +                UINT32* pDstBase = (UINT32*)
>> > m_pOffscreenBuffer->GetBuffer();
>> > +                // Loop through the rows of the damaged rect
>> > +                for (UINT32 i = 0; i < ulRectHeight; i++)
>> > +                {
>> > +                    // Compute the offset for the beginning
>> > of this row
>> > +                    UINT32 ulOffset = ((m_ulDIBitsHeight - 1 -
>> > rDrawRect.top - i) * m_ulDIBitsWidth) + rDrawRect.left;
>> > +                    // Get the src and dst pointers for the
>> > beginning of
>> > this row
>> > +                    UINT32* pSrc = pSrcBase + ulOffset;
>> > +                    UINT32* pDst = pDstBase + ulOffset;
>> > +                    // Get the number of pixels in this row to copy
>> > +                    UINT32 ulNum = ulRectWidth;
>> > +                    // Copy this row, inverting the alpha channel
>> > +                    while (ulNum--)
>> > +                    {
>> > +                        *pDst++ = *pSrc++ ^ 0xFF000000;
>> > +                    }
>> > +                }
>> >          }
>> > -
>> >          m_pMutex->Unlock();
>> > +        } // if (m_bUseDoubleBuffer)
>> >      }
>> >  #endif // _WIN32
>> >
>> > @@ -2549,7 +2595,8 @@
>> >  {
>> >      HXBOOL bResult = FALSE;
>> >
>> > -    if (pVideoSurface && m_pSite && m_pOffscreenBuffer &&
>> > m_pOffscreenBuffer->GetSize())
>> > +    if (pVideoSurface && m_pSite &&
>> > +        (!m_bUseDoubleBuffer || m_pOffscreenBuffer &&
>> > m_pOffscreenBuffer->GetSize()))
>> >      {
>> >          int nResult = 0;
>> >          HXBitmapInfoHeader bmi;
>> > @@ -2566,7 +2613,7 @@
>> >          bmi.biPlanes        = 1;
>> >          bmi.biBitCount      = 32;
>> >          bmi.biCompression   = HX_ARGB;
>> > -        bmi.biSizeImage     = m_pOffscreenBuffer->GetSize();
>> > +        bmi.biSizeImage     = m_ulDIBitsSize;
>> >          bmi.biXPelsPerMeter = 0;
>> >          bmi.biYPelsPerMeter = 0;
>> >          bmi.biClrUsed       = 0;
>> > @@ -2580,7 +2627,8 @@
>> >          m_pSite->GetSize(cSize);
>> >          HXxRect cDstRect = {0, 0, cSize.cx, cSize.cy};
>> >
>> > -        bResult = pVideoSurface->Blt((BYTE*)
>> > m_pOffscreenBuffer->GetBuffer(),
>> > +        BYTE* pBuf = (BYTE*) (m_bUseDoubleBuffer ?
>> > m_pOffscreenBuffer->GetBuffer() : m_pDIBits);
>> > +        bResult = pVideoSurface->Blt(pBuf,
>> >                                          &bmi,
>> >                                          cDstRect,
>> >                                          cSrcRect);
>> > @@ -2731,6 +2779,7 @@
>> >  void
>> >  CFlashGuestPlayerNS::FinishFile()
>> >  {
>> > +    HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerNS::FinishFile()");
>> >      if (m_dStreamType == NP_ASFILE)
>> >      {
>> >          // Send the plugin the url of the file we just wrote to it.
>> > @@ -2846,8 +2895,15 @@
>> >
>> >      // Save the location of the bitmap bits
>> >      m_pDIBits = pvBits;
>> > +    // Save the width and height of the DIB Section
>> > +    m_ulDIBitsWidth  = ulWidth;
>> > +    m_ulDIBitsHeight = ulHeight;
>> > +    m_ulDIBitsSize   = ulWidth * ulHeight * 4;
>> >
>> > +    if (m_bUseDoubleBuffer)
>> > +    {
>> >      m_pOffscreenBuffer->SetSize(bmi.bmiHeader.biSizeImage);
>> > +    }
>> >
>> >  }
>> >  #endif
>> > cvs diff: Diffing platform
>> > cvs diff: Diffing platform/win32
>> > cvs diff: Diffing pub
>> > Index: pub/flash_guest_player_ns.h
>> > ===================================================================
>> > RCS file:
>> > /cvsroot/datatype/flash/flashhost/pub/flash_guest_player_ns.h,v
>> > retrieving revision 1.7
>> > diff -u -w -u -w -r1.7 flash_guest_player_ns.h
>> > --- pub/flash_guest_player_ns.h 23 Apr 2007 15:15:03 -0000      1.7
>> > +++ pub/flash_guest_player_ns.h 26 Apr 2007 15:15:16 -0000
>> > @@ -270,6 +270,9 @@
>> >      HBITMAP    m_hBitmap;
>> >      HBITMAP    m_hOldBitmap;
>> >      void*      m_pDIBits;
>> > +    UINT32      m_ulDIBitsWidth;
>> > +    UINT32      m_ulDIBitsHeight;
>> > +    UINT32      m_ulDIBitsSize;
>> >
>> >      void       CreateOffscreenBitmap(UINT32 ulWidth, UINT32
>> > ulHeight);
>> >  #endif
>> >
>> >
>> > =============================================
>> > Eric Hyche (ehyche@real.com)
>> > Technical Lead
>> > RealNetworks, Inc.
>> >
>> >
>
>
>_______________________________________________
>Datatype-dev mailing list
>Datatype-dev@helixcommunity.org
>http://lists.helixcommunity.org/mailman/listinfo/datatype-dev



_______________________________________________
Datatype-dev mailing list
Datatype-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

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