public class DripFeedDataSource extends DataSource
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.
DURATION_UNBOUNDED, DURATION_UNKNOWN| Constructor and Description |
|---|
DripFeedDataSource()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
getLocator, initCheck, setLocatorpublic DripFeedDataSource()
public void feed(byte[] clip_part)
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.
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).public String getContentType()
getContentType in class DataSourcepublic void connect()
throws IOException
connect in class DataSourceIOException - never thrown in this sub-classpublic void disconnect()
disconnect in class DataSourcepublic void start()
throws IOException
start in class DataSourceIOException - never thrown in this sub-classpublic void stop()
throws IOException
stop in class DataSourceIOException - never thrown in this sub-classpublic Time getDuration()
public Object[] getControls()
public Object getControl(String controlType)
controlType - the full class or interface name of the requested controlCopyright © 2012 code4tv.com. All Rights Reserved.