Commit 9ad60177 authored by Geoffrey Métais's avatar Geoffrey Métais

Deactivate mediarouter callbacks in benchmark

parent 0f388166
...@@ -57,8 +57,8 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) { ...@@ -57,8 +57,8 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) {
}} }}
init { init {
presentation = if (AndroidUtil.isJellyBeanMR1OrLater) createPresentation(cloneMode) else null presentation = if (AndroidUtil.isJellyBeanMR1OrLater && !cloneMode) createPresentation() else null
displayType = getCurrentType() displayType = if (cloneMode) DisplayType.PRIMARY else getCurrentType()
if (!AndroidDevices.isChromeBook) RendererDelegate.selectedRenderer.observeForever(rendererObs) if (!AndroidDevices.isChromeBook) RendererDelegate.selectedRenderer.observeForever(rendererObs)
} }
...@@ -85,8 +85,8 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) { ...@@ -85,8 +85,8 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) {
} }
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
private fun createPresentation(cloneMode: Boolean): SecondaryDisplay? { private fun createPresentation(): SecondaryDisplay? {
if (mediaRouter === null || cloneMode) return null if (mediaRouter === null) return null
// Get the current route and its presentation display. // Get the current route and its presentation display.
val route = mediaRouter?.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO) val route = mediaRouter?.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO)
......
...@@ -324,7 +324,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C ...@@ -324,7 +324,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
audioBoostEnabled = mSettings.getBoolean("audio_boost", false); audioBoostEnabled = mSettings.getBoolean("audio_boost", false);
mEnableCloneMode = mSettings.getBoolean("enable_clone_mode", false); mEnableCloneMode = mSettings.getBoolean("enable_clone_mode", false);
mDisplayManager = new DisplayManager(this, mEnableCloneMode); mDisplayManager = new DisplayManager(this, mEnableCloneMode || mIsBenchmark);
setContentView(mDisplayManager.isPrimary() ? R.layout.player : R.layout.player_remote_control); setContentView(mDisplayManager.isPrimary() ? R.layout.player : R.layout.player_remote_control);
/** initialize Views an their Events */ /** initialize Views an their Events */
...@@ -777,7 +777,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C ...@@ -777,7 +777,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
surfaceFrameAddLayoutListener(true); surfaceFrameAddLayoutListener(true);
/* Listen for changes to media routes. */ /* Listen for changes to media routes. */
mDisplayManager.mediaRouterAddCallback(true); if (!mIsBenchmark) mDisplayManager.mediaRouterAddCallback(true);
if (mRootView != null) mRootView.setKeepScreenOn(true); if (mRootView != null) mRootView.setKeepScreenOn(true);
} }
...@@ -845,7 +845,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C ...@@ -845,7 +845,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
if (mRootView != null) mRootView.setKeepScreenOn(false); if (mRootView != null) mRootView.setKeepScreenOn(false);
/* Stop listening for changes to media routes. */ /* Stop listening for changes to media routes. */
mDisplayManager.mediaRouterAddCallback(false); if (!mIsBenchmark) mDisplayManager.mediaRouterAddCallback(false);
surfaceFrameAddLayoutListener(false); surfaceFrameAddLayoutListener(false);
...@@ -933,7 +933,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C ...@@ -933,7 +933,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
} }
}; };
public void exit(int resultCode){ public void exit(int resultCode) {
if (isFinishing()) return; if (isFinishing()) return;
final Intent resultIntent = new Intent(ACTION_RESULT); final Intent resultIntent = new Intent(ACTION_RESULT);
if (mUri != null && mService != null) { if (mUri != null && mService != null) {
......
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