www.pudn.com > Full-Duplex_Audio_Example.rar > shareddata.h


/* 
* ============================================================================= 
*  Name        : SharedData.h 
*  Part of     : FullDuplexEx 
*  Description : Data structure that is shared between the audio output & input 
                 stream threads 
                  
*  Version     :  
* 
*  Copyright © 2007 Nokia. All rights reserved. 
*  This material, including documentation and any related  
*  computer programs, is protected by copyright controlled by  
*  Nokia. All rights are reserved. Copying, including  
*  reproducing, storing, adapting or translating, any  
*  or all of this material requires the prior written consent of  
*  Nokia. This material also contains confidential  
*  information which may not be disclosed to others without the  
*  prior written consent of Nokia. 
* ============================================================================= 
*/ 
 
#ifndef __TSHAREDDATA_H__ 
#define __TSHAREDDATA_H__ 
 
// INCLUDES 
#include  
#include    // for CMMFDescriptorBuffer  
#include     // for TFourCC 
 
 
// ENUMERATIONS 
// Commands for controlling the input stream thread 
enum TUserCommand 
    { 
    ECmdStartInputStream = 0, 
    ECmdStopInputStream, 
    ECmdTerminateThread, 
    ECmdInitialize 
    }; 
 
// class TSharedData 
/**  
*   This struct is used for inter-thread data trasfer and 
*   communication 
*/ 
 
class TSharedData 
    { 
    public: 
        //semaphore for thread end signalling 
        RSemaphore  iThreadSync; 
 
        // semaphore for synchronize the two threads 
        RSemaphore  iBufferFilled; 
         
        // mutex for shared buffer access 
        RMutex  iMutex; 
 
        // shared buffer for audio data 
        CMMFDescriptorBuffer* iBuffer; 
 
        // command parameter, used for signalling between  
        //  main thread and input stream thread 
        TUserCommand    iCmd; 
         
        // shared req. status, used for signalling between 
        // threads via active object  
        TRequestStatus* iStatusPtr; 
         
        // Stores the data type (codec) used for streaming 
        TFourCC iFourCC; 
         
    }; 
 
#endif  // __TSHAREDDATA_H__