Bug 214973 - Add support for MediaRecorder bitrate options
Summary: Add support for MediaRecorder bitrate options
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks: 85851
  Show dependency treegraph
 
Reported: 2020-07-30 09:11 PDT by youenn fablet
Modified: 2020-08-25 08:48 PDT (History)
11 users (show)

See Also:


Attachments
Patch (66.84 KB, patch)
2020-08-03 07:37 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (52.47 KB, patch)
2020-08-03 10:09 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (52.51 KB, patch)
2020-08-04 05:34 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (52.80 KB, patch)
2020-08-06 02:23 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Fixing nullptr crashes (53.01 KB, patch)
2020-08-24 07:35 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 2020-07-30 09:11:01 PDT
Add support for MediaRecorder bitrate options
Comment 1 youenn fablet 2020-08-03 07:37:32 PDT
Created attachment 405827 [details]
Patch
Comment 2 youenn fablet 2020-08-03 10:09:39 PDT
Created attachment 405847 [details]
Patch
Comment 3 Eric Carlson 2020-08-03 11:59:34 PDT
Comment on attachment 405847 [details]
Patch

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

> Source/WebCore/platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:70
> +    m_outputBitRate = bitRate;

Shouldn't we limit this to the bitrates we support, or at least log an error if passed open we don't support?

> Source/WebCore/platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:196
> +    converterCleanup.release();

Is this manual release necessary?

> Source/WebCore/platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:452
> +            // FIXME: Maybe we should error the media recorder if we are not able to get a correct converter.

We should at least log and error, to the JS console if possible.
Comment 4 youenn fablet 2020-08-04 05:33:28 PDT
(In reply to Eric Carlson from comment #3)
> Comment on attachment 405847 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=405847&action=review
> 
> > Source/WebCore/platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:70
> > +    m_outputBitRate = bitRate;
> 
> Shouldn't we limit this to the bitrates we support, or at least log an error
> if passed open we don't support?

I added clamping and release logging.
I think we should add JS logs as well but this might be best done when adding the options getters.

> 
> > Source/WebCore/platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:196
> > +    converterCleanup.release();
> 
> Is this manual release necessary?

Yes, I'll rename converterCleanup to make it clearer.

> > Source/WebCore/platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:452
> > +            // FIXME: Maybe we should error the media recorder if we are not able to get a correct converter.
> 
> We should at least log and error, to the JS console if possible.

Difficult as is, as this is platform code but will do when implementing getters.
Comment 5 youenn fablet 2020-08-04 05:34:21 PDT
Created attachment 405915 [details]
Patch
Comment 6 youenn fablet 2020-08-04 08:55:50 PDT
win test failure unrelated.
Comment 7 youenn fablet 2020-08-05 13:57:42 PDT
ping review
Comment 8 Eric Carlson 2020-08-05 14:13:27 PDT
Comment on attachment 405915 [details]
Patch

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

> Source/WebCore/platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:102
> +    m_outputBitRate = bitRate;

It seems like we should log here if we don't support bitrate as well as in outputBitRate(), since this is called directly with the value in the options dictionary.
Comment 9 youenn fablet 2020-08-06 02:23:52 PDT
Created attachment 406079 [details]
Patch for landing
Comment 10 EWS 2020-08-06 08:25:44 PDT
Committed r265328: <https://trac.webkit.org/changeset/265328>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 406079 [details].
Comment 11 Radar WebKit Bug Importer 2020-08-06 08:26:17 PDT
<rdar://problem/66627900>
Comment 12 Truitt Savell 2020-08-06 10:32:24 PDT
Reverted r265328 for reason:

Broke 17 MediaRecorder tests.

Committed r265335: <https://trac.webkit.org/changeset/265335>
Comment 13 youenn fablet 2020-08-24 07:35:18 PDT
Created attachment 407102 [details]
Fixing nullptr crashes
Comment 14 EWS 2020-08-24 11:40:34 PDT
commit-queue failed to commit attachment 407102 [details] to WebKit repository.
Comment 15 EWS 2020-08-25 08:48:35 PDT
Committed r266116: <https://trac.webkit.org/changeset/266116>

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