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

Side by Side Diff: services/media/framework/metadata.h

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, updates based on feedback, some functions declared const. 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
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 #ifndef SERVICES_MEDIA_FRAMEWORK_METADATA_H_
6 #define SERVICES_MEDIA_FRAMEWORK_METADATA_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "services/media/framework/ptr.h"
13
14 namespace mojo {
15 namespace media {
16
17 class Metadata;
18
19 typedef UniquePtr<Metadata> MetadataPtr;
jeffbrown 2016/02/02 05:35:46 These typedefs make the code much harder to follow
dalesat 2016/02/02 21:46:38 OK. The guidance I've received is to the contrary.
20
21 class Metadata {
jeffbrown 2016/02/02 05:35:47 Docs?
dalesat 2016/02/02 21:46:38 Done.
22 public:
23 static MetadataPtr New(
jeffbrown 2016/02/02 05:35:47 We usually call these methods "Create".
dalesat 2016/02/02 21:46:39 Added TODO. I was taking a cue from mojo.
24 uint64_t duration_ns,
25 const std::string& title,
jeffbrown 2016/02/02 05:35:47 Don't hardcode this stuff. It'll explode. Consid
dalesat 2016/02/02 21:46:39 Yes, this was just to get the demo done. I've adde
26 const std::string& artist,
27 const std::string& album,
28 const std::string& publisher,
29 const std::string& genre,
30 const std::string& composer);
31
32 ~Metadata();
33
34 uint64_t duration_ns() const { return duration_ns_; }
35
36 const std::string& title() const { return title_; }
37
38 const std::string& artist() const { return artist_; }
39
40 const std::string& album() const { return album_; }
41
42 const std::string& publisher() const { return publisher_; }
43
44 const std::string& genre() const { return genre_; }
45
46 const std::string& composer() const { return composer_; }
47
48 MetadataPtr Clone() const {
49 return New(
50 duration_ns_,
51 title_,
52 artist_,
53 album_,
54 publisher_,
55 genre_,
56 composer_);
57 }
58
59 private:
60 Metadata(
61 uint64_t duration_ns,
62 const std::string& title,
63 const std::string& artist,
64 const std::string& album,
65 const std::string& publisher,
66 const std::string& genre,
67 const std::string& composer);
68
69 uint64_t duration_ns_;
70 std::string title_;
71 std::string artist_;
72 std::string album_;
73 std::string publisher_;
74 std::string genre_;
75 std::string composer_;
76
77 DISALLOW_COPY_AND_ASSIGN(Metadata);
78 };
79
80 } // namespace media
81 } // namespace mojo
82
83 #endif // SERVICES_MEDIA_FRAMEWORK_METADATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698