sl@0: // Copyright (c) 2005-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 the License "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: // in its implementation. sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file The interface to an example camera device driver which uses Shared Chunks sl@0: @publishedPartner sl@0: @prototype 9.1 sl@0: */ sl@0: sl@0: #ifndef __CAMERA1_H__ sl@0: #define __CAMERA1_H__ sl@0: sl@0: #include sl@0: #include sl@0: #ifndef __KERNEL_MODE__ sl@0: #include sl@0: #endif sl@0: sl@0: /** sl@0: User interface for 'Camera1' sl@0: */ sl@0: class RCamera1 : public RBusLogicalChannel sl@0: { sl@0: public: sl@0: /** sl@0: Structure for holding driver capabilities information sl@0: (Just a version number in this example.) sl@0: */ sl@0: class TCaps sl@0: { sl@0: public: sl@0: TVersion iVersion; sl@0: }; sl@0: sl@0: /** sl@0: Structure for holding driver configuration data sl@0: */ sl@0: class TConfig sl@0: { sl@0: public: sl@0: TSize iImageSize; /**< Size of image in pixels */ sl@0: TInt iImageBytesPerPixel; /**< Number of bytes used to represent a single pixel */ sl@0: TInt iFrameRate; /**< Speed to capture images at in frames per second*/ sl@0: TInt iNumImageBuffers; /**< Number of simultanious images the client wishes to process */ sl@0: }; sl@0: typedef TPckgBuf TConfigBuf; sl@0: sl@0: #ifndef __KERNEL_MODE__ sl@0: public: sl@0: TInt Open(); sl@0: void Close(); sl@0: TInt GetConfig(TConfigBuf& aConfig); sl@0: TInt SetConfig(const TConfigBuf& aConfig); sl@0: TInt StartCapture(); sl@0: TInt EndCapture(); sl@0: void CaptureImage(TRequestStatus& aStatus, TInt aReleaseImage=-1); sl@0: void CaptureImageCancel(); sl@0: TInt ReleaseImage(TInt aReleaseImage); sl@0: TInt Duplicate(const RThread& aSrc,TOwnerType aType=EOwnerProcess); sl@0: inline RChunk ImageChunk() const; sl@0: private: sl@0: RChunk iChunk; /**< The chunk into which captured images will be placed */ sl@0: #endif sl@0: sl@0: public: sl@0: inline static const TDesC& Name(); sl@0: inline static TVersion VersionRequired(); sl@0: sl@0: private: sl@0: /** sl@0: Enumeration of Control messages. sl@0: */ sl@0: enum TControl sl@0: { sl@0: EGetConfig, sl@0: ESetConfig, sl@0: EStartCapture, sl@0: EEndCapture, sl@0: ECaptureImage, sl@0: EReleaseImage sl@0: }; sl@0: sl@0: /** sl@0: Enumeration of Request messages. sl@0: (None used in this example) sl@0: */ sl@0: enum TRequest sl@0: { sl@0: ENumRequests, sl@0: EAllRequests = (1<