Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Side by Side Diff: media/formats/mp2t/es_adapter_video_unittest.cc

Issue 1221903003: Change the video color space default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/filters/vpx_video_decoder.cc ('k') | media/formats/mp2t/es_parser_h264.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "media/base/stream_parser_buffer.h" 13 #include "media/base/stream_parser_buffer.h"
14 #include "media/base/video_decoder_config.h" 14 #include "media/base/video_decoder_config.h"
15 #include "media/formats/mp2t/es_adapter_video.h" 15 #include "media/formats/mp2t/es_adapter_video.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 namespace media { 18 namespace media {
19 namespace mp2t { 19 namespace mp2t {
20 20
21 namespace { 21 namespace {
22 22
23 VideoDecoderConfig CreateFakeVideoConfig() { 23 VideoDecoderConfig CreateFakeVideoConfig() {
24 gfx::Size coded_size(320, 240); 24 gfx::Size coded_size(320, 240);
25 gfx::Rect visible_rect(0, 0, 320, 240); 25 gfx::Rect visible_rect(0, 0, 320, 240);
26 gfx::Size natural_size(320, 240); 26 gfx::Size natural_size(320, 240);
27 return VideoDecoderConfig( 27 return VideoDecoderConfig(kCodecH264, H264PROFILE_MAIN, VideoFrame::I420,
28 kCodecH264, 28 VideoFrame::COLOR_SPACE_UNSPECIFIED, coded_size,
29 H264PROFILE_MAIN, 29 visible_rect, natural_size, NULL, 0, false);
30 VideoFrame::I420,
31 coded_size,
32 visible_rect,
33 natural_size,
34 NULL, 0, false);
35 } 30 }
36 31
37 StreamParserBuffer::BufferQueue 32 StreamParserBuffer::BufferQueue
38 GenerateFakeBuffers(const int* frame_pts_ms, 33 GenerateFakeBuffers(const int* frame_pts_ms,
39 const bool* is_key_frame, 34 const bool* is_key_frame,
40 size_t frame_count) { 35 size_t frame_count) {
41 uint8 dummy_buffer[] = {0, 0, 0, 0}; 36 uint8 dummy_buffer[] = {0, 0, 0, 0};
42 37
43 StreamParserBuffer::BufferQueue buffers(frame_count); 38 StreamParserBuffer::BufferQueue buffers(frame_count);
44 for (size_t k = 0; k < frame_count; k++) { 39 for (size_t k = 0; k < frame_count; k++) {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 bool is_key_frame[] = {false, false, false, true, false, false}; 157 bool is_key_frame[] = {false, false, false, true, false, false};
163 StreamParserBuffer::BufferQueue buffer_queue = 158 StreamParserBuffer::BufferQueue buffer_queue =
164 GenerateFakeBuffers(pts_ms, is_key_frame, arraysize(pts_ms)); 159 GenerateFakeBuffers(pts_ms, is_key_frame, arraysize(pts_ms));
165 160
166 EXPECT_EQ("(70,Y) (30,Y) (30,N) (30,N)", 161 EXPECT_EQ("(70,Y) (30,Y) (30,N) (30,N)",
167 RunAdapterTest(buffer_queue)); 162 RunAdapterTest(buffer_queue));
168 } 163 }
169 164
170 } // namespace mp2t 165 } // namespace mp2t
171 } // namespace media 166 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/vpx_video_decoder.cc ('k') | media/formats/mp2t/es_parser_h264.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698