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

📄 jmfarchitecture.html

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

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Quadralay WebWorks Publisher 5.0.2">
<meta name="TEMPLATEBASE" content="Portable HTML">
<meta name="LASTUPDATED" content="11/23/99 11:48:00">
<title>Understanding JMF   </title>
</head>

<body link="#3366CC" vlink="#9999CC" text="#000000" alink="#0000CC" bgcolor="#FFFFFF"
background="images/backgrnd.gif">


<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
  <tr>
    <td><a href="JMFTOC.html">CONTENTS</a> | 
    <a href="JMFTBM.html">PREV </a> |
    <a href="JMFPresenting.html">NEXT</a> |
    <a href="JMFIX.html">INDEX</a></td>
    <td align="right"><em>JMF 2.0 API Guide</em>
  </tr>
</table>

<p><br clear="all">
</p>

<hr align="left">

<blockquote>
<div align="right">
<a name="96136"> </a><font  size="3" face="Palatino, Times New Roman, Times, serif">2 <br></font>
</div>
<div align="right">
<h2>
  <a name="112612"> </a><font color="#003366" face="Palatino, Times New Roman, Times, serif">Understanding JMF </font>
</h2>
</div>

<p>
  <a name="96267"> </a><font face="Palatino, Times New Roman, Times, serif">Java<font size="-1"><sup>TM</sup></font> Media Framework (JMF) provides a unified architecture and messaging protocol for managing the acquisition, processing, and delivery of time-based media data. JMF is designed to support most standard media content types, such as AIFF, AU, AVI, GSM, MIDI, MPEG, QuickTime, RMF, and WAV. </font>
</p>


<p>
  <a name="96275"> </a><font face="Palatino, Times New Roman, Times, serif">By exploiting the advantages of the Java platform, JMF delivers the promise of "Write Once, Run Anywhere<font size="-1"><sup>TM</sup></font>" to developers who want to use media such as audio and video in their Java programs. JMF provides a common cross-platform Java API for accessing underlying media frameworks. JMF implementations can leverage the capabilities of the underlying operating system, while developers can easily create portable Java programs that feature time-based media by writing to the JMF API. </font>
</p>


<p>
  <a name="96276"> </a><font face="Palatino, Times New Roman, Times, serif">With JMF, you can easily create applets and applications that present, capture, manipulate, and store time-based media. The framework enables advanced developers and technology providers to perform custom processing of raw media data and seamlessly extend JMF to support additional content types and formats, optimize handling of supported formats, and create new presentation mechanisms. </font>
</p>


<h3>
  <a name="97464"> </a><font color="#003366" face="Palatino, Times New Roman, Times, serif">High-Level Architecture</font>
</h3>


<p>
  <a name="101370"> </a><font face="Palatino, Times New Roman, Times, serif">Devices such as tape decks and VCRs provide a familiar model for recording, processing, and presenting time-based media. When you play a movie using a VCR, you provide the media stream to the VCR by inserting a video tape. The VCR reads and interprets the data on the tape and sends appropriate signals to your television and speakers.</font>
</p>


<a name="111824"> </a><font  size="1" face="Palatino, Times New Roman, Times, serif"> <img src="images/JMFArchitecture3.gif" height="309" width="480">
<br></font>


<a name="97467"> </a><font  size="2" face="Palatino, Times New Roman, Times, serif">Figure 2-1:   Recording, processing, and presenting time-based media.<br></font>


<p>
  <a name="112631"> </a><font face="Palatino, Times New Roman, Times, serif">JMF uses this same basic model. A <em>data source</em> encapsulates the media stream much like a video tape and a <em>player</em> provides processing and control mechanisms similar to a VCR. Playing and capturing audio and video with JMF requires the appropriate input and output devices such as microphones, cameras, speakers, and monitors. </font>
</p>


<p>
  <a name="101528"> </a><font face="Palatino, Times New Roman, Times, serif">Data sources and players are integral parts of JMF's high-level API for managing the capture, presentation, and processing of time-based media. JMF also provides a lower-level API that supports the seamless integration of custom processing components and extensions. This layering provides Java developers with an easy-to-use API for incorporating time-based media into Java programs while maintaining the flexibility and extensibility required to support advanced media applications and future media technologies.</font>
</p>


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


<a name="105608"> </a><font  size="2" face="Palatino, Times New Roman, Times, serif">Figure 2-2:   High-level JMF achitecture.<br></font>


<h4>
  <a name="112671"> </a><font color="#003366" face="Palatino, Times New Roman, Times, serif">Time Model</font>
</h4>


<p>
  <a name="105609"> </a><font face="Palatino, Times New Roman, Times, serif">JMF keeps time to nanosecond precision. A particular point in time is typically represented by a <code>Time</code> object, though some classes also support the specification of time in nanoseconds. </font>
</p>


<p>
  <a name="105610"> </a><font face="Palatino, Times New Roman, Times, serif">Classes that support the JMF time model implement <code>Clock</code> to keep track of time for a particular media stream. The<code> Clock</code> interface defines the basic timing and synchronization operations that are needed to control the presentation of media data. </font>
</p>


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


<a name="105654"> </a><font  size="2" face="Palatino, Times New Roman, Times, serif">Figure 2-3:   JMF time model.<br></font>


