Added in API level 34

AdBuffer


class AdBuffer : Parcelable
kotlin.Any
   ↳ android.media.tv.AdBuffer

Buffer for advertisement data.

Summary

Inherited constants
Public constructors
AdBuffer(id: Int, mimeType: String, buffer: SharedMemory, offset: Int, length: Int, presentationTimeUs: Long, flags: Int)

Public methods
Int

Int

Gets the buffer flags for this ad buffer.

Int

Gets corresponding AD request ID.

Int

Gets the data length of this ad buffer.

String

Gets the mime type of the data.

Int

Gets the offset into the shared memory to begin mapping.

Long

Gets the presentation time.

SharedMemory

Gets the SharedMemory which stores the data.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<AdBuffer!>

Public constructors

AdBuffer

Added in API level 34
AdBuffer(
    id: Int,
    mimeType: String,
    buffer: SharedMemory,
    offset: Int,
    length: Int,
    presentationTimeUs: Long,
    flags: Int)
Parameters
mimeType String: This value cannot be null.
buffer SharedMemory: This value cannot be null.
flags Int: Value is either 0 or a combination of android.media.MediaCodec#BUFFER_FLAG_SYNC_FRAME, android.media.MediaCodec#BUFFER_FLAG_KEY_FRAME, android.media.MediaCodec#BUFFER_FLAG_CODEC_CONFIG, android.media.MediaCodec#BUFFER_FLAG_END_OF_STREAM, android.media.MediaCodec#BUFFER_FLAG_PARTIAL_FRAME, android.media.MediaCodec.BUFFER_FLAG_MUXER_DATA, and android.media.MediaCodec#BUFFER_FLAG_DECODE_ONLY

Public methods

describeContents

Added in API level 34
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getFlags

Added in API level 34
fun getFlags(): Int

Gets the buffer flags for this ad buffer.

Return
Int The buffer flags for this ad buffer. Value is either 0 or a combination of android.media.MediaCodec#BUFFER_FLAG_SYNC_FRAME, android.media.MediaCodec#BUFFER_FLAG_KEY_FRAME, android.media.MediaCodec#BUFFER_FLAG_CODEC_CONFIG, android.media.MediaCodec#BUFFER_FLAG_END_OF_STREAM, android.media.MediaCodec#BUFFER_FLAG_PARTIAL_FRAME, android.media.MediaCodec.BUFFER_FLAG_MUXER_DATA, and android.media.MediaCodec#BUFFER_FLAG_DECODE_ONLY

getId

Added in API level 34
fun getId(): Int

Gets corresponding AD request ID.

Return
Int The ID of the ad request

getLength

Added in API level 34
fun getLength(): Int

Gets the data length of this ad buffer.

Return
Int The data length of this ad buffer in bytes.

getMimeType

Added in API level 34
fun getMimeType(): String

Gets the mime type of the data.

Return
String The mime type of the data. This value cannot be null.

getOffset

Added in API level 34
fun getOffset(): Int

Gets the offset into the shared memory to begin mapping.

Return
Int The offset of this ad buffer in the shared memory in bytes.

getPresentationTimeUs

Added in API level 34
fun getPresentationTimeUs(): Long

Gets the presentation time.

Return
Long The presentation time in microseconds.

getSharedMemory

Added in API level 34
fun getSharedMemory(): SharedMemory

Gets the SharedMemory which stores the data.

Information on how the data in this buffer is formatted can be found using AdRequest.getMetadata()

This data lives in a SharedMemory instance because of the potentially large amount of data needed to store the ad. This optimizes the data communication between the ad data source and the service responsible for its display.

Return
SharedMemory The SharedMemory that stores the data for this ad buffer. This value cannot be null.

writeToParcel

Added in API level 34
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 34
static val CREATOR: Parcelable.Creator<AdBuffer!>