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

📄 jmfarchitecture.html

📁 jmf指导文件参考资料
💻 HTML
📖 第 1 页 / 共 5 页
字号:


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


<p>
  <a name="106302"> </a><font face="Palatino, Times New Roman, Times, serif">A <code>Player</code> processes an input stream of media data and renders it at a precise time. A <code>DataSource</code> is used to deliver the input media-stream to the <code>Player</code>.The rendering destination depends on the type of media being presented.</font>
</p>


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


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


<p>
  <a name="112717"> </a><font face="Palatino, Times New Roman, Times, serif">A <code>Player</code> does not provide any control over the processing that it performs or how it renders the media data. </font>
</p>


<p>
  <a name="107433"> </a><font face="Palatino, Times New Roman, Times, serif"><code>Player</code> supports standardized user control and relaxes some of the operational restrictions imposed by <code>Clock </code>and<code> Controller</code>.</font>
</p>


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


<a name="112884"> </a><font  size="2" face="Palatino, Times New Roman, Times, serif">Figure 2-11:   JMF players.<br></font>


<h5>
  <a name="112886"> </a><i><font color="#003366" face="Palatino, Times New Roman, Times, serif">Player States</font></i>
</h5>


<p>
  <a name="99316"> </a><font face="Palatino, Times New Roman, Times, serif">A <code>Player</code> can be in one of six states. The <code>Clock</code> interface defines the two primary states: <em>Stopped</em> and <em>Started</em>. To facilitate resource management, <code>Controller</code> breaks the <em>Stopped</em> state down into five standby states: <em>Unrealized</em>, <em>Realizing</em>, <em>Realized</em>, <em>Prefetching</em>, and <em>Prefetched</em>. </font>
</p>


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


<a name="112748"> </a><font  size="2" face="Palatino, Times New Roman, Times, serif">Figure 2-12:   Player states.<br></font>


<p>
  <a name="99325"> </a><font face="Palatino, Times New Roman, Times, serif">In normal operation, a <code>Player</code> steps through each state until it reaches the <em>Started</em> state:</font>
</p>

<ul>
  <li><a name="99327"> </a><font face="Palatino, Times New Roman, Times, serif">A <code>Player</code> in the <em>Unrealized</em> state has been instantiated, but does not yet know anything about its media. When a media <code>Player</code> is first created, it is <em>Unrealized</em>. </font>
  <li><a name="99329"> </a><font face="Palatino, Times New Roman, Times, serif">When <code>realize </code>is called, a <code>Player</code> moves from the <em>Unrealized</em> state into the <em>Realizing</em> state. A <em>Realizing</em> <code>Player</code> is in the process of determining its resource requirements. During realization, a <code>Player</code> acquires the resources that it only needs to acquire once. These might include rendering resources other than exclusive-use resources. (Exclusive-use resources are limited resources such as particular hardware devices that can only be used by one <code>Player</code> at a time; such resources are acquired during <em>Prefetching</em>.) A <em>Realizing</em> <code>Player</code> often downloads assets over the network.</font>
  <li><a name="99333"> </a><font face="Palatino, Times New Roman, Times, serif">When a <code>Player</code> finishes <em>Realizing</em>, it moves into the <em>Realized</em> state. A <em>Realized</em> <code>Player</code> knows what resources it needs and information about the type of media it is to present. Because a <em>Realized</em> <code>Player</code> knows how to render its data, it can provide visual components and controls. Its connections to other objects in the system are in place, but it does not own any resources that would prevent another <code>Player</code> from starting. </font>
  <li><a name="99335"> </a><font face="Palatino, Times New Roman, Times, serif">When <code>prefetch</code> is called, a <code>Player</code> moves from the <em>Realized</em> state into the <em>Prefetching</em> state. A <em>Prefetching</em> <code>Player</code> is preparing to present its media. During this phase, the <code>Player</code> preloads its media data, obtains exclusive-use resources, and does whatever else it needs to do to prepare itself to play. <em>Prefetching</em> might have to recur if a <code>Player </code>object's media presentation is repositioned, or if a change in the <code>Player </code>object's rate requires that additional buffers be acquired or alternate processing take place.</font>
  <li><a name="99338"> </a><font face="Palatino, Times New Roman, Times, serif">When a <code>Player</code> finishes <em>Prefetching</em>, it moves into the <em>Prefetched</em> state. A <em>Prefetched</em> <code>Player</code> is ready to be started. </font>
  <li><a name="99341"> </a><font face="Palatino, Times New Roman, Times, serif">Calling <code>start</code> puts a <code>Player</code> into the <em>Started</em> state. A <em>Started</em> <code>Player </code>object's time-base time and media time are mapped and its clock is running, though the <code>Player</code> might be waiting for a particular time to begin presenting its media data.</font>
