Package com.wowza.wms.stream
Interface IMediaReader
- 
- All Known Subinterfaces:
- IMediaReaderCupertino,- IMediaReaderMPEGDash
 
 public interface IMediaReaderIMediaReader: generic media reader interface. All media types implement this interface to interact with PlaylistPlayer. 
- 
- 
Field SummaryFields Modifier and Type Field Description static intCONTENTTYPE_MEDIAstatic intCONTENTTYPE_MEDIALISTstatic StringDEFAULT_RANDOMACCESSREADERstatic StringDEFAULT_RANDOMACCESSREADEROPTIMIZERstatic intPLAYEVENT_AFTERBUFFERFILLstatic intPLAYEVENT_AFTERMETADATAstatic intPLAYEVENT_BEFOREBUFFERFILLstatic intPLAYEVENT_BEFOREMETADATAstatic intPLAYEVENT_STARTPLAYBACKstatic intSEEK_EXACTSeek direction: closest frame (audio, video) (key, no-key)static intSEEK_KEYCLOSESeek direction: closest key framestatic intSEEK_KEYDOWNSeek direction: down to closets key framestatic intSEEK_KEYUPSeek direction: up to closets key framestatic intSEEKTARGET_AUDIOstatic intSEEKTARGET_ENHANCEDstatic intSEEKTARGET_VIDEOKEYFRAME
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()close filelonggetDuration()Get duration or time (milliseconds) of the media filelonggetLength()Get the stream length in bytesStringgetMediaExtension()Get media extensionjava.util.ListgetMetadata()Get a collection of metadata packets in ByteBuffers for this file.StringgetPath()Get abstract path to the media itemIMediaReaderStreamPositiongetStreamPosition()Get a reference to the current stream positionvoidinit(IApplicationInstance appInstance, IMediaStream stream, String mediaReadType, String basePath, String mediaName)Initialize mediaReaderbooleanisOpen()is file openvoidopen(String basePath, String name)Open the file for readingvoidrewind()rewind file to startcom.wowza.wms.stream.PlaylistSeekResultseek(long timecode, int seektype)seek to timecode in fileintsendZeroLengthPacket(int type, int timecode, boolean isAbsolute, IMediaStream stream, java.io.OutputStream out, AMFObj wmsObj, com.wowza.wms.stream.file.PlaylistCursor flvCursor, com.wowza.wms.stream.file.PlaylistWriteControl control, com.wowza.wms.stream.file.PlaylistReaderWriteResults results, long[] sizes, boolean isForceTCZero)voidsetMediaReaderItem(com.wowza.wms.stream.MediaReaderItem mediaReaderItem)Set the mediaReader item definitionvoidsetProperties(WMSProperties properties)Set the properties for this media readervoidsetStreamPosition(IMediaReaderStreamPosition pos)Set the file position within the media filevoidstartPlayback()Called each time the player being playback (before the buffer it filled)intwriteGeneratedKeyFrame(IMediaStream stream, java.io.OutputStream out, AMFObj wmsObjAudio, AMFObj wmsObjVideo, AMFObj wmsObjData, com.wowza.wms.stream.file.PlaylistCursor flvCursor, com.wowza.wms.stream.file.PlaylistWriteControl control, com.wowza.wms.stream.file.PlaylistReaderWriteResults results, long[] sizes, com.wowza.wms.stream.FastPlaySettings fastPlaySettings, boolean isForceTCZero)From current location in file generate a key frame (enhanced seek) and write it to outintwritePackets(IMediaStream stream, java.io.OutputStream out, AMFObj wmsObjAudio, AMFObj wmsObjVideo, AMFObj wmsObjData, com.wowza.wms.stream.file.PlaylistCursor flvCursor, com.wowza.wms.stream.file.PlaylistWriteControl control, com.wowza.wms.stream.file.PlaylistReaderWriteResults results, long[] sizes, com.wowza.wms.stream.FastPlaySettings fastPlaySettings, boolean isForceTCZero)From current location in file write packets to outputintwritePackets(java.util.List<AMFPacket> packetList, com.wowza.wms.stream.file.PlaylistCursor flvCursor, com.wowza.wms.stream.file.PlaylistWriteControl control, com.wowza.wms.stream.file.PlaylistReaderWriteResults results, long[] sizes, com.wowza.wms.stream.FastPlaySettings fastPlaySettings)Write packets to the packetList as AMFPackets
 
