id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
108,100 | Red5/red5-server-common | src/main/java/org/red5/server/so/ClientSharedObject.java | ClientSharedObject.notifySendMessage | protected void notifySendMessage(String method, List<?> params) {
for (ISharedObjectListener listener : listeners) {
listener.onSharedObjectSend(this, method, params);
}
} | java | protected void notifySendMessage(String method, List<?> params) {
for (ISharedObjectListener listener : listeners) {
listener.onSharedObjectSend(this, method, params);
}
} | [
"protected",
"void",
"notifySendMessage",
"(",
"String",
"method",
",",
"List",
"<",
"?",
">",
"params",
")",
"{",
"for",
"(",
"ISharedObjectListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"onSharedObjectSend",
"(",
"this",
",",
"method",
... | Broadcast send event to listeners
@param method
Method name
@param params
Params | [
"Broadcast",
"send",
"event",
"to",
"listeners"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/ClientSharedObject.java#L265-L269 |
108,101 | Red5/red5-server-common | src/main/java/org/red5/server/service/ServiceInvoker.java | ServiceInvoker.getServiceHandler | private Object getServiceHandler(IScope scope, String serviceName) {
// get application scope handler first
Object service = scope.getHandler();
if (serviceName == null || serviceName.equals("")) {
// no service requested, return application scope handler
log.trace("... | java | private Object getServiceHandler(IScope scope, String serviceName) {
// get application scope handler first
Object service = scope.getHandler();
if (serviceName == null || serviceName.equals("")) {
// no service requested, return application scope handler
log.trace("... | [
"private",
"Object",
"getServiceHandler",
"(",
"IScope",
"scope",
",",
"String",
"serviceName",
")",
"{",
"// get application scope handler first\r",
"Object",
"service",
"=",
"scope",
".",
"getHandler",
"(",
")",
";",
"if",
"(",
"serviceName",
"==",
"null",
"||",... | Lookup a handler for the passed service name in the given scope.
@param scope
Scope
@param serviceName
Service name
@return Service handler | [
"Lookup",
"a",
"handler",
"for",
"the",
"passed",
"service",
"name",
"in",
"the",
"given",
"scope",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/service/ServiceInvoker.java#L79-L96 |
108,102 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandler.java | RTMPHandler.sendSOCreationFailed | private void sendSOCreationFailed(RTMPConnection conn, SharedObjectMessage message) {
log.debug("sendSOCreationFailed - message: {} conn: {}", message, conn);
// reset the object so we can re-use it
message.reset();
// add the error event
message.addEvent(new SharedObjectEve... | java | private void sendSOCreationFailed(RTMPConnection conn, SharedObjectMessage message) {
log.debug("sendSOCreationFailed - message: {} conn: {}", message, conn);
// reset the object so we can re-use it
message.reset();
// add the error event
message.addEvent(new SharedObjectEve... | [
"private",
"void",
"sendSOCreationFailed",
"(",
"RTMPConnection",
"conn",
",",
"SharedObjectMessage",
"message",
")",
"{",
"log",
".",
"debug",
"(",
"\"sendSOCreationFailed - message: {} conn: {}\"",
",",
"message",
",",
"conn",
")",
";",
"// reset the object so we can re... | Create and send SO message stating that a SO could not be created.
@param conn
@param message
Shared object message that incurred the failure | [
"Create",
"and",
"send",
"SO",
"message",
"stating",
"that",
"a",
"SO",
"could",
"not",
"be",
"created",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandler.java#L547-L561 |
108,103 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/DeferredResult.java | DeferredResult.setResult | public void setResult(Object result) {
if (resultSent) {
throw new RuntimeException("You can only set the result once.");
}
this.resultSent = true;
Channel channel = this.channel.get();
if (channel == null) {
log.warn("The client is no longer connec... | java | public void setResult(Object result) {
if (resultSent) {
throw new RuntimeException("You can only set the result once.");
}
this.resultSent = true;
Channel channel = this.channel.get();
if (channel == null) {
log.warn("The client is no longer connec... | [
"public",
"void",
"setResult",
"(",
"Object",
"result",
")",
"{",
"if",
"(",
"resultSent",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"You can only set the result once.\"",
")",
";",
"}",
"this",
".",
"resultSent",
"=",
"true",
";",
"Channel",
"chann... | Set the result of a method call and send to the caller.
@param result
deferred result of the method call | [
"Set",
"the",
"result",
"of",
"a",
"method",
"call",
"and",
"send",
"to",
"the",
"caller",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/DeferredResult.java#L66-L82 |
108,104 | Red5/red5-server-common | src/main/java/org/red5/server/messaging/InMemoryPushPushPipe.java | InMemoryPushPushPipe.pushMessage | public void pushMessage(IMessage message) throws IOException {
if (log.isDebugEnabled()) {
log.debug("pushMessage: {} to {} consumers", message, consumers.size());
}
for (IConsumer consumer : consumers) {
try {
((IPushableConsumer) consumer).pushMessage(th... | java | public void pushMessage(IMessage message) throws IOException {
if (log.isDebugEnabled()) {
log.debug("pushMessage: {} to {} consumers", message, consumers.size());
}
for (IConsumer consumer : consumers) {
try {
((IPushableConsumer) consumer).pushMessage(th... | [
"public",
"void",
"pushMessage",
"(",
"IMessage",
"message",
")",
"throws",
"IOException",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"pushMessage: {} to {} consumers\"",
",",
"message",
",",
"consumers",
".",... | Pushes a message out to all the PushableConsumers.
@param message
the message to be pushed to consumers
@throws IOException
In case IOException of some sort is occurred | [
"Pushes",
"a",
"message",
"out",
"to",
"all",
"the",
"PushableConsumers",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/InMemoryPushPushPipe.java#L94-L109 |
108,105 | Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.subscribe | public boolean subscribe(IConsumer consumer, Map<String, Object> paramMap) {
// pipe is possibly used by dozens of threads at once (like many subscribers for one server stream)
boolean success = consumers.addIfAbsent(consumer);
// if consumer is listener object register it as listener and consum... | java | public boolean subscribe(IConsumer consumer, Map<String, Object> paramMap) {
// pipe is possibly used by dozens of threads at once (like many subscribers for one server stream)
boolean success = consumers.addIfAbsent(consumer);
// if consumer is listener object register it as listener and consum... | [
"public",
"boolean",
"subscribe",
"(",
"IConsumer",
"consumer",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"// pipe is possibly used by dozens of threads at once (like many subscribers for one server stream)",
"boolean",
"success",
"=",
"consumers",
... | Connect consumer to this pipe. Doesn't allow to connect one consumer twice. Does register event listeners if instance of IPipeConnectionListener is given.
@param consumer
Consumer
@param paramMap
Parameters passed with connection, used in concrete pipe implementations
@return true if consumer was added, false otherwis... | [
"Connect",
"consumer",
"to",
"this",
"pipe",
".",
"Doesn",
"t",
"allow",
"to",
"connect",
"one",
"consumer",
"twice",
".",
"Does",
"register",
"event",
"listeners",
"if",
"instance",
"of",
"IPipeConnectionListener",
"is",
"given",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L73-L81 |
108,106 | Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.subscribe | public boolean subscribe(IProvider provider, Map<String, Object> paramMap) {
boolean success = providers.addIfAbsent(provider);
// register event listener if given and just added
if (success && provider instanceof IPipeConnectionListener) {
listeners.addIfAbsent((IPipeConnectionListe... | java | public boolean subscribe(IProvider provider, Map<String, Object> paramMap) {
boolean success = providers.addIfAbsent(provider);
// register event listener if given and just added
if (success && provider instanceof IPipeConnectionListener) {
listeners.addIfAbsent((IPipeConnectionListe... | [
"public",
"boolean",
"subscribe",
"(",
"IProvider",
"provider",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"boolean",
"success",
"=",
"providers",
".",
"addIfAbsent",
"(",
"provider",
")",
";",
"// register event listener if given and jus... | Connect provider to this pipe. Doesn't allow to connect one provider twice. Does register event listeners if instance of IPipeConnectionListener is given.
@param provider
Provider
@param paramMap
Parameters passed with connection, used in concrete pipe implementations
@return true if provider was added, false otherwis... | [
"Connect",
"provider",
"to",
"this",
"pipe",
".",
"Doesn",
"t",
"allow",
"to",
"connect",
"one",
"provider",
"twice",
".",
"Does",
"register",
"event",
"listeners",
"if",
"instance",
"of",
"IPipeConnectionListener",
"is",
"given",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L92-L99 |
108,107 | Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.unsubscribe | @SuppressWarnings("unlikely-arg-type")
public boolean unsubscribe(IProvider provider) {
if (providers.remove(provider)) {
fireProviderConnectionEvent(provider, PipeConnectionEvent.EventType.PROVIDER_DISCONNECT, null);
listeners.remove(provider);
return true;
}
... | java | @SuppressWarnings("unlikely-arg-type")
public boolean unsubscribe(IProvider provider) {
if (providers.remove(provider)) {
fireProviderConnectionEvent(provider, PipeConnectionEvent.EventType.PROVIDER_DISCONNECT, null);
listeners.remove(provider);
return true;
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unlikely-arg-type\"",
")",
"public",
"boolean",
"unsubscribe",
"(",
"IProvider",
"provider",
")",
"{",
"if",
"(",
"providers",
".",
"remove",
"(",
"provider",
")",
")",
"{",
"fireProviderConnectionEvent",
"(",
"provider",
",",
"P... | Disconnects provider from this pipe. Fires pipe connection event.
@param provider
Provider that should be removed
@return true on success, false otherwise | [
"Disconnects",
"provider",
"from",
"this",
"pipe",
".",
"Fires",
"pipe",
"connection",
"event",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L108-L116 |
108,108 | Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.unsubscribe | @SuppressWarnings("unlikely-arg-type")
public boolean unsubscribe(IConsumer consumer) {
if (consumers.remove(consumer)) {
fireConsumerConnectionEvent(consumer, PipeConnectionEvent.EventType.CONSUMER_DISCONNECT, null);
listeners.remove(consumer);
return true;
}
... | java | @SuppressWarnings("unlikely-arg-type")
public boolean unsubscribe(IConsumer consumer) {
if (consumers.remove(consumer)) {
fireConsumerConnectionEvent(consumer, PipeConnectionEvent.EventType.CONSUMER_DISCONNECT, null);
listeners.remove(consumer);
return true;
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unlikely-arg-type\"",
")",
"public",
"boolean",
"unsubscribe",
"(",
"IConsumer",
"consumer",
")",
"{",
"if",
"(",
"consumers",
".",
"remove",
"(",
"consumer",
")",
")",
"{",
"fireConsumerConnectionEvent",
"(",
"consumer",
",",
"P... | Disconnects consumer from this pipe. Fires pipe connection event.
@param consumer
Consumer that should be removed
@return true on success, false otherwise | [
"Disconnects",
"consumer",
"from",
"this",
"pipe",
".",
"Fires",
"pipe",
"connection",
"event",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L125-L133 |
108,109 | Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.fireConsumerConnectionEvent | protected void fireConsumerConnectionEvent(IConsumer consumer, PipeConnectionEvent.EventType type, Map<String, Object> paramMap) {
firePipeConnectionEvent(PipeConnectionEvent.build(this, type, consumer, paramMap));
} | java | protected void fireConsumerConnectionEvent(IConsumer consumer, PipeConnectionEvent.EventType type, Map<String, Object> paramMap) {
firePipeConnectionEvent(PipeConnectionEvent.build(this, type, consumer, paramMap));
} | [
"protected",
"void",
"fireConsumerConnectionEvent",
"(",
"IConsumer",
"consumer",
",",
"PipeConnectionEvent",
".",
"EventType",
"type",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"firePipeConnectionEvent",
"(",
"PipeConnectionEvent",
".",
"... | Broadcast consumer connection event
@param consumer
Consumer that has connected
@param type
Event type
@param paramMap
Parameters passed with connection | [
"Broadcast",
"consumer",
"connection",
"event"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L239-L241 |
108,110 | Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.fireProviderConnectionEvent | protected void fireProviderConnectionEvent(IProvider provider, PipeConnectionEvent.EventType type, Map<String, Object> paramMap) {
firePipeConnectionEvent(PipeConnectionEvent.build(this, type, provider, paramMap));
} | java | protected void fireProviderConnectionEvent(IProvider provider, PipeConnectionEvent.EventType type, Map<String, Object> paramMap) {
firePipeConnectionEvent(PipeConnectionEvent.build(this, type, provider, paramMap));
} | [
"protected",
"void",
"fireProviderConnectionEvent",
"(",
"IProvider",
"provider",
",",
"PipeConnectionEvent",
".",
"EventType",
"type",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"firePipeConnectionEvent",
"(",
"PipeConnectionEvent",
".",
"... | Broadcast provider connection event
@param provider
Provider that has connected
@param type
Event type
@param paramMap
Parameters passed with connection | [
"Broadcast",
"provider",
"connection",
"event"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L253-L255 |
108,111 | Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.firePipeConnectionEvent | protected void firePipeConnectionEvent(PipeConnectionEvent event) {
for (IPipeConnectionListener element : listeners) {
try {
element.onPipeConnectionEvent(event);
} catch (Throwable t) {
log.error("Exception when handling pipe connection event", t);
... | java | protected void firePipeConnectionEvent(PipeConnectionEvent event) {
for (IPipeConnectionListener element : listeners) {
try {
element.onPipeConnectionEvent(event);
} catch (Throwable t) {
log.error("Exception when handling pipe connection event", t);
... | [
"protected",
"void",
"firePipeConnectionEvent",
"(",
"PipeConnectionEvent",
"event",
")",
"{",
"for",
"(",
"IPipeConnectionListener",
"element",
":",
"listeners",
")",
"{",
"try",
"{",
"element",
".",
"onPipeConnectionEvent",
"(",
"event",
")",
";",
"}",
"catch",
... | Fire any pipe connection event and run all it's tasks
@param event
Pipe connection event | [
"Fire",
"any",
"pipe",
"connection",
"event",
"and",
"run",
"all",
"it",
"s",
"tasks"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L263-L284 |
108,112 | Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.close | public void close() {
// clean up collections
if (consumers != null) {
consumers.clear();
consumers = null;
}
if (providers != null) {
providers.clear();
providers = null;
}
if (listeners != null) {
listeners.cle... | java | public void close() {
// clean up collections
if (consumers != null) {
consumers.clear();
consumers = null;
}
if (providers != null) {
providers.clear();
providers = null;
}
if (listeners != null) {
listeners.cle... | [
"public",
"void",
"close",
"(",
")",
"{",
"// clean up collections",
"if",
"(",
"consumers",
"!=",
"null",
")",
"{",
"consumers",
".",
"clear",
"(",
")",
";",
"consumers",
"=",
"null",
";",
"}",
"if",
"(",
"providers",
"!=",
"null",
")",
"{",
"provider... | Close the pipe | [
"Close",
"the",
"pipe"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L289-L303 |
108,113 | Red5/red5-server-common | src/main/java/org/red5/server/stream/AudioCodecFactory.java | AudioCodecFactory.getAudioCodec | public static IAudioStreamCodec getAudioCodec(IoBuffer data) {
IAudioStreamCodec result = null;
try {
//get the codec identifying byte
int codecId = (data.get() & 0xf0) >> 4;
switch (codecId) {
case 10: //aac
result = (IAudi... | java | public static IAudioStreamCodec getAudioCodec(IoBuffer data) {
IAudioStreamCodec result = null;
try {
//get the codec identifying byte
int codecId = (data.get() & 0xf0) >> 4;
switch (codecId) {
case 10: //aac
result = (IAudi... | [
"public",
"static",
"IAudioStreamCodec",
"getAudioCodec",
"(",
"IoBuffer",
"data",
")",
"{",
"IAudioStreamCodec",
"result",
"=",
"null",
";",
"try",
"{",
"//get the codec identifying byte\r",
"int",
"codecId",
"=",
"(",
"data",
".",
"get",
"(",
")",
"&",
"0xf0",... | Create and return new audio codec applicable for byte buffer data
@param data
Byte buffer data
@return audio codec | [
"Create",
"and",
"return",
"new",
"audio",
"codec",
"applicable",
"for",
"byte",
"buffer",
"data"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/AudioCodecFactory.java#L68-L108 |
108,114 | Red5/red5-server-common | src/main/java/org/red5/server/api/Red5.java | Red5.setConnectionLocal | public static void setConnectionLocal(IConnection connection) {
if (log.isDebugEnabled()) {
log.debug("Set connection: {} with thread: {}", (connection != null ? connection.getSessionId() : null), Thread.currentThread().getName());
try {
StackTraceElement[] stackTrace... | java | public static void setConnectionLocal(IConnection connection) {
if (log.isDebugEnabled()) {
log.debug("Set connection: {} with thread: {}", (connection != null ? connection.getSessionId() : null), Thread.currentThread().getName());
try {
StackTraceElement[] stackTrace... | [
"public",
"static",
"void",
"setConnectionLocal",
"(",
"IConnection",
"connection",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Set connection: {} with thread: {}\"",
",",
"(",
"connection",
"!=",
"null",
... | Setter for connection
@param connection
Thread local connection | [
"Setter",
"for",
"connection"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/api/Red5.java#L125-L145 |
108,115 | Red5/red5-server-common | src/main/java/org/red5/server/api/Red5.java | Red5.getConnectionLocal | public static IConnection getConnectionLocal() {
WeakReference<IConnection> ref = connThreadLocal.get();
if (ref != null) {
IConnection connection = ref.get();
log.debug("Get connection: {} on thread: {}", (connection != null ? connection.getSessionId() : null), Thread.curren... | java | public static IConnection getConnectionLocal() {
WeakReference<IConnection> ref = connThreadLocal.get();
if (ref != null) {
IConnection connection = ref.get();
log.debug("Get connection: {} on thread: {}", (connection != null ? connection.getSessionId() : null), Thread.curren... | [
"public",
"static",
"IConnection",
"getConnectionLocal",
"(",
")",
"{",
"WeakReference",
"<",
"IConnection",
">",
"ref",
"=",
"connThreadLocal",
".",
"get",
"(",
")",
";",
"if",
"(",
"ref",
"!=",
"null",
")",
"{",
"IConnection",
"connection",
"=",
"ref",
"... | Get the connection associated with the current thread. This method allows you to get connection object local to current thread. When you need to get a connection associated with event handler and so forth, this method provides you with it.
@return Connection object | [
"Get",
"the",
"connection",
"associated",
"with",
"the",
"current",
"thread",
".",
"This",
"method",
"allows",
"you",
"to",
"get",
"connection",
"object",
"local",
"to",
"current",
"thread",
".",
"When",
"you",
"need",
"to",
"get",
"a",
"connection",
"associ... | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/api/Red5.java#L152-L161 |
108,116 | Red5/red5-server-common | src/main/java/org/red5/server/persistence/RamPersistence.java | RamPersistence.getObjectName | protected String getObjectName(String id) {
// The format of the object id is <type>/<path>/<objectName>
String result = id.substring(id.lastIndexOf('/') + 1);
if (result.equals(PERSISTENCE_NO_NAME)) {
result = null;
}
return result;
} | java | protected String getObjectName(String id) {
// The format of the object id is <type>/<path>/<objectName>
String result = id.substring(id.lastIndexOf('/') + 1);
if (result.equals(PERSISTENCE_NO_NAME)) {
result = null;
}
return result;
} | [
"protected",
"String",
"getObjectName",
"(",
"String",
"id",
")",
"{",
"// The format of the object id is <type>/<path>/<objectName>\r",
"String",
"result",
"=",
"id",
".",
"substring",
"(",
"id",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
"+",
"1",
")",
";",
"if",... | Get resource name from path. The format of the object id is
<pre>
type / path / objectName
</pre>
@param id
object id
@return resource name | [
"Get",
"resource",
"name",
"from",
"path",
".",
"The",
"format",
"of",
"the",
"object",
"id",
"is"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/persistence/RamPersistence.java#L91-L98 |
108,117 | Red5/red5-server-common | src/main/java/org/red5/server/persistence/RamPersistence.java | RamPersistence.getObjectPath | protected String getObjectPath(String id, String name) {
// The format of the object id is <type>/<path>/<objectName>
id = id.substring(id.indexOf('/') + 1);
if (id.charAt(0) == '/') {
id = id.substring(1);
}
if (id.lastIndexOf(name) <= 0) {
return ... | java | protected String getObjectPath(String id, String name) {
// The format of the object id is <type>/<path>/<objectName>
id = id.substring(id.indexOf('/') + 1);
if (id.charAt(0) == '/') {
id = id.substring(1);
}
if (id.lastIndexOf(name) <= 0) {
return ... | [
"protected",
"String",
"getObjectPath",
"(",
"String",
"id",
",",
"String",
"name",
")",
"{",
"// The format of the object id is <type>/<path>/<objectName>\r",
"id",
"=",
"id",
".",
"substring",
"(",
"id",
".",
"indexOf",
"(",
"'",
"'",
")",
"+",
"1",
")",
";"... | Get object path for given id and name. The format of the object id is
<pre>
type / path / objectName
</pre>
@param id
object id
@param name
object name
@return resource path | [
"Get",
"object",
"path",
"for",
"given",
"id",
"and",
"name",
".",
"The",
"format",
"of",
"the",
"object",
"id",
"is"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/persistence/RamPersistence.java#L113-L123 |
108,118 | Red5/red5-server-common | src/main/java/org/red5/server/persistence/RamPersistence.java | RamPersistence.getObjectId | protected String getObjectId(IPersistable object) {
// The format of the object id is <type>/<path>/<objectName>
String result = object.getType();
if (object.getPath().charAt(0) != '/') {
result += '/';
}
result += object.getPath();
if (!result.endsWith... | java | protected String getObjectId(IPersistable object) {
// The format of the object id is <type>/<path>/<objectName>
String result = object.getType();
if (object.getPath().charAt(0) != '/') {
result += '/';
}
result += object.getPath();
if (!result.endsWith... | [
"protected",
"String",
"getObjectId",
"(",
"IPersistable",
"object",
")",
"{",
"// The format of the object id is <type>/<path>/<objectName>\r",
"String",
"result",
"=",
"object",
".",
"getType",
"(",
")",
";",
"if",
"(",
"object",
".",
"getPath",
"(",
")",
".",
"... | Get object id
@param object
Persistable object whose id is asked for
@return Given persistable object id | [
"Get",
"object",
"id"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/persistence/RamPersistence.java#L132-L151 |
108,119 | Red5/red5-server-common | src/main/java/org/red5/server/BaseConnection.java | BaseConnection.connect | public boolean connect(IScope newScope, Object[] params) {
if (log.isDebugEnabled()) {
log.debug("Connect Params: {}", params);
if (params != null) {
for (Object e : params) {
log.debug("Param: {}", e);
}
}
}... | java | public boolean connect(IScope newScope, Object[] params) {
if (log.isDebugEnabled()) {
log.debug("Connect Params: {}", params);
if (params != null) {
for (Object e : params) {
log.debug("Param: {}", e);
}
}
}... | [
"public",
"boolean",
"connect",
"(",
"IScope",
"newScope",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Connect Params: {}\"",
",",
"params",
")",
";",
"if",
"(",... | Connect to another scope on server with given parameters
@param newScope
New scope
@param params
Parameters to connect with
@return true on success, false otherwise | [
"Connect",
"to",
"another",
"scope",
"on",
"server",
"with",
"given",
"parameters"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/BaseConnection.java#L359-L370 |
108,120 | Red5/red5-server-common | src/main/java/org/red5/server/BaseConnection.java | BaseConnection.unregisterBasicScope | public void unregisterBasicScope(IBasicScope basicScope) {
if (basicScope instanceof IBroadcastScope || basicScope instanceof SharedObjectScope) {
basicScopes.remove(basicScope);
basicScope.removeEventListener(this);
}
} | java | public void unregisterBasicScope(IBasicScope basicScope) {
if (basicScope instanceof IBroadcastScope || basicScope instanceof SharedObjectScope) {
basicScopes.remove(basicScope);
basicScope.removeEventListener(this);
}
} | [
"public",
"void",
"unregisterBasicScope",
"(",
"IBasicScope",
"basicScope",
")",
"{",
"if",
"(",
"basicScope",
"instanceof",
"IBroadcastScope",
"||",
"basicScope",
"instanceof",
"SharedObjectScope",
")",
"{",
"basicScopes",
".",
"remove",
"(",
"basicScope",
")",
";"... | Unregister basic scope
@param basicScope
Unregister basic scope | [
"Unregister",
"basic",
"scope"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/BaseConnection.java#L491-L496 |
108,121 | Red5/red5-server-common | src/main/java/org/red5/server/scope/BasicScope.java | BasicScope.isValid | public boolean isValid() {
// to be valid a scope must have a type set other than undefined and its name will be set
return (type != null && !type.equals(ScopeType.UNDEFINED) && (name != null && !("").equals(name)));
} | java | public boolean isValid() {
// to be valid a scope must have a type set other than undefined and its name will be set
return (type != null && !type.equals(ScopeType.UNDEFINED) && (name != null && !("").equals(name)));
} | [
"public",
"boolean",
"isValid",
"(",
")",
"{",
"// to be valid a scope must have a type set other than undefined and its name will be set\r",
"return",
"(",
"type",
"!=",
"null",
"&&",
"!",
"type",
".",
"equals",
"(",
"ScopeType",
".",
"UNDEFINED",
")",
"&&",
"(",
"na... | Validates a scope based on its name and type
@return true if both name and type are valid, false otherwise | [
"Validates",
"a",
"scope",
"based",
"on",
"its",
"name",
"and",
"type"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/scope/BasicScope.java#L208-L211 |
108,122 | Red5/red5-server-common | src/main/java/org/red5/server/scope/BasicScope.java | BasicScope.addEventListener | public boolean addEventListener(IEventListener listener) {
log.debug("addEventListener - scope: {} {}", getName(), listener);
return listeners.add(listener);
} | java | public boolean addEventListener(IEventListener listener) {
log.debug("addEventListener - scope: {} {}", getName(), listener);
return listeners.add(listener);
} | [
"public",
"boolean",
"addEventListener",
"(",
"IEventListener",
"listener",
")",
"{",
"log",
".",
"debug",
"(",
"\"addEventListener - scope: {} {}\"",
",",
"getName",
"(",
")",
",",
"listener",
")",
";",
"return",
"listeners",
".",
"add",
"(",
"listener",
")",
... | Add event listener to list of notified objects
@param listener Listening object
@return true if listener is added and false otherwise | [
"Add",
"event",
"listener",
"to",
"list",
"of",
"notified",
"objects"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/scope/BasicScope.java#L282-L285 |
108,123 | Red5/red5-server-common | src/main/java/org/red5/server/scope/BasicScope.java | BasicScope.removeEventListener | public boolean removeEventListener(IEventListener listener) {
log.debug("removeEventListener - scope: {} {}", getName(), listener);
if (log.isTraceEnabled()) {
log.trace("Listeners - check #1: {}", listeners);
}
boolean removed = listeners.remove(listener);
if (... | java | public boolean removeEventListener(IEventListener listener) {
log.debug("removeEventListener - scope: {} {}", getName(), listener);
if (log.isTraceEnabled()) {
log.trace("Listeners - check #1: {}", listeners);
}
boolean removed = listeners.remove(listener);
if (... | [
"public",
"boolean",
"removeEventListener",
"(",
"IEventListener",
"listener",
")",
"{",
"log",
".",
"debug",
"(",
"\"removeEventListener - scope: {} {}\"",
",",
"getName",
"(",
")",
",",
"listener",
")",
";",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
... | Remove event listener from list of listeners
@param listener
Listener to remove
@return true if listener is removed and false otherwise | [
"Remove",
"event",
"listener",
"from",
"list",
"of",
"listeners"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/scope/BasicScope.java#L294-L316 |
108,124 | Red5/red5-server-common | src/main/java/org/red5/server/adapter/AbstractScopeAdapter.java | AbstractScopeAdapter.checkBandwidth | public void checkBandwidth(Object o) {
//Incoming object should be null
IClient client = Red5.getConnectionLocal().getClient();
if (client != null) {
client.checkBandwidth();
}
} | java | public void checkBandwidth(Object o) {
//Incoming object should be null
IClient client = Red5.getConnectionLocal().getClient();
if (client != null) {
client.checkBandwidth();
}
} | [
"public",
"void",
"checkBandwidth",
"(",
"Object",
"o",
")",
"{",
"//Incoming object should be null\r",
"IClient",
"client",
"=",
"Red5",
".",
"getConnectionLocal",
"(",
")",
".",
"getClient",
"(",
")",
";",
"if",
"(",
"client",
"!=",
"null",
")",
"{",
"clie... | Calls the checkBandwidth method on the current client.
@param o
Object passed from Flash, not used at the moment | [
"Calls",
"the",
"checkBandwidth",
"method",
"on",
"the",
"current",
"client",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/adapter/AbstractScopeAdapter.java#L278-L284 |
108,125 | Red5/red5-server-common | src/main/java/org/red5/server/adapter/AbstractScopeAdapter.java | AbstractScopeAdapter.checkBandwidthUp | public Map<String, Object> checkBandwidthUp(Object[] params) {
//Incoming object should be null
IClient client = Red5.getConnectionLocal().getClient();
if (client != null) {
return client.checkBandwidthUp(params);
}
return null;
} | java | public Map<String, Object> checkBandwidthUp(Object[] params) {
//Incoming object should be null
IClient client = Red5.getConnectionLocal().getClient();
if (client != null) {
return client.checkBandwidthUp(params);
}
return null;
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"checkBandwidthUp",
"(",
"Object",
"[",
"]",
"params",
")",
"{",
"//Incoming object should be null\r",
"IClient",
"client",
"=",
"Red5",
".",
"getConnectionLocal",
"(",
")",
".",
"getClient",
"(",
")",
";",
... | Calls the checkBandwidthUp method on the current client.
@param params
Object passed from Flash
@return bandwidth results map | [
"Calls",
"the",
"checkBandwidthUp",
"method",
"on",
"the",
"current",
"client",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/adapter/AbstractScopeAdapter.java#L293-L300 |
108,126 | Red5/red5-server-common | src/main/java/org/red5/server/adapter/StatefulScopeWrappingAdapter.java | StatefulScopeWrappingAdapter.createChildScope | public boolean createChildScope(String name) {
if (!scope.hasChildScope(name)) {
return scope.createChildScope(name);
}
return false;
} | java | public boolean createChildScope(String name) {
if (!scope.hasChildScope(name)) {
return scope.createChildScope(name);
}
return false;
} | [
"public",
"boolean",
"createChildScope",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"!",
"scope",
".",
"hasChildScope",
"(",
"name",
")",
")",
"{",
"return",
"scope",
".",
"createChildScope",
"(",
"name",
")",
";",
"}",
"return",
"false",
";",
"}"
] | Creates child scope
@param name
Child scope name
@return true on success, false otherwise | [
"Creates",
"child",
"scope"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/adapter/StatefulScopeWrappingAdapter.java#L176-L181 |
108,127 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/event/Notify.java | Notify.duplicate | public Notify duplicate() throws IOException, ClassNotFoundException {
Notify result = new Notify();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
writeExternal(oos);
oos.close();
byte[] buf = baos.t... | java | public Notify duplicate() throws IOException, ClassNotFoundException {
Notify result = new Notify();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
writeExternal(oos);
oos.close();
byte[] buf = baos.t... | [
"public",
"Notify",
"duplicate",
"(",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"Notify",
"result",
"=",
"new",
"Notify",
"(",
")",
";",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ObjectOutputStrea... | Duplicate this Notify message to future injection Serialize to memory and deserialize, safe way.
@return duplicated Notify event | [
"Duplicate",
"this",
"Notify",
"message",
"to",
"future",
"injection",
"Serialize",
"to",
"memory",
"and",
"deserialize",
"safe",
"way",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/event/Notify.java#L279-L298 |
108,128 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.connectToProvider | private final void connectToProvider(String itemName) {
log.debug("Attempting connection to {}", itemName);
IMessageInput in = msgInReference.get();
if (in == null) {
in = providerService.getLiveProviderInput(subscriberStream.getScope(), itemName, true);
msgInReference.se... | java | private final void connectToProvider(String itemName) {
log.debug("Attempting connection to {}", itemName);
IMessageInput in = msgInReference.get();
if (in == null) {
in = providerService.getLiveProviderInput(subscriberStream.getScope(), itemName, true);
msgInReference.se... | [
"private",
"final",
"void",
"connectToProvider",
"(",
"String",
"itemName",
")",
"{",
"log",
".",
"debug",
"(",
"\"Attempting connection to {}\"",
",",
"itemName",
")",
";",
"IMessageInput",
"in",
"=",
"msgInReference",
".",
"get",
"(",
")",
";",
"if",
"(",
... | Connects to the data provider.
@param itemName
name of the item to play | [
"Connects",
"to",
"the",
"data",
"provider",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L660-L684 |
108,129 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.pause | public void pause(int position) throws IllegalStateException {
// allow pause if playing or stopped
switch (subscriberStream.getState()) {
case PLAYING:
case STOPPED:
subscriberStream.setState(StreamState.PAUSED);
clearWaitJobs();
s... | java | public void pause(int position) throws IllegalStateException {
// allow pause if playing or stopped
switch (subscriberStream.getState()) {
case PLAYING:
case STOPPED:
subscriberStream.setState(StreamState.PAUSED);
clearWaitJobs();
s... | [
"public",
"void",
"pause",
"(",
"int",
"position",
")",
"throws",
"IllegalStateException",
"{",
"// allow pause if playing or stopped",
"switch",
"(",
"subscriberStream",
".",
"getState",
"(",
")",
")",
"{",
"case",
"PLAYING",
":",
"case",
"STOPPED",
":",
"subscri... | Pause at position
@param position
Position in file
@throws IllegalStateException
If stream is stopped | [
"Pause",
"at",
"position"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L694-L708 |
108,130 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.seek | public void seek(int position) throws IllegalStateException, OperationNotSupportedException {
// add this pending seek operation to the list
pendingOperations.add(new SeekRunnable(position));
cancelDeferredStop();
ensurePullAndPushRunning();
} | java | public void seek(int position) throws IllegalStateException, OperationNotSupportedException {
// add this pending seek operation to the list
pendingOperations.add(new SeekRunnable(position));
cancelDeferredStop();
ensurePullAndPushRunning();
} | [
"public",
"void",
"seek",
"(",
"int",
"position",
")",
"throws",
"IllegalStateException",
",",
"OperationNotSupportedException",
"{",
"// add this pending seek operation to the list",
"pendingOperations",
".",
"add",
"(",
"new",
"SeekRunnable",
"(",
"position",
")",
")",
... | Seek to a given position
@param position
Position
@throws IllegalStateException
If stream is in stopped state
@throws OperationNotSupportedException
If this object doesn't support the operation. | [
"Seek",
"to",
"a",
"given",
"position"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L756-L761 |
108,131 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.okayToSendMessage | private boolean okayToSendMessage(IRTMPEvent message) {
if (message instanceof IStreamData) {
final long now = System.currentTimeMillis();
// check client buffer size
if (isClientBufferFull(now)) {
return false;
}
// get pending message... | java | private boolean okayToSendMessage(IRTMPEvent message) {
if (message instanceof IStreamData) {
final long now = System.currentTimeMillis();
// check client buffer size
if (isClientBufferFull(now)) {
return false;
}
// get pending message... | [
"private",
"boolean",
"okayToSendMessage",
"(",
"IRTMPEvent",
"message",
")",
"{",
"if",
"(",
"message",
"instanceof",
"IStreamData",
")",
"{",
"final",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"// check client buffer size",
"if",
"... | Check if it's okay to send the client more data. This takes the configured bandwidth as well as the requested client buffer into
account.
@param message
@return true if it is ok to send more, false otherwise | [
"Check",
"if",
"it",
"s",
"okay",
"to",
"send",
"the",
"client",
"more",
"data",
".",
"This",
"takes",
"the",
"configured",
"bandwidth",
"as",
"well",
"as",
"the",
"requested",
"client",
"buffer",
"into",
"account",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L860-L891 |
108,132 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.isClientBufferFull | private boolean isClientBufferFull(final long now) {
// check client buffer length when we've already sent some messages
if (lastMessageTs > 0) {
// duration the stream is playing / playback duration
final long delta = now - playbackStart;
// buffer size as requested ... | java | private boolean isClientBufferFull(final long now) {
// check client buffer length when we've already sent some messages
if (lastMessageTs > 0) {
// duration the stream is playing / playback duration
final long delta = now - playbackStart;
// buffer size as requested ... | [
"private",
"boolean",
"isClientBufferFull",
"(",
"final",
"long",
"now",
")",
"{",
"// check client buffer length when we've already sent some messages",
"if",
"(",
"lastMessageTs",
">",
"0",
")",
"{",
"// duration the stream is playing / playback duration",
"final",
"long",
... | Estimate client buffer fill.
@param now
The current timestamp being used.
@return True if it appears that the client buffer is full, otherwise false. | [
"Estimate",
"client",
"buffer",
"fill",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L900-L917 |
108,133 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.ensurePullAndPushRunning | private void ensurePullAndPushRunning() {
log.trace("State should be PLAYING to running this task: {}", subscriberStream.getState());
if (pullMode && pullAndPush == null && subscriberStream.getState() == StreamState.PLAYING) {
// client buffer is at least 100ms
pullAndPush = subs... | java | private void ensurePullAndPushRunning() {
log.trace("State should be PLAYING to running this task: {}", subscriberStream.getState());
if (pullMode && pullAndPush == null && subscriberStream.getState() == StreamState.PLAYING) {
// client buffer is at least 100ms
pullAndPush = subs... | [
"private",
"void",
"ensurePullAndPushRunning",
"(",
")",
"{",
"log",
".",
"trace",
"(",
"\"State should be PLAYING to running this task: {}\"",
",",
"subscriberStream",
".",
"getState",
"(",
")",
")",
";",
"if",
"(",
"pullMode",
"&&",
"pullAndPush",
"==",
"null",
... | Make sure the pull and push processing is running. | [
"Make",
"sure",
"the",
"pull",
"and",
"push",
"processing",
"is",
"running",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L937-L943 |
108,134 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.clearWaitJobs | private void clearWaitJobs() {
log.debug("Clear wait jobs");
if (pullAndPush != null) {
subscriberStream.cancelJob(pullAndPush);
releasePendingMessage();
pullAndPush = null;
}
if (waitLiveJob != null) {
schedulingService.removeScheduledJob(... | java | private void clearWaitJobs() {
log.debug("Clear wait jobs");
if (pullAndPush != null) {
subscriberStream.cancelJob(pullAndPush);
releasePendingMessage();
pullAndPush = null;
}
if (waitLiveJob != null) {
schedulingService.removeScheduledJob(... | [
"private",
"void",
"clearWaitJobs",
"(",
")",
"{",
"log",
".",
"debug",
"(",
"\"Clear wait jobs\"",
")",
";",
"if",
"(",
"pullAndPush",
"!=",
"null",
")",
"{",
"subscriberStream",
".",
"cancelJob",
"(",
"pullAndPush",
")",
";",
"releasePendingMessage",
"(",
... | Clear all scheduled waiting jobs | [
"Clear",
"all",
"scheduled",
"waiting",
"jobs"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L948-L959 |
108,135 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.doPushMessage | private void doPushMessage(Status status) {
StatusMessage message = new StatusMessage();
message.setBody(status);
doPushMessage(message);
} | java | private void doPushMessage(Status status) {
StatusMessage message = new StatusMessage();
message.setBody(status);
doPushMessage(message);
} | [
"private",
"void",
"doPushMessage",
"(",
"Status",
"status",
")",
"{",
"StatusMessage",
"message",
"=",
"new",
"StatusMessage",
"(",
")",
";",
"message",
".",
"setBody",
"(",
"status",
")",
";",
"doPushMessage",
"(",
"message",
")",
";",
"}"
] | Sends a status message.
@param status | [
"Sends",
"a",
"status",
"message",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L966-L970 |
108,136 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.doPushMessage | private void doPushMessage(AbstractMessage message) {
if (log.isTraceEnabled()) {
String msgType = message.getMessageType();
log.trace("doPushMessage: {}", msgType);
}
IMessageOutput out = msgOutReference.get();
if (out != null) {
try {
... | java | private void doPushMessage(AbstractMessage message) {
if (log.isTraceEnabled()) {
String msgType = message.getMessageType();
log.trace("doPushMessage: {}", msgType);
}
IMessageOutput out = msgOutReference.get();
if (out != null) {
try {
... | [
"private",
"void",
"doPushMessage",
"(",
"AbstractMessage",
"message",
")",
"{",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"String",
"msgType",
"=",
"message",
".",
"getMessageType",
"(",
")",
";",
"log",
".",
"trace",
"(",
"\"doPushMess... | Send message to output stream and handle exceptions.
@param message
The message to send. | [
"Send",
"message",
"to",
"output",
"stream",
"and",
"handle",
"exceptions",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L978-L1002 |
108,137 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendMessage | private void sendMessage(RTMPMessage messageIn) {
IRTMPEvent eventIn = messageIn.getBody();
IRTMPEvent event;
switch (eventIn.getDataType()) {
case Constants.TYPE_AGGREGATE:
event = new Aggregate(((Aggregate) eventIn).getData());
break;
cas... | java | private void sendMessage(RTMPMessage messageIn) {
IRTMPEvent eventIn = messageIn.getBody();
IRTMPEvent event;
switch (eventIn.getDataType()) {
case Constants.TYPE_AGGREGATE:
event = new Aggregate(((Aggregate) eventIn).getData());
break;
cas... | [
"private",
"void",
"sendMessage",
"(",
"RTMPMessage",
"messageIn",
")",
"{",
"IRTMPEvent",
"eventIn",
"=",
"messageIn",
".",
"getBody",
"(",
")",
";",
"IRTMPEvent",
"event",
";",
"switch",
"(",
"eventIn",
".",
"getDataType",
"(",
")",
")",
"{",
"case",
"Co... | Send an RTMP message
@param messageIn
incoming RTMP message | [
"Send",
"an",
"RTMP",
"message"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1010-L1072 |
108,138 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendClearPing | private void sendClearPing() {
Ping eof = new Ping();
eof.setEventType(Ping.STREAM_PLAYBUFFER_CLEAR);
eof.setValue2(streamId);
// eos
RTMPMessage eofMsg = RTMPMessage.build(eof);
doPushMessage(eofMsg);
} | java | private void sendClearPing() {
Ping eof = new Ping();
eof.setEventType(Ping.STREAM_PLAYBUFFER_CLEAR);
eof.setValue2(streamId);
// eos
RTMPMessage eofMsg = RTMPMessage.build(eof);
doPushMessage(eofMsg);
} | [
"private",
"void",
"sendClearPing",
"(",
")",
"{",
"Ping",
"eof",
"=",
"new",
"Ping",
"(",
")",
";",
"eof",
".",
"setEventType",
"(",
"Ping",
".",
"STREAM_PLAYBUFFER_CLEAR",
")",
";",
"eof",
".",
"setValue2",
"(",
"streamId",
")",
";",
"// eos ",
"RTMPMe... | Send clear ping. Lets client know that stream has no more data to send. | [
"Send",
"clear",
"ping",
".",
"Lets",
"client",
"know",
"that",
"stream",
"has",
"no",
"more",
"data",
"to",
"send",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1077-L1084 |
108,139 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendReset | private void sendReset() {
if (pullMode) {
Ping recorded = new Ping();
recorded.setEventType(Ping.RECORDED_STREAM);
recorded.setValue2(streamId);
// recorded
RTMPMessage recordedMsg = RTMPMessage.build(recorded);
doPushMessage(recordedMsg)... | java | private void sendReset() {
if (pullMode) {
Ping recorded = new Ping();
recorded.setEventType(Ping.RECORDED_STREAM);
recorded.setValue2(streamId);
// recorded
RTMPMessage recordedMsg = RTMPMessage.build(recorded);
doPushMessage(recordedMsg)... | [
"private",
"void",
"sendReset",
"(",
")",
"{",
"if",
"(",
"pullMode",
")",
"{",
"Ping",
"recorded",
"=",
"new",
"Ping",
"(",
")",
";",
"recorded",
".",
"setEventType",
"(",
"Ping",
".",
"RECORDED_STREAM",
")",
";",
"recorded",
".",
"setValue2",
"(",
"s... | Send reset message | [
"Send",
"reset",
"message"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1089-L1107 |
108,140 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendResetStatus | private void sendResetStatus(IPlayItem item) {
Status reset = new Status(StatusCodes.NS_PLAY_RESET);
reset.setClientid(streamId);
reset.setDetails(item.getName());
reset.setDesciption(String.format("Playing and resetting %s.", item.getName()));
doPushMessage(reset);
} | java | private void sendResetStatus(IPlayItem item) {
Status reset = new Status(StatusCodes.NS_PLAY_RESET);
reset.setClientid(streamId);
reset.setDetails(item.getName());
reset.setDesciption(String.format("Playing and resetting %s.", item.getName()));
doPushMessage(reset);
} | [
"private",
"void",
"sendResetStatus",
"(",
"IPlayItem",
"item",
")",
"{",
"Status",
"reset",
"=",
"new",
"Status",
"(",
"StatusCodes",
".",
"NS_PLAY_RESET",
")",
";",
"reset",
".",
"setClientid",
"(",
"streamId",
")",
";",
"reset",
".",
"setDetails",
"(",
... | Send reset status for item
@param item
Playlist item | [
"Send",
"reset",
"status",
"for",
"item"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1115-L1122 |
108,141 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendStartStatus | private void sendStartStatus(IPlayItem item) {
Status start = new Status(StatusCodes.NS_PLAY_START);
start.setClientid(streamId);
start.setDetails(item.getName());
start.setDesciption(String.format("Started playing %s.", item.getName()));
doPushMessage(start);
} | java | private void sendStartStatus(IPlayItem item) {
Status start = new Status(StatusCodes.NS_PLAY_START);
start.setClientid(streamId);
start.setDetails(item.getName());
start.setDesciption(String.format("Started playing %s.", item.getName()));
doPushMessage(start);
} | [
"private",
"void",
"sendStartStatus",
"(",
"IPlayItem",
"item",
")",
"{",
"Status",
"start",
"=",
"new",
"Status",
"(",
"StatusCodes",
".",
"NS_PLAY_START",
")",
";",
"start",
".",
"setClientid",
"(",
"streamId",
")",
";",
"start",
".",
"setDetails",
"(",
... | Send playback start status notification
@param item
Playlist item | [
"Send",
"playback",
"start",
"status",
"notification"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1130-L1137 |
108,142 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendStopStatus | private void sendStopStatus(IPlayItem item) {
Status stop = new Status(StatusCodes.NS_PLAY_STOP);
stop.setClientid(streamId);
stop.setDesciption(String.format("Stopped playing %s.", item.getName()));
stop.setDetails(item.getName());
doPushMessage(stop);
} | java | private void sendStopStatus(IPlayItem item) {
Status stop = new Status(StatusCodes.NS_PLAY_STOP);
stop.setClientid(streamId);
stop.setDesciption(String.format("Stopped playing %s.", item.getName()));
stop.setDetails(item.getName());
doPushMessage(stop);
} | [
"private",
"void",
"sendStopStatus",
"(",
"IPlayItem",
"item",
")",
"{",
"Status",
"stop",
"=",
"new",
"Status",
"(",
"StatusCodes",
".",
"NS_PLAY_STOP",
")",
";",
"stop",
".",
"setClientid",
"(",
"streamId",
")",
";",
"stop",
".",
"setDesciption",
"(",
"S... | Send playback stoppage status notification
@param item
Playlist item | [
"Send",
"playback",
"stoppage",
"status",
"notification"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1145-L1152 |
108,143 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendOnPlayStatus | private void sendOnPlayStatus(String code, int duration, long bytes) {
if (log.isDebugEnabled()) {
log.debug("Sending onPlayStatus - code: {} duration: {} bytes: {}", code, duration, bytes);
}
// create the buffer
IoBuffer buf = IoBuffer.allocate(102);
buf.setAutoExpa... | java | private void sendOnPlayStatus(String code, int duration, long bytes) {
if (log.isDebugEnabled()) {
log.debug("Sending onPlayStatus - code: {} duration: {} bytes: {}", code, duration, bytes);
}
// create the buffer
IoBuffer buf = IoBuffer.allocate(102);
buf.setAutoExpa... | [
"private",
"void",
"sendOnPlayStatus",
"(",
"String",
"code",
",",
"int",
"duration",
",",
"long",
"bytes",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Sending onPlayStatus - code: {} duration: {} bytes: {}... | Sends an onPlayStatus message.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetDataEvent.html
@param code
@param duration
@param bytes | [
"Sends",
"an",
"onPlayStatus",
"message",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1163-L1194 |
108,144 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendCompleteStatus | private void sendCompleteStatus() {
// may be the correct duration
int duration = (lastMessageTs > 0) ? Math.max(0, lastMessageTs - streamStartTS.get()) : 0;
if (log.isDebugEnabled()) {
log.debug("sendCompleteStatus - duration: {} bytes sent: {}", duration, bytesSent.get());
... | java | private void sendCompleteStatus() {
// may be the correct duration
int duration = (lastMessageTs > 0) ? Math.max(0, lastMessageTs - streamStartTS.get()) : 0;
if (log.isDebugEnabled()) {
log.debug("sendCompleteStatus - duration: {} bytes sent: {}", duration, bytesSent.get());
... | [
"private",
"void",
"sendCompleteStatus",
"(",
")",
"{",
"// may be the correct duration",
"int",
"duration",
"=",
"(",
"lastMessageTs",
">",
"0",
")",
"?",
"Math",
".",
"max",
"(",
"0",
",",
"lastMessageTs",
"-",
"streamStartTS",
".",
"get",
"(",
")",
")",
... | Send playlist complete status notification | [
"Send",
"playlist",
"complete",
"status",
"notification"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1215-L1222 |
108,145 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendSeekStatus | private void sendSeekStatus(IPlayItem item, int position) {
Status seek = new Status(StatusCodes.NS_SEEK_NOTIFY);
seek.setClientid(streamId);
seek.setDetails(item.getName());
seek.setDesciption(String.format("Seeking %d (stream ID: %d).", position, streamId));
doPushMessage(seek... | java | private void sendSeekStatus(IPlayItem item, int position) {
Status seek = new Status(StatusCodes.NS_SEEK_NOTIFY);
seek.setClientid(streamId);
seek.setDetails(item.getName());
seek.setDesciption(String.format("Seeking %d (stream ID: %d).", position, streamId));
doPushMessage(seek... | [
"private",
"void",
"sendSeekStatus",
"(",
"IPlayItem",
"item",
",",
"int",
"position",
")",
"{",
"Status",
"seek",
"=",
"new",
"Status",
"(",
"StatusCodes",
".",
"NS_SEEK_NOTIFY",
")",
";",
"seek",
".",
"setClientid",
"(",
"streamId",
")",
";",
"seek",
"."... | Send seek status notification
@param item
Playlist item
@param position
Seek position | [
"Send",
"seek",
"status",
"notification"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1232-L1239 |
108,146 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendPauseStatus | private void sendPauseStatus(IPlayItem item) {
Status pause = new Status(StatusCodes.NS_PAUSE_NOTIFY);
pause.setClientid(streamId);
pause.setDetails(item.getName());
doPushMessage(pause);
} | java | private void sendPauseStatus(IPlayItem item) {
Status pause = new Status(StatusCodes.NS_PAUSE_NOTIFY);
pause.setClientid(streamId);
pause.setDetails(item.getName());
doPushMessage(pause);
} | [
"private",
"void",
"sendPauseStatus",
"(",
"IPlayItem",
"item",
")",
"{",
"Status",
"pause",
"=",
"new",
"Status",
"(",
"StatusCodes",
".",
"NS_PAUSE_NOTIFY",
")",
";",
"pause",
".",
"setClientid",
"(",
"streamId",
")",
";",
"pause",
".",
"setDetails",
"(",
... | Send pause status notification
@param item
Playlist item | [
"Send",
"pause",
"status",
"notification"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1247-L1253 |
108,147 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendResumeStatus | private void sendResumeStatus(IPlayItem item) {
Status resume = new Status(StatusCodes.NS_UNPAUSE_NOTIFY);
resume.setClientid(streamId);
resume.setDetails(item.getName());
doPushMessage(resume);
} | java | private void sendResumeStatus(IPlayItem item) {
Status resume = new Status(StatusCodes.NS_UNPAUSE_NOTIFY);
resume.setClientid(streamId);
resume.setDetails(item.getName());
doPushMessage(resume);
} | [
"private",
"void",
"sendResumeStatus",
"(",
"IPlayItem",
"item",
")",
"{",
"Status",
"resume",
"=",
"new",
"Status",
"(",
"StatusCodes",
".",
"NS_UNPAUSE_NOTIFY",
")",
";",
"resume",
".",
"setClientid",
"(",
"streamId",
")",
";",
"resume",
".",
"setDetails",
... | Send resume status notification
@param item
Playlist item | [
"Send",
"resume",
"status",
"notification"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1261-L1267 |
108,148 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendPublishedStatus | private void sendPublishedStatus(IPlayItem item) {
Status published = new Status(StatusCodes.NS_PLAY_PUBLISHNOTIFY);
published.setClientid(streamId);
published.setDetails(item.getName());
doPushMessage(published);
} | java | private void sendPublishedStatus(IPlayItem item) {
Status published = new Status(StatusCodes.NS_PLAY_PUBLISHNOTIFY);
published.setClientid(streamId);
published.setDetails(item.getName());
doPushMessage(published);
} | [
"private",
"void",
"sendPublishedStatus",
"(",
"IPlayItem",
"item",
")",
"{",
"Status",
"published",
"=",
"new",
"Status",
"(",
"StatusCodes",
".",
"NS_PLAY_PUBLISHNOTIFY",
")",
";",
"published",
".",
"setClientid",
"(",
"streamId",
")",
";",
"published",
".",
... | Send published status notification
@param item
Playlist item | [
"Send",
"published",
"status",
"notification"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1275-L1281 |
108,149 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendUnpublishedStatus | private void sendUnpublishedStatus(IPlayItem item) {
Status unpublished = new Status(StatusCodes.NS_PLAY_UNPUBLISHNOTIFY);
unpublished.setClientid(streamId);
unpublished.setDetails(item.getName());
doPushMessage(unpublished);
} | java | private void sendUnpublishedStatus(IPlayItem item) {
Status unpublished = new Status(StatusCodes.NS_PLAY_UNPUBLISHNOTIFY);
unpublished.setClientid(streamId);
unpublished.setDetails(item.getName());
doPushMessage(unpublished);
} | [
"private",
"void",
"sendUnpublishedStatus",
"(",
"IPlayItem",
"item",
")",
"{",
"Status",
"unpublished",
"=",
"new",
"Status",
"(",
"StatusCodes",
".",
"NS_PLAY_UNPUBLISHNOTIFY",
")",
";",
"unpublished",
".",
"setClientid",
"(",
"streamId",
")",
";",
"unpublished"... | Send unpublished status notification
@param item
Playlist item | [
"Send",
"unpublished",
"status",
"notification"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1289-L1295 |
108,150 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendStreamNotFoundStatus | private void sendStreamNotFoundStatus(IPlayItem item) {
Status notFound = new Status(StatusCodes.NS_PLAY_STREAMNOTFOUND);
notFound.setClientid(streamId);
notFound.setLevel(Status.ERROR);
notFound.setDetails(item.getName());
doPushMessage(notFound);
} | java | private void sendStreamNotFoundStatus(IPlayItem item) {
Status notFound = new Status(StatusCodes.NS_PLAY_STREAMNOTFOUND);
notFound.setClientid(streamId);
notFound.setLevel(Status.ERROR);
notFound.setDetails(item.getName());
doPushMessage(notFound);
} | [
"private",
"void",
"sendStreamNotFoundStatus",
"(",
"IPlayItem",
"item",
")",
"{",
"Status",
"notFound",
"=",
"new",
"Status",
"(",
"StatusCodes",
".",
"NS_PLAY_STREAMNOTFOUND",
")",
";",
"notFound",
".",
"setClientid",
"(",
"streamId",
")",
";",
"notFound",
"."... | Stream not found status notification
@param item
Playlist item | [
"Stream",
"not",
"found",
"status",
"notification"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1303-L1310 |
108,151 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendInsufficientBandwidthStatus | private void sendInsufficientBandwidthStatus(IPlayItem item) {
Status insufficientBW = new Status(StatusCodes.NS_PLAY_INSUFFICIENT_BW);
insufficientBW.setClientid(streamId);
insufficientBW.setLevel(Status.WARNING);
insufficientBW.setDetails(item.getName());
insufficientBW.setDesc... | java | private void sendInsufficientBandwidthStatus(IPlayItem item) {
Status insufficientBW = new Status(StatusCodes.NS_PLAY_INSUFFICIENT_BW);
insufficientBW.setClientid(streamId);
insufficientBW.setLevel(Status.WARNING);
insufficientBW.setDetails(item.getName());
insufficientBW.setDesc... | [
"private",
"void",
"sendInsufficientBandwidthStatus",
"(",
"IPlayItem",
"item",
")",
"{",
"Status",
"insufficientBW",
"=",
"new",
"Status",
"(",
"StatusCodes",
".",
"NS_PLAY_INSUFFICIENT_BW",
")",
";",
"insufficientBW",
".",
"setClientid",
"(",
"streamId",
")",
";",... | Insufficient bandwidth notification
@param item
Playlist item | [
"Insufficient",
"bandwidth",
"notification"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1318-L1326 |
108,152 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendVODInitCM | private void sendVODInitCM(IPlayItem item) {
OOBControlMessage oobCtrlMsg = new OOBControlMessage();
oobCtrlMsg.setTarget(IPassive.KEY);
oobCtrlMsg.setServiceName("init");
Map<String, Object> paramMap = new HashMap<String, Object>(1);
paramMap.put("startTS", (int) item.getStart()... | java | private void sendVODInitCM(IPlayItem item) {
OOBControlMessage oobCtrlMsg = new OOBControlMessage();
oobCtrlMsg.setTarget(IPassive.KEY);
oobCtrlMsg.setServiceName("init");
Map<String, Object> paramMap = new HashMap<String, Object>(1);
paramMap.put("startTS", (int) item.getStart()... | [
"private",
"void",
"sendVODInitCM",
"(",
"IPlayItem",
"item",
")",
"{",
"OOBControlMessage",
"oobCtrlMsg",
"=",
"new",
"OOBControlMessage",
"(",
")",
";",
"oobCtrlMsg",
".",
"setTarget",
"(",
"IPassive",
".",
"KEY",
")",
";",
"oobCtrlMsg",
".",
"setServiceName",... | Send VOD init control message
@param item
Playlist item | [
"Send",
"VOD",
"init",
"control",
"message"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1334-L1342 |
108,153 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendVODSeekCM | private int sendVODSeekCM(int position) {
OOBControlMessage oobCtrlMsg = new OOBControlMessage();
oobCtrlMsg.setTarget(ISeekableProvider.KEY);
oobCtrlMsg.setServiceName("seek");
Map<String, Object> paramMap = new HashMap<String, Object>(1);
paramMap.put("position", position);
... | java | private int sendVODSeekCM(int position) {
OOBControlMessage oobCtrlMsg = new OOBControlMessage();
oobCtrlMsg.setTarget(ISeekableProvider.KEY);
oobCtrlMsg.setServiceName("seek");
Map<String, Object> paramMap = new HashMap<String, Object>(1);
paramMap.put("position", position);
... | [
"private",
"int",
"sendVODSeekCM",
"(",
"int",
"position",
")",
"{",
"OOBControlMessage",
"oobCtrlMsg",
"=",
"new",
"OOBControlMessage",
"(",
")",
";",
"oobCtrlMsg",
".",
"setTarget",
"(",
"ISeekableProvider",
".",
"KEY",
")",
";",
"oobCtrlMsg",
".",
"setService... | Send VOD seek control message
@param msgIn
Message input
@param position
Playlist item
@return Out-of-band control message call result or -1 on failure | [
"Send",
"VOD",
"seek",
"control",
"message"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1353-L1366 |
108,154 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendCheckVideoCM | private boolean sendCheckVideoCM() {
OOBControlMessage oobCtrlMsg = new OOBControlMessage();
oobCtrlMsg.setTarget(IStreamTypeAwareProvider.KEY);
oobCtrlMsg.setServiceName("hasVideo");
msgInReference.get().sendOOBControlMessage(this, oobCtrlMsg);
if (oobCtrlMsg.getResult() instanc... | java | private boolean sendCheckVideoCM() {
OOBControlMessage oobCtrlMsg = new OOBControlMessage();
oobCtrlMsg.setTarget(IStreamTypeAwareProvider.KEY);
oobCtrlMsg.setServiceName("hasVideo");
msgInReference.get().sendOOBControlMessage(this, oobCtrlMsg);
if (oobCtrlMsg.getResult() instanc... | [
"private",
"boolean",
"sendCheckVideoCM",
"(",
")",
"{",
"OOBControlMessage",
"oobCtrlMsg",
"=",
"new",
"OOBControlMessage",
"(",
")",
";",
"oobCtrlMsg",
".",
"setTarget",
"(",
"IStreamTypeAwareProvider",
".",
"KEY",
")",
";",
"oobCtrlMsg",
".",
"setServiceName",
... | Send VOD check video control message
@return result of oob control message | [
"Send",
"VOD",
"check",
"video",
"control",
"message"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1373-L1383 |
108,155 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.pendingVideoMessages | private long pendingVideoMessages() {
IMessageOutput out = msgOutReference.get();
if (out != null) {
OOBControlMessage pendingRequest = new OOBControlMessage();
pendingRequest.setTarget("ConnectionConsumer");
pendingRequest.setServiceName("pendingVideoCount");
... | java | private long pendingVideoMessages() {
IMessageOutput out = msgOutReference.get();
if (out != null) {
OOBControlMessage pendingRequest = new OOBControlMessage();
pendingRequest.setTarget("ConnectionConsumer");
pendingRequest.setServiceName("pendingVideoCount");
... | [
"private",
"long",
"pendingVideoMessages",
"(",
")",
"{",
"IMessageOutput",
"out",
"=",
"msgOutReference",
".",
"get",
"(",
")",
";",
"if",
"(",
"out",
"!=",
"null",
")",
"{",
"OOBControlMessage",
"pendingRequest",
"=",
"new",
"OOBControlMessage",
"(",
")",
... | Get number of pending video messages
@return Number of pending video messages | [
"Get",
"number",
"of",
"pending",
"video",
"messages"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1573-L1585 |
108,156 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.releasePendingMessage | private void releasePendingMessage() {
if (pendingMessage != null) {
IRTMPEvent body = pendingMessage.getBody();
if (body instanceof IStreamData && ((IStreamData<?>) body).getData() != null) {
((IStreamData<?>) body).getData().free();
}
pendingMess... | java | private void releasePendingMessage() {
if (pendingMessage != null) {
IRTMPEvent body = pendingMessage.getBody();
if (body instanceof IStreamData && ((IStreamData<?>) body).getData() != null) {
((IStreamData<?>) body).getData().free();
}
pendingMess... | [
"private",
"void",
"releasePendingMessage",
"(",
")",
"{",
"if",
"(",
"pendingMessage",
"!=",
"null",
")",
"{",
"IRTMPEvent",
"body",
"=",
"pendingMessage",
".",
"getBody",
"(",
")",
";",
"if",
"(",
"body",
"instanceof",
"IStreamData",
"&&",
"(",
"(",
"ISt... | Releases pending message body, nullifies pending message object | [
"Releases",
"pending",
"message",
"body",
"nullifies",
"pending",
"message",
"object"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1674-L1682 |
108,157 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.checkSendMessageEnabled | protected boolean checkSendMessageEnabled(RTMPMessage message) {
IRTMPEvent body = message.getBody();
if (!receiveAudio && body instanceof AudioData) {
// The user doesn't want to get audio packets
((IStreamData<?>) body).getData().free();
if (sendBlankAudio) {
... | java | protected boolean checkSendMessageEnabled(RTMPMessage message) {
IRTMPEvent body = message.getBody();
if (!receiveAudio && body instanceof AudioData) {
// The user doesn't want to get audio packets
((IStreamData<?>) body).getData().free();
if (sendBlankAudio) {
... | [
"protected",
"boolean",
"checkSendMessageEnabled",
"(",
"RTMPMessage",
"message",
")",
"{",
"IRTMPEvent",
"body",
"=",
"message",
".",
"getBody",
"(",
")",
";",
"if",
"(",
"!",
"receiveAudio",
"&&",
"body",
"instanceof",
"AudioData",
")",
"{",
"// The user doesn... | Check if sending the given message was enabled by the client.
@param message
the message to check
@return true if the message should be sent, false otherwise (and the message is discarded) | [
"Check",
"if",
"sending",
"the",
"given",
"message",
"was",
"enabled",
"by",
"the",
"client",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1691-L1716 |
108,158 | Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.runDeferredStop | private void runDeferredStop() {
// Stop current jobs from running.
clearWaitJobs();
// Schedule deferred stop executor.
log.trace("Ran deferred stop");
if (deferredStop == null) {
// set deferred stop if we get a job name returned
deferredStop = subscrib... | java | private void runDeferredStop() {
// Stop current jobs from running.
clearWaitJobs();
// Schedule deferred stop executor.
log.trace("Ran deferred stop");
if (deferredStop == null) {
// set deferred stop if we get a job name returned
deferredStop = subscrib... | [
"private",
"void",
"runDeferredStop",
"(",
")",
"{",
"// Stop current jobs from running.",
"clearWaitJobs",
"(",
")",
";",
"// Schedule deferred stop executor.",
"log",
".",
"trace",
"(",
"\"Ran deferred stop\"",
")",
";",
"if",
"(",
"deferredStop",
"==",
"null",
")",... | Schedule a stop to be run from a separate thread to allow the background thread to stop cleanly. | [
"Schedule",
"a",
"stop",
"to",
"be",
"run",
"from",
"a",
"separate",
"thread",
"to",
"allow",
"the",
"background",
"thread",
"to",
"stop",
"cleanly",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1721-L1730 |
108,159 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/event/AllocationDebugger.java | AllocationDebugger.release | protected void release(BaseEvent event) {
Info info = events.get(event);
if (info != null) {
if (info.refcount.decrementAndGet() == 0) {
events.remove(event);
}
} else {
log.warn("Release called on already released event.");
}
} | java | protected void release(BaseEvent event) {
Info info = events.get(event);
if (info != null) {
if (info.refcount.decrementAndGet() == 0) {
events.remove(event);
}
} else {
log.warn("Release called on already released event.");
}
} | [
"protected",
"void",
"release",
"(",
"BaseEvent",
"event",
")",
"{",
"Info",
"info",
"=",
"events",
".",
"get",
"(",
"event",
")",
";",
"if",
"(",
"info",
"!=",
"null",
")",
"{",
"if",
"(",
"info",
".",
"refcount",
".",
"decrementAndGet",
"(",
")",
... | Release event if there's no more references to it
@param event
Event | [
"Release",
"event",
"if",
"there",
"s",
"no",
"more",
"references",
"to",
"it"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/event/AllocationDebugger.java#L114-L123 |
108,160 | Red5/red5-server-common | src/main/java/org/red5/server/util/ScopeUtils.java | ScopeUtils.resolveScope | public static IScope resolveScope(IScope from, String path) {
log.debug("resolveScope from: {} path: {}", from.getName(), path);
IScope current = from;
if (path.startsWith(SLASH)) {
current = ScopeUtils.findRoot(current);
path = path.substring(1, path.length());
}... | java | public static IScope resolveScope(IScope from, String path) {
log.debug("resolveScope from: {} path: {}", from.getName(), path);
IScope current = from;
if (path.startsWith(SLASH)) {
current = ScopeUtils.findRoot(current);
path = path.substring(1, path.length());
}... | [
"public",
"static",
"IScope",
"resolveScope",
"(",
"IScope",
"from",
",",
"String",
"path",
")",
"{",
"log",
".",
"debug",
"(",
"\"resolveScope from: {} path: {}\"",
",",
"from",
".",
"getName",
"(",
")",
",",
"path",
")",
";",
"IScope",
"current",
"=",
"f... | Resolves scope for specified scope and path.
@param from
Scope to use as context (to start from)
@param path
Path to resolve
@return Resolved scope | [
"Resolves",
"scope",
"for",
"specified",
"scope",
"and",
"path",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/ScopeUtils.java#L58-L92 |
108,161 | Red5/red5-server-common | src/main/java/org/red5/server/util/ScopeUtils.java | ScopeUtils.findRoot | public static IScope findRoot(IScope from) {
IScope current = from;
while (current.hasParent()) {
current = current.getParent();
}
return current;
} | java | public static IScope findRoot(IScope from) {
IScope current = from;
while (current.hasParent()) {
current = current.getParent();
}
return current;
} | [
"public",
"static",
"IScope",
"findRoot",
"(",
"IScope",
"from",
")",
"{",
"IScope",
"current",
"=",
"from",
";",
"while",
"(",
"current",
".",
"hasParent",
"(",
")",
")",
"{",
"current",
"=",
"current",
".",
"getParent",
"(",
")",
";",
"}",
"return",
... | Finds root scope for specified scope object. Root scope is the top level scope among scope's parents.
@param from
Scope to find root for
@return Root scope object | [
"Finds",
"root",
"scope",
"for",
"specified",
"scope",
"object",
".",
"Root",
"scope",
"is",
"the",
"top",
"level",
"scope",
"among",
"scope",
"s",
"parents",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/ScopeUtils.java#L101-L107 |
108,162 | Red5/red5-server-common | src/main/java/org/red5/server/util/ScopeUtils.java | ScopeUtils.findApplication | public static IScope findApplication(IScope from) {
IScope current = from;
while (current.hasParent() && !current.getType().equals(ScopeType.APPLICATION)) {
current = current.getParent();
}
return current;
} | java | public static IScope findApplication(IScope from) {
IScope current = from;
while (current.hasParent() && !current.getType().equals(ScopeType.APPLICATION)) {
current = current.getParent();
}
return current;
} | [
"public",
"static",
"IScope",
"findApplication",
"(",
"IScope",
"from",
")",
"{",
"IScope",
"current",
"=",
"from",
";",
"while",
"(",
"current",
".",
"hasParent",
"(",
")",
"&&",
"!",
"current",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"ScopeType",... | Returns the application scope for specified scope. Application scope has depth of 1 and has no parent.
See
<pre>
isApp
</pre>
method for details.
@param from
Scope to find application for
@return Application scope. | [
"Returns",
"the",
"application",
"scope",
"for",
"specified",
"scope",
".",
"Application",
"scope",
"has",
"depth",
"of",
"1",
"and",
"has",
"no",
"parent",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/ScopeUtils.java#L124-L130 |
108,163 | Red5/red5-server-common | src/main/java/org/red5/server/util/ScopeUtils.java | ScopeUtils.isAncestor | public static boolean isAncestor(IBasicScope from, IBasicScope ancestor) {
IBasicScope current = from;
while (current.hasParent()) {
current = current.getParent();
if (current.equals(ancestor)) {
return true;
}
}
return false;
} | java | public static boolean isAncestor(IBasicScope from, IBasicScope ancestor) {
IBasicScope current = from;
while (current.hasParent()) {
current = current.getParent();
if (current.equals(ancestor)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isAncestor",
"(",
"IBasicScope",
"from",
",",
"IBasicScope",
"ancestor",
")",
"{",
"IBasicScope",
"current",
"=",
"from",
";",
"while",
"(",
"current",
".",
"hasParent",
"(",
")",
")",
"{",
"current",
"=",
"current",
".",
"g... | Check whether one scope is an ancestor of another
@param from
Scope
@param ancestor
Scope to check
@return <pre>
true
</pre>
if ancestor scope is really an ancestor of scope passed as from parameter,
<pre>
false
</pre>
otherwise. | [
"Check",
"whether",
"one",
"scope",
"is",
"an",
"ancestor",
"of",
"another"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/ScopeUtils.java#L151-L160 |
108,164 | Red5/red5-server-common | src/main/java/org/red5/server/util/ScopeUtils.java | ScopeUtils.getScopeService | protected static Object getScopeService(IScope scope, String name) {
return getScopeService(scope, name, null);
} | java | protected static Object getScopeService(IScope scope, String name) {
return getScopeService(scope, name, null);
} | [
"protected",
"static",
"Object",
"getScopeService",
"(",
"IScope",
"scope",
",",
"String",
"name",
")",
"{",
"return",
"getScopeService",
"(",
"scope",
",",
"name",
",",
"null",
")",
";",
"}"
] | Returns scope service by bean name. See overloaded method for details.
@param scope
scope
@param name
name
@return object | [
"Returns",
"scope",
"service",
"by",
"bean",
"name",
".",
"See",
"overloaded",
"method",
"for",
"details",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/ScopeUtils.java#L257-L259 |
108,165 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/codec/RTMP.java | RTMP.getChannelInfo | private ChannelInfo getChannelInfo(int channelId) {
ChannelInfo info = channels.putIfAbsent(channelId, new ChannelInfo());
if (info == null) {
info = channels.get(channelId);
}
return info;
} | java | private ChannelInfo getChannelInfo(int channelId) {
ChannelInfo info = channels.putIfAbsent(channelId, new ChannelInfo());
if (info == null) {
info = channels.get(channelId);
}
return info;
} | [
"private",
"ChannelInfo",
"getChannelInfo",
"(",
"int",
"channelId",
")",
"{",
"ChannelInfo",
"info",
"=",
"channels",
".",
"putIfAbsent",
"(",
"channelId",
",",
"new",
"ChannelInfo",
"(",
")",
")",
";",
"if",
"(",
"info",
"==",
"null",
")",
"{",
"info",
... | Returns channel information for a given channel id.
@param channelId
@return channel info | [
"Returns",
"channel",
"information",
"for",
"a",
"given",
"channel",
"id",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMP.java#L122-L128 |
108,166 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/codec/RTMP.java | RTMP.freePacket | private void freePacket(Packet packet) {
if (packet != null && packet.getData() != null) {
packet.clearData();
}
} | java | private void freePacket(Packet packet) {
if (packet != null && packet.getData() != null) {
packet.clearData();
}
} | [
"private",
"void",
"freePacket",
"(",
"Packet",
"packet",
")",
"{",
"if",
"(",
"packet",
"!=",
"null",
"&&",
"packet",
".",
"getData",
"(",
")",
"!=",
"null",
")",
"{",
"packet",
".",
"clearData",
"(",
")",
";",
"}",
"}"
] | Releases a packet.
@param packet
Packet to release | [
"Releases",
"a",
"packet",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMP.java#L160-L164 |
108,167 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/codec/RTMP.java | RTMP.freeChannels | private void freeChannels() {
for (ChannelInfo info : channels.values()) {
freePacket(info.getReadPacket());
freePacket(info.getWritePacket());
}
channels.clear();
} | java | private void freeChannels() {
for (ChannelInfo info : channels.values()) {
freePacket(info.getReadPacket());
freePacket(info.getWritePacket());
}
channels.clear();
} | [
"private",
"void",
"freeChannels",
"(",
")",
"{",
"for",
"(",
"ChannelInfo",
"info",
":",
"channels",
".",
"values",
"(",
")",
")",
"{",
"freePacket",
"(",
"info",
".",
"getReadPacket",
"(",
")",
")",
";",
"freePacket",
"(",
"info",
".",
"getWritePacket"... | Releases the channels. | [
"Releases",
"the",
"channels",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMP.java#L169-L175 |
108,168 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/codec/RTMP.java | RTMP.setLastReadPacket | public void setLastReadPacket(int channelId, Packet packet) {
final ChannelInfo info = getChannelInfo(channelId);
// grab last packet
Packet prevPacket = info.getReadPacket();
// set new one
info.setReadPacket(packet);
// free the previous packet
freePacket... | java | public void setLastReadPacket(int channelId, Packet packet) {
final ChannelInfo info = getChannelInfo(channelId);
// grab last packet
Packet prevPacket = info.getReadPacket();
// set new one
info.setReadPacket(packet);
// free the previous packet
freePacket... | [
"public",
"void",
"setLastReadPacket",
"(",
"int",
"channelId",
",",
"Packet",
"packet",
")",
"{",
"final",
"ChannelInfo",
"info",
"=",
"getChannelInfo",
"(",
"channelId",
")",
";",
"// grab last packet\r",
"Packet",
"prevPacket",
"=",
"info",
".",
"getReadPacket"... | Setter for last read packet.
@param channelId
Channel id
@param packet
Packet | [
"Setter",
"for",
"last",
"read",
"packet",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMP.java#L244-L252 |
108,169 | Red5/red5-server-common | src/main/java/org/red5/server/util/FileUtil.java | FileUtil.deleteDirectory | public static boolean deleteDirectory(String directory, boolean useOSNativeDelete) throws IOException {
boolean result = false;
if (!useOSNativeDelete) {
File dir = new File(directory);
// first all files have to be cleared out
for (File file : dir.listFiles()) {... | java | public static boolean deleteDirectory(String directory, boolean useOSNativeDelete) throws IOException {
boolean result = false;
if (!useOSNativeDelete) {
File dir = new File(directory);
// first all files have to be cleared out
for (File file : dir.listFiles()) {... | [
"public",
"static",
"boolean",
"deleteDirectory",
"(",
"String",
"directory",
",",
"boolean",
"useOSNativeDelete",
")",
"throws",
"IOException",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"!",
"useOSNativeDelete",
")",
"{",
"File",
"dir",
"=",
"ne... | Deletes a directory and its contents. This will fail if there are any file locks or if the directory cannot be emptied.
@param directory
directory to delete
@param useOSNativeDelete
flag to signify use of operating system delete function
@throws IOException
if directory cannot be deleted
@return true if directory was ... | [
"Deletes",
"a",
"directory",
"and",
"its",
"contents",
".",
"This",
"will",
"fail",
"if",
"there",
"are",
"any",
"file",
"locks",
"or",
"if",
"the",
"directory",
"cannot",
"be",
"emptied",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L132-L192 |
108,170 | Red5/red5-server-common | src/main/java/org/red5/server/util/FileUtil.java | FileUtil.stdOut | private final static Thread stdOut(final Process p) {
final byte[] empty = new byte[128];
for (int b = 0; b < empty.length; b++) {
empty[b] = (byte) 0;
}
Thread std = new Thread() {
public void run() {
StringBuilder sb = new StringBuilder(10... | java | private final static Thread stdOut(final Process p) {
final byte[] empty = new byte[128];
for (int b = 0; b < empty.length; b++) {
empty[b] = (byte) 0;
}
Thread std = new Thread() {
public void run() {
StringBuilder sb = new StringBuilder(10... | [
"private",
"final",
"static",
"Thread",
"stdOut",
"(",
"final",
"Process",
"p",
")",
"{",
"final",
"byte",
"[",
"]",
"empty",
"=",
"new",
"byte",
"[",
"128",
"]",
";",
"for",
"(",
"int",
"b",
"=",
"0",
";",
"b",
"<",
"empty",
".",
"length",
";",
... | Special method for capture of StdOut.
@return stdOut thread | [
"Special",
"method",
"for",
"capture",
"of",
"StdOut",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L215-L242 |
108,171 | Red5/red5-server-common | src/main/java/org/red5/server/util/FileUtil.java | FileUtil.unzip | public static void unzip(String compressedFileName, String destinationDir) {
//strip everything except the applications name
String dirName = null;
// checks to see if there is a dash "-" in the filename of the war.
String applicationName = compressedFileName.substring(compressedFil... | java | public static void unzip(String compressedFileName, String destinationDir) {
//strip everything except the applications name
String dirName = null;
// checks to see if there is a dash "-" in the filename of the war.
String applicationName = compressedFileName.substring(compressedFil... | [
"public",
"static",
"void",
"unzip",
"(",
"String",
"compressedFileName",
",",
"String",
"destinationDir",
")",
"{",
"//strip everything except the applications name\r",
"String",
"dirName",
"=",
"null",
";",
"// checks to see if there is a dash \"-\" in the filename of the war. ... | Unzips a war file to an application located under the webapps directory
@param compressedFileName
The String name of the war file
@param destinationDir
The destination directory, ie: webapps | [
"Unzips",
"a",
"war",
"file",
"to",
"an",
"application",
"located",
"under",
"the",
"webapps",
"directory"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L299-L369 |
108,172 | Red5/red5-server-common | src/main/java/org/red5/server/util/FileUtil.java | FileUtil.formatPath | public static String formatPath(String absWebappsPath, String contextDirName) {
StringBuilder path = new StringBuilder(absWebappsPath.length() + contextDirName.length());
path.append(absWebappsPath);
if (log.isTraceEnabled()) {
log.trace("Path start: {}", path.toString());
... | java | public static String formatPath(String absWebappsPath, String contextDirName) {
StringBuilder path = new StringBuilder(absWebappsPath.length() + contextDirName.length());
path.append(absWebappsPath);
if (log.isTraceEnabled()) {
log.trace("Path start: {}", path.toString());
... | [
"public",
"static",
"String",
"formatPath",
"(",
"String",
"absWebappsPath",
",",
"String",
"contextDirName",
")",
"{",
"StringBuilder",
"path",
"=",
"new",
"StringBuilder",
"(",
"absWebappsPath",
".",
"length",
"(",
")",
"+",
"contextDirName",
".",
"length",
"(... | Quick-n-dirty directory formatting to support launching in windows, specifically from ant.
@param absWebappsPath
abs webapps path
@param contextDirName
conext directory name
@return full path | [
"Quick",
"-",
"n",
"-",
"dirty",
"directory",
"formatting",
"to",
"support",
"launching",
"in",
"windows",
"specifically",
"from",
"ant",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L395-L435 |
108,173 | Red5/red5-server-common | src/main/java/org/red5/server/util/FileUtil.java | FileUtil.generateCustomName | public static String generateCustomName() {
Random random = new Random();
StringBuilder sb = new StringBuilder();
sb.append(PropertyConverter.getCurrentTimeSeconds());
sb.append('_');
int i = random.nextInt(99999);
if (i < 10) {
sb.append("0000");
... | java | public static String generateCustomName() {
Random random = new Random();
StringBuilder sb = new StringBuilder();
sb.append(PropertyConverter.getCurrentTimeSeconds());
sb.append('_');
int i = random.nextInt(99999);
if (i < 10) {
sb.append("0000");
... | [
"public",
"static",
"String",
"generateCustomName",
"(",
")",
"{",
"Random",
"random",
"=",
"new",
"Random",
"(",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"PropertyConverter",
".",
"getCurrentTime... | Generates a custom name containing numbers and an underscore ex. 282818_00023. The name contains current seconds and a random number component.
@return custom name | [
"Generates",
"a",
"custom",
"name",
"containing",
"numbers",
"and",
"an",
"underscore",
"ex",
".",
"282818_00023",
".",
"The",
"name",
"contains",
"current",
"seconds",
"and",
"a",
"random",
"number",
"component",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L442-L459 |
108,174 | Red5/red5-server-common | src/main/java/org/red5/server/util/FileUtil.java | FileUtil.readAsByteArray | public static byte[] readAsByteArray(File localSwfFile) {
byte[] fileBytes = new byte[(int) localSwfFile.length()];
byte[] b = new byte[1];
FileInputStream fis = null;
try {
fis = new FileInputStream(localSwfFile);
for (int i = 0; i < Integer.MAX_VALUE; i++)... | java | public static byte[] readAsByteArray(File localSwfFile) {
byte[] fileBytes = new byte[(int) localSwfFile.length()];
byte[] b = new byte[1];
FileInputStream fis = null;
try {
fis = new FileInputStream(localSwfFile);
for (int i = 0; i < Integer.MAX_VALUE; i++)... | [
"public",
"static",
"byte",
"[",
"]",
"readAsByteArray",
"(",
"File",
"localSwfFile",
")",
"{",
"byte",
"[",
"]",
"fileBytes",
"=",
"new",
"byte",
"[",
"(",
"int",
")",
"localSwfFile",
".",
"length",
"(",
")",
"]",
";",
"byte",
"[",
"]",
"b",
"=",
... | Reads all the bytes of a given file into an array. If the file size exceeds Integer.MAX_VALUE, it will be truncated.
@param localSwfFile
swf file
@return file bytes | [
"Reads",
"all",
"the",
"bytes",
"of",
"a",
"given",
"file",
"into",
"an",
"array",
".",
"If",
"the",
"file",
"size",
"exceeds",
"Integer",
".",
"MAX_VALUE",
"it",
"will",
"be",
"truncated",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L468-L492 |
108,175 | Red5/red5-server-common | src/main/java/org/red5/server/so/SharedObjectScope.java | SharedObjectScope.getSecurityHandlers | private Set<ISharedObjectSecurity> getSecurityHandlers() {
ISharedObjectSecurityService security = (ISharedObjectSecurityService) ScopeUtils.getScopeService(getParent(), ISharedObjectSecurityService.class);
if (security == null) {
return null;
}
return security.getShared... | java | private Set<ISharedObjectSecurity> getSecurityHandlers() {
ISharedObjectSecurityService security = (ISharedObjectSecurityService) ScopeUtils.getScopeService(getParent(), ISharedObjectSecurityService.class);
if (security == null) {
return null;
}
return security.getShared... | [
"private",
"Set",
"<",
"ISharedObjectSecurity",
">",
"getSecurityHandlers",
"(",
")",
"{",
"ISharedObjectSecurityService",
"security",
"=",
"(",
"ISharedObjectSecurityService",
")",
"ScopeUtils",
".",
"getScopeService",
"(",
"getParent",
"(",
")",
",",
"ISharedObjectSec... | Return security handlers for this shared object or
<pre>
null
</pre>
if none are found.
@return set of security handlers | [
"Return",
"security",
"handlers",
"for",
"this",
"shared",
"object",
"or"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L487-L493 |
108,176 | Red5/red5-server-common | src/main/java/org/red5/server/so/SharedObjectScope.java | SharedObjectScope.isConnectionAllowed | protected boolean isConnectionAllowed() {
// Check internal handlers first
for (ISharedObjectSecurity handler : securityHandlers) {
if (!handler.isConnectionAllowed(this)) {
return false;
}
}
// Check global SO handlers next
final S... | java | protected boolean isConnectionAllowed() {
// Check internal handlers first
for (ISharedObjectSecurity handler : securityHandlers) {
if (!handler.isConnectionAllowed(this)) {
return false;
}
}
// Check global SO handlers next
final S... | [
"protected",
"boolean",
"isConnectionAllowed",
"(",
")",
"{",
"// Check internal handlers first\r",
"for",
"(",
"ISharedObjectSecurity",
"handler",
":",
"securityHandlers",
")",
"{",
"if",
"(",
"!",
"handler",
".",
"isConnectionAllowed",
"(",
"this",
")",
")",
"{",
... | Call handlers and check if connection to the existing SO is allowed.
@return is connection allowed | [
"Call",
"handlers",
"and",
"check",
"if",
"connection",
"to",
"the",
"existing",
"SO",
"is",
"allowed",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L500-L518 |
108,177 | Red5/red5-server-common | src/main/java/org/red5/server/so/SharedObjectScope.java | SharedObjectScope.isWriteAllowed | protected boolean isWriteAllowed(String key, Object value) {
// check internal handlers first
for (ISharedObjectSecurity handler : securityHandlers) {
if (!handler.isWriteAllowed(this, key, value)) {
return false;
}
}
// check global SO hand... | java | protected boolean isWriteAllowed(String key, Object value) {
// check internal handlers first
for (ISharedObjectSecurity handler : securityHandlers) {
if (!handler.isWriteAllowed(this, key, value)) {
return false;
}
}
// check global SO hand... | [
"protected",
"boolean",
"isWriteAllowed",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"// check internal handlers first\r",
"for",
"(",
"ISharedObjectSecurity",
"handler",
":",
"securityHandlers",
")",
"{",
"if",
"(",
"!",
"handler",
".",
"isWriteAllowed... | Call handlers and check if writing to the SO is allowed.
@param key
key
@param value
value
@return is write allowed | [
"Call",
"handlers",
"and",
"check",
"if",
"writing",
"to",
"the",
"SO",
"is",
"allowed",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L529-L547 |
108,178 | Red5/red5-server-common | src/main/java/org/red5/server/so/SharedObjectScope.java | SharedObjectScope.isDeleteAllowed | protected boolean isDeleteAllowed(String key) {
// check internal handlers first
for (ISharedObjectSecurity handler : securityHandlers) {
if (!handler.isDeleteAllowed(this, key)) {
return false;
}
}
// check global SO handlers next
... | java | protected boolean isDeleteAllowed(String key) {
// check internal handlers first
for (ISharedObjectSecurity handler : securityHandlers) {
if (!handler.isDeleteAllowed(this, key)) {
return false;
}
}
// check global SO handlers next
... | [
"protected",
"boolean",
"isDeleteAllowed",
"(",
"String",
"key",
")",
"{",
"// check internal handlers first\r",
"for",
"(",
"ISharedObjectSecurity",
"handler",
":",
"securityHandlers",
")",
"{",
"if",
"(",
"!",
"handler",
".",
"isDeleteAllowed",
"(",
"this",
",",
... | Call handlers and check if deleting a property from the SO is allowed.
@param key
key
@return is delete allowed | [
"Call",
"handlers",
"and",
"check",
"if",
"deleting",
"a",
"property",
"from",
"the",
"SO",
"is",
"allowed",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L556-L574 |
108,179 | Red5/red5-server-common | src/main/java/org/red5/server/so/SharedObjectScope.java | SharedObjectScope.isSendAllowed | protected boolean isSendAllowed(String message, List<?> arguments) {
// check internal handlers first
for (ISharedObjectSecurity handler : securityHandlers) {
if (!handler.isSendAllowed(this, message, arguments)) {
return false;
}
}
// check... | java | protected boolean isSendAllowed(String message, List<?> arguments) {
// check internal handlers first
for (ISharedObjectSecurity handler : securityHandlers) {
if (!handler.isSendAllowed(this, message, arguments)) {
return false;
}
}
// check... | [
"protected",
"boolean",
"isSendAllowed",
"(",
"String",
"message",
",",
"List",
"<",
"?",
">",
"arguments",
")",
"{",
"// check internal handlers first\r",
"for",
"(",
"ISharedObjectSecurity",
"handler",
":",
"securityHandlers",
")",
"{",
"if",
"(",
"!",
"handler"... | Call handlers and check if sending a message to the clients connected to the SO is allowed.
@param message
message
@param arguments
arguments
@return is send allowed | [
"Call",
"handlers",
"and",
"check",
"if",
"sending",
"a",
"message",
"to",
"the",
"clients",
"connected",
"to",
"the",
"SO",
"is",
"allowed",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L585-L603 |
108,180 | Red5/red5-server-common | src/main/java/org/red5/server/util/HttpConnectionUtil.java | HttpConnectionUtil.handleError | public static void handleError(HttpResponse response) throws ParseException, IOException {
log.debug("{}", response.getStatusLine().toString());
HttpEntity entity = response.getEntity();
if (entity != null) {
log.debug("{}", EntityUtils.toString(entity));
}
} | java | public static void handleError(HttpResponse response) throws ParseException, IOException {
log.debug("{}", response.getStatusLine().toString());
HttpEntity entity = response.getEntity();
if (entity != null) {
log.debug("{}", EntityUtils.toString(entity));
}
} | [
"public",
"static",
"void",
"handleError",
"(",
"HttpResponse",
"response",
")",
"throws",
"ParseException",
",",
"IOException",
"{",
"log",
".",
"debug",
"(",
"\"{}\"",
",",
"response",
".",
"getStatusLine",
"(",
")",
".",
"toString",
"(",
")",
")",
";",
... | Logs details about the request error.
@param response
http response
@throws IOException
on IO error
@throws ParseException
on parse error | [
"Logs",
"details",
"about",
"the",
"request",
"error",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/HttpConnectionUtil.java#L131-L137 |
108,181 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPUtils.java | RTMPUtils.writeReverseInt | public static void writeReverseInt(IoBuffer out, int value) {
out.put((byte) (0xFF & value));
out.put((byte) (0xFF & (value >> 8)));
out.put((byte) (0xFF & (value >> 16)));
out.put((byte) (0xFF & (value >> 24)));
} | java | public static void writeReverseInt(IoBuffer out, int value) {
out.put((byte) (0xFF & value));
out.put((byte) (0xFF & (value >> 8)));
out.put((byte) (0xFF & (value >> 16)));
out.put((byte) (0xFF & (value >> 24)));
} | [
"public",
"static",
"void",
"writeReverseInt",
"(",
"IoBuffer",
"out",
",",
"int",
"value",
")",
"{",
"out",
".",
"put",
"(",
"(",
"byte",
")",
"(",
"0xFF",
"&",
"value",
")",
")",
";",
"out",
".",
"put",
"(",
"(",
"byte",
")",
"(",
"0xFF",
"&",
... | Writes reversed integer to buffer.
@param out
Buffer
@param value
Integer to write | [
"Writes",
"reversed",
"integer",
"to",
"buffer",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L41-L46 |
108,182 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPUtils.java | RTMPUtils.readUnsignedMediumInt | public static int readUnsignedMediumInt(IoBuffer in) {
final byte a = in.get();
final byte b = in.get();
final byte c = in.get();
int val = 0;
val += (a & 0xff) << 16;
val += (b & 0xff) << 8;
val += (c & 0xff);
return val;
} | java | public static int readUnsignedMediumInt(IoBuffer in) {
final byte a = in.get();
final byte b = in.get();
final byte c = in.get();
int val = 0;
val += (a & 0xff) << 16;
val += (b & 0xff) << 8;
val += (c & 0xff);
return val;
} | [
"public",
"static",
"int",
"readUnsignedMediumInt",
"(",
"IoBuffer",
"in",
")",
"{",
"final",
"byte",
"a",
"=",
"in",
".",
"get",
"(",
")",
";",
"final",
"byte",
"b",
"=",
"in",
".",
"get",
"(",
")",
";",
"final",
"byte",
"c",
"=",
"in",
".",
"ge... | Read unsigned 24 bit integer.
@param in input
@return unsigned int | [
"Read",
"unsigned",
"24",
"bit",
"integer",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L67-L76 |
108,183 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPUtils.java | RTMPUtils.readMediumInt | public static int readMediumInt(IoBuffer in) {
final byte a = in.get();
final byte b = in.get();
final byte c = in.get();
// Fix unsigned values
int val = 0;
val += (a & 0xff) << 16;
val += (b & 0xff) << 8;
val += (c & 0xff);
return val;
... | java | public static int readMediumInt(IoBuffer in) {
final byte a = in.get();
final byte b = in.get();
final byte c = in.get();
// Fix unsigned values
int val = 0;
val += (a & 0xff) << 16;
val += (b & 0xff) << 8;
val += (c & 0xff);
return val;
... | [
"public",
"static",
"int",
"readMediumInt",
"(",
"IoBuffer",
"in",
")",
"{",
"final",
"byte",
"a",
"=",
"in",
".",
"get",
"(",
")",
";",
"final",
"byte",
"b",
"=",
"in",
".",
"get",
"(",
")",
";",
"final",
"byte",
"c",
"=",
"in",
".",
"get",
"(... | Read 24 bit integer.
@param in
input
@return signed 3 byte int | [
"Read",
"24",
"bit",
"integer",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L85-L95 |
108,184 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPUtils.java | RTMPUtils.readReverseInt | public static int readReverseInt(IoBuffer in) {
final byte a = in.get();
final byte b = in.get();
final byte c = in.get();
final byte d = in.get();
int val = 0;
val += (d & 0xff) << 24;
val += (c & 0xff) << 16;
val += (b & 0xff) << 8;
val ... | java | public static int readReverseInt(IoBuffer in) {
final byte a = in.get();
final byte b = in.get();
final byte c = in.get();
final byte d = in.get();
int val = 0;
val += (d & 0xff) << 24;
val += (c & 0xff) << 16;
val += (b & 0xff) << 8;
val ... | [
"public",
"static",
"int",
"readReverseInt",
"(",
"IoBuffer",
"in",
")",
"{",
"final",
"byte",
"a",
"=",
"in",
".",
"get",
"(",
")",
";",
"final",
"byte",
"b",
"=",
"in",
".",
"get",
"(",
")",
";",
"final",
"byte",
"c",
"=",
"in",
".",
"get",
"... | Read integer in reversed order.
@param in
Input buffer
@return Integer | [
"Read",
"integer",
"in",
"reversed",
"order",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L104-L115 |
108,185 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPUtils.java | RTMPUtils.encodeHeaderByte | public static void encodeHeaderByte(IoBuffer out, byte headerSize, int channelId) {
if (channelId <= 63) {
out.put((byte) ((headerSize << 6) + channelId));
} else if (channelId <= 319) {
out.put((byte) (headerSize << 6));
out.put((byte) (channelId - 64));
... | java | public static void encodeHeaderByte(IoBuffer out, byte headerSize, int channelId) {
if (channelId <= 63) {
out.put((byte) ((headerSize << 6) + channelId));
} else if (channelId <= 319) {
out.put((byte) (headerSize << 6));
out.put((byte) (channelId - 64));
... | [
"public",
"static",
"void",
"encodeHeaderByte",
"(",
"IoBuffer",
"out",
",",
"byte",
"headerSize",
",",
"int",
"channelId",
")",
"{",
"if",
"(",
"channelId",
"<=",
"63",
")",
"{",
"out",
".",
"put",
"(",
"(",
"byte",
")",
"(",
"(",
"headerSize",
"<<",
... | Encodes header size marker and channel id into header marker.
@param out output buffer
@param headerSize Header size marker
@param channelId Channel used | [
"Encodes",
"header",
"size",
"marker",
"and",
"channel",
"id",
"into",
"header",
"marker",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L124-L136 |
108,186 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPUtils.java | RTMPUtils.diffTimestamps | public static long diffTimestamps(final int a, final int b) {
// first convert each to unsigned integers
final long unsignedA = a & 0xFFFFFFFFL;
final long unsignedB = b & 0xFFFFFFFFL;
// then find the delta
final long delta = unsignedA - unsignedB;
return delta;
... | java | public static long diffTimestamps(final int a, final int b) {
// first convert each to unsigned integers
final long unsignedA = a & 0xFFFFFFFFL;
final long unsignedB = b & 0xFFFFFFFFL;
// then find the delta
final long delta = unsignedA - unsignedB;
return delta;
... | [
"public",
"static",
"long",
"diffTimestamps",
"(",
"final",
"int",
"a",
",",
"final",
"int",
"b",
")",
"{",
"// first convert each to unsigned integers\r",
"final",
"long",
"unsignedA",
"=",
"a",
"&",
"0xFFFFFFFF",
"L",
";",
"final",
"long",
"unsignedB",
"=",
... | Calculates the delta between two time stamps, adjusting for time stamp wrapping.
@param a
First time stamp
@param b
Second time stamp
@return the distance between a and b, which will be negative if a is less than b. | [
"Calculates",
"the",
"delta",
"between",
"two",
"time",
"stamps",
"adjusting",
"for",
"time",
"stamp",
"wrapping",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L219-L226 |
108,187 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.startWaitForHandshake | public void startWaitForHandshake() {
if (log.isDebugEnabled()) {
log.debug("startWaitForHandshake - {}", sessionId);
}
// start the handshake checker after maxHandshakeTimeout milliseconds
if (scheduler != null) {
try {
waitForHandshakeTask... | java | public void startWaitForHandshake() {
if (log.isDebugEnabled()) {
log.debug("startWaitForHandshake - {}", sessionId);
}
// start the handshake checker after maxHandshakeTimeout milliseconds
if (scheduler != null) {
try {
waitForHandshakeTask... | [
"public",
"void",
"startWaitForHandshake",
"(",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"startWaitForHandshake - {}\"",
",",
"sessionId",
")",
";",
"}",
"// start the handshake checker after maxHandshakeTime... | Start waiting for a valid handshake. | [
"Start",
"waiting",
"for",
"a",
"valid",
"handshake",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L500-L512 |
108,188 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.stopWaitForHandshake | private void stopWaitForHandshake() {
if (waitForHandshakeTask != null) {
boolean cancelled = waitForHandshakeTask.cancel(true);
waitForHandshakeTask = null;
if (cancelled && log.isDebugEnabled()) {
log.debug("waitForHandshake was cancelled for {}", sessi... | java | private void stopWaitForHandshake() {
if (waitForHandshakeTask != null) {
boolean cancelled = waitForHandshakeTask.cancel(true);
waitForHandshakeTask = null;
if (cancelled && log.isDebugEnabled()) {
log.debug("waitForHandshake was cancelled for {}", sessi... | [
"private",
"void",
"stopWaitForHandshake",
"(",
")",
"{",
"if",
"(",
"waitForHandshakeTask",
"!=",
"null",
")",
"{",
"boolean",
"cancelled",
"=",
"waitForHandshakeTask",
".",
"cancel",
"(",
"true",
")",
";",
"waitForHandshakeTask",
"=",
"null",
";",
"if",
"(",... | Cancels wait for handshake task. | [
"Cancels",
"wait",
"for",
"handshake",
"task",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L517-L525 |
108,189 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.startRoundTripMeasurement | private void startRoundTripMeasurement() {
if (scheduler != null) {
if (pingInterval > 0) {
if (log.isDebugEnabled()) {
log.debug("startRoundTripMeasurement - {}", sessionId);
}
try {
// schedule with an i... | java | private void startRoundTripMeasurement() {
if (scheduler != null) {
if (pingInterval > 0) {
if (log.isDebugEnabled()) {
log.debug("startRoundTripMeasurement - {}", sessionId);
}
try {
// schedule with an i... | [
"private",
"void",
"startRoundTripMeasurement",
"(",
")",
"{",
"if",
"(",
"scheduler",
"!=",
"null",
")",
"{",
"if",
"(",
"pingInterval",
">",
"0",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"st... | Starts measurement. | [
"Starts",
"measurement",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L530-L549 |
108,190 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.stopRoundTripMeasurement | private void stopRoundTripMeasurement() {
if (keepAliveTask != null) {
boolean cancelled = keepAliveTask.cancel(true);
keepAliveTask = null;
if (cancelled && log.isDebugEnabled()) {
log.debug("Keep alive was cancelled for {}", sessionId);
}
... | java | private void stopRoundTripMeasurement() {
if (keepAliveTask != null) {
boolean cancelled = keepAliveTask.cancel(true);
keepAliveTask = null;
if (cancelled && log.isDebugEnabled()) {
log.debug("Keep alive was cancelled for {}", sessionId);
}
... | [
"private",
"void",
"stopRoundTripMeasurement",
"(",
")",
"{",
"if",
"(",
"keepAliveTask",
"!=",
"null",
")",
"{",
"boolean",
"cancelled",
"=",
"keepAliveTask",
".",
"cancel",
"(",
"true",
")",
";",
"keepAliveTask",
"=",
"null",
";",
"if",
"(",
"cancelled",
... | Stops measurement. | [
"Stops",
"measurement",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L554-L562 |
108,191 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.setup | public void setup(String host, String path, Map<String, Object> params) {
this.host = host;
this.path = path;
this.params = params;
if (Integer.valueOf(3).equals(params.get("objectEncoding"))) {
if (log.isDebugEnabled()) {
log.debug("Setting object encod... | java | public void setup(String host, String path, Map<String, Object> params) {
this.host = host;
this.path = path;
this.params = params;
if (Integer.valueOf(3).equals(params.get("objectEncoding"))) {
if (log.isDebugEnabled()) {
log.debug("Setting object encod... | [
"public",
"void",
"setup",
"(",
"String",
"host",
",",
"String",
"path",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"{",
"this",
".",
"host",
"=",
"host",
";",
"this",
".",
"path",
"=",
"path",
";",
"this",
".",
"params",
"=",
... | Initialize connection.
@param host
Connection host
@param path
Connection path
@param params
Params passed from client | [
"Initialize",
"connection",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L574-L584 |
108,192 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.getChannel | public Channel getChannel(int channelId) {
Channel channel = channels.putIfAbsent(channelId, new Channel(this, channelId));
if (channel == null) {
channel = channels.get(channelId);
}
return channel;
} | java | public Channel getChannel(int channelId) {
Channel channel = channels.putIfAbsent(channelId, new Channel(this, channelId));
if (channel == null) {
channel = channels.get(channelId);
}
return channel;
} | [
"public",
"Channel",
"getChannel",
"(",
"int",
"channelId",
")",
"{",
"Channel",
"channel",
"=",
"channels",
".",
"putIfAbsent",
"(",
"channelId",
",",
"new",
"Channel",
"(",
"this",
",",
"channelId",
")",
")",
";",
"if",
"(",
"channel",
"==",
"null",
")... | Return channel by id.
@param channelId
Channel id
@return Channel by id | [
"Return",
"channel",
"by",
"id",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L626-L632 |
108,193 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.closeChannel | public void closeChannel(int channelId) {
if (log.isTraceEnabled()) {
log.trace("closeChannel: {}", channelId);
}
Channel chan = channels.remove(channelId);
if (log.isTraceEnabled()) {
log.trace("channel: {} for id: {}", chan, channelId);
if (ch... | java | public void closeChannel(int channelId) {
if (log.isTraceEnabled()) {
log.trace("closeChannel: {}", channelId);
}
Channel chan = channels.remove(channelId);
if (log.isTraceEnabled()) {
log.trace("channel: {} for id: {}", chan, channelId);
if (ch... | [
"public",
"void",
"closeChannel",
"(",
"int",
"channelId",
")",
"{",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"log",
".",
"trace",
"(",
"\"closeChannel: {}\"",
",",
"channelId",
")",
";",
"}",
"Channel",
"chan",
"=",
"channels",
".",
... | Closes channel.
@param channelId
Channel id | [
"Closes",
"channel",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L640-L665 |
108,194 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.isValidStreamId | public boolean isValidStreamId(Number streamId) {
double d = streamId.doubleValue();
if (log.isTraceEnabled()) {
log.trace("Checking validation for streamId {}; reservedStreams: {}; streams: {}, connection: {}", new Object[] { d, reservedStreams, streams, sessionId });
}
... | java | public boolean isValidStreamId(Number streamId) {
double d = streamId.doubleValue();
if (log.isTraceEnabled()) {
log.trace("Checking validation for streamId {}; reservedStreams: {}; streams: {}, connection: {}", new Object[] { d, reservedStreams, streams, sessionId });
}
... | [
"public",
"boolean",
"isValidStreamId",
"(",
"Number",
"streamId",
")",
"{",
"double",
"d",
"=",
"streamId",
".",
"doubleValue",
"(",
")",
";",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"log",
".",
"trace",
"(",
"\"Checking validation fo... | Returns whether or not a given stream id is valid.
@param streamId
stream id
@return true if its valid, false if its invalid | [
"Returns",
"whether",
"or",
"not",
"a",
"given",
"stream",
"id",
"is",
"valid",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L712-L731 |
108,195 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.isIdle | public boolean isIdle() {
long lastPingTime = lastPingSentOn.get();
long lastPongTime = lastPongReceivedOn.get();
boolean idle = (lastPongTime > 0 && (lastPingTime - lastPongTime > maxInactivity));
if (log.isTraceEnabled()) {
log.trace("Connection {} {} idle", getSession... | java | public boolean isIdle() {
long lastPingTime = lastPingSentOn.get();
long lastPongTime = lastPongReceivedOn.get();
boolean idle = (lastPongTime > 0 && (lastPingTime - lastPongTime > maxInactivity));
if (log.isTraceEnabled()) {
log.trace("Connection {} {} idle", getSession... | [
"public",
"boolean",
"isIdle",
"(",
")",
"{",
"long",
"lastPingTime",
"=",
"lastPingSentOn",
".",
"get",
"(",
")",
";",
"long",
"lastPongTime",
"=",
"lastPongReceivedOn",
".",
"get",
"(",
")",
";",
"boolean",
"idle",
"=",
"(",
"lastPongTime",
">",
"0",
"... | Returns whether or not the connection has been idle for a maximum period.
@return true if max idle period has been exceeded, false otherwise | [
"Returns",
"whether",
"or",
"not",
"the",
"connection",
"has",
"been",
"idle",
"for",
"a",
"maximum",
"period",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L738-L746 |
108,196 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.getStreamIdForChannelId | public Number getStreamIdForChannelId(int channelId) {
if (channelId < 4) {
return 0;
}
Number streamId = Math.floor(((channelId - 4) / 5.0d) + 1);
if (log.isTraceEnabled()) {
log.trace("Stream id: {} requested for channel id: {}", streamId, channelId);
... | java | public Number getStreamIdForChannelId(int channelId) {
if (channelId < 4) {
return 0;
}
Number streamId = Math.floor(((channelId - 4) / 5.0d) + 1);
if (log.isTraceEnabled()) {
log.trace("Stream id: {} requested for channel id: {}", streamId, channelId);
... | [
"public",
"Number",
"getStreamIdForChannelId",
"(",
"int",
"channelId",
")",
"{",
"if",
"(",
"channelId",
"<",
"4",
")",
"{",
"return",
"0",
";",
"}",
"Number",
"streamId",
"=",
"Math",
".",
"floor",
"(",
"(",
"(",
"channelId",
"-",
"4",
")",
"/",
"5... | Return stream id for given channel id.
@param channelId
Channel id
@return ID of stream that channel belongs to | [
"Return",
"stream",
"id",
"for",
"given",
"channel",
"id",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L834-L843 |
108,197 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.getStreamByChannelId | public IClientStream getStreamByChannelId(int channelId) {
// channels 2 and 3 are "special" and don't have an IClientStream associated
if (channelId < 4) {
return null;
}
Number streamId = getStreamIdForChannelId(channelId);
if (log.isTraceEnabled()) {
... | java | public IClientStream getStreamByChannelId(int channelId) {
// channels 2 and 3 are "special" and don't have an IClientStream associated
if (channelId < 4) {
return null;
}
Number streamId = getStreamIdForChannelId(channelId);
if (log.isTraceEnabled()) {
... | [
"public",
"IClientStream",
"getStreamByChannelId",
"(",
"int",
"channelId",
")",
"{",
"// channels 2 and 3 are \"special\" and don't have an IClientStream associated\r",
"if",
"(",
"channelId",
"<",
"4",
")",
"{",
"return",
"null",
";",
"}",
"Number",
"streamId",
"=",
"... | Return stream by given channel id.
@param channelId
Channel id
@return Stream that channel belongs to | [
"Return",
"stream",
"by",
"given",
"channel",
"id",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L852-L862 |
108,198 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.getChannelIdForStreamId | public int getChannelIdForStreamId(Number streamId) {
int channelId = (int) (streamId.doubleValue() * 5) - 1;
if (log.isTraceEnabled()) {
log.trace("Channel id: {} requested for stream id: {}", channelId, streamId);
}
return channelId;
} | java | public int getChannelIdForStreamId(Number streamId) {
int channelId = (int) (streamId.doubleValue() * 5) - 1;
if (log.isTraceEnabled()) {
log.trace("Channel id: {} requested for stream id: {}", channelId, streamId);
}
return channelId;
} | [
"public",
"int",
"getChannelIdForStreamId",
"(",
"Number",
"streamId",
")",
"{",
"int",
"channelId",
"=",
"(",
"int",
")",
"(",
"streamId",
".",
"doubleValue",
"(",
")",
"*",
"5",
")",
"-",
"1",
";",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
... | Return channel id for given stream id.
@param streamId
Stream id
@return ID of channel that belongs to the stream | [
"Return",
"channel",
"id",
"for",
"given",
"stream",
"id",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L871-L877 |
108,199 | Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.createOutputStream | public OutputStream createOutputStream(Number streamId) {
int channelId = getChannelIdForStreamId(streamId);
if (log.isTraceEnabled()) {
log.trace("Create output - stream id: {} channel id: {}", streamId, channelId);
}
final Channel data = getChannel(channelId++);
... | java | public OutputStream createOutputStream(Number streamId) {
int channelId = getChannelIdForStreamId(streamId);
if (log.isTraceEnabled()) {
log.trace("Create output - stream id: {} channel id: {}", streamId, channelId);
}
final Channel data = getChannel(channelId++);
... | [
"public",
"OutputStream",
"createOutputStream",
"(",
"Number",
"streamId",
")",
"{",
"int",
"channelId",
"=",
"getChannelIdForStreamId",
"(",
"streamId",
")",
";",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"log",
".",
"trace",
"(",
"\"Crea... | Creates output stream object from stream id. Output stream consists of audio, video, and data channels.
@see org.red5.server.stream.OutputStream
@param streamId
Stream id
@return Output stream object | [
"Creates",
"output",
"stream",
"object",
"from",
"stream",
"id",
".",
"Output",
"stream",
"consists",
"of",
"audio",
"video",
"and",
"data",
"channels",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L887-L899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.