Skip to content

Commit

Permalink
Bug 1394591 - P6. Simplify some internal codec mimetype. r=gerald
Browse files Browse the repository at this point in the history
The codec mimetype is now shown in the media devtools. May as well make it readable.

MozReview-Commit-ID: 6rccDiTR24m

--HG--
extra : rebase_source : 7b8d1da8f05d0c46d5fd57b5e604ec3aed36a5f2
  • Loading branch information
Jean-Yves Avenard committed Sep 1, 2017
1 parent 1559f6a commit 64a4b87
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
3 changes: 1 addition & 2 deletions dom/media/platforms/agnostic/AOMDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ AOMDecoder::Drain()
bool
AOMDecoder::IsAV1(const nsACString& aMimeType)
{
return aMimeType.EqualsLiteral("video/webm; codecs=av1")
|| aMimeType.EqualsLiteral("video/av1");
return aMimeType.EqualsLiteral("video/av1");
}

/* static */
Expand Down
8 changes: 2 additions & 6 deletions dom/media/platforms/agnostic/VPXDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ 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;
}
Expand Down Expand Up @@ -288,9 +286,7 @@ 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"));
}
Expand Down
6 changes: 3 additions & 3 deletions dom/media/webm/WebMDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,13 @@ WebMDemuxer::ReadMetadata()
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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ WebrtcMediaDataDecoder::InitDecode(const webrtc::VideoCodec* aCodecSettings,
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";
Expand Down

0 comments on commit 64a4b87

Please sign in to comment.