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

Commit f5df0cc1 authored by Linus Nilsson's avatar Linus Nilsson
Browse files

Transcoder: Run all transcoder threads on background priority.

Bug: 183751395
Test: build_and_run_all_unit_tests.sh
Change-Id: I4e30e3fda4b9ed8773991d7d4bff5229df57b52d
parent 22df0f21
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <media/MediaSampleWriter.h>
#include <media/NdkMediaMuxer.h>
#include <sys/prctl.h>
#include <utils/AndroidThreads.h>

namespace android {

@@ -174,6 +175,7 @@ bool MediaSampleWriter::start() {

    mState = STARTED;
    std::thread([this] {
        androidSetThreadPriority(0 /* tid (0 = current) */, ANDROID_PRIORITY_BACKGROUND);
        prctl(PR_SET_NAME, (unsigned long)"SampleWriterTrd", 0, 0, 0);

        bool wasStopped = false;
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <android-base/logging.h>
#include <media/MediaTrackTranscoder.h>
#include <media/MediaTrackTranscoderCallback.h>
#include <utils/AndroidThreads.h>

namespace android {

@@ -72,6 +73,7 @@ bool MediaTrackTranscoder::start() {
    mState = STARTED;

    std::thread([this] {
        androidSetThreadPriority(0 /* tid (0 = current) */, ANDROID_PRIORITY_BACKGROUND);
        bool stopped = false;
        media_status_t status = runTranscodeLoop(&stopped);