Package org.red5.server.api

Examples of org.red5.server.api.IScope


        return true;           
   
  public String whoami() {
      IConnection conn = Red5.getConnectionLocal();
      IClient client = conn.getClient();
      IScope scope = conn.getScope();
      return client.getId();
      // ...
  }
View Full Code Here


              msgIn.unsubscribe(this);
              msgIn = null;
            }
      int type = (int) (item.getStart() / 1000);
      // see if it's a published stream
      IScope thisScope = getScope();
      IContext context = thisScope.getContext();
      IProviderService providerService = (IProviderService) context
          .getBean(IProviderService.BEAN_NAME);
            // Get live input
            IMessageInput liveInput = providerService.getLiveProviderInput(
          thisScope, item.getName(), false);
View Full Code Here

    public void play(String name, int start, int length, boolean flushPlaylist) {
    IConnection conn = Red5.getConnectionLocal();
    if (!(conn instanceof IStreamCapableConnection)) {
      return;
    }
    IScope scope = conn.getScope();
    IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
    int streamId = getCurrentStreamId();
    if (name == null || "".equals(name)) {
      sendNSFailed((RTMPConnection) streamConn, "The stream name may not be empty.", name, streamId);
      return;
View Full Code Here

    IConnection conn = Red5.getConnectionLocal();
    if (!(conn instanceof IStreamCapableConnection)) {
      return;
    }
   
    IScope scope = conn.getScope();
    IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
    int streamId = getCurrentStreamId();
    if (name == null || "".equals(name)) {
      sendNSFailed((RTMPConnection) streamConn, "The stream name may not be empty.", name, streamId);
      return;
View Full Code Here

   */
  public IServer getServer() {
    if (!hasParent()) {
      return null;
        }
    final IScope parent = getParent();
    if (parent instanceof Scope) {
      return ((Scope) parent).getServer();
    } else if (parent instanceof IGlobalScope) {
      return ((IGlobalScope) parent).getServer();
    } else {
View Full Code Here

        return;
      }
      // Provide a valid IConnection in the Red5 object
      final IGlobalScope global = getGlobalScope(req);
      final IContext context = global.getContext();
      final IScope scope = context.resolveScope(global, packet.getScopePath());
      IRemotingConnection conn = new RemotingConnection(req, scope, packet);
      // Make sure the connection object isn't garbage collected
      req.setAttribute(CONNECTION, conn);
      try {
        Red5.setConnectionLocal(conn);
View Full Code Here

    IStreamCapableConnection conn = getConnection();
    if (conn == null) {
      // TODO: throw other exception here?
      throw new IOException("stream is no longer connected");
    }
    IScope scope = conn.getScope();
    // Get stream filename generator
    IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils
        .getScopeService(scope, IStreamFilenameGenerator.class,
            DefaultStreamFilenameGenerator.class);

    // Generate filename
    String filename = generator.generateFilename(scope, name, ".flv",
        GenerationType.RECORD);
    // Get file for that filename
    File file;
    if (generator.resolvesToAbsolutePath()) {
      file = new File(filename);
    } else {
      file = scope.getContext().getResource(filename).getFile();
    }
    // If append mode is on...
    if (!isAppend) {
      if (file.exists()) {
        // Per livedoc of FCS/FMS:
View Full Code Here

  private void sendStartNotifications(IEventListener source) {
    if (sendStartNotification) {
      // Notify handler that stream starts recording/publishing
      sendStartNotification = false;
      if (source instanceof IConnection) {
        IScope scope = ((IConnection) source).getScope();
        if (scope.hasHandler()) {
          Object handler = scope.getHandler();
          if (handler instanceof IStreamAwareScopeHandler) {
            if (recording) {
              ((IStreamAwareScopeHandler) handler)
                  .streamRecordStart(this);
            } else {
View Full Code Here

     * @param scope            Scope
     * @return                 Directory based on relative scope path
     */
    private String getStreamDirectory(IScope scope) {
    final StringBuilder result = new StringBuilder();
    final IScope app = ScopeUtils.findApplication(scope);
    final String prefix = "streams/";
    while (scope != null && scope != app) {
      result.insert(0, scope.getName() + "/");
      scope = scope.getParent();
    }
View Full Code Here

   *
   * @param conn  RTMP connection
   * @param call  Service call
   */
  protected void invokeCall(RTMPConnection conn, IServiceCall call) {
    final IScope scope = conn.getScope();
    if (scope.hasHandler()) {
      final IScopeHandler handler = scope.getHandler();
      log.debug("Scope: {}", scope);
      log.debug("Handler: {}", handler);
      if (!handler.serviceCall(conn, call)) {
        // XXX: What do do here? Return an error?
        return;
      }
    }

    final IContext context = scope.getContext();
    log.debug("Context: {}", context);
    context.getServiceInvoker().invoke(call, scope);
  }
View Full Code Here

TOP

Related Classes of org.red5.server.api.IScope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.