Why is the maximum size of SurfaceView (Android) for video playback is 1024x1024?

I use SurfaceView to play videos. I use the Samsung Galaxy Tab for testing. I set the size:

LinearLayout.LayoutParams videoViewParams = new LinearLayout.LayoutParams(m_mainView.getPictureWidth(), m_mainView.getPictureHeight()); mPreview = (SurfaceView) videoView.findViewById(R.id.surface); mPreview.setLayoutParams(videoViewParams); 

When mainView.getPictureWidth () or mainView.getPictureHeight () is higher than 1024 - I get a message in logcat:

01-12 11: 49: 15.839: ERROR / SurfaceFlinger (2491): Error initializing temp buffer LayerBuffer with w = 1210, h = 922, exp max = 1024x1024 to 0

and I only see a black screen.

Why? In my application, I use video scaling, and sometimes I need to get videos larger than 1024.

+4
source share
2 answers

It is assumed that this restriction applies only to Samsung. Tested on emulators - everything is in order! One topic was found - a similar problem where people asked him to test a media player (and he says that the application works correctly for all his devices). One user is the same problem on the Samsung Galaxy S. Only he exp max = 800x800. Those. here the maximum value of the screen size is obtained and forms a limit.

Any ideas?

+1
source

I still have 2 ideas:

1) Make a zoom limit for all devices (set the maximum video size as the maximum size of one side of the screen). But in this case, sometimes the scale will not be at all, or it will be very small.

2) Catch this error log and show the user a dialogue that will not work in such a scaled video for playback. But how to catch this magazine?

What do you think about it?

+1
source

Source: https://habr.com/ru/post/1335422/


All Articles