Bug 233492

Summary: [GStreamer][WPE] Control on-disk multimedia buffering via the WPE_SHELL_DISABLE_MEDIA_DISK_CACHE environment variable
Product: WebKit Reporter: Enrique Ocaña <eocanha>
Component: MediaAssignee: Enrique Ocaña <eocanha>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, cgarcia, eric.carlson, ews-watchlist, glenn, gustavo, jer.noble, menard, philipj, pnormand, sergio, vjaquez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Enrique Ocaña 2021-11-25 05:03:24 PST
Embedded platforms often don't have a persistent storage suitable for repetitive writes (eg: caching media files may wear out a flash drive, and RAM memory is scarce enough to use a tmpfs for caching).

Those platforms need a way to disable on-disk caching. Metrological has been successfully using an environment variable for that purpose downstream since 2016. If that implementation is upstreamed, other WPE users can benefit from it.
Comment 1 Enrique Ocaña 2021-11-25 06:02:01 PST
Created attachment 445136 [details]
Patch
Comment 2 Xabier Rodríguez Calvar 2021-11-26 03:27:41 PST
Comment on attachment 445136 [details]
Patch

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

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:2565
> +    static bool computed = false;

Please, use std::once...
Comment 3 Enrique Ocaña 2021-11-26 12:00:25 PST
Comment on attachment 445136 [details]
Patch

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

>> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:2565
>> +    static bool computed = false;
> 
> Please, use std::once...

I've ended up using std::once_flag and std::call_once. They're very useful and I didn't know about them. Thanks!
Comment 4 Enrique Ocaña 2021-11-26 12:00:56 PST
Created attachment 445207 [details]
Patch
Comment 5 EWS 2021-11-29 06:32:30 PST
Committed r286210 (244592@main): <https://commits.webkit.org/244592@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 445207 [details].
Comment 6 Radar WebKit Bug Importer 2021-11-29 06:33:27 PST
<rdar://problem/85814319>