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

Unified Diff: media/base/decoder_buffer_unittest.cc

Issue 10949029: Replace av_malloc with AlignedAlloc for memory allocation in DecoderBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve Dale's comments. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/decoder_buffer.cc ('k') | media/ffmpeg/ffmpeg_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decoder_buffer_unittest.cc
diff --git a/media/base/decoder_buffer_unittest.cc b/media/base/decoder_buffer_unittest.cc
index f7ec5786f0fecc9bb3dd0e52ee1f92ba144486fe..65a14b6df3bffc2b1d106d71b4c8bdfabb219b9b 100644
--- a/media/base/decoder_buffer_unittest.cc
+++ b/media/base/decoder_buffer_unittest.cc
@@ -4,10 +4,6 @@
#include "base/string_util.h"
#include "media/base/decoder_buffer.h"
-#if !defined(OS_ANDROID)
-#include "media/ffmpeg/ffmpeg_common.h"
-#endif
-
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
@@ -51,30 +47,22 @@ TEST(DecoderBufferTest, PaddingAlignment) {
reinterpret_cast<const uint8*>(&kData), kDataSize));
ASSERT_TRUE(buffer2);
- // FFmpeg padding data should always be zeroed.
- for(int i = 0; i < FF_INPUT_BUFFER_PADDING_SIZE; i++)
+ // Padding data should always be zeroed.
+ for(int i = 0; i < DecoderBuffer::kPaddingSize; i++)
EXPECT_EQ((buffer2->GetData() + kDataSize)[i], 0);
// If the data is padded correctly we should be able to read and write past
- // the end of the data by FF_INPUT_BUFFER_PADDING_SIZE bytes without crashing
+ // the end of the data by DecoderBuffer::kPaddingSize bytes without crashing
// or Valgrind/ASAN throwing errors.
const uint8 kFillChar = 0xFF;
memset(
buffer2->GetWritableData() + kDataSize, kFillChar,
- FF_INPUT_BUFFER_PADDING_SIZE);
- for(int i = 0; i < FF_INPUT_BUFFER_PADDING_SIZE; i++)
+ DecoderBuffer::kPaddingSize);
+ for(int i = 0; i < DecoderBuffer::kPaddingSize; i++)
EXPECT_EQ((buffer2->GetData() + kDataSize)[i], kFillChar);
- // These alignments will need to be updated to match FFmpeg when it changes.
-#if defined(ARCH_CPU_ARM_FAMILY)
- // FFmpeg data should be aligned on a 16 byte boundary for ARM.
- const int kDataAlignment = 16;
-#else
- // FFmpeg data should be aligned on a 32 byte boundary for x86.
- const int kDataAlignment = 32;
-#endif
EXPECT_EQ(0u, reinterpret_cast<uintptr_t>(
- buffer2->GetData()) & (kDataAlignment - 1));
+ buffer2->GetData()) & (DecoderBuffer::kAlignmentSize - 1));
}
#endif
« no previous file with comments | « media/base/decoder_buffer.cc ('k') | media/ffmpeg/ffmpeg_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698