Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.RecorderEndpoint$Builder


      getLogger().info(
          "Activating media for " + this.getClass().getSimpleName()
              + " with contentPath " + contentPath);

      final RecorderEndpoint recorderEndpoint = buildUriEndpoint(contentPath);
      HttpEndpoint httpEndpoint = buildAndConnectHttpEndpoint(recorderEndpoint);
      recorderEndpoint.record(); // TODO. Ask Jose if this is the best
                    // place for this or it should be set as
                    // in the HttpPlayerSession
      activateMedia(httpEndpoint, null);

    } catch (KurentoMediaFrameworkException ke) {
View Full Code Here


  protected RecorderEndpoint buildUriEndpoint(String contentPath) {
    getLogger().info("Creating media pipeline ...");
    MediaPipeline mediaPipeline = mediaPipelineFactory.create();
    releaseOnTerminate(mediaPipeline);
    getLogger().info("Creating RecorderEndpoint ...");
    RecorderEndpoint recorderEndpoint = mediaPipeline.newRecorderEndpoint(
        contentPath).build();
    return recorderEndpoint;
  }
View Full Code Here

    if (sourceContentPath != null) {
      playerEndpoint = createSourceEndpoint(mediaPipeline,
          sourceContentPath);
    }

    RecorderEndpoint recorderEndpoint = null;
    if (sinkContentPath != null) {
      recorderEndpoint = createSinkEndpoint(mediaPipeline,
          sinkContentPath);
    }

    SdpEndpoint sdpEndpoint = buildAndConnectSdpEndpoint(mediaPipeline,
        playerEndpoint, recorderEndpoint);

    if (playerEndpoint != null)
      playerEndpoint.play();

    if (recorderEndpoint != null)
      recorderEndpoint.record();

    activateMedia(sdpEndpoint, null); // TODO. Ask Jose if
                      // playerEndpoint.play() can be
                      // in the Runnable
  }
View Full Code Here

  }

  private RecorderEndpoint createSinkEndpoint(MediaPipeline mediaPipeline,
      String contentPath) {
    getLogger().info("Creating RecorderEndpoint ...");
    RecorderEndpoint recorderEndpoint = mediaPipeline.newRecorderEndpoint(
        contentPath).build();
    return recorderEndpoint;
  }
View Full Code Here

  @Override
  public void onContentRequest(HttpRecorderSession contentSession)
      throws Exception {
    MediaPipeline mp = contentSession.getMediaPipelineFactory().create();
    contentSession.releaseOnTerminate(mp);
    RecorderEndpoint recorderEndpoint = mp.newRecorderEndpoint(getUri())
        .build();
    contentSession.setAttribute("recorder", recorderEndpoint);
    HttpPostEndpoint httpEndpoint = mp.newHttpPostEndpoint().build();
    httpEndpoint.connect(recorderEndpoint);
    contentSession.start(httpEndpoint);
View Full Code Here

    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/fiwarecut.mp4").build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    RecorderEndpoint recorderEP = mp.newRecorderEndpoint(
        FILE_SCHEMA + getDefaultFileForRecording()).build();
    final FaceOverlayFilter filter = mp.newFaceOverlayFilter().build();
    filter.setOverlayedImage(
        "http://files.kurento.org/imgs/mario-wings.png", -0.2F, -1.2F,
        1.6F, 1.6F);
View Full Code Here

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

    try (BrowserClient browser = new BrowserClient.Builder()
        .browser(browserType).client(Client.PLAYER).build()) {
      browser.setURL(httpEP.getUrl());

      // red
      playerRed.connect(httpEP);
      playerRed.connect(recorderEP);
      playerRed.play();
      recorderEP.record();
      browser.subscribeEvents("playing", "ended");
      browser.start();
      Assert.assertTrue("Timeout waiting playing event",
          browser.waitForEvent("playing"));
      Thread.sleep(2000);

      // green
      playerGreen.connect(httpEP);
      playerGreen.connect(recorderEP);
      playerGreen.play();
      Thread.sleep(6000);

      // blue
      playerBlue.connect(httpEP);
      playerBlue.connect(recorderEP);
      playerBlue.play();
      Thread.sleep(6000);

      // Assertions
      Assert.assertTrue("Timeout waiting ended event",
          browser.waitForEvent("ended"));
      Assert.assertTrue("Play time must be at least " + PLAYTIME
          + " seconds", browser.getCurrentTime() >= PLAYTIME);

    }

    // Stop and release media elements
    recorderEP.stop();
    playerRed.stop();
    playerGreen.stop();
    playerBlue.stop();
    recorderEP.release();
    playerRed.release();
    playerGreen.release();
    playerBlue.release();

    // Media Pipeline #2
View Full Code Here

  @Override
  public void onContentRequest(HttpRecorderSession contentSession)
      throws Exception {
    MediaPipeline mp = contentSession.getMediaPipelineFactory().create();
    contentSession.releaseOnTerminate(mp);
    RecorderEndpoint recorderEndpoint = mp.newRecorderEndpoint(getUri())
        .build();
    contentSession.setAttribute("recorder", recorderEndpoint);
    HttpPostEndpoint httpEndpoint = mp.newHttpPostEndpoint().build();
    httpEndpoint.connect(recorderEndpoint);
    contentSession.start(httpEndpoint);
View Full Code Here

TOP

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

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.