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

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

release-request-10d85be7-ec19-4bdb-85e6-4ae4ac39c643-for-git_oc-dr1-release-40...

release-request-10d85be7-ec19-4bdb-85e6-4ae4ac39c643-for-git_oc-dr1-release-4050218 snap-temp-L98100000068575008

Change-Id: I251c3ea6c900b99117e5ae1e0a14e0296f8dc676
parents 17d01f5d 159db446
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_C_INCLUDES := \
	frameworks/av/media/libstagefright \
	frameworks/av/media/libstagefright/include \
	$(TOP)/frameworks/native/include/media/openmax \
	frameworks/native/include/media/openmax \
	external/jpeg

LOCAL_CFLAGS := -Werror -Wall
+13 −13
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        frameworks/av/media/libstagefright/include \
        $(TOP)/frameworks/native/include/media/openmax \
        frameworks/native/include/media/openmax \
        external/jpeg \

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
@@ -40,8 +40,8 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        $(TOP)/frameworks/native/include/media/openmax \
        $(TOP)/frameworks/native/include/media/hardware
        frameworks/native/include/media/openmax \
        frameworks/native/include/media/hardware

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall

@@ -64,8 +64,8 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        $(TOP)/frameworks/native/include/media/openmax \
        $(TOP)/frameworks/native/include/media/hardware
        frameworks/native/include/media/openmax \
        frameworks/native/include/media/hardware

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall

@@ -89,7 +89,7 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        $(TOP)/frameworks/native/include/media/openmax
        frameworks/native/include/media/openmax

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall

@@ -112,7 +112,7 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        $(TOP)/frameworks/native/include/media/openmax
        frameworks/native/include/media/openmax

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall

@@ -136,7 +136,7 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        $(TOP)/frameworks/native/include/media/openmax
        frameworks/native/include/media/openmax

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall

@@ -168,10 +168,10 @@ LOCAL_SHARED_LIBRARIES := \
        libRScpp \

LOCAL_C_INCLUDES:= \
        $(TOP)/frameworks/av/media/libstagefright \
        $(TOP)/frameworks/native/include/media/openmax \
        $(TOP)/frameworks/rs/cpp \
        $(TOP)/frameworks/rs \
        frameworks/av/media/libstagefright \
        frameworks/native/include/media/openmax \
        frameworks/rs/cpp \
        frameworks/rs \

intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
LOCAL_C_INCLUDES += $(intermediates)
@@ -203,7 +203,7 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_C_INCLUDES:= \
        frameworks/av/media/libstagefright \
        $(TOP)/frameworks/native/include/media/openmax
        frameworks/native/include/media/openmax

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall

+2 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <android/hardware/drm/1.0/IDrmPlugin.h>
#include <android/hardware/drm/1.0/types.h>
#include <android/hidl/manager/1.0/IServiceManager.h>
#include <hidl/ServiceManagement.h>

