Bug 237075 - Add ability to convert FragmentedSharedBuffer to CMBlockBuffer
Summary: Add ability to convert FragmentedSharedBuffer to CMBlockBuffer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks: 236754 237078
  Show dependency treegraph
 
Reported: 2022-02-22 22:45 PST by Jean-Yves Avenard [:jya]
Modified: 2022-03-07 17:40 PST (History)
2 users (show)

See Also:


Attachments
Patch (9.42 KB, patch)
2022-02-23 03:34 PST, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch (9.47 KB, patch)
2022-02-23 18:26 PST, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch (9.87 KB, patch)
2022-02-24 05:34 PST, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch (9.96 KB, patch)
2022-03-07 14:53 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] 2022-02-22 22:45:59 PST
Sub-task of bug 236754.

We can simplify the rewrite of SourceBufferParserWebM by using SharedBuffers instead.

Once we have built the SharedBuffer, we would want an easy way to convert it into a CMBlockBuffer without allocating memory or performing any copies.
Comment 1 Radar WebKit Bug Importer 2022-02-22 22:49:17 PST
<rdar://problem/89338447>
Comment 2 Jean-Yves Avenard [:jya] 2022-02-23 03:34:57 PST
Created attachment 452960 [details]
Patch
Comment 3 Jean-Yves Avenard [:jya] 2022-02-23 18:26:16 PST
Created attachment 453063 [details]
Patch
Comment 4 Jean-Yves Avenard [:jya] 2022-02-24 00:05:15 PST
Comment on attachment 453063 [details]
Patch

Unrelated failure, that code path isn't even used yet.
Comment 5 Jean-Yves Avenard [:jya] 2022-02-24 05:34:36 PST
Created attachment 453093 [details]
Patch
Comment 6 Jer Noble 2022-03-07 14:01:51 PST
Comment on attachment 453093 [details]
Patch

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

> Source/WebCore/platform/SharedBuffer.cpp:162
> +    if (element->segment->size() - offsetInSegment >= length)

Is it possible for element->segment->size() to be < offsetInSegment? If not, maybe an ASSERT() that states such?
Comment 7 Jean-Yves Avenard [:jya] 2022-03-07 14:42:15 PST
Comment on attachment 453093 [details]
Patch

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

>> Source/WebCore/platform/SharedBuffer.cpp:162
>> +    if (element->segment->size() - offsetInSegment >= length)
> 
> Is it possible for element->segment->size() to be < offsetInSegment? If not, maybe an ASSERT() that states such?

No, it's not possible. unless getSegmentForPosition is buggy and it's not :)
Comment 8 Jean-Yves Avenard [:jya] 2022-03-07 14:53:09 PST
Created attachment 454038 [details]
Patch
Comment 9 EWS 2022-03-07 17:40:26 PST
Committed r290968 (248147@main): <https://commits.webkit.org/248147@main>

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