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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::OnStarted(JNIEnv* env, |
| 432 const JavaParamRef<jobject>& obj) { |
| 433 if (client_) |
| 434 client_->OnStarted(); |
| 435 } |
| 436 |
431 void VideoCaptureDeviceAndroid::ConfigureForTesting() { | 437 void VideoCaptureDeviceAndroid::ConfigureForTesting() { |
432 Java_VideoCapture_setTestMode(AttachCurrentThread(), j_capture_); | 438 Java_VideoCapture_setTestMode(AttachCurrentThread(), j_capture_); |
433 } | 439 } |
434 | 440 |
435 VideoPixelFormat VideoCaptureDeviceAndroid::GetColorspace() { | 441 VideoPixelFormat VideoCaptureDeviceAndroid::GetColorspace() { |
436 JNIEnv* env = AttachCurrentThread(); | 442 JNIEnv* env = AttachCurrentThread(); |
437 const int current_capture_colorspace = | 443 const int current_capture_colorspace = |
438 Java_VideoCapture_getColorspace(env, j_capture_); | 444 Java_VideoCapture_getColorspace(env, j_capture_); |
439 switch (current_capture_colorspace) { | 445 switch (current_capture_colorspace) { |
440 case ANDROID_IMAGE_FORMAT_YV12: | 446 case ANDROID_IMAGE_FORMAT_YV12: |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 static_cast<int>(exposure_mode), width, height, points_of_interest, | 621 static_cast<int>(exposure_mode), width, height, points_of_interest, |
616 settings->has_exposure_compensation, exposure_compensation, | 622 settings->has_exposure_compensation, exposure_compensation, |
617 static_cast<int>(white_balance_mode), iso, | 623 static_cast<int>(white_balance_mode), iso, |
618 settings->has_red_eye_reduction, settings->red_eye_reduction, | 624 settings->has_red_eye_reduction, settings->red_eye_reduction, |
619 static_cast<int>(fill_light_mode), color_temperature); | 625 static_cast<int>(fill_light_mode), color_temperature); |
620 | 626 |
621 callback.Run(true); | 627 callback.Run(true); |
622 } | 628 } |
623 | 629 |
624 } // namespace media | 630 } // namespace media |
OLD | NEW |