Bug 1548113 - pass mEOS from MediaRawData to remote decoder. r=jya
authorMichael Froman <mfroman@mozilla.com>
Fri, 03 May 2019 00:36:19 +0000
changeset 531296 f00e36d2011fb9123158ab5ea3a6b3df6c75761e
parent 531295 8db7a4d48e49d401626c1b3893c382363a6eea49
child 531297 514ed4bfb0bd41fdb359befe7c30c8c72fee4566
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1548113
milestone68.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 1548113 - pass mEOS from MediaRawData to remote decoder. r=jya Lack of mEOS for decoding Vorbis on RDD was causing a mochitest failure with file spacestorm-1000Hz-100ms.ogg in dom/media/test/test_playback.html. The symptom was an incorrect frame count here[1]. [1] https://searchfox.org/mozilla-central/rev/b59a99943de4dd314bae4e44ab43ce7687ccbbec/dom/media/platforms/agnostic/VorbisDecoder.cpp#178 Differential Revision: https://phabricator.services.mozilla.com/D29756
dom/media/ipc/PMediaDecoderParams.ipdlh
dom/media/ipc/RemoteDecoderChild.cpp
dom/media/ipc/RemoteDecoderParent.cpp
dom/media/ipc/VideoDecoderChild.cpp
dom/media/ipc/VideoDecoderParent.cpp
--- a/dom/media/ipc/PMediaDecoderParams.ipdlh
+++ b/dom/media/ipc/PMediaDecoderParams.ipdlh
@@ -3,24 +3,27 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include "mozilla/dom/MediaIPCUtils.h";
 
 using mozilla::media::TimeUnit from "TimeUnits.h";
 
 namespace mozilla {
 
+// used for both SendInput/RecvInput and ProcessDecodedData/RecvOutput
 struct MediaDataIPDL
 {
   int64_t offset;
   TimeUnit time;
   TimeUnit timecode;
   TimeUnit duration;
   bool keyframe;
 };
 
+// used for SendInput/RecvInput
 struct MediaRawDataIPDL
 {
   MediaDataIPDL base;
+  bool eos;
   Shmem buffer;
 };
 
 } // namespace mozilla
--- a/dom/media/ipc/RemoteDecoderChild.cpp
+++ b/dom/media/ipc/RemoteDecoderChild.cpp
@@ -109,16 +109,17 @@ RefPtr<MediaDataDecoder::DecodePromise> 
         NS_ERROR_DOM_MEDIA_DECODE_ERR, __func__);
   }
 
   memcpy(buffer.get<uint8_t>(), aSample->Data(), aSample->Size());
 
   MediaRawDataIPDL sample(
       MediaDataIPDL(aSample->mOffset, aSample->mTime, aSample->mTimecode,
                     aSample->mDuration, aSample->mKeyframe),
+      aSample->mEOS,
       std::move(buffer));
   SendInput(sample);
 
   return mDecodePromise.Ensure(__func__);
 }
 
 RefPtr<MediaDataDecoder::FlushPromise> RemoteDecoderChild::Flush() {
   AssertOnManagerThread();
--- a/dom/media/ipc/RemoteDecoderParent.cpp
+++ b/dom/media/ipc/RemoteDecoderParent.cpp
@@ -72,16 +72,17 @@ mozilla::ipc::IPCResult RemoteDecoderPar
     Error(NS_ERROR_OUT_OF_MEMORY);
     return IPC_OK();
   }
   data->mOffset = aData.base().offset();
   data->mTime = aData.base().time();
   data->mTimecode = aData.base().timecode();
   data->mDuration = aData.base().duration();
   data->mKeyframe = aData.base().keyframe();
+  data->mEOS = aData.eos();
 
   DeallocShmem(aData.buffer());
 
   RefPtr<RemoteDecoderParent> self = this;
   mDecoder->Decode(data)->Then(
       mManagerTaskQueue, __func__,
       [self, this](const MediaDataDecoder::DecodedData& aResults) {
         if (mDestroyed) {
--- a/dom/media/ipc/VideoDecoderChild.cpp
+++ b/dom/media/ipc/VideoDecoderChild.cpp
@@ -238,16 +238,17 @@ RefPtr<MediaDataDecoder::DecodePromise> 
         NS_ERROR_DOM_MEDIA_DECODE_ERR, __func__);
   }
 
   memcpy(buffer.get<uint8_t>(), aSample->Data(), aSample->Size());
 
   MediaRawDataIPDL sample(
       MediaDataIPDL(aSample->mOffset, aSample->mTime, aSample->mTimecode,
                     aSample->mDuration, aSample->mKeyframe),
+      aSample->mEOS,
       std::move(buffer));
   SendInput(sample);
   return mDecodePromise.Ensure(__func__);
 }
 
 RefPtr<MediaDataDecoder::FlushPromise> VideoDecoderChild::Flush() {
   AssertOnManagerThread();
   mDecodePromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
--- a/dom/media/ipc/VideoDecoderParent.cpp
+++ b/dom/media/ipc/VideoDecoderParent.cpp
@@ -143,16 +143,17 @@ mozilla::ipc::IPCResult VideoDecoderPare
     Error(NS_ERROR_OUT_OF_MEMORY);
     return IPC_OK();
   }
   data->mOffset = aData.base().offset();
   data->mTime = aData.base().time();
   data->mTimecode = aData.base().timecode();
   data->mDuration = aData.base().duration();
   data->mKeyframe = aData.base().keyframe();
+  data->mEOS = aData.eos();
 
   DeallocShmem(aData.buffer());
 
   RefPtr<VideoDecoderParent> self = this;
   mDecoder->Decode(data)->Then(
       mManagerTaskQueue, __func__,
       [self, this](MediaDataDecoder::DecodedData&& aResults) {
         if (mDestroyed) {