OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 <memory> | 12 #include <memory> |
13 | 13 |
14 #include "webrtc/base/arraysize.h" | 14 #include "webrtc/rtc_base/arraysize.h" |
15 #include "webrtc/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.h" | 15 #include "webrtc/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.h" |
16 #include "webrtc/test/gtest.h" | 16 #include "webrtc/test/gtest.h" |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 | 19 |
20 static const uint8_t NALU_TEST_DATA_0[] = {0xAA, 0xBB, 0xCC}; | 20 static const uint8_t NALU_TEST_DATA_0[] = {0xAA, 0xBB, 0xCC}; |
21 static const uint8_t NALU_TEST_DATA_1[] = {0xDE, 0xAD, 0xBE, 0xEF}; | 21 static const uint8_t NALU_TEST_DATA_1[] = {0xDE, 0xAD, 0xBE, 0xEF}; |
22 | 22 |
23 TEST(H264VideoToolboxNaluTest, TestHasVideoFormatDescription) { | 23 TEST(H264VideoToolboxNaluTest, TestHasVideoFormatDescription) { |
24 const uint8_t sps_buffer[] = {0x00, 0x00, 0x00, 0x01, 0x27}; | 24 const uint8_t sps_buffer[] = {0x00, 0x00, 0x00, 0x01, 0x27}; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 memset(buffer.get(), 0, buffer_size); | 195 memset(buffer.get(), 0, buffer_size); |
196 AvccBufferWriter writer(buffer.get(), buffer_size); | 196 AvccBufferWriter writer(buffer.get(), buffer_size); |
197 EXPECT_EQ(buffer_size, writer.BytesRemaining()); | 197 EXPECT_EQ(buffer_size, writer.BytesRemaining()); |
198 EXPECT_FALSE(writer.WriteNalu(NALU_TEST_DATA_0, arraysize(NALU_TEST_DATA_0))); | 198 EXPECT_FALSE(writer.WriteNalu(NALU_TEST_DATA_0, arraysize(NALU_TEST_DATA_0))); |
199 EXPECT_EQ(buffer_size, writer.BytesRemaining()); | 199 EXPECT_EQ(buffer_size, writer.BytesRemaining()); |
200 EXPECT_EQ(0, | 200 EXPECT_EQ(0, |
201 memcmp(expected_buffer, buffer.get(), arraysize(expected_buffer))); | 201 memcmp(expected_buffer, buffer.get(), arraysize(expected_buffer))); |
202 } | 202 } |
203 | 203 |
204 } // namespace webrtc | 204 } // namespace webrtc |
OLD | NEW |