Skip to content

Instantly share code, notes, and snippets.

@FlyingJester
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save FlyingJester/3582cb79801f47e595ee to your computer and use it in GitHub Desktop.

Select an option

Save FlyingJester/3582cb79801f47e595ee to your computer and use it in GitHub Desktop.
GeneratedJNIWrappers_2.cpp
// GENERATED CODE
// Generated by the Java program at /build/jarClassProcessors at compile time from
// a given set of jars and a set of requested methods. To update, change the annotations
// on the corresponding Java methods and rerun the build. Manually updating this file
// will cause your build to fail.
#include "GeneratedJNIWrappers_2.h"
#include "AndroidBridgeUtilities.h"
#include "nsXPCOMStrings.h"
#include "AndroidBridge.h"
namespace mozilla {
namespace widget {
namespace android {
jclass MediaCodec::mMediaCodecClass = 0;
jmethodID MediaCodec::jConfigure = 0;
jmethodID MediaCodec::jCreateByCodecName = 0;
jmethodID MediaCodec::jCreateDecoderByType = 0;
jmethodID MediaCodec::jCreateEncoderByType = 0;
jmethodID MediaCodec::jDequeueInputBuffer = 0;
jmethodID MediaCodec::jDequeueOutputBuffer = 0;
jmethodID MediaCodec::jFinalize = 0;
jmethodID MediaCodec::jFlush = 0;
jmethodID MediaCodec::jGetInputBuffers = 0;
jmethodID MediaCodec::jGetOutputBuffers = 0;
jmethodID MediaCodec::jGetOutputFormat = 0;
jmethodID MediaCodec::jQueueInputBuffer = 0;
jmethodID MediaCodec::jQueueSecureInputBuffer = 0;
jmethodID MediaCodec::jRelease = 0;
jmethodID MediaCodec::jReleaseOutputBuffer = 0;
jmethodID MediaCodec::jSetVideoScalingMode = 0;
jmethodID MediaCodec::jStart = 0;
jmethodID MediaCodec::jStop = 0;
jfieldID MediaCodec::jBUFFER_FLAG_CODEC_CONFIG = 0;
jfieldID MediaCodec::jBUFFER_FLAG_END_OF_STREAM = 0;
jfieldID MediaCodec::jBUFFER_FLAG_SYNC_FRAME = 0;
jfieldID MediaCodec::jCONFIGURE_FLAG_ENCODE = 0;
jfieldID MediaCodec::jCRYPTO_MODE_AES_CTR = 0;
jfieldID MediaCodec::jCRYPTO_MODE_UNENCRYPTED = 0;
jfieldID MediaCodec::jINFO_OUTPUT_BUFFERS_CHANGED = 0;
jfieldID MediaCodec::jINFO_OUTPUT_FORMAT_CHANGED = 0;
jfieldID MediaCodec::jINFO_TRY_AGAIN_LATER = 0;
jfieldID MediaCodec::jVIDEO_SCALING_MODE_SCALE_TO_FIT = 0;
jfieldID MediaCodec::jVIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING = 0;
void MediaCodec::InitStubs(JNIEnv *jEnv) {
initInit();
mMediaCodecClass = getClassGlobalRef("android/media/MediaCodec");
jConfigure = getMethod("configure", "(Landroid/media/MediaFormat;Landroid/view/Surface;Landroid/media/MediaCrypto;I)V");
jCreateByCodecName = getStaticMethod("createByCodecName", "(Ljava/lang/String;)Landroid/media/MediaCodec;");
jCreateDecoderByType = getStaticMethod("createDecoderByType", "(Ljava/lang/String;)Landroid/media/MediaCodec;");
jCreateEncoderByType = getStaticMethod("createEncoderByType", "(Ljava/lang/String;)Landroid/media/MediaCodec;");
jDequeueInputBuffer = getMethod("dequeueInputBuffer", "(J)I");
jDequeueOutputBuffer = getMethod("dequeueOutputBuffer", "(Landroid/media/MediaCodec$BufferInfo;J)I");
jFinalize = getMethod("finalize", "()V");
jFlush = getMethod("flush", "()V");
jGetInputBuffers = getMethod("getInputBuffers", "()[Ljava/nio/ByteBuffer;");
jGetOutputBuffers = getMethod("getOutputBuffers", "()[Ljava/nio/ByteBuffer;");
jGetOutputFormat = getMethod("getOutputFormat", "()Landroid/media/MediaFormat;");
jQueueInputBuffer = getMethod("queueInputBuffer", "(IIIJI)V");
jQueueSecureInputBuffer = getMethod("queueSecureInputBuffer", "(IILandroid/media/MediaCodec$CryptoInfo;JI)V");
jRelease = getMethod("release", "()V");
jReleaseOutputBuffer = getMethod("releaseOutputBuffer", "(IZ)V");
jSetVideoScalingMode = getMethod("setVideoScalingMode", "(I)V");
jStart = getMethod("start", "()V");
jStop = getMethod("stop", "()V");
jBUFFER_FLAG_CODEC_CONFIG = getStaticField("BUFFER_FLAG_CODEC_CONFIG", "I");
jBUFFER_FLAG_END_OF_STREAM = getStaticField("BUFFER_FLAG_END_OF_STREAM", "I");
jBUFFER_FLAG_SYNC_FRAME = getStaticField("BUFFER_FLAG_SYNC_FRAME", "I");
jCONFIGURE_FLAG_ENCODE = getStaticField("CONFIGURE_FLAG_ENCODE", "I");
jCRYPTO_MODE_AES_CTR = getStaticField("CRYPTO_MODE_AES_CTR", "I");
jCRYPTO_MODE_UNENCRYPTED = getStaticField("CRYPTO_MODE_UNENCRYPTED", "I");
jINFO_OUTPUT_BUFFERS_CHANGED = getStaticField("INFO_OUTPUT_BUFFERS_CHANGED", "I");
jINFO_OUTPUT_FORMAT_CHANGED = getStaticField("INFO_OUTPUT_FORMAT_CHANGED", "I");
jINFO_TRY_AGAIN_LATER = getStaticField("INFO_TRY_AGAIN_LATER", "I");
jVIDEO_SCALING_MODE_SCALE_TO_FIT = getStaticField("VIDEO_SCALING_MODE_SCALE_TO_FIT", "I");
jVIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING = getStaticField("VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING", "I");
}
MediaCodec* MediaCodec::Wrap(jobject obj) {
JNIEnv *env = GetJNIForThread();
MediaCodec* ret = new MediaCodec(obj, env);
env->DeleteLocalRef(obj);
return ret;
}
void MediaCodec::Configure(jobject a0, jobject a1, jobject a2, int32_t a3) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(3) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[4];
args[0].l = a0;
args[1].l = a1;
args[2].l = a2;
args[3].i = a3;
env->CallVoidMethodA(wrapped_obj, jConfigure, args);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
jobject MediaCodec::CreateByCodecName(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
jobject temp = env->CallStaticObjectMethod(mMediaCodecClass, jCreateByCodecName, j0);
AndroidBridge::HandleUncaughtException(env);
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
return ret;
}
jobject MediaCodec::CreateDecoderByType(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
jobject temp = env->CallStaticObjectMethod(mMediaCodecClass, jCreateDecoderByType, j0);
AndroidBridge::HandleUncaughtException(env);
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
return ret;
}
jobject MediaCodec::CreateEncoderByType(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
jobject temp = env->CallStaticObjectMethod(mMediaCodecClass, jCreateEncoderByType, j0);
AndroidBridge::HandleUncaughtException(env);
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
return ret;
}
int32_t MediaCodec::DequeueInputBuffer(int64_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
int32_t temp = env->CallIntMethod(wrapped_obj, jDequeueInputBuffer, a0);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
int32_t MediaCodec::DequeueOutputBuffer(jobject a0, int64_t a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
int32_t temp = env->CallIntMethod(wrapped_obj, jDequeueOutputBuffer, a0, a1);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
void MediaCodec::Finalize() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jFinalize);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaCodec::Flush() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jFlush);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
jobjectArray MediaCodec::GetInputBuffers() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallObjectMethod(wrapped_obj, jGetInputBuffers);
AndroidBridge::HandleUncaughtException(env);
jobjectArray ret = static_cast<jobjectArray>(env->PopLocalFrame(temp));
return ret;
}
jobjectArray MediaCodec::GetOutputBuffers() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallObjectMethod(wrapped_obj, jGetOutputBuffers);
AndroidBridge::HandleUncaughtException(env);
jobjectArray ret = static_cast<jobjectArray>(env->PopLocalFrame(temp));
return ret;
}
jobject MediaCodec::GetOutputFormat() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallObjectMethod(wrapped_obj, jGetOutputFormat);
AndroidBridge::HandleUncaughtException(env);
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
return ret;
}
void MediaCodec::QueueInputBuffer(int32_t a0, int32_t a1, int32_t a2, int64_t a3, int32_t a4) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[5];
args[0].i = a0;
args[1].i = a1;
args[2].i = a2;
args[3].j = a3;
args[4].i = a4;
env->CallVoidMethodA(wrapped_obj, jQueueInputBuffer, args);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaCodec::QueueSecureInputBuffer(int32_t a0, int32_t a1, jobject a2, int64_t a3, int32_t a4) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[5];
args[0].i = a0;
args[1].i = a1;
args[2].l = a2;
args[3].j = a3;
args[4].i = a4;
env->CallVoidMethodA(wrapped_obj, jQueueSecureInputBuffer, args);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaCodec::Release() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jRelease);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaCodec::ReleaseOutputBuffer(int32_t a0, bool a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jReleaseOutputBuffer, a0, a1);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaCodec::SetVideoScalingMode(int32_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jSetVideoScalingMode, a0);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaCodec::Start() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jStart);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaCodec::Stop() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jStop);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
int32_t MediaCodec::getBUFFER_FLAG_CODEC_CONFIG() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jBUFFER_FLAG_CODEC_CONFIG);
}
int32_t MediaCodec::getBUFFER_FLAG_END_OF_STREAM() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jBUFFER_FLAG_END_OF_STREAM);
}
int32_t MediaCodec::getBUFFER_FLAG_SYNC_FRAME() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jBUFFER_FLAG_SYNC_FRAME);
}
int32_t MediaCodec::getCONFIGURE_FLAG_ENCODE() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jCONFIGURE_FLAG_ENCODE);
}
int32_t MediaCodec::getCRYPTO_MODE_AES_CTR() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jCRYPTO_MODE_AES_CTR);
}
int32_t MediaCodec::getCRYPTO_MODE_UNENCRYPTED() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jCRYPTO_MODE_UNENCRYPTED);
}
int32_t MediaCodec::getINFO_OUTPUT_BUFFERS_CHANGED() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jINFO_OUTPUT_BUFFERS_CHANGED);
}
int32_t MediaCodec::getINFO_OUTPUT_FORMAT_CHANGED() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jINFO_OUTPUT_FORMAT_CHANGED);
}
int32_t MediaCodec::getINFO_TRY_AGAIN_LATER() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jINFO_TRY_AGAIN_LATER);
}
int32_t MediaCodec::getVIDEO_SCALING_MODE_SCALE_TO_FIT() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jVIDEO_SCALING_MODE_SCALE_TO_FIT);
}
int32_t MediaCodec::getVIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaCodecClass, jVIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING);
}
jclass MediaExtractor::mMediaExtractorClass = 0;
jmethodID MediaExtractor::jMediaExtractor = 0;
jmethodID MediaExtractor::jAdvance = 0;
jmethodID MediaExtractor::jFinalize = 0;
jmethodID MediaExtractor::jGetCachedDuration = 0;
jmethodID MediaExtractor::jGetSampleCryptoInfo = 0;
jmethodID MediaExtractor::jGetSampleFlags = 0;
jmethodID MediaExtractor::jGetSampleTime = 0;
jmethodID MediaExtractor::jGetSampleTrackIndex = 0;
jmethodID MediaExtractor::jGetTrackCount = 0;
jmethodID MediaExtractor::jGetTrackFormat = 0;
jmethodID MediaExtractor::jHasCacheReachedEndOfStream = 0;
jmethodID MediaExtractor::jReadSampleData = 0;
jmethodID MediaExtractor::jRelease = 0;
jmethodID MediaExtractor::jSeekTo = 0;
jmethodID MediaExtractor::jSelectTrack = 0;
jmethodID MediaExtractor::jSetDataSource = 0;
jmethodID MediaExtractor::jSetDataSource0 = 0;
jmethodID MediaExtractor::jSetDataSource1 = 0;
jmethodID MediaExtractor::jSetDataSource2 = 0;
jmethodID MediaExtractor::jSetDataSource3 = 0;
jmethodID MediaExtractor::jUnselectTrack = 0;
jfieldID MediaExtractor::jSAMPLE_FLAG_ENCRYPTED = 0;
jfieldID MediaExtractor::jSAMPLE_FLAG_SYNC = 0;
jfieldID MediaExtractor::jSEEK_TO_CLOSEST_SYNC = 0;
jfieldID MediaExtractor::jSEEK_TO_NEXT_SYNC = 0;
jfieldID MediaExtractor::jSEEK_TO_PREVIOUS_SYNC = 0;
void MediaExtractor::InitStubs(JNIEnv *jEnv) {
initInit();
mMediaExtractorClass = getClassGlobalRef("android/media/MediaExtractor");
jMediaExtractor = getMethod("<init>", "()V");
jAdvance = getMethod("advance", "()Z");
jFinalize = getMethod("finalize", "()V");
jGetCachedDuration = getMethod("getCachedDuration", "()J");
jGetSampleCryptoInfo = getMethod("getSampleCryptoInfo", "(Landroid/media/MediaCodec$CryptoInfo;)Z");
jGetSampleFlags = getMethod("getSampleFlags", "()I");
jGetSampleTime = getMethod("getSampleTime", "()J");
jGetSampleTrackIndex = getMethod("getSampleTrackIndex", "()I");
jGetTrackCount = getMethod("getTrackCount", "()I");
jGetTrackFormat = getMethod("getTrackFormat", "(I)Landroid/media/MediaFormat;");
jHasCacheReachedEndOfStream = getMethod("hasCacheReachedEndOfStream", "()Z");
jReadSampleData = getMethod("readSampleData", "(Ljava/nio/ByteBuffer;I)I");
jRelease = getMethod("release", "()V");
jSeekTo = getMethod("seekTo", "(JI)V");
jSelectTrack = getMethod("selectTrack", "(I)V");
jSetDataSource = getMethod("setDataSource", "(Landroid/content/Context;Landroid/net/Uri;Ljava/util/Map;)V");
jSetDataSource0 = getMethod("setDataSource", "(Ljava/io/FileDescriptor;)V");
jSetDataSource1 = getMethod("setDataSource", "(Ljava/io/FileDescriptor;JJ)V");
jSetDataSource2 = getMethod("setDataSource", "(Ljava/lang/String;)V");
jSetDataSource3 = getMethod("setDataSource", "(Ljava/lang/String;Ljava/util/Map;)V");
jUnselectTrack = getMethod("unselectTrack", "(I)V");
jSAMPLE_FLAG_ENCRYPTED = getStaticField("SAMPLE_FLAG_ENCRYPTED", "I");
jSAMPLE_FLAG_SYNC = getStaticField("SAMPLE_FLAG_SYNC", "I");
jSEEK_TO_CLOSEST_SYNC = getStaticField("SEEK_TO_CLOSEST_SYNC", "I");
jSEEK_TO_NEXT_SYNC = getStaticField("SEEK_TO_NEXT_SYNC", "I");
jSEEK_TO_PREVIOUS_SYNC = getStaticField("SEEK_TO_PREVIOUS_SYNC", "I");
}
MediaExtractor* MediaExtractor::Wrap(jobject obj) {
JNIEnv *env = GetJNIForThread();
MediaExtractor* ret = new MediaExtractor(obj, env);
env->DeleteLocalRef(obj);
return ret;
}
MediaExtractor::MediaExtractor() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
Init(env->NewObject(mMediaExtractorClass, jMediaExtractor), env);
env->PopLocalFrame(nullptr);
}
bool MediaExtractor::Advance() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallBooleanMethod(wrapped_obj, jAdvance);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
void MediaExtractor::Finalize() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jFinalize);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
int64_t MediaExtractor::GetCachedDuration() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
int64_t temp = env->CallLongMethod(wrapped_obj, jGetCachedDuration);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
bool MediaExtractor::GetSampleCryptoInfo(jobject a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallBooleanMethod(wrapped_obj, jGetSampleCryptoInfo, a0);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
int32_t MediaExtractor::GetSampleFlags() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
int32_t temp = env->CallIntMethod(wrapped_obj, jGetSampleFlags);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
int64_t MediaExtractor::GetSampleTime() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
int64_t temp = env->CallLongMethod(wrapped_obj, jGetSampleTime);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
int32_t MediaExtractor::GetSampleTrackIndex() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
int32_t temp = env->CallIntMethod(wrapped_obj, jGetSampleTrackIndex);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
int32_t MediaExtractor::GetTrackCount() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
int32_t temp = env->CallIntMethod(wrapped_obj, jGetTrackCount);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
jobject MediaExtractor::GetTrackFormat(int32_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallObjectMethod(wrapped_obj, jGetTrackFormat, a0);
AndroidBridge::HandleUncaughtException(env);
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
return ret;
}
bool MediaExtractor::HasCacheReachedEndOfStream() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallBooleanMethod(wrapped_obj, jHasCacheReachedEndOfStream);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
int32_t MediaExtractor::ReadSampleData(jobject a0, int32_t a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
int32_t temp = env->CallIntMethod(wrapped_obj, jReadSampleData, a0, a1);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
return temp;
}
void MediaExtractor::Release() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jRelease);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaExtractor::SeekTo(int64_t a0, int32_t a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jSeekTo, a0, a1);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaExtractor::SelectTrack(int32_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jSelectTrack, a0);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaExtractor::SetDataSource(jobject a0, jobject a1, jobject a2) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(3) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[3];
args[0].l = a0;
args[1].l = a1;
args[2].l = a2;
env->CallVoidMethodA(wrapped_obj, jSetDataSource, args);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaExtractor::SetDataSource(jobject a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jSetDataSource0, a0);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaExtractor::SetDataSource(jobject a0, int64_t a1, int64_t a2) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[3];
args[0].l = a0;
args[1].j = a1;
args[2].j = a2;
env->CallVoidMethodA(wrapped_obj, jSetDataSource1, args);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaExtractor::SetDataSource(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
env->CallVoidMethod(wrapped_obj, jSetDataSource2, j0);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaExtractor::SetDataSource(const nsAString& a0, jobject a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
env->CallVoidMethod(wrapped_obj, jSetDataSource3, j0, a1);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
void MediaExtractor::UnselectTrack(int32_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jUnselectTrack, a0);
AndroidBridge::HandleUncaughtException(env);
env->PopLocalFrame(nullptr);
}
int32_t MediaExtractor::getSAMPLE_FLAG_ENCRYPTED() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaExtractorClass, jSAMPLE_FLAG_ENCRYPTED);
}
int32_t MediaExtractor::getSAMPLE_FLAG_SYNC() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaExtractorClass, jSAMPLE_FLAG_SYNC);
}
int32_t MediaExtractor::getSEEK_TO_CLOSEST_SYNC() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaExtractorClass, jSEEK_TO_CLOSEST_SYNC);
}
int32_t MediaExtractor::getSEEK_TO_NEXT_SYNC() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaExtractorClass, jSEEK_TO_NEXT_SYNC);
}
int32_t MediaExtractor::getSEEK_TO_PREVIOUS_SYNC() {
JNIEnv *env = GetJNIForThread();
return env->GetStaticIntField(mMediaExtractorClass, jSEEK_TO_PREVIOUS_SYNC);
}
void InitStubs(JNIEnv *jEnv) {
MediaCodec::InitStubs(jEnv);
MediaExtractor::InitStubs(jEnv);
}
} /* android */
} /* widget */
} /* mozilla */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment