OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
acolwell GONE FROM CHROMIUM
2014/01/07 00:27:24
nit: Should be 2014 now.
tommycli
2014/01/07 00:55:28
Done.
| |
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 MEDIA_BASE_MEDIA_FFMPEG_METADATA_EXTRACTOR_H_ | |
acolwell GONE FROM CHROMIUM
2014/01/07 00:27:24
nit: Change guard to MEDIA_BASE_AUDIO_VIDEO_METADA
tommycli
2014/01/07 00:55:28
Done.
| |
6 #define MEDIA_BASE_MEDIA_FFMPEG_METADATA_EXTRACTOR_H_ | |
7 | |
8 #include <map> | |
9 #include <string> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "media/base/media_export.h" | |
13 | |
14 struct AVDictionary; | |
15 | |
16 namespace media { | |
17 | |
18 class DataSource; | |
19 | |
20 // This class extracts a string dictionary of metadata tags for audio and video | |
21 // files. It also provides the format name. | |
22 class MEDIA_EXPORT AudioVideoMetadataExtractor { | |
23 public: | |
24 AudioVideoMetadataExtractor(); | |
25 ~AudioVideoMetadataExtractor(); | |
26 | |
27 // Returns whether or not the fields were successfully extracted. Should only | |
28 // be called once. | |
29 bool Extract(media::DataSource* source); | |
30 | |
31 double duration() const; | |
32 | |
33 // Returns -1 for containers without video. | |
34 int width() const; | |
35 int height() const; | |
36 | |
37 // Returns -1 or an empty string if the value is undefined. | |
38 const std::string& album() const; | |
39 const std::string& artist() const; | |
40 const std::string& comment() const; | |
41 const std::string& copyright() const; | |
42 const std::string& date() const; | |
43 int disc() const; | |
44 const std::string& encoder() const; | |
45 const std::string& encoded_by() const; | |
46 const std::string& genre() const; | |
47 const std::string& language() const; | |
48 const std::string& title() const; | |
49 int track() const; | |
50 | |
51 private: | |
52 void ExtractDictionary(AVDictionary* metadata); | |
53 | |
54 bool extracted_; | |
55 std::map<std::string, std::string> tags_; | |
acolwell GONE FROM CHROMIUM
2014/01/07 00:27:24
nit: remove since it isn't used anymore.
tommycli
2014/01/07 00:55:28
Done.
| |
56 | |
57 int duration_; | |
58 int width_; | |
59 int height_; | |
60 | |
61 std::string album_; | |
62 std::string artist_; | |
63 std::string comment_; | |
64 std::string copyright_; | |
65 std::string date_; | |
66 int disc_; | |
67 std::string encoder_; | |
68 std::string encoded_by_; | |
69 std::string genre_; | |
70 std::string language_; | |
71 std::string title_; | |
72 int track_; | |
73 | |
74 DISALLOW_COPY_AND_ASSIGN(AudioVideoMetadataExtractor); | |
75 }; | |
76 | |
77 } // namespace media | |
78 | |
79 #endif // MEDIA_BASE_MEDIA_FFMPEG_METADATA_EXTRACTOR_H_ | |
OLD | NEW |