| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/renderer_host/media/video_capture_device_client.h" | 5 #include "content/browser/renderer_host/media/video_capture_device_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h" | 10 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 case media::PIXEL_FORMAT_RGB24: | 154 case media::PIXEL_FORMAT_RGB24: |
| 155 origin_colorspace = libyuv::FOURCC_24BG; | 155 origin_colorspace = libyuv::FOURCC_24BG; |
| 156 #if defined(OS_WIN) | 156 #if defined(OS_WIN) |
| 157 // TODO(wjia): Currently, for RGB24 on WIN, capture device always | 157 // TODO(wjia): Currently, for RGB24 on WIN, capture device always |
| 158 // passes in positive src_width and src_height. Remove this hardcoded | 158 // passes in positive src_width and src_height. Remove this hardcoded |
| 159 // value when nagative src_height is supported. The negative src_height | 159 // value when nagative src_height is supported. The negative src_height |
| 160 // indicates that vertical flipping is needed. | 160 // indicates that vertical flipping is needed. |
| 161 flip = true; | 161 flip = true; |
| 162 #endif | 162 #endif |
| 163 break; | 163 break; |
| 164 case media::PIXEL_FORMAT_RGB32: |
| 165 // Fallback to PIXEL_FORMAT_ARGB setting |flip| in Windows platforms. |
| 166 #if defined(OS_WIN) |
| 167 flip = true; |
| 168 #endif |
| 164 case media::PIXEL_FORMAT_ARGB: | 169 case media::PIXEL_FORMAT_ARGB: |
| 165 origin_colorspace = libyuv::FOURCC_ARGB; | 170 origin_colorspace = libyuv::FOURCC_ARGB; |
| 166 break; | 171 break; |
| 167 case media::PIXEL_FORMAT_MJPEG: | 172 case media::PIXEL_FORMAT_MJPEG: |
| 168 origin_colorspace = libyuv::FOURCC_MJPG; | 173 origin_colorspace = libyuv::FOURCC_MJPG; |
| 169 break; | 174 break; |
| 170 default: | 175 default: |
| 171 NOTREACHED(); | 176 NOTREACHED(); |
| 172 } | 177 } |
| 173 | 178 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 } | 362 } |
| 358 | 363 |
| 359 void VideoCaptureDeviceClient::OnLog( | 364 void VideoCaptureDeviceClient::OnLog( |
| 360 const std::string& message) { | 365 const std::string& message) { |
| 361 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 366 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 362 base::Bind(&VideoCaptureController::DoLogOnIOThread, | 367 base::Bind(&VideoCaptureController::DoLogOnIOThread, |
| 363 controller_, message)); | 368 controller_, message)); |
| 364 } | 369 } |
| 365 | 370 |
| 366 } // namespace content | 371 } // namespace content |
| OLD | NEW |