Bug 237885 - Migrate use of MediaSampleGStreamer to VideoFrame in WebRTC pipelines
Summary: Migrate use of MediaSampleGStreamer to VideoFrame in WebRTC pipelines
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords: InRadar
Depends on:
Blocks: 237884
  Show dependency treegraph
 
Reported: 2022-03-15 05:09 PDT by youenn fablet
Modified: 2022-03-16 10:35 PDT (History)
4 users (show)

See Also:


Attachments
Patch (37.29 KB, patch)
2022-03-16 03:30 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
[fast-cq] Patch (37.83 KB, patch)
2022-03-16 08:57 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2022-03-15 05:09:43 PDT
Migrate use of MediaSampleGStreamer to VideoFrame in WebRTC pipelines
Comment 1 Philippe Normand 2022-03-15 12:20:40 PDT
I started a patch.
Comment 2 Philippe Normand 2022-03-16 03:30:12 PDT
Created attachment 454819 [details]
Patch
Comment 3 youenn fablet 2022-03-16 07:24:28 PDT
Comment on attachment 454819 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=454819&action=review

> Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.h:69
>      MediaTime m_duration;

Should m_videoRotation and m_videoMirrored be removed as well if they are no longer used except in implement videoRotation() and videoMirrored() that could return default values?
Or maybe add a FIXME to say that they should be removed at some point?

> Source/WebCore/platform/graphics/gstreamer/VideoFrameGStreamer.cpp:99
> +    m_sample = sample;

You could do  m_sample(WTFMove(sample)) next to m_presentationSize instead.
Then reuse m_sample instead of sample in the constructor body.

> Source/WebCore/platform/graphics/gstreamer/VideoFrameGStreamer.h:46
> +    RefPtr<JSC::Uint8ClampedArray> getRGBAImageData() const final;

Could be private?

> Source/WebCore/platform/graphics/gstreamer/VideoFrameGStreamer.h:52
> +    VideoFrameGStreamer(const GRefPtr<GstSample>&, const MediaTime& presentationTime, VideoRotation = VideoRotation::None);

Could be private?
Comment 4 Philippe Normand 2022-03-16 07:38:47 PDT
Comment on attachment 454819 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=454819&action=review

>> Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.h:69
>>      MediaTime m_duration;
> 
> Should m_videoRotation and m_videoMirrored be removed as well if they are no longer used except in implement videoRotation() and videoMirrored() that could return default values?
> Or maybe add a FIXME to say that they should be removed at some point?

Ah yes, I forgot to remove those.
Comment 5 Xabier Rodríguez Calvar 2022-03-16 08:04:46 PDT
Comment on attachment 454819 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=454819&action=review

> Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.cpp:84
> +Ref<MediaSampleGStreamer> MediaSampleGStreamer::createFakeSample(GstCaps*, MediaTime pts, MediaTime dts, MediaTime duration, const FloatSize& presentationSize, const AtomString& trackId)

Can we make the MediaTimes const &?
Comment 6 Philippe Normand 2022-03-16 08:57:46 PDT
Created attachment 454842 [details]
[fast-cq] Patch
Comment 7 EWS 2022-03-16 10:34:14 PDT
Committed r291357 (248490@main): <https://commits.webkit.org/248490@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 454842 [details].
Comment 8 Radar WebKit Bug Importer 2022-03-16 10:35:21 PDT
<rdar://problem/90378933>