Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.MediaPipeline


  public static WebRtcEndpoint webRtcEndpoint;

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


  private RecorderEndpoint recorderEndPoint;

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

    // By default recording in WEBM format
    MediaProfileSpecType mediaProfileSpecType = MediaProfileSpecType.WEBM;
    final String contentId = contentSession.getContentId();
    if (contentId != null && contentId.equalsIgnoreCase("mp4")) {
      mediaProfileSpecType = MediaProfileSpecType.MP4;
    }
    recorderEndPoint = mp.newRecorderEndpoint(TARGET)
        .withMediaProfile(mediaProfileSpecType).build();
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();

    webRtcEndpoint.connect(webRtcEndpoint);
    webRtcEndpoint.connect(recorderEndPoint);
    contentSession.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
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();

    // Connections
    webRtcEndpoint.connect(webRtcEndpoint);

    // Start content session
View Full Code Here

    // SDP Offer
    String sdpOffer = params.get("sdpOffer").getAsString();
    log.debug("Received SDP offer");

    // Media Logic
    MediaPipeline mp = mpf.create();
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    FaceOverlayFilter faceOverlayFilter = mp.newFaceOverlayFilter().build();
    faceOverlayFilter.setOverlayedImage(
        "http://files.kurento.org/imgs/mario-wings.png", -0.35F, -1.2F,
        1.6F, 1.6F);
    webRtcEndpoint.connect(faceOverlayFilter);
    faceOverlayFilter.connect(webRtcEndpoint);
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

  @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 enpoint in loopback
      firstWebRtcEndpoint = mp.newWebRtcEndpoint().build();
      sessionId = contentSession.getSessionId();
      contentSession.releaseOnTerminate(firstWebRtcEndpoint);
      firstWebRtcEndpoint.connect(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);

      contentSession.start(newWebRtcEndpoint);
View Full Code Here

public class CpPlayerWithFilterHandler 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(
        "http://files.kurento.org/video/fiwarecut.webm").build();

    JackVaderFilter filter = mp.newJackVaderFilter().build();
    playerEndPoint.connect(filter);
    session.setAttribute("player", playerEndPoint);
    HttpGetEndpoint httpEndpoint = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    filter.connect(httpEndpoint);
    session.start(httpEndpoint);

  }
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

    log.info("Starting client");
    JsonRpcClientRabbitMq client = new JsonRpcClientRabbitMq();

    MediaPipelineFactory mpf = new MediaPipelineFactory(client);
    MediaPipeline pipeline = mpf.create();

    checkKeepAlives(initTime, NUM_KEEP_ALIVES * 1000,
        (NUM_KEEP_ALIVES + 1) * 1000);

    // There are two pipelines and NUM_KEEP_ALIVES are submited in the half
    // of the time
    initTime = System.nanoTime();
    latch = new CountDownLatch(NUM_KEEP_ALIVES);
    MediaPipeline pipeline2 = mpf.create();
    checkKeepAlives(initTime, NUM_KEEP_ALIVES * 1000 / 2,
        (NUM_KEEP_ALIVES + 1) * 1000 / 2);

    client.close();

View Full Code Here

          }
        });
    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

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.