Loading media/mediaserver/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ soong_config_module_type { mediaserver_cc_binary { name: "mediaserver", defaults: ["libcodec2_hal_selection"], srcs: ["main_mediaserver.cpp"], shared_libs: [ Loading @@ -61,6 +63,7 @@ mediaserver_cc_binary { "libicu", "libfmq", "libbinder", "libbinder_ndk", "libhidlbase", "liblog", "libmediaplayerservice", Loading media/mediaserver/main_mediaserver.cpp +18 −3 Original line number Diff line number Diff line Loading @@ -17,11 +17,12 @@ #define LOG_TAG "mediaserver" //#define LOG_NDEBUG 0 #include <android/binder_process.h> #include <binder/IPCThreadState.h> #include <binder/ProcessState.h> #include <binder/IServiceManager.h> #include <hidl/HidlTransportSupport.h> #include <codec2/common/HalSelection.h> #include <utils/Log.h> #include "RegisterExtensions.h" Loading @@ -30,6 +31,14 @@ using namespace android; namespace { constexpr int kCodecThreadPoolCount = 16; // This is the default thread count for binder thread pool // if the thread count is not configured. constexpr int kDefaultBinderThreadPoolCount = 15; }; // anonymous int main(int argc __unused, char **argv __unused) { signal(SIGPIPE, SIG_IGN); Loading @@ -40,8 +49,14 @@ int main(int argc __unused, char **argv __unused) MediaPlayerService::instantiate(); ResourceManagerService::instantiate(); registerExtensions(); ::android::hardware::configureRpcThreadpool(16, false); bool aidl = ::android::IsCodec2AidlHalSelected(); if (!aidl) { ::android::hardware::configureRpcThreadpool(kCodecThreadPoolCount, false); } else { ABinderProcess_setThreadPoolMaxThreadCount( kCodecThreadPoolCount + kDefaultBinderThreadPoolCount); } ProcessState::self()->startThreadPool(); IPCThreadState::self()->joinThreadPool(); ::android::hardware::joinRpcThreadpool(); } Loading
media/mediaserver/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ soong_config_module_type { mediaserver_cc_binary { name: "mediaserver", defaults: ["libcodec2_hal_selection"], srcs: ["main_mediaserver.cpp"], shared_libs: [ Loading @@ -61,6 +63,7 @@ mediaserver_cc_binary { "libicu", "libfmq", "libbinder", "libbinder_ndk", "libhidlbase", "liblog", "libmediaplayerservice", Loading
media/mediaserver/main_mediaserver.cpp +18 −3 Original line number Diff line number Diff line Loading @@ -17,11 +17,12 @@ #define LOG_TAG "mediaserver" //#define LOG_NDEBUG 0 #include <android/binder_process.h> #include <binder/IPCThreadState.h> #include <binder/ProcessState.h> #include <binder/IServiceManager.h> #include <hidl/HidlTransportSupport.h> #include <codec2/common/HalSelection.h> #include <utils/Log.h> #include "RegisterExtensions.h" Loading @@ -30,6 +31,14 @@ using namespace android; namespace { constexpr int kCodecThreadPoolCount = 16; // This is the default thread count for binder thread pool // if the thread count is not configured. constexpr int kDefaultBinderThreadPoolCount = 15; }; // anonymous int main(int argc __unused, char **argv __unused) { signal(SIGPIPE, SIG_IGN); Loading @@ -40,8 +49,14 @@ int main(int argc __unused, char **argv __unused) MediaPlayerService::instantiate(); ResourceManagerService::instantiate(); registerExtensions(); ::android::hardware::configureRpcThreadpool(16, false); bool aidl = ::android::IsCodec2AidlHalSelected(); if (!aidl) { ::android::hardware::configureRpcThreadpool(kCodecThreadPoolCount, false); } else { ABinderProcess_setThreadPoolMaxThreadCount( kCodecThreadPoolCount + kDefaultBinderThreadPoolCount); } ProcessState::self()->startThreadPool(); IPCThreadState::self()->joinThreadPool(); ::android::hardware::joinRpcThreadpool(); }