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

Side by Side Diff: media/video/ffmpeg_video_decode_engine_unittest.cc

Issue 7867051: Introduce AudioDecoderConfig to migrate away from GetAVStream(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: samples_per_second Created 9 years, 3 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
« no previous file with comments | « media/media.gyp ('k') | webkit/glue/webmediaplayer_impl.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "media/base/data_buffer.h" 7 #include "media/base/data_buffer.h"
8 #include "media/base/mock_task.h" 8 #include "media/base/mock_task.h"
9 #include "media/base/pipeline.h" 9 #include "media/base/pipeline.h"
10 #include "media/base/test_data_util.h" 10 #include "media/base/test_data_util.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 private: 143 private:
144 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecodeEngineTest); 144 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecodeEngineTest);
145 }; 145 };
146 146
147 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_Normal) { 147 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_Normal) {
148 Initialize(); 148 Initialize();
149 } 149 }
150 150
151 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_FindDecoderFails) { 151 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_FindDecoderFails) {
152 VideoDecoderConfig config(kUnknown, kCodedSize, kVisibleRect, kNaturalSize, 152 VideoDecoderConfig config(kUnknownVideoCodec, kCodedSize, kVisibleRect,
153 kFrameRate.num, kFrameRate.den, NULL, 0); 153 kNaturalSize, kFrameRate.num, kFrameRate.den,
154 NULL, 0);
155
154 // Test avcodec_find_decoder() returning NULL. 156 // Test avcodec_find_decoder() returning NULL.
155 VideoCodecInfo info; 157 VideoCodecInfo info;
156 EXPECT_CALL(*this, OnInitializeComplete(_)) 158 EXPECT_CALL(*this, OnInitializeComplete(_))
157 .WillOnce(SaveArg<0>(&info)); 159 .WillOnce(SaveArg<0>(&info));
158 test_engine_->Initialize(MessageLoop::current(), this, NULL, config); 160 test_engine_->Initialize(MessageLoop::current(), this, NULL, config);
159 EXPECT_FALSE(info.success); 161 EXPECT_FALSE(info.success);
160 } 162 }
161 163
162 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_OpenDecoderFails) { 164 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_OpenDecoderFails) {
163 // Specify Theora w/o extra data so that avcodec_open() fails. 165 // Specify Theora w/o extra data so that avcodec_open() fails.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 // DecodeIFrameThenTestFile("vp8-I-frame-320x480"); 276 // DecodeIFrameThenTestFile("vp8-I-frame-320x480");
275 //} 277 //}
276 278
277 // Decode |i_frame_buffer_| and then a frame with a smaller height and verify 279 // Decode |i_frame_buffer_| and then a frame with a smaller height and verify
278 // the output size didn't change. 280 // the output size didn't change.
279 TEST_F(FFmpegVideoDecodeEngineTest, DecodeFrame_SmallerHeight) { 281 TEST_F(FFmpegVideoDecodeEngineTest, DecodeFrame_SmallerHeight) {
280 DecodeIFrameThenTestFile("vp8-I-frame-320x120"); 282 DecodeIFrameThenTestFile("vp8-I-frame-320x120");
281 } 283 }
282 284
283 } // namespace media 285 } // namespace media
OLDNEW
« no previous file with comments | « media/media.gyp ('k') | webkit/glue/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698