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

Unified Diff: media/filters/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
« no previous file with comments | « media/filters/h264_to_annex_b_bitstream_converter.cc ('k') | media/media.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/h264_to_annex_b_bitstream_converter_unittest.cc
diff --git a/media/base/h264_bitstream_converter_unittest.cc b/media/filters/h264_to_annex_b_bitstream_converter_unittest.cc
similarity index 94%
rename from media/base/h264_bitstream_converter_unittest.cc
rename to media/filters/h264_to_annex_b_bitstream_converter_unittest.cc
index e9ceaf41ce24abf2deb69c473fe7984e78e78411..2fc218d8ecebecfd00a5803eea01a9f095122361 100644
--- a/media/base/h264_bitstream_converter_unittest.cc
+++ b/media/filters/h264_to_annex_b_bitstream_converter_unittest.cc
@@ -1,21 +1,21 @@
-// 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 "base/memory/scoped_ptr.h"
-#include "media/base/h264_bitstream_converter.h"
+#include "media/filters/h264_to_annex_b_bitstream_converter.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
-class H264BitstreamConverterTest : public testing::Test {
+class H264ToAnnexBBitstreamConverterTest : public testing::Test {
protected:
- H264BitstreamConverterTest() {}
+ H264ToAnnexBBitstreamConverterTest() {}
- virtual ~H264BitstreamConverterTest() {}
+ virtual ~H264ToAnnexBBitstreamConverterTest() {}
private:
- DISALLOW_COPY_AND_ASSIGN(H264BitstreamConverterTest);
+ DISALLOW_COPY_AND_ASSIGN(H264ToAnnexBBitstreamConverterTest);
};
static const uint8 kHeaderDataOkWithFieldLen4[] = {
@@ -263,10 +263,10 @@ static const uint8 kPacketDataOkWithFieldLen4[] = {
0xEB, 0xE0
};
-TEST_F(H264BitstreamConverterTest, Conversion_Success) {
+TEST_F(H264ToAnnexBBitstreamConverterTest, Success) {
// Initialize converter.
scoped_array<uint8> output;
- H264BitstreamConverter converter;
+ H264ToAnnexBBitstreamConverter converter;
// Parse the headers.
uint32 config_size = converter.ParseConfigurationAndCalculateSize(
@@ -277,7 +277,7 @@ TEST_F(H264BitstreamConverterTest, Conversion_Success) {
// Go on with converting the headers.
output.reset(new uint8[config_size]);
EXPECT_TRUE(output.get() != NULL);
- EXPECT_TRUE(converter.ConvertAVCDecoderConfigurationRecordToByteStream(
+ EXPECT_TRUE(converter.ConvertAVCDecoderConfigToByteStream(
kHeaderDataOkWithFieldLen4,
sizeof(kHeaderDataOkWithFieldLen4),
output.get(),
@@ -303,20 +303,19 @@ TEST_F(H264BitstreamConverterTest, Conversion_Success) {
// Classes allocated in stack are automatically destroyed.
}
-TEST_F(H264BitstreamConverterTest, Conversion_FailureNullData) {
+TEST_F(H264ToAnnexBBitstreamConverterTest, FailureNullData) {
// Initialize converter.
- H264BitstreamConverter converter;
+ H264ToAnnexBBitstreamConverter converter;
// Simulate situation where there is no header data.
uint32 config_size = converter.ParseConfigurationAndCalculateSize(NULL, 0);
EXPECT_EQ(config_size, 0U);
// Go on with converting the headers with NULL parameters.
- EXPECT_FALSE(converter.ConvertAVCDecoderConfigurationRecordToByteStream(
- NULL,
- 0,
- NULL,
- &config_size));
+ EXPECT_FALSE(converter.ConvertAVCDecoderConfigToByteStream(NULL,
+ 0,
+ NULL,
+ &config_size));
// Simulate NULL parameters for buffer calculation.
uint32 output_size = converter.CalculateNeededOutputBufferSize(NULL, 0);
@@ -331,9 +330,9 @@ TEST_F(H264BitstreamConverterTest, Conversion_FailureNullData) {
// Classes allocated in stack are automatically destroyed.
}
-TEST_F(H264BitstreamConverterTest, Conversion_FailureHeaderBufferOverflow) {
+TEST_F(H264ToAnnexBBitstreamConverterTest, FailureHeaderBufferOverflow) {
// Initialize converter
- H264BitstreamConverter converter;
+ H264ToAnnexBBitstreamConverter converter;
// Simulate 10 sps AVCDecoderConfigurationRecord,
// which would extend beyond the buffer.
@@ -352,10 +351,10 @@ TEST_F(H264BitstreamConverterTest, Conversion_FailureHeaderBufferOverflow) {
// Classes allocated in stack are automatically destroyed.
}
-TEST_F(H264BitstreamConverterTest, Conversion_FailureNalUnitBreakage) {
+TEST_F(H264ToAnnexBBitstreamConverterTest, FailureNalUnitBreakage) {
// Initialize converter.
scoped_array<uint8> output;
- H264BitstreamConverter converter;
+ H264ToAnnexBBitstreamConverter converter;
// Parse the headers.
uint32 config_size = converter.ParseConfigurationAndCalculateSize(
@@ -366,7 +365,7 @@ TEST_F(H264BitstreamConverterTest, Conversion_FailureNalUnitBreakage) {
// Go on with converting the headers.
output.reset(new uint8[config_size]);
EXPECT_TRUE(output.get() != NULL);
- EXPECT_TRUE(converter.ConvertAVCDecoderConfigurationRecordToByteStream(
+ EXPECT_TRUE(converter.ConvertAVCDecoderConfigToByteStream(
kHeaderDataOkWithFieldLen4,
sizeof(kHeaderDataOkWithFieldLen4),
output.get(),
@@ -401,10 +400,10 @@ TEST_F(H264BitstreamConverterTest, Conversion_FailureNalUnitBreakage) {
// Classes allocated in stack are automatically destroyed.
}
-TEST_F(H264BitstreamConverterTest, Conversion_FailureTooSmallOutputBuffer) {
+TEST_F(H264ToAnnexBBitstreamConverterTest, FailureTooSmallOutputBuffer) {
// Initialize converter.
scoped_array<uint8> output;
- H264BitstreamConverter converter;
+ H264ToAnnexBBitstreamConverter converter;
// Parse the headers.
uint32 config_size = converter.ParseConfigurationAndCalculateSize(
@@ -417,7 +416,7 @@ TEST_F(H264BitstreamConverterTest, Conversion_FailureTooSmallOutputBuffer) {
config_size -= 10;
output.reset(new uint8[config_size]);
EXPECT_TRUE(output.get() != NULL);
- EXPECT_FALSE(converter.ConvertAVCDecoderConfigurationRecordToByteStream(
+ EXPECT_FALSE(converter.ConvertAVCDecoderConfigToByteStream(
kHeaderDataOkWithFieldLen4,
sizeof(kHeaderDataOkWithFieldLen4),
output.get(),
@@ -428,7 +427,7 @@ TEST_F(H264BitstreamConverterTest, Conversion_FailureTooSmallOutputBuffer) {
config_size = real_config_size - 1;
output.reset(new uint8[config_size]);
EXPECT_TRUE(output.get() != NULL);
- EXPECT_FALSE(converter.ConvertAVCDecoderConfigurationRecordToByteStream(
+ EXPECT_FALSE(converter.ConvertAVCDecoderConfigToByteStream(
kHeaderDataOkWithFieldLen4,
sizeof(kHeaderDataOkWithFieldLen4),
output.get(),
@@ -439,7 +438,7 @@ TEST_F(H264BitstreamConverterTest, Conversion_FailureTooSmallOutputBuffer) {
config_size = real_config_size;
output.reset(new uint8[config_size]);
EXPECT_TRUE(output.get() != NULL);
- EXPECT_TRUE(converter.ConvertAVCDecoderConfigurationRecordToByteStream(
+ EXPECT_TRUE(converter.ConvertAVCDecoderConfigToByteStream(
kHeaderDataOkWithFieldLen4,
sizeof(kHeaderDataOkWithFieldLen4),
output.get(),
« no previous file with comments | « media/filters/h264_to_annex_b_bitstream_converter.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698