mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Don't log removed encoders
We shouldn't have this logging unless we really need it to debug a specific problem, as it can be noisy (even at debug level). PiperOrigin-RevId: 512904412
This commit is contained in:
parent
78357e42d2
commit
3634e552e6
1 changed files with 4 additions and 25 deletions
|
|
@ -32,7 +32,6 @@ import android.util.Pair;
|
|||
import android.util.Size;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.Format;
|
||||
import com.google.android.exoplayer2.util.Log;
|
||||
import com.google.android.exoplayer2.util.MimeTypes;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import com.google.android.exoplayer2.video.ColorInfo;
|
||||
|
|
@ -461,8 +460,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
|||
return abs(
|
||||
requestedWidth * requestedHeight
|
||||
- closestSupportedResolution.getWidth() * closestSupportedResolution.getHeight());
|
||||
},
|
||||
/* filterName= */ "resolution");
|
||||
});
|
||||
}
|
||||
|
||||
/** Returns a list of encoders that support the requested bitrate most closely. */
|
||||
|
|
@ -474,8 +472,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
|||
int achievableBitrate =
|
||||
EncoderUtil.getSupportedBitrateRange(encoderInfo, mimeType).clamp(requestedBitrate);
|
||||
return abs(achievableBitrate - requestedBitrate);
|
||||
},
|
||||
/* filterName= */ "bitrate");
|
||||
});
|
||||
}
|
||||
|
||||
/** Returns a list of encoders that support the requested bitrate mode. */
|
||||
|
|
@ -486,8 +483,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
|||
/* cost= */ (encoderInfo) ->
|
||||
EncoderUtil.isBitrateModeSupported(encoderInfo, mimeType, requestedBitrateMode)
|
||||
? 0
|
||||
: Integer.MAX_VALUE, // Drops encoder.
|
||||
/* filterName= */ "bitrate mode");
|
||||
: Integer.MAX_VALUE); // Drops encoder.
|
||||
}
|
||||
|
||||
private static final class VideoEncoderQueryResult {
|
||||
|
|
@ -608,7 +604,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
|||
* costs of all encoders are {@link Integer#MAX_VALUE}.
|
||||
*/
|
||||
private static ImmutableList<MediaCodecInfo> filterEncoders(
|
||||
List<MediaCodecInfo> encoders, EncoderFallbackCost cost, String filterName) {
|
||||
List<MediaCodecInfo> encoders, EncoderFallbackCost cost) {
|
||||
List<MediaCodecInfo> filteredEncoders = new ArrayList<>(encoders.size());
|
||||
|
||||
int minGap = Integer.MAX_VALUE;
|
||||
|
|
@ -628,10 +624,6 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
|||
}
|
||||
}
|
||||
|
||||
if (filteredEncoders.size() != encoders.size()) {
|
||||
logRemovedEncoders(encoders, filteredEncoders, filterName);
|
||||
}
|
||||
|
||||
return ImmutableList.copyOf(filteredEncoders);
|
||||
}
|
||||
|
||||
|
|
@ -664,17 +656,4 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
|||
/* isDecoder= */ false,
|
||||
format);
|
||||
}
|
||||
|
||||
private static void logRemovedEncoders(
|
||||
List<MediaCodecInfo> encoders, List<MediaCodecInfo> filteredEncoders, String filterName) {
|
||||
List<MediaCodecInfo> removedEncoders = new ArrayList<>(encoders);
|
||||
removedEncoders.removeAll(filteredEncoders);
|
||||
StringBuilder stringBuilder =
|
||||
new StringBuilder("Encoders removed for ").append(filterName).append(":\n");
|
||||
for (int i = 0; i < removedEncoders.size(); i++) {
|
||||
MediaCodecInfo encoderInfo = removedEncoders.get(i);
|
||||
stringBuilder.append(Util.formatInvariant(" %s\n", encoderInfo.getName()));
|
||||
}
|
||||
Log.d(TAG, stringBuilder.toString());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue