javauis/mmapi_akn/baseline/inc.dsa/cmmavideoplayer.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2002-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:  This class is used for playing video.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMMAVIDEOPLAYER_H
       
    20 #define CMMAVIDEOPLAYER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "cmmaaudioplayer.h"
       
    24 #include "mmmaguiplayer.h"
       
    25 #include "mmmasnapshot.h"
       
    26 #include "cmmadsawindow.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CMMAEventSource;
       
    30 
       
    31 // CONSTANTS
       
    32 // Error code from MMF meaning that video is missing sound,
       
    33 // but still can be played.
       
    34 const TInt KNotCompleteVideoError = -12017;
       
    35 _LIT(KMMAVideoPlayer, "VideoPlayer");
       
    36 
       
    37 //  CLASS DECLARATION
       
    38 /**
       
    39 *   This class is used for playing video.
       
    40 *
       
    41 */
       
    42 
       
    43 NONSHARABLE_CLASS(CMMAVideoPlayer): public CMMAAudioPlayer,
       
    44         public MMMAGuiPlayer,
       
    45         public MMMASnapshot
       
    46 {
       
    47 public: // Construction
       
    48     static CMMAVideoPlayer* NewLC(
       
    49         CMMAMMFResolver* aResolver);
       
    50 
       
    51     //   Destructor
       
    52     ~CMMAVideoPlayer();
       
    53 
       
    54 protected:
       
    55     //   C++ constructor
       
    56     CMMAVideoPlayer(CMMAMMFResolver* aResolver);
       
    57 
       
    58     void ConstructL();
       
    59 
       
    60 public: // from CMMAPlayer
       
    61     IMPORT_C void SetPlayerListenerObjectL(jobject aListenerObject,
       
    62                                            JNIEnv* aJni,
       
    63                                            MMMAEventPoster* aEventPoster);
       
    64     void RealizeL();
       
    65     void PrefetchL();
       
    66 
       
    67 protected: // from CMMAudioPlayer
       
    68     IMPORT_C void ReadCompletedL(TInt aStatus, const TDesC8& aData);
       
    69     void HandleEvent(const TMMFEvent& aEvent);
       
    70     IMPORT_C const TDesC& Type();
       
    71 
       
    72 public: // From MMMAGuiPlayer
       
    73     IMPORT_C void SetDisplayL(MMMADisplay* aDisplay);
       
    74     IMPORT_C TSize SourceSize();
       
    75     IMPORT_C void NotifyWithStringEvent(CMMAPlayerEvent::TEventType aEventType,
       
    76                                         const TDesC& aStringEventData);
       
    77 
       
    78     IMPORT_C MMMASnapshot* SnapshoterL();
       
    79 
       
    80 public: // From MMMASnapshot
       
    81     IMPORT_C MMMASnapshot::TEncoding TakeSnapshotL(TRequestStatus* aStatus,
       
    82             const TSize& aSize,
       
    83             const CMMAImageSettings& aSettings);
       
    84     IMPORT_C CFbsBitmap* SnapshotBitmap();
       
    85     IMPORT_C HBufC8* SnapshotEncoded();
       
    86 
       
    87 protected: // New methods
       
    88     void CompletePrefetch(TInt aError);
       
    89     void PrepareDisplay();
       
    90     void SourceSizeChanged();
       
    91 
       
    92 protected: // Data
       
    93     CMMADSAWindow* iDSAWindow;
       
    94     RMMFVideoControllerCustomCommands iVideoControllerCustomCommands;
       
    95     RMMFVideoPlayControllerCustomCommands iVideoPlayControllerCustomCommands;
       
    96 
       
    97 private: // Data
       
    98     MMMADisplay* iDisplay;
       
    99 
       
   100     TSize iSourceSize;
       
   101 
       
   102     TFileName iFileExtension;
       
   103     CFbsBitmap* iEmptySnapshotImage;
       
   104 
       
   105     CActiveSchedulerWait* iActiveSchedulerWait;
       
   106 };
       
   107 
       
   108 #endif // CMMAVIDEOPLAYER_H