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

Side by Side Diff: media/base/test_helpers.cc

Issue 1786733004: Revert of media config: expand is_encrypted to a struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/base/media_util.cc ('k') | media/base/video_decoder_config.h » ('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 (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
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
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
OLDNEW
« no previous file with comments | « media/base/media_util.cc ('k') | media/base/video_decoder_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698