vtprotocolplugins/DisplaySink/inc/mdisplaysink.h
changeset 0 ed9695c8bcbe
equal deleted inserted replaced
-1:000000000000 0:ed9695c8bcbe
       
     1 /*
       
     2 * Copyright (c) 2004 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:  DisplaySink subsystem.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MDISPLAYSINK_H
       
    20 #define MDISPLAYSINK_H
       
    21 
       
    22 //  INCLUDE FILES
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 
       
    28 class MVTVideoSink;
       
    29 
       
    30 /**
       
    31 *  MDisplaySinkObserver
       
    32 *
       
    33 *  Sink observer API. Currently only frame size changes are reported using
       
    34 *  this IF.
       
    35 *
       
    36 *  @lib DisplaySink.lib
       
    37 */
       
    38 class MDisplaySinkObserver
       
    39     {
       
    40 public:
       
    41     /**
       
    42     * When incoming video frame size changes, this callback will be called.
       
    43     * @param "aFrom" Current frame size.
       
    44     * @param "aTo" New frame size.
       
    45     * @return KErrNone if successful, one of the system wide error codes
       
    46     * @exception May leave with one of the system wide error codes.
       
    47     * otherwise.
       
    48     */
       
    49     virtual void VideoFrameSizeChangedL(
       
    50         const TSize& aFrom,
       
    51         const TSize& aTo ) = 0;
       
    52     };
       
    53 
       
    54 /**
       
    55 *  Input parameters for Display Sink
       
    56 *
       
    57 *  @lib DisplaySink.lib
       
    58 */
       
    59 class TDisplaySinkParams
       
    60     {
       
    61 public:
       
    62 
       
    63     /**
       
    64     * Enumeration for limiting frame rate.
       
    65     */
       
    66     enum TFrameRateLimit
       
    67         {
       
    68         /** Don't limit frame rate (default) */
       
    69         EFrameRateLimitNone = 0,
       
    70         /** Limit frame rate to 1.0 frames per second */
       
    71         EFrameRateLimit1_0 = 1000,
       
    72         /** Limit frame rate to 2.5 frames per second */
       
    73         EFrameRateLimit2_5 = 400,
       
    74         /** Limit frame rate to 5.0 frames per second */
       
    75         EFrameRateLimit5_0 = 200,
       
    76         /** Limit frame rate to 7.5 frames per second */
       
    77         EFrameRateLimit7_5 = 133,
       
    78         /** Limit frame rate to 10.0 frames per second */
       
    79         EFrameRateLimit10_0 = 100,
       
    80         /** Limit frame rate to 12.5 frames per second */
       
    81         EFrameRateLimit12_5 = 80,
       
    82         /** Limit frame rate to 15.0 frames per second */
       
    83         EFrameRateLimit15_0 = 67,
       
    84         };
       
    85 
       
    86 	/**
       
    87 	* Flags for selecting correct type sink.
       
    88 	*/
       
    89 	enum TFlags
       
    90 		{
       
    91 		/** Create instance of DSA version of sink */
       
    92 		EDisplaySinkDSA = ( 1 << 0 ),
       
    93 		/** Create instance of DP version of sink */
       
    94 		EDisplaySinkDP = ( 1 << 1 ),
       
    95 		/** Create instance of NGA version of sink */
       
    96 		EDisplaySinkNGA = ( 1 << 2 )
       
    97 		};
       
    98 
       
    99 public:        // Data
       
   100 
       
   101     /**
       
   102     * C++ constructor for initializing some of the variables.
       
   103     */
       
   104     IMPORT_C TDisplaySinkParams();
       
   105 
       
   106     // Thread id that gets notified by sink
       
   107     TThreadId iThreadId;
       
   108 
       
   109     // Pointer to iStatus member of the Active Object to notify after video
       
   110     // frame is converted
       
   111     TRequestStatus* iRequestStatusPtr;
       
   112 
       
   113     // Pointer to Display Sink observer interface
       
   114     MDisplaySinkObserver* iObserver;
       
   115 
       
   116     // Frame rate limitation
       
   117     TFrameRateLimit iFrameRateLimit;
       
   118 
       
   119     // Sink flags
       
   120     TUint32 iFlags;
       
   121     };
       
   122 
       
   123 /**
       
   124 *  MDisplaySink
       
   125 *
       
   126 *  @lib DisplaySink.lib
       
   127 */
       
   128 class MDisplaySink
       
   129     {
       
   130 public: // data
       
   131 
       
   132     // Enumeration for the bitmaps.
       
   133     enum TBitmapNo
       
   134         {
       
   135         EFirstBitmap = 0,
       
   136         ESecondBitmap
       
   137         };
       
   138 
       
   139 public: // new methods
       
   140 
       
   141     /**
       
   142     * Deletes instance and frees all memory.
       
   143     */
       
   144     virtual void Destroy() = 0;
       
   145 
       
   146     /**
       
   147     * Mark the bitmap available for use.
       
   148     * @param "aBitmapNo" One of the enumerated TBitmapNo values.
       
   149     */
       
   150     virtual void SetBitmapAvailable( TBitmapNo aBitmapNo ) = 0;
       
   151 
       
   152     /**
       
   153     * Cancels sink so that it does not convert bitmaps even it receives data.
       
   154     */
       
   155     virtual void Release() = 0;
       
   156 
       
   157     /**
       
   158     * Updates display sink parameters, e.g. when display mode changes.
       
   159     * @param "aParams" Structure that contains new bitmap handles.
       
   160     * @param "aUpdated" Reference to boolean variable that will be set to
       
   161     * ETrue when display sink parameter update has been completed.
       
   162     * @exception May leave with one of the system wide error codes (e.g. in
       
   163     * out of memory situaton).
       
   164     */
       
   165     virtual void UpdateSinkParamsL( const TDisplaySinkParams& aParams,
       
   166         TBool& aUpdated ) = 0;
       
   167 
       
   168     /**
       
   169     * Pauses sending of remote video to VT engine.
       
   170     */
       
   171     virtual void Pause() = 0;
       
   172 
       
   173     /**
       
   174     * Resumes sending of remote video to VT engine.
       
   175     */
       
   176     virtual void Resume() = 0;
       
   177 
       
   178     /**
       
   179     * Operator returns this instance .
       
   180     */
       
   181     virtual operator MVTVideoSink&() = 0;
       
   182 
       
   183     /**
       
   184     * This method is called by the VT engine when engine has finished handling
       
   185     * of previous frame and is ready to handle a new one.
       
   186     */
       
   187     virtual void NextFrame() = 0;
       
   188 
       
   189     };
       
   190 
       
   191 /**
       
   192 * Creates instance of displaysink.
       
   193 */
       
   194 IMPORT_C MDisplaySink* CreateSinkL( TDisplaySinkParams& aParams,
       
   195     const TDesC8& aInitData );
       
   196 
       
   197 #endif // MDISPLAYSINK_H
       
   198 
       
   199 // End of file