mmsharing/mmshengine/inc/musengmceutils.h
branchRCL_3
changeset 22 73a1feb507fb
parent 0 f0cf47e981f9
child 23 bc78a40cd63c
equal deleted inserted replaced
21:33a5d2bbf6fc 22:73a1feb507fb
    22 #define MUSENGMCEUTILS_H
    22 #define MUSENGMCEUTILS_H
    23 
    23 
    24 
    24 
    25 #include <mcemediastream.h>
    25 #include <mcemediastream.h>
    26 #include <mcemediasink.h>
    26 #include <mcemediasink.h>
       
    27 #include <mcemediasource.h>
    27 
    28 
    28 
    29 
    29 class CMceSession;
    30 class CMceSession;
    30 class CMceDisplaySink;
    31 class CMceDisplaySink;
    31 class CMceCameraSource;
    32 class CMceCameraSource;
    32 class CMceFileSource;
    33 class CMceFileSource;
    33 class CMceVideoStream;
    34 class CMceVideoStream;
    34 class CMceSpeakerSink;
    35 class CMceSpeakerSink;
    35 
    36 
       
    37 const TUint KMusEngNoAssociatedSourceType = KMaxTUint;
    36 
    38 
    37 /**
    39 /**
    38 * Static class including utility methods to locate and manipulate MCE 
    40 * Static class including utility methods to locate and manipulate MCE 
    39 * sessions, streams, sources and sinks
    41 * sessions, streams, sources and sinks
    40 * @lib musengine.lib
    42 * @lib musengine.lib
    51         * @return ETrue if parameter is a video stream with a RTP source
    53         * @return ETrue if parameter is a video stream with a RTP source
    52         */
    54         */
    53         static TBool IsVideoInStream( CMceMediaStream& aStream );
    55         static TBool IsVideoInStream( CMceMediaStream& aStream );
    54 
    56 
    55         /**
    57         /**
       
    58         * Tells if a stream is a video stream with rtp sink.
       
    59         *
       
    60         * @param aStream Stream to be investigated
       
    61         * @return ETrue if parameter is a video stream with a RTP sink
       
    62         */
       
    63         static TBool IsVideoOutStream( CMceMediaStream& aStream );
       
    64         
       
    65         /**
    56         * Tells if a stream is an audio stream with rtp source.
    66         * Tells if a stream is an audio stream with rtp source.
    57         *
    67         *
    58         * @param aStream Stream to be investigated
    68         * @param aStream Stream to be investigated
    59         * @return ETrue if parameter is an audio stream with a RTP source
    69         * @return ETrue if parameter is an audio stream with a RTP source
    60         */
    70         */
    91         static CMceVideoStream* GetRecordingStream( CMceSession& aSession );
   101         static CMceVideoStream* GetRecordingStream( CMceSession& aSession );
    92         
   102         
    93         /**
   103         /**
    94         * Gets handle to a media sink of spesified type contained by
   104         * Gets handle to a media sink of spesified type contained by
    95         * a mediastream. If there are several sink instances, first one is 
   105         * a mediastream. If there are several sink instances, first one is 
    96         * returned. Ownership is not transferred.
   106         * returned. If associated source type is defined, sink in stream having
       
   107         * the source is tried to be searched. If no such match, first matching 
       
   108         * sink is returned. Ownership is not transferred.
    97         *
   109         *
    98         * @return Media sink of the spesified type. NULL if none exists
   110         * @return Media sink of the spesified type. NULL if none exists
    99         */
   111         */
   100         static CMceMediaSink* GetMediaSink( CMceMediaStream& aStream, 
   112         static CMceMediaSink* GetMediaSink( 
   101                                             TMceSinkType aType );
   113                 CMceMediaStream& aStream, 
       
   114                 TMceSinkType aType,
       
   115                 TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType );
   102         
   116         
   103         /**
   117         /**
   104         * Gets handle to a media sink of spesified type contained by
   118         * Gets handle to a media sink of spesified type contained by
   105         * a mediastream. If there are several sink instances, first one is 
   119         * a mediastream. If there are several sink instances, first one is 
   106         * returned. Ownership is not transferred.
   120         * returned. If associated source type is defined, sink in stream having
       
   121         * the source is tried to be searched. If no such match, first matching 
       
   122         * sink is returned. Ownership is not transferred.
   107         *
   123         *
   108         * @return Media sink of the spesified type.
   124         * @return Media sink of the spesified type.
   109         * @leave KErrNotFound if there is no sink of spesified type
   125         * @leave KErrNotFound if there is no sink of spesified type
   110         */
   126         */
   111         static CMceMediaSink* GetMediaSinkL( CMceMediaStream& aStream, 
   127         static CMceMediaSink* GetMediaSinkL( 
   112                                              TMceSinkType aType );
   128                 CMceMediaStream& aStream, 
       
   129                 TMceSinkType aType,
       
   130                 TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType );
   113 
   131 
   114         /**
   132         /**
   115         * Gets handle to a media sink of spesified type contained by
   133         * Gets handle to a media sink of spesified type contained by
   116         * a session. If there are several sink instances, first one is 
   134         * a session. If there are several sink instances, first one is 
   117         * returned. Ownership is not transferred.
   135         * returned. If associated source type is defined, sink in stream having
       
   136         * the source is tried to be searched. If no such match, first matching 
       
   137         * sink is returned. Ownership is not transferred.
   118         *
   138         *
   119         * @return Media sink of the spesified type. NULL if none exists
   139         * @return Media sink of the spesified type. NULL if none exists
   120         */
   140         */
   121         static CMceMediaSink* GetMediaSink( CMceSession& aSession, 
   141         static CMceMediaSink* GetMediaSink( 
   122                                             TMceSinkType aType );
   142                 CMceSession& aSession, 
       
   143                 TMceSinkType aType,
       
   144                 TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType,
       
   145                 TBool aStrictMatch = EFalse );
   123         
   146         
   124         /**
   147         /**
   125         * Gets handle to a media sink of spesified type contained by
   148         * Gets handle to a media sink of spesified type contained by
   126         * a session. If there are several sink instances, first one is 
   149         * a session. If there are several sink instances, first one is 
   127         * returned. Ownership is not transferred.
   150         * returned. If associated source type is defined, sink in stream having
       
   151         * the source is tried to be searched. If no such match, first matching 
       
   152         * sink is returned. Ownership is not transferred.
   128         *
   153         *
   129         * @return Media sink of the spesified type.
   154         * @return Media sink of the spesified type.
   130         * @leave KErrNotFound if there is no sink of spesified type
   155         * @leave KErrNotFound if there is no sink of spesified type
   131         */
   156         */
   132         static CMceMediaSink* GetMediaSinkL( CMceSession& aSession, 
   157         static CMceMediaSink* GetMediaSinkL( 
   133                                              TMceSinkType aType );
   158                 CMceSession& aSession, 
       
   159                 TMceSinkType aType,
       
   160                 TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType,
       
   161                 TBool aStrictMatch = EFalse );
   134         
   162         
   135         /**
   163         /**
   136         * Gets handle to a speaker sink contained by specified stream 
   164         * Gets handle to a speaker sink contained by specified stream 
   137         * or its' bound stream. Ownership is not transferred.
   165         * or its' bound stream. Ownership is not transferred.
   138         *
   166         *
   159         /**
   187         /**
   160         * Gets handle to a display sink. Ownership is not transferred.
   188         * Gets handle to a display sink. Ownership is not transferred.
   161         *
   189         *
   162         * @return Display sink, NULL if none exists
   190         * @return Display sink, NULL if none exists
   163         */
   191         */
   164         static CMceDisplaySink* GetDisplay( CMceSession& aSession );        
   192         static CMceDisplaySink* GetDisplay( CMceSession& aSession,
       
   193                                             TBool aPreferViewFinder = ETrue );        
   165 
   194 
   166         /**
   195         /**
   167         * Gets handle to a display sink. If there are several display
   196         * Gets handle to a display sink. If there are several display
   168         * sink instances, first one is returned.
   197         * sink instances view finder is preferred with default arguments.
   169         * Ownership is not transferred.
   198         * Ownership is not transferred.
   170         *
   199         *
   171         * @return Display sink
   200         * @return Display sink
   172         * @leave KErrNotFound if there is no display
   201         * @leave KErrNotFound if there is no display
   173         */
   202         */
   174         static CMceDisplaySink* GetDisplayL( CMceSession& aSession );     
   203         static CMceDisplaySink* GetDisplayL( CMceSession& aSession, 
   175 
   204                                              TBool aPreferViewFinder = ETrue );     
       
   205 
       
   206         /**
       
   207         * Gets handle to a display sink. Ownership is not transferred.
       
   208         *
       
   209         * @return Display sink, NULL if none exists
       
   210         */
       
   211         static CMceDisplaySink* GetReceivingDisplay( CMceSession& aSession );          
       
   212         
       
   213         /**
       
   214         * Gets handle to a receiving display sink. Ownership is not transferred.
       
   215         *
       
   216         * @return Display sink
       
   217         * @leave KErrNotFound if there is no display
       
   218         */
       
   219         static CMceDisplaySink* GetReceivingDisplayL( CMceSession& aSession );    
       
   220         
       
   221         /**
       
   222         * Gets handle to a viewfinder display sink. Ownership is not transferred.
       
   223         *
       
   224         * @return Display sink
       
   225         * @leave KErrNotFound if there is no display
       
   226         */
       
   227         static CMceDisplaySink* GetVfDisplay( CMceSession& aSession );
       
   228         
   176         /**
   229         /**
   177         * Adds display sink to specified stream if one does not exist already.
   230         * Adds display sink to specified stream if one does not exist already.
   178         * Display rect is set in both cases to a specified one.
   231         * Display rect is set in both cases to a specified one.
   179         * Display is disabled by default.
   232         * Display is disabled by default.
   180         * 
   233         * 
   183         * @param aDisplayRect is desired display area
   236         * @param aDisplayRect is desired display area
   184         * @leave KErrArgument if offered stream is not a video stream
   237         * @leave KErrArgument if offered stream is not a video stream
   185         */
   238         */
   186         static void AddDisplayL( CMceMediaStream& aStream, 
   239         static void AddDisplayL( CMceMediaStream& aStream, 
   187                                  CMceManager& aManager, 
   240                                  CMceManager& aManager, 
   188                                  const TRect& aDisplayRect );
   241                                  const TRect& aDisplayRect,
       
   242                                  TBool aDisable = EFalse );
   189 
   243 
   190         /**
   244         /**
   191         * Adds speaker sink to specified stream if one does not exist already.
   245         * Adds speaker sink to specified stream if one does not exist already.
   192         * Speaker is disabled by default.
   246         * Speaker is disabled by default.
   193         * 
   247         * 
   201         * 
   255         * 
   202         * @param aStream is a stream to be disabled
   256         * @param aStream is a stream to be disabled
   203         */
   257         */
   204         static void DisableStreamL( CMceMediaStream& aStream );
   258         static void DisableStreamL( CMceMediaStream& aStream );
   205         
   259         
       
   260         /**
       
   261         * Enables or disables display sink. If the state is already correct,
       
   262         * nothing is done.
       
   263         */
       
   264         static void DoEnableDisplayL( CMceDisplaySink& aDisplay, TBool aEnable );
       
   265         
       
   266         /**
       
   267         * Enables inactivity timer if possible.
       
   268         */
       
   269         static TInt EnableInactivityTimer( CMceSession& aSession, 
       
   270                                            TUint32 aInactivityTimeout );
       
   271         
   206     };
   272     };
   207 
   273 
   208 
   274 
   209 #endif // MUSENGMCEUTILS_H
   275 #endif // MUSENGMCEUTILS_H