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

Unified Diff: media/capture/video/android/video_capture_device_android.h

Issue 2219813002: Revert of ImageCapture: Queue up requests while device not ready (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: media/capture/video/android/video_capture_device_android.h
diff --git a/media/capture/video/android/video_capture_device_android.h b/media/capture/video/android/video_capture_device_android.h
index f4d9236f7cddd8e01efe1f8a7e7a2106778be8e7..9a637a39eb1af496995747d86fdca0e43586bb4c 100644
--- a/media/capture/video/android/video_capture_device_android.h
+++ b/media/capture/video/android/video_capture_device_android.h
@@ -10,7 +10,6 @@
#include "base/android/scoped_java_ref.h"
#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread.h"
#include "base/threading/thread_checker.h"
@@ -18,13 +17,9 @@
#include "media/capture/capture_export.h"
#include "media/capture/video/video_capture_device.h"
-namespace base {
-class SingleThreadTaskRunner;
-}
-
namespace tracked_objects {
class Location;
-} // namespace tracked_objects
+} // namespace tracked_
namespace media {
@@ -102,33 +97,24 @@
private:
enum InternalState {
- kIdle, // The device is opened but not in use.
- kConfigured, // The device has been AllocateAndStart()ed.
- kError // Hit error. User needs to recover by destroying the object.
+ kIdle, // The device is opened but not in use.
+ kCapturing, // Video is being captured.
+ kError // Hit error. User needs to recover by destroying the object.
};
VideoPixelFormat GetColorspace();
void SetErrorState(const tracked_objects::Location& from_here,
const std::string& reason);
- void DoGetPhotoCapabilities(GetPhotoCapabilitiesCallback callback);
- void DoSetPhotoOptions(mojom::PhotoSettingsPtr settings,
- SetPhotoOptionsCallback callback);
- void DoTakePhoto(TakePhotoCallback callback);
+ base::ThreadChecker thread_checker_;
- // Thread on which we are created.
- const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
-
- // |lock_| protects |state_|, |client_|, |got_first_frame_| and
- // |photo_requests_queue_| from concurrent access.
+ // Prevent racing on accessing |state_| and |client_| since both could be
+ // accessed from different threads.
base::Lock lock_;
InternalState state_;
std::unique_ptr<VideoCaptureDevice::Client> client_;
+
bool got_first_frame_;
- // Photo-related requests waiting for |got_first_frame_| to be served. Android
- // APIs need the device capturing or nearly-capturing to be fully oeprational.
- std::list<base::Closure> photo_requests_queue_;
-
base::TimeTicks expected_next_frame_time_;
base::TimeTicks first_ref_time_;
base::TimeDelta frame_interval_;
@@ -145,8 +131,6 @@
// Java VideoCaptureAndroid instance.
base::android::ScopedJavaLocalRef<jobject> j_capture_;
- base::WeakPtrFactory<VideoCaptureDeviceAndroid> weak_ptr_factory_;
-
DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid);
};
« no previous file with comments | « content/test/data/media/image_capture_test.html ('k') | media/capture/video/android/video_capture_device_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698