mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Add usePlatformDiagnostics
in Transformer.
Added a new `usePlatformDiagnostics` in Transformer. This parameter enables/disables forwarding editing events and performance data to the platform. This is pre-work for metrics support in Transformer. In the following CLs, metrics collection and forwarding will be implemented. PiperOrigin-RevId: 707930368
This commit is contained in:
parent
59789b7209
commit
915130eb00
@ -5,6 +5,15 @@
|
||||
* Common Library:
|
||||
* ExoPlayer:
|
||||
* Transformer:
|
||||
* Enable support for Android platform diagnostics via
|
||||
`MediaMetricsManager`. Transformer will forward editing events and
|
||||
performance data to the platform, which helps to provide system
|
||||
performance and debugging information on the device. This data may also
|
||||
be collected by Google
|
||||
[if sharing usage and diagnostics data is enabled](https://support.google.com/accounts/answer/6078260)
|
||||
by the user of the device. Apps can opt-out of contributing to platform
|
||||
diagnostics for Transformer with
|
||||
`Transformer.Builder.setUsePlatformDiagnostics(false)`.
|
||||
* Track Selection:
|
||||
* Extractors:
|
||||
* DataSource:
|
||||
|
@ -110,6 +110,7 @@ public final class Transformer {
|
||||
private boolean trimOptimizationEnabled;
|
||||
private boolean portraitEncodingEnabled;
|
||||
private boolean fileStartsOnVideoFrameEnabled;
|
||||
private boolean usePlatformDiagnostics;
|
||||
private long maxDelayBetweenMuxerSamplesMs;
|
||||
private int maxFramesInEncoder;
|
||||
private ListenerSet<Transformer.Listener> listeners;
|
||||
@ -141,6 +142,7 @@ public final class Transformer {
|
||||
debugViewProvider = DebugViewProvider.NONE;
|
||||
clock = Clock.DEFAULT;
|
||||
listeners = new ListenerSet<>(looper, clock, (listener, flags) -> {});
|
||||
usePlatformDiagnostics = true;
|
||||
}
|
||||
|
||||
/** Creates a builder with the values of the provided {@link Transformer}. */
|
||||
@ -156,6 +158,7 @@ public final class Transformer {
|
||||
this.trimOptimizationEnabled = transformer.trimOptimizationEnabled;
|
||||
this.portraitEncodingEnabled = transformer.portraitEncodingEnabled;
|
||||
this.fileStartsOnVideoFrameEnabled = transformer.fileStartsOnVideoFrameEnabled;
|
||||
this.usePlatformDiagnostics = transformer.usePlatformDiagnostics;
|
||||
this.maxDelayBetweenMuxerSamplesMs = transformer.maxDelayBetweenMuxerSamplesMs;
|
||||
this.maxFramesInEncoder = transformer.maxFramesInEncoder;
|
||||
this.listeners = transformer.listeners;
|
||||
@ -513,6 +516,26 @@ public final class Transformer {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether transformer reports diagnostics data to the Android platform.
|
||||
*
|
||||
* <p>If enabled, transformer will use the {@link android.media.metrics.MediaMetricsManager} to
|
||||
* create an {@link android.media.metrics.EditingSession} and forward editing events and
|
||||
* performance data to this session. This helps to provide system performance and debugging
|
||||
* information for media editing on this device. This data may also be collected by Google <a
|
||||
* href="https://support.google.com/accounts/answer/6078260">if sharing usage and diagnostics
|
||||
* data is enabled</a> by the user of the device.
|
||||
*
|
||||
* @param usePlatformDiagnostics Whether transformer reports diagnostics data to the Android
|
||||
* platform
|
||||
* @return This builder
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
public Builder setUsePlatformDiagnostics(boolean usePlatformDiagnostics) {
|
||||
this.usePlatformDiagnostics = usePlatformDiagnostics;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a {@link Transformer} instance.
|
||||
*
|
||||
@ -549,6 +572,7 @@ public final class Transformer {
|
||||
trimOptimizationEnabled,
|
||||
portraitEncodingEnabled,
|
||||
fileStartsOnVideoFrameEnabled,
|
||||
usePlatformDiagnostics,
|
||||
maxDelayBetweenMuxerSamplesMs,
|
||||
maxFramesInEncoder,
|
||||
listeners,
|
||||
@ -731,6 +755,7 @@ public final class Transformer {
|
||||
private final boolean trimOptimizationEnabled;
|
||||
private final boolean portraitEncodingEnabled;
|
||||
private final boolean fileStartsOnVideoFrameEnabled;
|
||||
private final boolean usePlatformDiagnostics;
|
||||
private final long maxDelayBetweenMuxerSamplesMs;
|
||||
private final int maxFramesInEncoder;
|
||||
|
||||
@ -770,6 +795,7 @@ public final class Transformer {
|
||||
boolean trimOptimizationEnabled,
|
||||
boolean portraitEncodingEnabled,
|
||||
boolean fileStartsOnVideoFrameEnabled,
|
||||
boolean usePlatformDiagnostics,
|
||||
long maxDelayBetweenMuxerSamplesMs,
|
||||
int maxFramesInEncoder,
|
||||
ListenerSet<Listener> listeners,
|
||||
@ -791,6 +817,7 @@ public final class Transformer {
|
||||
this.trimOptimizationEnabled = trimOptimizationEnabled;
|
||||
this.portraitEncodingEnabled = portraitEncodingEnabled;
|
||||
this.fileStartsOnVideoFrameEnabled = fileStartsOnVideoFrameEnabled;
|
||||
this.usePlatformDiagnostics = usePlatformDiagnostics;
|
||||
this.maxDelayBetweenMuxerSamplesMs = maxDelayBetweenMuxerSamplesMs;
|
||||
this.maxFramesInEncoder = maxFramesInEncoder;
|
||||
this.listeners = listeners;
|
||||
|
Loading…
x
Reference in New Issue
Block a user