Skip to content

Commit

Permalink
Live View doesn't support high color depth
Browse files Browse the repository at this point in the history
  • Loading branch information
ma1co committed Jul 9, 2015
1 parent cc64415 commit f2eac4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected void onResume() {
Logger.info("Resume " + getComponentName().getClassName());
super.onResume();

Gpelibrary.changeFrameBufferPixel(Gpelibrary.GS_FRAMEBUFFER_TYPE.ABGR8888);
setColorDepth(true);
notifyAppInfo();

displayManager = new DisplayManager();
Expand All @@ -35,7 +35,7 @@ protected void onPause() {
Logger.info("Pause " + getComponentName().getClassName());
super.onPause();

Gpelibrary.changeFrameBufferPixel(Gpelibrary.GS_FRAMEBUFFER_TYPE.RGBA4444);
setColorDepth(false);

displayManager.releaseDisplayStatusListener();
displayManager.finish();
Expand Down Expand Up @@ -198,6 +198,11 @@ protected void setAutoPowerOffMode(boolean enable) {
sendBroadcast(intent);
}

protected void setColorDepth(boolean highQuality) {
Gpelibrary.GS_FRAMEBUFFER_TYPE type = highQuality ? Gpelibrary.GS_FRAMEBUFFER_TYPE.ABGR8888 : Gpelibrary.GS_FRAMEBUFFER_TYPE.RGBA4444;
Gpelibrary.changeFrameBufferPixel(type);
}

protected void notifyAppInfo() {
Intent intent = new Intent("com.android.server.DAConnectionManagerService.AppInfoReceive");
intent.putExtra("package_name", getComponentName().getPackageName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,9 @@ protected boolean onShutterKeyUp() {
camera.cancelTakePicture();
return true;
}

@Override
protected void setColorDepth(boolean highQuality) {
super.setColorDepth(false);
}
}

0 comments on commit f2eac4b

Please sign in to comment.