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

Side by Side Diff: media/filters/file_data_source.cc

Issue 40059: Changed several references from "char" to "uint8" which is the appropriate de... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « media/filters/file_data_source.h ('k') | media/filters/file_data_source_unittest.cc » ('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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 #include "media/base/filter_host.h" 7 #include "media/base/filter_host.h"
8 #include "media/base/filters.h" 8 #include "media/base/filters.h"
9 #include "media/base/pipeline.h" 9 #include "media/base/pipeline.h"
10 #include "media/filters/file_data_source.h" 10 #include "media/filters/file_data_source.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 file_util::CloseFile(file_); 50 file_util::CloseFile(file_);
51 file_ = NULL; 51 file_ = NULL;
52 file_size_ = 0; 52 file_size_ = 0;
53 } 53 }
54 } 54 }
55 55
56 const MediaFormat* FileDataSource::GetMediaFormat() { 56 const MediaFormat* FileDataSource::GetMediaFormat() {
57 return &media_format_; 57 return &media_format_;
58 } 58 }
59 59
60 size_t FileDataSource::Read(char* data, size_t size) { 60 size_t FileDataSource::Read(uint8* data, size_t size) {
61 DCHECK(file_); 61 DCHECK(file_);
62 AutoLock l(lock_); 62 AutoLock l(lock_);
63 if (file_) { 63 if (file_) {
64 size_t size_read = fread(data, 1, size, file_); 64 size_t size_read = fread(data, 1, size, file_);
65 if (size_read == size || !ferror(file_)) { 65 if (size_read == size || !ferror(file_)) {
66 return size_read; 66 return size_read;
67 } 67 }
68 } 68 }
69 return kReadError; 69 return kReadError;
70 } 70 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 bool FileDataSource::GetSize(int64* size_out) { 106 bool FileDataSource::GetSize(int64* size_out) {
107 DCHECK(size_out); 107 DCHECK(size_out);
108 DCHECK(file_); 108 DCHECK(file_);
109 AutoLock l(lock_); 109 AutoLock l(lock_);
110 *size_out = file_size_; 110 *size_out = file_size_;
111 return (NULL != file_); 111 return (NULL != file_);
112 } 112 }
113 113
114 } // namespace media 114 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/file_data_source.h ('k') | media/filters/file_data_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698