#include <media/DrmHal.h>
#include <media/DrmSessionClientInterface.h>
@@ -200,7 +201,7 @@ DrmHal::~DrmHal() {
Vector<sp<IDrmFactory>> DrmHal::makeDrmFactories() {
    Vector<sp<IDrmFactory>> factories;

    auto manager = ::IServiceManager::getService();
    auto manager = hardware::defaultServiceManager();

    if (manager != NULL) {
        manager->listByInterface(IDrmFactory::descriptor,
+1 −1
Original line number Diff line number Diff line
../../media/libstagefright/include
 No newline at end of file
../../media/libstagefright/include/media/stagefright/
 No newline at end of file
+24 −13
Original line number Diff line number Diff line
@@ -24,12 +24,11 @@
#include <aaudio/AAudio.h>

#define SAMPLE_RATE        48000
#define NUM_SECONDS        10
#define NUM_SECONDS        5
#define NANOS_PER_MICROSECOND ((int64_t)1000)
#define NANOS_PER_MILLISECOND (NANOS_PER_MICROSECOND * 1000)
#define NANOS_PER_SECOND      (NANOS_PER_MILLISECOND * 1000)

#define DECAY_FACTOR       0.999
#define MIN_FRAMES_TO_READ    48  /* arbitrary, 1 msec at 48000 Hz */

static const char *getSharingModeText(aaudio_sharing_mode_t mode) {
@@ -58,7 +57,13 @@ int main(int argc, char **argv)
    const aaudio_audio_format_t requestedDataFormat = AAUDIO_FORMAT_PCM_I16;
    aaudio_audio_format_t actualDataFormat;

    const int requestedInputChannelCount = 1; // Can affect whether we get a FAST path.

    //aaudio_performance_mode_t requestedPerformanceMode = AAUDIO_PERFORMANCE_MODE_NONE;
    const aaudio_performance_mode_t requestedPerformanceMode = AAUDIO_PERFORMANCE_MODE_LOW_LATENCY;
    //aaudio_performance_mode_t requestedPerformanceMode = AAUDIO_PERFORMANCE_MODE_POWER_SAVING;
    const aaudio_sharing_mode_t requestedSharingMode = AAUDIO_SHARING_MODE_SHARED;
    //const aaudio_sharing_mode_t requestedSharingMode = AAUDIO_SHARING_MODE_EXCLUSIVE;
    aaudio_sharing_mode_t actualSharingMode;

    AAudioStreamBuilder *aaudioBuilder = nullptr;
@@ -89,6 +94,8 @@ int main(int argc, char **argv)
    AAudioStreamBuilder_setDirection(aaudioBuilder, AAUDIO_DIRECTION_INPUT);
    AAudioStreamBuilder_setFormat(aaudioBuilder, requestedDataFormat);
    AAudioStreamBuilder_setSharingMode(aaudioBuilder, requestedSharingMode);
    AAudioStreamBuilder_setPerformanceMode(aaudioBuilder, requestedPerformanceMode);
    AAudioStreamBuilder_setChannelCount(aaudioBuilder, requestedInputChannelCount);

    // Create an AAudioStream using the Builder.
    result = AAudioStreamBuilder_openStream(aaudioBuilder, &aaudioStream);
@@ -124,6 +131,9 @@ int main(int argc, char **argv)
    // TODO handle other data formats
    assert(actualDataFormat == AAUDIO_FORMAT_PCM_I16);

    printf("PerformanceMode: requested = %d, actual = %d\n", requestedPerformanceMode,
           AAudioStream_getPerformanceMode(aaudioStream));

    // Allocate a buffer for the audio data.
    data = new(std::nothrow) int16_t[framesPerRead * actualSamplesPerFrame];
    if (data == nullptr) {
@@ -143,27 +153,27 @@ int main(int argc, char **argv)
    state = AAudioStream_getState(aaudioStream);
    printf("after start, state = %s\n", AAudio_convertStreamStateToText(state));

    // Play for a while.
    // Record for a while.
    framesToRecord = actualSampleRate * NUM_SECONDS;
    framesLeft = framesToRecord;
    while (framesLeft > 0) {
        // Read audio data from the stream.
        int64_t timeoutNanos = 100 * NANOS_PER_MILLISECOND;
        const int64_t timeoutNanos = 100 * NANOS_PER_MILLISECOND;
        int minFrames = (framesToRecord < framesPerRead) ? framesToRecord : framesPerRead;
        int actual = AAudioStream_read(aaudioStream, data, minFrames, timeoutNanos);
        if (actual < 0) {
            fprintf(stderr, "ERROR - AAudioStream_read() returned %zd\n", actual);
            fprintf(stderr, "ERROR - AAudioStream_read() returned %d\n", actual);
            result = actual;
            goto finish;
        } else if (actual == 0) {
            fprintf(stderr, "WARNING - AAudioStream_read() returned %zd\n", actual);
            fprintf(stderr, "WARNING - AAudioStream_read() returned %d\n", actual);
            goto finish;
        }
        framesLeft -= actual;

        // Peak follower.
        // Peak finder.
        for (int frameIndex = 0; frameIndex < actual; frameIndex++) {
            float sample = data[frameIndex * actualSamplesPerFrame] * (1.0/32768);
            peakLevel *= DECAY_FACTOR;
            if (sample > peakLevel) {
                peakLevel = sample;
            }
@@ -177,6 +187,7 @@ int main(int argc, char **argv)
                printf("*");
            }
            printf("\n");
            peakLevel = 0.0;
        }
    }

@@ -184,9 +195,9 @@ int main(int argc, char **argv)
    printf("AAudioStream_getXRunCount %d\n", xRunCount);

finish:
    delete[] data;
    AAudioStream_close(aaudioStream);
    AAudioStreamBuilder_delete(aaudioBuilder);
    delete[] data;
    printf("exiting - AAudio result = %d = %s\n", result, AAudio_convertResultToText(result));
    return (result != AAUDIO_OK) ? EXIT_FAILURE : EXIT_SUCCESS;
}
Loading