Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3b4d443 authored by Harish Mahendrakar's avatar Harish Mahendrakar
Browse files

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

Change-Id: Ia76f781f5046d51c78f851730789a62d8089e122
parent 5675e331
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -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",
    ],

}
+1 −0
Original line number Diff line number Diff line
@@ -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");
+18 −0
Original line number Diff line number Diff line
@@ -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 -->
+1 −0
Original line number Diff line number Diff line
@@ -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",