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: services/media/framework/parts/reader.cc

Issue 1577953002: Motown in-proc streaming framework used to implement media services. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: sync Created 4 years, 10 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 | « services/media/framework/parts/reader.h ('k') | services/media/framework/ptr.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/logging.h"
6 #include "services/media/framework/parts/file_reader.h"
7 #include "services/media/framework/parts/reader.h"
8 #include "url/gurl.h"
9
10 namespace mojo {
11 namespace media {
12
13 Result Reader::Create(const GURL& gurl, ReaderPtr* reader_out) {
14 if (!gurl.is_valid()) {
15 return Result::kInvalidArgument;
16 }
17
18 ReaderPtr reader = nullptr;
19 if (gurl.SchemeIsFile()) {
20 reader = FileReader::Create();
21 }
22 // TODO(dalesat): More schemes.
23
24 if (reader == nullptr) {
25 return Result::kUnsupportedOperation;
26 }
27
28 Result result = reader->Init(gurl);
29 if (result == Result::kOk) {
30 *reader_out = reader;
31 }
32
33 return result;
34 }
35
36 } // namespace media
37 } // namespace mojo
OLDNEW
« no previous file with comments | « services/media/framework/parts/reader.h ('k') | services/media/framework/ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698