Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.MediaPipeline


   * Creates a Media Element repository using a ContentPath.
   *
   */
  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


   * Creates a Media Element repository using a MediaElement.
   */
  protected HttpEndpoint buildAndConnectHttpEndpoint(
      RecorderEndpoint recorderEndpoint) {

    MediaPipeline mediaPiplePipeline = recorderEndpoint.getMediaPipeline();
    getLogger().info("Creating HttpEndpoint ...");
    HttpPostEndpoint httpEndpoint = mediaPiplePipeline
        .newHttpPostEndpoint().build();
    releaseOnTerminate(httpEndpoint);
    httpEndpoint.connect(recorderEndpoint);
    return httpEndpoint;

View Full Code Here

      throw kmfe;
    }
  }

  private void internalStart(String sourceContentPath, String sinkContentPath) {
    MediaPipeline mediaPipeline = createMediaPipeline();
    PlayerEndpoint playerEndpoint = null;
    if (sourceContentPath != null) {
      playerEndpoint = createSourceEndpoint(mediaPipeline,
          sourceContentPath);
    }
View Full Code Here

  }

  private MediaPipeline createMediaPipeline() {
    getLogger().info("Creating media pipeline ...");
    MediaPipeline mediaPipeline = mediaPipelineFactory.create();
    releaseOnTerminate(mediaPipeline);
    return mediaPipeline;
  }
View Full Code Here

@WebRtcContentService(path = "/webRtcPointerDetectorLoopback")
public class WebRtcPointerDetectorLoopback extends WebRtcContentHandler {

  @Override
  public void onContentRequest(WebRtcContentSession session) throws Exception {
    MediaPipeline mp = session.getMediaPipelineFactory().create();
    session.releaseOnTerminate(mp);

    PointerDetectorFilter filter = mp.newPointerDetectorFilter().build();
    PointerDetectorWindowMediaParam window1 = new PointerDetectorWindowMediaParam(
        "window1", 50, 50, 50, 50);
    filter.addWindow(window1);
    filter.addWindowInListener(new MediaEventListener<WindowInEvent>() {
      @Override
      public void onEvent(WindowInEvent event) {
        getLogger().info("WindowInEvent IN");
      }
    });
    filter.addWindowOutListener(new MediaEventListener<WindowOutEvent>() {
      @Override
      public void onEvent(WindowOutEvent event) {
        getLogger().info("WindowInEvent OUT");
      }
    });

    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();

    webRtcEndpoint.connect(filter);
    filter.connect(webRtcEndpoint);
    session.start(webRtcEndpoint);
  }
View Full Code Here

          + ":"
          + contentSession.getHttpServletRequest().getServerPort()
          + player.getURL();
      getLogger().info("mediaUrl {}", mediaUrl);

      MediaPipeline mp = contentSession.getMediaPipelineFactory()
          .create();
      contentSession.releaseOnTerminate(mp);
      PlayerEndpoint playerEndpoint = mp.newPlayerEndpoint(mediaUrl)
          .build();
      JackVaderFilter filter = mp.newJackVaderFilter().build();
      playerEndpoint.connect(filter);
      contentSession.setAttribute("player", playerEndpoint);
      HttpGetEndpoint httpEndpoint = mp.newHttpGetEndpoint()
          .terminateOnEOS().build();
      filter.connect(httpEndpoint);
      contentSession.start(httpEndpoint);
    }
  }
View Full Code Here

public abstract class AbstractBaseRecorder extends HttpRecorderHandler {

  @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

  @Override
  public void onContentRequest(final HttpPlayerSession session)
      throws Exception {
    MediaPipelineFactory mpf = session.getMediaPipelineFactory();
    MediaPipeline mp = mpf.create();
    session.releaseOnTerminate(mp);

    PlayerEndpoint playerEndpoint = mp.newPlayerEndpoint(

    VideoURLs.map.get("zbar")).build();
    ZBarFilter filter = mp.newZBarFilter().build();
    playerEndpoint.connect(filter);

    filter.addCodeFoundListener(new MediaEventListener<CodeFoundEvent>() {

      @Override
      public void onEvent(CodeFoundEvent event) {
        getLogger().info("Event {}-->{}", event.getType(),
            event.getValue());
        if (url.equals(event.getValue())) {
          return;
        }

        url = event.getValue();
        session.publishEvent(new ContentEvent(event.getType(), event
            .getValue()));

      }
    });
    session.setAttribute("player", playerEndpoint);

    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    filter.connect(httpEP);
    session.start(httpEP);
  }
View Full Code Here

public class PlayerJsonJackVaderHandler extends HttpPlayerHandler {

  @Override
  public void onContentRequest(HttpPlayerSession session) throws Exception {
    MediaPipelineFactory mpf = session.getMediaPipelineFactory();
    MediaPipeline mp = mpf.create();
    session.releaseOnTerminate(mp);

    PlayerEndpoint playerEndpoint = mp.newPlayerEndpoint(
        VideoURLs.map.get("jack")).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

public class MediaApiPlayerCrowdDetectorBrowserTest extends BrowserMediaApiTest {

  @Test
  public void testPlayerCrowdDetector() throws Exception {
    // Media Pipeline
    MediaPipeline mp = pipelineFactory.create();
    PlayerEndpoint playerEP = mp.newPlayerEndpoint(
        "http://files.kurento.org/video/crowd.mp4").build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();

    List<RegionOfInterest> rois = newArrayList();
    List<RelativePoint> points = new ArrayList<RelativePoint>();

    points.add(new RelativePoint(0, 0));
    points.add(new RelativePoint((float) 0.5, 0));
    points.add(new RelativePoint((float) 0.5, (float) 0.5));
    points.add(new RelativePoint(0, (float) 0.5));

    RegionOfInterestConfig config = new RegionOfInterestConfig();

    config.setFluidityLevelMin(10);
    config.setFluidityLevelMed(35);
    config.setFluidityLevelMax(65);
    config.setFluidityNumFramesToEvent(5);
    config.setOccupancyLevelMin(10);
    config.setOccupancyLevelMed(35);
    config.setOccupancyLevelMax(65);
    config.setOccupancyNumFramesToEvent(5);
    config.setSendOpticalFlowEvent(false);
    config.setOpticalFlowNumFramesToEvent(3);
    config.setOpticalFlowNumFramesToReset(3);
    config.setOpticalFlowAngleOffset(0);

    rois.add(new RegionOfInterest(points, config, "roi0"));

    CrowdDetectorFilter crowdDetectorFilter = mp.newCrowdDetectorFilter(
        rois).build();
    playerEP.connect(crowdDetectorFilter);
    crowdDetectorFilter.connect(httpEP);

    final List<EndOfStreamEvent> eosEvents = new ArrayList<>();
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.