mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
parent
a4d28b4f10
commit
b25d6ef249
@ -105,8 +105,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
}
|
||||
|
||||
private static final int SUCCESS_PROGRESS_PERCENTAGE = 100;
|
||||
private final String exporterName;
|
||||
@Nullable private final String muxerName;
|
||||
private @MonotonicNonNull EditingSession editingSession;
|
||||
private long startTimeMs;
|
||||
|
||||
@ -115,16 +113,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
*
|
||||
* <p>A new instance must be created before starting a new export.
|
||||
*
|
||||
* <p>Both {@code exporterName} and {@code muxerName} should follow the format
|
||||
* "<packageName>:<version>".
|
||||
*
|
||||
* @param context The {@link Context}.
|
||||
* @param exporterName Java package name and version of the library or application implementing
|
||||
* the editing operation.
|
||||
* @param muxerName Java package name and version of the library or application that writes to the
|
||||
* output file.
|
||||
*/
|
||||
public EditingMetricsCollector(Context context, String exporterName, @Nullable String muxerName) {
|
||||
public EditingMetricsCollector(Context context) {
|
||||
@Nullable
|
||||
MediaMetricsManager mediaMetricsManager =
|
||||
(MediaMetricsManager) context.getSystemService(Context.MEDIA_METRICS_SERVICE);
|
||||
@ -132,8 +123,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
editingSession = checkNotNull(mediaMetricsManager.createEditingSession());
|
||||
startTimeMs = SystemClock.DEFAULT.elapsedRealtime();
|
||||
}
|
||||
this.exporterName = exporterName;
|
||||
this.muxerName = muxerName;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -212,14 +201,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
private EditingEndedEvent.Builder createEditingEndedEventBuilder(int finalState) {
|
||||
long endTimeMs = SystemClock.DEFAULT.elapsedRealtime();
|
||||
EditingEndedEvent.Builder editingEndedEventBuilder =
|
||||
new EditingEndedEvent.Builder(finalState)
|
||||
.setTimeSinceCreatedMillis(endTimeMs - startTimeMs)
|
||||
.setExporterName(exporterName);
|
||||
if (muxerName != null) {
|
||||
editingEndedEventBuilder.setMuxerName(muxerName);
|
||||
}
|
||||
return editingEndedEventBuilder;
|
||||
return new EditingEndedEvent.Builder(finalState)
|
||||
.setTimeSinceCreatedMillis(endTimeMs - startTimeMs);
|
||||
}
|
||||
|
||||
private static List<MediaItemInfo> getMediaItemInfos(
|
||||
|
@ -96,8 +96,6 @@ import java.util.Locale;
|
||||
}
|
||||
|
||||
public static final String MUXER_STOPPING_FAILED_ERROR_MESSAGE = "Failed to stop the MediaMuxer";
|
||||
public static final String MUXER_NAME =
|
||||
checkNotNull(MediaMuxer.class.getPackage()).getName() + ":" + SDK_INT;
|
||||
|
||||
// MediaMuxer supported sample formats are documented in MediaMuxer.addTrack(MediaFormat).
|
||||
private static final ImmutableList<String> SUPPORTED_VIDEO_SAMPLE_MIME_TYPES =
|
||||
|
@ -22,7 +22,6 @@ import android.media.MediaCodec.BufferInfo;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.C;
|
||||
import androidx.media3.common.Format;
|
||||
import androidx.media3.common.MediaLibraryInfo;
|
||||
import androidx.media3.common.Metadata;
|
||||
import androidx.media3.common.MimeTypes;
|
||||
import androidx.media3.common.util.Log;
|
||||
@ -206,9 +205,6 @@ public final class InAppMuxer implements Muxer {
|
||||
}
|
||||
}
|
||||
|
||||
public static final String MUXER_NAME =
|
||||
"androidx.media3.media3-muxer:" + MediaLibraryInfo.VERSION;
|
||||
|
||||
private static final String TAG = "InAppMuxer";
|
||||
private static final int TRACK_ID_UNSET = -1;
|
||||
|
||||
|
@ -1580,15 +1580,7 @@ public final class Transformer {
|
||||
}
|
||||
DebugTraceUtil.reset();
|
||||
if (canCollectEditingMetrics()) {
|
||||
String exporterName =
|
||||
checkNotNull(this.getClass().getPackage()).getName() + ":" + MediaLibraryInfo.VERSION;
|
||||
String muxerName = null;
|
||||
if (muxerFactory instanceof InAppMuxer.Factory) {
|
||||
muxerName = InAppMuxer.MUXER_NAME;
|
||||
} else if (muxerFactory instanceof FrameworkMuxer.Factory) {
|
||||
muxerName = FrameworkMuxer.MUXER_NAME;
|
||||
}
|
||||
editingMetricsCollector = new EditingMetricsCollector(context, exporterName, muxerName);
|
||||
editingMetricsCollector = new EditingMetricsCollector(context);
|
||||
}
|
||||
transformerInternal =
|
||||
new TransformerInternal(
|
||||
|
Loading…
x
Reference in New Issue
Block a user