mirror of
https://github.com/androidx/media.git
synced 2025-05-17 20:49:53 +08:00
Internal Changes
PiperOrigin-RevId: 755903085
This commit is contained in:
parent
036bd9c7ed
commit
88f1c64907
@ -37,7 +37,7 @@ public class VideoDecoderOutputBuffer extends DecoderOutputBuffer {
|
||||
// )
|
||||
|
||||
/** Decoder private data. Used from native code. */
|
||||
public int decoderPrivate;
|
||||
public long decoderPrivate;
|
||||
|
||||
/** Output mode. */
|
||||
public @C.VideoOutputMode int mode;
|
||||
|
@ -553,7 +553,7 @@ DECODER_FUNC(jlong, gav1Init, jint threads) {
|
||||
const jclass outputBufferClass =
|
||||
env->FindClass("androidx/media3/decoder/VideoDecoderOutputBuffer");
|
||||
context->decoder_private_field =
|
||||
env->GetFieldID(outputBufferClass, "decoderPrivate", "I");
|
||||
env->GetFieldID(outputBufferClass, "decoderPrivate", "J");
|
||||
context->output_mode_field = env->GetFieldID(outputBufferClass, "mode", "I");
|
||||
context->data_field =
|
||||
env->GetFieldID(outputBufferClass, "data", "Ljava/nio/ByteBuffer;");
|
||||
@ -664,7 +664,7 @@ DECODER_FUNC(jint, gav1GetFrame, jlong jContext, jobject jOutputBuffer,
|
||||
// Exception is thrown in Java when returning from the native call.
|
||||
return kStatusError;
|
||||
}
|
||||
env->SetIntField(jOutputBuffer, context->decoder_private_field, buffer_id);
|
||||
env->SetLongField(jOutputBuffer, context->decoder_private_field, buffer_id);
|
||||
}
|
||||
|
||||
return kStatusOk;
|
||||
@ -674,7 +674,7 @@ DECODER_FUNC(jint, gav1RenderFrame, jlong jContext, jobject jSurface,
|
||||
jobject jOutputBuffer) {
|
||||
JniContext* const context = reinterpret_cast<JniContext*>(jContext);
|
||||
const int buffer_id =
|
||||
env->GetIntField(jOutputBuffer, context->decoder_private_field);
|
||||
env->GetLongField(jOutputBuffer, context->decoder_private_field);
|
||||
JniFrameBuffer* const jni_buffer =
|
||||
context->buffer_manager.GetBuffer(buffer_id);
|
||||
|
||||
@ -749,8 +749,8 @@ DECODER_FUNC(jint, gav1RenderFrame, jlong jContext, jobject jSurface,
|
||||
DECODER_FUNC(void, gav1ReleaseFrame, jlong jContext, jobject jOutputBuffer) {
|
||||
JniContext* const context = reinterpret_cast<JniContext*>(jContext);
|
||||
const int buffer_id =
|
||||
env->GetIntField(jOutputBuffer, context->decoder_private_field);
|
||||
env->SetIntField(jOutputBuffer, context->decoder_private_field, -1);
|
||||
env->GetLongField(jOutputBuffer, context->decoder_private_field);
|
||||
env->SetLongField(jOutputBuffer, context->decoder_private_field, -1);
|
||||
context->jni_status_code = context->buffer_manager.ReleaseBuffer(buffer_id);
|
||||
if (context->jni_status_code != kJniStatusOk) {
|
||||
LOGE("%s", GetJniErrorMessage(context->jni_status_code));
|
||||
|
@ -484,7 +484,7 @@ DECODER_FUNC(jlong, vpxInit, jboolean disableLoopFilter,
|
||||
env->GetFieldID(outputBufferClass, "data", "Ljava/nio/ByteBuffer;");
|
||||
outputModeField = env->GetFieldID(outputBufferClass, "mode", "I");
|
||||
decoderPrivateField =
|
||||
env->GetFieldID(outputBufferClass, "decoderPrivate", "I");
|
||||
env->GetFieldID(outputBufferClass, "decoderPrivate", "J");
|
||||
return reinterpret_cast<intptr_t>(context);
|
||||
}
|
||||
|
||||
@ -615,7 +615,7 @@ DECODER_FUNC(jint, vpxGetFrame, jlong jContext, jobject jOutputBuffer) {
|
||||
if (env->ExceptionCheck()) {
|
||||
return -1;
|
||||
}
|
||||
env->SetIntField(jOutputBuffer, decoderPrivateField,
|
||||
env->SetLongField(jOutputBuffer, decoderPrivateField,
|
||||
id + kDecoderPrivateBase);
|
||||
}
|
||||
return 0;
|
||||
@ -624,7 +624,7 @@ DECODER_FUNC(jint, vpxGetFrame, jlong jContext, jobject jOutputBuffer) {
|
||||
DECODER_FUNC(jint, vpxRenderFrame, jlong jContext, jobject jSurface,
|
||||
jobject jOutputBuffer) {
|
||||
JniCtx* const context = reinterpret_cast<JniCtx*>(jContext);
|
||||
const int id = env->GetIntField(jOutputBuffer, decoderPrivateField) -
|
||||
const int id = env->GetLongField(jOutputBuffer, decoderPrivateField) -
|
||||
kDecoderPrivateBase;
|
||||
JniFrameBuffer* srcBuffer = context->buffer_manager->get_buffer(id);
|
||||
context->acquire_native_window(env, jSurface);
|
||||
@ -679,9 +679,9 @@ DECODER_FUNC(jint, vpxRenderFrame, jlong jContext, jobject jSurface,
|
||||
|
||||
DECODER_FUNC(void, vpxReleaseFrame, jlong jContext, jobject jOutputBuffer) {
|
||||
JniCtx* const context = reinterpret_cast<JniCtx*>(jContext);
|
||||
const int id = env->GetIntField(jOutputBuffer, decoderPrivateField) -
|
||||
const int id = env->GetLongField(jOutputBuffer, decoderPrivateField) -
|
||||
kDecoderPrivateBase;
|
||||
env->SetIntField(jOutputBuffer, decoderPrivateField, -1);
|
||||
env->SetLongField(jOutputBuffer, decoderPrivateField, -1);
|
||||
context->buffer_manager->release(id);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user