public class MediaStreamMap
extends Object
MediaStreamMap: collection of IMediaStream object. This collection is usually attached to an IApplicationInstance object.
| Modifier and Type | Field | Description |
|---|---|---|
protected IApplicationInstance |
appInstance |
|
boolean |
debugDVRShutdown |
|
protected java.util.Map<String,ILiveStreamDvrRecorder> |
dvrRecorders |
|
protected java.util.Map<String,ILiveStreamPacketizer> |
liveStreamPacketizers |
|
static int |
MAXSTREAMINDEX |
|
protected java.util.List<IMediaStreamNotify> |
mediaStreamListeners |
|
protected java.util.Map<String,com.wowza.wms.stream.MediaStreamMap.NameGroupHolder> |
nameGroupDelayRemoveMap |
|
protected long |
nameGroupId |
|
protected int |
nameGroupRemoveDelayTime |
|
protected java.util.List<com.wowza.wms.stream.MediaStreamMapGroup> |
nameGroups |
|
protected java.util.concurrent.atomic.AtomicLong |
nextStreamId |
|
protected java.util.Map<ILiveStreamPacketizer,java.util.Map<Integer,com.wowza.wms.client.LicenseHolder>> |
packetizerLicenses |
|
protected java.util.Map<Long,java.util.Map<Integer,com.wowza.wms.client.LicenseHolder>> |
streamLicenses |
|
protected edu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock |
streamLock |
|
protected java.util.Map<String,IMediaStream> |
streamNames |
|
protected edu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock |
streamNamesLock |
|
protected java.util.Map<String,java.util.Set<com.wowza.wms.stream.MediaStreamMapGroup>> |
streamNameToGroup |
|
protected java.util.Map<Long,IMediaStream> |
streams |
| Constructor | Description |
|---|---|
MediaStreamMap(IApplicationInstance appInstance) |
Create empty MediaStreamMap collection
|
| Modifier and Type | Method | Description |
|---|---|---|
com.wowza.wms.client.LicenseHolder |
addLicense(IMediaStream stream,
int licenseType) |
|
com.wowza.wms.client.LicenseHolder |
addLicense(ILiveStreamPacketizer liveStreamPacketizer,
int licenseType) |
|
void |
addMediaStreamListener(IMediaStreamNotify mediaStreamListener) |
Add a media stream listener.
|
com.wowza.wms.stream.MediaStreamMapGroup |
addNameGroup(com.wowza.wms.stream.MediaStreamMapGroup newGroup) |
|
void |
broadcasePlayMessage(IMediaStream stream,
long timecode,
java.nio.ByteBuffer msg,
int objectEncoding) |
Send a broadcast message to all play stream that are listening to this
live published stream.
|
int |
broadcastGetObjectEncoding(IMediaStream stream) |
Get the minimum object encoding level for the clients playing this stream.
|
void |
clearStreamName(String name) |
Unregister a published live media stream name.
|
void |
clearStreamName(String name,
IMediaStream stream) |
Unregister a published live media stream name.
|
void |
doWatchdog() |
|
IApplicationInstance |
getAppInstance() |
Get the parent applicationInstance.
|
String |
getAppInstanceName() |
Get the name of the parent applicationInstance.
|
String |
getAppName() |
Get the name of the parent application.
|
int |
getCount() |
Get the total number of streams stored in the mediaStreamMap
|
ILiveStreamDvrRecorder |
getDvrRecorder(String streamName,
String recorderName,
boolean doCreate) |
Get a DVR recorder by name and recorder name
|
java.util.List<ILiveStreamDvrRecorder> |
getDvrRecorders() |
Returns a list of ILiveStreamDvrRecorder objects
|
ILiveStreamPacketizer |
getLiveStreamPacketizer(String streamName,
String packetizerName,
boolean doCreate) |
Get a live stream packetizer by name and packetizer id
|
Object |
getLiveStreamPacketizerLock() |
Get the lock to the live stream packetizer system
|
com.wowza.wms.stream.MediaStreamMapGroup |
getNameGroupByGroupName(String groupName) |
|
int |
getNameGroupRemoveDelayTime() |
|
java.util.Set<com.wowza.wms.stream.MediaStreamMapGroup> |
getNameGroups() |
|
java.util.Set<com.wowza.wms.stream.MediaStreamMapGroup> |
getNameGroups(String streamName) |
|
java.util.Set<String> |
getNameGroupStreamNames(String streamName) |
|
long |
getNextNameGroupId(com.wowza.wms.stream.MediaStreamMapGroup newGroup) |
|
int |
getNextStreamIndex() |
Reserve a clientless stream id for a new media stream.
|
int |
getNextStreamIndex(IClient client) |
Reserve a stream for a client connection.
|
int |
getNextStreamIndex(INetConnection netConnection) |
Reserve a stream for a netConnection connection.
|
java.util.List<String> |
getPublishStreamNames() |
Returns a List of published stream names
|
IMediaStream |
getStream(IClient client,
int index) |
Get a media stream reference by stream id.
|
IMediaStream |
getStream(IClient client,
int index,
boolean doCreate) |
Get a media stream reference by stream id.
|
IMediaStream |
getStream(INetConnection netConnection,
int index) |
Get a media stream object that is owned by a server to server
netConnection object (not yet implemented).
|
IMediaStream |
getStream(INetConnection netConnection,
int index,
boolean doCreate) |
Get a media stream reference by stream id.
|
IMediaStream |
getStream(String name) |
Get a media stream by stream name.
|
IMediaStream |
getStreamClientless(int index,
String streamTypeStr) |
Get a media stream reference by stream id.
|
edu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock |
getStreamListLock() |
Get the underlying read/write lock associated with the list of streams
|
edu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock |
getStreamNameLock() |
Get the underlying read/write lock associated with the stream names list
|
java.util.List<IMediaStream> |
getStreams() |
Returns a list of IMediaStream objects
|
IVHost |
getVHost() |
Get the parent vHost.
|
void |
notifyMediaStreamCreate(IMediaStream mediaStream) |
Notify all media stream listeners that a new media stream object has been created.
|
void |
notifyMediaStreamDestroy(IMediaStream mediaStream) |
Notify all media stream listeners that a media stream object is being destroyed.
|
void |
notifyPlayPublish(IMediaStream stream) |
Notify all play streams that are listening to this stream
that the stream is going into a state of publish (NetStream.Play.PublishNotify).
|
void |
notifyPlayUnpublish(IMediaStream stream) |
Notify all play streams that are listening to this stream
that the stream is going into a state of unpublished (NetStream.Play.UnpublishNotify).
|
void |
notifyPlayUnpublish(String streamName) |
Notify all play streams that are listening to this stream name
that the stream is going into a state of unpublished (NetStream.Play.UnpublishNotify).
|
void |
removeDvrRecorder(String streamName) |
|
ILiveStreamDvrRecorder |
removeDvrRecorder(String streamName,
String recorderName) |
Remove DVR Recorder
|
void |
removeLiveStreamPacketizer(String streamName) |
Remove all live stream packetizers for this stream name
|
ILiveStreamPacketizer |
removeLiveStreamPacketizer(String streamName,
String packetizerName) |
Remove live stream packetizer
|
void |
removeMediaStreamListener(IMediaStreamNotify mediaStreamListener) |
Remove a media stream listener.
|
com.wowza.wms.stream.MediaStreamMapGroup |
removeNameGroup(int groupId) |
|
com.wowza.wms.stream.MediaStreamMapGroup |
removeNameGroup(com.wowza.wms.stream.MediaStreamMapGroup nameGroup) |
|
void |
removeStream(int index) |
Remove a clientless media stream
|
void |
removeStream(IClient client,
int index) |
Remove a stream associated with a client connection
|
void |
removeStream(INetConnection netConnection,
int index) |
Remove a stream associated with a netConnection object
|
void |
setNameGroupRemoveDelayTime(int nameGroupRemoveDelayTime) |
|
void |
setStreamName(IMediaStream stream,
String name) |
Insert live media stream into the mediaStreamMap by name.
|
long |
streamToIndex(IMediaStream stream) |
Get the unique stream identifier for a given stream
|
protected IApplicationInstance appInstance
public boolean debugDVRShutdown
protected java.util.Map<String,ILiveStreamDvrRecorder> dvrRecorders
protected java.util.Map<String,ILiveStreamPacketizer> liveStreamPacketizers
public static final int MAXSTREAMINDEX
protected java.util.List<IMediaStreamNotify> mediaStreamListeners
protected java.util.Map<String,com.wowza.wms.stream.MediaStreamMap.NameGroupHolder> nameGroupDelayRemoveMap
protected long nameGroupId
protected int nameGroupRemoveDelayTime
protected java.util.List<com.wowza.wms.stream.MediaStreamMapGroup> nameGroups
protected java.util.concurrent.atomic.AtomicLong nextStreamId
protected java.util.Map<ILiveStreamPacketizer,java.util.Map<Integer,com.wowza.wms.client.LicenseHolder>> packetizerLicenses
protected java.util.Map<Long,java.util.Map<Integer,com.wowza.wms.client.LicenseHolder>> streamLicenses
protected edu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock streamLock
protected java.util.Map<String,IMediaStream> streamNames
protected edu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock streamNamesLock
protected java.util.Map<String,java.util.Set<com.wowza.wms.stream.MediaStreamMapGroup>> streamNameToGroup
protected java.util.Map<Long,IMediaStream> streams
public MediaStreamMap(IApplicationInstance appInstance)
appInstance - parent applicationInstancepublic com.wowza.wms.client.LicenseHolder addLicense(IMediaStream stream, int licenseType)
public com.wowza.wms.client.LicenseHolder addLicense(ILiveStreamPacketizer liveStreamPacketizer, int licenseType)
public void addMediaStreamListener(IMediaStreamNotify mediaStreamListener)
mediaStreamListener - media stream listenerpublic com.wowza.wms.stream.MediaStreamMapGroup addNameGroup(com.wowza.wms.stream.MediaStreamMapGroup newGroup)
public void broadcasePlayMessage(IMediaStream stream, long timecode, java.nio.ByteBuffer msg, int objectEncoding)
stream - media streamtimecode - timecode (milliseconds)msg - byte[] of data that will be deserialized as an AMFData object.objectEncoding - object encoding (AMF0 or AMF3)public int broadcastGetObjectEncoding(IMediaStream stream)
stream - publish streampublic void clearStreamName(String name)
name - stream namepublic void clearStreamName(String name,
IMediaStream stream)
name - stream namestream - streampublic void doWatchdog()
public IApplicationInstance getAppInstance()
public String getAppInstanceName()
public String getAppName()
public int getCount()
public ILiveStreamDvrRecorder getDvrRecorder(String streamName, String recorderName, boolean doCreate)
streamName - stream namerecorderName - packetizer iddoCreate - create if does not existpublic java.util.List<ILiveStreamDvrRecorder> getDvrRecorders()
public ILiveStreamPacketizer getLiveStreamPacketizer(String streamName, String packetizerName, boolean doCreate)
streamName - stream namepacketizerName - packetizer iddoCreate - create if does not existpublic Object getLiveStreamPacketizerLock()
public com.wowza.wms.stream.MediaStreamMapGroup getNameGroupByGroupName(String groupName)
public int getNameGroupRemoveDelayTime()
public java.util.Set<com.wowza.wms.stream.MediaStreamMapGroup> getNameGroups()
public java.util.Set<com.wowza.wms.stream.MediaStreamMapGroup> getNameGroups(String streamName)
public java.util.Set<String> getNameGroupStreamNames(String streamName)
public long getNextNameGroupId(com.wowza.wms.stream.MediaStreamMapGroup newGroup)
public int getNextStreamIndex()
public int getNextStreamIndex(IClient client)
getStream(IClient, int, boolean) to create stream.client - parent clientpublic int getNextStreamIndex(INetConnection netConnection)
getStream(INetConnection, int, boolean) to create stream.netConnection - public java.util.List<String> getPublishStreamNames()
public IMediaStream getStream(IClient client, int index)
client - clientindex - stream idpublic IMediaStream getStream(IClient client, int index, boolean doCreate)
getNextStreamIndex(IClient).client - clientindex - stream iddoCreate - true to create if it does not existpublic IMediaStream getStream(INetConnection netConnection, int index)
netConnection - netConnection to remote serverindex - stream idpublic IMediaStream getStream(INetConnection netConnection, int index, boolean doCreate)
getNextStreamIndex(INetConnection) .netConnection - netConnection to remote serverindex - stream iddoCreate - true to create if it does not existpublic IMediaStream getStream(String name)
name - stream namepublic IMediaStream getStreamClientless(int index, String streamTypeStr)
getNextStreamIndex() .index - stream idstreamTypeStr - stream typepublic edu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock getStreamListLock()
public edu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock getStreamNameLock()
public java.util.List<IMediaStream> getStreams()
public IVHost getVHost()
public void notifyMediaStreamCreate(IMediaStream mediaStream)
mediaStream - new media stream objectpublic void notifyMediaStreamDestroy(IMediaStream mediaStream)
mediaStream - media stream object being destroyedpublic void notifyPlayPublish(IMediaStream stream)
stream - live published stream that is being publishedpublic void notifyPlayUnpublish(IMediaStream stream)
stream - live published stream that is being unpublishedpublic void notifyPlayUnpublish(String streamName)
streamName - live published stream that is being unpublishedpublic void removeDvrRecorder(String streamName)
public ILiveStreamDvrRecorder removeDvrRecorder(String streamName, String recorderName)
streamName - stream namerecorderName - recorder namepublic void removeLiveStreamPacketizer(String streamName)
streamName - streamNamepublic ILiveStreamPacketizer removeLiveStreamPacketizer(String streamName, String packetizerName)
streamName - stream namepacketizerName - packetizer idpublic void removeMediaStreamListener(IMediaStreamNotify mediaStreamListener)
mediaStreamListener - media stream listenerpublic com.wowza.wms.stream.MediaStreamMapGroup removeNameGroup(int groupId)
public com.wowza.wms.stream.MediaStreamMapGroup removeNameGroup(com.wowza.wms.stream.MediaStreamMapGroup nameGroup)
public void removeStream(int index)
index - stream indexpublic void removeStream(IClient client, int index)
client - clientindex - stream indexpublic void removeStream(INetConnection netConnection, int index)
netConnection - net connectionindex - stream indexpublic void setNameGroupRemoveDelayTime(int nameGroupRemoveDelayTime)
public void setStreamName(IMediaStream stream, String name)
stream - mediea stream objectname - media stream namepublic long streamToIndex(IMediaStream stream)
stream - stream