/ projects

Android: Fix the Nexus upside down camera

This took me an embarrassing amount of time and energy to unravel...

Eventually the solution was to carefully go back to the Capturing Video tutorial and very carefully try possible permutations that don't contradict the steps: https://developer.android.com/guide/topics/media/camera.html#capture-video

  1. Refactor CameraView (simplify the problem)
    This means separate SurfaceView as a separate moduleUse a base example to experiment with performance: https://github.com/joseph-zhong/android-MediaRecorder
  2. Fix orientation issues for both camera and recorder without hacks (set the orientation for the internal hardware)
  1. One particularly important key change was to remove the need for setting a media recorder preview display
    Rely on the camera preview by only using the MediaRecorder#setCamera command (fix the Preview UI)
  2. Performance performance performance
    Everything just freezes if heavy things aren't off the main thread -- perhaps all camera things should be in Threads or AsyncTasks
    It's actually quite insane how intensive this Camera1 API is, the Camera2 is way smoother and has much more functionality (basically every problem listed above and more seems to be dealt with elegantly)
Joseph Zhong

Joseph Zhong

“The brick walls give us a chance to show how badly we want something. They stop people who don’t want it badly enough.” ― Randy Pausch, The Last Lecture

Read More