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 // TODO(sergeyu): Move these methods to media. | |
19 int GetBytesPerPixel(media::VideoFrame::Format format); | |
20 | |
21 // Convert and scale YUV to RGB32 on a specific rectangle. The source and | 18 // Convert and scale YUV to RGB32 on a specific rectangle. The source and |
22 // destination buffers are assumed to contain only |source_buffer_rect| and | 19 // destination buffers are assumed to contain only |source_buffer_rect| and |
23 // |dest_buffer_rect| areas correspondingly. The scaling factor is determined | 20 // |dest_buffer_rect| areas correspondingly. The scaling factor is determined |
24 // as ratio between |dest_size| and |source_size|. The target rectangle | 21 // as ratio between |dest_size| and |source_size|. The target rectangle |
25 // |dect_rect| is specified in the destination coordinates. | 22 // |dect_rect| is specified in the destination coordinates. |
26 // | 23 // |
27 // |source_buffer_rect| and |dest_buffer_rect| must fall entirely within | 24 // |source_buffer_rect| and |dest_buffer_rect| must fall entirely within |
28 // the source and destination dimensions, respectively. |dest_rect| must be | 25 // the source and destination dimensions, respectively. |dest_rect| must be |
29 // completely contained within the source and destinations buffers boundaries | 26 // completely contained within the source and destinations buffers boundaries |
30 // including the case when scaling is requested. | 27 // including the case when scaling is requested. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 int source_stride, | 78 int source_stride, |
82 const SkIRect& source_buffer_rect, | 79 const SkIRect& source_buffer_rect, |
83 uint8* dest_buffer, | 80 uint8* dest_buffer, |
84 int dest_stride, | 81 int dest_stride, |
85 const SkIRect& dest_buffer_rect, | 82 const SkIRect& dest_buffer_rect, |
86 const SkIRect& dest_rect); | 83 const SkIRect& dest_rect); |
87 | 84 |
88 } // namespace remoting | 85 } // namespace remoting |
89 | 86 |
90 #endif // REMOTING_BASE_UTIL_H_ | 87 #endif // REMOTING_BASE_UTIL_H_ |
OLD | NEW |