Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.WebRtcEndpoint


    String sdpOffer = params.get("sdpOffer").getAsString();
    log.debug("Received SDP offer");

    // Media Logic
    MediaPipeline mp = mpf.create();
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    FaceOverlayFilter faceOverlayFilter = mp.newFaceOverlayFilter().build();
    faceOverlayFilter.setOverlayedImage(
        "http://files.kurento.org/imgs/mario-wings.png", -0.35F, -1.2F,
        1.6F, 1.6F);
    webRtcEndpoint.connect(faceOverlayFilter);
    faceOverlayFilter.connect(webRtcEndpoint);

    // SDP Answer
    String sdpAnswer = webRtcEndpoint.processOffer(sdpOffer);
    JsonObject scParams = new JsonObject();
    scParams.addProperty("sdpAnswer", sdpAnswer);
    transaction.sendResponse(scParams);
  }
View Full Code Here


    } else {
      // Media Pipeline reusing
      MediaPipeline mp = firstWebRtcEndpoint.getMediaPipeline();

      // Next WebRTC endpoints connected to the first one
      WebRtcEndpoint newWebRtcEndpoint = mp.newWebRtcEndpoint().build();
      contentSession.releaseOnTerminate(newWebRtcEndpoint);
      newWebRtcEndpoint.connect(firstWebRtcEndpoint);
      firstWebRtcEndpoint.connect(newWebRtcEndpoint);

      contentSession.start(newWebRtcEndpoint);
    }
  }
View Full Code Here

    }
    if (existName(name)) {
      session.terminate(403, "User " + name + " is already in the room. "
          + "Please select another name and try again.");
    } else {
      WebRtcEndpoint endpoint = mp.newWebRtcEndpoint().build();
      WebRTCParticipant participant = new WebRTCParticipant(
          session.getSessionId(), name, endpoint, session);
      participant.endpoint.connect(participant.endpoint);
      session.start(participant.endpoint);
      session.setAttribute("participant", participant);
View Full Code Here

      return outgoingMedia;
    }
    log.debug("PARTICIPANT {}: receiving video from {}", this.name,
        sender.getName());

    WebRtcEndpoint incoming = incomingMedia.get(sender.getName());

    if (incoming == null) {
      log.debug("PARTICIPANT {}: creating new endpoint for {}",
          this.name, sender.getName());
      incoming = pipeline.newWebRtcEndpoint().build();
View Full Code Here

   *            the participant
   */
  public void cancelVideoFrom(final String senderName) {
    log.debug("PARTICIPANT {}: canceling video reception from {}",
        this.name, senderName);
    WebRtcEndpoint incoming = incomingMedia.remove(senderName);

    log.debug("PARTICIPANT {}: removing endpoint for {}", this.name,
        senderName);
    incoming.release(new Continuation<Void>() {
      @Override
      public void onSuccess(Void result) throws Exception {
        log.trace(
            "PARTICIPANT {}: Released successfully incoming EP for {}",
            Participant.this.name, senderName);
View Full Code Here

  @Override
  public void onContentRequest(WebRtcContentSession session) throws Exception {
    MediaPipeline mp = session.getMediaPipelineFactory().create();
    session.releaseOnTerminate(mp);
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    webRtcEndpoint.connect(webRtcEndpoint);
    session.start(webRtcEndpoint);
  }
View Full Code Here

    }
  }

  public void doTest(Node node, Color color) {
    MediaPipeline mp = pipelineFactory.create();
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    webRtcEndpoint.connect(webRtcEndpoint);

    BrowserClient.Builder builder = new BrowserClient.Builder()
        .browser(node.getBrowser()).client(Client.WEBRTC)
        .remoteNode(node);
    if (node.getVideo() != null) {
View Full Code Here

      } else {
        // Media Pipeline reusing
        MediaPipeline mp = firstWebRtcEndpoint.getMediaPipeline();

        // Next WebRTC endpoints connected to the first one
        WebRtcEndpoint newWebRtcEndpoint = mp.newWebRtcEndpoint()
            .build();
        contentSession.releaseOnTerminate(newWebRtcEndpoint);
        newWebRtcEndpoint.connect(firstWebRtcEndpoint);
        firstWebRtcEndpoint.connect(newWebRtcEndpoint);

        contentSession.start(newWebRtcEndpoint);
      }
View Full Code Here

  }

  public void doTest(Browser browserType) throws Exception {
    // Media Pipeline
    MediaPipeline mp = pipelineFactory.create();
    WebRtcEndpoint webRtcEP1 = mp.newWebRtcEndpoint().build();
    WebRtcEndpoint webRtcEP2 = mp.newWebRtcEndpoint().build();
    WebRtcEndpoint webRtcEP3 = mp.newWebRtcEndpoint().build();
    WebRtcEndpoint webRtcEP4 = mp.newWebRtcEndpoint().build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();

    Composite composite = mp.newComposite().build();
    HubPort hubPort1 = composite.newHubPort().build();
    HubPort hubPort2 = composite.newHubPort().build();
    HubPort hubPort3 = composite.newHubPort().build();
    HubPort hubPort4 = composite.newHubPort().build();
    HubPort hubPort5 = composite.newHubPort().build();

    webRtcEP1.connect(hubPort1);
    webRtcEP2.connect(hubPort2);
    webRtcEP3.connect(hubPort3);
    webRtcEP4.connect(hubPort4);
    hubPort5.connect(httpEP);

    // Test execution
    try (BrowserClient browserPlayer = new BrowserClient.Builder()
        .browser(browserType).client(Client.PLAYER).build();
View Full Code Here

    // SDP Offer
    String sdpOffer = params.get("sdpOffer").getAsString();
    log.debug("Received SDP offer");

    // Media Logic
    WebRtcEndpoint webRtcEndpoint = room.getPipeline().newWebRtcEndpoint()
        .build();
    HubPort port = room.getComposite().newHubPort().build();
    webRtcEndpoint.connect(port);
    port.connect(webRtcEndpoint);
    room.joinParticipant(session, webRtcEndpoint, port);

    // SDP Answer
    String sdpAnswer = webRtcEndpoint.processOffer(sdpOffer);
    JsonObject scParams = new JsonObject();
    scParams.addProperty("sdpAnswer", sdpAnswer);
    transaction.sendResponse(scParams);
  }
View Full Code Here

TOP

Related Classes of com.kurento.kmf.media.WebRtcEndpoint

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.