</ul>

<p>
  <a name="99342"> </a><font face="Palatino, Times New Roman, Times, serif">A <code>Player</code> posts <code>TransitionEvents</code> as it moves from one state to another. The <code>ControllerListener</code> interface provides a way for your program to determine what state a <code>Player</code> is in and to respond appropriately. For example, when your program calls an asynchronous method on a <code>Player </code>or<code> Processor</code>, it needs to listen for the appropriate event to determine when the operation is complete.</font>
</p>


<p>
  <a name="99344"> </a><font face="Palatino, Times New Roman, Times, serif">Using this event reporting mechanism, you can manage a <code>Player </code>object's<code> </code>start latency by controlling when it begins <em>Realizing</em> and <em>Prefetching</em>. It also enables you to determine whether or not the <code>Player</code> is in an appropriate state before calling methods on the <code>Player</code>.</font>
</p>


<h5>
  <a name="99346"> </a><i><font color="#003366" face="Palatino, Times New Roman, Times, serif">Methods Available in Each Player State</font></i>
</h5>


<p>
  <a name="100275"> </a><font face="Palatino, Times New Roman, Times, serif">To prevent race conditions, not all methods can be called on a <code>Player</code> in every state. The following table identifies the restrictions imposed by JMF. If you call a method that is illegal in a <code>Player </code>object's current state, the <code>Player</code> throws an error or exception. <strong></strong></font>
</p>


<a name="112984"> </a><font  size="1" face="Palatino, Times New Roman, Times, serif">

<table border="1" bordercolorlight="#FFFFFF" bordercolordark="#000000"
       cellpadding="5" cellspacing="0">
  <caption><b><i><font face="Palatino, Times New Roman, Times, serif"></font></i></b></caption>
  <tr bgcolor="#CCCCCC"><div align="center">
    <th><font face="Palatino, Times New Roman, Times, serif" color="#003366"><a name="100279"> </a>Method<a name="100280"> </a><br></font></th>
    <th><font face="Palatino, Times New Roman, Times, serif" color="#003366"><a name="100282"> </a>Unrealized <a name="100283"> </a>Player</font></th>
    <th><font face="Palatino, Times New Roman, Times, serif" color="#003366"><a name="100285"> </a>Realized<a name="100286"> </a>Player</font></th>
    <th><font face="Palatino, Times New Roman, Times, serif" color="#003366"><a name="100288"> </a>Prefetched Player</font></th>
    <th><font face="Palatino, Times New Roman, Times, serif" color="#003366"><a name="100290"> </a>Started <a name="100291"> </a>Player</font></th>
  </div></tr>
  <tr>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100293"> </a><code>addController</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100295"> </a><code>NotRealizedError</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100297"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100299"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100301"> </a><code>ClockStartedError</code></font></td>
  </tr>
  <tr>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100303"> </a><code>deallocate</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100305"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100307"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100309"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100311"> </a><code>ClockStartedError</code></font></td>
  </tr>
  <tr>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100313"> </a><code>getControlPanelComponent</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100315"> </a><code>NotRealizedError</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100317"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100319"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100321"> </a><code>legal</code></font></td>
  </tr>
  <tr>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100323"> </a><code>getGainControl</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100325"> </a><code>NotRealizedError</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100327"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100329"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100331"> </a><code>legal</code></font></td>
  </tr>
  <tr>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100333"> </a><code>getStartLatency</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100335"> </a><code>NotRealizedError</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100337"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100339"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100341"> </a><code>legal</code></font></td>
  </tr>
  <tr>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100343"> </a><code>getTimeBase</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100345"> </a><code>NotRealizedError</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100347"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100349"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100351"> </a><code>legal</code></font></td>
  </tr>
  <tr>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100353"> </a><code>getVisualComponent</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100355"> </a><code>NotRealizedError</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100357"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100359"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100361"> </a><code>legal</code></font></td>
  </tr>
  <tr>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100363"> </a><code>mapToTimeBase</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100365"> </a><code>ClockStoppedException</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100367"> </a><code>ClockStoppedException</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100369"> </a><code>ClockStoppedException</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100371"> </a><code>legal</code></font></td>
  </tr>
  <tr>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100373"> </a><code>removeController</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100375"> </a><code>NotRealizedError</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100377"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100379"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100381"> </a><code>ClockStartedError</code></font></td>
  </tr>
  <tr>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100383"> </a><code>setMediaTime</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100385"> </a><code>NotRealizedError</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100387"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100389"> </a><code>legal</code></font></td>
    <td><font face="Palatino, Times New Roman, Times, serif"><a name="100391"> </a><code>legal</code></font></td>

⌨️ 快捷键说明

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