DripFeedDataSource

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.dvb.media
Class DripFeedDataSource

    java.lang.Object
      javax.media.protocol.DataSource
          org.dvb.media.DripFeedDataSource

All Implemented Interfaces:
  Duration, Controls

    public class DripFeedDataSource

extends DataSource

This class allows to create a source for a JMF player to be able to feed the decoder progressively with parts of a clip (e.g. I or P MPEG-2 frame) according to the drip-fed mode format defined in the MHP content format clause.

To start using the drip-feed mode, the application needs to instantiate a player representing a MPEG-2 video decoder and have its source be a DripFeedDataSource instance.

A DripFeedDataSource instance can be obtained by calling the default constructor of the class.

A player that will be bound to a MPEG-2 video decoder (when realized) can be created with a locator of the following text representation: "dripfeed://".

After having the DripFeedDataSource connected to a Player representing a MPEG-2 video decoder, the following rules applies:
- If the feed method is called when the player is in the "prefetched" state the image will be stored so that when the player goes in the "started" state it will be automatically displayed.
- If the feed method is called when the player is in the "started" mode, the frame shall be displayed immediately. In particular it is not required to feed a second frame to the decoder to display the first frame.
- If the feed method is called when the player is in any other state (or if the DripFeedDataSource is not connected to a player), it will be ignored by the platform implementation.

Field Summary

Fields inherited from interface javax.media.Duration
`DURATION_UNBOUNDED, DURATION_UNKNOWN`

Constructor Summary
`DripFeedDataSource()` Constructor.

Method Summary
`void` | `connect()` This method shall not be used and has no effect.
`void` | `disconnect()` This method shall not be used and has no effect.
`void` | `feed(byte[] clip_part)` This method allows an application to feed the decoder progressively with parts of a clip (e.g.
`String` | `getContentType()` This method shall return the content type for mpeg-2 video "drips"
`Object` | `getControl(String controlType)` Obtain the object that implements the specified Class or Interface.
`Object[]` | `getControls()` Obtain the collection of objects that control this object.
`Time` | `getDuration()` This method shall not be used and has no effect.
`void` | `start()` This method shall not be used and has no effect.
`void` | `stop()` This method shall not be used and has no effect.

Methods inherited from class javax.media.protocol.DataSource
`getLocator, setLocator`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DripFeedDataSource

    public DripFeedDataSource()

  Constructor. A call to the constructor will throw a security exception if the application is not granted the right to use the drip feed mode. The constructor shall automatically set the MediaLocator for this DataSource to the only allowed value: dripfeed://. There is no need for applications to later call setLocator.

Method Detail

### feed

    public void feed(byte[] clip_part)

  This method allows an application to feed the decoder progressively with parts of a clip (e.g. I or P MPEG-2 frame) according to the drip-fed mode format defined in the MHP content format clause.
  The feed method shall not be called more often than every 500ms. If this rule is not respected, display is not guaranteed.

  While in the prefetch state the drip feed data source is only required to correctly process a single invocation of this method where the data consists only of a single I frame. Possible additional invocations while in the prefetch state shall have implementation specific results.

  Parameters:
    `clip_part` - Chunk of bytes compliant with the drip-fed mode format defined in the MHP content format clause (i.e. one MPEG-2 frame with optional synctactic MPEG-2 elements).

### getContentType

    public String getContentType()

  This method shall return the content type for mpeg-2 video "drips"

  Specified by:
    `getContentType` in class `DataSource`
  Returns:
    the content type for MPEG-2 video drips

### connect

    public void connect()
                 throws IOException

  This method shall not be used and has no effect. This source is considered as always connected.

  Specified by:
    `connect` in class `DataSource`
  Throws:
    `IOException` - never thrown in this sub-class

### disconnect

    public void disconnect()

  This method shall not be used and has no effect. This source is considered as always connected.

  Specified by:
    `disconnect` in class `DataSource`

### start

    public void start()
               throws IOException

  This method shall not be used and has no effect. This source is considered as always started.

  Specified by:
    `start` in class `DataSource`
  Throws:
    `IOException` - never thrown in this sub-class

### stop

    public void stop()
              throws IOException

  This method shall not be used and has no effect. This source is considered as always started.

  Specified by:
    `stop` in class `DataSource`
  Throws:
    `IOException` - never thrown in this sub-class

### getDuration

    public Time getDuration()

  This method shall not be used and has no effect.

  Returns:
    DURATION_UNKNOWN.

### getControls

    public Object[] getControls()

  Obtain the collection of objects that control this object. If no controls are supported, a zero length array is returned.

  Returns:
    the collection of object controls

### getControl

    public Object getControl(String controlType)

  Obtain the object that implements the specified Class or Interface. The full class or interface name must be used. If the control is not supported then null is returned.

  Parameters:
    `controlType` - the full class or interface name of the requested control
  Returns:
    the object that implements the control, or null.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD