Bug 1540581 - P2. Add missing VideoInfo members to IPC serializer. r=bryce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 11 Apr 2019 12:36:00 +0000
changeset 469130 61c265181c16b1e0208bbafb6c6aa7acb6a33216
parent 469129 a6a6f88b71c7294faf8b21492a5f3ac6c904aa58
child 469131 961e937daf7bc23193924e4d16404cc2c11120c9
push id35856
push usercsabou@mozilla.com
push dateFri, 12 Apr 2019 03:19:48 +0000
treeherdermozilla-central@940684cd1065 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbryce
bugs1540581
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 1540581 - P2. Add missing VideoInfo members to IPC serializer. r=bryce Another case where you have to wonder how did this ever worked!? Differential Revision: https://phabricator.services.mozilla.com/D26055
dom/media/ipc/MediaIPCUtils.h
--- a/dom/media/ipc/MediaIPCUtils.h
+++ b/dom/media/ipc/MediaIPCUtils.h
@@ -21,41 +21,63 @@ struct ParamTraits<mozilla::VideoInfo> {
     // TrackInfo
     WriteParam(aMsg, aParam.mMimeType);
 
     // VideoInfo
     WriteParam(aMsg, aParam.mDisplay);
     WriteParam(aMsg, aParam.mStereoMode);
     WriteParam(aMsg, aParam.mImage);
     WriteParam(aMsg, aParam.ImageRect());
+    WriteParam(aMsg, *aParam.mCodecSpecificConfig);
+    WriteParam(aMsg, *aParam.mExtraData);
+    WriteParam(aMsg, aParam.mRotation);
+    WriteParam(aMsg, aParam.mColorDepth);
+    WriteParam(aMsg, aParam.mColorSpace);
+    WriteParam(aMsg, aParam.mFullRange);
+    WriteParam(aMsg, aParam.HasAlpha());
   }
 
   static bool Read(const Message* aMsg, PickleIterator* aIter,
                    paramType* aResult) {
     mozilla::gfx::IntRect imageRect;
+    bool alphaPresent;
     if (ReadParam(aMsg, aIter, &aResult->mMimeType) &&
         ReadParam(aMsg, aIter, &aResult->mDisplay) &&
         ReadParam(aMsg, aIter, &aResult->mStereoMode) &&
         ReadParam(aMsg, aIter, &aResult->mImage) &&
-        ReadParam(aMsg, aIter, &imageRect)) {
+        ReadParam(aMsg, aIter, &imageRect) &&
+        ReadParam(aMsg, aIter, aResult->mCodecSpecificConfig.get()) &&
+        ReadParam(aMsg, aIter, aResult->mExtraData.get()) &&
+        ReadParam(aMsg, aIter, &aResult->mRotation) &&
+        ReadParam(aMsg, aIter, &aResult->mColorDepth) &&
+        ReadParam(aMsg, aIter, &aResult->mColorSpace) &&
+        ReadParam(aMsg, aIter, &aResult->mFullRange) &&
+        ReadParam(aMsg, aIter, &alphaPresent)) {
       aResult->SetImageRect(imageRect);
+      aResult->SetAlpha(alphaPresent);
       return true;
     }
     return false;
   }
 };
 
 template <>
 struct ParamTraits<mozilla::TrackInfo::TrackType>
     : public ContiguousEnumSerializerInclusive<
           mozilla::TrackInfo::TrackType,
           mozilla::TrackInfo::TrackType::kUndefinedTrack,
           mozilla::TrackInfo::TrackType::kTextTrack> {};
 
 template <>
+struct ParamTraits<mozilla::VideoInfo::Rotation>
+    : public ContiguousEnumSerializerInclusive<
+          mozilla::VideoInfo::Rotation, mozilla::VideoInfo::Rotation::kDegree_0,
+          mozilla::VideoInfo::Rotation::kDegree_270> {};
+
+template <>
 struct ParamTraits<mozilla::MediaByteBuffer>
     : public ParamTraits<nsTArray<uint8_t>> {
   typedef mozilla::MediaByteBuffer paramType;
 };
 
 template <>
 struct ParamTraits<mozilla::AudioInfo> {
   typedef mozilla::AudioInfo paramType;