1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_FACTORY_ANDROID_H_ 6 #define MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_FACTORY_ANDROID_H_ 7 8 #include "media/video/capture/video_capture_device_factory.h" 9 10 #include <jni.h> 11 12 #include "base/android/scoped_java_ref.h" 13 #include "media/video/capture/video_capture_device.h" 14 15 namespace media { 16 17 // VideoCaptureDeviceFactory on Android. This class implements the static 18 // VideoCapture methods and the factory of VideoCaptureAndroid. 19 class MEDIA_EXPORT VideoCaptureDeviceFactoryAndroid : 20 public VideoCaptureDeviceFactory { 21 public: 22 // Automatically generated enum to interface with Java world. 23 enum AndroidImageFormat { 24 #define DEFINE_ANDROID_IMAGEFORMAT(name, value) name = value, 25 #include "media/video/capture/android/imageformat_list.h" 26 #undef DEFINE_ANDROID_IMAGEFORMAT 27 }; 28 static bool RegisterVideoCaptureDeviceFactory(JNIEnv* env); 29 static base::android::ScopedJavaLocalRef<jobject> createVideoCaptureAndroid( 30 int id, 31 jlong nativeVideoCaptureDeviceAndroid); 32 VideoCaptureDeviceFactoryAndroid()33 VideoCaptureDeviceFactoryAndroid() {} ~VideoCaptureDeviceFactoryAndroid()34 virtual ~VideoCaptureDeviceFactoryAndroid() {} 35 36 virtual scoped_ptr<VideoCaptureDevice> Create( 37 const VideoCaptureDevice::Name& device_name) OVERRIDE; 38 virtual void GetDeviceNames(VideoCaptureDevice::Names* device_names) OVERRIDE; 39 virtual void GetDeviceSupportedFormats( 40 const VideoCaptureDevice::Name& device, 41 VideoCaptureFormats* supported_formats) OVERRIDE; 42 43 private: 44 45 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactoryAndroid);}; 46 } // namespace media 47 48 #endif // MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_FACTORY_ANDROID_H_ 49