summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/mediaplayerplugininterface.h
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/mediaplayerplugininterface.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/mediaplayerplugininterface.h113
1 files changed, 113 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/mediaplayerplugininterface.h b/core/multimedia/opieplayer/mediaplayerplugininterface.h
new file mode 100644
index 0000000..24d5a80
--- a/dev/null
+++ b/core/multimedia/opieplayer/mediaplayerplugininterface.h
@@ -0,0 +1,113 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef MEDIA_PLAYER_PLUGIN_INTERFACE_H
21#define MEDIA_PLAYER_PLUGIN_INTERFACE_H
22
23#include <qpe/qcom.h>
24
25#ifndef QT_NO_COMPONENT
26// {c0093632-b44c-4cf7-a279-d82fe8a8890c}
27# ifndef IID_MediaPlayerPlugin
28# define IID_MediaPlayerPlugin QUuid( 0xc0093632, 0xb44c, 0x4cf7, 0xa2, 0x79, 0xd8, 0x2f, 0xe8, 0xa8, 0x89, 0x0c )
29# endif
30#endif
31
32
33enum ColorFormat {
34 RGB565,
35 BGR565,
36 RGBA8888,
37 BGRA8888
38};
39
40
41class MediaPlayerDecoder {
42
43public:
44 virtual ~MediaPlayerDecoder() { };
45
46 // About Plugin
47 virtual const char *pluginName() = 0;
48 virtual const char *pluginComment() = 0;
49 virtual double pluginVersion() = 0;
50
51 virtual bool isFileSupported( const QString& file ) = 0;
52 virtual bool open( const QString& file ) = 0;
53 virtual bool close() = 0;
54 virtual bool isOpen() = 0;
55 virtual const QString &fileInfo() = 0;
56
57 // If decoder doesn't support audio then return 0 here
58 virtual int audioStreams() = 0;
59 virtual int audioChannels( int stream ) = 0;
60 virtual int audioFrequency( int stream ) = 0;
61 virtual int audioSamples( int stream ) = 0;
62 virtual bool audioSetSample( long sample, int stream ) = 0;
63 virtual long audioGetSample( int stream ) = 0;
64// virtual bool audioReadMonoSamples( short *samples, long samples, long& samplesRead, int stream ) = 0;
65// virtual bool audioReadStereoSamples( short *samples, long samples, long& samplesRead, int stream ) = 0;
66 virtual bool audioReadSamples( short *samples, int channels, long samples, long& samplesRead, int stream ) = 0;
67 // Libmpeg3 functions, perhaps good for reading an audio file with 5 channels or something!
68// virtual bool audioReadSamples( short *samples, int channel, long samples, int stream ) = 0;
69// virtual bool audioReReadSamples( short *samples, int channel, long samples, int stream ) = 0;
70
71 // If decoder doesn't support video then return 0 here
72 virtual int videoStreams() = 0;
73 virtual int videoWidth( int stream ) = 0;
74 virtual int videoHeight( int stream ) = 0;
75 virtual double videoFrameRate( int stream ) = 0; // frames per second (this may change to frames/1000secs)
76 virtual int videoFrames( int stream ) = 0;
77 virtual bool videoSetFrame( long sample, int stream ) = 0;
78 virtual long videoGetFrame( int stream ) = 0;
79 virtual bool videoReadFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, ColorFormat color_model, int stream ) = 0;
80 virtual bool videoReadScaledFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, int out_w, int out_h, ColorFormat color_model, int stream ) = 0;
81 virtual bool videoReadYUVFrame( char *y_output, char *u_output, char *v_output, int in_x, int in_y, int in_w, int in_h, int stream ) = 0;
82
83 // Profiling
84 virtual double getTime() = 0;
85
86 // Ignore if these aren't supported
87 virtual bool setSMP( int cpus ) = 0;
88 virtual bool setMMX( bool useMMX ) = 0;
89
90 // Capabilities
91 virtual bool supportsAudio() = 0;
92 virtual bool supportsVideo() = 0;
93 virtual bool supportsYUV() = 0;
94 virtual bool supportsMMX() = 0;
95 virtual bool supportsSMP() = 0;
96 virtual bool supportsStereo() = 0;
97 virtual bool supportsScaling() = 0;
98
99};
100
101
102class MediaPlayerEncoder;
103
104
105struct MediaPlayerPluginInterface : public QUnknownInterface
106{
107 virtual MediaPlayerDecoder *decoder() = 0;
108 virtual MediaPlayerEncoder *encoder() = 0;
109};
110
111
112#endif
113