I am using Android MediaPlayer to play a video file on TextureView. I count the times the onSurfaceTextureUpdated callback is made and on some devices it is less than the number of the frames of the video, while in others it reaches the total number of frames. Why is this happening? Isn't the Surface Texture supposed to be updating for every frame? Could it be a TextureView or a codec implementation issue?
Asked
Active
Viewed 1,504 times
0
-
1What's the video's frame rate? I'm wondering if playback is falling behind and dropping frames. On the devices that don't show all frames, is it missing the same number of frames every time? Which devices? – fadden Mar 28 '14 at 14:56
-
Thank you for the comment. The video's frame rate is 30fps. It's not missing the same number of frames every time, but it's in the range of 3 to 15 frames. One of the devices is Nexus 7 (2013). Could it be the dropping of frames? – drgr Mar 28 '14 at 17:13
-
Sounds like it's dropping frames. Try this: just before the video starts, and the entire time it's playing, drag your finger around the screen. On some devices, including the N7(2013), this will cause the power management to keep the various CPU / GPU / bus clocks higher. – fadden Mar 28 '14 at 17:26
-
Thank you for the insight. The suggested experiment does work as a charm. – drgr Apr 02 '14 at 06:24
1 Answers
0
This is memory issue.
Please try to finish other activities and release unneeded data before play the video on TextureView
.

Trung NT Nguyen
- 403
- 2
- 14