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.
5 #ifndef MEDIA_BASE_AUDIO_VIDEO_METADATA_EXTRACTOR_H_
6 #define MEDIA_BASE_AUDIO_VIDEO_METADATA_EXTRACTOR_H_
10 #include "base/basictypes.h"
11 #include "media/base/media_export.h"
19 // This class extracts a string dictionary of metadata tags for audio and video
20 // files. It also provides the format name.
21 class MEDIA_EXPORT AudioVideoMetadataExtractor
{
23 AudioVideoMetadataExtractor();
24 ~AudioVideoMetadataExtractor();
26 // Returns whether or not the fields were successfully extracted. Should only
28 bool Extract(DataSource
* source
);
30 // Returns -1 if we cannot extract the duration. In seconds.
31 double duration() const;
33 // Returns -1 for containers without video.
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;
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;
52 void ExtractDictionary(AVDictionary
* metadata
);
63 std::string copyright_
;
67 std::string encoded_by_
;
69 std::string language_
;
73 DISALLOW_COPY_AND_ASSIGN(AudioVideoMetadataExtractor
);
78 #endif // MEDIA_BASE_AUDIO_VIDEO_METADATA_EXTRACTOR_H_