Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Side by Side Diff: media/capture/video/android/video_capture_device_android.h

Issue 2169013002: Change class VideoCaptureDevice::Name to struct VideoCaptureDeviceDescriptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed emircan's comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ 5 #ifndef MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_
6 #define MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ 6 #define MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 23 matching lines...) Expand all
34 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.media 34 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.media
35 enum AndroidImageFormat { 35 enum AndroidImageFormat {
36 // Android graphics ImageFormat mapping, see reference in: 36 // Android graphics ImageFormat mapping, see reference in:
37 // http://developer.android.com/reference/android/graphics/ImageFormat.html 37 // http://developer.android.com/reference/android/graphics/ImageFormat.html
38 ANDROID_IMAGE_FORMAT_NV21 = 17, 38 ANDROID_IMAGE_FORMAT_NV21 = 17,
39 ANDROID_IMAGE_FORMAT_YUV_420_888 = 35, 39 ANDROID_IMAGE_FORMAT_YUV_420_888 = 35,
40 ANDROID_IMAGE_FORMAT_YV12 = 842094169, 40 ANDROID_IMAGE_FORMAT_YV12 = 842094169,
41 ANDROID_IMAGE_FORMAT_UNKNOWN = 0, 41 ANDROID_IMAGE_FORMAT_UNKNOWN = 0,
42 }; 42 };
43 43
44 explicit VideoCaptureDeviceAndroid(const Name& device_name); 44 explicit VideoCaptureDeviceAndroid(
45 const VideoCaptureDeviceDescriptor& device_descriptor);
45 ~VideoCaptureDeviceAndroid() override; 46 ~VideoCaptureDeviceAndroid() override;
46 47
47 static VideoCaptureDevice* Create(const Name& device_name); 48 static VideoCaptureDevice* Create(
49 const VideoCaptureDeviceDescriptor& device_descriptor);
48 static bool RegisterVideoCaptureDevice(JNIEnv* env); 50 static bool RegisterVideoCaptureDevice(JNIEnv* env);
49 51
50 // Registers the Java VideoCaptureDevice pointer, used by the rest of the 52 // Registers the Java VideoCaptureDevice pointer, used by the rest of the
51 // methods of the class to operate the Java capture code. This method must be 53 // methods of the class to operate the Java capture code. This method must be
52 // called after the class constructor and before AllocateAndStart(). 54 // called after the class constructor and before AllocateAndStart().
53 bool Init(); 55 bool Init();
54 56
55 // VideoCaptureDevice implementation. 57 // VideoCaptureDevice implementation.
56 void AllocateAndStart(const VideoCaptureParams& params, 58 void AllocateAndStart(const VideoCaptureParams& params,
57 std::unique_ptr<Client> client) override; 59 std::unique_ptr<Client> client) override;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 base::TimeTicks first_ref_time_; 114 base::TimeTicks first_ref_time_;
113 base::TimeDelta frame_interval_; 115 base::TimeDelta frame_interval_;
114 std::unique_ptr<VideoCaptureDevice::Client> client_; 116 std::unique_ptr<VideoCaptureDevice::Client> client_;
115 117
116 // List of |photo_callbacks_| in flight, being served in Java side. 118 // List of |photo_callbacks_| in flight, being served in Java side.
117 base::Lock photo_callbacks_lock_; 119 base::Lock photo_callbacks_lock_;
118 std::list<std::unique_ptr<TakePhotoCallback>> photo_callbacks_; 120 std::list<std::unique_ptr<TakePhotoCallback>> photo_callbacks_;
119 121
120 gfx::Size next_photo_resolution_; 122 gfx::Size next_photo_resolution_;
121 123
122 Name device_name_; 124 VideoCaptureDeviceDescriptor device_descriptor_;
mcasas 2016/07/26 23:52:03 nit: can be made const?
chfremer 2016/07/27 23:10:17 Done.
123 VideoCaptureFormat capture_format_; 125 VideoCaptureFormat capture_format_;
124 126
125 // Java VideoCaptureAndroid instance. 127 // Java VideoCaptureAndroid instance.
126 base::android::ScopedJavaLocalRef<jobject> j_capture_; 128 base::android::ScopedJavaLocalRef<jobject> j_capture_;
127 129
128 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); 130 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid);
129 }; 131 };
130 132
131 } // namespace media 133 } // namespace media
132 134
133 #endif // MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ 135 #endif // MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698