blob: d9531cd9a5f98a88f82d26814ca2eed41b0ecd38 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
kjellanderb24317b2016-02-10 07:54:43 -08002 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00003 *
kjellanderb24317b2016-02-10 07:54:43 -08004 * 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.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00009 */
10
henrike@webrtc.org28e20752013-07-10 00:45:36 +000011package org.webrtc;
12
fischman@webrtc.org4e65e072013-10-03 18:23:13 +000013/**
Magnus Jedvert7640fcf2016-09-21 16:20:03 +020014 * Java wrapper of native AndroidVideoTrackSource.
fischman@webrtc.org4e65e072013-10-03 18:23:13 +000015 */
henrike@webrtc.org28e20752013-07-10 00:45:36 +000016public class VideoSource extends MediaSource {
17 public VideoSource(long nativeSource) {
18 super(nativeSource);
19 }
Magnus Jedvert7640fcf2016-09-21 16:20:03 +020020
21 /**
22 * Calling this function will cause frames to be scaled down to the requested resolution. Also,
23 * frames will be cropped to match the requested aspect ratio, and frames will be dropped to match
24 * the requested fps. The requested aspect ratio is orientation agnostic and will be adjusted to
25 * maintain the input orientation, so it doesn't matter if e.g. 1280x720 or 720x1280 is requested.
26 */
27 public void adaptOutputFormat(int width, int height, int fps) {
28 nativeAdaptOutputFormat(nativeSource, width, height, fps);
29 }
30
31 private static native void nativeAdaptOutputFormat(
32 long nativeSource, int width, int height, int fps);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000033}