Add toggle for DebugTraceUtil to Transformer demo.

PiperOrigin-RevId: 634495944
This commit is contained in:
samrobinson 2024-05-16 12:39:03 -07:00 committed by Copybara-Service
parent 1abcf5c22c
commit d83e81f374
3 changed files with 16 additions and 0 deletions

View File

@ -49,6 +49,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.media3.common.C;
import androidx.media3.common.MimeTypes;
import androidx.media3.effect.DebugTraceUtil;
import androidx.media3.transformer.Composition;
import com.google.android.material.slider.RangeSlider;
import com.google.android.material.slider.Slider;
@ -230,6 +231,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
private @MonotonicNonNull CheckBox trimCheckBox;
private @MonotonicNonNull CheckBox enableFallbackCheckBox;
private @MonotonicNonNull CheckBox enableDebugPreviewCheckBox;
private @MonotonicNonNull CheckBox enableDebugTracingCheckBox;
private @MonotonicNonNull CheckBox abortSlowExportCheckBox;
private @MonotonicNonNull CheckBox produceFragmentedMp4CheckBox;
private @MonotonicNonNull Spinner hdrModeSpinner;
@ -349,6 +351,9 @@ public final class ConfigurationActivity extends AppCompatActivity {
enableFallbackCheckBox = findViewById(R.id.enable_fallback_checkbox);
enableDebugPreviewCheckBox = findViewById(R.id.enable_debug_preview_checkbox);
enableDebugTracingCheckBox = findViewById(R.id.enable_debug_tracing_checkbox);
enableDebugTracingCheckBox.setOnCheckedChangeListener(
(buttonView, isChecked) -> DebugTraceUtil.enableTracing = isChecked);
abortSlowExportCheckBox = findViewById(R.id.abort_slow_export_checkbox);
produceFragmentedMp4CheckBox = findViewById(R.id.produce_fragmented_mp4_checkbox);

View File

@ -206,6 +206,16 @@
android:layout_gravity="end"
android:checked="true"/>
</TableRow>
<TableRow
android:layout_weight="1">
<TextView
android:layout_gravity="center_vertical"
android:text="@string/enable_debug_tracing" />
<CheckBox
android:id="@+id/enable_debug_tracing_checkbox"
android:layout_gravity="end"
android:checked="false"/>
</TableRow>
<TableRow
android:layout_weight="1">
<TextView

View File

@ -29,6 +29,7 @@
<string name="rotate" translatable="false">Rotate video (degrees)</string>
<string name="enable_fallback" translatable="false">Enable fallback</string>
<string name="enable_debug_preview" translatable="false">Enable debug preview</string>
<string name="enable_debug_tracing" translatable="false">Enable debug tracing</string>
<string name="abort_slow_export" translatable="false">Abort slow export</string>
<string name="produce_fragmented_mp4" translatable="false">Produce fragmented MP4</string>
<string name="trim" translatable="false">Trim</string>