sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // VideoFrameMessage.cpp sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include "MMFVideoFrameMessage.h" sl@0: sl@0: /** sl@0: Handles decoding the video frame message and providing a reference to the bitmap sl@0: to modify for the user of the class. sl@0: Provides a callback to return the message to the client sl@0: */ sl@0: CMMFVideoFrameMessage* CMMFVideoFrameMessage::NewL(TMMFMessage& aMessage) sl@0: { sl@0: CMMFVideoFrameMessage * self = new (ELeave) CMMFVideoFrameMessage(aMessage); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: CFbsBitmap& CMMFVideoFrameMessage::GetBitmap() sl@0: { sl@0: return *iBitmap; sl@0: } sl@0: void CMMFVideoFrameMessage::FrameReady(TInt aErr) sl@0: { sl@0: iMessage.Complete(aErr); sl@0: } sl@0: sl@0: CMMFVideoFrameMessage::CMMFVideoFrameMessage(TMMFMessage& aMessage) sl@0: : iMessage(aMessage) sl@0: { sl@0: } sl@0: sl@0: void CMMFVideoFrameMessage::ConstructL() sl@0: { sl@0: TPckgBuf pckg; sl@0: iMessage.ReadData1FromClientL(pckg); sl@0: iFbsSession.Connect(); sl@0: iBitmap = new (ELeave) CFbsBitmap; sl@0: User::LeaveIfError(iBitmap->Duplicate(pckg().iFrameBitmapServerHandle)); sl@0: } sl@0: sl@0: CMMFVideoFrameMessage::~CMMFVideoFrameMessage() sl@0: { sl@0: delete iBitmap; sl@0: iFbsSession.Disconnect(); sl@0: } sl@0: sl@0: