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

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

Issue 2324733004: Reland: Video capture Android: enable unittests for Camera2 API (Closed)
Patch Set: Do not enumerate PIXEL_FORMAT_UNKNOWN capabilities, add TODO 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 #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 <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 } 421 }
422 422
423 mojom::BlobPtr blob = mojom::Blob::New(); 423 mojom::BlobPtr blob = mojom::Blob::New();
424 base::android::JavaByteArrayToByteVector(env, data.obj(), &blob->data); 424 base::android::JavaByteArrayToByteVector(env, data.obj(), &blob->data);
425 blob->mime_type = blob->data.empty() ? "" : "image/jpeg"; 425 blob->mime_type = blob->data.empty() ? "" : "image/jpeg";
426 cb->Run(std::move(blob)); 426 cb->Run(std::move(blob));
427 427
428 photo_callbacks_.erase(reference_it); 428 photo_callbacks_.erase(reference_it);
429 } 429 }
430 430
431 void VideoCaptureDeviceAndroid::ConfigureForTesting() {
432 Java_VideoCapture_setTestMode(AttachCurrentThread(), j_capture_);
433 }
434
431 VideoPixelFormat VideoCaptureDeviceAndroid::GetColorspace() { 435 VideoPixelFormat VideoCaptureDeviceAndroid::GetColorspace() {
432 JNIEnv* env = AttachCurrentThread(); 436 JNIEnv* env = AttachCurrentThread();
433 const int current_capture_colorspace = 437 const int current_capture_colorspace =
434 Java_VideoCapture_getColorspace(env, j_capture_); 438 Java_VideoCapture_getColorspace(env, j_capture_);
435 switch (current_capture_colorspace) { 439 switch (current_capture_colorspace) {
436 case ANDROID_IMAGE_FORMAT_YV12: 440 case ANDROID_IMAGE_FORMAT_YV12:
437 return media::PIXEL_FORMAT_YV12; 441 return media::PIXEL_FORMAT_YV12;
438 case ANDROID_IMAGE_FORMAT_YUV_420_888: 442 case ANDROID_IMAGE_FORMAT_YUV_420_888:
439 return media::PIXEL_FORMAT_I420; 443 return media::PIXEL_FORMAT_I420;
440 case ANDROID_IMAGE_FORMAT_NV21: 444 case ANDROID_IMAGE_FORMAT_NV21:
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 static_cast<int>(exposure_mode), width, height, points_of_interest, 594 static_cast<int>(exposure_mode), width, height, points_of_interest,
591 settings->has_exposure_compensation, exposure_compensation, 595 settings->has_exposure_compensation, exposure_compensation,
592 static_cast<int>(white_balance_mode), iso, 596 static_cast<int>(white_balance_mode), iso,
593 settings->has_red_eye_reduction, settings->red_eye_reduction, 597 settings->has_red_eye_reduction, settings->red_eye_reduction,
594 static_cast<int>(fill_light_mode)); 598 static_cast<int>(fill_light_mode));
595 599
596 callback.Run(true); 600 callback.Run(true);
597 } 601 }
598 602
599 } // namespace media 603 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698