sakal | 3442579 | 2016-09-21 01:34:56 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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 | |
sakal | 3442579 | 2016-09-21 01:34:56 -0700 | [diff] [blame] | 13 | import android.content.Context; |
Sami Kalliomäki | e7592d8 | 2018-03-22 13:32:44 +0100 | [diff] [blame] | 14 | import javax.annotation.Nullable; |
sakal | 3442579 | 2016-09-21 01:34:56 -0700 | [diff] [blame] | 15 | |
| 16 | public class Camera1Capturer extends CameraCapturer { |
| 17 | private final boolean captureToTexture; |
| 18 | |
sakal | b6760f9 | 2016-09-29 04:12:44 -0700 | [diff] [blame] | 19 | public Camera1Capturer( |
| 20 | String cameraName, CameraEventsHandler eventsHandler, boolean captureToTexture) { |
sakal | 3442579 | 2016-09-21 01:34:56 -0700 | [diff] [blame] | 21 | super(cameraName, eventsHandler, new Camera1Enumerator(captureToTexture)); |
| 22 | |
| 23 | this.captureToTexture = captureToTexture; |
| 24 | } |
| 25 | |
| 26 | @Override |
sakal | b6760f9 | 2016-09-29 04:12:44 -0700 | [diff] [blame] | 27 | protected void createCameraSession(CameraSession.CreateSessionCallback createSessionCallback, |
| 28 | CameraSession.Events events, Context applicationContext, |
Magnus Jedvert | 5ebb82b | 2018-04-12 16:23:34 +0200 | [diff] [blame^] | 29 | SurfaceTextureHelper surfaceTextureHelper, String cameraName, int width, int height, |
| 30 | int framerate) { |
| 31 | Camera1Session.create(createSessionCallback, events, captureToTexture, applicationContext, |
| 32 | surfaceTextureHelper, Camera1Enumerator.getCameraIndex(cameraName), width, height, |
| 33 | framerate); |
sakal | 3442579 | 2016-09-21 01:34:56 -0700 | [diff] [blame] | 34 | } |
| 35 | } |