OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <sstream> | 8 #include <sstream> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 14 matching lines...) Expand all Loading... |
25 namespace mp2t { | 25 namespace mp2t { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 VideoDecoderConfig CreateFakeVideoConfig() { | 29 VideoDecoderConfig CreateFakeVideoConfig() { |
30 gfx::Size coded_size(320, 240); | 30 gfx::Size coded_size(320, 240); |
31 gfx::Rect visible_rect(0, 0, 320, 240); | 31 gfx::Rect visible_rect(0, 0, 320, 240); |
32 gfx::Size natural_size(320, 240); | 32 gfx::Size natural_size(320, 240); |
33 return VideoDecoderConfig(kCodecH264, H264PROFILE_MAIN, PIXEL_FORMAT_I420, | 33 return VideoDecoderConfig(kCodecH264, H264PROFILE_MAIN, PIXEL_FORMAT_I420, |
34 COLOR_SPACE_UNSPECIFIED, coded_size, visible_rect, | 34 COLOR_SPACE_UNSPECIFIED, coded_size, visible_rect, |
35 natural_size, EmptyExtraData(), Unencrypted()); | 35 natural_size, EmptyExtraData(), false); |
36 } | 36 } |
37 | 37 |
38 StreamParserBuffer::BufferQueue | 38 StreamParserBuffer::BufferQueue |
39 GenerateFakeBuffers(const int* frame_pts_ms, | 39 GenerateFakeBuffers(const int* frame_pts_ms, |
40 const bool* is_key_frame, | 40 const bool* is_key_frame, |
41 size_t frame_count) { | 41 size_t frame_count) { |
42 uint8_t dummy_buffer[] = {0, 0, 0, 0}; | 42 uint8_t dummy_buffer[] = {0, 0, 0, 0}; |
43 | 43 |
44 StreamParserBuffer::BufferQueue buffers(frame_count); | 44 StreamParserBuffer::BufferQueue buffers(frame_count); |
45 for (size_t k = 0; k < frame_count; k++) { | 45 for (size_t k = 0; k < frame_count; k++) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 bool is_key_frame[] = {false, false, false, true, false, false}; | 163 bool is_key_frame[] = {false, false, false, true, false, false}; |
164 StreamParserBuffer::BufferQueue buffer_queue = | 164 StreamParserBuffer::BufferQueue buffer_queue = |
165 GenerateFakeBuffers(pts_ms, is_key_frame, arraysize(pts_ms)); | 165 GenerateFakeBuffers(pts_ms, is_key_frame, arraysize(pts_ms)); |
166 | 166 |
167 EXPECT_EQ("(70,Y) (30,Y) (30,N) (30,N)", | 167 EXPECT_EQ("(70,Y) (30,Y) (30,N) (30,N)", |
168 RunAdapterTest(buffer_queue)); | 168 RunAdapterTest(buffer_queue)); |
169 } | 169 } |
170 | 170 |
171 } // namespace mp2t | 171 } // namespace mp2t |
172 } // namespace media | 172 } // namespace media |
OLD | NEW |