mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +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(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
All,
|
All,
|
||||||
SpatialQualityTest,
|
SpatialQualityTest,
|
||||||
Combine(Values("AV1", "VP9", "VP8", "H264"),
|
Combine(Values("AV1", "VP9", "VP8", "H264", "H265"),
|
||||||
#if defined(WEBRTC_ANDROID)
|
#if defined(WEBRTC_ANDROID)
|
||||||
Values("builtin", "mediacodec"),
|
Values("builtin", "mediacodec"),
|
||||||
#else
|
#else
|
||||||
|
@ -663,7 +663,7 @@ TEST_P(BitrateAdaptationTest, DISABLED_BitrateAdaptation) {
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(All,
|
INSTANTIATE_TEST_SUITE_P(All,
|
||||||
BitrateAdaptationTest,
|
BitrateAdaptationTest,
|
||||||
Combine(Values("AV1", "VP9", "VP8", "H264"),
|
Combine(Values("AV1", "VP9", "VP8", "H264", "H265"),
|
||||||
#if defined(WEBRTC_ANDROID)
|
#if defined(WEBRTC_ANDROID)
|
||||||
Values("builtin", "mediacodec"),
|
Values("builtin", "mediacodec"),
|
||||||
#else
|
#else
|
||||||
|
@ -737,7 +737,7 @@ TEST_P(FramerateAdaptationTest, DISABLED_FramerateAdaptation) {
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(All,
|
INSTANTIATE_TEST_SUITE_P(All,
|
||||||
FramerateAdaptationTest,
|
FramerateAdaptationTest,
|
||||||
Combine(Values("AV1", "VP9", "VP8", "H264"),
|
Combine(Values("AV1", "VP9", "VP8", "H264", "H265"),
|
||||||
#if defined(WEBRTC_ANDROID)
|
#if defined(WEBRTC_ANDROID)
|
||||||
Values("builtin", "mediacodec"),
|
Values("builtin", "mediacodec"),
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -132,9 +132,10 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
|
||||||
public VideoCodecInfo[] getSupportedCodecs() {
|
public VideoCodecInfo[] getSupportedCodecs() {
|
||||||
List<VideoCodecInfo> supportedCodecInfos = new ArrayList<VideoCodecInfo>();
|
List<VideoCodecInfo> supportedCodecInfos = new ArrayList<VideoCodecInfo>();
|
||||||
// Generate a list of supported codecs in order of preference:
|
// Generate a list of supported codecs in order of preference:
|
||||||
// VP8, VP9, H264 (high profile), H264 (baseline profile) and AV1.
|
// VP8, VP9, H264 (high profile), H264 (baseline profile), AV1 and H265.
|
||||||
for (VideoCodecMimeType type : new VideoCodecMimeType[] {VideoCodecMimeType.VP8,
|
for (VideoCodecMimeType type :
|
||||||
VideoCodecMimeType.VP9, VideoCodecMimeType.H264, VideoCodecMimeType.AV1}) {
|
new VideoCodecMimeType[] {VideoCodecMimeType.VP8, VideoCodecMimeType.VP9,
|
||||||
|
VideoCodecMimeType.H264, VideoCodecMimeType.AV1, VideoCodecMimeType.H265}) {
|
||||||
MediaCodecInfo codec = findCodecForType(type);
|
MediaCodecInfo codec = findCodecForType(type);
|
||||||
if (codec != null) {
|
if (codec != null) {
|
||||||
String name = type.name();
|
String name = type.name();
|
||||||
|
@ -201,6 +202,7 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
|
||||||
return isHardwareSupportedInCurrentSdkVp9(info);
|
return isHardwareSupportedInCurrentSdkVp9(info);
|
||||||
case H264:
|
case H264:
|
||||||
return isHardwareSupportedInCurrentSdkH264(info);
|
return isHardwareSupportedInCurrentSdkH264(info);
|
||||||
|
case H265:
|
||||||
case AV1:
|
case AV1:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ class HardwareVideoEncoder implements VideoEncoder {
|
||||||
* intervals, and bitrateAdjuster.
|
* intervals, and bitrateAdjuster.
|
||||||
*
|
*
|
||||||
* @param codecName the hardware codec implementation to use
|
* @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 surfaceColorFormat color format for surface mode or null if not available
|
||||||
* @param yuvColorFormat color format for bytebuffer mode
|
* @param yuvColorFormat color format for bytebuffer mode
|
||||||
* @param keyFrameIntervalSec interval in seconds between key frames; used to initialize the codec
|
* @param keyFrameIntervalSec interval in seconds between key frames; used to initialize the codec
|
||||||
|
|
|
@ -85,6 +85,7 @@ class MediaCodecUtils {
|
||||||
case VP8:
|
case VP8:
|
||||||
case VP9:
|
case VP9:
|
||||||
case AV1:
|
case AV1:
|
||||||
|
case H265:
|
||||||
return new HashMap<String, String>();
|
return new HashMap<String, String>();
|
||||||
case H264:
|
case H264:
|
||||||
return H264Utils.getDefaultH264Params(highProfile);
|
return H264Utils.getDefaultH264Params(highProfile);
|
||||||
|
|
|
@ -63,9 +63,10 @@ class MediaCodecVideoDecoderFactory implements VideoDecoderFactory {
|
||||||
public VideoCodecInfo[] getSupportedCodecs() {
|
public VideoCodecInfo[] getSupportedCodecs() {
|
||||||
List<VideoCodecInfo> supportedCodecInfos = new ArrayList<VideoCodecInfo>();
|
List<VideoCodecInfo> supportedCodecInfos = new ArrayList<VideoCodecInfo>();
|
||||||
// Generate a list of supported codecs in order of preference:
|
// Generate a list of supported codecs in order of preference:
|
||||||
// VP8, VP9, H264 (high profile), and H264 (baseline profile).
|
// VP8, VP9, H264 (high profile), H264 (baseline profile), AV1 and H265.
|
||||||
for (VideoCodecMimeType type : new VideoCodecMimeType[] {VideoCodecMimeType.VP8,
|
for (VideoCodecMimeType type :
|
||||||
VideoCodecMimeType.VP9, VideoCodecMimeType.H264, VideoCodecMimeType.AV1}) {
|
new VideoCodecMimeType[] {VideoCodecMimeType.VP8, VideoCodecMimeType.VP9,
|
||||||
|
VideoCodecMimeType.H264, VideoCodecMimeType.AV1, VideoCodecMimeType.H265}) {
|
||||||
MediaCodecInfo codec = findCodecForType(type);
|
MediaCodecInfo codec = findCodecForType(type);
|
||||||
if (codec != null) {
|
if (codec != null) {
|
||||||
String name = type.name();
|
String name = type.name();
|
||||||
|
|
|
@ -15,7 +15,8 @@ enum VideoCodecMimeType {
|
||||||
VP8("video/x-vnd.on2.vp8"),
|
VP8("video/x-vnd.on2.vp8"),
|
||||||
VP9("video/x-vnd.on2.vp9"),
|
VP9("video/x-vnd.on2.vp9"),
|
||||||
H264("video/avc"),
|
H264("video/avc"),
|
||||||
AV1("video/av01");
|
AV1("video/av01"),
|
||||||
|
H265("video/hevc");
|
||||||
|
|
||||||
private final String mimeType;
|
private final String mimeType;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue