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

Unified Diff: media/filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc

Issue 10690140: Reorganize bitstream converter classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: media/filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc
diff --git a/media/filters/ffmpeg_h264_bitstream_converter_unittest.cc b/media/filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc
similarity index 95%
rename from media/filters/ffmpeg_h264_bitstream_converter_unittest.cc
rename to media/filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc
index e3d3766ea7db65967749aaa4c99763ced0f13caa..5831883153258658bbaeb87deef3d0129eeece2a 100644
--- a/media/filters/ffmpeg_h264_bitstream_converter_unittest.cc
+++ b/media/filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc
@@ -1,10 +1,9 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "media/base/media.h"
#include "media/ffmpeg/ffmpeg_common.h"
-#include "media/filters/ffmpeg_h264_bitstream_converter.h"
+#include "media/filters/ffmpeg_h264_to_annex_b_bitstream_converter.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
@@ -255,10 +254,10 @@ static const uint8 kPacketDataOkWithFieldLen4[] = {
0xEB, 0xE0
};
-// Class for testing the FFmpegH264BitstreamConverter.
-class FFmpegH264BitstreamConverterTest : public testing::Test {
+// Class for testing the FFmpegH264ToAnnexBBitstreamConverter.
+class FFmpegH264ToAnnexBBitstreamConverterTest : public testing::Test {
protected:
- FFmpegH264BitstreamConverterTest() {
+ FFmpegH264ToAnnexBBitstreamConverterTest() {
// Set up AVCConfigurationRecord correctly for tests.
// It's ok to do const cast here as data in kHeaderDataOkWithFieldLen4 is
// never written to.
@@ -267,7 +266,7 @@ class FFmpegH264BitstreamConverterTest : public testing::Test {
test_context_.extradata_size = sizeof(kHeaderDataOkWithFieldLen4);
}
- virtual ~FFmpegH264BitstreamConverterTest() {}
+ virtual ~FFmpegH264ToAnnexBBitstreamConverterTest() {}
void CreatePacket(AVPacket* packet, const uint8* data, uint32 data_size) {
// Create new packet sized of |data_size| from |data|.
@@ -279,14 +278,11 @@ class FFmpegH264BitstreamConverterTest : public testing::Test {
AVCodecContext test_context_;
private:
- DISALLOW_COPY_AND_ASSIGN(FFmpegH264BitstreamConverterTest);
+ DISALLOW_COPY_AND_ASSIGN(FFmpegH264ToAnnexBBitstreamConverterTest);
};
-TEST_F(FFmpegH264BitstreamConverterTest, Conversion_Success) {
- FFmpegH264BitstreamConverter converter(&test_context_);
-
- // Initialization should be always successful.
- EXPECT_TRUE(converter.Initialize());
+TEST_F(FFmpegH264ToAnnexBBitstreamConverterTest, Conversion_Success) {
+ FFmpegH264ToAnnexBBitstreamConverter converter(&test_context_);
AVPacket test_packet;
CreatePacket(&test_packet, kPacketDataOkWithFieldLen4,
@@ -302,11 +298,8 @@ TEST_F(FFmpegH264BitstreamConverterTest, Conversion_Success) {
// Converter will be automatically cleaned up.
}
-TEST_F(FFmpegH264BitstreamConverterTest, Conversion_SuccessBigPacket) {
- FFmpegH264BitstreamConverter converter(&test_context_);
-
- // Initialization should be always successful.
- EXPECT_TRUE(converter.Initialize());
+TEST_F(FFmpegH264ToAnnexBBitstreamConverterTest, Conversion_SuccessBigPacket) {
+ FFmpegH264ToAnnexBBitstreamConverter converter(&test_context_);
// Create new packet with 1000 excess bytes.
AVPacket test_packet;
@@ -325,15 +318,12 @@ TEST_F(FFmpegH264BitstreamConverterTest, Conversion_SuccessBigPacket) {
// Converter will be automatically cleaned up.
}
-TEST_F(FFmpegH264BitstreamConverterTest, Conversion_FailureNullParams) {
+TEST_F(FFmpegH264ToAnnexBBitstreamConverterTest, Conversion_FailureNullParams) {
// Set up AVCConfigurationRecord to represent NULL data.
AVCodecContext dummy_context;
dummy_context.extradata = NULL;
dummy_context.extradata_size = 0;
- FFmpegH264BitstreamConverter converter(&dummy_context);
-
- // Initialization should be always successful.
- EXPECT_TRUE(converter.Initialize());
+ FFmpegH264ToAnnexBBitstreamConverter converter(&dummy_context);
// Try out the actual conversion with NULL parameter.
EXPECT_FALSE(converter.ConvertPacket(NULL));
« no previous file with comments | « media/filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc ('k') | media/filters/h264_to_annex_b_bitstream_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698