Bug 1394591 - P6. Simplify some internal codec mimetype. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 01 Sep 2017 23:04:39 +0200
changeset 428203 642de7199c12214f3f9675d87662128c572de728
parent 428202 38133755716bac09d39e95821c6ee3888c6a79db
child 428204 a1c4ec3f36f622bd8a96403f20577a550e9de452
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1394591
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1394591 - P6. Simplify some internal codec mimetype. r=gerald The codec mimetype is now shown in the media devtools. May as well make it readable. MozReview-Commit-ID: 6rccDiTR24m
dom/media/platforms/agnostic/AOMDecoder.cpp
dom/media/platforms/agnostic/VPXDecoder.cpp
dom/media/webm/WebMDemuxer.cpp
media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
--- a/dom/media/platforms/agnostic/AOMDecoder.cpp
+++ b/dom/media/platforms/agnostic/AOMDecoder.cpp
@@ -304,18 +304,17 @@ AOMDecoder::Drain()
   });
 }
 
 
 /* static */
 bool
 AOMDecoder::IsAV1(const nsACString& aMimeType)
 {
-  return aMimeType.EqualsLiteral("video/webm; codecs=av1")
-         || aMimeType.EqualsLiteral("video/av1");
+  return aMimeType.EqualsLiteral("video/av1");
 }
 
 /* static */
 bool
 AOMDecoder::IsSupportedCodec(const nsAString& aCodecType)
 {
   // While AV1 is under development, we describe support
   // for a specific aom commit hash so sites can check
--- a/dom/media/platforms/agnostic/VPXDecoder.cpp
+++ b/dom/media/platforms/agnostic/VPXDecoder.cpp
@@ -20,20 +20,18 @@
 
 namespace mozilla {
 
 using namespace gfx;
 using namespace layers;
 
 static VPXDecoder::Codec MimeTypeToCodec(const nsACString& aMimeType)
 {
-  if (aMimeType.EqualsLiteral("video/webm; codecs=vp8")) {
+  if (aMimeType.EqualsLiteral("video/vp8")) {
     return VPXDecoder::Codec::VP8;
-  } else if (aMimeType.EqualsLiteral("video/webm; codecs=vp9")) {
-    return VPXDecoder::Codec::VP9;
   } else if (aMimeType.EqualsLiteral("video/vp9")) {
     return VPXDecoder::Codec::VP9;
   }
   return VPXDecoder::Codec::Unknown;
 }
 
 static nsresult
 InitContext(vpx_codec_ctx_t* aCtx,
@@ -283,19 +281,17 @@ VPXDecoder::DecodeAlpha(vpx_image_t** aI
   return NS_OK;
 }
 
 /* static */
 bool
 VPXDecoder::IsVPX(const nsACString& aMimeType, uint8_t aCodecMask)
 {
   return ((aCodecMask & VPXDecoder::VP8)
-          && aMimeType.EqualsLiteral("video/webm; codecs=vp8"))
-         || ((aCodecMask & VPXDecoder::VP9)
-             && aMimeType.EqualsLiteral("video/webm; codecs=vp9"))
+          && aMimeType.EqualsLiteral("video/vp8"))
          || ((aCodecMask & VPXDecoder::VP9)
              && aMimeType.EqualsLiteral("video/vp9"));
 }
 
 /* static */
 bool
 VPXDecoder::IsVP8(const nsACString& aMimeType)
 {
--- a/dom/media/webm/WebMDemuxer.cpp
+++ b/dom/media/webm/WebMDemuxer.cpp
@@ -318,23 +318,23 @@ WebMDemuxer::ReadMetadata()
       nestegg_video_params params;
       r = nestegg_track_video_params(context, track, &params);
       if (r == -1) {
         return NS_ERROR_FAILURE;
       }
       mVideoCodec = nestegg_track_codec_id(context, track);
       switch(mVideoCodec) {
         case NESTEGG_CODEC_VP8:
-          mInfo.mVideo.mMimeType = "video/webm; codecs=vp8";
+          mInfo.mVideo.mMimeType = "video/vp8";
           break;
         case NESTEGG_CODEC_VP9:
-          mInfo.mVideo.mMimeType = "video/webm; codecs=vp9";
+          mInfo.mVideo.mMimeType = "video/vp9";
           break;
         case NESTEGG_CODEC_AV1:
-          mInfo.mVideo.mMimeType = "video/webm; codecs=av1";
+          mInfo.mVideo.mMimeType = "video/av1";
           break;
         default:
           NS_WARNING("Unknown WebM video codec");
           return NS_ERROR_FAILURE;
       }
       // Picture region, taking into account cropping, before scaling
       // to the display size.
       unsigned int cropH = params.crop_right + params.crop_left;
--- a/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
@@ -31,20 +31,20 @@ WebrtcMediaDataDecoder::~WebrtcMediaData
 
 int32_t
 WebrtcMediaDataDecoder::InitDecode(const webrtc::VideoCodec* aCodecSettings,
                                    int32_t aNumberOfCores)
 {
   nsCString codec;
   switch (aCodecSettings->codecType) {
     case webrtc::VideoCodecType::kVideoCodecVP8:
-      codec = "video/webm; codecs=vp8";
+      codec = "video/vp8";
       break;
     case webrtc::VideoCodecType::kVideoCodecVP9:
-      codec = "video/webm; codecs=vp9";
+      codec = "video/vp9";
       break;
     case webrtc::VideoCodecType::kVideoCodecH264:
       codec = "video/avc";
       break;
     default:
       return WEBRTC_VIDEO_CODEC_ERROR;
   }