diff options
author | Moonchild <moonchild@palemoon.org> | 2019-07-11 14:56:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-11 14:56:41 +0000 |
commit | 04a7c6bb4e4048369e0a635dc02e9d83bbd59f87 (patch) | |
tree | cd580c19b66ce62987ece8df5d2ba7384c329502 /dom/media/webm/WebMDemuxer.cpp | |
parent | dd924323c3cda022493cd78d42da190577be20cf (diff) | |
parent | 31addeaac8841867008699478ef55e1c1b3d68a7 (diff) | |
download | UXP-04a7c6bb4e4048369e0a635dc02e9d83bbd59f87.tar UXP-04a7c6bb4e4048369e0a635dc02e9d83bbd59f87.tar.gz UXP-04a7c6bb4e4048369e0a635dc02e9d83bbd59f87.tar.lz UXP-04a7c6bb4e4048369e0a635dc02e9d83bbd59f87.tar.xz UXP-04a7c6bb4e4048369e0a635dc02e9d83bbd59f87.zip |
Merge pull request #1174 from JeroenVreeken/master
Report matroska containers as supported and also support h.264 content in a matroska container file
Diffstat (limited to 'dom/media/webm/WebMDemuxer.cpp')
-rw-r--r-- | dom/media/webm/WebMDemuxer.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/dom/media/webm/WebMDemuxer.cpp b/dom/media/webm/WebMDemuxer.cpp index 013da9b2c..2b6d46186 100644 --- a/dom/media/webm/WebMDemuxer.cpp +++ b/dom/media/webm/WebMDemuxer.cpp @@ -326,6 +326,20 @@ WebMDemuxer::ReadMetadata() case NESTEGG_CODEC_AV1: mInfo.mVideo.mMimeType = "video/webm; codecs=av1"; break; + case NESTEGG_CODEC_AVC1: { + mInfo.mVideo.mMimeType = "video/webm; codecs=avc1"; + + unsigned char* data = 0; + size_t length = 0; + r = nestegg_track_codec_data(context, track, 0, &data, &length); + if (r == -1) { + return NS_ERROR_FAILURE; + } + + mInfo.mVideo.mExtraData = new MediaByteBuffer(length); + mInfo.mVideo.mExtraData->AppendElements(data, length); + break; + } default: NS_WARNING("Unknown WebM video codec"); return NS_ERROR_FAILURE; @@ -662,6 +676,9 @@ WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, MediaRawDataQueue *aSampl isKeyframe = AOMDecoder::IsKeyframe(sample); break; #endif + case NESTEGG_CODEC_AVC1: + isKeyframe = nestegg_packet_has_keyframe(holder->Packet()); + break; default: NS_WARNING("Cannot detect keyframes in unknown WebM video codec"); return NS_ERROR_FAILURE; @@ -682,7 +699,7 @@ WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, MediaRawDataQueue *aSampl dimensions = AOMDecoder::GetFrameSize(sample); break; #endif - } + } if (mLastSeenFrameSize.isSome() && (dimensions != mLastSeenFrameSize.value())) { mInfo.mVideo.mDisplay = dimensions; @@ -749,6 +766,11 @@ WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, MediaRawDataQueue *aSampl if (aType == TrackInfo::kVideoTrack) { sample->mTrackInfo = mSharedVideoTrackInfo; } + + if (mVideoCodec == NESTEGG_CODEC_AVC1) { + sample->mExtraData = mInfo.mVideo.mExtraData; + } + aSamples->Push(sample); } return NS_OK; |