summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamienv <damienv@chromium.org>2014-08-26 18:47:58 -0700
committerCommit bot <commit-bot@chromium.org>2014-08-27 01:48:37 +0000
commita6c976378bd6485a520f0806e82126b25047d1c9 (patch)
tree24e4b9724f95ea4a72dffc2ab7d6ef2e9e86b4cf
parent29fe338316a08c2669d2e011889dff2b91dfb616 (diff)
downloadchromium_src-a6c976378bd6485a520f0806e82126b25047d1c9.zip
chromium_src-a6c976378bd6485a520f0806e82126b25047d1c9.tar.gz
chromium_src-a6c976378bd6485a520f0806e82126b25047d1c9.tar.bz2
Add the mp2t mimetype to the list of supported mime types.
The mp2t mimetype is now supported when the mpeg2 TS stream parser is enabled. This change is required since isTypeSupported involves that CanPlayType for the same mime type is at least maybe. This condition is now enforced at Blink level. BUG=None Review URL: https://codereview.chromium.org/478043005 Cr-Commit-Position: refs/heads/master@{#292073}
-rw-r--r--build/common.gypi5
-rw-r--r--media/BUILD.gn3
-rw-r--r--media/media.gyp12
-rw-r--r--net/base/mime_util.cc5
-rw-r--r--net/base/mime_util_unittest.cc6
5 files changed, 16 insertions, 15 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 531339f..eae50bf 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -2590,6 +2590,11 @@
}],
['proprietary_codecs==1', {
'defines': ['USE_PROPRIETARY_CODECS'],
+ 'conditions': [
+ ['enable_mpeg2ts_stream_parser==1', {
+ 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
+ }],
+ ],
}],
['enable_viewport==1', {
'defines': ['ENABLE_VIEWPORT'],
diff --git a/media/BUILD.gn b/media/BUILD.gn
index 8912f4b..9f450c8 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -24,9 +24,6 @@ config("media_config") {
if (use_cras) {
defines += [ "USE_CRAS" ]
}
- if (enable_mpeg2ts_stream_parser) {
- defines += [ "ENABLE_MPEG2TS_STREAM_PARSER" ]
- }
}
config("media_dependent_config") {
diff --git a/media/media.gyp b/media/media.gyp
index 620f9b2..f9f6cfc 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -973,13 +973,6 @@
'formats/mpeg/mpeg_audio_stream_parser_base.cc',
'formats/mpeg/mpeg_audio_stream_parser_base.h',
],
- 'conditions': [
- ['enable_mpeg2ts_stream_parser==1', {
- 'defines': [
- 'ENABLE_MPEG2TS_STREAM_PARSER',
- ],
- }],
- ],
}],
['target_arch=="ia32" or target_arch=="x64"', {
'dependencies': [
@@ -1271,11 +1264,6 @@
'formats/mpeg/mp3_stream_parser_unittest.cc',
],
}],
- ['enable_mpeg2ts_stream_parser==1', {
- 'defines': [
- 'ENABLE_MPEG2TS_STREAM_PARSER',
- ],
- }],
# TODO(wolenetz): Fix size_t to int truncations in win64. See
# http://crbug.com/171009
['OS=="win" and target_arch=="x64"', {
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index 29264b8..5e77619 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -379,6 +379,11 @@ static const char* const proprietary_media_types[] = {
"audio/mp3",
"audio/x-mp3",
"audio/mpeg",
+
+#if defined(ENABLE_MPEG2TS_STREAM_PARSER)
+ // MPEG-2 TS.
+ "video/mp2t",
+#endif
};
// Note:
diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc
index 93bd221..08a3dfd 100644
--- a/net/base/mime_util_unittest.cc
+++ b/net/base/mime_util_unittest.cc
@@ -231,6 +231,12 @@ TEST(MimeUtilTest, CommonMediaMimeType) {
EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3"));
EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3"));
EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg"));
+
+#if defined(ENABLE_MPEG2TS_STREAM_PARSER)
+ EXPECT_TRUE(IsSupportedMediaMimeType("video/mp2t"));
+#else
+ EXPECT_FALSE(IsSupportedMediaMimeType("video/mp2t"));
+#endif
#else
EXPECT_FALSE(IsSupportedMediaMimeType("audio/mp4"));
EXPECT_FALSE(IsSupportedMediaMimeType("audio/x-m4a"));