Revert "Expose AV1 encoder&decoder from Android SDK."

This reverts commit fedd5029c584e9dc1352434b62a30cd8af2889d8.

Reason for revert: Speculative revert due to crashes in downstream tests on Android.

Original change's description:
> Expose AV1 encoder&decoder from Android SDK.
>
> Bug: None
> Change-Id: Ie32be36da498d4bed2a3cf51aa6abc8838e42da1
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212024
> Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
> Commit-Queue: Yura Yaroshevich <yura.yaroshevich@gmail.com>
> Cr-Commit-Position: refs/heads/master@{#33743}

TBR=alessiob@webrtc.org,mflodman@webrtc.org,yura.yaroshevich@gmail.com,xalep@webrtc.org

Change-Id: I76171087d1998b9d7573c2b86b1cf9ed65154bbf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215324
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33753}
This commit is contained in:
Björn Terelius
2021-04-16 07:40:09 +00:00
committed by Commit Bot
parent 220a252de6
commit dd36198ae8
16 changed files with 20 additions and 190 deletions

View File

@ -169,7 +169,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, or H264)
* @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

View File

@ -91,7 +91,6 @@ class MediaCodecUtils {
switch (type) {
case VP8:
case VP9:
case AV1:
return new HashMap<String, String>();
case H264:
return H264Utils.getDefaultH264Params(highProfile);

View File

@ -64,8 +64,8 @@ class MediaCodecVideoDecoderFactory implements VideoDecoderFactory {
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}) {
for (VideoCodecMimeType type : new VideoCodecMimeType[] {
VideoCodecMimeType.VP8, VideoCodecMimeType.VP9, VideoCodecMimeType.H264}) {
MediaCodecInfo codec = findCodecForType(type);
if (codec != null) {
String name = type.name();

View File

@ -14,8 +14,7 @@ package org.webrtc;
enum VideoCodecMimeType {
VP8("video/x-vnd.on2.vp8"),
VP9("video/x-vnd.on2.vp9"),
H264("video/avc"),
AV1("video/av01");
H264("video/avc");
private final String mimeType;

View File

@ -1,39 +0,0 @@
/*
* Copyright 2021 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <jni.h>
#include "modules/video_coding/codecs/av1/libaom_av1_decoder.h"
#include "modules/video_coding/codecs/av1/libaom_av1_encoder.h"
#include "sdk/android/generated_libaom_av1_jni/LibaomAv1Decoder_jni.h"
#include "sdk/android/generated_libaom_av1_jni/LibaomAv1Encoder_jni.h"
#include "sdk/android/src/jni/jni_helpers.h"
namespace webrtc {
namespace jni {
static jlong JNI_LibaomAv1Encoder_CreateEncoder(JNIEnv* jni) {
return jlongFromPointer(webrtc::CreateLibaomAv1Encoder().release());
}
static jboolean JNI_LibaomAv1Encoder_IsSupported(JNIEnv* jni) {
return webrtc::kIsLibaomAv1EncoderSupported;
}
static jlong JNI_LibaomAv1Decoder_CreateDecoder(JNIEnv* jni) {
return jlongFromPointer(webrtc::CreateLibaomAv1Decoder().release());
}
static jboolean JNI_LibaomAv1Decoder_IsSupported(JNIEnv* jni) {
return webrtc::kIsLibaomAv1DecoderSupported;
}
} // namespace jni
} // namespace webrtc

View File

@ -19,33 +19,18 @@ namespace jni {
SdpVideoFormat VideoCodecInfoToSdpVideoFormat(JNIEnv* jni,
const JavaRef<jobject>& j_info) {
std::string codecName =
JavaToNativeString(jni, Java_VideoCodecInfo_getName(jni, j_info));
std::string sdpCodecName;
if (codecName == "AV1") {
// TODO(yyaroshevich): Undo mapping once AV1 sdp name is standardized
sdpCodecName = "AV1X";
} else {
sdpCodecName = codecName;
}
return SdpVideoFormat(
sdpCodecName,
JavaToNativeString(jni, Java_VideoCodecInfo_getName(jni, j_info)),
JavaToNativeStringMap(jni, Java_VideoCodecInfo_getParams(jni, j_info)));
}
ScopedJavaLocalRef<jobject> SdpVideoFormatToVideoCodecInfo(
JNIEnv* jni,
const SdpVideoFormat& format) {
std::string codecName;
if (format.name == "AV1X" || format.name == "AV1") {
codecName = "AV1";
} else {
codecName = format.name;
}
ScopedJavaLocalRef<jobject> j_params =
NativeToJavaStringMap(jni, format.parameters);
return Java_VideoCodecInfo_Constructor(
jni, NativeToJavaString(jni, codecName), j_params);
jni, NativeToJavaString(jni, format.name), j_params);
}
} // namespace jni