| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 run_loop_->Quit(); | 125 run_loop_->Quit(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 static VideoDecoderConfig GetTestConfig(VideoCodec codec, | 128 static VideoDecoderConfig GetTestConfig(VideoCodec codec, |
| 129 gfx::Size coded_size, | 129 gfx::Size coded_size, |
| 130 bool is_encrypted) { | 130 bool is_encrypted) { |
| 131 gfx::Rect visible_rect(coded_size.width(), coded_size.height()); | 131 gfx::Rect visible_rect(coded_size.width(), coded_size.height()); |
| 132 gfx::Size natural_size = coded_size; | 132 gfx::Size natural_size = coded_size; |
| 133 | 133 |
| 134 return VideoDecoderConfig( | 134 return VideoDecoderConfig( |
| 135 codec, VIDEO_CODEC_PROFILE_UNKNOWN, PIXEL_FORMAT_YV12, | 135 codec, VIDEO_CODEC_PROFILE_UNKNOWN, PIXEL_FORMAT_YV12, COLOR_SPACE_JPEG, |
| 136 COLOR_SPACE_UNSPECIFIED, coded_size, visible_rect, natural_size, | 136 coded_size, visible_rect, natural_size, EmptyExtraData(), |
| 137 EmptyExtraData(), | |
| 138 is_encrypted ? AesCtrEncryptionScheme() : Unencrypted()); | 137 is_encrypted ? AesCtrEncryptionScheme() : Unencrypted()); |
| 139 } | 138 } |
| 140 | 139 |
| 141 static const gfx::Size kNormalSize(320, 240); | 140 static const gfx::Size kNormalSize(320, 240); |
| 142 static const gfx::Size kLargeSize(640, 480); | 141 static const gfx::Size kLargeSize(640, 480); |
| 143 | 142 |
| 144 // static | 143 // static |
| 145 VideoDecoderConfig TestVideoConfig::Invalid() { | 144 VideoDecoderConfig TestVideoConfig::Invalid() { |
| 146 return GetTestConfig(kUnknownVideoCodec, kNormalSize, false); | 145 return GetTestConfig(kUnknownVideoCodec, kNormalSize, false); |
| 147 } | 146 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 int width = 0; | 276 int width = 0; |
| 278 int height = 0; | 277 int height = 0; |
| 279 bool success = pickle.ReadString(&header) && pickle.ReadInt(&width) && | 278 bool success = pickle.ReadString(&header) && pickle.ReadInt(&width) && |
| 280 pickle.ReadInt(&height); | 279 pickle.ReadInt(&height); |
| 281 return (success && header == kFakeVideoBufferHeader && | 280 return (success && header == kFakeVideoBufferHeader && |
| 282 width == config.coded_size().width() && | 281 width == config.coded_size().width() && |
| 283 height == config.coded_size().height()); | 282 height == config.coded_size().height()); |
| 284 } | 283 } |
| 285 | 284 |
| 286 } // namespace media | 285 } // namespace media |
| OLD | NEW |