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

📄 jmfarchitecture.html

📁 奉献给多媒体java编程者们。JMF2.1.1最新版本的用户指南。JMF是java用于基于实时多媒体的开发工具
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</p>


<p>
  <a name="105098"> </a><font face="Palatino, Times New Roman, Times, serif">Any JMF object that wants to provide access to its corresponding <code>Control</code> objects can implement the <code>Controls</code> interface. <code>Controls</code> defines methods for retrieving associated <code>Control</code> objects. <code>DataSource</code> and <code>PlugIn</code> use the <code>Controls</code> interface to provide access to their <code>Control </code>objects. </font>
</p>


<h5>
  <a name="105320"> </a><i><font color="#003366" face="Palatino, Times New Roman, Times, serif">Standard Controls</font></i>
</h5>


<p>
  <a name="113585"> </a><font face="Palatino, Times New Roman, Times, serif">JMF defines the standard <code>Control</code> interfaces shown in <a href="JMFArchitecture.html#113686">Figure 2-8:, "JMF controls.</a>"</font>
</p>


<p>
  <a name="113693"> </a><font face="Palatino, Times New Roman, Times, serif"><code>CachingControl</code> enables download progress to be monitored and displayed. If a <code>Player</code> or <code>Processor</code> can report its download progress, it implements this interface so that a progress bar can be displayed to the user. </font>
</p>


<p>
  <a name="113694"> </a><font face="Palatino, Times New Roman, Times, serif"><code>GainControl</code> enables audio volume adjustments such as setting the level and muting the output of a <code>Player</code> or <code>Processor</code>. It also supports a listener mechanism for volume changes.</font>
</p>


<a name="113725"> </a><font  size="1" face="Palatino, Times New Roman, Times, serif"><img src="images/JMFArchitecture6.gif" height="148" width="485">
<br></font>


<a name="113726"> </a><font  size="2" face="Palatino, Times New Roman, Times, serif">Figure 2-7:   Gain control.<br></font>


<a name="113685"> </a><font  size="1" face="Palatino, Times New Roman, Times, serif"><img src="images/JMFArchitecture3a.gif" height="483" width="478">
<br></font>


<a name="113686"> </a><font  size="2" face="Palatino, Times New Roman, Times, serif">Figure 2-8:   JMF controls.<br></font>


<p>
  <a name="113406"> </a><font face="Palatino, Times New Roman, Times, serif"><code>DataSink or Multiplexer </code>objects that read media from a <code>DataSource</code> and write it out to a destination such as a file can implement the<code> StreamWriterControl</code> interface. This <code>Control</code> enables the user to limit the size of the stream that is created. </font>
</p>


<p>
  <a name="112707"> </a><font face="Palatino, Times New Roman, Times, serif"><code>FramePositioningControl</code> and <code>FrameGrabbingControl</code> export frame-based capabilities for <code>Players</code> and <code>Processors</code>. <code>FramePositioningControl</code> enables precise frame positioning within a <code>Player or Processor </code>object's media stream. <code>FrameGrabbingControl </code>provides a mechanism for grabbing a still video frame from the video stream. The <code>FrameGrabbingControl</code> can also be supported at the <code>Renderer</code> level.</font>
</p>


<p>
  <a name="112294"> </a><font face="Palatino, Times New Roman, Times, serif">Objects that have a <code>Form</code>at can implement the <code>FormatControl</code> interface to  provide access to the <code>Format</code>. <code>FormatControl</code> also  provides methods for querying and setting the format. </font>
</p>


<p>
  <a name="112304"> </a><font face="Palatino, Times New Roman, Times, serif"><code>A TrackControl</code> is a type of <code>FormatControl</code> that provides the mechanism for controlling what processing a <code>Processor</code> object performs on a particular track of media data. With the <code>TrackControl</code> methods, you can specify what format conversions are performed on individual tracks and select the <code>Effect</code>, <code>Codec</code>, or <code>Renderer</code> plug-ins that are used by the <code>Processor</code>. (For more information about processing media data, see <a href="JMFProcessing.html#97009">Processing Time-Based Media with JMF</a>.)</font>
</p>


<p>
  <a name="112314"> </a><font face="Palatino, Times New Roman, Times, serif">Two controls, <code>PortControl </code>and<code> MonitorControl</code> enable user control over the capture process. <code>PortControl</code> defines methods for controlling the output of a capture device. <code>MonitorControl</code> enables media data to be previewed as it is captured or encoded.</font>
</p>


