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

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: Fallback to old code path in case no timestamp 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
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
OLDNEW
« no previous file with comments | « media/capture/video/win/sink_filter_observer_win.h ('k') | media/capture/video/win/video_capture_device_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698