- 
- 
- 
Field Detail- 
CONTENTTYPE_MEDIAstatic final int CONTENTTYPE_MEDIA - See Also:
- Constant Field Values
 
 - 
CONTENTTYPE_MEDIALISTstatic final int CONTENTTYPE_MEDIALIST - See Also:
- Constant Field Values
 
 - 
DEFAULT_RANDOMACCESSREADERstatic final String DEFAULT_RANDOMACCESSREADER - See Also:
- Constant Field Values
 
 - 
DEFAULT_RANDOMACCESSREADEROPTIMIZERstatic final String DEFAULT_RANDOMACCESSREADEROPTIMIZER - See Also:
- Constant Field Values
 
 - 
SEEKTARGET_VIDEOKEYFRAMEstatic final int SEEKTARGET_VIDEOKEYFRAME - See Also:
- Constant Field Values
 
 - 
SEEKTARGET_AUDIOstatic final int SEEKTARGET_AUDIO - See Also:
- Constant Field Values
 
 - 
SEEKTARGET_ENHANCEDstatic final int SEEKTARGET_ENHANCED - See Also:
- Constant Field Values
 
 - 
PLAYEVENT_STARTPLAYBACKstatic final int PLAYEVENT_STARTPLAYBACK - See Also:
- Constant Field Values
 
 - 
PLAYEVENT_BEFOREMETADATAstatic final int PLAYEVENT_BEFOREMETADATA - See Also:
- Constant Field Values
 
 - 
PLAYEVENT_AFTERMETADATAstatic final int PLAYEVENT_AFTERMETADATA - See Also:
- Constant Field Values
 
 - 
PLAYEVENT_BEFOREBUFFERFILLstatic final int PLAYEVENT_BEFOREBUFFERFILL - See Also:
- Constant Field Values
 
 - 
PLAYEVENT_AFTERBUFFERFILLstatic final int PLAYEVENT_AFTERBUFFERFILL - See Also:
- Constant Field Values
 
 - 
SEEK_KEYUPstatic final int SEEK_KEYUP Seek direction: up to closets key frame- See Also:
- Constant Field Values
 
 - 
SEEK_KEYDOWNstatic final int SEEK_KEYDOWN Seek direction: down to closets key frame- See Also:
- Constant Field Values
 
 - 
SEEK_KEYCLOSEstatic final int SEEK_KEYCLOSE Seek direction: closest key frame- See Also:
- Constant Field Values
 
 - 
SEEK_EXACTstatic final int SEEK_EXACT Seek direction: closest frame (audio, video) (key, no-key)- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
initvoid init(IApplicationInstance appInstance, IMediaStream stream, String mediaReadType, String basePath, String mediaName) Initialize mediaReader- Parameters:
- stream- parent stream
- mediaReadType- media reader type id. Example: flv
- basePath- Base path for application instance
- mediaName- name of the media item
 
 - 
setMediaReaderItemvoid setMediaReaderItem(com.wowza.wms.stream.MediaReaderItem mediaReaderItem) Set the mediaReader item definition- Parameters:
- mediaReaderItem-
 
 - 
openvoid open(String basePath, String name)Open the file for reading- Parameters:
- basePath- base path to file
- name- file name without extension
 
 - 
getMetadatajava.util.List getMetadata() Get a collection of metadata packets in ByteBuffers for this file. You can use 'new AMFDataList(data)' to convert to AMF objects.- Returns:
- collection of metadata packets in ByteBuffers
 
 - 
rewindvoid rewind() rewind file to start
 - 
closevoid close() close file
 - 
isOpenboolean isOpen() is file open- Returns:
- is file open
 
 - 
seekcom.wowza.wms.stream.PlaylistSeekResult seek(long timecode, int seektype)seek to timecode in file- Parameters:
- timecode- timecode (milliseconds) to seek to
- seektype- seek type IMediaReader.SEEK_*
- Returns:
- detailed results object of seek or null if failure
 
 - 
