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

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

Issue 1534273002: Switch to standard integer types in media/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 years 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 #include "media/capture/video/android/video_capture_device_android.h" 5 #include "media/capture/video/android/video_capture_device_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "jni/VideoCapture_jni.h" 10 #include "jni/VideoCapture_jni.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if (!got_first_frame_) { 154 if (!got_first_frame_) {
155 // Set aside one frame allowance for fluctuation. 155 // Set aside one frame allowance for fluctuation.
156 expected_next_frame_time_ = current_time - frame_interval_; 156 expected_next_frame_time_ = current_time - frame_interval_;
157 got_first_frame_ = true; 157 got_first_frame_ = true;
158 } 158 }
159 159
160 // Deliver the frame when it doesn't arrive too early. 160 // Deliver the frame when it doesn't arrive too early.
161 if (expected_next_frame_time_ <= current_time) { 161 if (expected_next_frame_time_ <= current_time) {
162 expected_next_frame_time_ += frame_interval_; 162 expected_next_frame_time_ += frame_interval_;
163 163
164 client_->OnIncomingCapturedData(reinterpret_cast<uint8*>(buffer), length, 164 client_->OnIncomingCapturedData(reinterpret_cast<uint8_t*>(buffer), length,
165 capture_format_, rotation, 165 capture_format_, rotation,
166 base::TimeTicks::Now()); 166 base::TimeTicks::Now());
167 } 167 }
168 168
169 env->ReleaseByteArrayElements(data, buffer, JNI_ABORT); 169 env->ReleaseByteArrayElements(data, buffer, JNI_ABORT);
170 } 170 }
171 171
172 void VideoCaptureDeviceAndroid::OnError(JNIEnv* env, 172 void VideoCaptureDeviceAndroid::OnError(JNIEnv* env,
173 const JavaParamRef<jobject>& obj, 173 const JavaParamRef<jobject>& obj,
174 const JavaParamRef<jstring>& message) { 174 const JavaParamRef<jstring>& message) {
(...skipping 22 matching lines...) Expand all
197 const tracked_objects::Location& from_here, 197 const tracked_objects::Location& from_here,
198 const std::string& reason) { 198 const std::string& reason) {
199 { 199 {
200 base::AutoLock lock(lock_); 200 base::AutoLock lock(lock_);
201 state_ = kError; 201 state_ = kError;
202 } 202 }
203 client_->OnError(from_here, reason); 203 client_->OnError(from_here, reason);
204 } 204 }
205 205
206 } // namespace media 206 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698