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

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

Issue 48113011: Remove media::VideoFrame from media::VideoCaptureDevice::Client interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: ffdbaeb83 Trybot failures. Created 7 years, 1 month 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
« no previous file with comments | « media/base/video_frame.cc ('k') | media/video/capture/linux/video_capture_device_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/video/capture/android/video_capture_device_android.h" 5 #include "media/video/capture/android/video_capture_device_android.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 if (!got_first_frame_) { 221 if (!got_first_frame_) {
222 // Set aside one frame allowance for fluctuation. 222 // Set aside one frame allowance for fluctuation.
223 expected_next_frame_time_ = current_time - frame_interval_; 223 expected_next_frame_time_ = current_time - frame_interval_;
224 got_first_frame_ = true; 224 got_first_frame_ = true;
225 } 225 }
226 226
227 // Deliver the frame when it doesn't arrive too early. 227 // Deliver the frame when it doesn't arrive too early.
228 if (expected_next_frame_time_ <= current_time) { 228 if (expected_next_frame_time_ <= current_time) {
229 expected_next_frame_time_ += frame_interval_; 229 expected_next_frame_time_ += frame_interval_;
230 230
231 client_->OnIncomingCapturedFrame( 231 client_->OnIncomingCapturedFrame(reinterpret_cast<uint8*>(buffer),
232 reinterpret_cast<uint8*>(buffer), length, base::Time::Now(), 232 length,
233 rotation, flip_vert, flip_horiz, current_settings_); 233 base::Time::Now(),
234 rotation,
235 flip_vert,
236 flip_horiz,
237 current_settings_);
234 } 238 }
235 239
236 env->ReleaseByteArrayElements(data, buffer, JNI_ABORT); 240 env->ReleaseByteArrayElements(data, buffer, JNI_ABORT);
237 } 241 }
238 242
239 VideoPixelFormat VideoCaptureDeviceAndroid::GetColorspace() { 243 VideoPixelFormat VideoCaptureDeviceAndroid::GetColorspace() {
240 JNIEnv* env = AttachCurrentThread(); 244 JNIEnv* env = AttachCurrentThread();
241 int current_capture_colorspace = 245 int current_capture_colorspace =
242 Java_VideoCapture_getColorspace(env, j_capture_.obj()); 246 Java_VideoCapture_getColorspace(env, j_capture_.obj());
243 switch (current_capture_colorspace){ 247 switch (current_capture_colorspace){
(...skipping 16 matching lines...) Expand all
260 void VideoCaptureDeviceAndroid::SetErrorState(const std::string& reason) { 264 void VideoCaptureDeviceAndroid::SetErrorState(const std::string& reason) {
261 LOG(ERROR) << "VideoCaptureDeviceAndroid::SetErrorState: " << reason; 265 LOG(ERROR) << "VideoCaptureDeviceAndroid::SetErrorState: " << reason;
262 { 266 {
263 base::AutoLock lock(lock_); 267 base::AutoLock lock(lock_);
264 state_ = kError; 268 state_ = kError;
265 } 269 }
266 client_->OnError(); 270 client_->OnError();
267 } 271 }
268 272
269 } // namespace media 273 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame.cc ('k') | media/video/capture/linux/video_capture_device_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698