OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/numerics/safe_math.h" | 10 #include "base/numerics/safe_math.h" |
11 #include "media/gpu/ipc/common/media_messages.h" | 11 #include "media/gpu/ipc/common/media_messages.h" |
12 | 12 |
13 namespace IPC { | 13 namespace IPC { |
14 | 14 |
| 15 void ParamTraits<media::BitstreamBuffer>::GetSize(base::PickleSizer* s, |
| 16 const param_type& p) { |
| 17 GetParamSize(s, p.id()); |
| 18 GetParamSize(s, static_cast<uint64_t>(p.size())); |
| 19 GetParamSize(s, static_cast<uint64_t>(p.offset())); |
| 20 GetParamSize(s, p.presentation_timestamp()); |
| 21 GetParamSize(s, p.key_id()); |
| 22 if (!p.key_id().empty()) { |
| 23 GetParamSize(s, p.iv()); |
| 24 GetParamSize(s, p.subsamples()); |
| 25 } |
| 26 GetParamSize(s, p.handle()); |
| 27 } |
| 28 |
15 void ParamTraits<media::BitstreamBuffer>::Write(base::Pickle* m, | 29 void ParamTraits<media::BitstreamBuffer>::Write(base::Pickle* m, |
16 const param_type& p) { | 30 const param_type& p) { |
17 WriteParam(m, p.id()); | 31 WriteParam(m, p.id()); |
18 WriteParam(m, static_cast<uint64_t>(p.size())); | 32 WriteParam(m, static_cast<uint64_t>(p.size())); |
19 DCHECK_GE(p.offset(), 0); | 33 DCHECK_GE(p.offset(), 0); |
20 WriteParam(m, static_cast<uint64_t>(p.offset())); | 34 WriteParam(m, static_cast<uint64_t>(p.offset())); |
21 WriteParam(m, p.presentation_timestamp()); | 35 WriteParam(m, p.presentation_timestamp()); |
22 WriteParam(m, p.key_id()); | 36 WriteParam(m, p.key_id()); |
23 if (!p.key_id().empty()) { | 37 if (!p.key_id().empty()) { |
24 WriteParam(m, p.iv()); | 38 WriteParam(m, p.iv()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 77 |
64 void ParamTraits<media::BitstreamBuffer>::Log(const param_type& p, | 78 void ParamTraits<media::BitstreamBuffer>::Log(const param_type& p, |
65 std::string* l) { | 79 std::string* l) { |
66 std::ostringstream oss; | 80 std::ostringstream oss; |
67 oss << "id=" << p.id() << ", size=" << p.size() << ", presentation_timestamp=" | 81 oss << "id=" << p.id() << ", size=" << p.size() << ", presentation_timestamp=" |
68 << p.presentation_timestamp().ToInternalValue(); | 82 << p.presentation_timestamp().ToInternalValue(); |
69 l->append(oss.str()); | 83 l->append(oss.str()); |
70 } | 84 } |
71 | 85 |
72 } // namespace IPC | 86 } // namespace IPC |
OLD | NEW |