|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.red5.server.stream.AbstractStream
org.red5.server.stream.ServerStream
public class ServerStream
An implementation for server side stream.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.red5.server.stream.AbstractStream |
|---|
AbstractStream.State |
| Field Summary | |
|---|---|
protected IPlaylistController |
controller
Actual playlist controller |
protected IPlayItem |
currentItem
Current item |
protected IPlaylistController |
defaultController
Default playlist controller |
protected List<IPlayItem> |
items
List of items in this playlist |
protected String |
publishedName
Stream published name |
protected String |
recordingFilename
The filename we are recording to. |
| Fields inherited from class org.red5.server.stream.AbstractStream |
|---|
creationTime, state |
| Fields inherited from interface org.red5.server.messaging.IPushableConsumer |
|---|
KEY |
| Constructor Summary | |
|---|---|
ServerStream()
Constructs a new ServerStream. |
|
| Method Summary | |
|---|---|
void |
addItem(IPlayItem item)
Add an item to the list. |
void |
addItem(IPlayItem item,
int index)
Add an item to specific index. |
void |
addStreamListener(IStreamListener listener)
Add a listener to be notified about received packets. |
void |
close()
Close this stream. |
IPlayItem |
getCurrentItem()
Get currently playing item |
int |
getCurrentItemIndex()
Get currently playing item index. |
IPlayItem |
getItem(int index)
Get the item according to the index. |
int |
getItemSize()
Return number of items in list |
protected RTMPMessage |
getNextRTMPMessage()
Getter for next RTMP message. |
IProvider |
getProvider()
Get the provider corresponding to this stream. |
String |
getPublishedName()
Get stream publish name. |
String |
getSaveFilename()
Get the filename the stream is being saved as. |
Collection<IStreamListener> |
getStreamListeners()
Return registered stream listeners. |
boolean |
hasMoreItems()
Check if the playlist has more items after the currently playing one. |
boolean |
isRandom()
Whether items are randomly played. |
boolean |
isRepeat()
Whether repeat playing an item. |
boolean |
isRewind()
Whether rewind the list. |
protected void |
moveToNext()
Move to the next item updating the currentItemIndex. |
protected void |
moveToPrevious()
Move to the previous item updating the currentItemIndex. |
void |
nextItem()
Go for next item decided by controller logic. |
protected void |
notifyBroadcastClose()
Notifies handler on stream broadcast stop |
protected void |
notifyBroadcastStart()
Notifies handler on stream broadcast start |
protected void |
onItemEnd()
Play next item on item end |
void |
onOOBControlMessage(IMessageComponent source,
IPipe pipe,
OOBControlMessage oobCtrlMsg)
|
void |
onPipeConnectionEvent(PipeConnectionEvent event)
Pipe connection event handler. |
void |
pause()
Toggles the paused state. |
protected void |
play(IPlayItem item)
Play a specific IPlayItem. |
void |
previousItem()
Go for the previous played item. |
void |
pushMessage(IPipe pipe,
IMessage message)
Pushes message through pipe |
void |
removeAllItems()
Remove all items. |
void |
removeItem(int index)
Remove an item from list. |
void |
removeStreamListener(IStreamListener listener)
Remove a listener from being notified about received packets. |
void |
saveAs(String name,
boolean isAppend)
Save the broadcast stream as a file. |
protected void |
scheduleNextMessage()
Pull the next message from IMessageInput and schedule it for push according to the timestamp. |
void |
seek(int position)
Seek to a given position in the stream. |
void |
setItem(int index)
Set the current item for playing. |
void |
setPlaylistController(IPlaylistController controller)
Set list controller. |
void |
setPublishedName(String name)
|
void |
setRandom(boolean random)
Set whether items should be randomly played. |
void |
setRepeat(boolean repeat)
Set whether repeat playing an item. |
void |
setRewind(boolean rewind)
Set whether rewind the list. |
void |
start()
Start this server-side stream |
protected void |
startBroadcastVOD()
Begin VOD broadcasting |
void |
stop()
Stop this server-side stream |
| Methods inherited from class org.red5.server.stream.AbstractStream |
|---|
getCodecInfo, getCreationTime, getName, getScope, getStreamAwareHandler, setCodecInfo, setName, setScope |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.red5.server.api.stream.IStream |
|---|
getCodecInfo, getCreationTime, getName, getScope |
| Field Detail |
|---|
protected String publishedName
protected IPlaylistController controller
protected IPlaylistController defaultController
protected List<IPlayItem> items
protected IPlayItem currentItem
protected String recordingFilename
| Constructor Detail |
|---|
public ServerStream()
| Method Detail |
|---|
public void addItem(IPlayItem item)
addItem in interface IPlaylistitem - Playlist item
public void addItem(IPlayItem item,
int index)
addItem in interface IPlaylistitem - Playlist itemindex - Index in listpublic void removeItem(int index)
removeItem in interface IPlaylistindex - Index in listpublic void removeAllItems()
removeAllItems in interface IPlaylistpublic int getItemSize()
getItemSize in interface IPlaylistpublic int getCurrentItemIndex()
getCurrentItemIndex in interface IPlaylistpublic IPlayItem getCurrentItem()
getCurrentItem in interface IPlaylistpublic IPlayItem getItem(int index)
getItem in interface IPlaylistindex - Item index
public void previousItem()
previousItem in interface IPlaylistpublic boolean hasMoreItems()
hasMoreItems in interface IPlaylisttrue if more items are available, false otherwisepublic void nextItem()
nextItem in interface IPlaylistpublic void setItem(int index)
setItem in interface IPlaylistindex - Position in listpublic boolean isRandom()
isRandom in interface IPlaylisttrue if shuffle is on for this list, false otherwisepublic void setRandom(boolean random)
setRandom in interface IPlaylistrandom - Shuffle flagpublic boolean isRewind()
isRewind in interface IPlaylisttrue if playlist is rewind on end, false otherwisepublic void setRewind(boolean rewind)
setRewind in interface IPlaylistrewind - New vallue for rewind flagpublic boolean isRepeat()
isRepeat in interface IPlaylisttrue if repeat mode is on for this playlist, false otherwisepublic void setRepeat(boolean repeat)
setRepeat in interface IPlaylistrepeat - New value for item playback repeat flagpublic void setPlaylistController(IPlaylistController controller)
setPlaylistController in interface IPlaylistcontroller - Playlist controller
public void saveAs(String name,
boolean isAppend)
throws IOException,
ResourceNotFoundException,
ResourceExistException
saveAs in interface IBroadcastStreamname - The path of the file relative to the scope.isAppend - Whether to append to the end of file.
IOException - File could not be created/written to.
ResourceNotFoundException - Resource not exist when trying to append.
ResourceExistException - Resource exist when trying to create.public String getSaveFilename()
getSaveFilename in interface IBroadcastStreamnull
if the stream is not being saved.public IProvider getProvider()
getProvider in interface IBroadcastStreampublic String getPublishedName()
NetStream.publish on client side in
SWF.
getPublishedName in interface IBroadcastStreampublic void setPublishedName(String name)
setPublishedName in interface IBroadcastStreamname - Set stream publish namepublic void start()
start in interface IStreampublic void stop()
stop in interface IStreampublic void pause()
pause in interface IServerStreampublic void seek(int position)
seek in interface IServerStreamposition - new playback position in millisecondspublic void close()
close in interface IStream
public void onOOBControlMessage(IMessageComponent source,
IPipe pipe,
OOBControlMessage oobCtrlMsg)
onOOBControlMessage in interface IMessageComponentsource - Message component sourcepipe - Connection pipe
TODOoobCtrlMsg - Out-of-band control message
public void pushMessage(IPipe pipe,
IMessage message)
throws IOException
pushMessage in interface IPushableConsumerpipe - Pipemessage - Message
IOException - if message could not be writtenpublic void onPipeConnectionEvent(PipeConnectionEvent event)
onPipeConnectionEvent in interface IPipeConnectionListenerevent - Pipe connection event contextprotected void play(IPlayItem item)
item - Item to playprotected void onItemEnd()
protected void startBroadcastVOD()
protected void notifyBroadcastClose()
protected void notifyBroadcastStart()
protected void scheduleNextMessage()
protected RTMPMessage getNextRTMPMessage()
protected void moveToNext()
protected void moveToPrevious()
public void addStreamListener(IStreamListener listener)
IBroadcastStream
addStreamListener in interface IBroadcastStreamlistener - the listener to addpublic Collection<IStreamListener> getStreamListeners()
IBroadcastStream
getStreamListeners in interface IBroadcastStreampublic void removeStreamListener(IStreamListener listener)
IBroadcastStream
removeStreamListener in interface IBroadcastStreamlistener - the listener to remove
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||