Unity-Technologies / Unity-Technologies/com.unity.webrtc

[BUG]: Encoder/Decoder priority

Open
#1,023 2 comments 0 reactions 1 assignee View on GitHub

@karasusan is already working on this.

Since Mar 18, 2024.

bug
Dominant language
Assembly
Stars
852
Forks
238
PR merge metrics
No merged PRs in 30d

Description

Package version

3.0.0-pre.7

Environment
* OS: Not related to the bug
* Unity version: Not related to the bug
Steps To Reproduce

No reproduce. Just check the code in the current behaviour.

Current Behavior

https://github.com/Unity-Technologies/com.unity.webrtc/blob/main/Plugin~/WebRTCPlugin/UnityVideoEncoderFactory.cpp#L110-L119
https://github.com/Unity-Technologies/com.unity.webrtc/blob/main/Plugin~/WebRTCPlugin/UnityVideoEncoderFactory.h#L33
Here it uses a map factories to save the encoder implementations.
https://github.com/Unity-Technologies/com.unity.webrtc/blob/main/Plugin~/WebRTCPlugin/Codec/CreateVideoCodecFactory.h#L27-L40
It finds the first implementation support the format with the same codec.
The map is sorted by the key.
The order of the implementations will be, internal, mediacodec, nvcodec, videotoolbox.

Expected Behavior

The later 3 is hardware accelerated. I think that they should be prior.

I know that currently software h264 encoder is not built in the libwebrtc.
But I think the hardware encoders should be always prior.

Anything else?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.