Skip to content

Commit

Permalink
encapp: Update proto def
Browse files Browse the repository at this point in the history
Break out Parameter from sub messages

Signed-off-by: JohanBlome <[email protected]>
  • Loading branch information
JohanBlome committed Jul 19, 2024
1 parent 502471b commit 8e1f8d0
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 470 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 27
targetSdkVersion 31
versionCode 1
versionName "1.14"
versionName "1.15"
setProperty("archivesBaseName", applicationId + "-v" + versionName)
}
buildTypes {
Expand Down
Binary file added app/releases/com.facebook.encapp-v1.15-debug.apk
Binary file not shown.
7 changes: 4 additions & 3 deletions app/src/main/java/com/facebook/encapp/Encoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import com.facebook.encapp.proto.Configure;
import com.facebook.encapp.proto.DataValueType;
import com.facebook.encapp.proto.Parameter;
import com.facebook.encapp.proto.Runtime;
import com.facebook.encapp.proto.Test;
import com.facebook.encapp.utils.Assert;
Expand Down Expand Up @@ -278,8 +279,8 @@ protected Test setCodecNameAndIdentifier(Test test) throws Exception {
}

protected void setConfigureParams(Test test, MediaFormat format) {
List<Configure.Parameter> params = test.getConfigure().getParameterList();
for (Configure.Parameter param : params) {
List<Parameter> params = test.getConfigure().getParameterList();
for (Parameter param : params) {
switch (param.getType().getNumber()) {
case DataValueType.stringType_VALUE:
format.setString(param.getKey(), param.getValue());
Expand Down Expand Up @@ -345,7 +346,7 @@ public void setRuntimeParameters(int frame) {
}
}

for (Runtime.Parameter param : mRuntimeParams.getParameterList()) {
for (Parameter param : mRuntimeParams.getParameterList()) {
if (param.getFramenum() == frame) {
Log.d(TAG, "Set runtime parameter @ " + frame + " key: " + param.getKey() + ", " + param.getType() + ", " + param.getValue());
switch (param.getType().getNumber()) {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/facebook/encapp/SurfaceTranscoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.facebook.encapp.proto.DataValueType;
import com.facebook.encapp.proto.DecoderRuntime;
import com.facebook.encapp.proto.Parameter;
import com.facebook.encapp.proto.Test;
import com.facebook.encapp.utils.FileReader;
import com.facebook.encapp.utils.FrameInfo;
Expand Down Expand Up @@ -309,7 +310,7 @@ public void setDecoderRuntimeParameters(Test mTest, int frame) {
if (mDecoderRuntimeParams == null) return;
Bundle bundle = new Bundle();

for (DecoderRuntime.Parameter param : mDecoderRuntimeParams.getParameterList()) {
for (Parameter param : mDecoderRuntimeParams.getParameterList()) {
if (param.getFramenum() == frame) {
switch (param.getType().getNumber()) {
case DataValueType.floatType_VALUE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.facebook.encapp.proto.DataValueType;
import com.facebook.encapp.proto.DecoderConfigure;
import com.facebook.encapp.proto.Input;
import com.facebook.encapp.proto.Parameter;
import com.facebook.encapp.proto.PixFmt;
import com.facebook.encapp.proto.Test;
import com.facebook.encapp.utils.MediaCodecInfoHelper;
Expand Down Expand Up @@ -85,7 +86,7 @@ public static MediaFormat buildMediaFormat(Test test) {
}

// set all the available values
for (Configure.Parameter param : config.getParameterList()) {
for (Parameter param : config.getParameterList()) {
switch (param.getType().getNumber()) {
case DataValueType.floatType_VALUE:
float fval = Float.parseFloat(param.getValue());
Expand Down Expand Up @@ -222,9 +223,9 @@ public static Test updateBasicSettings(Test test) {
public static void setDecoderConfigureParams(Test mTest, MediaFormat format) {
DecoderConfigure config = mTest.getDecoderConfigure();

List<DecoderConfigure.Parameter> params = config.getParameterList();
List<Parameter> params = config.getParameterList();
Log.d(TAG, "Set decoder config: " + params);
for (DecoderConfigure.Parameter param : params) {
for (Parameter param : params) {
switch (param.getType().getNumber()) {
case DataValueType.intType_VALUE:
format.setInteger(param.getKey(), Integer.parseInt(param.getValue()));
Expand Down
Loading

0 comments on commit 8e1f8d0

Please sign in to comment.