videoutils_plat/dvrengine_api/inc/ipvideo/CRTypeDefs.h
changeset 41 d88d70d98bbc
parent 34 814ba97beeb9
child 46 3bc36dbd63c2
equal deleted inserted replaced
34:814ba97beeb9 41:d88d70d98bbc
     1 /*
       
     2 * Copyright (c) 2006 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 the License "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:    Common type definitions for both client and server parts*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CRTYPEDEFS_H
       
    19 #define CRTYPEDEFS_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 
       
    25 // CONSTANTS
       
    26 _LIT( KCRServerNameExe, "CommonRecordingEngine.exe" );
       
    27 _LIT( KCRServerSemaphoreName, "CommonRecServerSemaphore" );
       
    28 _LIT( KCRMsgQueueName, "CRMsgQueue%d" );
       
    29 
       
    30 /** Max RTSP Name/password len */
       
    31 const TInt KMaxNameLen( 40 );
       
    32 /** Max RTSP URI len */
       
    33 const TUint KMaxUrlLen( 256 );
       
    34 
       
    35 // The server version. A version must be specified 
       
    36 // when creating a session with the server
       
    37 const TUint KCRServMajorVersionNumber( 0 );
       
    38 const TUint KCRServMinorVersionNumber( 1 );
       
    39 const TUint KCRServBuildVersionNumber( 0 );
       
    40 const TUint KCRStackSize( 2 * KDefaultStackSize );
       
    41 const TUint KCRHeapSize( 0xF0000 );
       
    42 const TUint KCRMaxHeapSize( 0x1F0000 );
       
    43 
       
    44 // Queue name length (10 from fixed part and 
       
    45 // 10 from maximum numbers in 32 value
       
    46 const TUint KCRQueueNameLength( 20 );
       
    47 
       
    48 // MACROS
       
    49 // None.
       
    50 
       
    51 // DATA TYPES
       
    52 /**
       
    53 * Different messagetypes going from DVR engine to client lib. 
       
    54 * Note that client lib maps this to yet another enum before 
       
    55 * reporting the event via MCRStreamObserver::NotifyL
       
    56 */
       
    57 enum TCRQueueMsg
       
    58     {
       
    59     ECRMsgQueueAuthenticationNeeded, /**< Needs new username and password for authentication */
       
    60     ECRMsgQueueAttachCompleted,      /**< Connection Attach completed and connection ready to be used */
       
    61     ECRMsgQueueConnectionError,      /**< Unable to open connection in RTP engine & CR engine */
       
    62     ECRMsgQueueNotEnoughBandwidth,   /**< Stream bitrate higher than (estimated) available connection bandwidth */
       
    63     ECRMsgQueueSwitchingToTcp,       /**< Switching to tcp-streaming; client is supposed to init player */
       
    64     ECRMsgQueueNormalEndOfStream,    /**< clip ends normally */   
       
    65     ECRMsgQueueStreamIsLiveStream,   /**< indicates that we are streaming clip that cannot be paused */		
       
    66     ECRMsgQueueStreamIsRealMedia,    /**< Clip would have been (unsupported) realnetworks realmedia over rdt */
       
    67     ECRMsgQueueTestSinkData,         /**< Data from TestSink (former NullSink) to test client */
       
    68     ECRMsgQueueSdpAvailable,         /**< Used to communicate SDP availability to client */
       
    69     ECRMsgQueueReadyToSeek,          /**< Used to communicate seeking possibility */
       
    70     ECRMsgQueueRecordingStarted,     /**< Used to communicate recording state */
       
    71     ECRMsgQueueRecordingPaused,      /**< Used to communicate recording state */
       
    72     ECRMsgQueueRecordingEnded        /**< Used to communicate recording state */
       
    73     };
       
    74 
       
    75 /**
       
    76 *  Different message types going from TestSink (NullSink) to client lib.
       
    77 *  Embedded in TCRQueueMsg::ECRMsgQueueTestSinkData
       
    78 */
       
    79 enum TCRTestSinkData
       
    80     {
       
    81     ECRTestSinkStateIdle,
       
    82     ECRTestSinkStateSdpAvailable,
       
    83     ECRTestSinkStateSeqAndTSAvailable,
       
    84     ECRTestSinkStatePlaying,
       
    85     ECRTestSinkStateClosing,
       
    86     };
       
    87 
       
    88 /**
       
    89 * Different record formats. 
       
    90 */
       
    91 enum TCRRecordFormat
       
    92     {
       
    93     ECRRecordFormatRtp, /**< Nokia's propriatary RTP clip format */
       
    94     ECRRecordFormat3gp, /**< Normal 3GPP file format */
       
    95     ECRRecordTimeShift  /**< Time shifting with Nokia's propriatary format */
       
    96     };
       
    97 
       
    98 /**
       
    99  * This structure is sent over message queue where
       
   100  * api sits listening
       
   101  */
       
   102 struct SCRQueueEntry
       
   103     {
       
   104     TCRQueueMsg iMsg; /**< Identifies the message */
       
   105     TInt iErr;        /**< Can be used to pass error value related to message */
       
   106 	TInt iSessionId;  /**< Points to session generating the message. 0 points no session, broadcast */
       
   107     };
       
   108 
       
   109 /**
       
   110 * Structure used to communicate the Internet Access Point that
       
   111 * DVR engine may use 
       
   112 */
       
   113 struct SCRRtspIapParams
       
   114     {
       
   115     TInt32 iIap;  /**< Internet Access Point ID from COMMS db. Currently not used */
       
   116 	TUint32 iConnectionId; /**< Handle of opened RConnection. Currently used */
       
   117 	TBuf<KCRQueueNameLength> iQueueName; /**< Name of RMSgQueue that DVR engine will use to report progress back */
       
   118     };
       
   119 
       
   120 /**
       
   121 * Data structure specifying RTSP address 
       
   122 */
       
   123 struct SCRRtspParams
       
   124     {
       
   125     TBuf<KMaxUrlLen> iUrl ;  /**< usually something like rtsp://server.name... */
       
   126 	TBuf<KMaxNameLen> iUserName; /**< RTSP Username. May be blank if server is not going to reply 401 */
       
   127 	TBuf<KMaxNameLen> iPassword; /**< RTSP password. May be blank if server is not going to reply 401 */    
       
   128 	TBuf<KCRQueueNameLength> iQueueName; /**< Name of RMSgQueue that DVR engine will use to report progress back */
       
   129 	TName iProxyServerAddr ; /**< Possible rtsp proxy server */
       
   130 	TInt iProxyServerPort ;  /**< Rtsp proxy port number */
       
   131     };
       
   132     
       
   133 /**
       
   134 * Defines live stream params.
       
   135 */
       
   136 struct SCRLiveParams
       
   137     {
       
   138     TPtrC8 iSdpData;
       
   139     };
       
   140     
       
   141 /**
       
   142 * Defines RTP playback params.
       
   143 */
       
   144 struct SCRRtpPlayParams
       
   145     {
       
   146     TFileName iFileName;
       
   147     };
       
   148     
       
   149 /**
       
   150 * Defines recording params.
       
   151 */
       
   152 struct SCRRecordParams
       
   153     {
       
   154     TPtrC iFileName;
       
   155     TCRRecordFormat iFormat;
       
   156     TPtrC iServiceName;
       
   157     TPtrC iProgramName; 
       
   158     TPtrC8 iSdpData;
       
   159     TInt iPostRule;
       
   160     TInt iParental;
       
   161     TTime iEndTime;
       
   162     };
       
   163         
       
   164 /**
       
   165 * Opcodes used in message passing between client and server.
       
   166 */
       
   167 enum TCRServRqst
       
   168     {
       
   169     // Server request
       
   170     ECRServBase = 450,
       
   171     ECRServConnect,
       
   172     ECRServCreateSubSession,
       
   173     ECRServCloseSubSession,
       
   174     ECRServCloseSession,
       
   175     ECRServReset,
       
   176     ECRServCancelAll,
       
   177     ECRServLastEnum,
       
   178     // API for LiveTV specific commands
       
   179     ECRLiveTvBase = 500,
       
   180     ECRSetIap,
       
   181     ECRCancelSetIap,
       
   182     ECRPlayRtspUrl,
       
   183     ECRPlayDvbhLive,
       
   184     ECRChangeService,
       
   185     ECRPlayRtpFile,
       
   186     ECRPlayRtpHandle,
       
   187     ECRRecordCurrentStream,
       
   188     ECRRecordRtspStream,
       
   189     ECRRecordDvbhStream,
       
   190     ECRPauseRecordStream,
       
   191     ECRStopRecordStream,
       
   192     ECRStartTimeShift,
       
   193     ECRStopTimeShift,
       
   194     ECRPlayCommand,
       
   195     ECRPauseCommand,
       
   196     ECRStopCommand,
       
   197     ECRSetPosition,
       
   198     ECRGetPosition,
       
   199     ECRCloseSession,
       
   200     ECRPlayNullSource,
       
   201     ECRPlayRtspUrlToNullSink,
       
   202     ECRLiveTvLastEnum
       
   203     };
       
   204     
       
   205 /**
       
   206 * Opcodes used in message passing from server.
       
   207 */
       
   208 enum TCRServResponse
       
   209     {
       
   210     ECRStreamPauseHanling = 550,
       
   211     ECRStreamEndHandling
       
   212     };
       
   213 
       
   214 #endif // CRTYPEDEFS_H
       
   215 
       
   216 // End of File