📄 processor.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Sat May 20 18:57:44 PDT 2000 --><TITLE>: Interface Processor</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javax/media/Prefetchable.html"><B>PREV CLASS</B></A> <A HREF="../../javax/media/Renderer.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Processor.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.media</FONT><BR>Interface Processor</H2><HR><DL><DT>public interface <B>Processor</B><DT>extends <A HREF="../../javax/media/Player.html">Player</A></DL><P>The <code>Processor</code> interface defines a module for processing and controlling time-based media data. <code>Processor</code> extends the <code>Player</code> interface. Unlike a <code>Player</code>, which processes data as a "black box" and only renders data to preset destinations, a <code>Processor</code> supports a programmatic interface that enables control over the media data processing and access to output data streams. <p> The processing performed by a <code>Processor</code> is split into three stages: <ul> <li> Demultiplexing - an interleaved media stream is first demultiplexed into separate tracks of data streams that can be processed individually. <li> Data transcoding - each track of data can be transcoded from one format to another. <li> Multiplexing - the separate tracks can be multiplexed to form an interleaved stream of a particular container content type. </ul> <p> Both the data transcoding and multiplexing processes are programmable. <h2>How a <code>Processor</code> Differs from a <code>Controller</code></h2> <code>Processor</code> extends the state transition cycle of a <code>Controller</code> by adding the <i>Configuring</i> and <i>Configured</i> states. The purpose of these additional states is to further refine the realizing process. The realizing step is essentially split into two phases: <ul> <li> Source information gathering - the input <code>DataSource</code> is queried and the input media stream is parsed to get the format information for the tracks in the stream. <li> Construction - the internals of the <code>Processor</code> are constructed to handle the input media stream. </ul> <p> Between these two steps, you can program the <code>Processor</code> to perform specific processing on its media stream. <p> The states of a <code>Processor</code> are: <i>Unrealized,</i> <i>Configuring,</i> <i>Configured,</i> <i>Realizing,</i> <i>Realized,</i> <i>Prefetching,</i> <i>Prefetched,</i> and <i>Started</i>. <h3>The <i>Configuring</i> and <i>Configured</i> States</h3> <p> While it's in the <code>Configuring</code> state, a <code>Processor</code> gathers the source information necessary to prepare the <code>Processor</code> to be programmed. This might involve parsing an input file to access the individual media tracks within the file, or connecting to a capturing device to determine its capabilities. A <code>ConfigureCompleteEvent</code> is posted when the <code>Processor</code> reaches <i>Configured</i> state. <p> Once a <code>Processor</code> is <i>Configured,</i> you can program it to perform particular processing on each track or to output data in a particular format. <h3>Realizing a <code>Processor</code></h3> <p> When you're done programming the <code>Processor</code>, you call the <code>realize</code> method to complete its construction. <p> Once the <code>Processor</code> is in the <i>Realized</i> state, reprogramming the <code>Processor</code> by calling the <code>TrackControl</code> methods or the <code>setContentDescriptor</code> method is not guaranteed to work. This is because reprogramming the <code>Processor</code> might require reconstruction of its internals. <p> It is legal to call <code>realize</code> on a <code>Processor</code> while it is in the <i>Unrealized</i> state. This causes the <code>Processor</code> to transition from the <i>Unrealized</i> state to the <i>Realized</i> state. As it does this, it goes through each intermediate state: <code>Configuring</code>, <code>Configured</code>, and <code>Realizing</code>. However, when you directly realize a <code>Processor</code>, you miss the opportunity to program it while it's in the <i>Configured</i> state--the <code>Processor</code> performs whatever default processing its implementation specifies. <h3>Deallocating a <code>Processor</code></h3> <p> Calling <code>deallocate</code> changes the state of a <code>Processor</code> in the same way as a <code>Controller</code> <b>except</b> that if <code>deallocate</code> is called while the <code>Processor</code> is in the <i>Configuring</i> or <i>Configured</i> state, the <code>Processor</code> is returned to the <i>Unrealized</i> state. <h2>Programming a <code>Processor</code></h2> <p> You can control both the transcoding and multiplexing performed by a <code>Processor</code>. Data transcoding is controlled separately for each track. The <code>getTrackControls</code> method returns a <code>TrackControl</code> for each track. You use these <code>TrackControl</code> objects to specify what processing you want to perform. The multiplexing performed by a <code>Processor</code> is controlled by specifying the format that you want it to output. This is done through the <code>setContentDescriptor</code> method. <p> A <code>Processor</code> can be programmed while it is in the <i>Configured</i> state. A <code>NotConfiguredError</code> is thrown if you attempt to program the <code>Processor</code> before is configured. <p> If you do not program a <code>Processor</code> through the <code>TrackControl</code> methods or by calling <code>setContentDescriptor</code>, it performs whatever default processing is specified by its implementation. <h2>Getting the Output from a <code>Processor</code></h2> <p> The processed output data streams can be retrieved from a <code>Processor</code> through its output <code>DataSource</code>. The output <code>DataSource</code> provides the gateway for the output data to be read. A <code>DataSource</code> output from a <code>Processor</code> can be a <code>PushDataSource</code>, <code>PushBufferDataSource</code>, <code>PullDataSource</code>, or <code>PullBufferDataSource</code> depending on the implementation of the <code>Processor</code>. <p> A <code>NotRealizedError</code> is thrown if <code>getDataOutput</code> is called on a <code>Processor</code> that has not yet been realized. <h2>Using a <code>Processor</code> as a <code>Player</code></h2> Many <code>Processor</code> implementations can be used like a <code>Player</code> to render media data instead of sending it to an output <code>DataSource</code>. In this case, the <code>TrackControl</code> objects provide additional information and control over the individual tracks to be rendered. When used as a <code>Player</code>, a <code>Processor</code> does not produce an output <code>DataSource</code>. To use a <code>Processor</code> as a <code>Player</code>, you call <code>setContentDescriptor(null)</code>.<P><DL><DT><B>Since: </B><DD>JMF 2.0</DD><DT><B>See Also: </B><DD><A HREF="../../javax/media/Controller.html"><CODE>Controller</CODE></A>, <A HREF="../../javax/media/Player.html"><CODE>Player</CODE></A>, <A HREF="../../javax/media/control/TrackControl.html"><CODE>TrackControl</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/media/Processor.html#Configured">Configured</A></B></CODE><BR> Returned by <code>getState</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/media/Processor.html#Configuring">Configuring</A></B></CODE><BR> Returned by <code>getState</code>.</TD></TR></TABLE> <A NAME="fields_inherited_from_class_javax.media.Controller"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from interface javax.media.<A HREF="../../javax/media/Controller.html">Controller</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../javax/media/Controller.html#LATENCY_UNKNOWN">LATENCY_UNKNOWN</A>, <A HREF="../../javax/media/Controller.html#Prefetched">Prefetched</A>, <A HREF="../../javax/media/Controller.html#Prefetching">Prefetching</A>, <A HREF="../../javax/media/Controller.html#Realized">Realized</A>, <A HREF="../../javax/media/Controller.html#Realizing">Realizing</A>, <A HREF="../../javax/media/Controller.html#Started">Started</A>, <A HREF="../../javax/media/Controller.html#Unrealized">Unrealized</A></CODE></TD></TR></TABLE> <A NAME="fields_inherited_from_class_javax.media.Clock"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from interface javax.media.<A HREF="../../javax/media/Clock.html">Clock</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../javax/media/Clock.html#RESET">RESET</A></CODE></TD></TR></TABLE> <A NAME="fields_inherited_from_class_javax.media.Duration"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from interface javax.media.<A HREF="../../javax/media/Duration.html">Duration</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../javax/media/Duration.html#DURATION_UNBOUNDED">DURATION_UNBOUNDED</A>, <A HREF="../../javax/media/Duration.html#DURATION_UNKNOWN">DURATION_UNKNOWN</A></CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/media/Processor.html#configure()">configure</A></B>()</CODE><BR> Prepares the <code>Processor</code> to be programmed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/media/protocol/ContentDescriptor.html">ContentDescriptor</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/media/Processor.html#getContentDescriptor()">getContentDescriptor</A></B>()</CODE><BR> Gets the output content-type currently set for this <code>Processor</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/media/protocol/DataSource.html">DataSource</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/media/Processor.html#getDataOutput()">getDataOutput</A></B>()</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -