Fixed sample video corrupted in MediaCodec mode.
Change-Id: I1cdfae5fda3f4002f0c17105aa25f5d25683d58f related-to-bug: 6732061
This commit is contained in:
@@ -207,6 +207,7 @@ class CodecState {
|
||||
} catch (MediaCodec.CryptoException e) {
|
||||
Log.d(TAG, "CryptoException w/ errorCode "
|
||||
+ e.getErrorCode() + ", '" + e.getMessage() + "'");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -527,6 +528,8 @@ class MediaCodecView extends SurfaceView
|
||||
if (isAudio) {
|
||||
mAudioTrackState = state;
|
||||
}
|
||||
// set video view size
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
@@ -722,4 +725,14 @@ class MediaCodecView extends SurfaceView
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
int width = 720;
|
||||
int height = 480;
|
||||
|
||||
Log.d(TAG, "setting size: " + width + 'x' + height);
|
||||
setMeasuredDimension(width, height);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user