WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
235760
[GStreamer] GstStructure to JSON serialization
https://bugs.webkit.org/show_bug.cgi?id=235760
Summary
[GStreamer] GstStructure to JSON serialization
Philippe Normand
Reported
2022-01-28 02:08:46 PST
Would be useful for gstwebrtc stats logging.
Attachments
Patch
(7.07 KB, patch)
2022-01-28 02:57 PST
,
Philippe Normand
no flags
Details
Formatted Diff
Diff
Patch
(6.77 KB, patch)
2022-01-30 04:24 PST
,
Philippe Normand
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Philippe Normand
Comment 1
2022-01-28 02:57:06 PST
Created
attachment 450217
[details]
Patch
Xabier Rodríguez Calvar
Comment 2
2022-01-28 08:26:24 PST
Comment on
attachment 450217
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=450217&action=review
> Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:556 > + auto resultArray = array->asArray(); > + return resultArray->asValue();
I would collapse these two lines if possible.
> Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:322 > +String structureToJSONString(const GstStructure*);
I might go (not only for this method, but for the other ones as well) for something like gstStructureTo...
> Tools/TestWebKitAPI/Tests/WebCore/gstreamer/GStreamerTest.cpp:57 > + ASSERT_EQ(jsonString, "{\"int-val\":5,\"str-val\":\"foo\",\"bool-val\":1}");
Are we not interested in printing the structure name?
Philippe Normand
Comment 3
2022-01-28 09:01:22 PST
Comment on
attachment 450217
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=450217&action=review
>> Tools/TestWebKitAPI/Tests/WebCore/gstreamer/GStreamerTest.cpp:57 >> + ASSERT_EQ(jsonString, "{\"int-val\":5,\"str-val\":\"foo\",\"bool-val\":1}"); > > Are we not interested in printing the structure name?
For non-nested structures I don't see the point and it would add one level of nesting, only for the name: {"name": {...}}.
> Tools/TestWebKitAPI/Tests/WebCore/gstreamer/GStreamerTest.cpp:62 > + ASSERT_EQ(jsonString, "{\"int-val\":5,\"str-val\":\"foo\",\"bool-val\":1,\"inner\":{\"boo\":0,\"double-val\":2.42}}");
Here the nested struct is identified by its name though.
Philippe Normand
Comment 4
2022-01-30 04:24:48 PST
Created
attachment 450358
[details]
Patch
EWS
Comment 5
2022-01-30 05:20:33 PST
Committed
r288799
(
246575@main
): <
https://commits.webkit.org/246575@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 450358
[details]
.
Radar WebKit Bug Importer
Comment 6
2022-01-30 05:21:18 PST
<
rdar://problem/88239833
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug