Understanding JMF


    Java Media Framework (JMF) provides a unified architecture and messaging protocol for managing the

      acquisition, processing & 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.


    JMF provides a common cross-platform Java API for accessing underlying media frameworks.
     

    High-Level Architecture

     



    Time Model


    A Clock uses a TimeBase to keep track of the passage of time while a media stream is being presented.

    A Clock object's media time 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 duration of the media stream is the elapsed time from start to finish--the length of time that it takes to present the media stream.

    To keep track of the current media time, a Clock uses:


    During presentation, the current media time is calculated using the following formula:

     MediaTime = MediaStartTime + Rate(TimeBaseTime - TimeBaseStartTime)

    Managers

    JMF uses intermediary objects called managers.
    JMF uses four managers:
    1. Manager--handles the construction of
            Players, Processors, DataSources, and DataSinks.
    1. PackageManager--maintains a registry of packages such as
custom Players, Processors, DataSources, and DataSinks.
    1. CaptureDeviceManager--maintains a registry of available capture devices.
    2. PlugInManager--maintains a registry of available JMF plug-in processing components, such as 
    3. Multiplexers, Demultiplexers, Codecs, Effects, and Renderers.

    Event Model

    Whenever a JMF object needs to report on the current conditions,
    it posts a MediaEvent.

    To receive notification when a MediaEvent is posted, you implement the appropriate listener interface and register your listener class with the object that posts the event by calling its addListener method. 
     

    Data Model

    JMF media players usually use DataSources to manage the transfer of media-content. A DataSource encapsulates both the location of media and the protocol and software used to deliver the media.

    A DataSource is identified by either a JMF MediaLocator or a URL
     

    Push and Pull Data Sources
     JMF data sources can be categorized according to how data transfer is initiated:
    Data Formats
    The exact media format of an object is represented by a Format object. JMF extends Format to define audio- and video-specific formats.


    Capture

    A multimedia capturing device can act as a source for multimedia data delivery.  Such capture devices are abstracted as DataSources.

    Some devices deliver multiple data streams--for example, an audio/video conferencing board might deliver both an audio and a video stream. The corresponding DataSource can contain multiple SourceStreams that map to the data streams provided by the device.


    Media Data Storage and Transmission

    A DataSink is used to read media data from a DataSource and render the media to some destination--generally a destination other than a presentation device. A particular DataSink might write data to a file, write data across the network, or function as an RTP broadcaster.