Loading media/codec2/sfplugin/CCodec.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -814,9 +814,17 @@ void CCodec::configure(const sp<AMessage> &msg) { } { double value; if (msg->findDouble("time-lapse-fps", &value)) { config->mISConfig->mCaptureFps = value; bool captureFpsFound = false; double timeLapseFps; float captureRate; if (msg->findDouble("time-lapse-fps", &timeLapseFps)) { config->mISConfig->mCaptureFps = timeLapseFps; captureFpsFound = true; } else if (msg->findAsFloat(KEY_CAPTURE_RATE, &captureRate)) { config->mISConfig->mCaptureFps = captureRate; captureFpsFound = true; } if (captureFpsFound) { (void)msg->findAsFloat(KEY_FRAME_RATE, &config->mISConfig->mCodedFps); } } Loading media/libstagefright/ACodec.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -1844,8 +1844,13 @@ status_t ACodec::configureCodec( } if (!msg->findDouble("time-lapse-fps", &mCaptureFps)) { float captureRate; if (msg->findAsFloat(KEY_CAPTURE_RATE, &captureRate)) { mCaptureFps = captureRate; } else { mCaptureFps = -1.0; } } if (!msg->findInt32( KEY_CREATE_INPUT_SURFACE_SUSPENDED, Loading media/utils/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ cc_library { ], shared_libs: [ "libbinder", "libcutils", "liblog", "libutils", "libmemunreachable", Loading media/utils/ServiceUtilities.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,10 @@ static bool checkRecordingInternal(const String16& opPackageName, pid_t pid, uid_t uid, bool start) { // Okay to not track in app ops as audio server is us and if // device is rooted security model is considered compromised. if (isAudioServerOrRootUid(uid)) return true; // system_server loses its RECORD_AUDIO permission when a secondary // user is active, but it is a core system service so let it through. // TODO(b/141210120): UserManager.DISALLOW_RECORD_AUDIO should not affect system user 0 if (isAudioServerOrSystemServerOrRootUid(uid)) return true; // We specify a pid and uid here as mediaserver (aka MediaRecorder or StageFrightRecorder) // may open a record track on behalf of a client. Note that pid may be a tid. Loading media/utils/include/mediautils/ServiceUtilities.h +6 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,12 @@ static inline bool isAudioServerOrSystemServerUid(uid_t uid) { return multiuser_get_app_id(uid) == AID_SYSTEM || uid == AID_AUDIOSERVER; } // used for calls that should come from system_server or audio_server and // include AID_ROOT for command-line tests. static inline bool isAudioServerOrSystemServerOrRootUid(uid_t uid) { return multiuser_get_app_id(uid) == AID_SYSTEM || uid == AID_AUDIOSERVER || uid == AID_ROOT; } // Mediaserver may forward the client PID and UID as part of a binder interface call; // otherwise the calling UID must be equal to the client UID. static inline bool isAudioServerOrMediaServerUid(uid_t uid) { Loading Loading
media/codec2/sfplugin/CCodec.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -814,9 +814,17 @@ void CCodec::configure(const sp<AMessage> &msg) { } { double value; if (msg->findDouble("time-lapse-fps", &value)) { config->mISConfig->mCaptureFps = value; bool captureFpsFound = false; double timeLapseFps; float captureRate; if (msg->findDouble("time-lapse-fps", &timeLapseFps)) { config->mISConfig->mCaptureFps = timeLapseFps; captureFpsFound = true; } else if (msg->findAsFloat(KEY_CAPTURE_RATE, &captureRate)) { config->mISConfig->mCaptureFps = captureRate; captureFpsFound = true; } if (captureFpsFound) { (void)msg->findAsFloat(KEY_FRAME_RATE, &config->mISConfig->mCodedFps); } } Loading
media/libstagefright/ACodec.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -1844,8 +1844,13 @@ status_t ACodec::configureCodec( } if (!msg->findDouble("time-lapse-fps", &mCaptureFps)) { float captureRate; if (msg->findAsFloat(KEY_CAPTURE_RATE, &captureRate)) { mCaptureFps = captureRate; } else { mCaptureFps = -1.0; } } if (!msg->findInt32( KEY_CREATE_INPUT_SURFACE_SUSPENDED, Loading
media/utils/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ cc_library { ], shared_libs: [ "libbinder", "libcutils", "liblog", "libutils", "libmemunreachable", Loading
media/utils/ServiceUtilities.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,10 @@ static bool checkRecordingInternal(const String16& opPackageName, pid_t pid, uid_t uid, bool start) { // Okay to not track in app ops as audio server is us and if // device is rooted security model is considered compromised. if (isAudioServerOrRootUid(uid)) return true; // system_server loses its RECORD_AUDIO permission when a secondary // user is active, but it is a core system service so let it through. // TODO(b/141210120): UserManager.DISALLOW_RECORD_AUDIO should not affect system user 0 if (isAudioServerOrSystemServerOrRootUid(uid)) return true; // We specify a pid and uid here as mediaserver (aka MediaRecorder or StageFrightRecorder) // may open a record track on behalf of a client. Note that pid may be a tid. Loading
media/utils/include/mediautils/ServiceUtilities.h +6 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,12 @@ static inline bool isAudioServerOrSystemServerUid(uid_t uid) { return multiuser_get_app_id(uid) == AID_SYSTEM || uid == AID_AUDIOSERVER; } // used for calls that should come from system_server or audio_server and // include AID_ROOT for command-line tests. static inline bool isAudioServerOrSystemServerOrRootUid(uid_t uid) { return multiuser_get_app_id(uid) == AID_SYSTEM || uid == AID_AUDIOSERVER || uid == AID_ROOT; } // Mediaserver may forward the client PID and UID as part of a binder interface call; // otherwise the calling UID must be equal to the client UID. static inline bool isAudioServerOrMediaServerUid(uid_t uid) { Loading