Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/logging.h" | |
| 6 #include "base/stringprintf.h" | |
| 5 #include "media/base/video_frame.h" | 7 #include "media/base/video_frame.h" |
| 6 #include "media/base/yuv_convert.h" | 8 #include "media/base/yuv_convert.h" |
| 7 #include "remoting/base/util.h" | 9 #include "remoting/base/util.h" |
| 8 | 10 |
| 9 #include "base/logging.h" | |
| 10 | |
| 11 using media::VideoFrame; | 11 using media::VideoFrame; |
| 12 | 12 |
| 13 namespace remoting { | 13 namespace remoting { |
| 14 | 14 |
| 15 std::string GetTimestampString() { | |
| 16 time_t t = time(NULL); | |
| 17 struct tm local_time = {0}; | |
| 18 #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
| |
| 19 localtime_s(&local_time, &t); | |
| 20 #else | |
| 21 localtime_r(&t, &local_time); | |
| 22 #endif | |
| 23 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
| |
| 24 return StringPrintf("%02d%02d/%02d%02d%02d:", | |
| 25 1 + tm_time->tm_mon, tm_time->tm_mday, | |
| 26 tm_time->tm_hour, tm_time->tm_min, tm_time->tm_sec); | |
| 27 } | |
| 28 | |
| 15 int GetBytesPerPixel(VideoFrame::Format format) { | 29 int GetBytesPerPixel(VideoFrame::Format format) { |
| 16 // Note: The order is important here for performance. This is sorted from the | 30 // Note: The order is important here for performance. This is sorted from the |
| 17 // most common to the less common (PIXEL_FORMAT_ASCII is mostly used | 31 // most common to the less common (PIXEL_FORMAT_ASCII is mostly used |
| 18 // just for testing). | 32 // just for testing). |
| 19 switch (format) { | 33 switch (format) { |
| 20 case VideoFrame::RGB24: return 3; | 34 case VideoFrame::RGB24: return 3; |
| 21 case VideoFrame::RGB565: return 2; | 35 case VideoFrame::RGB565: return 2; |
| 22 case VideoFrame::RGB32: return 4; | 36 case VideoFrame::RGB32: return 4; |
| 23 case VideoFrame::ASCII: return 1; | 37 case VideoFrame::ASCII: return 1; |
| 24 default: | 38 default: |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 u_plane + uv_offset, | 101 u_plane + uv_offset, |
| 88 v_plane + uv_offset, | 102 v_plane + uv_offset, |
| 89 width, | 103 width, |
| 90 height, | 104 height, |
| 91 rgb_stride, | 105 rgb_stride, |
| 92 y_stride, | 106 y_stride, |
| 93 uv_stride); | 107 uv_stride); |
| 94 } | 108 } |
| 95 | 109 |
| 96 } // namespace remoting | 110 } // namespace remoting |
| OLD | NEW |