diff options
Diffstat (limited to 'chromium/media/video/capture/android/video_capture_device_android.h')
-rw-r--r-- | chromium/media/video/capture/android/video_capture_device_android.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/chromium/media/video/capture/android/video_capture_device_android.h b/chromium/media/video/capture/android/video_capture_device_android.h index de6955d9e8f..635417af572 100644 --- a/chromium/media/video/capture/android/video_capture_device_android.h +++ b/chromium/media/video/capture/android/video_capture_device_android.h @@ -19,9 +19,9 @@ namespace media { // VideoCaptureDevice on Android. The VideoCaptureDevice API's are called // by VideoCaptureManager on its own thread, while OnFrameAvailable is called -// on JAVA thread (i.e., UI thread). Both will access |state_| and |observer_|, +// on JAVA thread (i.e., UI thread). Both will access |state_| and |client_|, // but only VideoCaptureManager would change their value. -class MEDIA_EXPORT VideoCaptureDeviceAndroid : public VideoCaptureDevice1 { +class MEDIA_EXPORT VideoCaptureDeviceAndroid : public VideoCaptureDevice { public: virtual ~VideoCaptureDeviceAndroid(); @@ -29,12 +29,9 @@ class MEDIA_EXPORT VideoCaptureDeviceAndroid : public VideoCaptureDevice1 { static bool RegisterVideoCaptureDevice(JNIEnv* env); // VideoCaptureDevice implementation. - virtual void Allocate(const VideoCaptureCapability& capture_format, - EventHandler* observer) OVERRIDE; - virtual void Start() OVERRIDE; - virtual void Stop() OVERRIDE; - virtual void DeAllocate() OVERRIDE; - virtual const Name& device_name() OVERRIDE; + virtual void AllocateAndStart(const VideoCaptureParams& params, + scoped_ptr<Client> client) OVERRIDE; + virtual void StopAndDeAllocate() OVERRIDE; // Implement org.chromium.media.VideoCapture.nativeOnFrameAvailable. void OnFrameAvailable( @@ -42,14 +39,11 @@ class MEDIA_EXPORT VideoCaptureDeviceAndroid : public VideoCaptureDevice1 { jobject obj, jbyteArray data, jint length, - jint rotation, - jboolean flip_vert, - jboolean flip_horiz); + jint rotation); private: enum InternalState { kIdle, // The device is opened but not in use. - kAllocated, // All resouces have been allocated and camera can be started. kCapturing, // Video is being captured. kError // Hit error. User needs to recover by destroying the object. }; @@ -66,17 +60,17 @@ class MEDIA_EXPORT VideoCaptureDeviceAndroid : public VideoCaptureDevice1 { VideoPixelFormat GetColorspace(); void SetErrorState(const std::string& reason); - // Prevent racing on accessing |state_| and |observer_| since both could be + // Prevent racing on accessing |state_| and |client_| since both could be // accessed from different threads. base::Lock lock_; InternalState state_; bool got_first_frame_; base::TimeTicks expected_next_frame_time_; base::TimeDelta frame_interval_; - VideoCaptureDevice::EventHandler* observer_; + scoped_ptr<VideoCaptureDevice::Client> client_; Name device_name_; - VideoCaptureCapability current_settings_; + VideoCaptureFormat capture_format_; // Java VideoCaptureAndroid instance. base::android::ScopedJavaGlobalRef<jobject> j_capture_; |