OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MEDIA_CAST_CAST_DEFINES_H_ | 5 #ifndef MEDIA_CAST_CAST_DEFINES_H_ |
6 #define MEDIA_CAST_CAST_DEFINES_H_ | 6 #define MEDIA_CAST_CAST_DEFINES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 aes_nonce[10] = (frame_id >> 8) & 0xff; | 179 aes_nonce[10] = (frame_id >> 8) & 0xff; |
180 aes_nonce[9] = (frame_id >> 16) & 0xff; | 180 aes_nonce[9] = (frame_id >> 16) & 0xff; |
181 aes_nonce[8] = (frame_id >> 24) & 0xff; | 181 aes_nonce[8] = (frame_id >> 24) & 0xff; |
182 | 182 |
183 for (size_t i = 0; i < kAesBlockSize; ++i) { | 183 for (size_t i = 0; i < kAesBlockSize; ++i) { |
184 aes_nonce[i] ^= iv_mask[i]; | 184 aes_nonce[i] ^= iv_mask[i]; |
185 } | 185 } |
186 return aes_nonce; | 186 return aes_nonce; |
187 } | 187 } |
188 | 188 |
| 189 inline uint32 GetVideoRtpTimestamp(const base::TimeTicks& time_ticks) { |
| 190 base::TimeTicks zero_time; |
| 191 base::TimeDelta recorded_delta = time_ticks - zero_time; |
| 192 // Timestamp is in 90 KHz for video. |
| 193 return static_cast<uint32>(recorded_delta.InMilliseconds() * 90); |
| 194 } |
| 195 |
189 } // namespace cast | 196 } // namespace cast |
190 } // namespace media | 197 } // namespace media |
191 | 198 |
192 #endif // MEDIA_CAST_CAST_DEFINES_H_ | 199 #endif // MEDIA_CAST_CAST_DEFINES_H_ |
OLD | NEW |