public final class MediaStream extends java.lang.Object implements MediaStreamInterface
Modifier and Type | Class and Description |
---|---|
static class |
MediaStream.FormatInfo
The base class for the additional format information that may
be SourceType specific.
|
static class |
MediaStream.FormatInfoGeneric
Additional format information that may be needed when
constructing a Media Stream object.
|
static class |
MediaStream.SourceType
The source type.
|
CONTENT_TYPE_AES128CBC, CONTENT_TYPE_DCF
Constructor and Description |
---|
MediaStream(MediaStreamInterface sourceInput,
MediaStream.FormatInfo format_info)
Access an encrypted source through an input object that
implements the MediaStreamInterface.
|
MediaStream(java.lang.String sourceName,
MediaStream.SourceType sourceType,
MediaStream.FormatInfo format_info)
Access an encrypted source through a URL.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Release the Media Stream resources.
|
java.lang.String |
getContentType()
Get Media Stream content type.
|
java.lang.Object |
getKey()
Access the crypto context for sharing with another Media
Stream object to avoid re-evaluation of the same license.
|
long |
getSize()
Get Media Stream size.
|
int |
read(byte[] buffer)
Read data from a media stream object.
|
int |
read(byte[] buffer,
int offset,
int length)
Read data from a media stream object.
|
void |
seek(long position)
Change the current read position.
|
long |
tell()
Get the current read position.
|
public MediaStream(java.lang.String sourceName, MediaStream.SourceType sourceType, MediaStream.FormatInfo format_info) throws ErrorCodeException, java.lang.NullPointerException
sourceName
- either an ms3:// URL or directly a source file
URL (http:// or file://) for BB.sourceType
- the type of the source data.format_info
- additional format information about the
source data that. Ignored if sourceType is
DCF. Can be null.ErrorCodeException
java.lang.NullPointerException
public MediaStream(MediaStreamInterface sourceInput, MediaStream.FormatInfo format_info) throws ErrorCodeException, java.lang.NullPointerException
sourceInput
- source data random access object.format_info
- additional format information about the
source data that. Can be null.ErrorCodeException
java.lang.NullPointerException
public int read(byte[] buffer) throws ErrorCodeException
read
in interface MediaStreamInterface
buffer
- the data buffer to read into.ErrorCodeException
public int read(byte[] buffer, int offset, int length) throws ErrorCodeException
read
in interface MediaStreamInterface
buffer
- the data buffer to read into.offset
- the number of buffer locations to skiplength
- the number of bytes to readErrorCodeException
public void seek(long position) throws ErrorCodeException
seek
in interface MediaStreamInterface
position
- the number of bytes from the start of the media
stream.ErrorCodeException
public long tell() throws ErrorCodeException
tell
in interface MediaStreamInterface
ErrorCodeException
public long getSize() throws ErrorCodeException
getSize
in interface MediaStreamInterface
ErrorCodeException
public java.lang.String getContentType() throws ErrorCodeException
getContentType
in interface MediaStreamInterface
ErrorCodeException
public java.lang.Object getKey() throws ErrorCodeException
ErrorCodeException
public void close()
close
in interface MediaStreamInterface