| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef SERVICES_MEDIA_FRAMEWORK_METADATA_H_ | 5 #ifndef SERVICES_MEDIA_FRAMEWORK_METADATA_H_ |
| 6 #define SERVICES_MEDIA_FRAMEWORK_METADATA_H_ | 6 #define SERVICES_MEDIA_FRAMEWORK_METADATA_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "services/media/framework/safe_clone.h" | 12 #include "services/media/framework/safe_clone.h" |
| 13 | 13 |
| 14 namespace mojo { | 14 namespace mojo { |
| 15 namespace media { | 15 namespace media { |
| 16 | 16 |
| 17 class Metadata; | 17 class Metadata; |
| 18 | 18 |
| 19 // Container for content metadata. | 19 // Container for content metadata. |
| 20 // TODO(dalesat): Probably needs to be extensible. Consider using map-like. | 20 // TODO(dalesat): Probably needs to be extensible. Consider using map-like. |
| 21 class Metadata { | 21 class Metadata { |
| 22 public: | 22 public: |
| 23 static std::unique_ptr<Metadata> Create( | 23 static std::unique_ptr<Metadata> Create(uint64_t duration_ns, |
| 24 uint64_t duration_ns, | 24 const std::string& title, |
| 25 const std::string& title, | 25 const std::string& artist, |
| 26 const std::string& artist, | 26 const std::string& album, |
| 27 const std::string& album, | 27 const std::string& publisher, |
| 28 const std::string& publisher, | 28 const std::string& genre, |
| 29 const std::string& genre, | 29 const std::string& composer); |
| 30 const std::string& composer); | |
| 31 | 30 |
| 32 ~Metadata(); | 31 ~Metadata(); |
| 33 | 32 |
| 34 uint64_t duration_ns() const { return duration_ns_; } | 33 uint64_t duration_ns() const { return duration_ns_; } |
| 35 | 34 |
| 36 const std::string& title() const { return title_; } | 35 const std::string& title() const { return title_; } |
| 37 | 36 |
| 38 const std::string& artist() const { return artist_; } | 37 const std::string& artist() const { return artist_; } |
| 39 | 38 |
| 40 const std::string& album() const { return album_; } | 39 const std::string& album() const { return album_; } |
| 41 | 40 |
| 42 const std::string& publisher() const { return publisher_; } | 41 const std::string& publisher() const { return publisher_; } |
| 43 | 42 |
| 44 const std::string& genre() const { return genre_; } | 43 const std::string& genre() const { return genre_; } |
| 45 | 44 |
| 46 const std::string& composer() const { return composer_; } | 45 const std::string& composer() const { return composer_; } |
| 47 | 46 |
| 48 std::unique_ptr<Metadata> Clone() const { | 47 std::unique_ptr<Metadata> Clone() const { |
| 49 return Create( | 48 return Create(duration_ns_, title_, artist_, album_, publisher_, genre_, |
| 50 duration_ns_, | 49 composer_); |
| 51 title_, | |
| 52 artist_, | |
| 53 album_, | |
| 54 publisher_, | |
| 55 genre_, | |
| 56 composer_); | |
| 57 } | 50 } |
| 58 | 51 |
| 59 private: | 52 private: |
| 60 Metadata( | 53 Metadata(uint64_t duration_ns, |
| 61 uint64_t duration_ns, | 54 const std::string& title, |
| 62 const std::string& title, | 55 const std::string& artist, |
| 63 const std::string& artist, | 56 const std::string& album, |
| 64 const std::string& album, | 57 const std::string& publisher, |
| 65 const std::string& publisher, | 58 const std::string& genre, |
| 66 const std::string& genre, | 59 const std::string& composer); |
| 67 const std::string& composer); | |
| 68 | 60 |
| 69 uint64_t duration_ns_; | 61 uint64_t duration_ns_; |
| 70 std::string title_; | 62 std::string title_; |
| 71 std::string artist_; | 63 std::string artist_; |
| 72 std::string album_; | 64 std::string album_; |
| 73 std::string publisher_; | 65 std::string publisher_; |
| 74 std::string genre_; | 66 std::string genre_; |
| 75 std::string composer_; | 67 std::string composer_; |
| 76 | 68 |
| 77 DISALLOW_COPY_AND_ASSIGN(Metadata); | 69 DISALLOW_COPY_AND_ASSIGN(Metadata); |
| 78 }; | 70 }; |
| 79 | 71 |
| 80 } // namespace media | 72 } // namespace media |
| 81 } // namespace mojo | 73 } // namespace mojo |
| 82 | 74 |
| 83 #endif // SERVICES_MEDIA_FRAMEWORK_METADATA_H_ | 75 #endif // SERVICES_MEDIA_FRAMEWORK_METADATA_H_ |
| OLD | NEW |