private boolean setAudioOutputDeviceInternal(String id, boolean fromUser) { final boolean ret = nativeSetAudioOutputDevice(id); if (ret) { synchronized (this) { mAudioOutputDevice = id; if (fromUser) { /* The user forced a device, don't listen to audio plug events and let the user decide */ mAudioDeviceFromUser = true; registerAudioPlug(false); } } } return ret; }
private boolean setAudioOutputDeviceInternal(String id, boolean fromUser) { final boolean ret = nativeSetAudioOutputDevice(id); if (ret) { synchronized (this) { mAudioOutputDevice = id; if (fromUser) { /* The user forced a device, don't listen to audio plug events and let the user decide */ mAudioDeviceFromUser = true; registerAudioPlug(false); } } } return ret; }
private boolean setAudioOutputDeviceInternal(String id, boolean fromUser) { final boolean ret = nativeSetAudioOutputDevice(id); if (ret) { synchronized (this) { mAudioOutputDevice = id; if (fromUser) { /* The user forced a device, don't listen to audio plug events and let the user decide */ mAudioDeviceFromUser = true; registerAudioPlug(false); } } } return ret; }
/** * Selects an audio output module. * Any change will take effect only after playback is stopped and * restarted. Audio output cannot be changed while playing. * * By default, the "android_audiotrack" is selected. Starting Android 21, passthrough is * enabled for encodings supported by the device/audio system. * * Calling this method will disable the encoding detection. * * @return true on success. */ public boolean setAudioOutput(String aout) { final boolean ret = nativeSetAudioOutput(aout); if (ret) { synchronized (this) { mAudioOutput = aout; /* The user forced an output, don't listen to audio plug events and let the user decide */ mAudioDeviceFromUser = true; registerAudioPlug(false); } } return ret; }
/** * Selects an audio output module. * Any change will take effect only after playback is stopped and * restarted. Audio output cannot be changed while playing. * * By default, the "android_audiotrack" is selected. Starting Android 21, passthrough is * enabled for encodings supported by the device/audio system. * * Calling this method will disable the encoding detection. * * @return true on success. */ public boolean setAudioOutput(String aout) { final boolean ret = nativeSetAudioOutput(aout); if (ret) { synchronized (this) { mAudioOutput = aout; /* The user forced an output, don't listen to audio plug events and let the user decide */ mAudioDeviceFromUser = true; registerAudioPlug(false); } } return ret; }
/** * Selects an audio output module. * Any change will take effect only after playback is stopped and * restarted. Audio output cannot be changed while playing. * * By default, the "android_audiotrack" is selected. Starting Android 21, passthrough is * enabled for encodings supported by the device/audio system. * * Calling this method will disable the encoding detection. * * @return true on success. */ public boolean setAudioOutput(String aout) { final boolean ret = nativeSetAudioOutput(aout); if (ret) { synchronized (this) { mAudioOutput = aout; /* The user forced an output, don't listen to audio plug events and let the user decide */ mAudioDeviceFromUser = true; registerAudioPlug(false); } } return ret; }
@Override protected void onReleaseNative() { registerAudioPlug(false); if (mMedia != null) mMedia.release(); nativeRelease(); }
@Override protected void onReleaseNative() { registerAudioPlug(false); if (mMedia != null) mMedia.release(); mVoutCount = 0; nativeRelease(); }
@Override protected void onReleaseNative() { registerAudioPlug(false); if (mMedia != null) mMedia.release(); nativeRelease(); }
/** * Play the media * */ public void play() { synchronized (this) { if (!mPlaying) { /* HACK: stop() reset the audio output, so set it again before first play. */ if (mAudioReset) { if (mAudioOutput != null) nativeSetAudioOutput(mAudioOutput); if (mAudioOutputDevice != null) nativeSetAudioOutputDevice(mAudioOutputDevice); mAudioReset = false; } if (!mAudioDeviceFromUser) registerAudioPlug(true); mPlayRequested = true; if (mWindow.areSurfacesWaiting()) return; } mPlaying = true; } nativePlay(); }
/** * Play the media * */ public void play() { synchronized (this) { if (!mPlaying) { /* HACK: stop() reset the audio output, so set it again before first play. */ if (mAudioReset) { if (mAudioOutput != null) nativeSetAudioOutput(mAudioOutput); if (mAudioOutputDevice != null) nativeSetAudioOutputDevice(mAudioOutputDevice); mAudioReset = false; } if (!mAudioDeviceFromUser) registerAudioPlug(true); mPlayRequested = true; if (mWindow.areSurfacesWaiting()) return; } mPlaying = true; } nativePlay(); }
/** * Play the media * */ public void play() { synchronized (this) { if (!mPlaying) { /* HACK: stop() reset the audio output, so set it again before first play. */ if (mAudioReset) { if (mAudioOutput != null) nativeSetAudioOutput(mAudioOutput); if (mAudioOutputDevice != null) nativeSetAudioOutputDevice(mAudioOutputDevice); mAudioReset = false; } if (!mAudioDeviceFromUser) registerAudioPlug(true); mPlayRequested = true; if (mWindow.areSurfacesWaiting()) return; } mPlaying = true; } nativePlay(); }