public class DataSource extends PushDataSource
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
connected |
protected ContentDescriptor |
contentType |
protected PushSourceStream2Impl[] |
sources |
protected boolean |
started |
protected URL |
url |
protected URLConnection |
urlConnection |
DURATION_UNBOUNDED, DURATION_UNKNOWN| Constructor and Description |
|---|
DataSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Open a connection to the source described by
the
MediaLocator. |
void |
disconnect()
Close the connection to the source described by the locator.
|
String |
getContentType()
Get a string that describes the content-type of the media
that the source is providing.
|
Object |
getControl(String controlType)
Obtain the object that implements the specified
Class or Interface
The full class or interface name must be used. |
Object[] |
getControls()
Obtain the collection of objects that
control the object that implements this interface.
|
Time |
getDuration()
Get the duration of the media represented
by this object.
|
PushSourceStream[] |
getStreams()
Get the collection of streams that this source
manages.
|
void |
start()
Initiate data-transfer.
|
void |
stop()
Stop the data-transfer.
|
getLocator, initCheck, setLocatorprotected boolean connected
protected boolean started
protected URL url
protected URLConnection urlConnection
protected ContentDescriptor contentType
protected PushSourceStream2Impl[] sources
public PushSourceStream[] getStreams()
ContentDescriptor
of this DataSource provides the only indication of
what streams can be available on this connection.getStreams in class PushDataSourcepublic String getContentType()
It is an error to call getContentType if the source is
not connected.
getContentType in class DataSourcepublic void connect()
throws IOException
MediaLocator.
The connect method initiates communication with the source.
connect in class DataSourceIOException - Thrown if there are IO problems
when connect is called.public void disconnect()
The disconnect method frees resources used to maintain a
connection to the source.
If no resources are in use, disconnect is ignored.
If stop hasn't already been called,
calling disconnect implies a stop.
disconnect in class DataSourcepublic void start()
throws IOException
start method must be
called before data is available.
(You must call connect before calling start.)start in class DataSourceIOException - Thrown if there are IO problems with the source
when start is called.public void stop()
throws IOException
stop does nothing.stop in class DataSourceIOExceptionpublic Object[] getControls()
If no controls are supported, a zero length array is returned.
public Object getControl(String controlType)
Class or Interface
The full class or interface name must be used.
If the control is not supported then null
is returned.
null.public Time getDuration()
getDuration returns DURATION_UNKNOWN.Time object representing the duration or DURATION_UNKNOWN.Copyright © 2012 code4tv.com. All Rights Reserved.