Page 1 of 1

Re-size surface problem

Posted: 25 Dec 2013 06:34
by d36201419
HI, first thanks for your help.
I encounter a problem. How to re-size the surface?

the code on android set the surface as full-screen.
But I want to make it just maybe 400*400.
Have any one done this before?

I tried to modify the function "changeSurfaceSize()". But the screen is black, although it has voice.

Thanks for your help again!

Re: Re-size surface problem

Posted: 08 Jan 2014 13:57
by XilasZ
if you want to display in a 400x400 frame but keep the original aspect ratio, forcing dw/dh variable to 400 at the beginning should work.
if you don't care about aspect ratio, you can just force dimensions in the two LayoutParams near the end.

in all cases, you must keep this line untouched :

Code: Select all

mSurfaceHolder.setFixedSize(mVideoWidth, mVideoHeight);