Skip to content

Commit

Permalink
Remove unneeded getting, still need to test+cleanup comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankiesz committed Apr 23, 2024
1 parent e44628d commit fc71b01
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,6 @@ BOOL setClientInfo(JNIEnv *env, jobject clientInfo, PClientInfo pClientInfo) {
}
}

// Note: kvsRetryStrategyCallbacks is not supported yet in Java, the below is a skeleton for the future implementation.
methodId = env->GetMethodID(cls, "getKvsRetryStrategyCallbacks", "()Lcom/amazonaws/kinesisvideo/producer/KvsRetryStrategyCallbacks;");
if (methodId == NULL) {
DLOGW("Couldn't find method id getKvsRetryStrategyCallbacks");
} else {
kvsRetryStrategyCallbacks = (jobject) env->CallObjectMethod(clientInfo, methodId);
CHK_JVM_EXCEPTION(env);
}

CleanUp:
return STATUS_FAILED(retStatus) ? FALSE : TRUE;
}
Expand All @@ -299,18 +290,11 @@ BOOL setKvsRetryStrategy(JNIEnv *env, jobject kvsRetryStrategy, PKvsRetryStrateg
jmethodID methodId = NULL;
jclass cls = NULL;

CHECK(env != NULL && pKvsRetryStrategy != NULL);

if (kvsRetryStrategy == NULL) {
goto CleanUp;
}
CHK(env != NULL && pKvsRetryStrategy != NULL, STATUS_NULL_ARG);
CHK_WARN(kvsRetryStrategy != NULL, STATUS_INVALID_OPERATION, "Failed to get Java kvsRetryStrategy class.");

cls = env->GetObjectClass(kvsRetryStrategy);
if (cls == NULL) {
DLOGW("Failed to create Java kvsRetryStrategy class.");
CHK(FALSE, STATUS_INVALID_OPERATION);
goto CleanUp;
}
CHK_WARN(cls != NULL, STATUS_INVALID_OPERATION, "Failed to create Java kvsRetryStrategy class.");

methodId = env->GetMethodID(cls, "getRetryStrategy", "()J");
if (methodId == NULL) {
Expand All @@ -328,10 +312,10 @@ BOOL setKvsRetryStrategy(JNIEnv *env, jobject kvsRetryStrategy, PKvsRetryStrateg
CHK_JVM_EXCEPTION(env);
}

// TODO: Test with logs that this is getting the value from Java, play around with the value.
methodId = env->GetMethodID(cls, "getRetryStrategyType", "()I");
if (methodId == NULL) {
DLOGW("Couldn't find method id getRetryStrategyType, setting retryStrategyType to EXPONENTIAL_BACKOFF_WAIT.");
pKvsRetryStrategy->retryStrategyType = KVS_RETRY_STRATEGY_EXPONENTIAL_BACKOFF_WAIT;
} else {
pKvsRetryStrategy->retryStrategyType = (KVS_RETRY_STRATEGY_TYPE) env->CallIntMethod(kvsRetryStrategy, methodId);
CHK_JVM_EXCEPTION(env);
Expand Down

0 comments on commit fc71b01

Please sign in to comment.