36
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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:
|
|
15 |
* Source file for the main class of the ConsolePlayer test app.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
33
|
19 |
#ifndef OPENMAX_PLAYER_UTILITY_H
|
|
20 |
#define OPENMAX_PLAYER_UTILITY_H
|
|
21 |
|
|
22 |
#include <string.h>
|
|
23 |
#include <e32std.h>
|
|
24 |
#include <w32std.h>
|
|
25 |
#include <mmf\common\Mmfvideo.h> // for TVideoRotation and TAutoScaleType
|
|
26 |
#include "playerwindow.h"
|
|
27 |
#include "openmaxal.h"
|
|
28 |
|
|
29 |
#define MAX_NUMBER_INTERFACES 5
|
|
30 |
|
|
31 |
class COpenMaxPlayerUtility
|
|
32 |
{
|
|
33 |
public:
|
|
34 |
COpenMaxPlayerUtility();
|
|
35 |
~COpenMaxPlayerUtility();
|
36
|
36 |
|
33
|
37 |
void VideoFrameSize(TSize& aSize) const;
|
|
38 |
TTimeIntervalMicroSeconds Position() const;
|
|
39 |
TTimeIntervalMicroSeconds Duration() const;
|
|
40 |
TInt Volume() const;
|
|
41 |
TInt MaxVolume() const;
|
|
42 |
TInt Balance()const;
|
|
43 |
TVideoRotation Rotation() const;
|
36
|
44 |
|
33
|
45 |
void SetVolume(TInt aVolume);
|
|
46 |
void SetBalance(TInt aBalance);
|
|
47 |
void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
|
|
48 |
void SetRotation(const RWindow& aWindow, TVideoRotation aRotation);
|
|
49 |
void SetScaleFactor(const RWindow& aWindow, TReal32 aWidthPercentage, TReal32 aHeightPercentage);
|
|
50 |
void SetAutoScale(const RWindow& aWindow, TAutoScaleType aScaleType);
|
|
51 |
void StepFrame(TInt aStep);
|
36
|
52 |
|
33
|
53 |
void OpenFile(const TDesC& aFileName,TUid aControllerUid = KNullUid);
|
|
54 |
void OpenUrl(const TDesC& aUrl);
|
|
55 |
void Prepare();
|
|
56 |
void Close();
|
|
57 |
void Play();
|
|
58 |
TInt Stop();
|
|
59 |
void Pause();
|
|
60 |
|
|
61 |
void AddDisplayWindow(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindow& aWindow);
|
|
62 |
void SetWindowClipRect(const RWindow& aWindow, const TRect& aWindowClipRect);
|
|
63 |
void SetVideoExtent(const RWindow& aWindow, const TRect& aVideoExtent);
|
|
64 |
|
|
65 |
bool CheckErr (XAresult res, char* aMsg = "");
|
|
66 |
|
|
67 |
void Init (void);
|
|
68 |
void DestroyPlayer ();
|
|
69 |
void DrawEQDisplay (void);
|
|
70 |
void SetBandLevel(XAint16 band, XAboolean increase);
|
|
71 |
void PlaySource(const XADataLocator_URI &source);
|
|
72 |
void PlayPause(bool);
|
|
73 |
void MuteChanged(bool);
|
|
74 |
TInt SetPlayVelocity( TInt aVelocity );
|
36
|
75 |
|
33
|
76 |
protected:
|
|
77 |
void StartBackLightTimer();
|
|
78 |
void CancelBackLightTimer();
|
36
|
79 |
|
33
|
80 |
private:
|
|
81 |
XAObjectItf m_engine; /* OpenMAX AL Engine */
|
|
82 |
XAObjectItf player;
|
|
83 |
XAObjectItf m_outputMix;
|
|
84 |
|
|
85 |
XAEngineItf m_EngineItf;
|
|
86 |
XAPlayItf m_playItf;
|
|
87 |
XAEqualizerItf m_equalizerItf;
|
|
88 |
XAVolumeItf m_volumeItf;
|
|
89 |
|
|
90 |
XAInterfaceID m_iidArray[MAX_NUMBER_INTERFACES];
|
|
91 |
XAboolean m_required[MAX_NUMBER_INTERFACES];
|
|
92 |
|
|
93 |
XADataSource m_dataSource;
|
|
94 |
XADataSink m_audioSink;
|
|
95 |
XADataSink m_videoSink;
|
|
96 |
XADataFormat_MIME m_mime;
|
|
97 |
XADataLocator_OutputMix m_locator_outputmix;
|
|
98 |
XADataLocator_NativeDisplay m_locator_displayregion;
|
|
99 |
XADataLocator_URI uri;
|
36
|
100 |
|
33
|
101 |
TRect m_displayRect;
|
|
102 |
int m_nVolume;
|
|
103 |
int m_Velocity;
|
|
104 |
XAchar m_sourceName[1000];
|
|
105 |
};
|
|
106 |
|
|
107 |
#endif // OPENMAX_PLAYER_UTILITY_H
|