| 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 #ifndef REMOTING_BASE_UTIL_H_ | 5 #ifndef REMOTING_BASE_UTIL_H_ |
| 6 #define REMOTING_BASE_UTIL_H_ | 6 #define REMOTING_BASE_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| 11 #include "third_party/skia/include/core/SkRect.h" | 11 #include "third_party/skia/include/core/SkRect.h" |
| 12 | 12 |
| 13 namespace remoting { | 13 namespace remoting { |
| 14 | 14 |
| 15 // Return a string that contains the current date formatted as 'MMDD/HHMMSS:'. | 15 // Return a string that contains the current date formatted as 'MMDD/HHMMSS:'. |
| 16 std::string GetTimestampString(); | 16 std::string GetTimestampString(); |
| 17 | 17 |
| 18 // Calculate the offset of a specific pixel in an RGB32 buffer. |
| 19 int CalculateRGBOffset(int x, int y, int stride); |
| 20 |
| 21 // Calculate the offset of a specific pixel in a YV12/YUV420 buffer. Note that |
| 22 // the X and Y coordinates must both be even owing to the YV12 buffer layout. |
| 23 int CalculateYOffset(int x, int y, int stride); |
| 24 int CalculateUVOffset(int x, int y, int stride); |
| 25 |
| 18 // Convert and scale YUV to RGB32 on a specific rectangle. The source and | 26 // Convert and scale YUV to RGB32 on a specific rectangle. The source and |
| 19 // destination buffers are assumed to contain only |source_buffer_rect| and | 27 // destination buffers are assumed to contain only |source_buffer_rect| and |
| 20 // |dest_buffer_rect| areas correspondingly. The scaling factor is determined | 28 // |dest_buffer_rect| areas correspondingly. The scaling factor is determined |
| 21 // as ratio between |dest_size| and |source_size|. The target rectangle | 29 // as ratio between |dest_size| and |source_size|. The target rectangle |
| 22 // |dect_rect| is specified in the destination coordinates. | 30 // |dect_rect| is specified in the destination coordinates. |
| 23 // | 31 // |
| 24 // |source_buffer_rect| and |dest_buffer_rect| must fall entirely within | 32 // |source_buffer_rect| and |dest_buffer_rect| must fall entirely within |
| 25 // the source and destination dimensions, respectively. |dest_rect| must be | 33 // the source and destination dimensions, respectively. |dest_rect| must be |
| 26 // completely contained within the source and destinations buffers boundaries | 34 // completely contained within the source and destinations buffers boundaries |
| 27 // including the case when scaling is requested. | 35 // including the case when scaling is requested. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 92 |
| 85 // Replaces every occurrence of "\n" in a string by "\r\n". | 93 // Replaces every occurrence of "\n" in a string by "\r\n". |
| 86 std::string ReplaceLfByCrLf(const std::string& in); | 94 std::string ReplaceLfByCrLf(const std::string& in); |
| 87 | 95 |
| 88 // Replaces every occurrence of "\r\n" in a string by "\n". | 96 // Replaces every occurrence of "\r\n" in a string by "\n". |
| 89 std::string ReplaceCrLfByLf(const std::string& in); | 97 std::string ReplaceCrLfByLf(const std::string& in); |
| 90 | 98 |
| 91 } // namespace remoting | 99 } // namespace remoting |
| 92 | 100 |
| 93 #endif // REMOTING_BASE_UTIL_H_ | 101 #endif // REMOTING_BASE_UTIL_H_ |
| OLD | NEW |