00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef LIBFLASH_PLUGIN_H
00021 #define LIBFLASH_PLUGIN_H
00022
00023
00024 #include <qstring.h>
00025 #include <qapplication.h>
00026 #include "flash.h"
00027 #include <qpe/mediaplayerplugininterface.h>
00028
00029
00030 class LibFlashPlugin : public MediaPlayerDecoder {
00031
00032 public:
00033 LibFlashPlugin();
00034 ~LibFlashPlugin() { close(); }
00035
00036 const char *pluginName() { return "LibFlashPlugin: " PLUGIN_NAME " " FLASH_VERSION_STRING; }
00037 const char *pluginComment() { return "This is the libflash library: " PLUGIN_NAME " " FLASH_VERSION_STRING; }
00038 double pluginVersion() { return 1.0; }
00039
00040 bool isFileSupported( const QString& fileName ) { return fileName.right(4) == ".swf"; }
00041 bool open( const QString& fileName );
00042 bool close() { FlashClose( file ); file = NULL; return TRUE; }
00043 bool isOpen() { return file != NULL; }
00044 const QString &fileInfo() { return strInfo = qApp->translate( "MediaPlayer", "No Information Available", "media plugin text" ); }
00045
00046
00047 int audioStreams() { return 1; }
00048 int audioChannels( int ) { return 2; }
00049 int audioFrequency( int ) { return 44100; }
00050 int audioSamples( int ) { return 1000000; }
00051 bool audioSetSample( long sample, int stream );
00052 long audioGetSample( int stream );
00053
00054
00055 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
00056
00057
00058
00059
00060 int videoStreams();
00061 int videoWidth( int stream );
00062 int videoHeight( int stream );
00063 double videoFrameRate( int stream );
00064 int videoFrames( int stream );
00065 bool videoSetFrame( long frame, int stream );
00066 long videoGetFrame( int stream );
00067 bool videoReadFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, ColorFormat color_model, int stream );
00068 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 );
00069 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 );
00070
00071
00072 double getTime();
00073
00074
00075 bool setSMP( int cpus );
00076 bool setMMX( bool useMMX );
00077
00078
00079 bool supportsAudio() { return TRUE; }
00080 bool supportsVideo() { return TRUE; }
00081 bool supportsYUV() { return TRUE; }
00082 bool supportsMMX() { return TRUE; }
00083 bool supportsSMP() { return TRUE; }
00084 bool supportsStereo() { return TRUE; }
00085 bool supportsScaling() { return TRUE; }
00086
00087 private:
00088 FlashHandle file;
00089 FlashDisplay *fd;
00090 QString strInfo;
00091
00092 };
00093
00094
00095 #endif
00096