ipappsrv_plat/transcoder_api/inc/mmcctranscoder.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2007 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:    Plugin interface to be implemented in order to get transcoding
       
    15 *                functionality
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef MCCTRANSCODER_H
       
    23 #define MCCTRANSCODER_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <e32base.h>
       
    27 #include <e32std.h>
       
    28 #include <mmccevents.h>
       
    29 
       
    30 // CLASS DECLARATION
       
    31 class CMccTranscoderImpl;
       
    32 
       
    33 // CONSTS
       
    34 
       
    35 // Plugin Interface UID
       
    36 #define KMmfUidPluginInterfaceMccTranscoder  0x10282898
       
    37 
       
    38 /**
       
    39 * Class for setting up codec values for transcoding.
       
    40 */  
       
    41 class TMccTranscoderCodecInfo
       
    42 	{
       
    43     public:
       
    44 		TUint32 iBitrate;
       
    45 		TReal iFramerate;
       
    46 		TUint32 iVideoWidth; 
       
    47 		TUint32 iVideoHeight;
       
    48 		TUint32 iSamplingFreq; 
       
    49 		TBuf8<256> iMimeType;
       
    50 		TUid iFourCC; 
       
    51 		TUint32 iReserved1; 
       
    52 		TUint32 iReserved2; 
       
    53 	};
       
    54 
       
    55 /**
       
    56 * Class for setting up transcoding.
       
    57 */  
       
    58 class TMccTranscodeFileMsg
       
    59     {
       
    60     public:
       
    61     
       
    62         TFileName  iSourceFile;
       
    63         
       
    64         TFileName  iDesFile;
       
    65         
       
    66         TUint32    iQuality;
       
    67         
       
    68         TMccTranscoderCodecInfo iVideoCodec;
       
    69         
       
    70         TMccTranscoderCodecInfo iAudioCodec;
       
    71     };
       
    72     
       
    73 typedef TPckgBuf<TMccTranscodeFileMsg> TMccTranscodeFileMsgBuffer; 
       
    74 
       
    75 
       
    76 /**
       
    77 *  Observer interface for clients to receive events from transcoder.
       
    78 */
       
    79 class MMccTranscoderObserver
       
    80     {
       
    81 	public:
       
    82     
       
    83     /**
       
    84     * Callback function to receive transcoder events
       
    85     * @param aEvent Received transcoder events
       
    86     */
       
    87     virtual void MccTranscoderEventReceived( TMccEvent& aEvent ) = 0;
       
    88     };
       
    89     
       
    90 /**
       
    91 *  MCC subsystem transcoder interface. Class is used for transcoding audio and video
       
    92 *  files from one codec to another. Transcoding can be also done with old codec in order
       
    93 *  to change bitrate.
       
    94 */
       
    95 class CMccTranscoder : public CBase
       
    96     {
       
    97     public:  // Constructors and destructor
       
    98         /**
       
    99         * Two-phased constructor.
       
   100         */
       
   101         static CMccTranscoder* NewL();
       
   102 
       
   103         /**
       
   104         * Destructor.
       
   105         */
       
   106         virtual ~CMccTranscoder();
       
   107 
       
   108     public:  // New functions
       
   109 
       
   110        /**
       
   111         * Registers observer for transcoding events.
       
   112         * @param aObserver observer for transcoding events.
       
   113         */
       
   114         virtual void RegisterEventObserver( MMccTranscoderObserver& aObserver );
       
   115         
       
   116        /**
       
   117         * Unregisters observer for transcoding events.
       
   118         */
       
   119         virtual void UnregisterEventObserver();
       
   120        
       
   121        /**
       
   122         * Starts transcoding of media file.
       
   123         * @param aSessionId session identifier for transcoding, updated on return
       
   124         * @param aVal TMccTranscodeFileMsgBuffer containing transcode parameters
       
   125         */
       
   126         virtual void TranscodeFileL( TUint32& aSessionId, const TDesC8& aVal );
       
   127         
       
   128        /**
       
   129         * Cancels transcoding of media file.
       
   130         * @param aSessionId session identifier for transcoding
       
   131         */
       
   132         virtual void CancelTranscodeFileL( TUint32 aSessionId );
       
   133     
       
   134     private:
       
   135         /**
       
   136         * C++ default constructor.
       
   137         */
       
   138         CMccTranscoder();
       
   139 
       
   140         /**
       
   141         * By default Symbian 2nd phase constructor is private.
       
   142         *
       
   143         * @param aSource    Source of the data for the payload format plugin
       
   144         */
       
   145         void ConstructL();
       
   146 
       
   147     private:    // data
       
   148         CMccTranscoderImpl* iTranscoderImpl;
       
   149         
       
   150     };
       
   151 
       
   152 #endif