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