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 <sstream> | 5 #include <sstream> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace mp2t { | 21 namespace mp2t { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 VideoDecoderConfig CreateFakeVideoConfig() { | 25 VideoDecoderConfig CreateFakeVideoConfig() { |
26 gfx::Size coded_size(320, 240); | 26 gfx::Size coded_size(320, 240); |
27 gfx::Rect visible_rect(0, 0, 320, 240); | 27 gfx::Rect visible_rect(0, 0, 320, 240); |
28 gfx::Size natural_size(320, 240); | 28 gfx::Size natural_size(320, 240); |
29 return VideoDecoderConfig(kCodecH264, H264PROFILE_MAIN, PIXEL_FORMAT_I420, | 29 return VideoDecoderConfig(kCodecH264, H264PROFILE_MAIN, PIXEL_FORMAT_I420, |
30 COLOR_SPACE_UNSPECIFIED, coded_size, visible_rect, | 30 COLOR_SPACE_UNSPECIFIED, coded_size, visible_rect, |
31 natural_size, EmptyExtraData(), false); | 31 natural_size, EmptyExtraData(), |
| 32 EncryptionScheme(false)); |
32 } | 33 } |
33 | 34 |
34 StreamParserBuffer::BufferQueue | 35 StreamParserBuffer::BufferQueue |
35 GenerateFakeBuffers(const int* frame_pts_ms, | 36 GenerateFakeBuffers(const int* frame_pts_ms, |
36 const bool* is_key_frame, | 37 const bool* is_key_frame, |
37 size_t frame_count) { | 38 size_t frame_count) { |
38 uint8 dummy_buffer[] = {0, 0, 0, 0}; | 39 uint8 dummy_buffer[] = {0, 0, 0, 0}; |
39 | 40 |
40 StreamParserBuffer::BufferQueue buffers(frame_count); | 41 StreamParserBuffer::BufferQueue buffers(frame_count); |
41 for (size_t k = 0; k < frame_count; k++) { | 42 for (size_t k = 0; k < frame_count; k++) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 bool is_key_frame[] = {false, false, false, true, false, false}; | 160 bool is_key_frame[] = {false, false, false, true, false, false}; |
160 StreamParserBuffer::BufferQueue buffer_queue = | 161 StreamParserBuffer::BufferQueue buffer_queue = |
161 GenerateFakeBuffers(pts_ms, is_key_frame, arraysize(pts_ms)); | 162 GenerateFakeBuffers(pts_ms, is_key_frame, arraysize(pts_ms)); |
162 | 163 |
163 EXPECT_EQ("(70,Y) (30,Y) (30,N) (30,N)", | 164 EXPECT_EQ("(70,Y) (30,Y) (30,N) (30,N)", |
164 RunAdapterTest(buffer_queue)); | 165 RunAdapterTest(buffer_queue)); |
165 } | 166 } |
166 | 167 |
167 } // namespace mp2t | 168 } // namespace mp2t |
168 } // namespace media | 169 } // namespace media |
OLD | NEW |