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

Commit e87d0b25 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5422062 from fc332471 to qt-release

Change-Id: I738754def3672e1e434dfb6efd91db46bfd20f88
parents 07b54f44 fc332471
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ namespace.default.links = platform
# namespace.default.link.platform.shared_libs  = %LLNDK_LIBRARIES%
# namespace.default.link.platform.shared_libs += %SANITIZER_RUNTIME_LIBRARIES%
namespace.default.link.platform.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libclang_rt.asan-aarch64-android.so:libclang_rt.asan-arm-android.so:libclang_rt.hwasan-aarch64-android.so:libclang_rt.asan-i686-android.so:libclang_rt.asan-x86_64-android.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libneuralnetworks.so:libsync.so:libvndksupport.so:libvulkan.so
# FIXME: b/129552044
namespace.default.link.platform.shared_libs += libz.so

###############################################################################
# "platform" namespace
+1 −1
Original line number Diff line number Diff line
{
  "name": "com.android.media",
  "version": 1
  "version": 200000000
}
+1 −1
Original line number Diff line number Diff line
{
  "name": "com.android.media.swcodec",
  "version": 1
  "version": 200000000
}
+3 −2
Original line number Diff line number Diff line
@@ -40,7 +40,8 @@
// V0.4.01 = add -h hang option
//           fix -n option to set output buffer for -tm
//           plot first glitch
#define APP_VERSION             "0.4.01"
// V0.4.02 = allow -n0 for minimal buffer size
#define APP_VERSION             "0.4.02"

// Tag for machine readable results as property = value pairs
#define RESULT_TAG              "RESULT: "
@@ -535,7 +536,7 @@ int main(int argc, const char **argv)
    printf("INPUT  stream ----------------------------------------\n");
    // Use different parameters for the input.
    argParser.setDeviceId(requestedInputDeviceId);
    argParser.setNumberOfBursts(AAUDIO_UNSPECIFIED);
    argParser.setNumberOfBursts(AAudioParameters::kDefaultNumberOfBursts);
    argParser.setFormat(requestedInputFormat);
    argParser.setPerformanceMode(inputPerformanceLevel);
    argParser.setChannelCount(requestedInputChannelCount);
+77 −6
Original line number Diff line number Diff line
@@ -36,11 +36,14 @@ static void (*s_setContentType)(AAudioStreamBuilder* builder,
                                aaudio_content_type_t contentType) = nullptr;
static void (*s_setInputPreset)(AAudioStreamBuilder* builder,
                                aaudio_input_preset_t inputPreset) = nullptr;
static void (*s_setAllowedCapturePolicy)(AAudioStreamBuilder* builder,
                                          aaudio_allowed_capture_policy_t usage) = nullptr;

static bool s_loadAttempted = false;
static aaudio_usage_t (*s_getUsage)(AAudioStream *stream) = nullptr;
static aaudio_content_type_t (*s_getContentType)(AAudioStream *stream) = nullptr;
static aaudio_input_preset_t (*s_getInputPreset)(AAudioStream *stream) = nullptr;
static aaudio_allowed_capture_policy_t (*s_getAllowedCapturePolicy)(AAudioStream *stream) = nullptr;

// Link to test functions in shared library.
static void loadFutureFunctions() {
@@ -61,6 +64,10 @@ static void loadFutureFunctions() {
                dlsym(handle, "AAudioStreamBuilder_setInputPreset");
        if (s_setInputPreset == nullptr) goto error;

        s_setAllowedCapturePolicy = (void (*)(AAudioStreamBuilder *, aaudio_input_preset_t))
                dlsym(handle, "AAudioStreamBuilder_setAllowedCapturePolicy");
        if (s_setAllowedCapturePolicy == nullptr) goto error;

        s_getUsage = (aaudio_usage_t (*)(AAudioStream *))
                dlsym(handle, "AAudioStream_getUsage");
        if (s_getUsage == nullptr) goto error;
@@ -72,6 +79,10 @@ static void loadFutureFunctions() {
        s_getInputPreset = (aaudio_input_preset_t (*)(AAudioStream *))
                dlsym(handle, "AAudioStream_getInputPreset");
        if (s_getInputPreset == nullptr) goto error;

        s_getAllowedCapturePolicy = (aaudio_input_preset_t (*)(AAudioStream *))
                dlsym(handle, "AAudioStream_getAllowedCapturePolicy");
        if (s_getAllowedCapturePolicy == nullptr) goto error;
    }
    return;

@@ -169,6 +180,14 @@ public:
        mInputPreset = inputPreset;
    }

    aaudio_allowed_capture_policy_t getAllowedCapturePolicy() const {
        return mAllowedCapturePolicy;
    }

    void setAllowedCapturePolicy(aaudio_allowed_capture_policy_t policy) {
        mAllowedCapturePolicy = policy;
    }

    int32_t getDeviceId() const {
        return mDeviceId;
    }
@@ -223,8 +242,17 @@ public:
        } else if (mUsage != AAUDIO_UNSPECIFIED){
            printf("WARNING: setInputPreset not supported");
        }

        // Call Q functions if supported.
        if (s_setAllowedCapturePolicy != nullptr) {
            s_setAllowedCapturePolicy(builder, mAllowedCapturePolicy);
        } else if (mAllowedCapturePolicy != AAUDIO_UNSPECIFIED){
            printf("WARNING: setAllowedCapturePolicy not supported");
        }
    }

    static constexpr int32_t   kDefaultNumberOfBursts = 2;

