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

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

Issue 231283005: Add live mode detection in WebM MediaSource parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 108
109 static VideoDecoderConfig GetTestConfig(VideoCodec codec, 109 static VideoDecoderConfig GetTestConfig(VideoCodec codec,
110 gfx::Size coded_size, 110 gfx::Size coded_size,
111 bool is_encrypted) { 111 bool is_encrypted) {
112 gfx::Rect visible_rect(coded_size.width(), coded_size.height()); 112 gfx::Rect visible_rect(coded_size.width(), coded_size.height());
113 gfx::Size natural_size = coded_size; 113 gfx::Size natural_size = coded_size;
114 114
115 return VideoDecoderConfig(codec, VIDEO_CODEC_PROFILE_UNKNOWN, 115 return VideoDecoderConfig(codec, VIDEO_CODEC_PROFILE_UNKNOWN,
116 VideoFrame::YV12, coded_size, visible_rect, natural_size, 116 VideoFrame::YV12, coded_size, visible_rect, natural_size,
117 NULL, 0, is_encrypted); 117 NULL, 0, is_encrypted, false);
118 } 118 }
119 119
120 static const gfx::Size kNormalSize(320, 240); 120 static const gfx::Size kNormalSize(320, 240);
121 static const gfx::Size kLargeSize(640, 480); 121 static const gfx::Size kLargeSize(640, 480);
122 122
123 VideoDecoderConfig TestVideoConfig::Invalid() { 123 VideoDecoderConfig TestVideoConfig::Invalid() {
124 return GetTestConfig(kUnknownVideoCodec, kNormalSize, false); 124 return GetTestConfig(kUnknownVideoCodec, kNormalSize, false);
125 } 125 }
126 126
127 VideoDecoderConfig TestVideoConfig::Normal() { 127 VideoDecoderConfig TestVideoConfig::Normal() {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 int width = 0; 241 int width = 0;
242 int height = 0; 242 int height = 0;
243 bool success = pickle.ReadString(&header) && pickle.ReadInt(&width) && 243 bool success = pickle.ReadString(&header) && pickle.ReadInt(&width) &&
244 pickle.ReadInt(&height); 244 pickle.ReadInt(&height);
245 return (success && header == kFakeVideoBufferHeader && 245 return (success && header == kFakeVideoBufferHeader &&
246 width == config.coded_size().width() && 246 width == config.coded_size().width() &&
247 height == config.coded_size().height()); 247 height == config.coded_size().height());
248 } 248 }
249 249
250 } // namespace media 250 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698