Back to Exoplayer

Allocator (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/Allocator.html

latest4.3 KB
Original Source

Package com.google.android.exoplayer2.upstream

Interface Allocator

  • All Known Implementing Classes:DefaultAllocator

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceAllocator

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.

A source of allocations.

Nested Class Summary

Nested Classes | Modifier and Type | Interface | Description | | --- | --- | --- | | static interface | Allocator.AllocationNode | Deprecated.

A node in a chain of Allocations. |

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | Allocation | allocate() | Deprecated.

Obtain an Allocation. | | int | getIndividualAllocationLength() | Deprecated.

Returns the length of each individual Allocation. | | int | getTotalBytesAllocated() | Deprecated.

Returns the total number of bytes currently allocated. | | void | release​(Allocation allocation) | Deprecated.

Releases an Allocation back to the allocator. | | void | release​(Allocator.AllocationNode allocationNode) | Deprecated.

Releases all Allocations in the chain starting at the given Allocator.AllocationNode. | | void | trim() | Deprecated.

Hints to the allocator that it should make a best effort to release any excess Allocations. |

Method Detail

- 

allocate

[Allocation](Allocation.html "class in com.google.android.exoplayer2.upstream")allocate()

Deprecated.

Obtain an Allocation.

When the caller has finished with the Allocation, it should be returned by calling release(Allocation).

Returns:The Allocation.

- 

release

void release​([Allocation](Allocation.html "class in com.google.android.exoplayer2.upstream")allocation)

Deprecated.

Releases an Allocation back to the allocator. Parameters:allocation - The Allocation being released.

- 

release

void release​([Allocator.AllocationNode](Allocator.AllocationNode.html "interface in com.google.android.exoplayer2.upstream")allocationNode)

Deprecated.

Releases all Allocations in the chain starting at the given Allocator.AllocationNode.

Implementations must not make memory allocations.

- 

trim

void trim()

Deprecated.

Hints to the allocator that it should make a best effort to release any excess Allocations.

- 

getTotalBytesAllocated

int getTotalBytesAllocated()

Deprecated.

Returns the total number of bytes currently allocated.

- 

getIndividualAllocationLength

int getIndividualAllocationLength()

Deprecated.

Returns the length of each individual Allocation.