Chromium Code Reviews| Index: remoting/base/util.cc |
| diff --git a/remoting/base/util.cc b/remoting/base/util.cc |
| index 93410502f997ebcc5ada457f7283353b2be198f2..cf7c4105527ac8267c69b93455f7ee0be104b24a 100644 |
| --- a/remoting/base/util.cc |
| +++ b/remoting/base/util.cc |
| @@ -2,16 +2,30 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "base/logging.h" |
| +#include "base/stringprintf.h" |
| #include "media/base/video_frame.h" |
| #include "media/base/yuv_convert.h" |
| #include "remoting/base/util.h" |
| -#include "base/logging.h" |
| - |
| using media::VideoFrame; |
| namespace remoting { |
| +std::string GetTimestampString() { |
| + time_t t = time(NULL); |
| + struct tm local_time = {0}; |
| +#if _MSC_VER >= 1400 |
|
dmac
2011/07/21 23:37:07
add a comment about this?
garykac
2011/08/02 00:15:37
Added a comment to the block of code since this wa
|
| + localtime_s(&local_time, &t); |
| +#else |
| + localtime_r(&t, &local_time); |
| +#endif |
| + struct tm* tm_time = &local_time; |
|
dmac
2011/07/21 23:37:07
why not just use local_time. instead of tm_time?
garykac
2011/08/02 00:15:37
To duplicate behavior from LogMessage
|
| + return StringPrintf("%02d%02d/%02d%02d%02d:", |
| + 1 + tm_time->tm_mon, tm_time->tm_mday, |
| + tm_time->tm_hour, tm_time->tm_min, tm_time->tm_sec); |
| +} |
| + |
| int GetBytesPerPixel(VideoFrame::Format format) { |
| // Note: The order is important here for performance. This is sorted from the |
| // most common to the less common (PIXEL_FORMAT_ASCII is mostly used |