| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/win/sink_input_pin_win.h" | 5 #include "media/capture/video/win/sink_input_pin_win.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 | 8 |
| 9 // Avoid including strsafe.h via dshow as it will cause build warnings. | 9 // Avoid including strsafe.h via dshow as it will cause build warnings. |
| 10 #define NO_DSHOW_STRSAFE | 10 #define NO_DSHOW_STRSAFE |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 if (sub_type == MEDIASUBTYPE_RGB32 && | 93 if (sub_type == MEDIASUBTYPE_RGB32 && |
| 94 pvi->bmiHeader.biCompression == BI_RGB) { | 94 pvi->bmiHeader.biCompression == BI_RGB) { |
| 95 resulting_format_.pixel_format = PIXEL_FORMAT_RGB32; | 95 resulting_format_.pixel_format = PIXEL_FORMAT_RGB32; |
| 96 return true; | 96 return true; |
| 97 } | 97 } |
| 98 | 98 |
| 99 #ifndef NDEBUG | 99 #ifndef NDEBUG |
| 100 WCHAR guid_str[128]; | 100 WCHAR guid_str[128]; |
| 101 StringFromGUID2(sub_type, guid_str, arraysize(guid_str)); | 101 StringFromGUID2(sub_type, guid_str, arraysize(guid_str)); |
| 102 DVLOG(2) << __FUNCTION__ << " unsupported media type: " << guid_str; | 102 DVLOG(2) << __func__ << " unsupported media type: " << guid_str; |
| 103 #endif | 103 #endif |
| 104 return false; | 104 return false; |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool SinkInputPin::GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) { | 107 bool SinkInputPin::GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) { |
| 108 if (media_type->cbFormat < sizeof(VIDEOINFOHEADER)) | 108 if (media_type->cbFormat < sizeof(VIDEOINFOHEADER)) |
| 109 return false; | 109 return false; |
| 110 | 110 |
| 111 VIDEOINFOHEADER* const pvi = | 111 VIDEOINFOHEADER* const pvi = |
| 112 reinterpret_cast<VIDEOINFOHEADER*>(media_type->pbFormat); | 112 reinterpret_cast<VIDEOINFOHEADER*>(media_type->pbFormat); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 209 } |
| 210 | 210 |
| 211 observer_->FrameReceived(buffer, length, timestamp); | 211 observer_->FrameReceived(buffer, length, timestamp); |
| 212 return S_OK; | 212 return S_OK; |
| 213 } | 213 } |
| 214 | 214 |
| 215 SinkInputPin::~SinkInputPin() { | 215 SinkInputPin::~SinkInputPin() { |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace media | 218 } // namespace media |
| OLD | NEW |