Page 1 of 1

FPCN_Paint question

Posted: Fri Jun 30, 2006 9:43 pm
by jgamble
Hi,

I'm curious if you can answer a question on the behavior of FPCN_UpdateRect/FPCN_Paint notifications for movies playing in hidden windows. Is it the case that these notifications will be sent exactly once for each and every frame that the movie plays? i.e. they are not sent when the movie is not playing, and no frames are skipped or duped, etc..

Thanks for any insight,
-jon

Posted: Sat Jul 01, 2006 8:47 am
by Softanics
Thank you for your question.

The notification FPCN_UPDATE_RECT is sending every time when the movie needs to be updated. In the handler send WM_PAINT to the window. In the handler of WM_PAINT, the notification FPCN_PAINT is sending:

Code: Select all

static
void WINAPI FPCListener(HWND hwndFlashPlayerControl, LPARAM lParam, NMHDR* pNMHDR)
{
   if (FPCN_UPDATE_RECT == pNMHDR->code)
         {
                  SendMessage(hwndFlashPlayerControl, WM_PAINT, 0, 0);
         }
   else if (FPCN_PAINT == pNMHDR->code)
         {
                  SFPCNPaint* pFPCNPaint = (SFPCNPaint*)pNMHDR;
                  LPDWORD lpPixels = pFPCNPaint->lpPixels; // <-- pixels buffer
         }
}

right

Posted: Mon Jul 03, 2006 5:57 pm
by jgamble
What I'm curious about is if there are situations where multiple FPCN_UpdateRects are sent for a single frame, or if multiple frames can occur without a FPCN_UpdateRect being generated (perhaps because the frames are identical). I'm using FlashPlayerControl to capture frames from a flash movie and encode them into MPEG, WMV, etc. So the FPCN_UpdateRect approach will only be viable for me if there is a guarantee that exactly one FPCN_UpdateRect notification will be generated per frame for movies in a hidden window...

Posted: Mon Jul 03, 2006 6:24 pm
by Softanics
FPCN_UPDATE_RECT is sending when a flash player decide to repaint. Ususally only one notification will be sent for every frame. But if a movie interacts with a user, the movie can contain just one frame. In this case there will many notifications.