vtprotocolplugins/VideoSource/inc/cmultiframeloopao.h
changeset 0 ed9695c8bcbe
equal deleted inserted replaced
-1:000000000000 0:ed9695c8bcbe
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Video Source subsystem.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_MULTIFRAMELOOPAO_H
       
    20 #define C_MULTIFRAMELOOPAO_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CMultiframeProvider;
       
    27 
       
    28 // MACROS
       
    29 
       
    30 /**
       
    31 * @lib videosource.lib
       
    32 * Handles data looping in multi frame sharing case.
       
    33 */
       
    34 NONSHARABLE_CLASS( CMultiframeloopAO ) : public CActive
       
    35     {
       
    36     public: // Constructors and destructor
       
    37 
       
    38         /**
       
    39         * Constructor.
       
    40         * @param "aRequester" instance to requester
       
    41         */
       
    42         CMultiframeloopAO( CMultiframeProvider* aRequester );
       
    43 
       
    44         /**
       
    45         * Destructor.
       
    46         */
       
    47         ~CMultiframeloopAO();
       
    48         
       
    49         /**
       
    50         * Decreases number of free bitmaps
       
    51         * @param "aCount" count how many bitmaps to be removed
       
    52         */
       
    53         void RemoveFreeBitmaps( TInt aCount );
       
    54         
       
    55         /**
       
    56         * Increases number of free bitmaps
       
    57         * @param "aCount" count how many bitmaps to be increased
       
    58         */
       
    59         void SetFreeBitmaps( TInt aCount );
       
    60         
       
    61         /**
       
    62         * Cancels looping and completes request in correct thread.
       
    63         */
       
    64         void CancelDataLoop();
       
    65 
       
    66     public: // New functions
       
    67 
       
    68         /**
       
    69         * Activates looping and completes request in correct thread. 
       
    70         */
       
    71         void Signal( );
       
    72         
       
    73        	/**
       
    74         * Sets frame count.
       
    75         * @param "aCount" frame count
       
    76         */
       
    77         void SetFrameCount( TInt aCount );
       
    78 
       
    79     private:    // Functions from base classes
       
    80 
       
    81         /**
       
    82         * From CActive. See CActive for description.
       
    83         */
       
    84         void RunL();
       
    85 
       
    86         /**
       
    87         * From CActive. See CActive for description.
       
    88         */
       
    89         void DoCancel();
       
    90 
       
    91     private:    // Data
       
    92 
       
    93         // Pointer to requester.
       
    94         CMultiframeProvider* iRequester; // not owned
       
    95         
       
    96         // Index of frame to be handled
       
    97         TInt iIndex;
       
    98         
       
    99         // Total nuber of frames
       
   100         TInt iFramecount;
       
   101         
       
   102         // Number of free bitmaps 
       
   103         TInt iFreeBMCount;
       
   104         
       
   105         // Id of thread whose active scheduler this instance is added into.
       
   106         TThreadId iThreadId;
       
   107         
       
   108         // A flag to indecate loop ao must be stopped
       
   109         TBool iRequireStopping;
       
   110     };
       
   111 #endif //C_MULTIFRAMELOOPAO_H
       
   112 
       
   113 // End of File