title: Android TextureView vs VideoView Performance
body: <p>I need to be able to rotate a video on screen, so I created a custom TextureView which provides a convenience layer over a MediaPlayer similar to how the current implementation of VideoView does. <a href="http://android-developers.blogspot.com/2011/11/android-40-graphics-and-animations.html" rel="noreferrer">This Android blog post</a> says the following about TextureView:</p>
  <blockquote>
  <p>Because a SurfaceView’s content does not live in the application’s window, it cannot be transformed (moved, scaled, rotated) efficiently. This makes it difficult to use a SurfaceView inside a ListView or a ScrollView. SurfaceView also cannot interact properly with some features of the UI toolkit such as fading edges or View.setAlpha().</p>
  <p>To solve these problems, Android 4.0 introduces a new widget called TextureView that relies on the hardware accelerated 2D rendering pipeline and SurfaceTexture. TextureView offers the same capabilities as SurfaceView but, unlike SurfaceView, behaves as a regular view. You can for instance use a TextureView to display an OpenGL scene or a video stream. The TextureView itself can be animated, scrolled, etc.</p>
  </blockquote>
  <p>However, it looks like the TextureView is struggling to play the videos. The target device I'm testing it on has a 1.2Ghz Rockchip RK3066 Dual Core CPU, a Quad core Mali-400 GPU (ARM) and 1GB RAM. The same code using VideoViews on this device performs fine, but the TextureViews either &quot;stutter&quot; while playing or don't show up at all (black box with white squares in the top left), depending on the specific device. The TextureViews perform fine on the emulator using the Intel-provided x86 &quot;device&quot;.</p>
  <p>Is this performance hit expected, or should I be looking elsewhere to find the problem? Thanks</p>