blob: 855a291952221235fddb94e6bd2f6cd11d3c7e5c [file] [log] [blame]
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +00001/*
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_DEVICE_INFO_ANDROID_H_
12#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_ANDROID_DEVICE_INFO_ANDROID_H_
13
14#include <jni.h>
15#include "../video_capture_impl.h"
16#include "../device_info_impl.h"
17
18#define AndroidJavaCaptureDeviceInfoClass "org/webrtc/videoengine/VideoCaptureDeviceInfoAndroid"
19#define AndroidJavaCaptureCapabilityClass "org/webrtc/videoengine/CaptureCapabilityAndroid"
20
21namespace webrtc
22{
23namespace videocapturemodule
24{
25
26// Android logging, uncomment to print trace to
27// logcat instead of trace file/callback
28// #include <android/log.h>
29// #define WEBRTC_TRACE(a,b,c,...)
30// __android_log_print(ANDROID_LOG_DEBUG, "*WEBRTCN*", __VA_ARGS__)
31
32class DeviceInfoAndroid : public DeviceInfoImpl {
33
34 public:
35 DeviceInfoAndroid(const WebRtc_Word32 id);
36 WebRtc_Word32 Init();
37 virtual ~DeviceInfoAndroid();
38 virtual WebRtc_UWord32 NumberOfDevices();
39 virtual WebRtc_Word32 GetDeviceName(
40 WebRtc_UWord32 deviceNumber,
41 char* deviceNameUTF8,
42 WebRtc_UWord32 deviceNameLength,
43 char* deviceUniqueIdUTF8,
44 WebRtc_UWord32 deviceUniqueIdUTF8Length,
45 char* productUniqueIdUTF8 = 0,
46 WebRtc_UWord32 productUniqueIdUTF8Length = 0);
47 virtual WebRtc_Word32 CreateCapabilityMap(const char* deviceUniqueIdUTF8);
48
49 virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
50 const char* /*deviceUniqueIdUTF8*/,
51 const char* /*dialogTitleUTF8*/,
52 void* /*parentWindow*/,
53 WebRtc_UWord32 /*positionX*/,
54 WebRtc_UWord32 /*positionY*/) { return -1; }
55 virtual WebRtc_Word32 GetOrientation(const char* deviceUniqueIdUTF8,
56 VideoCaptureRotation& orientation);
57 private:
58 bool IsDeviceNameMatches(const char* name, const char* deviceUniqueIdUTF8);
59 enum {_expectedCaptureDelay = 190};
60};
61
62} // namespace videocapturemodule
63} // namespace webrtc
64
65#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_ANDROID_DEVICE_INFO_ANDROID_H_