1 /* 2 * Copyright (c) 2012 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 #ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_ANDROID_VIDEO_CAPTURE_ANDROID_H_ 12 #define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_ANDROID_VIDEO_CAPTURE_ANDROID_H_ 13 14 #include <jni.h> 15 16 #include "webrtc/modules/video_capture/android/device_info_android.h" 17 #include "webrtc/modules/video_capture/video_capture_impl.h" 18 19 namespace webrtc { 20 namespace videocapturemodule { 21 22 class VideoCaptureAndroid : public VideoCaptureImpl { 23 public: 24 VideoCaptureAndroid(const int32_t id); 25 virtual int32_t Init(const int32_t id, const char* deviceUniqueIdUTF8); 26 27 virtual int32_t StartCapture(const VideoCaptureCapability& capability); 28 virtual int32_t StopCapture(); 29 virtual bool CaptureStarted(); 30 virtual int32_t CaptureSettings(VideoCaptureCapability& settings); 31 virtual int32_t SetCaptureRotation(VideoCaptureRotation rotation); 32 33 int32_t OnIncomingFrame(uint8_t* videoFrame, 34 int32_t videoFrameLength, 35 int64_t captureTime = 0); 36 37 protected: 38 virtual ~VideoCaptureAndroid(); 39 40 DeviceInfoAndroid _deviceInfo; 41 jobject _jCapturer; // Global ref to Java VideoCaptureAndroid object. 42 VideoCaptureCapability _captureCapability; 43 bool _captureStarted; 44 }; 45 46 } // namespace videocapturemodule 47 } // namespace webrtc 48 #endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_ANDROID_VIDEO_CAPTURE_ANDROID_H_ 49