Why max size of SurfaceView(Android) for play video is 1024x1024?
I use SurfaceView for play video. I use Samsung Galaxy Tab to test. I set size:
LinearLayout.LayoutParams videoViewParams = n开发者_运维百科ew 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 higer then 1024 - i get message in logcat:
01-12 11:49:15.839: ERROR/SurfaceFlinger(2491): LayerBuffer init temp buff failed with w=1210, h=922, exp max=1024x1024 on 0
and i see only black screen.
Why? In my application I use video scaling, and sometimes I need to get a video of a size greater than 1024.
It is suspected that this restriction only on Samsung. Checked on emulators - all ok!Found a single theme - a similar problemt where people asked him to test the media player (and he says that for all its devices, the application works correctly). One user is the same problem on Samsung Galaxy S. Only he exp max = 800x800. Ie obtained here is taken the maximum value of screen sizes and forms the limit.
Any ideas?
I still have 2 ideas:
1)Make a zoom limit for all devices (Set the maximum size of video as a maximum size of one side of the screen). But in this case sometimes zoom in general will not or he will be very small.
2)Catch this log about error and show the user a dialogue that in such a zoom video to play will not work. But how to catch this log?
What do you think about this?
精彩评论