Chromium Code Reviews| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 uint8* buffer = NULL; | 175 uint8* buffer = NULL; |
| 176 | 176 |
| 177 if (length <= 0) { | 177 if (length <= 0) { |
| 178 DLOG(WARNING) << "Media sample length is 0 or less."; | 178 DLOG(WARNING) << "Media sample length is 0 or less."; |
| 179 return S_FALSE; | 179 return S_FALSE; |
| 180 } | 180 } |
| 181 | 181 |
| 182 if (FAILED(sample->GetPointer(&buffer))) | 182 if (FAILED(sample->GetPointer(&buffer))) |
| 183 return S_FALSE; | 183 return S_FALSE; |
| 184 | 184 |
| 185 observer_->FrameReceived(buffer, length); | 185 REFERENCE_TIME start_time, end_time; |
| 186 | |
|
mcasas
2015/09/10 20:03:20
no blank line
qiangchen
2015/09/10 21:37:45
Done.
| |
| 187 if (FAILED(sample->GetTime(&start_time, &end_time))) { | |
| 188 start_time = -1; | |
| 189 end_time = -1; | |
|
mcasas
2015/09/10 20:03:20
Hmmm, the assignment and the use of |start_time| a
qiangchen
2015/09/10 21:37:45
Done.
| |
| 190 } | |
| 191 | |
| 192 DCHECK(start_time <= end_time); | |
| 193 | |
| 194 observer_->FrameReceived(buffer, length, start_time); | |
| 186 return S_OK; | 195 return S_OK; |
| 187 } | 196 } |
| 188 | 197 |
| 189 SinkInputPin::~SinkInputPin() { | 198 SinkInputPin::~SinkInputPin() { |
| 190 } | 199 } |
| 191 | 200 |
| 192 } // namespace media | 201 } // namespace media |
| OLD | NEW |