Class DefaultAllocator

  • All Implemented Interfaces:
    Allocator

    @Deprecated
    public final class DefaultAllocator
    extends Object
    implements Allocator
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Default implementation of Allocator.
    • Constructor Detail

      • DefaultAllocator

        public DefaultAllocator​(boolean trimOnReset,
                                int individualAllocationSize)
        Deprecated.
        Constructs an instance without creating any Allocations up front.
        Parameters:
        trimOnReset - Whether memory is freed when the allocator is reset. Should be true unless the allocator will be re-used by multiple player instances.
        individualAllocationSize - The length of each individual Allocation.
      • DefaultAllocator

        public DefaultAllocator​(boolean trimOnReset,
                                int individualAllocationSize,
                                int initialAllocationCount)
        Deprecated.
        Constructs an instance with some Allocations created up front.

        Note: Allocations created up front will never be discarded by trim().

        Parameters:
        trimOnReset - Whether memory is freed when the allocator is reset. Should be true unless the allocator will be re-used by multiple player instances.
        individualAllocationSize - The length of each individual Allocation.
        initialAllocationCount - The number of allocations to create up front.