| 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 #include "webrtc/common_video/h264/pps_parser.h" | 11 #include "webrtc/common_video/h264/pps_parser.h" |
| 12 | 12 |
| 13 #include <limits> | 13 #include <limits> |
| 14 #include <memory> | 14 #include <memory> |
| 15 | 15 |
| 16 #include "webrtc/test/gtest.h" | |
| 17 | |
| 18 #include "webrtc/base/bitbuffer.h" | 16 #include "webrtc/base/bitbuffer.h" |
| 19 #include "webrtc/base/buffer.h" | 17 #include "webrtc/base/buffer.h" |
| 20 #include "webrtc/common_video/h264/h264_common.h" | 18 #include "webrtc/common_video/h264/h264_common.h" |
| 19 #include "webrtc/test/gtest.h" |
| 21 | 20 |
| 22 namespace webrtc { | 21 namespace webrtc { |
| 23 | 22 |
| 24 namespace { | 23 namespace { |
| 25 // Contains enough of the image slice to contain slice QP. | 24 // Contains enough of the image slice to contain slice QP. |
| 26 const uint8_t kH264BitstreamChunk[] = { | 25 const uint8_t kH264BitstreamChunk[] = { |
| 27 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x20, 0xda, 0x01, 0x40, 0x16, | 26 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x20, 0xda, 0x01, 0x40, 0x16, |
| 28 0xe8, 0x06, 0xd0, 0xa1, 0x35, 0x00, 0x00, 0x00, 0x01, 0x68, 0xce, 0x06, | 27 0xe8, 0x06, 0xd0, 0xa1, 0x35, 0x00, 0x00, 0x00, 0x01, 0x68, 0xce, 0x06, |
| 29 0xe2, 0x00, 0x00, 0x00, 0x01, 0x65, 0xb8, 0x40, 0xf0, 0x8c, 0x03, 0xf2, | 28 0xe2, 0x00, 0x00, 0x00, 0x01, 0x65, 0xb8, 0x40, 0xf0, 0x8c, 0x03, 0xf2, |
| 30 0x75, 0x67, 0xad, 0x41, 0x64, 0x24, 0x0e, 0xa0, 0xb2, 0x12, 0x1e, 0xf8, | 29 0x75, 0x67, 0xad, 0x41, 0x64, 0x24, 0x0e, 0xa0, 0xb2, 0x12, 0x1e, 0xf8, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 } | 212 } |
| 214 | 213 |
| 215 TEST_F(PpsParserTest, PpsIdFromSlice) { | 214 TEST_F(PpsParserTest, PpsIdFromSlice) { |
| 216 rtc::Optional<uint32_t> pps_id = PpsParser::ParsePpsIdFromSlice( | 215 rtc::Optional<uint32_t> pps_id = PpsParser::ParsePpsIdFromSlice( |
| 217 kH264BitstreamChunk, sizeof(kH264BitstreamChunk)); | 216 kH264BitstreamChunk, sizeof(kH264BitstreamChunk)); |
| 218 ASSERT_TRUE(pps_id); | 217 ASSERT_TRUE(pps_id); |
| 219 EXPECT_EQ(2u, *pps_id); | 218 EXPECT_EQ(2u, *pps_id); |
| 220 } | 219 } |
| 221 | 220 |
| 222 } // namespace webrtc | 221 } // namespace webrtc |
| OLD | NEW |