webrtc_m130/sdk/android/api/org/webrtc/Camera2Capturer.java

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.5 KiB
Java
Raw Normal View History

/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
package org.webrtc;
import android.annotation.TargetApi;
import android.content.Context;
import android.hardware.camera2.CameraManager;
Reland of Support adding and removing MediaRecorder to camera 2 session. (patchset #1 id:1 of https://codereview.webrtc.org/2844233002/ ) Reason for revert: Revert "Revert of Support adding and removing MediaRecorder to camera 2 session. (patchset #5 id:80001 of https://codereview.webrtc.org/2833773003/ )" Will fix external bots by cherry picking this CL and updating external functions which depend on CameraVideoCapturer interface Original issue's description: > Revert of Support adding and removing MediaRecorder to camera 2 session. (patchset #5 id:80001 of https://codereview.webrtc.org/2833773003/ ) > > Reason for revert: > Breaks external bot > > Original issue's description: > > Support adding and removing MediaRecorder to camera 2 session. > > > > Camera 1 API is not supported. > > > > BUG=b/36684011 > > > > Review-Url: https://codereview.webrtc.org/2833773003 > > Cr-Commit-Position: refs/heads/master@{#17901} > > Committed: https://chromium.googlesource.com/external/webrtc/+/2fc04769faec0031a202963eaeb602420a082c07 > > TBR=sakal@webrtc.org,glaznev@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=b/36684011 > > Review-Url: https://codereview.webrtc.org/2844233002 > Cr-Commit-Position: refs/heads/master@{#17905} > Committed: https://chromium.googlesource.com/external/webrtc/+/6702739862e292f3556a9e63c71367f49c3895b4 TBR=sakal@webrtc.org,magjed@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=b/36684011 Review-Url: https://codereview.webrtc.org/2844393002 Cr-Commit-Position: refs/heads/master@{#17915}
2017-04-27 13:38:29 -07:00
import android.media.MediaRecorder;
@TargetApi(21)
public class Camera2Capturer extends CameraCapturer {
private final Context context;
private final CameraManager cameraManager;
public Camera2Capturer(Context context, String cameraName, CameraEventsHandler eventsHandler) {
super(cameraName, eventsHandler, new Camera2Enumerator(context));
this.context = context;
cameraManager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE);
}
@Override
protected void createCameraSession(CameraSession.CreateSessionCallback createSessionCallback,
CameraSession.Events events, Context applicationContext,
Reland of Support adding and removing MediaRecorder to camera 2 session. (patchset #1 id:1 of https://codereview.webrtc.org/2844233002/ ) Reason for revert: Revert "Revert of Support adding and removing MediaRecorder to camera 2 session. (patchset #5 id:80001 of https://codereview.webrtc.org/2833773003/ )" Will fix external bots by cherry picking this CL and updating external functions which depend on CameraVideoCapturer interface Original issue's description: > Revert of Support adding and removing MediaRecorder to camera 2 session. (patchset #5 id:80001 of https://codereview.webrtc.org/2833773003/ ) > > Reason for revert: > Breaks external bot > > Original issue's description: > > Support adding and removing MediaRecorder to camera 2 session. > > > > Camera 1 API is not supported. > > > > BUG=b/36684011 > > > > Review-Url: https://codereview.webrtc.org/2833773003 > > Cr-Commit-Position: refs/heads/master@{#17901} > > Committed: https://chromium.googlesource.com/external/webrtc/+/2fc04769faec0031a202963eaeb602420a082c07 > > TBR=sakal@webrtc.org,glaznev@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=b/36684011 > > Review-Url: https://codereview.webrtc.org/2844233002 > Cr-Commit-Position: refs/heads/master@{#17905} > Committed: https://chromium.googlesource.com/external/webrtc/+/6702739862e292f3556a9e63c71367f49c3895b4 TBR=sakal@webrtc.org,magjed@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=b/36684011 Review-Url: https://codereview.webrtc.org/2844393002 Cr-Commit-Position: refs/heads/master@{#17915}
2017-04-27 13:38:29 -07:00
SurfaceTextureHelper surfaceTextureHelper, MediaRecorder mediaRecoder, String cameraName,
int width, int height, int framerate) {
Camera2Session.create(createSessionCallback, events, applicationContext, cameraManager,
Reland of Support adding and removing MediaRecorder to camera 2 session. (patchset #1 id:1 of https://codereview.webrtc.org/2844233002/ ) Reason for revert: Revert "Revert of Support adding and removing MediaRecorder to camera 2 session. (patchset #5 id:80001 of https://codereview.webrtc.org/2833773003/ )" Will fix external bots by cherry picking this CL and updating external functions which depend on CameraVideoCapturer interface Original issue's description: > Revert of Support adding and removing MediaRecorder to camera 2 session. (patchset #5 id:80001 of https://codereview.webrtc.org/2833773003/ ) > > Reason for revert: > Breaks external bot > > Original issue's description: > > Support adding and removing MediaRecorder to camera 2 session. > > > > Camera 1 API is not supported. > > > > BUG=b/36684011 > > > > Review-Url: https://codereview.webrtc.org/2833773003 > > Cr-Commit-Position: refs/heads/master@{#17901} > > Committed: https://chromium.googlesource.com/external/webrtc/+/2fc04769faec0031a202963eaeb602420a082c07 > > TBR=sakal@webrtc.org,glaznev@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=b/36684011 > > Review-Url: https://codereview.webrtc.org/2844233002 > Cr-Commit-Position: refs/heads/master@{#17905} > Committed: https://chromium.googlesource.com/external/webrtc/+/6702739862e292f3556a9e63c71367f49c3895b4 TBR=sakal@webrtc.org,magjed@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=b/36684011 Review-Url: https://codereview.webrtc.org/2844393002 Cr-Commit-Position: refs/heads/master@{#17915}
2017-04-27 13:38:29 -07:00
surfaceTextureHelper, mediaRecoder, cameraName, width, height, framerate);
}
}