writePacketsint writePackets(IMediaStream stream, java.io.OutputStream out, AMFObj wmsObjAudio, AMFObj wmsObjVideo, AMFObj wmsObjData, com.wowza.wms.stream.file.PlaylistCursor flvCursor, com.wowza.wms.stream.file.PlaylistWriteControl control, com.wowza.wms.stream.file.PlaylistReaderWriteResults results, long[] sizes, com.wowza.wms.stream.FastPlaySettings fastPlaySettings, boolean isForceTCZero) From current location in file write packets to output- Parameters:
- stream- parent mediaStream
- out- output stream
- wmsObjAudio- audio channel amfObj
- wmsObjVideo- video channel amfObj
- wmsObjData- data channel amfObj
- flvCursor- current cursor that keeps track of timecodes and flags indicating position in media file
- control- write control flags. Mainly used to control when it should stop writing
- results- write results returned from this routine
- sizes- array of values that keep track of number of bytes written and number of packets for each data type (audio, video, data). See IMediaStreamPlay.PLAYSIZES_*
- fastPlaySettings- current fastPlay settings for the stream
- isForceTCZero- are we forcing all timecodes to zero
- Returns:
- number of bytes written
 
 - 
writePacketsint writePackets(java.util.List<AMFPacket> packetList, com.wowza.wms.stream.file.PlaylistCursor flvCursor, com.wowza.wms.stream.file.PlaylistWriteControl control, com.wowza.wms.stream.file.PlaylistReaderWriteResults results, long[] sizes, com.wowza.wms.stream.FastPlaySettings fastPlaySettings) Write packets to the packetList as AMFPackets- Parameters:
- packetList- list to which to write packets
- flvCursor- current cursor that keeps track of timecodes and flags indicating position in media file
- control- write control flags. Mainly used to control when it should stop writing
- results- write results returned from this routine
- sizes- array of values that keep track of number of bytes written and number of packets for each data type (audio, video, data). See IMediaStreamPlay.PLAYSIZES_*
- fastPlaySettings- current fastPlay settings for the stream
- Returns:
- number of bytes written
 
 - 
writeGeneratedKeyFrameint writeGeneratedKeyFrame(IMediaStream stream, java.io.OutputStream out, AMFObj wmsObjAudio, AMFObj wmsObjVideo, AMFObj wmsObjData, com.wowza.wms.stream.file.PlaylistCursor flvCursor, com.wowza.wms.stream.file.PlaylistWriteControl control, com.wowza.wms.stream.file.PlaylistReaderWriteResults results, long[] sizes, com.wowza.wms.stream.FastPlaySettings fastPlaySettings, boolean isForceTCZero) From current location in file generate a key frame (enhanced seek) and write it to out- Parameters:
- stream- parent mediaStream
- out- output stream
- wmsObjAudio- audio channel amfObj
- wmsObjVideo- video channel amfObj
- wmsObjData- data channel amfObj
- flvCursor- current cursor that keeps track of timecodes and flags indicating position in media file
- control- write control flags. Mainly used to control when it should stop writing
- results- write results returned from this routine
- sizes- array of values that keep track of number of bytes written and number of packets for each data type (audio, video, data). See IMediaStreamPlay.PLAYSIZES_*
- fastPlaySettings- current fastPlay settings for the stream
- isForceTCZero- are we forcing all timecodes to zero
- Returns:
- number of bytes written
 
 - 
sendZeroLengthPacketint sendZeroLengthPacket(int type, int timecode, boolean isAbsolute, IMediaStream stream, java.io.OutputStream out, AMFObj wmsObj, com.wowza.wms.stream.file.PlaylistCursor flvCursor, com.wowza.wms.stream.file.PlaylistWriteControl control, com.wowza.wms.stream.file.PlaylistReaderWriteResults results, long[] sizes, boolean isForceTCZero)
 - 
startPlaybackvoid startPlayback() Called each time the player being playback (before the buffer it filled)
 - 
getDurationlong getDuration() Get duration or time (milliseconds) of the media file- Returns:
- duration or time (milliseconds) of the media file
 
 - 
getLengthlong getLength() Get the stream length in bytes- Returns:
- stream length in bytes
 
 - 
getPathString getPath() Get abstract path to the media item- Returns:
- abstract path to the media item
 
 - 
getMediaExtensionString getMediaExtension() Get media extension- Returns:
- media extension
 
 - 
getStreamPositionIMediaReaderStreamPosition getStreamPosition() Get a reference to the current stream position- Returns:
- stream position
 
 - 
setStreamPositionvoid setStreamPosition(IMediaReaderStreamPosition pos) Set the file position within the media file- Parameters:
- pos- stream position
 
 - 
setPropertiesvoid setProperties(WMSProperties properties) Set the properties for this media reader- Parameters:
- properties- properties
 
 
- 
 
-