Bug 238071 - VideoFrame does not need to inherit from MediaSample
Summary: VideoFrame does not need to inherit from MediaSample
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on: 237884
Blocks:
  Show dependency treegraph
 
Reported: 2022-03-18 05:24 PDT by youenn fablet
Modified: 2022-03-24 10:05 PDT (History)
9 users (show)

See Also:


Attachments
Patch (28.06 KB, patch)
2022-03-18 05:34 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (28.14 KB, patch)
2022-03-22 09:40 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Updated patch (28.55 KB, patch)
2022-03-23 00:39 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
GStreamer fix (30.18 KB, patch)
2022-03-23 01:11 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
GStreamer fix (30.19 KB, patch)
2022-03-23 03:11 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
GStreamer fix (30.88 KB, patch)
2022-03-23 03:28 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
GStreamer fix (31.57 KB, patch)
2022-03-23 03:59 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
GStreamer fix (31.57 KB, patch)
2022-03-23 05:19 PDT, youenn fablet
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-18 05:24:07 PDT
VideoFrame does not need to inherit from MediaSample
Comment 1 youenn fablet 2022-03-18 05:34:02 PDT
Created attachment 455089 [details]
Patch
Comment 2 youenn fablet 2022-03-22 09:40:07 PDT
Created attachment 455384 [details]
Patch
Comment 3 Eric Carlson 2022-03-22 09:52:53 PDT
Comment on attachment 455384 [details]
Patch

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

r=me once the bots are happy

> Source/WebCore/platform/VideoFrame.cpp:69
> +#if PLATFORM(COCOA) && USE(AVFOUNDATION)
>  RefPtr<VideoFrameCV> VideoFrame::asVideoFrameCV()
>  {
> +    if (isCV())
> +        return downcast<VideoFrameCV>(this);
> +
>      auto buffer = pixelBuffer();
>      if (!buffer)
>          return nullptr;
> -
>      return VideoFrameCV::create(presentationTime(), isMirrored(), rotation(), buffer);
>  }
> +#endif // PLATFORM(COCOA) && USE(AVFOUNDATION)
> +
> +#if !PLATFORM(COCOA)
> +RefPtr<JSC::Uint8ClampedArray> VideoFrame::getRGBAImageData() const
> +{
> +    return nullptr;
> +}
>  #endif

Can these move to VideoFrame.mm?

> Source/WebCore/platform/VideoFrame.mm:46
> +    const OSType imageFormat = kCVPixelFormatType_32RGBA;
> +    RetainPtr<CFNumberRef> imageFormatNumber = adoptCF(CFNumberCreate(nullptr,  kCFNumberIntType,  &imageFormat));
> +
> +    RetainPtr<CFMutableDictionaryRef> conformerOptions = adoptCF(CFDictionaryCreateMutable(0, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
> +    CFDictionarySetValue(conformerOptions.get(), kCVPixelBufferPixelFormatTypeKey, imageFormatNumber.get());
> +    PixelBufferConformerCV pixelBufferConformer(conformerOptions.get());

I think this be simplified to something like:

    auto pixelBufferConformer(@{ (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32RGBA) });
Comment 4 youenn fablet 2022-03-23 00:39:55 PDT
Created attachment 455471 [details]
Updated patch
Comment 5 youenn fablet 2022-03-23 01:11:41 PDT
Created attachment 455473 [details]
GStreamer fix
Comment 6 youenn fablet 2022-03-23 03:11:51 PDT
Created attachment 455480 [details]
GStreamer fix
Comment 7 youenn fablet 2022-03-23 03:28:25 PDT
Created attachment 455482 [details]
GStreamer fix
Comment 8 youenn fablet 2022-03-23 03:59:44 PDT
Created attachment 455487 [details]
GStreamer fix
Comment 9 youenn fablet 2022-03-23 05:19:27 PDT
Created attachment 455491 [details]
GStreamer fix
Comment 10 EWS 2022-03-23 06:55:51 PDT
Committed r291744 (248776@main): <https://commits.webkit.org/248776@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 455491 [details].
Comment 11 Radar WebKit Bug Importer 2022-03-23 09:48:20 PDT
<rdar://problem/90705308>
Comment 12 Jon Lee 2022-03-24 10:03:29 PDT
It looks like this fixed the timeout in fast/mediastream/captureStream/canvas3d.html