• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 package org.webrtc;
12 
13 public class JavaVideoSourceTestHelper {
14   @CalledByNative
startCapture(CapturerObserver observer, boolean success)15   public static void startCapture(CapturerObserver observer, boolean success) {
16     observer.onCapturerStarted(success);
17   }
18 
19   @CalledByNative
stopCapture(CapturerObserver observer)20   public static void stopCapture(CapturerObserver observer) {
21     observer.onCapturerStopped();
22   }
23 
24   @CalledByNative
deliverFrame( int width, int height, int rotation, long timestampNs, CapturerObserver observer)25   public static void deliverFrame(
26       int width, int height, int rotation, long timestampNs, CapturerObserver observer) {
27     observer.onFrameCaptured(
28         new VideoFrame(JavaI420Buffer.allocate(width, height), rotation, timestampNs));
29   }
30 }
31