Loading core/java/android/view/SurfaceView.java +3 −9 Original line number Diff line number Diff line Loading @@ -193,26 +193,20 @@ public class SurfaceView extends View { private boolean mGlobalListenersAdded; public SurfaceView(Context context) { super(context); init(); this(context, null); } public SurfaceView(Context context, AttributeSet attrs) { super(context, attrs); init(); this(context, attrs, 0); } public SurfaceView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(); this(context, attrs, defStyleAttr, 0); } public SurfaceView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); init(); } private void init() { setWillNotDraw(true); } Loading core/java/android/widget/VideoView.java +39 −41 Original line number Diff line number Diff line Loading @@ -70,10 +70,7 @@ import java.util.Vector; */ public class VideoView extends SurfaceView implements MediaPlayerControl, SubtitleController.Anchor { private String TAG = "VideoView"; // settable by the client private Uri mUri; private Map<String, String> mHeaders; private static final String TAG = "VideoView"; // all possible internal states private static final int STATE_ERROR = -1; Loading @@ -84,6 +81,12 @@ public class VideoView extends SurfaceView private static final int STATE_PAUSED = 4; private static final int STATE_PLAYBACK_COMPLETED = 5; private final Vector<Pair<InputStream, MediaFormat>> mPendingSubtitleTracks = new Vector<>(); // settable by the client private Uri mUri; private Map<String, String> mHeaders; // mCurrentState is a VideoView object's current state. // mTargetState is the state that a method caller intends to reach. // For instance, regardless the VideoView object's current state, Loading Loading @@ -118,13 +121,11 @@ public class VideoView extends SurfaceView private RenderingWidget.OnChangedListener mSubtitlesChangedListener; public VideoView(Context context) { super(context); initVideoView(); this(context, null); } public VideoView(Context context, AttributeSet attrs) { this(context, attrs, 0); initVideoView(); } public VideoView(Context context, AttributeSet attrs, int defStyleAttr) { Loading @@ -133,7 +134,19 @@ public class VideoView extends SurfaceView public VideoView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); initVideoView(); mVideoWidth = 0; mVideoHeight = 0; getHolder().addCallback(mSHCallback); getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); setFocusable(true); setFocusableInTouchMode(true); requestFocus(); mCurrentState = STATE_IDLE; mTargetState = STATE_IDLE; } @Override Loading Loading @@ -209,19 +222,6 @@ public class VideoView extends SurfaceView return getDefaultSize(desiredSize, measureSpec); } private void initVideoView() { mVideoWidth = 0; mVideoHeight = 0; getHolder().addCallback(mSHCallback); getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); setFocusable(true); setFocusableInTouchMode(true); requestFocus(); mPendingSubtitleTracks = new Vector<Pair<InputStream, MediaFormat>>(); mCurrentState = STATE_IDLE; mTargetState = STATE_IDLE; } /** * Sets video path. * Loading Loading @@ -294,8 +294,6 @@ public class VideoView extends SurfaceView } } private Vector<Pair<InputStream, MediaFormat>> mPendingSubtitleTracks; public void stopPlayback() { if (mMediaPlayer != null) { mMediaPlayer.stop(); Loading Loading
core/java/android/view/SurfaceView.java +3 −9 Original line number Diff line number Diff line Loading @@ -193,26 +193,20 @@ public class SurfaceView extends View { private boolean mGlobalListenersAdded; public SurfaceView(Context context) { super(context); init(); this(context, null); } public SurfaceView(Context context, AttributeSet attrs) { super(context, attrs); init(); this(context, attrs, 0); } public SurfaceView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(); this(context, attrs, defStyleAttr, 0); } public SurfaceView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); init(); } private void init() { setWillNotDraw(true); } Loading
core/java/android/widget/VideoView.java +39 −41 Original line number Diff line number Diff line Loading @@ -70,10 +70,7 @@ import java.util.Vector; */ public class VideoView extends SurfaceView implements MediaPlayerControl, SubtitleController.Anchor { private String TAG = "VideoView"; // settable by the client private Uri mUri; private Map<String, String> mHeaders; private static final String TAG = "VideoView"; // all possible internal states private static final int STATE_ERROR = -1; Loading @@ -84,6 +81,12 @@ public class VideoView extends SurfaceView private static final int STATE_PAUSED = 4; private static final int STATE_PLAYBACK_COMPLETED = 5; private final Vector<Pair<InputStream, MediaFormat>> mPendingSubtitleTracks = new Vector<>(); // settable by the client private Uri mUri; private Map<String, String> mHeaders; // mCurrentState is a VideoView object's current state. // mTargetState is the state that a method caller intends to reach. // For instance, regardless the VideoView object's current state, Loading Loading @@ -118,13 +121,11 @@ public class VideoView extends SurfaceView private RenderingWidget.OnChangedListener mSubtitlesChangedListener; public VideoView(Context context) { super(context); initVideoView(); this(context, null); } public VideoView(Context context, AttributeSet attrs) { this(context, attrs, 0); initVideoView(); } public VideoView(Context context, AttributeSet attrs, int defStyleAttr) { Loading @@ -133,7 +134,19 @@ public class VideoView extends SurfaceView public VideoView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); initVideoView(); mVideoWidth = 0; mVideoHeight = 0; getHolder().addCallback(mSHCallback); getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); setFocusable(true); setFocusableInTouchMode(true); requestFocus(); mCurrentState = STATE_IDLE; mTargetState = STATE_IDLE; } @Override Loading Loading @@ -209,19 +222,6 @@ public class VideoView extends SurfaceView return getDefaultSize(desiredSize, measureSpec); } private void initVideoView() { mVideoWidth = 0; mVideoHeight = 0; getHolder().addCallback(mSHCallback); getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); setFocusable(true); setFocusableInTouchMode(true); requestFocus(); mPendingSubtitleTracks = new Vector<Pair<InputStream, MediaFormat>>(); mCurrentState = STATE_IDLE; mTargetState = STATE_IDLE; } /** * Sets video path. * Loading Loading @@ -294,8 +294,6 @@ public class VideoView extends SurfaceView } } private Vector<Pair<InputStream, MediaFormat>> mPendingSubtitleTracks; public void stopPlayback() { if (mMediaPlayer != null) { mMediaPlayer.stop(); Loading