<p>
  <a name="112315"> </a><font face="Palatino, Times New Roman, Times, serif"><code>BufferControl</code> enables user-level control over the buffering done by a particular object. </font>
</p>


<p>
  <a name="107733"> </a><font face="Palatino, Times New Roman, Times, serif">JMF also defines several codec controls to enable control over hardware or software encoders and decoders:</font>
</p>

<ul>
  <li><a name="107854"> </a><font face="Palatino, Times New Roman, Times, serif"><code>BitRateControl</code>--used to export the bit rate information for an incoming stream or to control the encoding bit rate. Enables specification of the bit rate in bits per second. </font>
  <li><a name="107990"> </a><font face="Palatino, Times New Roman, Times, serif"><code>FrameProcessingControl</code>--enables the specification of frame processing parameters that allow the codec to perform minimal processing when it is falling behind on processing the incoming data.</font>
  <li><a name="108096"> </a><font face="Palatino, Times New Roman, Times, serif"><code>FrameRateControl</code>--enables modification of the frame rate.</font>
  <li><a name="107993"> </a><font face="Palatino, Times New Roman, Times, serif"><code>H261Control</code>--enables control over the H.261 video codec still-image transmission mode.</font>
  <li><a name="108024"> </a><font face="Palatino, Times New Roman, Times, serif"><code>H263Control</code>--enables control over the H.263 video-codec parameters, including support for the unrestricted vector, arithmetic coding, advanced prediction, PB Frames, and error compensation extensions.</font>
  <li><a name="110571"> </a><font face="Palatino, Times New Roman, Times, serif"><code>KeyFrameControl</code>--enables the specification of the desired interval between key frames. (The encoder can override the specified key-frame interval if necessary.)</font>
  <li><a name="110572"> </a><font face="Palatino, Times New Roman, Times, serif"><code>MpegAudioControl</code>--exports an MPEG audio codec's capabilities and enables the specification of selected MPEG encoding parameters.</font>
  <li><a name="108033"> </a><font face="Palatino, Times New Roman, Times, serif"><code>QualityControl</code>--enables specification of a preference in the trade-off between quality and CPU usage in the processing performed by a codec. This quality hint can have different effects depending on the type of compression. A higher quality setting will result in better quality of the resulting bits, for example better image quality for video.</font>
  <li><a name="107738"> </a><font face="Palatino, Times New Roman, Times, serif"><code>SilenceSuppressionControl</code>--enables specification of silence suppression parameters for audio codecs. When silence suppression mode is on, an audio encoder does not output any data if it detects silence at its input.</font>
</ul>

<h4>
  <a name="105719"> </a><font color="#003366" face="Palatino, Times New Roman, Times, serif">User Interface Components</font>
</h4>


<p>
  <a name="105730"> </a><font face="Palatino, Times New Roman, Times, serif">A <code>Control</code> can provide access to a user interface <code>Component</code> that exposes its control behavior to the end user. To get the default user interface component for a particular <code>Control</code>, you call <code>getControlComponent</code>. This method returns an AWT <code>Component</code> that you can add to your applet's presentation space or application window. </font>
</p>


<p>
  <a name="105720"> </a><font face="Palatino, Times New Roman, Times, serif">A <code>Controller</code> might also provide access to user interface <code>Components</code>. For example, a <code>Player</code> provides access to both a visual component and a control panel component--to retrieve these components, you call the <code>Player</code> methods <code>getVisualComponent</code> and <code>getControlPanelComponent</code>.</font>
</p>


<p>
  <a name="105741"> </a><font face="Palatino, Times New Roman, Times, serif">If you don't want to use the default control components provided by a particular implementation, you can implement your own and use the event listener mechanism to determine when they need to be updated. For example, you might implement your own GUI components that support user interaction with a <code>Player</code>. Actions on your GUI components would trigger calls to the appropriate <code>Player</code> methods, such as <code>start</code> and <code>stop</code>. By registering your custom GUI components as <code>ControllerListeners </code>for the<code> Player</code>, you can also update your GUI in response to changes in the <code>Player </code>object's state<code>.</code></font>
</p>


<h4>
  <a name="105721"> </a><font color="#003366" face="Palatino, Times New Roman, Times, serif">Extensibility</font>
</h4>


<p>
  <a name="101028"> </a><font face="Palatino, Times New Roman, Times, serif">Advanced developers and technology providers can extend JMF functionality in two ways:</font>
</p>

