OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/base/test_helpers.h" | 5 #include "media/base/test_helpers.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 ADD_FAILURE() << "Timed out waiting for message loop to quit"; | 122 ADD_FAILURE() << "Timed out waiting for message loop to quit"; |
123 run_loop_->Quit(); | 123 run_loop_->Quit(); |
124 } | 124 } |
125 | 125 |
126 static VideoDecoderConfig GetTestConfig(VideoCodec codec, | 126 static VideoDecoderConfig GetTestConfig(VideoCodec codec, |
127 gfx::Size coded_size, | 127 gfx::Size coded_size, |
128 bool is_encrypted) { | 128 bool is_encrypted) { |
129 gfx::Rect visible_rect(coded_size.width(), coded_size.height()); | 129 gfx::Rect visible_rect(coded_size.width(), coded_size.height()); |
130 gfx::Size natural_size = coded_size; | 130 gfx::Size natural_size = coded_size; |
131 | 131 |
132 return VideoDecoderConfig( | 132 return VideoDecoderConfig(codec, VIDEO_CODEC_PROFILE_UNKNOWN, |
133 codec, VIDEO_CODEC_PROFILE_UNKNOWN, PIXEL_FORMAT_YV12, | 133 PIXEL_FORMAT_YV12, COLOR_SPACE_UNSPECIFIED, |
134 COLOR_SPACE_UNSPECIFIED, coded_size, visible_rect, natural_size, | 134 coded_size, visible_rect, natural_size, |
135 EmptyExtraData(), | 135 EmptyExtraData(), is_encrypted); |
136 is_encrypted ? AesCtrEncryptionScheme() : Unencrypted()); | |
137 } | 136 } |
138 | 137 |
139 static const gfx::Size kNormalSize(320, 240); | 138 static const gfx::Size kNormalSize(320, 240); |
140 static const gfx::Size kLargeSize(640, 480); | 139 static const gfx::Size kLargeSize(640, 480); |
141 | 140 |
142 VideoDecoderConfig TestVideoConfig::Invalid() { | 141 VideoDecoderConfig TestVideoConfig::Invalid() { |
143 return GetTestConfig(kUnknownVideoCodec, kNormalSize, false); | 142 return GetTestConfig(kUnknownVideoCodec, kNormalSize, false); |
144 } | 143 } |
145 | 144 |
146 VideoDecoderConfig TestVideoConfig::Normal() { | 145 VideoDecoderConfig TestVideoConfig::Normal() { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 int width = 0; | 256 int width = 0; |
258 int height = 0; | 257 int height = 0; |
259 bool success = pickle.ReadString(&header) && pickle.ReadInt(&width) && | 258 bool success = pickle.ReadString(&header) && pickle.ReadInt(&width) && |
260 pickle.ReadInt(&height); | 259 pickle.ReadInt(&height); |
261 return (success && header == kFakeVideoBufferHeader && | 260 return (success && header == kFakeVideoBufferHeader && |
262 width == config.coded_size().width() && | 261 width == config.coded_size().width() && |
263 height == config.coded_size().height()); | 262 height == config.coded_size().height()); |
264 } | 263 } |
265 | 264 |
266 } // namespace media | 265 } // namespace media |
OLD | NEW |