Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

libflashplugin.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2001 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
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     // If decoder doesn't support audio then return 0 here
00047     int audioStreams() { return 1; }
00048     int audioChannels( int /*stream*/ ) { return 2; }
00049     int audioFrequency( int /*stream*/ ) { return 44100; }
00050     int audioSamples( int /*stream*/ ) { return 1000000; }
00051     bool audioSetSample( long sample, int stream );
00052     long audioGetSample( int stream );
00053     //bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
00054     //bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
00055     bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
00056     //bool audioReadSamples( short *output, int channel, long samples, int stream );
00057     //bool audioReReadSamples( short *output, int channel, long samples, int stream );
00058 
00059     // If decoder doesn't support video then return 0 here
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     // Profiling
00072     double getTime();
00073 
00074     // Ignore if these aren't supported
00075     bool setSMP( int cpus );
00076     bool setMMX( bool useMMX );
00077 
00078     // Capabilities
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 

Generated on Sat Nov 5 16:15:35 2005 for OPIE by  doxygen 1.4.2