MediaHandler

MediaHandler is the centralized interface for objects that read and control media delivered from a DataSource object. Interfaces that extend MediaHandler include Player, Processor, DataSink, and Demultiplexer, which are all key classes commonly used in JMF programs.

The MediaHandler interface consists of a single method setSource(). The method accepts a DataSource and associates or links that DataSource with the object in question: that is the location in which the data to be handled will be obtained.

The creation of Players, Processors, or DataSinks by the Manager class requires a DataSource that the Manager needs to create as a prestep if it isn't supplied with a DataSource as part of the call. Part of the creation process by the Manager class is the invocation of the setSource() method on the Player, Processor, or DataSink. That is why the method generally isn't called from user code. Indeed, the setSource() method can throw either an IOException or IncompatibleSourceException. The presence or lack of an exception is how the Manager class searches the list of possible candidate classes until one that supports a particular DataSource (and hence media format) is found.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset