Chromium Code Reviews| Index: media/base/audio_video_metadata_extractor.h |
| diff --git a/media/base/audio_video_metadata_extractor.h b/media/base/audio_video_metadata_extractor.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..feaef86e0ed3702c35113c38a74c199faa179cdd |
| --- /dev/null |
| +++ b/media/base/audio_video_metadata_extractor.h |
| @@ -0,0 +1,78 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_BASE_AUDIO_VIDEO_METADATA_EXTRACTOR_H_ |
| +#define MEDIA_BASE_AUDIO_VIDEO_METADATA_EXTRACTOR_H_ |
| + |
| +#include <map> |
|
Lei Zhang
2014/01/07 21:44:25
nit: remove
tommycli
2014/01/07 23:12:36
Done.
|
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| +#include "media/base/media_export.h" |
| + |
| +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.
|
| + |
| +namespace media { |
| + |
| +class DataSource; |
| + |
| +// This class extracts a string dictionary of metadata tags for audio and video |
| +// files. It also provides the format name. |
| +class MEDIA_EXPORT AudioVideoMetadataExtractor { |
| + public: |
| + AudioVideoMetadataExtractor(); |
| + ~AudioVideoMetadataExtractor(); |
| + |
| + // Returns whether or not the fields were successfully extracted. Should only |
| + // be called once. |
| + 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.
|
| + |
| + double duration() const; |
|
Lei Zhang
2014/01/07 21:44:25
Mention this is in seconds.
tommycli
2014/01/07 23:12:36
Done.
|
| + |
| + // Returns -1 for containers without video. |
| + int width() const; |
| + int height() const; |
| + |
| + // Returns -1 or an empty string if the value is undefined. |
| + const std::string& album() const; |
| + const std::string& artist() const; |
| + const std::string& comment() const; |
| + const std::string& copyright() const; |
| + const std::string& date() const; |
| + int disc() const; |
| + const std::string& encoder() const; |
| + const std::string& encoded_by() const; |
| + const std::string& genre() const; |
| + const std::string& language() const; |
| + const std::string& title() const; |
| + int track() const; |
| + |
| + private: |
| + void ExtractDictionary(AVDictionary* metadata); |
| + |
| + bool extracted_; |
| + |
| + int duration_; |
| + int width_; |
| + int height_; |
| + |
| + std::string album_; |
| + std::string artist_; |
| + std::string comment_; |
| + std::string copyright_; |
| + std::string date_; |
| + int disc_; |
| + std::string encoder_; |
| + std::string encoded_by_; |
| + std::string genre_; |
| + std::string language_; |
| + std::string title_; |
| + int track_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AudioVideoMetadataExtractor); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_BASE_AUDIO_VIDEO_METADATA_EXTRACTOR_H_ |