| OLD | NEW |
| 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 } | 413 } |
| 414 | 414 |
| 415 mojom::BlobPtr blob = mojom::Blob::New(); | 415 mojom::BlobPtr blob = mojom::Blob::New(); |
| 416 base::android::JavaByteArrayToByteVector(env, data.obj(), &blob->data); | 416 base::android::JavaByteArrayToByteVector(env, data.obj(), &blob->data); |
| 417 blob->mime_type = blob->data.empty() ? "" : "image/jpeg"; | 417 blob->mime_type = blob->data.empty() ? "" : "image/jpeg"; |
| 418 cb->Run(std::move(blob)); | 418 cb->Run(std::move(blob)); |
| 419 | 419 |
| 420 photo_callbacks_.erase(reference_it); | 420 photo_callbacks_.erase(reference_it); |
| 421 } | 421 } |
| 422 | 422 |
| 423 void VideoCaptureDeviceAndroid::ConfigureForTesting() { |
| 424 Java_VideoCapture_setTestMode(AttachCurrentThread(), j_capture_); |
| 425 } |
| 426 |
| 423 VideoPixelFormat VideoCaptureDeviceAndroid::GetColorspace() { | 427 VideoPixelFormat VideoCaptureDeviceAndroid::GetColorspace() { |
| 424 JNIEnv* env = AttachCurrentThread(); | 428 JNIEnv* env = AttachCurrentThread(); |
| 425 const int current_capture_colorspace = | 429 const int current_capture_colorspace = |
| 426 Java_VideoCapture_getColorspace(env, j_capture_); | 430 Java_VideoCapture_getColorspace(env, j_capture_); |
| 427 switch (current_capture_colorspace) { | 431 switch (current_capture_colorspace) { |
| 428 case ANDROID_IMAGE_FORMAT_YV12: | 432 case ANDROID_IMAGE_FORMAT_YV12: |
| 429 return media::PIXEL_FORMAT_YV12; | 433 return media::PIXEL_FORMAT_YV12; |
| 430 case ANDROID_IMAGE_FORMAT_YUV_420_888: | 434 case ANDROID_IMAGE_FORMAT_YUV_420_888: |
| 431 return media::PIXEL_FORMAT_I420; | 435 return media::PIXEL_FORMAT_I420; |
| 432 case ANDROID_IMAGE_FORMAT_NV21: | 436 case ANDROID_IMAGE_FORMAT_NV21: |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 static_cast<int>(exposure_mode), width, height, points_of_interest, | 585 static_cast<int>(exposure_mode), width, height, points_of_interest, |
| 582 settings->has_exposure_compensation, exposure_compensation, | 586 settings->has_exposure_compensation, exposure_compensation, |
| 583 static_cast<int>(white_balance_mode), iso, | 587 static_cast<int>(white_balance_mode), iso, |
| 584 settings->has_red_eye_reduction, settings->red_eye_reduction, | 588 settings->has_red_eye_reduction, settings->red_eye_reduction, |
| 585 static_cast<int>(fill_light_mode)); | 589 static_cast<int>(fill_light_mode)); |
| 586 | 590 |
| 587 callback.Run(true); | 591 callback.Run(true); |
| 588 } | 592 } |
| 589 | 593 |
| 590 } // namespace media | 594 } // namespace media |
| OLD | NEW |