#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/filters/audio_video_metadata_extractor.h"
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "media/ffmpeg/ffmpeg_common.h"
#include "media/filters/blocking_url_protocol.h"
#include "media/filters/ffmpeg_glue.h"
namespace media {
namespace {
void OnError(bool* succeeded) { … }
bool ExtractString(AVDictionaryEntry* tag,
const char* expected_key,
std::string* destination) { … }
bool ExtractInt(AVDictionaryEntry* tag,
const char* expected_key,
int* destination) { … }
const int kAttachedImageSizeLimit = …;
}
AudioVideoMetadataExtractor::StreamInfo::StreamInfo() = default;
AudioVideoMetadataExtractor::StreamInfo::StreamInfo(const StreamInfo& other) =
default;
AudioVideoMetadataExtractor::StreamInfo::~StreamInfo() = default;
AudioVideoMetadataExtractor::AudioVideoMetadataExtractor()
: … { … }
AudioVideoMetadataExtractor::~AudioVideoMetadataExtractor() = default;
bool AudioVideoMetadataExtractor::Extract(DataSource* source,
bool extract_attached_images) { … }
bool AudioVideoMetadataExtractor::has_duration() const { … }
double AudioVideoMetadataExtractor::duration() const { … }
int AudioVideoMetadataExtractor::width() const { … }
int AudioVideoMetadataExtractor::height() const { … }
int AudioVideoMetadataExtractor::rotation() const { … }
const std::string& AudioVideoMetadataExtractor::album() const { … }
const std::string& AudioVideoMetadataExtractor::artist() const { … }
const std::string& AudioVideoMetadataExtractor::comment() const { … }
const std::string& AudioVideoMetadataExtractor::copyright() const { … }
const std::string& AudioVideoMetadataExtractor::date() const { … }
int AudioVideoMetadataExtractor::disc() const { … }
const std::string& AudioVideoMetadataExtractor::encoder() const { … }
const std::string& AudioVideoMetadataExtractor::encoded_by() const { … }
const std::string& AudioVideoMetadataExtractor::genre() const { … }
const std::string& AudioVideoMetadataExtractor::language() const { … }
const std::string& AudioVideoMetadataExtractor::title() const { … }
int AudioVideoMetadataExtractor::track() const { … }
const std::vector<AudioVideoMetadataExtractor::StreamInfo>&
AudioVideoMetadataExtractor::stream_infos() const { … }
const std::vector<std::string>&
AudioVideoMetadataExtractor::attached_images_bytes() const { … }
void AudioVideoMetadataExtractor::ExtractDictionary(AVDictionary* metadata,
TagDictionary* raw_tags) { … }
}