OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
6 #include <iterator> | 6 #include <iterator> |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 #endif | 427 #endif |
428 | 428 |
429 struct MediaFormatStrict { | 429 struct MediaFormatStrict { |
430 const char* mime_type; | 430 const char* mime_type; |
431 const char* codecs_list; | 431 const char* codecs_list; |
432 }; | 432 }; |
433 | 433 |
434 static const MediaFormatStrict format_codec_mappings[] = { | 434 static const MediaFormatStrict format_codec_mappings[] = { |
435 { "video/webm", "opus,vorbis,vp8,vp8.0,vp9,vp9.0" }, | 435 { "video/webm", "opus,vorbis,vp8,vp8.0,vp9,vp9.0" }, |
436 { "audio/webm", "opus,vorbis" }, | 436 { "audio/webm", "opus,vorbis" }, |
437 { "audio/wav", "1" } | 437 { "audio/wav", "1" }, |
| 438 { "audio/x-wav", "1" }, |
| 439 { "video/ogg", "opus,theora,vorbis" }, |
| 440 { "audio/ogg", "opus,vorbis" }, |
| 441 { "application/ogg", "opus,theora,vorbis" } |
438 }; | 442 }; |
439 | 443 |
440 MimeUtil::MimeUtil() { | 444 MimeUtil::MimeUtil() { |
441 InitializeMimeTypeMaps(); | 445 InitializeMimeTypeMaps(); |
442 } | 446 } |
443 | 447 |
444 // static | 448 // static |
445 bool MimeUtil::AreSupportedCodecs(const MimeMappings& supported_codecs, | 449 bool MimeUtil::AreSupportedCodecs(const MimeMappings& supported_codecs, |
446 const std::vector<std::string>& codecs) { | 450 const std::vector<std::string>& codecs) { |
447 for (size_t i = 0; i < codecs.size(); ++i) { | 451 for (size_t i = 0; i < codecs.size(); ++i) { |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 post_data->append("\r\n" + value + "\r\n"); | 1028 post_data->append("\r\n" + value + "\r\n"); |
1025 } | 1029 } |
1026 | 1030 |
1027 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, | 1031 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, |
1028 std::string* post_data) { | 1032 std::string* post_data) { |
1029 DCHECK(post_data); | 1033 DCHECK(post_data); |
1030 post_data->append("--" + mime_boundary + "--\r\n"); | 1034 post_data->append("--" + mime_boundary + "--\r\n"); |
1031 } | 1035 } |
1032 | 1036 |
1033 } // namespace net | 1037 } // namespace net |
OLD | NEW |