ipappsrv_plat/media_control_api/inc/mmccinterface.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     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 "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:    Class is used for controlling MCC.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MMCCINTERFACE_H
       
    22 #define MMCCINTERFACE_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <mmf/common/mmffourcc.h>
       
    27 #include <mmf/common/mmfstandardcustomcommands.h>
       
    28 #include <mmccnetworksettings.h>
       
    29 #include <mmccinterfacedef.h>
       
    30 #include <mmccevents.h>
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CMccCodecInformation;
       
    34 class CMccEvent;
       
    35 class TCameraInfo;
       
    36 
       
    37 // CONSTANTS
       
    38 const TUid KUidMccInterface     = { 0x102073F7 };
       
    39 const TUid KUidMccFileSink      = { 0x102747D7 };
       
    40 const TUid KUidMccFileSource    = { 0x102747D5 };
       
    41 const TUid KUidMccRtpSource     = { 0x1020740B };
       
    42 const TUid KUidMccRtpSink       = { 0x1020740C };
       
    43 const TUid KUidMccVideoSource   = { 0x102747D6 };
       
    44 const TUid KUidMccVideoSink     = { 0x102747D8 };
       
    45 const TUid KUidMccTranscoder    = { 0x10282897 };
       
    46 const TUid KUidMccAnySource     = { 0x10283394 };
       
    47 const TUid KUidMccAnySink       = { 0x10283395 };
       
    48 
       
    49 // MACROS
       
    50 
       
    51 // DATA TYPES
       
    52 
       
    53 // FUNCTION PROTOTYPES
       
    54 
       
    55 // CLASS DECLARATION
       
    56 
       
    57 /**
       
    58 *  MCC subsystem client interface. Class is used for setting up and controlling
       
    59 *  multimedia streams. Details of resources needed by the cleint are unknown, 
       
    60 *  hence specified in details in every session.
       
    61 *
       
    62 *  MCC interface is based on four components: Session, link, stream and endpoint
       
    63 *  (sink or source). In order to create multimedia streams, client need to
       
    64 *  construct it by using these four components. 
       
    65 *
       
    66 *  @lib mmccinterface.lib
       
    67 */
       
    68 class CMccInterface : public CBase
       
    69 {
       
    70 public:  // Constructors and destructor
       
    71     /**
       
    72     * Two-phased constructor.
       
    73     * @param aObserver A callback object to receive and handle
       
    74     *                    event notifications from MCC subsystem.
       
    75     * @return CMccInterface* Pointer to the interface object created
       
    76     */
       
    77     IMPORT_C static CMccInterface* NewL( MMccCtrlObserver& aObserver );
       
    78 
       
    79     /**
       
    80     * Destructor.
       
    81     */
       
    82     virtual ~CMccInterface();
       
    83 
       
    84 public: // New functions
       
    85 
       
    86     /**
       
    87     * Creates a new MCC session. The session is needed to create
       
    88     * links and streams into MCC. A single session may have any
       
    89     * number of links.
       
    90     * @param aSessionID ID of the new session if successful
       
    91     * @return KErrNone if success; otherwise system wide error code.
       
    92     */
       
    93     IMPORT_C TInt CreateSession( TUint32& aSessionId );
       
    94 
       
    95     /**
       
    96     * Closes MCC session. All links and streams of the session are also
       
    97     * closed.
       
    98     * @param aSessionId session ID
       
    99     * @return One of the standard system-wide error codes.
       
   100     */
       
   101     IMPORT_C TInt CloseSession( TUint32 aSessionId );
       
   102 
       
   103     /**
       
   104     * Creates a new MCC link with a remote participant. Link creates
       
   105     * new RTP session with given network settings.
       
   106     * @param aSessionId session ID
       
   107     * @param aLinkType Defines is stream Up- or Downlink
       
   108     * @param aLinkId ID of new link
       
   109     * @param aNetSettings network settings for the link
       
   110     * @return KErrNone if success; otherwise system wide error code.
       
   111     */
       
   112     IMPORT_C TInt CreateLink( TUint32 aSessionId,
       
   113                               TInt aLinkType,
       
   114                               TUint32& aLinkId,
       
   115                               TMccNetSettings& aNetSettings );
       
   116 
       
   117     /**
       
   118     * Closes MCC link. All streams of the link are also closed.
       
   119     * @param aSessionId session ID
       
   120     * @param aLinkId link ID
       
   121     * @return One of the standard system-wide error codes.
       
   122     */
       
   123     IMPORT_C TInt CloseLink( TUint32 aSessionId, TUint32 aLinkId );
       
   124 
       
   125     /**
       
   126     * Creates a stream into a MCC link. Constructs the datapath
       
   127     * for stream, but no media resources reserved yet.
       
   128     * @param aSessionId session where stream is created to
       
   129     * @param aLinkId link ID where stream is created to
       
   130     * @param aStreamId Stream ID for the stream created.
       
   131     * @param aStreamType type of the stream
       
   132     * @param aCodecInformation Codec information for the stream.
       
   133     * @return KErrNone if success; otherwise system wide error code.
       
   134     */
       
   135     IMPORT_C TInt CreateStream( TUint32 aSessionId, TUint32 aLinkId,
       
   136                                 TUint32& aStreamId, TInt aStreamType,
       
   137                                 CMccCodecInformation& aCodecInformation );
       
   138 
       
   139     /**
       
   140     * Prepares a stream so that it is ready to be started. Media resources
       
   141     * are reserved and RTP stream is created.
       
   142     * @param aSessionId session where stream belongs to
       
   143     * @param aLinkId link ID where stream belongs to
       
   144     * @param aStreamId ID identifying stream to be prepared
       
   145     * @param aEndpointId ID identifying endpoint of the stream to be prepared.
       
   146     *         If value 0, both endpoints prepared.
       
   147     * @return One of the standard system-wide error codes.
       
   148     */
       
   149     IMPORT_C TInt PrepareStream( TUint32 aSessionId, TUint32 aLinkId, 
       
   150                                  TUint32 aStreamId, TUint32 aEndpointId = 0 );
       
   151 
       
   152     /**
       
   153     * Starts to send/receive media stream in a given session.
       
   154     * @param aSessionId session where stream belongs to
       
   155     * @param aLinkId link ID
       
   156     * @param aStreamId ID identifying stream to be started
       
   157     * @param aPaused ETrue, if stream paused after start
       
   158     * @param aEndpointId ID identifying endpoint of the stream to be started.
       
   159     *         If value 0, both endpoints started.
       
   160     * @param aEnableRTCP ETrue, if RTCP sent.
       
   161     * @return One of the standard system-wide error codes.
       
   162     */
       
   163     IMPORT_C TInt StartStream( TUint32 aSessionId, TUint32 aLinkId, 
       
   164                                TUint32 aStreamId, TUint32 aEndpointId = 0,
       
   165                                TBool aPaused = EFalse, TBool aEnableRTCP = ETrue );
       
   166 
       
   167     /**
       
   168     * Pauses media stream in a given session. No RTP packets are 
       
   169     * sent/received anymore. However, RTCP packets may still be sent and
       
   170     * received.
       
   171     * @param aSessionId session where stream belongs to
       
   172     * @param aLinkId link ID
       
   173     * @param aStreamId ID identifying stream to be paused
       
   174     * @param aEndpointId ID identifying endpoint of the stream to be paused.
       
   175     *         If value 0, both endpoints paused.
       
   176     * @param aEnableRTCP ETrue, if RTCP sent while paused.
       
   177     * @return One of the standard system-wide error codes.
       
   178     */
       
   179     IMPORT_C TInt PauseStream( TUint32 aSessionId, TUint32 aLinkId, 
       
   180                                TUint32 aStreamId, TUint32 aEndpointId = 0,
       
   181                                TBool aEnableRTCP = ETrue );
       
   182 
       
   183     /**
       
   184     * Resumes paused media stream in a given session.
       
   185     * @param aSessionId session where stream belongs to
       
   186     * @param aLinkId link ID
       
   187     * @param aStreamId Stream ID identifying stream to be resumed
       
   188     * @param aEndpointId ID identifying endpoint of the stream to be resumed.
       
   189     *         If value 0, both endpoints resumed.
       
   190     * @param aEnableRTCP ETrue, if RTCP sent while playing.
       
   191     * @return One of the standard system-wide error codes.
       
   192     */
       
   193     IMPORT_C TInt ResumeStream( TUint32 aSessionId, TUint32 aLinkId, 
       
   194                                 TUint32 aStreamId, TUint32 aEndpointId = 0,
       
   195                                 TBool aEnableRTCP = ETrue );
       
   196 
       
   197     /**
       
   198     * Stops sending/receiving media stream in a given session.
       
   199     * @param aSessionId session where stream belongs to
       
   200     * @param aLinkId link ID
       
   201     * @param aStreamId Stream ID identifying stream to be stopped
       
   202     * @param aEndpointId ID identifying endpoint of the stream to be stopped.
       
   203     *         If value 0, both endpoints stopped.
       
   204     * @return One of the standard system-wide error codes.
       
   205     */
       
   206     IMPORT_C TInt StopStream( TUint32 aSessionId, TUint32 aLinkId, 
       
   207                                TUint32 aStreamId, TUint32 aEndpointId = 0 );
       
   208 
       
   209     /**
       
   210     * Deletes media stream in a given session.
       
   211     * @param aSessionId  session where stream belongs to
       
   212     * @param aLinkId link ID
       
   213     * @param aStreamId  Stream ID identifying stream to be deleted
       
   214     * @return One of the standard system-wide error codes.
       
   215     */
       
   216     IMPORT_C TInt DeleteStream( TUint32 aSessionId, TUint32 aLinkId, 
       
   217                                 TUint32 aStreamId  );
       
   218 
       
   219     /**
       
   220     * Starts inactivity timer for a stream in a given session.
       
   221     * If RTP data is not received in given tive, inactivy
       
   222     * event is sent to client. In case of timeout, inactivity
       
   223     * timer is stopped. Client may restart the timer is needed.
       
   224     * @param aSessionId session where stream belongs to
       
   225     * @param aLinkId link ID
       
   226     * @param aStreamId Stream ID identifying stream
       
   227     * @param aTimeoutTime timeout value in microseconds
       
   228     * @param aEndpointId ID identifying endpoint of the stream to be monitored.
       
   229     * @return One of the standard system-wide error codes.
       
   230     */
       
   231     IMPORT_C TInt StartInactivityTimer( TUint32 aSessionId,
       
   232                                         TUint32 aLinkId, TUint32 aStreamId,
       
   233                                         TUint32 aTimeoutTime, TUint32 aEndpointId = 0 );
       
   234 
       
   235     /**
       
   236     * Stops inactivity timer for a stream in a given session.
       
   237     * @param aSessionId session where stream belongs to
       
   238     * @param aLinkId link ID
       
   239     * @param aStreamId Stream ID identifying stream
       
   240     * @param aEndpointId ID identifying endpoint of the stream where monitoring stopped.
       
   241     * @return One of the standard system-wide error codes.
       
   242     */
       
   243     IMPORT_C TInt StopInactivityTimer( TUint32 aSessionId, TUint32 aLinkId,
       
   244                                        TUint32 aStreamId, TUint32 aEndpointId = 0 );
       
   245 
       
   246     /**
       
   247     * Set remote IP address and port number for a given session.
       
   248     * @param aSessionId session ID
       
   249     * @param aLinkId link ID
       
   250     * @param aRemoteAddr Remote address to set
       
   251     * @param aRemoteRtcpPort Remote RTCP port to set, if not RTP port +1
       
   252     * @return One of the standard system-wide error codes.
       
   253     */
       
   254     IMPORT_C TInt SetRemoteAddress( TUint32 aSessionId, TUint32 aLinkId,
       
   255                                     const TInetAddr& aRemoteAddr, TUint aRemoteRtcpPort = 0 );
       
   256 
       
   257 
       
   258     /**
       
   259     * Gets current codec used in a given stream.
       
   260     * @param aSessionId session ID
       
   261     * @param aLinkId Link ID
       
   262     * @param aStreamId Stream ID
       
   263     * @return Current codec used with the specified stream, ownership is transferred.
       
   264     */
       
   265     IMPORT_C CMccCodecInformation* CodecL( TUint32 aSessionId,
       
   266                                            TUint32 aLinkId,
       
   267                                            TUint32 aStreamId );
       
   268 
       
   269     /**
       
   270     * Sets codec to be used in a given stream.
       
   271     * @param aSessionId session ID
       
   272     * @param aLinkId Link ID
       
   273     * @param aStreamId Stream ID
       
   274     * @param aCodec Codec to be used
       
   275     * @return One of the standard system-wide error codes.
       
   276     */
       
   277     IMPORT_C TInt SetCodec( TUint32 aSessionId, TUint32 aLinkId,
       
   278                             TUint32 aStreamId,
       
   279                             CMccCodecInformation& aCodecInformation );
       
   280     
       
   281     
       
   282     /**
       
   283     * Get supported codecs by the system. Certain sinks and sources
       
   284     * however may have limitations on which codecs they support, hence
       
   285     * all these codecs may not allowed in all streams.
       
   286     * @param aCodecs An array to be filled with FourCC codes
       
   287     * @return One of the standard system-wide error codes.
       
   288     */
       
   289     TInt GetSupportedCodecs( RArray<TFourCC>& aCodecs );
       
   290                             
       
   291     /**
       
   292     * Returns array of supported codecs in the system with their default values.
       
   293     * Note that data that the aCapabilities contains before calling this function 
       
   294     * will be lost during the excecution of this function. Note also that the client
       
   295     * is responsible for the destruction of the objects contained in the
       
   296     * parameter array.
       
   297     * @param aCapabilities Codec capabilities
       
   298     * @return KErrNone if successful
       
   299     */
       
   300     IMPORT_C TInt GetCapabilities(
       
   301             RPointerArray<CMccCodecInformation>& aCapabilities ) const;
       
   302 
       
   303     /**
       
   304     * Returns array of supported codecs of specific sink or source. Note that data that
       
   305     * the aCapabilities contains before calling this function will be
       
   306     * lost during the excecution of this function. Note also that the client
       
   307     * is responsible for the destruction of the objects contained in the
       
   308     * parameter array.
       
   309     * @param aType, type identifier of source or sink
       
   310     * @param aStreamType type of the stream
       
   311     * @param aParam, source or sink specific param
       
   312     * @param aCapabilities Codec capabilities
       
   313     * @return KErrNone if successful
       
   314     */
       
   315     IMPORT_C TInt GetCapabilities( const TUid aType, TInt aStreamType, const TDesC8& aParam,
       
   316             RPointerArray<CMccCodecInformation>& aCapabilities );
       
   317          
       
   318     /**
       
   319     * Get Synchronization source identifier.
       
   320     * @param aSessionId session ID
       
   321     * @param aLinkId Link ID
       
   322     * @param aStreamId Stream ID
       
   323     * @param aEndpointId ID identifying endpoint of the stream.
       
   324     * @param aSSRC SSRC value
       
   325     * @return One of the standard system-wide error codes.
       
   326     */   
       
   327     IMPORT_C TInt GetSSRC ( TUint32 aSessionId,
       
   328                             TUint32 aLinkId,
       
   329                             TUint32 aStreamId,
       
   330                             TUint32 aEndpointId,
       
   331                             TUint32& aSSRC );
       
   332 
       
   333     /**
       
   334     * Sends media signal (e.g. DTMF,RTCP) to uplink if possible.
       
   335     * @param aEvent Event to be sent
       
   336     * @return void
       
   337     */
       
   338     IMPORT_C void SendMediaSignalL( const TMccEvent& aEvent );
       
   339     
       
   340     /**
       
   341     * Adds new sink to the session. User must later
       
   342     * call CreateStream to connect this sink to some stream.
       
   343     * @param aSinkType type identifier of the sink.
       
   344     * @param aParam initialization parameters of the sink.
       
   345     * @param aEndpointId idenfier of the created sink on return.
       
   346     * @return KErrNotFound, if sink type not found
       
   347     */
       
   348     IMPORT_C TInt AddDataSink( const TUid aSinkType, const TDesC8& aParam, 
       
   349                                TUint32& aEndpointId );
       
   350 
       
   351     /**
       
   352     * Adds new source to the session. User must later
       
   353     * call CreateStream to connect this source to some stream.
       
   354     * @param aSourceType type identifier of the source.
       
   355     * @param aParam initialization parameters of the source.
       
   356     * @param aEndpointId idenfier of the created source on return.
       
   357     * @return KErrNotFound, if source type not found
       
   358     */
       
   359     IMPORT_C TInt AddDataSource( const TUid aSourceType, const TDesC8& aParam,
       
   360                                  TUint32& aEndpointId );
       
   361     
       
   362     /**
       
   363     * Checks if link already exists based on local port
       
   364     * @param aSessionId session ID
       
   365     * @param aLinkId ID of the link
       
   366     * @param aNetSettings network settings for the link
       
   367     * @return ETrue if found; otherwise EFalse.
       
   368     */
       
   369     IMPORT_C TBool LinkExists( TUint32 aSessionId,
       
   370                                TUint32& aLinkId,
       
   371                                const TMccNetSettings& aNetSettings );
       
   372 
       
   373     /**
       
   374     * Checks if link contains streams
       
   375     * @param aSessionId session ID
       
   376     * @param aLinkId ID of the link
       
   377     * @return ETrue if found; otherwise EFalse.
       
   378     */
       
   379     IMPORT_C TBool StreamsExists( TUint32 aSessionId,
       
   380                                   TUint32 aLinkId );
       
   381 
       
   382     /** 
       
   383     * Gets sink or source parameter
       
   384     * @param aSessionId session where sink or source belongs to
       
   385     * @param aLinkId link ID where sink or source belongs to
       
   386     * @param aStreamId stream ID where sink or source belongs to
       
   387     * @param aEndpointId endpoint ID identifying sink or source.
       
   388     * @param aParam a parameter to get
       
   389     * @param aVal on return will contain parameter value in TPkgBuf structure
       
   390     * @return KErrNotFound if parameter was not found, KErrNone otherwise
       
   391     */
       
   392     IMPORT_C TInt GetParameter( TUint32 aSessionId, TUint32 aLinkId, 
       
   393                                 TUint32 aStreamId, TUint32 aEndpointId,
       
   394                                 TUint32 aParam, TDes8& aVal );
       
   395 
       
   396     /** 
       
   397     * Sets sink or source parameter
       
   398     * @param aSessionId session where sink or source belongs to
       
   399     * @param aLinkId link ID where sink or source belongs to
       
   400     * @param aStreamId stream ID where sink or source belongs to
       
   401     * @param aEndpointId endpoint ID identifying sink or source.
       
   402     * @param aParam a parameter to get
       
   403     * @param aVal on return will contain parameter value in TPkgBuf structure
       
   404     * @return KErrNotFound if parameter was not found, KErrNone otherwise
       
   405     */
       
   406     IMPORT_C TInt SetParameter( TUint32 aSessionId, TUint32 aLinkId, 
       
   407                                 TUint32 aStreamId, TUint32 aEndpointId,
       
   408                                 TUint32 aParam, const TDesC8& aVal );
       
   409 
       
   410     /**
       
   411     * Updates sink of the stream.
       
   412     * @param aSessionId session where stream belongs to
       
   413     * @param aLinkId link ID
       
   414     * @param aStreamId ID identifying stream to be updated
       
   415     * @param aEndpointId ID identifying endpoint of the stream to be updated.
       
   416     * @param aParam initialization parameters of the sink.
       
   417     * @return KErrNotFound, if sink type not found
       
   418     */
       
   419     IMPORT_C TInt UpdateDataSink( TUint32 aSessionId, TUint32 aLinkId, 
       
   420                                TUint32 aStreamId, TUint32 aEndpointId,
       
   421                                const TDesC8& aParam );
       
   422 
       
   423     /**
       
   424     * Updates source of the stream. 
       
   425     * @param aSessionId session where stream belongs to
       
   426     * @param aLinkId link ID
       
   427     * @param aStreamId ID identifying stream to be updated
       
   428     * @param aEndpointId ID identifying endpoint of the stream to be updated.
       
   429     * @param aParam initialization parameters of the source.
       
   430     * @return KErrNotFound, if source type not found
       
   431     */
       
   432     IMPORT_C TInt UpdateDataSource( TUint32 aSessionId, TUint32 aLinkId, 
       
   433                                  TUint32 aStreamId, TUint32 aEndpointId,
       
   434                                  const TDesC8& aParam );
       
   435 
       
   436     /**
       
   437     * Removes sink from MCC.
       
   438     * @param aSessionId session where stream belongs to
       
   439     * @param aLinkId link ID
       
   440     * @param aStreamId ID identifying stream to be updated
       
   441     * @param aEndpointId ID identifying endpoint of the stream to be updated.
       
   442     * @return KErrNotFound, if sink type not found
       
   443     */
       
   444     IMPORT_C TInt RemoveDataSink( TUint32 aSessionId, TUint32 aLinkId, 
       
   445                                   TUint32 aStreamId, TUint32 aEndpointId );
       
   446 
       
   447     /**
       
   448     * Removes source from MCC. 
       
   449     * @param aSessionId session where stream belongs to
       
   450     * @param aLinkId link ID
       
   451     * @param aStreamId ID identifying stream to be updated
       
   452     * @param aEndpointId ID identifying endpoint of the stream to be updated.
       
   453     * @return KErrNotFound, if source type not found
       
   454     */
       
   455     IMPORT_C TInt RemoveDataSource( TUint32 aSessionId, TUint32 aLinkId, 
       
   456                                     TUint32 aStreamId, TUint32 aEndpointId );
       
   457 
       
   458     /**
       
   459     * Reuses sink or source of the stream. Reused sink or source may be
       
   460     * simultaneously shared by two or more stream. It is also possible,that only one stream 
       
   461     * can use it at a time. User must later call CreateStream to connect this sink or source
       
   462     * to some stream.
       
   463     * @param aSessionId session where stream belongs to
       
   464     * @param aLinkId link ID
       
   465     * @param aStreamId ID identifying stream to be updated
       
   466     * @param aEndpointId ID identifying endpoint of the stream to be reused.
       
   467     * @return KErrNotFound, if endpoint not found
       
   468     */
       
   469     IMPORT_C TInt Reuse( TUint32 aSessionId, TUint32 aLinkId, 
       
   470                          TUint32 aStreamId, TUint32 aEndpointId );
       
   471 
       
   472     /**
       
   473     * Get the reference count of given sink or source. 
       
   474     * @param aSessionId session where stream belongs to
       
   475     * @param aLinkId link ID
       
   476     * @param aStreamId ID identifying stream to be updated
       
   477     * @param aEndpointId ID identifying endpoint of the stream to be updated.
       
   478     * @param aCount number of references using this sink or source.
       
   479     * @return KErrNotFound, if endpoint not found
       
   480     */
       
   481     IMPORT_C TInt ReferenceCount( TUint32 aSessionId, TUint32 aLinkId, 
       
   482                                   TUint32 aStreamId, TUint32 aEndpointId,
       
   483                                   TUint& aCount );
       
   484 
       
   485     /**
       
   486     * Get the reference count of given sink or source. 
       
   487     * @param aSessionId session where stream belongs to
       
   488     * @param aBundle new bundle to be added in the session.
       
   489     * @param aBundleId identifier of the added bundle on return.
       
   490     * @return KErrNone if successful
       
   491     */
       
   492     IMPORT_C TInt AddBundle( TUint32 aSessionId, TMccStreamBundle& aBundle, TUint32& aBundleId );
       
   493 
       
   494     /**
       
   495     * Get the reference count of given sink or source. 
       
   496     * @param aSessionId session where stream belongs to
       
   497     * @param aBundleId identifier of the removed bundle.
       
   498     * @return KErrNotFound, if bundle not found
       
   499     */
       
   500     IMPORT_C TInt RemoveBundle( TUint32 aSessionId, TUint32 aBundleId );
       
   501 
       
   502     /**
       
   503     * Get the reference count of given sink or source. 
       
   504     * @param aSessionId session where stream belongs to
       
   505     * @param aBundles an array of bundles in given session.
       
   506     * @return KErrNone if successful
       
   507     */
       
   508     IMPORT_C TInt GetBundles( TUint32 aSessionId, RArray<TMccStreamBundle>& aBundles);
       
   509 
       
   510     /**
       
   511     * Transcodes media file in non-realtime. Progress of transcoding
       
   512     * can be monitored through MMccCtrlObserver::MccEventReceived.
       
   513     * @param aSourceFile source file for transcoding
       
   514     * @param aDestFile destination file for transcoding
       
   515     * @param aQuality requested quality for transcoding
       
   516     * @param aSessionId session identifier for transcoding
       
   517     * @param aVideoCodec requested video parameters for transcoding, overrides aQuality parameter.
       
   518     *         Ownership is not transferred.    
       
   519     * @param aAudioCodec requested audio parameters for transcoding, overrides aQuality parameter.
       
   520     *         Ownership is not transferred.    
       
   521     * @return ETrue if succesfull; otherwise EFalse.
       
   522     */
       
   523     IMPORT_C TInt TranscodeFile( const TDesC8& aSourceFile, const TDesC8& aDestFile,
       
   524                                  TUint32 aQuality, TUint32& aSessionId,  
       
   525                                  const CMccCodecInformation* aVideoCodec = 0,
       
   526                                  const CMccCodecInformation* aAudioCodec = 0 );
       
   527 
       
   528     /**
       
   529     * Cancels transcoding of media file.
       
   530     * @param aSessionId session identifier for transcoding
       
   531     * @return ETrue if succesfull; otherwise EFalse.
       
   532     */
       
   533     IMPORT_C TInt CancelTranscodeFile( TUint32 aSessionId );
       
   534         
       
   535     /**
       
   536      * Requests media quality reports from an endpoint. 
       
   537      * This request is synchronous. When given media quality level triggers
       
   538      * in specified endpoint the client receives media quality report via
       
   539      * asynchronous event.
       
   540      * If the given config is not valid, KErrArgument is returned.
       
   541      * The request can be cancelled with function CancelMediaQualityRequestL,
       
   542      * @since Series 60 3.2
       
   543      * @param aConfig Media quality request configuration
       
   544      * @return Error code
       
   545      */
       
   546     IMPORT_C TInt MediaQualityRequest( const TMccMediaQualityConfig& aConfig );
       
   547 
       
   548     /**
       
   549      * Cancels an outstanding media quality report.
       
   550      * If the given media quality request data contains false data, this
       
   551      * function will return KErrArgument.
       
   552      * @since Series 60 3.2
       
   553      * @param aConfig Configuration to find a outstanding media quality 
       
   554      *                request
       
   555      * @return Error code
       
   556      */
       
   557     IMPORT_C TInt CancelMediaQualityRequest( 
       
   558         const TMccMediaQualityConfig& aConfig );
       
   559      
       
   560     /**
       
   561      * Returns the reference to handle to controller plugin which interface
       
   562      * use for sending custom commands.
       
   563      * Client representation of a controller plugin for
       
   564      * the Multimedia Framework.
       
   565      * @since Series 60 3.2
       
   566      * @param aController  Controller. 
       
   567      * @return void
       
   568      */
       
   569     void GetController( RMMFController& aController );
       
   570       
       
   571 private:
       
   572 
       
   573     /**
       
   574     * C++ default constructor.
       
   575     */
       
   576     CMccInterface();
       
   577 
       
   578     /**
       
   579     * By default Symbian 2nd phase constructor is private.
       
   580     */
       
   581     void ConstructL( MMccCtrlObserver& aObserver );
       
   582 
       
   583 private:   
       
   584 
       
   585    /**
       
   586     * Open controller.
       
   587     * @param aControllerUid Controller uid to open.
       
   588     * @return One of the standard system-wide error codes.
       
   589     */
       
   590     void OpenControllerL( const TUid& aControllerUid );
       
   591     
       
   592     /**
       
   593     * Gets supported codecs from controller.
       
   594     * @return One of the standard system-wide error codes.
       
   595     */
       
   596     void CapabilitiesL();
       
   597 
       
   598     /**
       
   599     * Gets supported bit rates from the codec of the specified stream
       
   600     * @return One of the standard system-wide error codes.
       
   601     */
       
   602     TInt GetSupportedBitrates( TUint32 aSessionId,
       
   603                                TUint32 aLinkId,
       
   604                                TUint32 aStreamId,
       
   605                                RArray<TUint>& aBitrates );
       
   606                                
       
   607     /**
       
   608     */
       
   609     TInt SendRTCPReceiverReport( TUint32 aSessionId,
       
   610                                  TUint32 aLinkId,
       
   611                                  TUint32 aStreamId );
       
   612     /**
       
   613     */
       
   614     TInt SendRTCPSenderReport( TUint32 aSessionId,
       
   615                                TUint32 aLinkId,
       
   616                                TUint32 aStreamId );
       
   617 
       
   618     /**
       
   619     */
       
   620     TInt SendRTCPAnyData( TUint32 aSessionId,
       
   621                           TUint32 aLinkId,
       
   622                           TUint32 aStreamId,
       
   623                           const TDesC8& aData );
       
   624                           
       
   625     /**
       
   626     */
       
   627     TInt EnableViewFinder( const TDesC8& aParam );
       
   628     
       
   629     /**
       
   630     */
       
   631     TInt DisableViewFinder();
       
   632 	
       
   633 	/**
       
   634     */
       
   635 	TInt GetViewFinderSettings( TUint32 aParam, TUint32 aEndPointId, TDes8& aVal );
       
   636                           
       
   637     /**
       
   638     */
       
   639     TCameraInfo GetCameraInfoL(TInt aDeviceIndex );
       
   640     
       
   641     /**
       
   642     */
       
   643     TInt GetNumOfCamerasL();
       
   644     
       
   645     /**
       
   646     */
       
   647     TInt GetCameraParameter( TUint32 aParam, TInt& aVal );
       
   648 
       
   649     /**
       
   650     */
       
   651     TInt SetCameraParameter( TUint32 aParam, TInt aVal );
       
   652     
       
   653     /**
       
   654     */
       
   655     TInt GetCameraParameter( TUint32 aParam, TReal& aVal );
       
   656     
       
   657     /**
       
   658     */
       
   659     TInt SetCameraParameter(TUint32 aParam, TReal aVal);
       
   660     
       
   661     /**
       
   662     */
       
   663 	TInt SetEndpointParameter( TUint32 aParam, 
       
   664 	                           TUint32 aSessionId,
       
   665                                TUint32 aLinkId,
       
   666                                TUint32 aStreamId,
       
   667                                TUint32 aEndPointId, 
       
   668                                const TDesC8& aVal );
       
   669 	
       
   670 	/**
       
   671 	*/
       
   672 	TInt GetEndpointParameter( TUint32 aParam, 
       
   673 	                           TUint32 aSessionId,
       
   674                                TUint32 aLinkId,
       
   675                                TUint32 aStreamId,
       
   676                                TUint32 aEndPointId, 
       
   677                                TDes8& aVal );
       
   678 
       
   679     /**
       
   680     */
       
   681     TInt SetAudioRouting( TUint32 aSessionId, TUint32 aLinkId, 
       
   682                           TUint32 aStreamId, TUint32 aRoutingDestination );
       
   683 
       
   684 
       
   685     /**
       
   686     */
       
   687     TInt AudioRouting( TUint32 aSessionId, TUint32 aLinkId, 
       
   688                        TUint32 aStreamId, TUint32& aRoutingDestination );
       
   689                        
       
   690     /**
       
   691     */
       
   692     TInt Volume( TInt& aVolume ) const;
       
   693 
       
   694 
       
   695     /**
       
   696     */
       
   697     TInt MaxVolume( TUint32 aSessionId, 
       
   698                     TUint32 aLinkId, 
       
   699                     TUint32 aStreamId, 
       
   700                     TInt& aMaxVolume );
       
   701                     
       
   702     /**
       
   703     */
       
   704     TInt SetVolume( TInt aVolume );
       
   705 
       
   706     /**
       
   707     */
       
   708 	TInt Balance( TUint32 aSessionId, 
       
   709                   TUint32 aLinkId, 
       
   710                   TUint32 aStreamId, 
       
   711                   TInt& aBalance,
       
   712                   TMccDevice aStreamType ); 
       
   713 
       
   714     /**
       
   715     */
       
   716 	TInt SetBalance( TUint32 aSessionId, 
       
   717                      TUint32 aLinkId, 
       
   718                      TUint32 aStreamId, 
       
   719                      TInt aBalance,
       
   720                      TMccDevice aStreamType );
       
   721           
       
   722           
       
   723           
       
   724     /**
       
   725     */
       
   726 	TInt GetGain( TInt& aGain ) const;
       
   727 
       
   728     /**
       
   729     */
       
   730 	TInt SetGain( TInt aGain );
       
   731 
       
   732     /**
       
   733     */
       
   734 	TInt MaxGain( TUint32 aSessionId, 
       
   735 	              TUint32 aLinkId, 
       
   736 	              TUint32 aStreamId, 
       
   737 	              TInt& aMaxGain );
       
   738 	              
       
   739 	TInt StoreEndpointInfo( TUint32 aEndpointId, 
       
   740 	                        const TMMFMessageDestination& aHandleInfo );
       
   741 	
       
   742 	TMMFMessageDestination FindEndpointInfo( TUint32 aEndpointId, TInt& aError );
       
   743 	                       
       
   744 	TInt RemoveEndpointInfo( TUint32 aEndpointId ); 
       
   745                                                                     
       
   746 private:    // Data
       
   747 
       
   748     class TMccEndpointInfo
       
   749         {
       
   750         public:
       
   751         
       
   752             TUint32 iEndpointId;
       
   753             TMMFMessageDestination iHandleInfo;
       
   754         };
       
   755         
       
   756     static TBool EndpointInfoMatch( const TMccEndpointInfo& aInfo1, 
       
   757                                     const TMccEndpointInfo& aInfo2 );
       
   758 
       
   759     // Reserved for future extensions
       
   760     TAny* iReserved1;
       
   761     TInt  iReserved2;    
       
   762 
       
   763 private:    // Data
       
   764 
       
   765     // Notifies about events happened in MCC plugin
       
   766     CMccEvent* iMccEvent;
       
   767 
       
   768     // Handle to the controller plugin for sending custom commands
       
   769     RMMFController iController;
       
   770 
       
   771     // Contains unique ID of controller interface
       
   772     TMMFMessageDestinationPckg iMessageDest;
       
   773 
       
   774     // For easier access to Audio Play Device functionality
       
   775     RMMFAudioPlayDeviceCustomCommands iAudioPlayDeviceCustomCommands;
       
   776 
       
   777     // For easier access to Audio Record Device functionality
       
   778     RMMFAudioRecordDeviceCustomCommands iAudioRecordDeviceCustomCommands;
       
   779 
       
   780     // Array for codec capabilities
       
   781     RPointerArray<CMccCodecInformation> iCodecInformation;    
       
   782     
       
   783     // Array for endpoint infos
       
   784     RArray<TMccEndpointInfo> iEndpointInfos;
       
   785 
       
   786 private:
       
   787     #ifdef TEST_EUNIT
       
   788     friend class UT_CMccInterface;
       
   789     #endif
       
   790 };
       
   791 
       
   792 #endif /* MMCCINTERFACE_H */
       
   793 
       
   794 // End of File