<p>
  <a name="112676"> </a><font face="Palatino, Times New Roman, Times, serif">A <code>Clock</code> uses a <code>TimeBase</code> to keep track of the passage of time while a media stream is being presented. A <code>TimeBase</code> provides a constantly ticking time source, much like a crystal oscillator in a watch. The only information that a <code>TimeBase</code> provides is its current time, which is referred to as the <em>time-base time</em>. The time-base time cannot be stopped or reset. Time-base time is often based on the system clock.</font>
</p>


<p>
  <a name="105655"> </a><font face="Palatino, Times New Roman, Times, serif">A <code>Clock </code>object's <em>media time</em> represents the current position within a media stream--the beginning of the stream is media time zero, the end of the stream is the maximum media time for the stream. The <em>duration</em> of the media stream is the elapsed time from start to finish--the length of time that it takes to present the media stream. (Media objects implement the <code>Duration</code> interface if they can report a media stream's duration.)</font>
</p>


<p>
  <a name="105656"> </a><font face="Palatino, Times New Roman, Times, serif">To keep track of the current media time, a <code>Clock</code> uses:</font>
</p>

<ul>
  <li><a name="105657"> </a><font face="Palatino, Times New Roman, Times, serif">The time-base start-time--the time that its <code>TimeBase</code> reports when the presentation begins.</font>
  <li><a name="105658"> </a><font face="Palatino, Times New Roman, Times, serif">The media start-time--the position in the media stream where presentation begins.</font>
  <li><a name="105659"> </a><font face="Palatino, Times New Roman, Times, serif">The playback rate--how fast the <code>Clock</code> is running in relation to its <code>TimeBase</code>. The <em>rate</em> is a scale factor that is applied to the <code>TimeBase</code>. For example, a rate of 1.0 represents the normal playback rate for the media stream, while a rate of 2.0 indicates that the presentation<code> </code>will run at twice the normal rate. A negative rate indicates that the <code>Clock</code> is running in the opposite direction from its <code>TimeBase</code>--for example, a negative rate might be used to play a media stream backward.</font>
</ul>

<p>
  <a name="105660"> </a><font face="Palatino, Times New Roman, Times, serif">When presentation begins, the media time is mapped to the time-base time and the advancement of the time-base time is used to measure the passage of time. During presentation, the current media time is calculated using the following formula:</font>
</p>

<pre>
<a name="105661"> </a><code>MediaTime = MediaStartTime + Rate(TimeBaseTime - TimeBaseStartTime)
</code></pre>

<p>
  <a name="107340"> </a><font face="Palatino, Times New Roman, Times, serif">When the presentation stops, the media time stops, but the time-base time continues to advance. If the presentation is restarted, the media time is remapped to the current time-base time.</font>
</p>


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


<p>
  <a name="114222"> </a><font face="Palatino, Times New Roman, Times, serif">The JMF API consists mainly of interfaces that define the behavior and interaction of objects used to capture, process, and present time-based media. Implementations of these interfaces operate within the structure of the framework. By using intermediary objects called <em>managers</em>, JMF makes it easy to integrate new implementations of key interfaces that can be used seamlessly with existing classes.</font>
</p>


<p>
  <a name="114223"> </a><font face="Palatino, Times New Roman, Times, serif">JMF uses four managers:</font>
</p>

<ul>
  <li><a name="114224"> </a><font face="Palatino, Times New Roman, Times, serif"><code>Manager</code>--handles the construction of <code>Players</code>, <code>Processors</code>, <code>DataSources</code>, and <code>DataSinks</code>. This level of indirection allows new implementations to be integrated seamlessly with JMF. From the client perspective, these objects are always created the same way whether the requested object is constructed from a default implementation or a custom one.</font>
  <li><a name="104751"> </a><font face="Palatino, Times New Roman, Times, serif"><code>PackageManager</code>--maintains a registry of packages that contain JMF classes, such as custom <code>Players</code>, <code>Processors</code>, <code>DataSources</code>, and <code>DataSinks</code>.</font>
  <li><a name="104837"> </a><font face="Palatino, Times New Roman, Times, serif"><code>CaptureDeviceManager</code>--maintains a registry of available capture devices.</font>
  <li><a name="104818"> </a><font face="Palatino, Times New Roman, Times, serif"><code>PlugInManager</code>--maintains a registry of available JMF plug-in processing components, such as <code>Multiplexers</code>, <code>Demultiplexers</code>, <code>Codecs</code>, <code>Effects</code>, and <code>Renderers</code>.</font>
</ul>

<p>
  <a name="104874"> </a><font face="Palatino, Times New Roman, Times, serif">To write programs based on JMF, you'll need to use the <code>Manager</code> <code>create</code> methods to construct the <code>Players</code>, <code>Processors</code>, <code>DataSources</code>, and <code>DataSinks</code> for your application. If you're capturing media data from an input device, you'll use the <code>CaptureDeviceManager</code> to find out what devices are available and access information about them. If you're interested in controlling what processing is performed on the data, you might also query the <code>PlugInManager</code> to determine what plug-ins have been registered. </font>
</p>

⌨️ 快捷键说明

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