private:
    int32_t                    mChannelCount    = AAUDIO_UNSPECIFIED;
    aaudio_format_t            mFormat          = AAUDIO_FORMAT_UNSPECIFIED;
@@ -238,8 +266,9 @@ private:
    aaudio_usage_t             mUsage           = AAUDIO_UNSPECIFIED;
    aaudio_content_type_t      mContentType     = AAUDIO_UNSPECIFIED;
    aaudio_input_preset_t      mInputPreset     = AAUDIO_UNSPECIFIED;
    aaudio_allowed_capture_policy_t mAllowedCapturePolicy     = AAUDIO_UNSPECIFIED;

    int32_t                    mNumberOfBursts  = AAUDIO_UNSPECIFIED;
    int32_t                    mNumberOfBursts  = kDefaultNumberOfBursts;
    int32_t                    mFramesPerCallback = AAUDIO_UNSPECIFIED;
};

@@ -267,6 +296,9 @@ public:
                case 'c':
                    setChannelCount(atoi(&arg[2]));
                    break;
                case 'C':
                    setAllowedCapturePolicy(parseAllowedCapturePolicy(arg[2]));
                    break;
                case 'd':
                    setDeviceId(atoi(&arg[2]));
                    break;
@@ -341,6 +373,10 @@ public:
        printf("      Default values are UNSPECIFIED unless otherwise stated.\n");
        printf("      -b{bufferCapacity} frames\n");
        printf("      -c{channels} for example 2 for stereo\n");
        printf("      -C{a|s|n} set playback capture policy\n");
        printf("          a = _ALL (default)\n");
        printf("          s = _SYSTEM\n");
        printf("          n = _NONE\n");
        printf("      -d{deviceId} default is %d\n", AAUDIO_UNSPECIFIED);
        printf("      -f{0|1|2} set format\n");
        printf("          0 = UNSPECIFIED\n");
@@ -352,7 +388,7 @@ public:
        printf("          1 = _NEVER, never use MMAP\n");
        printf("          2 = _AUTO, use MMAP if available, default for -m with no number\n");
        printf("          3 = _ALWAYS, use MMAP or fail\n");
        printf("      -n{numberOfBursts} for setBufferSize\n");
        printf("      -n{numberOfBursts} for setBufferSize, default %d\n", kDefaultNumberOfBursts);
        printf("      -p{performanceMode} set output AAUDIO_PERFORMANCE_MODE*, default NONE\n");
        printf("          n for _NONE\n");
        printf("          l for _LATENCY\n");
@@ -365,6 +401,25 @@ public:
        printf("      -z{callbackSize} or block size, in frames, default = 0\n");
    }

    static aaudio_performance_mode_t parseAllowedCapturePolicy(char c) {
        aaudio_allowed_capture_policy_t policy = AAUDIO_ALLOW_CAPTURE_BY_ALL;
        switch (c) {
            case 'a':
                policy = AAUDIO_ALLOW_CAPTURE_BY_ALL;
                break;
            case 's':
                policy = AAUDIO_ALLOW_CAPTURE_BY_SYSTEM;
                break;
            case 'n':
                policy = AAUDIO_ALLOW_CAPTURE_BY_NONE;
                break;
            default:
                printf("ERROR: invalid playback capture policy %c\n", c);
                break;
        }
        return policy;
    }

    static aaudio_performance_mode_t parsePerformanceMode(char c) {
        aaudio_performance_mode_t mode = AAUDIO_PERFORMANCE_MODE_NONE;
        switch (c) {
@@ -407,17 +462,28 @@ public:
               getFormat(), AAudioStream_getFormat(stream));

        int32_t framesPerBurst = AAudioStream_getFramesPerBurst(stream);
        int32_t sizeFrames = AAudioStream_getBufferSizeInFrames(stream);
        printf("  Buffer:       burst     = %d\n", framesPerBurst);

        int32_t sizeFrames = AAudioStream_getBufferSizeInFrames(stream);
        if (framesPerBurst > 0) {
            printf("  Buffer:       size      = %d = (%d * %d) + %d\n",
            int32_t requestedSize = getNumberOfBursts() * framesPerBurst;
            printf("  BufferSize:   requested = %4d, actual = %4d = (%d * %d) + %d\n",
                   requestedSize,
                   sizeFrames,
                   (sizeFrames / framesPerBurst),
                   framesPerBurst,
                   (sizeFrames % framesPerBurst));
        } else {
             printf("  BufferSize:    %d\n", sizeFrames);
        }
        printf("  Capacity:     requested = %d, actual = %d\n", getBufferCapacity(),
               AAudioStream_getBufferCapacityInFrames(stream));

        int32_t capacityFrames = AAudioStream_getBufferCapacityInFrames(stream);
        printf("  Capacity:     requested = %4d, actual = %4d = (%d * %d) + %d\n",
               getBufferCapacity(),
               capacityFrames,
               (capacityFrames / framesPerBurst),
               framesPerBurst,
               (capacityFrames % framesPerBurst));

        printf("  CallbackSize: requested = %d, actual = %d\n", getFramesPerCallback(),
               AAudioStream_getFramesPerDataCallback(stream));
@@ -449,6 +515,11 @@ public:
        printf("  Is MMAP used? %s\n", AAudioStream_isMMapUsed(stream)
               ? "yes" : "no");

        if (s_getAllowedCapturePolicy != nullptr) {
            printf("  ContentType:  requested = %d, actual = %d\n",
                   getAllowedCapturePolicy(), s_getAllowedCapturePolicy(stream));
        }

    }

    int32_t getDurationSeconds() const {
Loading