video_capture_android.h (1682B)
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 "api/video/i420_buffer.h" 17 #include "device_info_android.h" 18 #include "modules/video_capture/video_capture_impl.h" 19 #include "system_wrappers/include/clock.h" 20 21 namespace webrtc { 22 namespace videocapturemodule { 23 24 class VideoCaptureAndroid : public VideoCaptureImpl { 25 public: 26 VideoCaptureAndroid(Clock* clock); 27 virtual int32_t Init(const char* deviceUniqueIdUTF8); 28 29 virtual int32_t StartCapture(const VideoCaptureCapability& capability); 30 virtual int32_t StopCapture(); 31 virtual bool CaptureStarted(); 32 virtual int32_t CaptureSettings(VideoCaptureCapability& settings); 33 34 void OnIncomingFrame(webrtc::scoped_refptr<I420Buffer> buffer, 35 int32_t degrees, 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_