Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.MediaPipeline


  @Override
  public void onContentRequest(WebRtcContentSession contentSession)
      throws Exception {
    // Media Pipeline
    final MediaPipeline mp = contentSession.getMediaPipelineFactory()
        .create();
    contentSession.releaseOnTerminate(mp);

    // Media Elements: WebRTC Endpoint, Filter
    final WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    final PointerDetectorFilter pointerDetectorFilter = mp
        .newPointerDetectorFilter().build();
    final FaceOverlayFilter faceOverlayFilter = mp.newFaceOverlayFilter()
        .build();
    PointerDetectorWindowMediaParam start = new PointerDetectorWindowMediaParam(
        "start", 100, 100, 280, 380);
    start.setImage("http://files.kurento.org/imgs/start.png");
    pointerDetectorFilter.addWindow(start);
View Full Code Here


public class PlayerJackVaderHandler 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

  @Override
  public void onContentRequest(HttpPlayerSession contentSession)
      throws Exception {
    // Media Pipeline
    MediaPipeline mp = contentSession.getMediaPipelineFactory().create();
    contentSession.releaseOnTerminate(mp);

    // Media Elements: Player Endpoint, HTTP Endpoint
    PlayerEndpoint playerEndpoint = mp.newPlayerEndpoint(
        "file:///tmp/recording").build();
    contentSession.setAttribute("player", playerEndpoint);
    HttpGetEndpoint httpEndpoint = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();

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

  public static JackVaderFilter sharedJackVaderReference;

  @Override
  public void onContentRequest(RtpContentSession session) throws Exception {
    MediaPipelineFactory mpf = session.getMediaPipelineFactory();
    MediaPipeline mp = mpf.create();
    session.releaseOnTerminate(mp);
    JackVaderFilter filter = mp.newJackVaderFilter().build();
    RtpEndpoint rtpEP = mp.newRtpEndpoint().build();
    filter.connect(rtpEP);
    session.start(rtpEP);
    sharedJackVaderReference = filter;
  }
View Full Code Here

public class WebRtcFaceOverlayLoopback extends WebRtcContentHandler {

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

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

    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    webRtcEndpoint.connect(filter);
    filter.connect(webRtcEndpoint);
    contentSession.start(webRtcEndpoint);
  }
View Full Code Here

@WebRtcContentService(path = "/webRtcLoopback")
public class WebRtcLoopback extends WebRtcContentHandler {

  @Override
  public void onContentRequest(WebRtcContentSession session) throws Exception {
    MediaPipeline mp = session.getMediaPipelineFactory().create();
    session.releaseOnTerminate(mp);
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    webRtcEndpoint.connect(webRtcEndpoint);
    session.start(webRtcEndpoint);
  }
View Full Code Here

  @Override
  public void onContentRequest(WebRtcContentSession contentSession)
      throws Exception {
    // Media Pipeline
    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

public class WebRtcPlateDetector extends WebRtcContentHandler {

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

    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    PlateDetectorFilter plateDetectorFilter = mp.newPlateDetectorFilter()
        .build();
    session.setAttribute("plateValue", "");
    plateDetectorFilter
        .addPlateDetectedListener(new MediaEventListener<PlateDetectedEvent>() {
          @Override
View Full Code Here

    String result = "";
    if ("register".equalsIgnoreCase(cmdType)) {
      if (sessions == null) {
        sessions = new HashMap<String, WebRtcContentSession>();
        MediaPipeline mp = session.getMediaPipelineFactory().create();
        session.releaseOnTerminate(mp);
        WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
        session.releaseOnTerminate(webRtcEndpoint);
        session.setAttribute(WEBRTCKEY, webRtcEndpoint);
        getLogger().info("**** {}", session.getSessionId());

        sessions.put(session.getSessionId(), session);
        result = "Waiting for another user in the room";

      } else {
        WebRtcEndpoint firstWebRtcEndpoint = (WebRtcEndpoint) sessions
            .values().iterator().next().getAttribute(WEBRTCKEY);
        MediaPipeline mp = firstWebRtcEndpoint.getMediaPipeline();
        WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
        session.releaseOnTerminate(webRtcEndpoint);
        webRtcEndpoint.connect(firstWebRtcEndpoint);
        session.setAttribute(WEBRTCKEY, webRtcEndpoint);

        getLogger().info("++++ {}", session.getSessionId());
View Full Code Here

public class WebRtcJackVaderLoopback extends WebRtcContentHandler {

  @Override
  public void onContentRequest(WebRtcContentSession contentSession)
      throws Exception {
    MediaPipeline mp = contentSession.getMediaPipelineFactory().create();
    contentSession.releaseOnTerminate(mp);
    JackVaderFilter filter = mp.newJackVaderFilter().build();
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    webRtcEndpoint.connect(filter);
    filter.connect(webRtcEndpoint);
    contentSession.start(webRtcEndpoint);
  }
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.