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

Issue 40059: Changed several references from "char" to "uint8" which is the appropriate de... (Closed)

Created:
11 years, 9 months ago by ralphl
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Changed several references from "char" to "uint8" which is the appropriate definition for byte data buffers. This change is small, but modifies the data source interface Read() method, and the VideoSurface data structure. Mocks and tests all have very small changes. There are some changes in the mock_media_filters.h file that go beyond the scope of just changing char to uint8. These changes are required for future tests, and simply fill in parts of mocks that previously were NOTIMPLEMENTED(). The MockVideoFrame was modified to allow other tests to create a video frame directly without using the MockFilterConfiguration data structure. Also, it is now possible to construct a mock pipeline that has no audio. The currently checked-in pipeline will NOT work if you don't have audio. In a 2nd changelist, I will submit a new Pipeline_Impl and unit test that DOES support video without audio. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=10940

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Total comments: 7

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -63 lines) Patch
M chrome/renderer/media/data_source_impl.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/renderer/media/data_source_impl.cc View 1 2 4 chunks +15 lines, -13 lines 0 comments Download
M media/base/buffers.h View 1 1 chunk +1 line, -1 line 0 comments Download
M media/base/filters.h View 1 1 chunk +1 line, -1 line 0 comments Download
M media/base/mock_media_filters.h View 1 2 13 chunks +85 lines, -43 lines 0 comments Download
M media/filters/file_data_source.h View 1 1 chunk +1 line, -1 line 0 comments Download
M media/filters/file_data_source.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M media/filters/file_data_source_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
ralphl
Changed data source and video buffers from using "char *" to "uint8 *". Right now ...
11 years, 9 months ago (2009-03-03 23:05:34 UTC) #1
Erik does not do reviews
LGTM (yay! rietveld finally let me finish the review) http://codereview.chromium.org/40059/diff/1/9 File chrome/renderer/media/data_source_impl.cc (right): http://codereview.chromium.org/40059/diff/1/9#newcode151 Line ...
11 years, 9 months ago (2009-03-04 01:08:59 UTC) #2
scherkus (not reviewing)
I having a really hard time reviewing code right now (site is completely messed up) ...
11 years, 9 months ago (2009-03-04 01:10:09 UTC) #3
scherkus (not reviewing)
rietveld isn't being super annoying today... LGTM!
11 years, 9 months ago (2009-03-04 19:08:22 UTC) #4
ralphl
11 years, 9 months ago (2009-03-04 19:28:04 UTC) #5
Fixed all the nits.  Added a compile-time check to make sure the
reinterpret_cast<> never allows a bug through if someone changes the input
parameters to the OnRead...() function.

When try try servers come back OK I'll commit.

http://codereview.chromium.org/40059/diff/1004/30
File chrome/renderer/media/data_source_impl.cc (right):

http://codereview.chromium.org/40059/diff/1004/30#newcode151
Line 151: if (stream_->Read(reinterpret_cast<char*>(data), size,
&read_callback_) !=
On 2009/03/04 01:10:09, scherkus wrote:
> nit (maybe): code might look cleaner if we cast to a separate char* variable
> first
> 
> also rietveld seems to be showing a trailing whitespace here, might want to
> double check

I agree, and I also put in a compile-time check to for the size of the input.  I
HATE using reinterpret_cast without some compile time check that will break if
the input type changes.

http://codereview.chromium.org/40059/diff/1004/30#newcode154
Line 154: // gets the new pipeline CL checked in..
On 2009/03/04 01:10:09, scherkus wrote:
> extra period here

Done.

http://codereview.chromium.org/40059/diff/1004/28
File media/base/mock_media_filters.h (right):

http://codereview.chromium.org/40059/diff/1004/28#newcode357
Line 357: explicit MockVideoFrame(size_t video_width,
On 2009/03/04 01:10:09, scherkus wrote:
> don't need explicit for constructors with more than one argument

Done.

http://codereview.chromium.org/40059/diff/1004/28#newcode357
Line 357: explicit MockVideoFrame(size_t video_width,
On 2009/03/04 01:10:09, scherkus wrote:
> don't need explicit for constructors with more than one argument

Done.

Powered by Google App Engine
This is Rietveld 408576698