summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarish Mahendrakar <hmahendrakar@google.com>2023-10-24 17:47:04 +0000
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2023-12-12 23:30:05 +0000
commitbb68e9ae9b1154894faaba7df5be76d193dbd319 (patch)
treeec489b5de0f1f4732953e74de228d707b48b983d
parent58d5debefe822f890b2ead71adfbfbb97b163b7e (diff)
downloadav-bb68e9ae9b1154894faaba7df5be76d193dbd319.tar.gz
Enable dav1d decoder as another av1 decoder
This CL enables c2 plugin for dav1d decoder but still keeps the current gav1 decoder as default createCodecByName() with "c2.android.av1-dav1d.decoder" can be used to pick dav1d c2 decoder. Bug: 289716589 Test: stagefright -s av1.webm -N c2.android.av1-dav1d.decoder (cherry picked from https://android-review.googlesource.com/q/commit:f3b4d443768238e750d1617c6ec8bef8bcf5fa61) Merged-In: Ia76f781f5046d51c78f851730789a62d8089e122 Change-Id: Ia76f781f5046d51c78f851730789a62d8089e122
-rw-r--r--media/codec2/components/dav1d/Android.bp13
-rw-r--r--media/codec2/vndk/C2Store.cpp1
-rw-r--r--media/libstagefright/data/media_codecs_sw.xml18
-rw-r--r--media/module/codecserviceregistrant/Android.bp1
4 files changed, 22 insertions, 11 deletions
diff --git a/media/codec2/components/dav1d/Android.bp b/media/codec2/components/dav1d/Android.bp
index c9387dd0a5..d549ccbe61 100644
--- a/media/codec2/components/dav1d/Android.bp
+++ b/media/codec2/components/dav1d/Android.bp
@@ -9,8 +9,6 @@ package {
cc_library {
name: "libcodec2_soft_av1dec_dav1d",
- // TODO: b/277797541 - enable once ready
- enabled: false,
defaults: [
"libcodec2_soft-defaults",
@@ -19,19 +17,12 @@ cc_library {
],
cflags: [
- "-DCODECNAME=\"c2.android.dav1d-av1.decoder\"",
+ "-DCODECNAME=\"c2.android.av1-dav1d.decoder\"",
"-Wno-unused-variable",
],
srcs: ["C2SoftDav1dDec.cpp", "C2SoftDav1dDump.cpp"],
static_libs: [
- "libdav1d_8bit",
- "libdav1d_16bit",
+ "libdav1d",
],
-
- apex_available: [
- "//apex_available:platform",
- "com.android.media.swcodec",
- ],
-
}
diff --git a/media/codec2/vndk/C2Store.cpp b/media/codec2/vndk/C2Store.cpp
index f6f97daae7..61aafa7465 100644
--- a/media/codec2/vndk/C2Store.cpp
+++ b/media/codec2/vndk/C2Store.cpp
@@ -1081,6 +1081,7 @@ C2PlatformComponentStore::C2PlatformComponentStore()
emplace("libcodec2_soft_amrwbenc.so");
//emplace("libcodec2_soft_av1dec_aom.so"); // deprecated for the gav1 implementation
emplace("libcodec2_soft_av1dec_gav1.so");
+ emplace("libcodec2_soft_av1dec_dav1d.so");
emplace("libcodec2_soft_av1enc.so");
emplace("libcodec2_soft_avcdec.so");
emplace("libcodec2_soft_avcenc.so");
diff --git a/media/libstagefright/data/media_codecs_sw.xml b/media/libstagefright/data/media_codecs_sw.xml
index d3fd790fdd..24956c0274 100644
--- a/media/libstagefright/data/media_codecs_sw.xml
+++ b/media/libstagefright/data/media_codecs_sw.xml
@@ -218,6 +218,24 @@
<Feature name="adaptive-playback" />
<Attribute name="software-codec" />
</MediaCodec>
+ <MediaCodec name="c2.android.av1-dav1d.decoder" type="video/av01" variant="slow-cpu,!slow-cpu" rank="1024">
+ <Limit name="alignment" value="1x1" />
+ <Limit name="block-size" value="16x16" />
+ <Variant name="!slow-cpu">
+ <Limit name="size" min="2x2" max="2048x2048" />
+ <Limit name="block-count" range="1-8192" /> <!-- max 2048x1024 -->
+ <Limit name="blocks-per-second" range="1-245760" />
+ <Limit name="bitrate" range="1-40000000" />
+ </Variant>
+ <Variant name="slow-cpu">
+ <Limit name="size" min="2x2" max="1280x1280" />
+ <Limit name="block-count" range="1-3600" /> <!-- max 1280x720 -->
+ <Limit name="blocks-per-second" range="1-108000" />
+ <Limit name="bitrate" range="1-5000000" />
+ </Variant>
+ <Feature name="adaptive-playback" />
+ <Attribute name="software-codec" />
+ </MediaCodec>
<MediaCodec name="c2.android.mpeg2.decoder" type="video/mpeg2" domain="tv">
<Alias name="OMX.google.mpeg2.decoder" />
<!-- profiles and levels: ProfileMain : LevelHL -->
diff --git a/media/module/codecserviceregistrant/Android.bp b/media/module/codecserviceregistrant/Android.bp
index f3a1723d99..53d2e22198 100644
--- a/media/module/codecserviceregistrant/Android.bp
+++ b/media/module/codecserviceregistrant/Android.bp
@@ -61,6 +61,7 @@ cc_library {
"libcodec2_soft_vp9dec",
// "libcodec2_soft_av1dec_aom", // replaced by the gav1 implementation
"libcodec2_soft_av1dec_gav1",
+ "libcodec2_soft_av1dec_dav1d",
"libcodec2_soft_av1enc",
"libcodec2_soft_vp8enc",
"libcodec2_soft_vp9enc",