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

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

Issue 2272873002: Android video capture: only use reference time for outbound timestamp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: estimate a timestamp in Camera1 callback Created 4 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_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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 void OnI420FrameAvailable(JNIEnv* env, 80 void OnI420FrameAvailable(JNIEnv* env,
81 jobject obj, 81 jobject obj,
82 jobject y_buffer, 82 jobject y_buffer,
83 jint y_stride, 83 jint y_stride,
84 jobject u_buffer, 84 jobject u_buffer,
85 jobject v_buffer, 85 jobject v_buffer,
86 jint uv_row_stride, 86 jint uv_row_stride,
87 jint uv_pixel_stride, 87 jint uv_pixel_stride,
88 jint width, 88 jint width,
89 jint height, 89 jint height,
90 jint rotation); 90 jint rotation,
91 jlong timestamp);
91 92
92 // Implement org.chromium.media.VideoCapture.nativeOnError. 93 // Implement org.chromium.media.VideoCapture.nativeOnError.
93 void OnError(JNIEnv* env, 94 void OnError(JNIEnv* env,
94 const base::android::JavaParamRef<jobject>& obj, 95 const base::android::JavaParamRef<jobject>& obj,
95 const base::android::JavaParamRef<jstring>& message); 96 const base::android::JavaParamRef<jstring>& message);
96 97
97 // Implement org.chromium.media.VideoCapture.nativeOnPhotoTaken. 98 // Implement org.chromium.media.VideoCapture.nativeOnPhotoTaken.
98 void OnPhotoTaken(JNIEnv* env, 99 void OnPhotoTaken(JNIEnv* env,
99 const base::android::JavaParamRef<jobject>& obj, 100 const base::android::JavaParamRef<jobject>& obj,
100 jlong callback_id, 101 jlong callback_id,
(...skipping 22 matching lines...) Expand all
123 // |photo_requests_queue_| from concurrent access. 124 // |photo_requests_queue_| from concurrent access.
124 base::Lock lock_; 125 base::Lock lock_;
125 InternalState state_; 126 InternalState state_;
126 std::unique_ptr<VideoCaptureDevice::Client> client_; 127 std::unique_ptr<VideoCaptureDevice::Client> client_;
127 bool got_first_frame_; 128 bool got_first_frame_;
128 // Photo-related requests waiting for |got_first_frame_| to be served. Android 129 // Photo-related requests waiting for |got_first_frame_| to be served. Android
129 // APIs need the device capturing or nearly-capturing to be fully oeprational. 130 // APIs need the device capturing or nearly-capturing to be fully oeprational.
130 std::list<base::Closure> photo_requests_queue_; 131 std::list<base::Closure> photo_requests_queue_;
131 132
132 base::TimeTicks expected_next_frame_time_; 133 base::TimeTicks expected_next_frame_time_;
133 base::TimeTicks first_ref_time_;
134 base::TimeDelta frame_interval_; 134 base::TimeDelta frame_interval_;
135 135
136 // List of |photo_callbacks_| in flight, being served in Java side. 136 // List of |photo_callbacks_| in flight, being served in Java side.
137 base::Lock photo_callbacks_lock_; 137 base::Lock photo_callbacks_lock_;
138 std::list<std::unique_ptr<TakePhotoCallback>> photo_callbacks_; 138 std::list<std::unique_ptr<TakePhotoCallback>> photo_callbacks_;
139 139
140 const VideoCaptureDeviceDescriptor device_descriptor_; 140 const VideoCaptureDeviceDescriptor device_descriptor_;
141 VideoCaptureFormat capture_format_; 141 VideoCaptureFormat capture_format_;
142 142
143 // Java VideoCaptureAndroid instance. 143 // Java VideoCaptureAndroid instance.
144 base::android::ScopedJavaLocalRef<jobject> j_capture_; 144 base::android::ScopedJavaLocalRef<jobject> j_capture_;
145 145
146 base::WeakPtrFactory<VideoCaptureDeviceAndroid> weak_ptr_factory_; 146 base::WeakPtrFactory<VideoCaptureDeviceAndroid> weak_ptr_factory_;
147 147
148 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); 148 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid);
149 }; 149 };
150 150
151 } // namespace media 151 } // namespace media
152 152
153 #endif // MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ 153 #endif // MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698