Bug 222462 - [REGRESSION] [MSE] WebContent/GPU process will hang when appending data under some circumstances.
Summary: [REGRESSION] [MSE] WebContent/GPU process will hang when appending data under...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-26 00:06 PST by Jean-Yves Avenard [:jya]
Modified: 2021-02-26 16:32 PST (History)
13 users (show)

See Also:


Attachments
Patch (10.64 KB, patch)
2021-02-26 00:20 PST, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch (10.78 KB, patch)
2021-02-26 14:26 PST, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch (10.76 KB, patch)
2021-02-26 15:52 PST, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2021-02-26 00:06:53 PST
[REGRESSION] [MSE] WebContent/GPU process will hang when appending data under some circumstances.
Comment 1 Jean-Yves Avenard [:jya] 2021-02-26 00:07:48 PST
rdar://74748843
Comment 2 Jean-Yves Avenard [:jya] 2021-02-26 00:20:05 PST
Created attachment 421620 [details]
Patch
Comment 3 Jer Noble 2021-02-26 13:32:46 PST
Comment on attachment 421620 [details]
Patch

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

> Source/WebCore/platform/MediaSample.h:76
> -    virtual std::pair<RefPtr<MediaSample>, RefPtr<MediaSample>> divide(const MediaTime& presentationTime) = 0;
> +    virtual std::pair<RefPtr<MediaSample>, RefPtr<MediaSample>> divide(const MediaTime& presentationTime, bool useEndTime = false) = 0;

Here...

> Source/WebCore/platform/graphics/SourceBufferPrivate.cpp:1020
> +                    replacementSamples = replacementSamples.second->divide(m_appendWindowEnd, true /* useEndTime */);

And here:

Rather than have a comment indicate the meaning of "true" in this case, something we've done elsewhere is:

enum class UseEndTime : bool { 
  DoNotUse,
  Use,
};

and: 

virtual std::pair<RefPtr<MediaSample>, RefPtr<MediaSample>> divide(const MediaTime& presentationTime, UseEndTime = UseEndTime::DoNotUse);

and:

replacementSamples = replacementSamples.second->divide(m_appendWindowEnd, UseEndTime::Use);
Comment 4 Eric Carlson 2021-02-26 13:35:54 PST
Comment on attachment 421620 [details]
Patch

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

> Source/WebCore/platform/graphics/SourceBufferPrivate.cpp:1020
> +                    replacementSamples = replacementSamples.second->divide(m_appendWindowEnd, true /* useEndTime */);

Please define and use an enum here instead of a bool

> Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:64
> +    std::pair<RefPtr<MediaSample>, RefPtr<MediaSample>> divide(const MediaTime& presentationTime, bool useEndTime) override;

s/override/final/

> Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.h:53
> +    std::pair<RefPtr<MediaSample>, RefPtr<MediaSample>> divide(const MediaTime&, bool) override  { return { nullptr, nullptr }; }

Ditto.

> Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:71
> +    std::pair<RefPtr<MediaSample>, RefPtr<MediaSample>> divide(const MediaTime&, bool) override { return {nullptr, nullptr}; }

Ditto.
Comment 5 Jean-Yves Avenard [:jya] 2021-02-26 14:26:33 PST
Created attachment 421707 [details]
Patch
Comment 6 Jer Noble 2021-02-26 14:35:53 PST
Comment on attachment 421707 [details]
Patch

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

r=me, with nits before landing:

> Source/WebCore/platform/MediaSample.h:79
> +    enum class UseEndTime : bool {
> +      DoNotUse,
> +      Use,
> +    };

StyleBot is complaining that the enum values aren't indented correctly.

> Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:64
> -    std::pair<RefPtr<MediaSample>, RefPtr<MediaSample>> divide(const MediaTime& presentationTime) override;
> +    std::pair<RefPtr<MediaSample>, RefPtr<MediaSample>> divide(const MediaTime& presentationTime, UseEndTime useEndTime) override;

StyleBot is complaining that the parameter name isn't needed here.
Comment 7 Jean-Yves Avenard [:jya] 2021-02-26 15:52:53 PST
Created attachment 421719 [details]
Patch
Comment 8 EWS 2021-02-26 16:32:18 PST
Committed r273604: <https://commits.webkit.org/r273604>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421719 [details].