mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Add H265 to VideoCodecMimeType
This enables testing HW H265 codecs on devices where the support is available. Bug: b/261160916, webrtc:14852 Change-Id: I32d102fcf483ea4ba46d6f5161342dbb584e7cc9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298040 Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39591}
This commit is contained in:
parent
63643357b4
commit
0af2bc639a
6 changed files with 16 additions and 11 deletions
|
@ -581,7 +581,7 @@ TEST_P(SpatialQualityTest, DISABLED_SpatialQuality) {
|
|||
INSTANTIATE_TEST_SUITE_P(
|
||||
All,
|
||||
SpatialQualityTest,
|
||||
Combine(Values("AV1", "VP9", "VP8", "H264"),
|
||||
Combine(Values("AV1", "VP9", "VP8", "H264", "H265"),
|
||||
#if defined(WEBRTC_ANDROID)
|
||||
Values("builtin", "mediacodec"),
|
||||
#else
|
||||
|
@ -663,7 +663,7 @@ TEST_P(BitrateAdaptationTest, DISABLED_BitrateAdaptation) {
|
|||
|
||||
INSTANTIATE_TEST_SUITE_P(All,
|
||||
BitrateAdaptationTest,
|
||||
Combine(Values("AV1", "VP9", "VP8", "H264"),
|
||||
Combine(Values("AV1", "VP9", "VP8", "H264", "H265"),
|
||||
#if defined(WEBRTC_ANDROID)
|
||||
Values("builtin", "mediacodec"),
|
||||
#else
|
||||
|
@ -737,7 +737,7 @@ TEST_P(FramerateAdaptationTest, DISABLED_FramerateAdaptation) {
|
|||
|
||||
INSTANTIATE_TEST_SUITE_P(All,
|
||||
FramerateAdaptationTest,
|
||||
Combine(Values("AV1", "VP9", "VP8", "H264"),
|
||||
Combine(Values("AV1", "VP9", "VP8", "H264", "H265"),
|
||||
#if defined(WEBRTC_ANDROID)
|
||||
Values("builtin", "mediacodec"),
|
||||
#else
|
||||
|
|
|
@ -132,9 +132,10 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
|
|||
public VideoCodecInfo[] getSupportedCodecs() {
|
||||
List<VideoCodecInfo> supportedCodecInfos = new ArrayList<VideoCodecInfo>();
|
||||
// Generate a list of supported codecs in order of preference:
|
||||
// VP8, VP9, H264 (high profile), H264 (baseline profile) and AV1.
|
||||
for (VideoCodecMimeType type : new VideoCodecMimeType[] {VideoCodecMimeType.VP8,
|
||||
VideoCodecMimeType.VP9, VideoCodecMimeType.H264, VideoCodecMimeType.AV1}) {
|
||||
// VP8, VP9, H264 (high profile), H264 (baseline profile), AV1 and H265.
|
||||
for (VideoCodecMimeType type :
|
||||
new VideoCodecMimeType[] {VideoCodecMimeType.VP8, VideoCodecMimeType.VP9,
|
||||
VideoCodecMimeType.H264, VideoCodecMimeType.AV1, VideoCodecMimeType.H265}) {
|
||||
MediaCodecInfo codec = findCodecForType(type);
|
||||
if (codec != null) {
|
||||
String name = type.name();
|
||||
|
@ -201,6 +202,7 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
|
|||
return isHardwareSupportedInCurrentSdkVp9(info);
|
||||
case H264:
|
||||
return isHardwareSupportedInCurrentSdkH264(info);
|
||||
case H265:
|
||||
case AV1:
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ class HardwareVideoEncoder implements VideoEncoder {
|
|||
* intervals, and bitrateAdjuster.
|
||||
*
|
||||
* @param codecName the hardware codec implementation to use
|
||||
* @param codecType the type of the given video codec (eg. VP8, VP9, H264 or AV1)
|
||||
* @param codecType the type of the given video codec (eg. VP8, VP9, H264, H265, AV1)
|
||||
* @param surfaceColorFormat color format for surface mode or null if not available
|
||||
* @param yuvColorFormat color format for bytebuffer mode
|
||||
* @param keyFrameIntervalSec interval in seconds between key frames; used to initialize the codec
|
||||
|
|
|
@ -85,6 +85,7 @@ class MediaCodecUtils {
|
|||
case VP8:
|
||||
case VP9:
|
||||
case AV1:
|
||||
case H265:
|
||||
return new HashMap<String, String>();
|
||||
case H264:
|
||||
return H264Utils.getDefaultH264Params(highProfile);
|
||||
|
|
|
@ -63,9 +63,10 @@ class MediaCodecVideoDecoderFactory implements VideoDecoderFactory {
|
|||
public VideoCodecInfo[] getSupportedCodecs() {
|
||||
List<VideoCodecInfo> supportedCodecInfos = new ArrayList<VideoCodecInfo>();
|
||||
// Generate a list of supported codecs in order of preference:
|
||||
// VP8, VP9, H264 (high profile), and H264 (baseline profile).
|
||||
for (VideoCodecMimeType type : new VideoCodecMimeType[] {VideoCodecMimeType.VP8,
|
||||
VideoCodecMimeType.VP9, VideoCodecMimeType.H264, VideoCodecMimeType.AV1}) {
|
||||
// VP8, VP9, H264 (high profile), H264 (baseline profile), AV1 and H265.
|
||||
for (VideoCodecMimeType type :
|
||||
new VideoCodecMimeType[] {VideoCodecMimeType.VP8, VideoCodecMimeType.VP9,
|
||||
VideoCodecMimeType.H264, VideoCodecMimeType.AV1, VideoCodecMimeType.H265}) {
|
||||
MediaCodecInfo codec = findCodecForType(type);
|
||||
if (codec != null) {
|
||||
String name = type.name();
|
||||
|
|
|
@ -15,7 +15,8 @@ enum VideoCodecMimeType {
|
|||
VP8("video/x-vnd.on2.vp8"),
|
||||
VP9("video/x-vnd.on2.vp9"),
|
||||
H264("video/avc"),
|
||||
AV1("video/av01");
|
||||
AV1("video/av01"),
|
||||
H265("video/hevc");
|
||||
|
||||
private final String mimeType;
|
||||
|
||||
|
|
Loading…
Reference in a new issue