Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.MediaPipeline


          }
        });
    server.start();

    long initTime = System.nanoTime();
    MediaPipeline pipeline = mpf.create();

    double duration = (System.nanoTime() - initTime) / (double) 1000000;

    log.info("Duration: " + duration);
View Full Code Here


      r.get();
    }
  }

  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);
View Full Code Here

    JsonRpcServerRabbitMq server = new JsonRpcServerRabbitMq(
        new JsonRpcClientThrift());

    server.start();

    MediaPipeline pipeline = mpf.create();

    PlayerEndpoint player = pipeline.newPlayerEndpoint(
        "http://files.kurento.org/video/small.webm").build();

    HttpGetEndpoint httpGetEndpoint = pipeline.newHttpGetEndpoint().build();

    player.connect(httpGetEndpoint);

    String url = httpGetEndpoint.getUrl();
View Full Code Here

    private PlayerEndpoint playerEP;

    @Override
    public void onContentRequest(final HttpPlayerSession session)
        throws Exception {
      MediaPipeline mp = session.getMediaPipelineFactory().create();
      playerEP = mp.newPlayerEndpoint(
          "http://files.kurento.org/video/barcodes.webm").build();
      HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
          .build();
      ZBarFilter zBarFilter = mp.newZBarFilter().build();
      playerEP.connect(zBarFilter);
      zBarFilter.connect(httpEP);
      session.start(httpEP);
      session.setAttribute("eventValue", "");
      zBarFilter
View Full Code Here

    private PlayerEndpoint playerEP;

    @Override
    public void onContentRequest(HttpPlayerSession session)
        throws Exception {
      MediaPipeline mp = session.getMediaPipelineFactory().create();
      session.releaseOnTerminate(mp);
      playerEP = mp.newPlayerEndpoint(
          "http://files.kurento.org/video/small.webm").build();
      HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
          .build();
      playerEP.connect(httpEP);
      session.start(httpEP);

      terminateLatch = new CountDownLatch(1);
View Full Code Here

    private PlayerEndpoint playerEP;

    @Override
    public void onContentRequest(HttpPlayerSession session)
        throws Exception {
      MediaPipeline mp = session.getMediaPipelineFactory().create();
      session.releaseOnTerminate(mp);
      playerEP = mp.newPlayerEndpoint(
          "http://files.kurento.org/video/small.webm").build();
      HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
          .build();
      playerEP.connect(httpEP);
      session.start(httpEP);
    }
View Full Code Here

    @Override
    public synchronized void onContentRequest(
        WebRtcContentSession contentSession) throws Exception {
      if (firstWebRtcEndpoint == null) {
        // Media Pipeline creation
        MediaPipeline mp = contentSession.getMediaPipelineFactory()
            .create();
        contentSession.releaseOnTerminate(mp);

        // First WebRTC
        firstWebRtcEndpoint = mp.newWebRtcEndpoint().build();
        sessionId = contentSession.getSessionId();
        contentSession.releaseOnTerminate(firstWebRtcEndpoint);

        contentSession.start(firstWebRtcEndpoint);
      } 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);
View Full Code Here

*/
public class PipelineTest extends MediaApiTest {

  @Test
  public void basicPipelineTest() {
    MediaPipeline mediaPipeline = pipelineFactory.create();
    Assert.assertNotNull("Error: MediaPipeline is null", mediaPipeline);
    mediaPipeline.release();
  }
View Full Code Here

    doTest(Browser.CHROME);
  }

  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();
        BrowserClient browserWebRtc1 = new BrowserClient.Builder()
            .browser(browserType).client(Client.WEBRTC)
            .video(getPathTestFiles() + "/video/10sec/red.y4m")
            .build();
        BrowserClient browserWebRtc2 = new BrowserClient.Builder()
            .browser(browserType).client(Client.WEBRTC)
            .video(getPathTestFiles() + "/video/10sec/green.y4m")
            .build();
        BrowserClient browserWebRtc3 = new BrowserClient.Builder()
            .browser(browserType).client(Client.WEBRTC)
            .video(getPathTestFiles() + "/video/10sec/blue.y4m")
            .build();
        BrowserClient browserWebRtc4 = new BrowserClient.Builder()
            .browser(browserType).client(Client.WEBRTC)
            .video(getPathTestFiles() + "/video/10sec/white.y4m")
            .build();) {

      // WebRTC browsers
      browserWebRtc1.subscribeEvents("playing");
      browserWebRtc1.connectToWebRtcEndpoint(webRtcEP1,
          WebRtcChannel.AUDIO_AND_VIDEO);
      browserWebRtc2.subscribeEvents("playing");
      browserWebRtc2.connectToWebRtcEndpoint(webRtcEP2,
          WebRtcChannel.AUDIO_AND_VIDEO);
      browserWebRtc3.subscribeEvents("playing");
      browserWebRtc3.connectToWebRtcEndpoint(webRtcEP3,
          WebRtcChannel.AUDIO_AND_VIDEO);
      browserWebRtc4.subscribeEvents("playing");
      browserWebRtc4.connectToWebRtcEndpoint(webRtcEP4,
          WebRtcChannel.AUDIO_AND_VIDEO);

      browserPlayer.setURL(httpEP.getUrl());
      browserPlayer.subscribeEvents("playing");
      browserPlayer.start();

      browserPlayer.setColorCoordinates(450, 450);

      // Assertions
      Assert.assertTrue("Timeout waiting playing event",
          browserPlayer.waitForEvent("playing"));
      Assert.assertTrue("Upper left part of the video must be red",
          browserPlayer.color(Color.RED, 12, 0, 0));
      Assert.assertTrue("Upper right part of the video must be green",
          browserPlayer.color(Color.GREEN, 14, 450, 0));
      Assert.assertTrue("Lower left part of the video must be blue",
          browserPlayer.color(Color.BLUE, 16, 0, 450));
      Assert.assertTrue("Lower right part of the video must be white",
          browserPlayer.color(Color.WHITE, 18, 450, 450));

      // Finally, a B&N filter is connected in one of the WebRTC's
      GStreamerFilter bn = mp.newGStreamerFilter(
          "videobalance saturation=0.0").build();
      webRtcEP1.connect(bn);
      bn.connect(hubPort1);
      Thread.sleep(5000);
      Assert.assertTrue(
View Full Code Here

    private PlayerEndpoint playerEP;

    @Override
    public void onContentRequest(HttpPlayerSession session)
        throws Exception {
      MediaPipeline mp = session.getMediaPipelineFactory().create();
      playerEP = mp.newPlayerEndpoint(
          "http://files.kurento.org/video/10sec/red.webm").build();
      HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
          .build();
      playerEP.connect(httpEP);
      session.start(httpEP);

      terminateLatch = new CountDownLatch(1);
View Full Code Here

TOP

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

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.