Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.HubPort$Factory


    WebRtcEndpoint webRtcEP1 = mp.newWebRtcEndpoint().build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();

    Dispatcher dispatcher = mp.newDispatcher().build();
    HubPort hubPort1 = dispatcher.newHubPort().build();
    HubPort hubPort2 = dispatcher.newHubPort().build();

    webRtcEP1.connect(hubPort1);
    hubPort2.connect(httpEP);

    dispatcher.connect(hubPort1, hubPort2);

    // Test execution
    try (BrowserClient browser1 = new BrowserClient.Builder()
View Full Code Here


  List<PlayerConnection> playersList;

  @Override
  public void onContentRequest(HttpPlayerSession contentSession)
      throws Exception {
    HubPort mixerPort1;
    HubPort mixerPort2;
    HubPort mixerPort3;
    PlayerEndpoint player1;
    PlayerEndpoint player2;
    GStreamerFilter bn;

    MediaPipelineFactory mpf = contentSession.getMediaPipelineFactory();
    mediaPipeline = mpf.create();
    contentSession.releaseOnTerminate(mediaPipeline);
    player1 = mediaPipeline.newPlayerEndpoint(
        VideoURLs.map.get("small-mp4")).build();
    player2 = mediaPipeline.newPlayerEndpoint(
        VideoURLs.map.get("small-mp4")).build();
    bn = mediaPipeline.newGStreamerFilter("videobalance saturation=0.0")
        .build();

    mixer = mediaPipeline.newComposite().build();

    mixerPort1 = mixer.newHubPort().build();
    mixerPort2 = mixer.newHubPort().build();
    mixerPort3 = mixer.newHubPort().build();

    player2.connect(bn);
    player1.connect(mixerPort1);
    bn.connect(mixerPort2);

    playersList = new ArrayList<PlayerConnection>();

    PlayerConnection conection1 = new PlayerConnection(player1, mixerPort1);
    PlayerConnection conection2 = new PlayerConnection(player2, mixerPort2);

    playersList.add(conection1);
    playersList.add(conection2);

    // mixer.setMainEndPoint(mixerPort1);
    HttpGetEndpoint httpEndpoint = mediaPipeline.newHttpGetEndpoint()
    // .withMediaProfile(MediaProfileSpecType.MP4).build();
        .withMediaProfile(MediaProfileSpecType.WEBM).build();
    mixerPort3.connect(httpEndpoint);
    contentSession.start(httpEndpoint);
  }
View Full Code Here

      HttpPlayerSession contentSession, ContentCommand contentCommand)
      throws Exception {
    if (contentCommand.getType().equalsIgnoreCase("newplayer")) {
      PlayerEndpoint player = mediaPipeline.newPlayerEndpoint(
          VideoURLs.map.get("small-mp4")).build();
      HubPort mixerPort = mixer.newHubPort().build();
      player.connect(mixerPort);
      player.play();
      PlayerConnection conection = new PlayerConnection(player, mixerPort);
      playersList.add(conection);
    } else if (contentCommand.getType().equalsIgnoreCase("deleteplayer")) {
View Full Code Here

        "http://files.kurento.org/video/60sec/blue.webm").build();
    PlayerEndpoint playerWhite = mp.newPlayerEndpoint(
        "http://files.kurento.org/video/60sec/white.webm").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();

    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    playerRed.connect(hubPort1);
    playerGreen.connect(hubPort2);
    playerBlue.connect(hubPort3);
    playerWhite.connect(hubPort4);

    hubPort5.connect(httpEP);

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

    MediaPipeline mp = pipelineFactory.create();
    WebRtcEndpoint webRtcEP1 = mp.newWebRtcEndpoint().build();
    WebRtcEndpoint webRtcEP2 = mp.newWebRtcEndpoint().build();

    Dispatcher dispatcher = mp.newDispatcher().build();
    HubPort hubPort1 = dispatcher.newHubPort().build();
    HubPort hubPort2 = dispatcher.newHubPort().build();

    webRtcEP1.connect(hubPort1);
    hubPort2.connect(webRtcEP2);

    dispatcher.connect(hubPort1, hubPort2);

    // Test execution
    try (BrowserClient browser1 = new BrowserClient.Builder()
View Full Code Here

    PlayerEndpoint playerEP = mp.newPlayerEndpoint(
        "http://files.kurento.org/video/30sec/red.webm").build();
    WebRtcEndpoint webRtcEP = mp.newWebRtcEndpoint().build();

    Dispatcher dispatcher = mp.newDispatcher().build();
    HubPort hubPort1 = dispatcher.newHubPort().build();
    HubPort hubPort2 = dispatcher.newHubPort().build();

    playerEP.connect(hubPort1);
    hubPort2.connect(webRtcEP);

    dispatcher.connect(hubPort1, hubPort2);
    playerEP.play();

    // Test execution
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();
      HubPort hubPort = compsite.newHubPort().build();
      endpoint.connect(hubPort);
      hubPort.connect(endpoint);
      DispatcherParticipant participant = new DispatcherParticipant(
          session.getSessionId(), name, endpoint, session, hubPort);
      session.start(participant.endpoint);
      session.setAttribute("participant", participant);
      participants.put(participant.getId(), participant);
      notifyJoined(participant);
      hubPort.connect(endpoint);
    }
  }
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();
      HubPort hubPort = dispatcher.newHubPort().build();
      endpoint.connect(hubPort);
      hubPort.connect(endpoint);
      // endpoint.connect(endpoint);
      DispatcherParticipant participant = new DispatcherParticipant(
          session.getSessionId(), name, endpoint, session, hubPort);
      session.start(participant.endpoint);
      session.setAttribute("participant", participant);
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();
      HubPort hubPort = dispatcher.newHubPort().build();
      endpoint.connect(hubPort);
      hubPort.connect(endpoint);
      DispatcherParticipant participant = new DispatcherParticipant(
          session.getSessionId(), name, endpoint, session, hubPort);
      session.start(participant.endpoint);
      session.setAttribute("participant", participant);
      participants.put(participant.getId(), participant);
View Full Code Here

    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();
        BrowserClient browserWebRtc1 = new BrowserClient.Builder()
View Full Code Here

TOP

Related Classes of com.kurento.kmf.media.HubPort$Factory

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.