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

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

Issue 23903032: Move NV21 colorspace treatment from VideoCapture java to C++ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unused GetIntField in VCDA; protected nv21_intermediate_buffer allocation in VCC Created 7 years, 3 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_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ 5 #ifndef MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_
6 #define MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ 6 #define MEDIA_VIDEO_CAPTURE_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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 private: 48 private:
49 enum InternalState { 49 enum InternalState {
50 kIdle, // The device is opened but not in use. 50 kIdle, // The device is opened but not in use.
51 kAllocated, // All resouces have been allocated and camera can be started. 51 kAllocated, // All resouces have been allocated and camera can be started.
52 kCapturing, // Video is being captured. 52 kCapturing, // Video is being captured.
53 kError // Hit error. User needs to recover by destroying the object. 53 kError // Hit error. User needs to recover by destroying the object.
54 }; 54 };
55 55
56 explicit VideoCaptureDeviceAndroid(const Name& device_name); 56 explicit VideoCaptureDeviceAndroid(const Name& device_name);
57 bool Init(); 57 bool Init();
58 VideoPixelFormat GetColorspace();
58 void SetErrorState(const std::string& reason); 59 void SetErrorState(const std::string& reason);
59 60
60 // Prevent racing on accessing |state_| and |observer_| since both could be 61 // Prevent racing on accessing |state_| and |observer_| since both could be
61 // accessed from different threads. 62 // accessed from different threads.
62 base::Lock lock_; 63 base::Lock lock_;
63 InternalState state_; 64 InternalState state_;
64 VideoCaptureDevice::EventHandler* observer_; 65 VideoCaptureDevice::EventHandler* observer_;
65 66
66 Name device_name_; 67 Name device_name_;
67 VideoCaptureCapability current_settings_; 68 VideoCaptureCapability current_settings_;
68 69
69 // Java VideoCaptureAndroid instance. 70 // Java VideoCaptureAndroid instance.
70 base::android::ScopedJavaGlobalRef<jobject> j_capture_; 71 base::android::ScopedJavaGlobalRef<jobject> j_capture_;
71 72
72 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); 73 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid);
73 }; 74 };
74 75
75 } // namespace media 76 } // namespace media
76 77
77 #endif // MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ 78 #endif // MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698