Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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 MEDIA_BASE_AUDIO_VIDEO_METADATA_EXTRACTOR_H_ | |
| 6 #define MEDIA_BASE_AUDIO_VIDEO_METADATA_EXTRACTOR_H_ | |
| 7 | |
| 8 #include <map> | |
|
Lei Zhang
2014/01/07 21:44:25
nit: remove
tommycli
2014/01/07 23:12:36
Done.
| |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "media/base/media_export.h" | |
| 13 | |
| 14 struct AVDictionary; | |
|
Lei Zhang
2014/01/07 21:44:25
Are you going to use AVDictionary outside of this
tommycli
2014/01/07 23:12:36
Declared by FFmpeg.
| |
| 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); | |
|
Lei Zhang
2014/01/07 21:44:25
nit:: you can omit media:: inside namespace media.
tommycli
2014/01/07 23:12:36
Done.
| |
| 30 | |
| 31 double duration() const; | |
|
Lei Zhang
2014/01/07 21:44:25
Mention this is in seconds.
tommycli
2014/01/07 23:12:36
Done.
| |
| 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 | |
| 56 int duration_; | |
| 57 int width_; | |
| 58 int height_; | |
| 59 | |
| 60 std::string album_; | |
| 61 std::string artist_; | |
| 62 std::string comment_; | |
| 63 std::string copyright_; | |
| 64 std::string date_; | |
| 65 int disc_; | |
| 66 std::string encoder_; | |
| 67 std::string encoded_by_; | |
| 68 std::string genre_; | |
| 69 std::string language_; | |
| 70 std::string title_; | |
| 71 int track_; | |
| 72 | |
| 73 DISALLOW_COPY_AND_ASSIGN(AudioVideoMetadataExtractor); | |
| 74 }; | |
| 75 | |
| 76 } // namespace media | |
| 77 | |
| 78 #endif // MEDIA_BASE_AUDIO_VIDEO_METADATA_EXTRACTOR_H_ | |
| OLD | NEW |