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

Unified Diff: media/base/video_frame_unittest.cc

Issue 1534273002: Switch to standard integer types in media/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 years 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/base/video_frame_unittest.cc
diff --git a/media/base/video_frame_unittest.cc b/media/base/video_frame_unittest.cc
index 157986f3d63aaf7c37813970cc920d996c3a5fbe..c697d6f9e60ee4ed9b77f03b64b26dc52a472961 100644
--- a/media/base/video_frame_unittest.cc
+++ b/media/base/video_frame_unittest.cc
@@ -25,14 +25,14 @@ void InitializeYV12Frame(VideoFrame* frame, double white_to_black) {
EXPECT_EQ(PIXEL_FORMAT_YV12, frame->format());
const int first_black_row =
static_cast<int>(frame->coded_size().height() * white_to_black);
- uint8* y_plane = frame->data(VideoFrame::kYPlane);
+ uint8_t* y_plane = frame->data(VideoFrame::kYPlane);
for (int row = 0; row < frame->coded_size().height(); ++row) {
int color = (row < first_black_row) ? 0xFF : 0x00;
memset(y_plane, color, frame->stride(VideoFrame::kYPlane));
y_plane += frame->stride(VideoFrame::kYPlane);
}
- uint8* u_plane = frame->data(VideoFrame::kUPlane);
- uint8* v_plane = frame->data(VideoFrame::kVPlane);
+ uint8_t* u_plane = frame->data(VideoFrame::kUPlane);
+ uint8_t* v_plane = frame->data(VideoFrame::kVPlane);
for (int row = 0; row < frame->coded_size().height(); row += 2) {
memset(u_plane, 0x80, frame->stride(VideoFrame::kUPlane));
memset(v_plane, 0x80, frame->stride(VideoFrame::kVPlane));
@@ -43,7 +43,8 @@ void InitializeYV12Frame(VideoFrame* frame, double white_to_black) {
// Given a |yv12_frame| this method converts the YV12 frame to RGBA and
// makes sure that all the pixels of the RBG frame equal |expect_rgb_color|.
-void ExpectFrameColor(media::VideoFrame* yv12_frame, uint32 expect_rgb_color) {
+void ExpectFrameColor(media::VideoFrame* yv12_frame,
+ uint32_t expect_rgb_color) {
ASSERT_EQ(PIXEL_FORMAT_YV12, yv12_frame->format());
ASSERT_EQ(yv12_frame->stride(VideoFrame::kUPlane),
yv12_frame->stride(VideoFrame::kVPlane));
@@ -55,7 +56,7 @@ void ExpectFrameColor(media::VideoFrame* yv12_frame, uint32 expect_rgb_color) {
0);
size_t bytes_per_row = yv12_frame->coded_size().width() * 4u;
- uint8* rgb_data = reinterpret_cast<uint8*>(
+ uint8_t* rgb_data = reinterpret_cast<uint8_t*>(
base::AlignedAlloc(bytes_per_row * yv12_frame->coded_size().height() +
VideoFrame::kFrameSizePadding,
VideoFrame::kFrameAddressAlignment));
@@ -72,8 +73,8 @@ void ExpectFrameColor(media::VideoFrame* yv12_frame, uint32 expect_rgb_color) {
media::YV12);
for (int row = 0; row < yv12_frame->coded_size().height(); ++row) {
- uint32* rgb_row_data = reinterpret_cast<uint32*>(
- rgb_data + (bytes_per_row * row));
+ uint32_t* rgb_row_data =
+ reinterpret_cast<uint32_t*>(rgb_data + (bytes_per_row * row));
for (int col = 0; col < yv12_frame->coded_size().width(); ++col) {
SCOPED_TRACE(base::StringPrintf("Checking (%d, %d)", row, col));
EXPECT_EQ(expect_rgb_color, rgb_row_data[col]);
@@ -180,8 +181,8 @@ TEST(VideoFrame, CreateZeroInitializedFrame) {
TEST(VideoFrame, CreateBlackFrame) {
const int kWidth = 2;
const int kHeight = 2;
- const uint8 kExpectedYRow[] = { 0, 0 };
- const uint8 kExpectedUVRow[] = { 128 };
+ const uint8_t kExpectedYRow[] = {0, 0};
+ const uint8_t kExpectedUVRow[] = {128};
scoped_refptr<media::VideoFrame> frame =
VideoFrame::CreateBlackFrame(gfx::Size(kWidth, kHeight));
@@ -199,14 +200,14 @@ TEST(VideoFrame, CreateBlackFrame) {
EXPECT_EQ(kHeight, frame->coded_size().height());
// Test frames themselves.
- uint8* y_plane = frame->data(VideoFrame::kYPlane);
+ uint8_t* y_plane = frame->data(VideoFrame::kYPlane);
for (int y = 0; y < frame->coded_size().height(); ++y) {
EXPECT_EQ(0, memcmp(kExpectedYRow, y_plane, arraysize(kExpectedYRow)));
y_plane += frame->stride(VideoFrame::kYPlane);
}
- uint8* u_plane = frame->data(VideoFrame::kUPlane);
- uint8* v_plane = frame->data(VideoFrame::kVPlane);
+ uint8_t* u_plane = frame->data(VideoFrame::kUPlane);
+ uint8_t* v_plane = frame->data(VideoFrame::kVPlane);
for (int y = 0; y < frame->coded_size().height() / 2; ++y) {
EXPECT_EQ(0, memcmp(kExpectedUVRow, u_plane, arraysize(kExpectedUVRow)));
EXPECT_EQ(0, memcmp(kExpectedUVRow, v_plane, arraysize(kExpectedUVRow)));
@@ -324,7 +325,7 @@ TEST(VideoFrame,
gpu::SyncToken sync_token(kNamespace, 0, kCommandBufferId, 7);
sync_token.SetVerifyFlush();
- uint32 target = 9;
+ uint32_t target = 9;
gpu::SyncToken release_sync_token(kNamespace, 0, kCommandBufferId, 111);
release_sync_token.SetVerifyFlush();

Powered by Google App Engine
This is Rietveld 408576698