OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 * | 9 * |
10 */ | 10 */ |
11 | 11 |
12 #include "webrtc/common_video/h264/sps_vui_rewriter.h" | 12 #include "webrtc/common_video/h264/sps_vui_rewriter.h" |
13 | 13 |
14 #include <algorithm> | 14 #include <algorithm> |
15 #include <memory> | 15 #include <memory> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/base/bitbuffer.h" | 18 #include "webrtc/rtc_base/bitbuffer.h" |
19 #include "webrtc/base/checks.h" | 19 #include "webrtc/rtc_base/checks.h" |
20 #include "webrtc/base/logging.h" | 20 #include "webrtc/rtc_base/logging.h" |
21 #include "webrtc/base/safe_minmax.h" | 21 #include "webrtc/rtc_base/safe_minmax.h" |
22 | 22 |
23 #include "webrtc/common_video/h264/h264_common.h" | 23 #include "webrtc/common_video/h264/h264_common.h" |
24 #include "webrtc/common_video/h264/sps_parser.h" | 24 #include "webrtc/common_video/h264/sps_parser.h" |
25 | 25 |
26 namespace webrtc { | 26 namespace webrtc { |
27 | 27 |
28 // The maximum expected growth from adding a VUI to the SPS. It's actually | 28 // The maximum expected growth from adding a VUI to the SPS. It's actually |
29 // closer to 24 or so, but better safe than sorry. | 29 // closer to 24 or so, but better safe than sorry. |
30 const size_t kMaxVuiSpsIncrease = 64; | 30 const size_t kMaxVuiSpsIncrease = 64; |
31 | 31 |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 while (source->RemainingBitCount() > 0) { | 354 while (source->RemainingBitCount() > 0) { |
355 auto count = rtc::SafeMin<size_t>(32u, source->RemainingBitCount()); | 355 auto count = rtc::SafeMin<size_t>(32u, source->RemainingBitCount()); |
356 COPY_BITS(source, destination, bits_tmp, count); | 356 COPY_BITS(source, destination, bits_tmp, count); |
357 } | 357 } |
358 // TODO(noahric): The last byte could be all zeroes now, which we should just | 358 // TODO(noahric): The last byte could be all zeroes now, which we should just |
359 // strip. | 359 // strip. |
360 return true; | 360 return true; |
361 } | 361 } |
362 | 362 |
363 } // namespace webrtc | 363 } // namespace webrtc |
OLD | NEW |