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

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

Issue 2267963002: Add support for cancellation of demuxer reads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add tests. Created 4 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 unified diff | Download patch
« no previous file with comments | « media/filters/file_data_source.h ('k') | media/filters/memory_data_source.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/filters/file_data_source.h" 5 #include "media/filters/file_data_source.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 11 matching lines...) Expand all
22 force_streaming_(false), 22 force_streaming_(false),
23 bytes_read_(0) { 23 bytes_read_(0) {
24 file_.Initialize(std::move(file)); 24 file_.Initialize(std::move(file));
25 } 25 }
26 26
27 bool FileDataSource::Initialize(const base::FilePath& file_path) { 27 bool FileDataSource::Initialize(const base::FilePath& file_path) {
28 DCHECK(!file_.IsValid()); 28 DCHECK(!file_.IsValid());
29 return file_.Initialize(file_path); 29 return file_.Initialize(file_path);
30 } 30 }
31 31
32 void FileDataSource::Stop() { 32 void FileDataSource::Stop() {}
33 } 33
34 void FileDataSource::Abort() {}
34 35
35 void FileDataSource::Read(int64_t position, 36 void FileDataSource::Read(int64_t position,
36 int size, 37 int size,
37 uint8_t* data, 38 uint8_t* data,
38 const DataSource::ReadCB& read_cb) { 39 const DataSource::ReadCB& read_cb) {
39 if (force_read_errors_ || !file_.IsValid()) { 40 if (force_read_errors_ || !file_.IsValid()) {
40 read_cb.Run(kReadError); 41 read_cb.Run(kReadError);
41 return; 42 return;
42 } 43 }
43 44
(...skipping 20 matching lines...) Expand all
64 65
65 bool FileDataSource::IsStreaming() { 66 bool FileDataSource::IsStreaming() {
66 return force_streaming_; 67 return force_streaming_;
67 } 68 }
68 69
69 void FileDataSource::SetBitrate(int bitrate) {} 70 void FileDataSource::SetBitrate(int bitrate) {}
70 71
71 FileDataSource::~FileDataSource() {} 72 FileDataSource::~FileDataSource() {}
72 73
73 } // namespace media 74 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/file_data_source.h ('k') | media/filters/memory_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698