Package org.red5.server.net.rtmp.event

Examples of org.red5.server.net.rtmp.event.Invoke


    params.put("audioCodecs",(double)615);
    params.put("videoCodecs",(double)76);
    params.put("pageUrl","http://localhost/test.html");
    params.put("objectEncoding",(double)0);
    PendingCall pendingCall=new PendingCall("connect");
    Invoke invoke=new Invoke(pendingCall);
    invoke.setConnectionParams(params);
    invoke.setInvokeId(1);
    channel.write(invoke);
  }
View Full Code Here


    @Override
  public void connectionOpened(RTMPConnection conn, RTMP state) {
    // Send "connect" call to the server
    Channel channel = conn.getChannel((byte) 3);
    PendingCall pendingCall = new PendingCall("connect");
    Invoke invoke = new Invoke(pendingCall);
    invoke.setConnectionParams(connectionParams);
    invoke.setInvokeId(conn.getInvokeId());
    if (connectCallback != null)
      pendingCall.registerCallback(connectCallback);
    conn.registerPendingCall(invoke.getInvokeId(), pendingCall);
    channel.write(invoke);
  }
View Full Code Here

        dr.setInvokeId(invoke.getInvokeId());
        dr.setServiceCall(psc);
        dr.setChannel(channel);
        conn.registerDeferredResult(dr);
      } else {
        Invoke reply = new Invoke();
        reply.setCall(call);
        reply.setInvokeId(invoke.getInvokeId());
        channel.write(reply);
      }
    }
  }
View Full Code Here

     * @param status           Status
     */
    public void sendStatus(Status status) {
    final boolean andReturn = !status.getCode().equals(
        StatusCodes.NS_DATA_START);
    final Invoke invoke;
    if (andReturn) {
      final PendingCall call = new PendingCall(null, "onStatus",
          new Object[] { status });
      invoke = new Invoke();
      invoke.setInvokeId(1);
      invoke.setCall(call);
    } else {
      final Call call = new Call(null, "onStatus", new Object[] { status });
      invoke = (Invoke) new Notify();
      invoke.setInvokeId(1);
      invoke.setCall(call);
    }
    // We send directly to the corresponding stream as for
    // some status codes, no stream has been created and thus
    // "getStreamByChannelId" will fail.
    write(invoke, connection.getStreamIdForChannel(id));
View Full Code Here

    if (channel == null) {
      log.warn("The client is no longer connected.");
      return;
    }
   
    Invoke reply = new Invoke();
    call.setResult(result);
    reply.setCall(call);
    reply.setInvokeId(invokeId);
    channel.write(reply);
    channel.getConnection().unregisterDeferredResult(this);
  }
View Full Code Here

      call.setStatus(Call.STATUS_ACCESS_DENIED);
      if (call instanceof IPendingServiceCall) {
        IPendingServiceCall pc = (IPendingServiceCall) call;
        pc.setResult(getStatus(NC_CONNECT_REJECTED));
      }
      Invoke reply = new Invoke();
      reply.setCall(call);
      reply.setInvokeId(invoke.getInvokeId());
      channel.write(reply);
      conn.close();
    } else {
      synchronized (rtmp) {
        // connect the origin
View Full Code Here

        break;
      case Constants.TYPE_VIDEO_DATA:
        msg = new VideoData(tag.getBody());
        break;
      case Constants.TYPE_INVOKE:
        msg = new Invoke(tag.getBody());
        break;
      case Constants.TYPE_NOTIFY:
        msg = new Notify(tag.getBody());
        break;
      default:
View Full Code Here

    return decodeNotifyOrInvoke(new Notify(), in, header, rtmp);
  }

  /** {@inheritDoc} */
  public Invoke decodeInvoke(ByteBuffer in, RTMP rtmp) {
    return (Invoke) decodeNotifyOrInvoke(new Invoke(), in, null, rtmp);
  }
View Full Code Here

      }
      ;

      if (sendResult) {
        // The client expects a result for the method call.
        Invoke reply = new Invoke();
        reply.setCall(call);
        reply.setInvokeId(invoke.getInvokeId());
        channel.write(reply);
        if (disconnectOnReturn) {
          conn.close();
        }
      }
View Full Code Here

        synchronized (rtmpState) {
          if (rtmpState.getState() == RTMP.STATE_ORIGIN_CONNECT_FORWARDED &&
              rtmpHeader.getRtmpType() == TYPE_INVOKE) {
            // we got the connect invocation result from Origin
            // parse the result
            Invoke invoke = (Invoke) rtmpBody.getRtmpPacket().getMessage();
            if ("connect".equals(invoke.getCall().getServiceMethodName())) {
              if (invoke.getCall().getStatus() == Call.STATUS_SUCCESS_RESULT) {
                rtmpState.setState(RTMP.STATE_CONNECTED);
              } else {
                // TODO set EdgeRTMP state to closing ?
                toDisconnect = true;
              }
View Full Code Here

TOP

Related Classes of org.red5.server.net.rtmp.event.Invoke

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.