static void com_media_ffmpeg_FFMpegPlayer_setAudioStreamType(JNIEnv *env, jobject thiz, int streamtype) { MediaPlayer* mp = getMediaPlayer(env, thiz); if (mp == NULL ) { jniThrowException(env, "java/lang/IllegalStateException", NULL); return; } process_media_player_call( env, thiz, mp->setAudioStreamType(streamtype) , NULL, NULL ); }
static void wseemann_media_FFmpegMediaPlayer_setAudioStreamType(JNIEnv *env, jobject thiz, int streamtype) { __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, "setAudioStreamType: %d", streamtype); MediaPlayer* mp = getMediaPlayer(env, thiz); if (mp == NULL ) { jniThrowException(env, "java/lang/IllegalStateException", NULL); return; } process_media_player_call( env, thiz, mp->setAudioStreamType(streamtype) , NULL, NULL ); }
MediaPlayer* CameraService::newMediaPlayer(const char *file) { MediaPlayer* mp = new MediaPlayer(); if (mp->setDataSource(file, NULL) == NO_ERROR) { mp->setAudioStreamType(AUDIO_STREAM_ENFORCED_AUDIBLE); mp->prepare(); } else { LOGE("Failed to load CameraService sounds: %s", file); return NULL; } return mp; }
void BootAnimation::bootMusic() { int index; MediaPlayer* mp = new MediaPlayer(); if((access(SYSTEM_BOOTMUSIC_FILE,F_OK))!=-1){ if (mp->setDataSource(SYSTEM_BOOTMUSIC_FILE, NULL) == NO_ERROR) { mp->setAudioStreamType(AUDIO_STREAM_ENFORCED_AUDIBLE); mp->prepare(); mp->setLooping(true); } AudioSystem::getStreamVolumeIndex(AUDIO_STREAM_ENFORCED_AUDIBLE, &index); if (index != 0) { mp->seekTo(0); mp->start(); } } }
MediaPlayer* CameraService::newMediaPlayer(const char *file) { #ifdef MTK_CAMERAPROFILE_SUPPORT AutoCPTLog cptlog(Event_CS_newMediaPlayer); #endif #ifdef MTK_CAMERA_BSP_SUPPORT LOG1("[CameraService::newMediaPlayer] + (%s)\r\n", file); #endif MediaPlayer* mp = new MediaPlayer(); if (mp->setDataSource(file, NULL) == NO_ERROR) { mp->setAudioStreamType(AUDIO_STREAM_ENFORCED_AUDIBLE); mp->prepare(); } else { ALOGE("Failed to load CameraService sounds: %s", file); return NULL; } #ifdef MTK_CAMERA_BSP_SUPPORT LOG1("[CameraService::newMediaPlayer] -\r\n"); #endif return mp; }