public class OggJmfStream extends java.lang.Object implements PhysicalOggStream
PhysicalOggStream interface for accessing
JMF (Java Media Framework) media streams.| Constructor and Description |
|---|
OggJmfStream(PullSourceStream source)
Creates access to the specified
PullSourceStream through the
PhysicalOggStream interface. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream.
|
LogicalOggStream |
getLogicalStream(int serialNumber) |
java.util.Collection |
getLogicalStreams()
Returns a collection of objects implementing
LogicalOggStream
for accessing the separate logical streams within this physical Ogg stream. |
OggPage |
getOggPage(int index)
Return the Ogg page with the absolute index
index,
independent from the logical structure of this stream or if the
index parameter is -1, the next Ogg page is returned. |
boolean |
isOpen()
Checks if this stream is open for reading.
|
boolean |
isSeekable() |
void |
setTime(long granulePosition)
Sets this stream's (and its logical stream's) position to the granule
position.
|
public OggJmfStream(PullSourceStream source)
throws OggFormatException,
java.io.FileNotFoundException,
java.io.IOException
PullSourceStream through the
PhysicalOggStream interface.
The specified source must implement the Seekable interface.source - the media stream to read fromOggFormatException - if the stream format is incorrectjava.io.IOException - if some other IO error occurs when reading the streamjava.io.FileNotFoundExceptionpublic java.util.Collection getLogicalStreams()
PhysicalOggStreamLogicalOggStream
for accessing the separate logical streams within this physical Ogg stream.getLogicalStreams in interface PhysicalOggStreamLogicalOggStream
which are representing the logical streams contained within this
physical streamLogicalOggStreampublic boolean isOpen()
PhysicalOggStreamisOpen in interface PhysicalOggStreamtrue if this stream is open for reading,
false otherwisepublic void close()
throws java.io.IOException
PhysicalOggStreamclose in interface PhysicalOggStreamjava.io.IOExceptionpublic OggPage getOggPage(int index) throws java.io.IOException
PhysicalOggStreamindex,
independent from the logical structure of this stream or if the
index parameter is -1, the next Ogg page is returned.
This method should only be used by implementations of LogicalOggStream
to access the raw pages.getOggPage in interface PhysicalOggStreamindex - the absolute index starting from 0 at the beginning of
the file or stream or -1 to get the next page in a non-seekable
streamindexOggFormatException - if the ogg stream is corruptedjava.io.IOException - if some other IO error occurspublic LogicalOggStream getLogicalStream(int serialNumber)
public void setTime(long granulePosition)
throws java.io.IOException
PhysicalOggStreamsetTime in interface PhysicalOggStreamOggFormatException - if the ogg stream is corruptedjava.io.IOException - if some other IO error occurspublic boolean isSeekable()
isSeekable in interface PhysicalOggStreamtrue if the stream is seekable, false
otherwiseCopyright © 2013 Tor-Einar Jarnbjo. All Rights Reserved.