Add explicit |forceOnlineSignin| to user pod status
[chromium-blink-merge.git] / media / base / audio_video_metadata_extractor.h
blobaffe7945d374be43bd56c91bf2bb5fe1d6f07871
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_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "media/base/media_export.h"
13 struct AVDictionary;
15 namespace media {
17 class DataSource;
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 {
22 public:
23 AudioVideoMetadataExtractor();
24 ~AudioVideoMetadataExtractor();
26 // Returns whether or not the fields were successfully extracted. Should only
27 // be called once.
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.
34 int width() const;
35 int height() const;
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;
51 private:
52 void ExtractDictionary(AVDictionary* metadata);
54 bool extracted_;
56 int duration_;
57 int width_;
58 int height_;
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_;
73 DISALLOW_COPY_AND_ASSIGN(AudioVideoMetadataExtractor);
76 } // namespace media
78 #endif // MEDIA_BASE_AUDIO_VIDEO_METADATA_EXTRACTOR_H_