OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/utility/media_galleries/media_metadata_parser.h" | 5 #include "chrome/utility/media_galleries/media_metadata_parser.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 SetStringScopedPtr(extractor.artist(), &metadata->artist); | 54 SetStringScopedPtr(extractor.artist(), &metadata->artist); |
55 SetStringScopedPtr(extractor.comment(), &metadata->comment); | 55 SetStringScopedPtr(extractor.comment(), &metadata->comment); |
56 SetStringScopedPtr(extractor.copyright(), &metadata->copyright); | 56 SetStringScopedPtr(extractor.copyright(), &metadata->copyright); |
57 SetIntScopedPtr(extractor.disc(), &metadata->disc); | 57 SetIntScopedPtr(extractor.disc(), &metadata->disc); |
58 SetStringScopedPtr(extractor.genre(), &metadata->genre); | 58 SetStringScopedPtr(extractor.genre(), &metadata->genre); |
59 SetStringScopedPtr(extractor.language(), &metadata->language); | 59 SetStringScopedPtr(extractor.language(), &metadata->language); |
60 SetIntScopedPtr(extractor.rotation(), &metadata->rotation); | 60 SetIntScopedPtr(extractor.rotation(), &metadata->rotation); |
61 SetStringScopedPtr(extractor.title(), &metadata->title); | 61 SetStringScopedPtr(extractor.title(), &metadata->title); |
62 SetIntScopedPtr(extractor.track(), &metadata->track); | 62 SetIntScopedPtr(extractor.track(), &metadata->track); |
63 | 63 |
| 64 for (std::map<std::string, std::string>::const_iterator it = |
| 65 extractor.raw_tags().begin(); |
| 66 it != extractor.raw_tags().end(); ++it) { |
| 67 metadata->raw_tags.additional_properties.SetString(it->first, it->second); |
| 68 } |
| 69 |
64 return metadata.Pass(); | 70 return metadata.Pass(); |
65 } | 71 } |
66 | 72 |
67 } // namespace | 73 } // namespace |
68 | 74 |
69 MediaMetadataParser::MediaMetadataParser(media::DataSource* source, | 75 MediaMetadataParser::MediaMetadataParser(media::DataSource* source, |
70 const std::string& mime_type) | 76 const std::string& mime_type) |
71 : source_(source), | 77 : source_(source), |
72 mime_type_(mime_type) { | 78 mime_type_(mime_type) { |
73 } | 79 } |
(...skipping 14 matching lines...) Expand all Loading... |
88 base::Bind(&ParseAudioVideoMetadata, source_, base::Passed(&metadata)), | 94 base::Bind(&ParseAudioVideoMetadata, source_, base::Passed(&metadata)), |
89 callback); | 95 callback); |
90 return; | 96 return; |
91 } | 97 } |
92 | 98 |
93 // TODO(tommycli): Implement for image mime types. | 99 // TODO(tommycli): Implement for image mime types. |
94 callback.Run(metadata.Pass()); | 100 callback.Run(metadata.Pass()); |
95 } | 101 } |
96 | 102 |
97 } // namespace metadata | 103 } // namespace metadata |
OLD | NEW |