Closed Bug 1896538 Opened 2 years ago Closed 2 years ago

Explicitly check supported codec in FFmpegEncoderModule

Categories

(Core :: Audio/Video: Web Codecs, defect, P1)

Desktop
All
defect

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

(Depends on 1 open bug)

Details

Attachments

(2 files)

FFmpegEncoderModule<V>::Supports has two problems:

  1. SupportsCodec(aConfig.mCodec) != AV_CODEC_ID_NONE doesn't make sense. The SupportsCodec return a bool, so it shouldn't be compared with AV_CODEC_ID_NONE
  2. Even if GetFFmpegEncoderCodecId finds a AVCodecID, it doesn't guarantee we have the underlying encoder. We should query the underlying codec like what FFmpegDecoderModule does

The SupportsCodec returns a bool, so it shouldn't be compared with
AV_CODEC_ID_NONE.

This patch enhances the SupportsCodec function by explicitly verifying
the supported encoder within the FFmpegEncoderModule. Previously, the
function checked whether the CodecType could be mapped to an AVCodecID,
but this alone didn't guarantee the existence of the corresponding
encoder. Now, the patch ensures the existence of the encoder by directly
checking for it within the FFmpegEncoderModule.

Depends on D210251

Pushed by cchang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0e7b5608cab3 Remove unnecessary comparison in FFmpegEncoderModule::Supports r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/166e08b48e06 Enhance FFmpegEncoderModule's SupportsCodec check r=media-playback-reviewers,padenot
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: