Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(914)

Side by Side Diff: media/capture/video/win/sink_input_pin_win.cc

Issue 1324683004: Win Video Capture: Sending the timestamps provided by the driver to the capture pipeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
187 sample->GetTime(&start_time, &end_time);
188
mcasas 2015/09/09 23:33:26 I deeply distrust all this code. Would you mind ad
qiangchen 2015/09/10 18:03:01 Done. Added a fallback to old code path if the dr
189 observer_->FrameReceived(buffer, length, start_time);
186 return S_OK; 190 return S_OK;
187 } 191 }
188 192
189 SinkInputPin::~SinkInputPin() { 193 SinkInputPin::~SinkInputPin() {
190 } 194 }
191 195
192 } // namespace media 196 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698