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

Side by Side Diff: media/mojo/services/media_type_converters_unittest.cc

Issue 1542013004: Switch to standard integer types in media/, take 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more stddef Created 4 years, 12 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
« no previous file with comments | « media/mojo/services/media_type_converters.cc ('k') | media/mojo/services/mojo_cdm.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/mojo/services/media_type_converters.h" 5 #include "media/mojo/services/media_type_converters.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
7 #include <string.h> 9 #include <string.h>
8 10
11 #include "base/macros.h"
9 #include "media/base/audio_buffer.h" 12 #include "media/base/audio_buffer.h"
10 #include "media/base/audio_decoder_config.h" 13 #include "media/base/audio_decoder_config.h"
11 #include "media/base/cdm_config.h" 14 #include "media/base/cdm_config.h"
12 #include "media/base/decoder_buffer.h" 15 #include "media/base/decoder_buffer.h"
13 #include "media/base/media_util.h" 16 #include "media/base/media_util.h"
14 #include "media/base/sample_format.h" 17 #include "media/base/sample_format.h"
15 #include "media/base/test_helpers.h" 18 #include "media/base/test_helpers.h"
16 #include "media/base/video_frame.h" 19 #include "media/base/video_frame.h"
17 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
18 21
19 namespace media { 22 namespace media {
20 23
21 namespace { 24 namespace {
22 25
23 void CompareBytes(uint8_t* original_data, uint8_t* result_data, size_t length) { 26 void CompareBytes(uint8_t* original_data, uint8_t* result_data, size_t length) {
24 EXPECT_GT(length, 0u); 27 EXPECT_GT(length, 0u);
25 EXPECT_EQ(memcmp(original_data, result_data, length), 0); 28 EXPECT_EQ(memcmp(original_data, result_data, length), 0);
26 } 29 }
27 30
28 // Compare the actual video frame bytes (|rows| rows of |row|bytes| data), 31 // Compare the actual video frame bytes (|rows| rows of |row|bytes| data),
29 // skipping any padding that may be in either frame. 32 // skipping any padding that may be in either frame.
30 void CompareRowBytes(uint8* original_data, 33 void CompareRowBytes(uint8_t* original_data,
31 uint8* result_data, 34 uint8_t* result_data,
32 size_t rows, 35 size_t rows,
33 size_t row_bytes, 36 size_t row_bytes,
34 size_t original_stride, 37 size_t original_stride,
35 size_t result_stride) { 38 size_t result_stride) {
36 DCHECK_GE(original_stride, row_bytes); 39 DCHECK_GE(original_stride, row_bytes);
37 DCHECK_GE(result_stride, row_bytes); 40 DCHECK_GE(result_stride, row_bytes);
38 41
39 for (size_t i = 0; i < rows; ++i) { 42 for (size_t i = 0; i < rows; ++i) {
40 CompareBytes(original_data, result_data, row_bytes); 43 CompareBytes(original_data, result_data, row_bytes);
41 original_data += original_stride; 44 original_data += original_stride;
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 345
343 // Convert to and back. 346 // Convert to and back.
344 interfaces::VideoFramePtr ptr(interfaces::VideoFrame::From(buffer)); 347 interfaces::VideoFramePtr ptr(interfaces::VideoFrame::From(buffer));
345 scoped_refptr<VideoFrame> result(ptr.To<scoped_refptr<VideoFrame>>()); 348 scoped_refptr<VideoFrame> result(ptr.To<scoped_refptr<VideoFrame>>());
346 349
347 // Compare. 350 // Compare.
348 CompareVideoFrames(buffer, result); 351 CompareVideoFrames(buffer, result);
349 } 352 }
350 353
351 } // namespace media 354 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/media_type_converters.cc ('k') | media/mojo/services/mojo_cdm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698