Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i meet some exception #59

Open
woniu0936 opened this issue Aug 18, 2016 · 3 comments
Open

i meet some exception #59

woniu0936 opened this issue Aug 18, 2016 · 3 comments

Comments

@woniu0936
Copy link

java.lang.IllegalStateException
at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:1036)
at com.gouhuoapp.camerarecord.video.AndroidEncoder$override.drainEncoder(AndroidEncoder.java:86)
at com.gouhuoapp.camerarecord.video.AndroidEncoder$override.access$dispatch(AndroidEncoder.java)
at com.gouhuoapp.camerarecord.video.AndroidEncoder.drainEncoder(AndroidEncoder.java:0)
at com.gouhuoapp.camerarecord.video.CameraEncoder.handleFrameAvailable(CameraEncoder.java:497)
at com.gouhuoapp.camerarecord.video.CameraEncoder.access$100(CameraEncoder.java:28)
at com.gouhuoapp.camerarecord.video.CameraEncoder$EncoderHandler.handleMessage(CameraEncoder.java:913)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at com.gouhuoapp.camerarecord.video.CameraEncoder.run(CameraEncoder.java:676)
at java.lang.Thread.run(Thread.java:818)

@woniu0936
Copy link
Author

in MediaCodec,i find below:
/**
* Dequeue an output buffer, block at most "timeoutUs" microseconds.
* Returns the index of an output buffer that has been successfully
* decoded or one of the INFO_* constants.
* @param info Will be filled with buffer meta data.
* @param timeoutUs The timeout in microseconds, a negative timeout indicates "infinite".
* @throws IllegalStateException if not in the Executing state,
* or codec is configured in asynchronous mode.
* @throws MediaCodec.CodecException upon codec error.
/
@OutputBufferInfo
public final int dequeueOutputBuffer(
@nonnull BufferInfo info, long timeoutUs) {
int res = native_dequeueOutputBuffer(info, timeoutUs);
synchronized(mBufferLock) {
if (res == INFO_OUTPUT_BUFFERS_CHANGED) {
cacheBuffers(false /
input */);
} else if (res >= 0) {
validateOutputByteBuffer(mCachedOutputBuffers, res, info);
if (mHasSurface) {
mDequeuedOutputInfos.put(res, info.dup());
}
}
}
return res;
}

@woniu0936
Copy link
Author

IllegalStateException if codec is configured in asynchronous mode??in VideoEncoderCore you say “This class is not thread-safe, with one exception: it is valid to use the input surface on one thread, and drain the output on a different thread.”

@woniu0936
Copy link
Author

It's really nice if you can help check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant