Loading services/camera/libcameraservice/CameraService.cpp +15 −4 Original line number Diff line number Diff line Loading @@ -2054,7 +2054,8 @@ MediaPlayer* CameraService::newMediaPlayer(const char *file) { mp->prepare(); } else { ALOGE("Failed to load CameraService sounds: %s", file); return NULL; delete mp; return nullptr; } return mp; } Loading @@ -2066,10 +2067,20 @@ void CameraService::loadSound() { LOG1("CameraService::loadSound ref=%d", mSoundRef); if (mSoundRef++) return; mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/product/media/audio/ui/camera_click.ogg"); if (mSoundPlayer[SOUND_SHUTTER] == nullptr) { mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg"); mSoundPlayer[SOUND_RECORDING_START] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg"); } mSoundPlayer[SOUND_RECORDING_START] = newMediaPlayer("/product/media/audio/ui/VideoRecord.ogg"); if (mSoundPlayer[SOUND_RECORDING_START] == nullptr) { mSoundPlayer[SOUND_RECORDING_START] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg"); } mSoundPlayer[SOUND_RECORDING_STOP] = newMediaPlayer("/product/media/audio/ui/VideoStop.ogg"); if (mSoundPlayer[SOUND_RECORDING_STOP] == nullptr) { mSoundPlayer[SOUND_RECORDING_STOP] = newMediaPlayer("/system/media/audio/ui/VideoStop.ogg"); } } void CameraService::releaseSound() { Mutex::Autolock lock(mSoundLock); Loading Loading
services/camera/libcameraservice/CameraService.cpp +15 −4 Original line number Diff line number Diff line Loading @@ -2054,7 +2054,8 @@ MediaPlayer* CameraService::newMediaPlayer(const char *file) { mp->prepare(); } else { ALOGE("Failed to load CameraService sounds: %s", file); return NULL; delete mp; return nullptr; } return mp; } Loading @@ -2066,10 +2067,20 @@ void CameraService::loadSound() { LOG1("CameraService::loadSound ref=%d", mSoundRef); if (mSoundRef++) return; mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/product/media/audio/ui/camera_click.ogg"); if (mSoundPlayer[SOUND_SHUTTER] == nullptr) { mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg"); mSoundPlayer[SOUND_RECORDING_START] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg"); } mSoundPlayer[SOUND_RECORDING_START] = newMediaPlayer("/product/media/audio/ui/VideoRecord.ogg"); if (mSoundPlayer[SOUND_RECORDING_START] == nullptr) { mSoundPlayer[SOUND_RECORDING_START] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg"); } mSoundPlayer[SOUND_RECORDING_STOP] = newMediaPlayer("/product/media/audio/ui/VideoStop.ogg"); if (mSoundPlayer[SOUND_RECORDING_STOP] == nullptr) { mSoundPlayer[SOUND_RECORDING_STOP] = newMediaPlayer("/system/media/audio/ui/VideoStop.ogg"); } } void CameraService::releaseSound() { Mutex::Autolock lock(mSoundLock); Loading