videofeeds/livetvutils/inc/IptvLiveDataStructures.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     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 data structures shared by IP protocol livetv*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __IPTV_SMARTVISION_DATA_STRUCTURES
       
    21 #define __IPTV_SMARTVISION_DATA_STRUCTURES
       
    22 enum TIptvSmartVisionServiceType
       
    23     {
       
    24     ELiveTv = 0,
       
    25     EVod,
       
    26     EServiceDiscovery
       
    27     };
       
    28     
       
    29 struct SIptvSmartVisionServiceDiscovery
       
    30 	{
       
    31 	TBuf8<255> iAddress;
       
    32 	TIptvSmartVisionServiceType iServiceType;
       
    33 	};
       
    34 
       
    35 /**
       
    36  * This enum identifies different kind of messages
       
    37  * in message queue that UI listens to
       
    38  */
       
    39 enum TIptvQueueMsg
       
    40 	{
       
    41 	EEPGUpdateCompleted,   /**< LiveTV metadata update finished, possibly with error */
       
    42 	EEPGUpdateStarted,	   /**< LiveTV metadata update started */
       
    43 	EChannelDataModified,  /**< LiveTV channel object has been changed */
       
    44 	EChannelIconDownloaded,
       
    45 	EIapUp,                /**< Internet access point is up in CR engine */
       
    46 	EIapDown,              /**< Internet access point is down in CR engine */
       
    47 	EStartingConnection,
       
    48 	EBothAudioVideoExists,
       
    49 	EAudioOnly,            /**< LiveTV stream contains only audio, no video */
       
    50 	EVideoOnly,            /**< LiveTV stream contains only video, no audio */
       
    51 	ENoAudioOrVideo,       /**< LiveTV stream contains both audio and video */
       
    52 	EAuthenticationFailed, /**< RTSP server said 401 to common recording engine */
       
    53 	EScheduleCompleted,
       
    54 	ECRROPSDPReady,         /**< Common recording engine has SDP file ready for ROP */
       
    55 	EConnectionError	    /**< Unable to open connection in RTP engine & CR engine */
       
    56 	} ;
       
    57 /**
       
    58  * This structure is sent over message queue where
       
    59  * ui sits listening
       
    60  */
       
    61 struct SIptvQueueEntry
       
    62 	{
       
    63 	TIptvQueueMsg iMsg ;        /**< Identifies the message */
       
    64 	TUint iServiceId ;          /**< Service provider that this message is about */
       
    65 	TInt64 iModifiedChannelId ; /**< In case of EChannelDataModified the channel id */
       
    66 	TInt iErr ;                 /**< May be used to pass error value related to message */
       
    67 	};
       
    68 
       
    69 /**
       
    70  * This structure is used when downloading channel icons
       
    71  */
       
    72 struct SIptvChannelIconEntry
       
    73 	{
       
    74 	TUint32 iServiceId ;          /**< Service provider that this message is about */
       
    75 	TInt64 iChannelId ; 
       
    76 	TBuf8<256> iLogoPath;
       
    77 	};
       
    78 
       
    79 /**  
       
    80 * Version of CleanupXxxxPushL() that can be used to 'ResetAndDestroy'
       
    81 * the supplied object if the clean-up stack unwinds.
       
    82 */
       
    83 
       
    84 template <class T>
       
    85 class CleanupResetAndDestroy
       
    86     {
       
    87     public:
       
    88         inline static void PushL( T& aRef );
       
    89     private:
       
    90         static void ResetAndDestroy( TAny *aPtr );
       
    91     };
       
    92     
       
    93 template <class T>
       
    94     inline void CleanupResetAndDestroyPushL( T& aRef );
       
    95 
       
    96 template <class T>
       
    97 inline void CleanupResetAndDestroy<T>::PushL( T& aRef )
       
    98      {
       
    99      CleanupStack::PushL( TCleanupItem( &ResetAndDestroy, &aRef ) );
       
   100      }
       
   101 
       
   102 template <class T>
       
   103 void CleanupResetAndDestroy<T>::ResetAndDestroy( TAny *aPtr )
       
   104     {
       
   105     ( static_cast<T*>( aPtr ) )->ResetAndDestroy();
       
   106     }
       
   107     
       
   108 template <class T>
       
   109 inline void CleanupResetAndDestroyPushL( T& aRef )
       
   110     {
       
   111     CleanupResetAndDestroy<T>::PushL( aRef );
       
   112     }
       
   113     
       
   114 /**
       
   115  * Name of the queue that is used in creating and opening the queue
       
   116  */
       
   117 _LIT(KIptvUiMsgQueueName, "IPTV_MSG_Q_UI") ; 
       
   118 
       
   119 _LIT(KIptvUiEPGMsgQueueName, "IPTV_EPG_MSG_QUEUE" );
       
   120 
       
   121 #endif //__IPTV_SMARTVISION_DATA_STRUCTURES