⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mediaplayerdecoder.html

📁 qtopiaphone英文帮助,用于初学者和开发人员,初学者可以用来学习,开发人员可以用来资料查询.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/edba/dist/qtopia/main-Sunday/qtopia/src/libraries/qtopia/mediaplayerplugininterface.cpp:22 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>MediaPlayerDecoder Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td width="200" align="left" valign="top"><a href="index.html"><img height="27" width="472" src="dochead.png" border="0"></a><br><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" align="center" size=32>Qtopia</font>   <a href="index.html">Home</a> - <a href="qtopiaclasses.html">Classes</a> - <a href="qtopiaannotated.html">Annotated</a> - <a href="qtopiafunctions.html">Functions</a> - <a href="qtindex.html">Qt Embedded</a></td><td align="right" valign="top">  <table border="0" cellpadding="0" cellspacing="0" width="137">  <tr>  <td><a href="http://www.trolltech.com/company/about/trolls.html"><img height="100" width="100" src="face.png" border="0"></a></td>  <td><img height="100" width="100" src="qtlogo.png" align="top" border="0"></td>  </tr>  </table></td></tr></table><h1 align=center>MediaPlayerDecoder Class Reference</h1><p>The MediaPlayerDecoder class provides an abstract base class forQtopia MediaPlayer decoder plugins.<a href="#details">More...</a><p><tt>#include &lt;<a href="mediaplayerplugininterface-h.html">mediaplayerplugininterface.h</a>&gt;</tt><p>Inherited by <a href="mediaplayerdecoder_1_6.html">MediaPlayerDecoder_1_6</a>, <a href="libflashplugin.html">LibFlashPlugin</a> and <a href="libmadplugin.html">LibMadPlugin</a>.<p><a href="mediaplayerdecoder-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn>virtual <a href="#~MediaPlayerDecoder"><b>~MediaPlayerDecoder</b></a> ()</div></li><li><div class=fn>virtual const char * <a href="#pluginName"><b>pluginName</b></a> () = 0</div></li><li><div class=fn>virtual const char * <a href="#pluginComment"><b>pluginComment</b></a> () = 0</div></li><li><div class=fn>virtual double <a href="#pluginVersion"><b>pluginVersion</b></a> () = 0</div></li><li><div class=fn>virtual bool <a href="#isFileSupported"><b>isFileSupported</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;file ) = 0</div></li><li><div class=fn>virtual bool <a href="#open"><b>open</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;file ) = 0</div></li><li><div class=fn>virtual bool <a href="#close"><b>close</b></a> () = 0</div></li><li><div class=fn>virtual bool <a href="#isOpen"><b>isOpen</b></a> () = 0</div></li><li><div class=fn>virtual const QString &amp; <a href="#fileInfo"><b>fileInfo</b></a> () = 0</div></li><li><div class=fn>virtual int <a href="#audioStreams"><b>audioStreams</b></a> () = 0</div></li><li><div class=fn>virtual int <a href="#audioChannels"><b>audioChannels</b></a> ( int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual int <a href="#audioFrequency"><b>audioFrequency</b></a> ( int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual int <a href="#audioSamples"><b>audioSamples</b></a> ( int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual bool <a href="#audioSetSample"><b>audioSetSample</b></a> ( long&nbsp;sample, int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual long <a href="#audioGetSample"><b>audioGetSample</b></a> ( int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual bool <a href="#audioReadSamples"><b>audioReadSamples</b></a> ( short&nbsp;*&nbsp;samples, int&nbsp;channels, long&nbsp;sampleCount, long&nbsp;&amp;&nbsp;samplesRead, int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual int <a href="#videoStreams"><b>videoStreams</b></a> () = 0</div></li><li><div class=fn>virtual int <a href="#videoWidth"><b>videoWidth</b></a> ( int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual int <a href="#videoHeight"><b>videoHeight</b></a> ( int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual double <a href="#videoFrameRate"><b>videoFrameRate</b></a> ( int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual int <a href="#videoFrames"><b>videoFrames</b></a> ( int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual bool <a href="#videoSetFrame"><b>videoSetFrame</b></a> ( long&nbsp;frame, int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual long <a href="#videoGetFrame"><b>videoGetFrame</b></a> ( int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual bool <a href="#videoReadFrame"><b>videoReadFrame</b></a> ( unsigned char **, int, int, int, int, ColorFormat, int ) = 0</div></li><li><div class=fn>virtual bool <a href="#videoReadScaledFrame"><b>videoReadScaledFrame</b></a> ( unsigned&nbsp;char&nbsp;**&nbsp;output_rows, int&nbsp;in_x, int&nbsp;in_y, int&nbsp;in_w, int&nbsp;in_h, int&nbsp;out_w, int&nbsp;out_h, ColorFormat&nbsp;color_model, int&nbsp;stream ) = 0</div></li><li><div class=fn>virtual bool <a href="#videoReadYUVFrame"><b>videoReadYUVFrame</b></a> ( char *, char *, char *, int, int, int, int, int ) = 0</div></li><li><div class=fn>virtual double <a href="#getTime"><b>getTime</b></a> () = 0</div></li><li><div class=fn>virtual bool <a href="#setSMP"><b>setSMP</b></a> ( int&nbsp;CPUs ) = 0</div></li><li><div class=fn>virtual bool <a href="#setMMX"><b>setMMX</b></a> ( bool&nbsp;useMMX ) = 0</div></li><li><div class=fn>virtual bool <a href="#supportsAudio"><b>supportsAudio</b></a> () = 0</div></li><li><div class=fn>virtual bool <a href="#supportsVideo"><b>supportsVideo</b></a> () = 0</div></li><li><div class=fn>virtual bool <a href="#supportsYUV"><b>supportsYUV</b></a> () = 0</div></li><li><div class=fn>virtual bool <a href="#supportsMMX"><b>supportsMMX</b></a> () = 0</div></li><li><div class=fn>virtual bool <a href="#supportsSMP"><b>supportsSMP</b></a> () = 0</div></li><li><div class=fn>virtual bool <a href="#supportsStereo"><b>supportsStereo</b></a> () = 0</div></li><li><div class=fn>virtual bool <a href="#supportsScaling"><b>supportsScaling</b></a> () = 0</div></li><li><div class=fn>virtual long <a href="#getPlayTime"><b>getPlayTime</b></a> ()</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2><p> The MediaPlayerDecoder class provides an abstract base class forQtopia MediaPlayer decoder plugins.<p> Writing a decoder plugin is achieved by subclassing this base class,reimplementing the pure virtual functions and exporting the class withthe <tt>Q_EXPORT_PLUGIN</tt> macro. See the <a href="pluginintro.html">Plugins    documentation</a> for details.<p> <p>See also <a href="qtopiaemb.html">Qtopia Classes</a>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="~MediaPlayerDecoder"></a>MediaPlayerDecoder::~MediaPlayerDecoder ()<tt> [virtual]</tt></h3><p> This function is called when a decoder plugin object is deleted.It closes any open streams, and releases any memory which has beenallocated for decoding.<h3 class=fn>int <a name="audioChannels"></a>MediaPlayerDecoder::audioChannels ( int&nbsp;stream )<tt> [pure virtual]</tt></h3><p> Returns the number of audio channels for the given <em>stream</em>. A monofile will return 1, stereo returns 2, and so on.<p> (The Qtopia MediaPlayer currently only supports decoding up to the first2 channels of audio, however it is quite possible for a <em>stream</em> to haveup to 6 channels, and for those to be decoded when audioReadSamples iscalled with 6 channels requested.)<h3 class=fn>int <a name="audioFrequency"></a>MediaPlayerDecoder::audioFrequency ( int&nbsp;stream )<tt> [pure virtual]</tt></h3><p> Returns the frequency of the audio <em>stream</em>. A typical value is 44100which represents that there are 44100 audio samples per second per channel(for example, if it is 16-bit stereo, then there will be a total of 44100*2*2bytes available per second).<h3 class=fn>long <a name="audioGetSample"></a>MediaPlayerDecoder::audioGetSample ( int&nbsp;stream )<tt> [pure virtual]</tt></h3><p> This function retrieves the decoders sample postion in the given <em>stream</em>. Thesample position can change due to <a href="#audioReadSamples">audioReadSamples</a>() being called or if supported,from <a href="#audioSetSample">audioSetSample</a>() being called.<h3 class=fn>bool <a name="audioReadSamples"></a>MediaPlayerDecoder::audioReadSamples ( short&nbsp;*&nbsp;samples, int&nbsp;channels, long&nbsp;sampleCount, long&nbsp;&amp;&nbsp;samplesRead, int&nbsp;stream )<tt> [pure virtual]</tt></h3><p> This function reads <em>sampleCount</em> number of samples in to the <em>samples</em> buffer from the given <em>stream</em>.<p> The <em>samples</em> buffer is filled with 16 bit wide values, therefore if the samples are only8 bit, they are expanded to shorts before being stored by the decoder. The <em>channels</em> valuespecifies how many channels to decoded.<p> The samples for multiple channels are placed together, for example in the following order:<p> sample1channel1, sample1channel2, sample2channel1, sample2channel2 etc.<p> On success, TRUE is returned, otherwise FALSE is returned which indicatesthe end of the file has been reached. The value in <em>samplesRead</em> on return contains the numberof samples actually read.<p> In the case of streamed media, when no input is currently available, a return value of TRUEis returned, however <em>samplesRead</em> is set to 0 after a suitable timeout has elapsed andno samples have been able to be read.<h3 class=fn>int <a name="audioSamples"></a>MediaPlayerDecoder::audioSamples ( int&nbsp;stream )<tt> [pure virtual]</tt></h3><p> Returns the total number of audio samples in the given <em>stream</em>.<p> As an example, if there is 10 seconds of music at 44100Hz with stereosamples, this function would return 441000 samples (each sample in astereo pair is only counted once).<p> If the media file is being streamed, it may not always be possible todetermine the length of the streamed data (for example a radio webcastwhich continuously streams audio data), in which case the return valueis -1 which indicates that the <em>stream</em> is not seekable. In such casesattempts to call <a href="#audioSetSample">audioSetSample</a>() will most likely fail.<h3 class=fn>bool <a name="audioSetSample"></a>MediaPlayerDecoder::audioSetSample ( long&nbsp;sample, int&nbsp;stream )<tt> [pure virtual]</tt></h3><p> This function causes the decoder to seek to the given <em>sample</em> postion in themedia file.<p> If the open <em>stream</em> is not a file, but is instead for example a URL, thenit may not be possible to seek to the given <em>sample</em> and FALSE will be returned, otherwisethe next time either <a href="#audioReadSamples">audioReadSamples</a>() or <a href="#videoReadFrame">videoReadFrame</a>() is called, decoding willcontinue from the set position in the file.<p> Note this function repositions both the audio and video if there are also video streamsto the appropriate positions.<p> <p>See also <a href="#videoSetFrame">videoSetFrame</a>().<h3 class=fn>int <a name="audioStreams"></a>MediaPlayerDecoder::audioStreams ()<tt> [pure virtual]</tt></h3><p> If the opened file contains audio streams, the number of audio streamsare returned here, otherwise zero is returned. The Qtopia MediaPlayer currentlyonly supports opening the first stream (stream 0) from a decoder if there ismore than one stream.<p> The return value is normally 1 or 0.<h3 class=fn>bool <a name="close"></a>MediaPlayerDecoder::close ()<tt> [pure virtual]</tt></h3><p> This function closes all open streams. If there is a failure or no streamsare open, this function returns FALSE;<h3 class=fn>const QString &amp; <a name="fileInfo"></a>MediaPlayerDecoder::fileInfo ()<tt> [pure virtual]</tt></h3><p> This function returns an internationalized QString which describesinformation fields which are comma seperated and paired with colonsabout the currently open stream.<p> An example would be:<pre>        "Format: MPEG1 Layer3, Year: 1998"    </pre> <p> The internationalization is achieved inside the plugin using theqApp->translate() function around the translatable strings.<p> For the above example, the code to generate the string might be written like this:<pre>        qApp-&gt;translate( "PluginName", "Format: MPEG1 Layer3" ) + ", " +            qApp-&gt;translate( "PluginName", "Year: " + "1998";    </pre> <p> Please refer to the Qt Internationalization documentation for more detailedinformation on creating code which makes good translations possible.<p> The translation files are loaded by the Qtopia MediaPlayer for the decoderplugin by searching the language directories for files matching$QPEDIR/i18n/[LANG]/[PLUGIN].qm for the supported languages.<h3 class=fn>long <a name="getPlayTime"></a>MediaPlayerDecoder::getPlayTime ()<tt> [virtual]</tt></h3><p> This function is deprecated.<p> The most accurate way to get the elapsed play time for files which containaudio is to use the <a href="#audioGetSample">audioGetSample</a>() function and derive the elapsed timefrom the sample rate, or for files without audio is to use <a href="#videoGetFrame">videoGetFrame</a>() and

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -