Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.RecorderEndpoint


    contentSession.start(httpEndpoint);
  }

  @Override
  public void onContentStarted(HttpRecorderSession contentSession) {
    RecorderEndpoint recorderEndPoint = (RecorderEndpoint) contentSession
        .getAttribute("recorder");
    recorderEndPoint.record();
  }
View Full Code Here


  }

  @Override
  public void onSessionTerminated(HttpRecorderSession contentSession,
      int code, String reason) throws Exception {
    RecorderEndpoint recorderEndPoint = (RecorderEndpoint) contentSession
        .getAttribute("recorder");
    recorderEndPoint.stop();
    super.onSessionTerminated(contentSession, code, reason);
  }
View Full Code Here

    MediaPipeline mp = pipelineFactory.create();
    PlayerEndpoint playerEP = mp.newPlayerEndpoint(
        "http://files.kurento.org/video/10sec/green.webm").build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    RecorderEndpoint recorderEP = mp.newRecorderEndpoint(
        FILE_SCHEMA + getDefaultFileForRecording()).build();
    playerEP.connect(httpEP);
    playerEP.connect(recorderEP);

    // Test execution #1. Play the video while it is recorded
View Full Code Here

  public void doTest(Browser browserType, String video, Color color)
      throws InterruptedException {
    // Media Pipeline #1
    MediaPipeline mp = pipelineFactory.create();
    WebRtcEndpoint webRtcEP = mp.newWebRtcEndpoint().build();
    RecorderEndpoint recorderEP = mp.newRecorderEndpoint(
        FILE_SCHEMA + getDefaultFileForRecording()).build();
    webRtcEP.connect(webRtcEP);
    webRtcEP.connect(recorderEP);

    // Test execution #1. WewbRTC in loopback while it is recorded
    BrowserClient.Builder builder = new BrowserClient.Builder().browser(
        browserType).client(Client.WEBRTC);
    if (video != null) {
      builder = builder.video(video);
    }

    try (BrowserClient browser = builder.build()) {
      browser.subscribeEvents("playing");
      browser.connectToWebRtcEndpoint(webRtcEP,
          WebRtcChannel.AUDIO_AND_VIDEO);
      recorderEP.record();

      // Wait until event playing in the remote stream
      Assert.assertTrue("Timeout waiting playing event",
          browser.waitForEvent("playing"));

      // Guard time to play the video
      Thread.sleep(PLAYTIME * 1000);

      // Assert play time
      double currentTime = browser.getCurrentTime();
      Assert.assertTrue("Error in play time of HTTP player (expected: "
          + PLAYTIME + " sec, real: " + currentTime + " sec)",
          compare(PLAYTIME, currentTime));

      // Assert color
      if (color != null) {
        Assert.assertTrue("The color of the video should be " + color,
            browser.colorSimilarTo(color));
      }
    }

    // Stop and release media elements
    recorderEP.stop();
    webRtcEP.release();
    recorderEP.release();

    // Media Pipeline #2
    PlayerEndpoint playerEP = mp.newPlayerEndpoint(
        FILE_SCHEMA + getDefaultFileForRecording()).build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
View Full Code Here

    MediaPipeline mp = contentSession.getMediaPipelineFactory().create();
    contentSession.releaseOnTerminate(mp);

    // Media Elements: WebRTC Endpoint, Recorder Endpoint
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    RecorderEndpoint recorderEndpoint = mp.newRecorderEndpoint(
        "file:///tmp/recording").build();
    contentSession.setAttribute("recorder", recorderEndpoint);

    // Connections
    webRtcEndpoint.connect(webRtcEndpoint);
View Full Code Here

    contentSession.start(webRtcEndpoint);
  }

  @Override
  public void onContentStarted(WebRtcContentSession contentSession) {
    RecorderEndpoint recorderEndpoint = (RecorderEndpoint) contentSession
        .getAttribute("recorder");
    recorderEndpoint.record();
  }
View Full Code Here

    MediaPipeline mp = contentSession.getMediaPipelineFactory().create();
    contentSession.releaseOnTerminate(mp);

    // Media Elements: WebRTC Endpoint, Recorder Endpoint
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    RecorderEndpoint recorderEndpoint = mp.newRecorderEndpoint(
        "file:///tmp/recording").build();
    contentSession.setAttribute("recorder", recorderEndpoint);

    // Connections
    webRtcEndpoint.connect(webRtcEndpoint);
View Full Code Here

    contentSession.start(webRtcEndpoint);
  }

  @Override
  public void onContentStarted(WebRtcContentSession contentSession) {
    RecorderEndpoint recorderEndpoint = (RecorderEndpoint) contentSession
        .getAttribute("recorder");
    recorderEndpoint.record();
  }
View Full Code Here

      sessionId = contentSession.getSessionId();
      contentSession.releaseOnTerminate(firstWebRtcEndpoint);
      firstWebRtcEndpoint.connect(firstWebRtcEndpoint);

      if (contentId != null && contentId.equalsIgnoreCase("record")) {
        RecorderEndpoint recorderEndPoint = mp.newRecorderEndpoint(
            "file:///tmp/master").build();
        contentSession.setAttribute("recorder", recorderEndPoint);
        firstWebRtcEndpoint.connect(recorderEndPoint);
      }

      contentSession.start(firstWebRtcEndpoint);
    } else {
      MediaPipeline mp = firstWebRtcEndpoint.getMediaPipeline();

      WebRtcEndpoint newWebRtcEndpoint = mp.newWebRtcEndpoint().build();
      contentSession.releaseOnTerminate(newWebRtcEndpoint);
      newWebRtcEndpoint.connect(firstWebRtcEndpoint);
      firstWebRtcEndpoint.connect(newWebRtcEndpoint);

      if (contentId != null && contentId.equalsIgnoreCase("record")) {
        RecorderEndpoint recorderEndPoint = mp.newRecorderEndpoint(
            "file:///tmp/peer").build();
        contentSession.setAttribute("recorder", recorderEndPoint);
        newWebRtcEndpoint.connect(recorderEndPoint);
      }
View Full Code Here

    }
  }

  @Override
  public void onContentStarted(WebRtcContentSession contentSession) {
    RecorderEndpoint recorderEndPoint = (RecorderEndpoint) contentSession
        .getAttribute("recorder");
    if (recorderEndPoint != null) {
      recorderEndPoint.record();
    }
  }
View Full Code Here

TOP

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

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.