This is an offshoot of  Hardware Acceleration,
With my new tests I'm not sure that was the problem
I have created a new project that is Nothing but the Video Player I'm trying to create
this time I did **not** enable any hardware acceleration
I still have the same problem  video plays ,  hear the audio    no picture

So I thought about resizing, I followed
http://stackoverflow.com/questions/7031598/resize-video-to-fit-the-videoview and
   http://clseto.mysinablog.com/index.php?op=ViewArticle&articleId=2992625

No joy still no picture

public class MyVideoView extends VideoView {
    private int mForceHeight =  658;
    private int mForceWidth  = 1170;

    public MyVideoView(Context context) {
        super(context);
    }

    public MyVideoView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public MyVideoView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public void setDimensions(int w, int h) {
        this.mForceWidth  = w;
        this.mForceHeight = h;
        getHolder().setFixedSize(w , h);
        requestLayout();
        invalidate();
    }

@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { Log.i("@@@@", "onMeasure this : " + this.getWidth() + " x " + this.getHeight() + " current : " + this.mForceWidth + " x " + this.mForceHeight + " to be : " + widthMeasureSpec + " x " + heightMeasureSpec );
        setMeasuredDimension(mForceWidth, mForceHeight);
    }
}

Log reports  it is called three times
onMeasure this : 0 x 0 current : 1170 x 658 to be : 1073742994 x 1073742524 onMeasure this : 1170 x 658 current : 1170 x 658 to be : 1073742994 x 1073742524 onMeasure this : 1170 x 658 current : 1170 x 658 to be : 1073742994 x 1073742524


I called this way whether I put setDimensions before of after setVideoPath no change
    video.setVideoPath(fName);
    video.setDimensions(1170 , 658);


Questions:
--------------
1) Why three times ?
2) What are the large values of widthMeasureSpec and heightMeasureSpec ?
3) Is this right,  what is the correct way to resize the video ?
    the original video is  1280 x 720  and my viewing size  is  1170 x 700


All help greatly appreciated
Thanks in advance



--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to