<ul>
  <li><a name="101574"> </a><font face="Palatino, Times New Roman, Times, serif">By implementing custom processing components (<em>plug-ins</em>) that can be interchanged with the standard processing components used by a JMF <code>Processor</code></font>
  <li><a name="101033"> </a><font face="Palatino, Times New Roman, Times, serif">By directly implementing the <code>Controller</code>, <code>Player</code>, <code>Processor</code>, <code>DataSource</code>, or <code>DataSink</code> interfaces</font>
</ul>

<p>
  <a name="101585"> </a><font face="Palatino, Times New Roman, Times, serif">Implementing a JMF plug-in enables you to customize or extend the capabilities of a <code>Processor</code> without having to implement one from scratch. Once a plug-in is registered with JMF, it can be selected as a processing option for any <code>Processor</code> that supports the plug-in API. JMF plug-ins can be used to: </font>
</p>

<ul>
  <li><a name="101586"> </a><font face="Palatino, Times New Roman, Times, serif">Extend or replace a <code>Processor</code> object's processing capability piecewise by selecting the individual plug-ins to be used.</font>
  <li><a name="101587"> </a><font face="Palatino, Times New Roman, Times, serif">Access the media data at specific points in the data flow. For example, different <code>Effect</code> plug-ins can be used for pre- and post-processing of the media data associated with a <code>Processor</code>.</font>
  <li><a name="101588"> </a><font face="Palatino, Times New Roman, Times, serif">Process media data outside of a <code>Player</code> or <code>Processor</code>. For example, you might use a <code>Demultiplexer</code> plug-in to get individual audio tracks from a multiplexed media-stream so you could play the tracks through Java Sound.</font>
</ul>

<p>
  <a name="103142"> </a><font face="Palatino, Times New Roman, Times, serif">In situations where an even greater degree of flexibility and control is required, custom implementations of the JMF <code>Controller</code>, <code>Player</code>, <code>Processor</code>, <code>DataSource</code>, or <code>DataSink</code> interfaces can be developed and used seamlessly with existing implementations. For example, if you have a hardware MPEG decoder, you might want to implement a <code>Player</code> that takes input from a <code>DataSource</code> and uses the decoder to perform the parsing, decoding, and rendering all in one step. Custom <code>Players</code> and <code>Processors</code> can also be implemented to integrate media engines such as Microsoft's Media Player, Real Network's RealPlayer, and IBM's HotMedia with JMF.</font>
</p>


<p>
  <a name="103452"> </a><font face="Palatino, Times New Roman, Times, serif">Note:  <strong>JMF Players and Processors are not required to support plug-ins. </strong>Plug-ins won't work with JMF 1.0-based <code>Players</code> and some <code>Processor</code> implementations might choose not to support them. The reference implementation of JMF 2.0 provided by Sun Microsystems, Inc. and IBM Corporation fully supports the plug-in API. </font>
</p>


<h3>
  <a name="105850"> </a><font color="#003366" face="Palatino, Times New Roman, Times, serif">Presentation</font>
</h3>


<p>
  <a name="106514"> </a><font face="Palatino, Times New Roman, Times, serif">In JMF, the presentation process is modeled by the <code>Controller</code> interface. <code>Controller</code> defines the basic state and control mechanism for an object that controls, presents, or captures time-based media. It defines the phases that a media controller goes through and provides a mechanism for controlling the transitions between those phases. A number of the operations that must be performed before media data can be presented can be time consuming, so JMF allows programmatic control over when they occur. </font>
</p>


<p>
  <a name="106084"> </a><font face="Palatino, Times New Roman, Times, serif"> A <code>Controller</code> posts a variety of controller-specific <code>MediaEvents</code> to provide notification of changes in its status. To receive events from a <code>Controller</code> such as a <code>Player</code>, you implement the <code>ControllerListener</code> interface. For more information about the events posted by a <code>Controller</code>, see <a href="JMFArchitecture.html#106146">Controller Events</a>.</font>
</p>


<p>
  <a name="106107"> </a><font face="Palatino, Times New Roman, Times, serif">The JMF API defines two types of <code>Controllers</code>: <code>Players</code> and <code>Processors</code>. <code>A Player </code>or <code>Processor</code> is constructed for a particular data source and is normally not re-used to present other media data. </font>
</p>


<a name="101850"> </a><font  size="1" face="Palatino, Times New Roman, Times, serif"><img src="images/JMFArchitecture9.gif" height="215" width="478">
<br></font>


<a name="112711"> </a><font  size="2" face="Palatino, Times New Roman, Times, serif">Figure 2-9:   JMF controllers.<br></font>

⌨️ 快捷键说明

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