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

Commit 2d39ccf9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "transcoding: change service thread priority to background" into sc-dev

parents 6a1fd115 45a31636
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <media/NdkCommon.h>
#include <media/TranscoderWrapper.h>
#include <media/TranscodingRequest.h>
#include <utils/AndroidThreads.h>
#include <utils/Log.h>

#include <thread>
@@ -599,6 +600,7 @@ void TranscoderWrapper::queueEvent(Event::Type type, ClientIdType clientId, Sess
}

void TranscoderWrapper::threadLoop() {
    androidSetThreadPriority(0 /*tid (0 = current) */, ANDROID_PRIORITY_BACKGROUND);
    std::unique_lock<std::mutex> lock{mLock};
    // TranscoderWrapper currently lives in the transcoding service, as long as
    // MediaTranscodingService itself.
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <inttypes.h>
#include <media/TranscodingSessionController.h>
#include <media/TranscodingUidPolicy.h>
#include <utils/AndroidThreads.h>
#include <utils/Log.h>

#include <thread>
@@ -162,6 +163,7 @@ void TranscodingSessionController::Watchdog::updateTimer_l() NO_THREAD_SAFETY_AN

// Unfortunately std::unique_lock is incompatible with -Wthread-safety.
void TranscodingSessionController::Watchdog::threadLoop() NO_THREAD_SAFETY_ANALYSIS {
    androidSetThreadPriority(0 /*tid (0 = current) */, ANDROID_PRIORITY_BACKGROUND);
    std::unique_lock<std::mutex> lock{mLock};

    while (!mAbort) {