public abstract class BaseRTMPHandler extends Object implements IRTMPHandler, Constants, StatusCodes, org.springframework.context.ApplicationContextAware
HANDSHAKE_SIZE, HEADER_CONTINUE, HEADER_NEW, HEADER_SAME_SOURCE, HEADER_TIMER_CHANGE, MEDIUM_INT_MAX, SO_CLIENT_CLEAR_DATA, SO_CLIENT_DELETE_DATA, SO_CLIENT_INITIAL_DATA, SO_CLIENT_SEND_MESSAGE, SO_CLIENT_STATUS, SO_CLIENT_UPDATE_ATTRIBUTE, SO_CLIENT_UPDATE_DATA, SO_CONNECT, SO_DELETE_ATTRIBUTE, SO_DISCONNECT, SO_SEND_MESSAGE, SO_SET_ATTRIBUTE, SOURCE_TYPE_LIVE, SOURCE_TYPE_VOD, TYPE_ABORT, TYPE_AGGREGATE, TYPE_AUDIO_DATA, TYPE_BYTES_READ, TYPE_CHUNK_SIZE, TYPE_CLIENT_BANDWIDTH, TYPE_EDGE_ORIGIN, TYPE_FLEX_MESSAGE, TYPE_FLEX_SHARED_OBJECT, TYPE_FLEX_STREAM_SEND, TYPE_INVOKE, TYPE_NOTIFY, TYPE_PING, TYPE_SERVER_BANDWIDTH, TYPE_SHARED_OBJECT, TYPE_STREAM_METADATA, TYPE_VIDEO_DATA
APP_GC, APP_RESOURCE_LOWMEMORY, APP_SCRIPT_ERROR, APP_SCRIPT_WARNING, APP_SHUTDOWN, NC_CALL_BADVERSION, NC_CALL_FAILED, NC_CONNECT_APPSHUTDOWN, NC_CONNECT_CLOSED, NC_CONNECT_FAILED, NC_CONNECT_INVALID_APPLICATION, NC_CONNECT_REJECTED, NC_CONNECT_SUCCESS, NS_BUFFER_EMPTY, NS_CLEAR_FAILED, NS_CLEAR_SUCCESS, NS_DATA_START, NS_FAILED, NS_INVALID_ARGUMENT, NS_PAUSE_NOTIFY, NS_PLAY_COMPLETE, NS_PLAY_FAILED, NS_PLAY_FILE_STRUCTURE_INVALID, NS_PLAY_INSUFFICIENT_BW, NS_PLAY_NO_SUPPORTED_TRACK_FOUND, NS_PLAY_PUBLISHNOTIFY, NS_PLAY_RESET, NS_PLAY_START, NS_PLAY_STOP, NS_PLAY_STREAMNOTFOUND, NS_PLAY_SWITCH, NS_PLAY_TRANSITION, NS_PLAY_TRANSITION_COMPLETE, NS_PLAY_UNPUBLISHNOTIFY, NS_PUBLISH_BADNAME, NS_PUBLISH_START, NS_RECORD_FAILED, NS_RECORD_NOACCESS, NS_RECORD_START, NS_RECORD_STOP, NS_SEEK_FAILED, NS_SEEK_NOTIFY, NS_TRANSITION_FORCED, NS_TRANSITION_SUCCESS, NS_UNPAUSE_NOTIFY, NS_UNPUBLISHED_SUCCESS, SO_CREATION_FAILED, SO_NO_READ_ACCESS, SO_NO_WRITE_ACCESS, SO_PERSISTENCE_MISMATCH
Constructor and Description |
---|
BaseRTMPHandler() |
Modifier and Type | Method and Description |
---|---|
void |
connectionClosed(RTMPConnection conn,
RTMP state)
Connection closed
|
void |
connectionOpened(RTMPConnection conn,
RTMP state)
Connection open event
|
protected String |
getHostname(String url)
Return hostname for URL.
|
static int |
getStreamId()
Getter for stream ID.
|
protected void |
handlePendingCallResult(RTMPConnection conn,
Notify invoke)
Handler for pending call result.
|
void |
messageReceived(Object in,
IoSession session)
Message received
|
void |
messageSent(RTMPConnection conn,
Object message)
Message sent
|
protected abstract void |
onChunkSize(RTMPConnection conn,
Channel channel,
Header source,
ChunkSize chunkSize)
Chunk size change event handler.
|
protected abstract void |
onInvoke(RTMPConnection conn,
Channel channel,
Header source,
Notify invoke,
RTMP rtmp)
Invocation event handler.
|
protected abstract void |
onPing(RTMPConnection conn,
Channel channel,
Header source,
Ping ping)
Ping event handler.
|
protected abstract void |
onSharedObject(RTMPConnection conn,
Channel channel,
Header source,
SharedObjectMessage object)
Shared object event handler.
|
protected void |
onStreamBytesRead(RTMPConnection conn,
Channel channel,
Header source,
BytesRead streamBytesRead)
Stream bytes read event handler.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext appCtx) |
public static int getStreamId()
public void setApplicationContext(org.springframework.context.ApplicationContext appCtx) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void connectionOpened(RTMPConnection conn, RTMP state)
connectionOpened
in interface IRTMPHandler
conn
- Connectionstate
- RTMP statepublic void messageReceived(Object in, IoSession session) throws Exception
messageReceived
in interface IRTMPHandler
in
- Messagesession
- Connected sessionException
- Exceptionpublic void messageSent(RTMPConnection conn, Object message)
messageSent
in interface IRTMPHandler
conn
- Connectionmessage
- Messagepublic void connectionClosed(RTMPConnection conn, RTMP state)
connectionClosed
in interface IRTMPHandler
conn
- Connectionstate
- RTMP stateprotected String getHostname(String url)
url
- URLprotected void handlePendingCallResult(RTMPConnection conn, Notify invoke)
conn
- Connectioninvoke
- Pending call result event contextprotected abstract void onChunkSize(RTMPConnection conn, Channel channel, Header source, ChunkSize chunkSize)
conn
- Connectionchannel
- Channelsource
- HeaderchunkSize
- New chunk sizeprotected abstract void onInvoke(RTMPConnection conn, Channel channel, Header source, Notify invoke, RTMP rtmp)
conn
- Connectionchannel
- Channelsource
- Headerinvoke
- Invocation event contextrtmp
- RTMP connection stateprotected abstract void onPing(RTMPConnection conn, Channel channel, Header source, Ping ping)
conn
- Connectionchannel
- Channelsource
- Headerping
- Ping event contextprotected void onStreamBytesRead(RTMPConnection conn, Channel channel, Header source, BytesRead streamBytesRead)
conn
- Connectionchannel
- Channelsource
- HeaderstreamBytesRead
- Bytes read event contextprotected abstract void onSharedObject(RTMPConnection conn, Channel channel, Header source, SharedObjectMessage object)
conn
- Connectionchannel
- Channelsource
- Headerobject
- Shared object event contextCopyright © 2006-2012 The Red5 Project