| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/audio_video_metadata_extractor.h" | 5 #include "media/base/audio_video_metadata_extractor.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 AudioVideoMetadataExtractor::attached_images_bytes() const { | 229 AudioVideoMetadataExtractor::attached_images_bytes() const { |
| 230 DCHECK(extracted_); | 230 DCHECK(extracted_); |
| 231 return attached_images_bytes_; | 231 return attached_images_bytes_; |
| 232 } | 232 } |
| 233 | 233 |
| 234 void AudioVideoMetadataExtractor::ExtractDictionary( | 234 void AudioVideoMetadataExtractor::ExtractDictionary( |
| 235 AVDictionary* metadata, TagDictionary* raw_tags) { | 235 AVDictionary* metadata, TagDictionary* raw_tags) { |
| 236 if (!metadata) | 236 if (!metadata) |
| 237 return; | 237 return; |
| 238 | 238 |
| 239 AVDictionaryEntry* tag = NULL; | 239 for (AVDictionaryEntry* tag = |
| 240 while ((tag = av_dict_get(metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { | 240 av_dict_get(metadata, "", NULL, AV_DICT_IGNORE_SUFFIX); |
| 241 tag; tag = av_dict_get(metadata, "", tag, AV_DICT_IGNORE_SUFFIX)) { |
| 241 if (raw_tags->find(tag->key) == raw_tags->end()) | 242 if (raw_tags->find(tag->key) == raw_tags->end()) |
| 242 (*raw_tags)[tag->key] = tag->value; | 243 (*raw_tags)[tag->key] = tag->value; |
| 243 | 244 |
| 244 if (ExtractInt(tag, "rotate", &rotation_)) continue; | 245 if (ExtractInt(tag, "rotate", &rotation_)) continue; |
| 245 if (ExtractString(tag, "album", &album_)) continue; | 246 if (ExtractString(tag, "album", &album_)) continue; |
| 246 if (ExtractString(tag, "artist", &artist_)) continue; | 247 if (ExtractString(tag, "artist", &artist_)) continue; |
| 247 if (ExtractString(tag, "comment", &comment_)) continue; | 248 if (ExtractString(tag, "comment", &comment_)) continue; |
| 248 if (ExtractString(tag, "copyright", ©right_)) continue; | 249 if (ExtractString(tag, "copyright", ©right_)) continue; |
| 249 if (ExtractString(tag, "date", &date_)) continue; | 250 if (ExtractString(tag, "date", &date_)) continue; |
| 250 if (ExtractInt(tag, "disc", &disc_)) continue; | 251 if (ExtractInt(tag, "disc", &disc_)) continue; |
| 251 if (ExtractString(tag, "encoder", &encoder_)) continue; | 252 if (ExtractString(tag, "encoder", &encoder_)) continue; |
| 252 if (ExtractString(tag, "encoded_by", &encoded_by_)) continue; | 253 if (ExtractString(tag, "encoded_by", &encoded_by_)) continue; |
| 253 if (ExtractString(tag, "genre", &genre_)) continue; | 254 if (ExtractString(tag, "genre", &genre_)) continue; |
| 254 if (ExtractString(tag, "language", &language_)) continue; | 255 if (ExtractString(tag, "language", &language_)) continue; |
| 255 if (ExtractString(tag, "title", &title_)) continue; | 256 if (ExtractString(tag, "title", &title_)) continue; |
| 256 if (ExtractInt(tag, "track", &track_)) continue; | 257 if (ExtractInt(tag, "track", &track_)) continue; |
| 257 } | 258 } |
| 258 } | 259 } |
| 259 | 260 |
| 260 } // namespace media | 261 } // namespace media |
| OLD | NEW |