| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/blob_utils.h" | 5 #include "media/capture/video/blob_utils.h" |
| 6 | 6 |
| 7 #include "media/base/video_capture_types.h" | |
| 8 #include "media/base/video_frame.h" | 7 #include "media/base/video_frame.h" |
| 8 #include "media/capture/video_capture_types.h" |
| 9 #include "third_party/libyuv/include/libyuv.h" | 9 #include "third_party/libyuv/include/libyuv.h" |
| 10 #include "third_party/skia/include/core/SkImage.h" | 10 #include "third_party/skia/include/core/SkImage.h" |
| 11 #include "ui/gfx/codec/png_codec.h" | 11 #include "ui/gfx/codec/png_codec.h" |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 | 14 |
| 15 mojom::BlobPtr Blobify(const uint8_t* buffer, | 15 mojom::BlobPtr Blobify(const uint8_t* buffer, |
| 16 const uint32_t bytesused, | 16 const uint32_t bytesused, |
| 17 const VideoCaptureFormat& capture_format) { | 17 const VideoCaptureFormat& capture_format) { |
| 18 DCHECK(buffer); | 18 DCHECK(buffer); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 tmp_argb.get(), codec_color_format, frame_size, frame_size.width() * 4, | 60 tmp_argb.get(), codec_color_format, frame_size, frame_size.width() * 4, |
| 61 true /* discard_transparency */, std::vector<gfx::PNGCodec::Comment>(), | 61 true /* discard_transparency */, std::vector<gfx::PNGCodec::Comment>(), |
| 62 &blob->data); | 62 &blob->data); |
| 63 DCHECK(result); | 63 DCHECK(result); |
| 64 | 64 |
| 65 blob->mime_type = "image/png"; | 65 blob->mime_type = "image/png"; |
| 66 return blob; | 66 return blob; |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace media | 69 } // namespace media |
| OLD | NEW |