Title: [258807] trunk/Source/WebCore
Revision
258807
Author
[email protected]
Date
2020-03-21 07:25:09 -0700 (Sat, 21 Mar 2020)

Log Message

Make the MediaSample::toJSONString method generic
https://bugs.webkit.org/show_bug.cgi?id=209287

Reviewed by Eric Carlson.

It is generic and thus can be shared to sub-classes.

* platform/MediaSample.h:
(WebCore::MediaSample::toJSONString const):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (258806 => 258807)


--- trunk/Source/WebCore/ChangeLog	2020-03-21 14:11:01 UTC (rev 258806)
+++ trunk/Source/WebCore/ChangeLog	2020-03-21 14:25:09 UTC (rev 258807)
@@ -1,3 +1,17 @@
+2020-03-21  Philippe Normand  <[email protected]>
+
+        Make the MediaSample::toJSONString method generic
+        https://bugs.webkit.org/show_bug.cgi?id=209287
+
+        Reviewed by Eric Carlson.
+
+        It is generic and thus can be shared to sub-classes.
+
+        * platform/MediaSample.h:
+        (WebCore::MediaSample::toJSONString const):
+        * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
+
 2020-03-21  Zalan Bujtas  <[email protected]>
 
         telerik.com: Placeholder text is misaligned in search text box

Modified: trunk/Source/WebCore/platform/MediaSample.h (258806 => 258807)


--- trunk/Source/WebCore/platform/MediaSample.h	2020-03-21 14:11:01 UTC (rev 258806)
+++ trunk/Source/WebCore/platform/MediaSample.h	2020-03-21 14:25:09 UTC (rev 258807)
@@ -98,7 +98,18 @@
     bool hasAlpha() const { return flags() & HasAlpha; }
 
     virtual void dump(PrintStream&) const = 0;
-    virtual String toJSONString() const { return { }; }
+    String toJSONString() const
+    {
+        auto object = JSON::Object::create();
+
+        object->setObject("pts"_s, presentationTime().toJSONObject());
+        object->setObject("dts"_s, decodeTime().toJSONObject());
+        object->setObject("duration"_s, duration().toJSONObject());
+        object->setInteger("flags"_s, static_cast<unsigned>(flags()));
+        object->setObject("presentationSize"_s, presentationSize().toJSONObject());
+
+        return object->toJSONString();
+    }
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h (258806 => 258807)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h	2020-03-21 14:11:01 UTC (rev 258806)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h	2020-03-21 14:25:09 UTC (rev 258807)
@@ -68,8 +68,6 @@
 
     CMSampleBufferRef sampleBuffer() const { return m_sample.get(); }
 
-    String toJSONString() const override;
-
 protected:
     MediaSampleAVFObjC(RetainPtr<CMSampleBufferRef>&& sample)
         : m_sample(WTFMove(sample))

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm (258806 => 258807)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm	2020-03-21 14:11:01 UTC (rev 258806)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm	2020-03-21 14:25:09 UTC (rev 258807)
@@ -316,17 +316,4 @@
     }
 }
 
-String MediaSampleAVFObjC::toJSONString() const
-{
-    auto object = JSON::Object::create();
-
-    object->setObject("pts"_s, presentationTime().toJSONObject());
-    object->setObject("dts"_s, decodeTime().toJSONObject());
-    object->setObject("duration"_s, duration().toJSONObject());
-    object->setInteger("flags"_s, static_cast<unsigned>(flags()));
-    object->setObject("presentationSize"_s, presentationSize().toJSONObject());
-
-    return object->toJSONString();
 }
-
-}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to