Commit 10ece049 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

LibVLC: Expose if device is ready for passThrough

parent 2e302e6e
......@@ -372,6 +372,8 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
private boolean mAudioDigitalOutputEnabled = false;
private String mAudioPlugOutputDevice = "stereo";
private boolean mCanDoPassthrough;
private final AWindow mWindow = new AWindow(new AWindow.SurfaceCallback() {
@Override
public void onSurfacesCreated(AWindow vout) {
......@@ -402,7 +404,8 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
});
private synchronized void updateAudioOutputDevice(long encodingFlags, String defaultDevice) {
final String newDeviceId = mAudioDigitalOutputEnabled && encodingFlags != 0 ? "encoded:" + encodingFlags : defaultDevice;
mCanDoPassthrough = encodingFlags != 0;
final String newDeviceId = mAudioDigitalOutputEnabled && mCanDoPassthrough ? "encoded:" + encodingFlags : defaultDevice;
if (!newDeviceId.equals(mAudioPlugOutputDevice)) {
mAudioPlugOutputDevice = newDeviceId;
setAudioOutputDeviceInternal(mAudioPlugOutputDevice, false);
......@@ -1201,6 +1204,10 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
nativeRelease();
}
public boolean canDoPassthrough() {
return mCanDoPassthrough;
}
/* JNI */
private native void nativeNewFromLibVlc(LibVLC libVLC, AWindow window);
private native void nativeNewFromMedia(Media media, AWindow window);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment