Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.HttpGetEndpoint


    MediaPipeline mp = mpf.create();
    contentSession.releaseOnTerminate(mp);
    PlayerEndpoint playerEndpoint = mp.newPlayerEndpoint(
        VideoURLs.map.get("webm")).build();
    contentSession.setAttribute("player", playerEndpoint);
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    playerEndpoint.connect(httpEP);
    contentSession.start(httpEP);
  }
View Full Code Here


  public void testPlayer() throws Exception {
    // Media Pipeline
    MediaPipeline mp = pipelineFactory.create();
    PlayerEndpoint playerEP = mp.newPlayerEndpoint(
        "http://files.kurento.org/video/small.webm").build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    playerEP.connect(httpEP);
    playerEP.play();

    // Test execution
    HttpClient client = HttpClientBuilder.create().build();
    HttpGet httpGet = new HttpGet(httpEP.getUrl());
    HttpResponse response = client.execute(httpGet);
    HttpEntity resEntity = response.getEntity();

    // Assertions
    Assert.assertEquals("Response content-type must be video/webm",
View Full Code Here

  public void basicPipelineTest() {

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

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

    player.connect(httpGetEndpoint);

    String url = httpGetEndpoint.getUrl();

    player.release();

    Assert.assertNotSame("The URL shouldn't be empty", "", url);
  }
View Full Code Here

        "http://files.kurento.org/video/barcodes.webm").build();
    session.setAttribute("player", player);

    ZBarFilter zBarFilter = mp.newZBarFilter().build();
    player.connect(zBarFilter);
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    zBarFilter.connect(httpEP);
    session.start(httpEP);
    session.setAttribute("eventValue", "");
    zBarFilter
View Full Code Here

  /**
   * Checks that the getUrl method does not return an empty string
   */
  @Test
  public void testMethodGetUrl() {
    HttpGetEndpoint httpEP = pipeline.newHttpGetEndpoint().build();
    Assert.assertTrue(!httpEP.getUrl().isEmpty());
  }
View Full Code Here

      ClientProtocolException, IOException {

    final PlayerEndpoint player = pipeline.newPlayerEndpoint(URL_SMALL)
        .build();

    HttpGetEndpoint httpEP = pipeline.newHttpGetEndpoint().build();
    player.connect(httpEP);

    AsyncEventManager<EndOfStreamEvent> async = new AsyncEventManager<>(
        "EndOfStream event");

    player.addEndOfStreamListener(async.getMediaEventListener());

    httpEP.addMediaSessionStartedListener(new MediaEventListener<MediaSessionStartedEvent>() {
      @Override
      public void onEvent(MediaSessionStartedEvent event) {
        player.play();
      }
    });

    try (CloseableHttpClient httpclient = HttpClientBuilder.create()
        .build()) {
      // This should trigger MediaSessionStartedEvent
      httpclient.execute(new HttpGet(httpEP.getUrl()));
    }

    async.waitForResult();

    httpEP.release();
    player.release();
  }
View Full Code Here

  @Test
  public void testEventMediaSessionTerminated() throws InterruptedException,
      ClientProtocolException, IOException {
    final PlayerEndpoint player = pipeline.newPlayerEndpoint(URL_SMALL)
        .build();
    HttpGetEndpoint httpEP = pipeline.newHttpGetEndpoint().terminateOnEOS()
        .build();
    player.connect(httpEP);

    httpEP.addMediaSessionStartedListener(new MediaEventListener<MediaSessionStartedEvent>() {

      @Override
      public void onEvent(MediaSessionStartedEvent event) {
        player.play();
      }
    });

    final BlockingQueue<MediaSessionTerminatedEvent> events = new ArrayBlockingQueue<>(
        1);
    httpEP.addMediaSessionTerminatedListener(new MediaEventListener<MediaSessionTerminatedEvent>() {

      @Override
      public void onEvent(MediaSessionTerminatedEvent event) {
        events.add(event);
      }
    });

    try (CloseableHttpClient httpclient = HttpClientBuilder.create()
        .build()) {
      // This should trigger MediaSessionStartedEvent
      httpclient.execute(new HttpGet(httpEP.getUrl()));
    }

    Assert.assertNotNull("MediaSessionTerminatedEvent not sent in 20s",
        events.poll(20, SECONDS));

    httpEP.release();
    player.release();
  }
View Full Code Here

    PlayerEndpoint playerEndpoint = mp.newPlayerEndpoint(
        "http://files.kurento.org/video/fiwarecut.webm").build();
    JackVaderFilter filter = mp.newJackVaderFilter().build();
    playerEndpoint.connect(filter);
    session.setAttribute("player", playerEndpoint);
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    filter.connect(httpEP);
    session.start(httpEP);
  }
View Full Code Here

    // Media Elements: Player Endpoint, Filter, HTTP Endpoint
    PlayerEndpoint playerEndpoint = mp.newPlayerEndpoint(
        "http://files.kurento.org/video/fiwarecut.webm").build();
    contentSession.setAttribute("player", playerEndpoint);
    JackVaderFilter filter = mp.newJackVaderFilter().build();
    HttpGetEndpoint httpEndpoint = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();

    // Connections
    filter.connect(httpEndpoint);
    playerEndpoint.connect(filter);
View Full Code Here

    FaceOverlayFilter filter = pipeline.newFaceOverlayFilter().build();
    filter.setOverlayedImage(
        "http://files.kurento.org/imgs/mario-wings.png", -0.35F, -1.2F,
        1.6F, 1.6F);

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

    // RecorderEndpoint recorder = pipeline.newRecorderEndpoint(
    // "file:///home/mica/Data/Kurento/tmp/video.mp4").build();

    player.connect(filter);
    filter.connect(recorder);

    player.play();

    Desktop.getDesktop().browse(new URI(recorder.getUrl()));

  }
View Full Code Here

TOP

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

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.