Media
Summary
Typedefs |
|
---|---|
AImage
|
typedefstruct AImage
AImage is an opaque type that provides access to image generated by AImageReader. |
AImageCropRect
|
typedefstruct AImageCropRect
Data type describing an cropped rectangle returned by AImage_getCropRect. |
AImageReader
|
typedefstruct AImageReader
AImage is an opaque type that allows direct application access to image data rendered into a ANativeWindow. |
AImageReader_BufferRemovedCallback)(void *context, AImageReader *reader, AHardwareBuffer *buffer)
|
typedefvoid(*
Signature of the callback which is called when AImageReader is about to remove a buffer. |
AImageReader_BufferRemovedListener
|
typedef A listener to the AHardwareBuffer removal event, use AImageReader_setBufferRemovedListener to register the listener object to AImageReader. |
AImageReader_ImageCallback)(void *context, AImageReader *reader)
|
typedefvoid(*
Signature of the callback which is called when a new image is available from AImageReader. |
AImageReader_ImageListener
|
typedefstruct AImageReader_ImageListener
|
AMediaCodec
|
typedefstruct AMediaCodec
|
AMediaCodecBufferInfo
|
typedefstruct AMediaCodecBufferInfo
|
AMediaCodecCryptoInfo
|
typedefstruct AMediaCodecCryptoInfo
|
AMediaCodecOnAsyncError)(AMediaCodec *codec, void *userdata, media_status_t error, int32_t actionCode, const char *detail)
|
typedefvoid(*
Called when the MediaCodec encountered an error. |
AMediaCodecOnAsyncFormatChanged)(AMediaCodec *codec, void *userdata, AMediaFormat *format)
|
typedefvoid(*
Called when the output format has changed. |
AMediaCodecOnAsyncInputAvailable)(AMediaCodec *codec, void *userdata, int32_t index)
|
typedefvoid(*
Called when an input buffer becomes available. |
AMediaCodecOnAsyncNotifyCallback
|
typedef |
AMediaCodecOnAsyncOutputAvailable)(AMediaCodec *codec, void *userdata, int32_t index, AMediaCodecBufferInfo *bufferInfo)
|
typedefvoid(*
Called when an output buffer becomes available. |
AMediaCodecOnFrameRendered)(AMediaCodec *codec, void *userdata, int64_t mediaTimeUs, int64_t systemNano)
|
typedefvoid(*
Called when an output frame has rendered on the output surface. |
AMediaCrypto
|
typedefstruct AMediaCrypto
|
AMediaDataSource
|
typedefstruct AMediaDataSource
|
AMediaDataSourceClose)(void *userdata)
|
typedefvoid(*
Called to close the data source, unblock reads, and release associated resources. |
AMediaDataSourceGetAvailableSize)(void *userdata, off64_t offset)
|
typedefssize_t(*
Called to get an estimate of the number of bytes that can be read from this data source starting at offset without blocking for I/O. |
AMediaDataSourceGetSize)(void *userdata)
|
typedefssize_t(*
Called to get the size of the data source. |
AMediaDataSourceReadAt)(void *userdata, off64_t offset, void *buffer, size_t size)
|
typedefssize_t(*
Called to request data from the given offset . |
AMediaDrm
|
typedefstruct AMediaDrm
|
AMediaDrmEventListener)(AMediaDrm *, const AMediaDrmSessionId *sessionId, AMediaDrmEventType eventType, int extra, const uint8_t *data, size_t dataSize)
|
typedefvoid(*
|
AMediaDrmEventType
|
typedefenum AMediaDrmEventType
|
AMediaDrmExpirationUpdateListener)(AMediaDrm *, const AMediaDrmSessionId *sessionId, int64_t expiryTimeInMS)
|
typedefvoid(*
|
AMediaDrmKeyId
|
typedef |
AMediaDrmKeyRequestType
|
typedef Introduced in API 33. |
AMediaDrmKeySetId
|
typedef |
AMediaDrmKeyStatus
|
typedefstruct AMediaDrmKeyStatus
|
AMediaDrmKeyStatusType
|
typedefenum AMediaKeyStatusType
|
AMediaDrmKeyType
|
typedefenum AMediaDrmKeyType
|
AMediaDrmKeyValue
|
typedefstruct AMediaDrmKeyValuePair
Data type containing {key, value} pair. |
AMediaDrmKeysChangeListener)(AMediaDrm *, const AMediaDrmSessionId *sessionId, const AMediaDrmKeyStatus *keyStatus, size_t numKeys, bool hasNewUsableKey)
|
typedefvoid(*
|
AMediaDrmScope
|
typedef |
AMediaDrmSecureStop
|
typedef |
AMediaDrmSessionId
|
typedef |
AMediaExtractor
|
typedefstruct AMediaExtractor
|
AMediaFormat
|
typedefstruct AMediaFormat
|
AMediaMuxer
|
typedefstruct AMediaMuxer
|
AMediaUUID[16]
|
typedefuint8_t
|
ANativeWindow
|
typedefstruct ANativeWindow
|
PsshEntry
|
typedefstruct PsshEntry
mapping of crypto scheme uuid to the scheme specific data for that scheme |
PsshInfo
|
typedefstruct PsshInfo
list of crypto schemes and their data |
Functions |
|
---|---|
AImageReader_acquireLatestImage(AImageReader *reader, AImage **image)
|
Acquire the latest AImage from the image reader's queue, dropping older images.
|
AImageReader_acquireLatestImageAsync(AImageReader *reader, AImage **image, int *acquireFenceFd)
|
Acquire the latest AImage from the image reader's queue asynchronously, dropping older images.
|
AImageReader_acquireNextImage(AImageReader *reader, AImage **image)
|
Acquire the next AImage from the image reader's queue.
|
AImageReader_acquireNextImageAsync(AImageReader *reader, AImage **image, int *acquireFenceFd)
|
Acquire the next AImage from the image reader's queue asynchronously.
|
AImageReader_delete(AImageReader *reader)
|
void
Delete an AImageReader and return all images generated by this reader to system.
|
AImageReader_getFormat(const AImageReader *reader, int32_t *format)
|
Query the format of the AImage generated by this reader.
|
AImageReader_getHeight(const AImageReader *reader, int32_t *height)
|
Query the default height of the AImage generated by this reader, in pixels.
|
AImageReader_getMaxImages(const AImageReader *reader, int32_t *maxImages)
|
Query the maximum number of concurrently acquired AImages of this reader.
|
AImageReader_getWidth(const AImageReader *reader, int32_t *width)
|
Query the default width of the AImage generated by this reader, in pixels.
|
AImageReader_getWindow(AImageReader *reader, ANativeWindow **window)
|
Get a ANativeWindow that can be used to produce AImage for this image reader.
|
AImageReader_getWindowNativeHandle(AImageReader *reader, native_handle_t **handle)
|
|
AImageReader_new(int32_t width, int32_t height, int32_t format, int32_t maxImages, AImageReader **reader)
|
Create a new reader for images of the desired size and format.
|
AImageReader_newWithDataSpace(int32_t width, int32_t height, uint64_t usage, int32_t maxImages, uint32_t hardwareBufferFormat, int32_t dataSpace, AImageReader **reader)
|
AImageReader constructor similar to AImageReader_newWithUsage that takes two additional parameters to build the format of the Image.
|
AImageReader_newWithUsage(int32_t width, int32_t height, int32_t format, uint64_t usage, int32_t maxImages, AImageReader **reader)
|
AImageReader constructor similar to AImageReader_new that takes an additional parameter for the consumer usage.
|
AImageReader_setBufferRemovedListener(AImageReader *reader, AImageReader_BufferRemovedListener *listener)
|
Set the onBufferRemoved listener of this image reader.
|
AImageReader_setImageListener(AImageReader *reader, AImageReader_ImageListener *listener)
|
Set the onImageAvailable listener of this image reader.
|
AImage_delete(AImage *image)
|
void
Return the image back the the system and delete the AImage object from memory.
|
AImage_deleteAsync(AImage *image, int releaseFenceFd)
|
void
Return the image back the the system and delete the AImage object from memory asynchronously.
|
AImage_getCropRect(const AImage *image, AImageCropRect *rect)
|
Query the cropped rectangle of the input AImage.
|
AImage_getDataSpace(const AImage *image, int32_t *dataSpace)
|
Query the dataspace of the input AImage.
|
AImage_getFormat(const AImage *image, int32_t *format)
|
Query the format of the input AImage.
|
AImage_getHardwareBuffer(const AImage *image, AHardwareBuffer **buffer)
|
Get the hardware buffer handle of the input image intended for GPU and/or hardware access.
|
AImage_getHeight(const AImage *image, int32_t *height)
|
Query the height of the input AImage.
|
AImage_getNumberOfPlanes(const AImage *image, int32_t *numPlanes)
|
Query the number of planes of the input AImage.
|
AImage_getPlaneData(const AImage *image, int planeIdx, uint8_t **data, int *dataLength)
|
Get the data pointer of the input image for direct application access.
|
AImage_getPlanePixelStride(const AImage *image, int planeIdx, int32_t *pixelStride)
|
Query the pixel stride of the input AImage.
|
AImage_getPlaneRowStride(const AImage *image, int planeIdx, int32_t *rowStride)
|
Query the row stride of the input AImage.
|
AImage_getTimestamp(const AImage *image, int64_t *timestampNs)
|
Query the timestamp of the input AImage.
|
AImage_getWidth(const AImage *image, int32_t *width)
|
Query the width of the input AImage.
|
AMediaCodecActionCode_isRecoverable(int32_t actionCode)
|
bool
Returns true if the codec cannot proceed further, but can be recovered by stopping, configuring, and starting again.
|
AMediaCodecActionCode_isTransient(int32_t actionCode)
|
bool
Returns true if the codec error is a transient issue, perhaps due to resource constraints, and that the method (or encoding/decoding) may be retried at a later time.
|
AMediaCodecCryptoInfo_delete(AMediaCodecCryptoInfo *)
|
Delete an AMediaCodecCryptoInfo created previously with AMediaCodecCryptoInfo_new, or obtained from AMediaExtractor.
|
AMediaCodecCryptoInfo_getClearBytes(AMediaCodecCryptoInfo *, size_t *dst)
|
The number of leading unencrypted bytes in each subsample.
|
AMediaCodecCryptoInfo_getEncryptedBytes(AMediaCodecCryptoInfo *, size_t *dst)
|
The number of trailing encrypted bytes in each subsample.
|
AMediaCodecCryptoInfo_getIV(AMediaCodecCryptoInfo *, uint8_t *dst)
|
A 16-byte initialization vector.
|
AMediaCodecCryptoInfo_getKey(AMediaCodecCryptoInfo *, uint8_t *dst)
|
A 16-byte opaque key.
|
AMediaCodecCryptoInfo_getMode(AMediaCodecCryptoInfo *)
|
cryptoinfo_mode_t
The type of encryption that has been applied, one of AMEDIACODECRYPTOINFO_MODE_CLEAR or AMEDIACODECRYPTOINFO_MODE_AES_CTR.
|
AMediaCodecCryptoInfo_getNumSubSamples(AMediaCodecCryptoInfo *)
|
size_t
The number of subsamples that make up the buffer's contents.
|
AMediaCodecCryptoInfo_new(int numsubsamples, uint8_t key[16], uint8_t iv[16], cryptoinfo_mode_t mode, size_t *clearbytes, size_t *encryptedbytes)
|
AMediaCodecCryptoInfo *
Create an AMediaCodecCryptoInfo from scratch.
|
AMediaCodecCryptoInfo_setPattern(AMediaCodecCryptoInfo *info, cryptoinfo_pattern_t *pattern)
|
void
Set the crypto pattern on an AMediaCryptoInfo object.
|
AMediaCodec_configure(AMediaCodec *, const AMediaFormat *format, ANativeWindow *surface, AMediaCrypto *crypto, uint32_t flags)
|
Configure the codec.
|
AMediaCodec_createCodecByName(const char *name)
|
AMediaCodec *
Create codec by name.
|
AMediaCodec_createDecoderByType(const char *mime_type)
|
AMediaCodec *
Create codec by mime type.
|
AMediaCodec_createEncoderByType(const char *mime_type)
|
AMediaCodec *
Create encoder by name.
|
AMediaCodec_createInputSurface(AMediaCodec *mData, ANativeWindow **surface)
|
Creates a Surface that can be used as the input to encoder, in place of input buffers.
|
AMediaCodec_createPersistentInputSurface(ANativeWindow **surface)
|
Creates a persistent Surface that can be used as the input to encoder.
|
AMediaCodec_delete(AMediaCodec *)
|
Delete the codec and free its resources.
|
AMediaCodec_dequeueInputBuffer(AMediaCodec *, int64_t timeoutUs)
|
ssize_t
Get the index of the next available input buffer.
|
AMediaCodec_dequeueOutputBuffer(AMediaCodec *, AMediaCodecBufferInfo *info, int64_t timeoutUs)
|
ssize_t
Get the index of the next available buffer of processed data.
|
AMediaCodec_flush(AMediaCodec *)
|
|
AMediaCodec_getBufferFormat(AMediaCodec *, size_t index)
|
AMediaFormat *
Get format of the buffer.
|
AMediaCodec_getInputBuffer(AMediaCodec *, size_t idx, size_t *out_size)
|
uint8_t *
Get an input buffer.
|
AMediaCodec_getInputFormat(AMediaCodec *)
|
AMediaFormat *
Call this after AMediaCodec_configure() returns successfully to get the input format accepted by the codec.
|
AMediaCodec_getName(AMediaCodec *, char **out_name)
|
Get the component name.
|
AMediaCodec_getOutputBuffer(AMediaCodec *, size_t idx, size_t *out_size)
|
uint8_t *
Get an output buffer.
|
AMediaCodec_getOutputFormat(AMediaCodec *)
|
AMediaFormat *
Returns the format of the codec's output.
|
AMediaCodec_queueInputBuffer(AMediaCodec *, size_t idx, _off_t_compat offset, size_t size, uint64_t time, uint32_t flags)
|
Send the specified buffer to the codec for processing.
|
AMediaCodec_queueSecureInputBuffer(AMediaCodec *, size_t idx, _off_t_compat offset, AMediaCodecCryptoInfo *, uint64_t time, uint32_t flags)
|
Send the specified buffer to the codec for processing.
|
AMediaCodec_releaseCrypto(AMediaCodec *)
|
Release the crypto if applicable.
|
AMediaCodec_releaseName(AMediaCodec *, char *name)
|
void
Free the memory pointed by name which is returned by AMediaCodec_getName.
|
AMediaCodec_releaseOutputBuffer(AMediaCodec *, size_t idx, bool render)
|
If you are done with a buffer, use this call to return the buffer to the codec.
|
AMediaCodec_releaseOutputBufferAtTime(AMediaCodec *mData, size_t idx, int64_t timestampNs)
|
If you are done with a buffer, use this call to update its surface timestamp and return it to the codec to render it on the output surface.
|
AMediaCodec_setAsyncNotifyCallback(AMediaCodec *, AMediaCodecOnAsyncNotifyCallback callback, void *userdata)
|
Set an asynchronous callback for actionable AMediaCodec events.
|
AMediaCodec_setInputSurface(AMediaCodec *mData, ANativeWindow *surface)
|
Set a persistent-surface that can be used as the input to encoder, in place of input buffers.
|
AMediaCodec_setOnFrameRenderedCallback(AMediaCodec *, AMediaCodecOnFrameRendered callback, void *userdata)
|
Registers a callback to be invoked when an output frame is rendered on the output surface.
|
AMediaCodec_setOutputSurface(AMediaCodec *, ANativeWindow *surface)
|
Dynamically sets the output surface of a codec.
|
AMediaCodec_setParameters(AMediaCodec *mData, const AMediaFormat *params)
|
Signal additional parameters to the codec instance.
|
AMediaCodec_signalEndOfInputStream(AMediaCodec *mData)
|
Signals end-of-stream on input.
|
AMediaCodec_start(AMediaCodec *)
|
Start the codec.
|
AMediaCodec_stop(AMediaCodec *)
|
Stop the codec.
|
AMediaCrypto_delete(AMediaCrypto *crypto)
|
void
Available since API level 21.
|
AMediaCrypto_isCryptoSchemeSupported(const AMediaUUID uuid)
|
bool
Available since API level 21.
|
AMediaCrypto_new(const AMediaUUID uuid, const void *initData, size_t initDataSize)
|
AMediaCrypto *
Available since API level 21.
|
AMediaCrypto_requiresSecureDecoderComponent(const char *mime)
|
bool
Available since API level 21.
|
AMediaDataSource_close(AMediaDataSource *)
|
void
Close the data source, unblock reads, and release associated resources.
|
AMediaDataSource_delete(AMediaDataSource *)
|
void
Delete a previously created media data source.
|
AMediaDataSource_new()
|
AMediaDataSource *
Create new media data source.
|
AMediaDataSource_newUri(const char *uri, int numheaders, const char *const *key_values)
|
AMediaDataSource *
Create new media data source.
|
AMediaDataSource_setClose(AMediaDataSource *, AMediaDataSourceClose)
|
void
Set a custom callback to receive signal from the NDK media framework when the data source is closed.
|
AMediaDataSource_setGetAvailableSize(AMediaDataSource *, AMediaDataSourceGetAvailableSize)
|
void
Set a custom callback for supplying the estimated number of bytes that can be read from this data source starting at an offset without blocking for I/O.
|
AMediaDataSource_setGetSize(AMediaDataSource *, AMediaDataSourceGetSize)
|
void
Set a custom callback for supplying the size of the data source to the NDK media framework.
|
AMediaDataSource_setReadAt(AMediaDataSource *, AMediaDataSourceReadAt)
|
void
Set a custom callback for supplying random access media data to the NDK media framework.
|
AMediaDataSource_setUserdata(AMediaDataSource *, void *userdata)
|
void
Set an user provided opaque handle.
|
AMediaDrm_closeSession(AMediaDrm *, const AMediaDrmSessionId *sessionId)
|
Close a session on the MediaDrm object that was previously opened with AMediaDrm_openSession.
|
AMediaDrm_createByUUID(const uint8_t *uuid)
|
AMediaDrm *
Create a MediaDrm instance from a UUID.
|
AMediaDrm_decrypt(AMediaDrm *, const AMediaDrmSessionId *sessionId, const char *cipherAlgorithm, uint8_t *keyId, uint8_t *iv, const uint8_t *input, uint8_t *output, size_t dataSize)
|
|
AMediaDrm_encrypt(AMediaDrm *, const AMediaDrmSessionId *sessionId, const char *cipherAlgorithm, uint8_t *keyId, uint8_t *iv, const uint8_t *input, uint8_t *output, size_t dataSize)
|
In addition to supporting decryption of DASH Common Encrypted Media, the MediaDrm APIs provide the ability to securely deliver session keys from an operator's session key server to a client device, based on the factory-installed root of trust, and then perform encrypt, decrypt, sign and verify operations with the session key on arbitrary user data.
|
AMediaDrm_getKeyRequest(AMediaDrm *, const AMediaDrmScope *scope, const uint8_t *init, size_t initSize, const char *mimeType, AMediaDrmKeyType keyType, const AMediaDrmKeyValue *optionalParameters, size_t numOptionalParameters, const uint8_t **keyRequest, size_t *keyRequestSize)
|
A key request/response exchange occurs between the app and a license server to obtain or release keys used to decrypt encrypted content.
|
AMediaDrm_getKeyRequestWithDefaultUrlAndType(AMediaDrm *, const AMediaDrmScope *scope, const uint8_t *init, size_t initSize, const char *mimeType, AMediaDrmKeyType keyType, const AMediaDrmKeyValue *optionalParameters, size_t numOptionalParameters, const uint8_t **keyRequest, size_t *keyRequestSize, const char **defaultUrl, AMediaDrmKeyRequestType *keyRequestType)
|
A key request/response exchange occurs between the app and a license server to obtain or release keys used to decrypt encrypted content.
|
AMediaDrm_getPropertyByteArray(AMediaDrm *, const char *propertyName, AMediaDrmByteArray *propertyValue)
|
Read a DRM engine plugin byte array property value, given the property name string.
|
AMediaDrm_getPropertyString(AMediaDrm *, const char *propertyName, const char **propertyValue)
|
Read a DRM engine plugin String property value, given the property name string.
|
AMediaDrm_getProvisionRequest(AMediaDrm *, const uint8_t **provisionRequest, size_t *provisionRequestSize, const char **serverUrl)
|
A provision request/response exchange occurs between the app and a provisioning server to retrieve a device certificate.
|
AMediaDrm_getSecureStops(AMediaDrm *, AMediaDrmSecureStop *secureStops, size_t *numSecureStops)
|
A means of enforcing limits on the number of concurrent streams per subscriber across devices is provided via SecureStop.
|
AMediaDrm_isCryptoSchemeSupported(const uint8_t *uuid, const char *mimeType)
|
bool
Query if the given scheme identified by its UUID is supported on this device, and whether the drm plugin is able to handle the media container format specified by mimeType.
|
AMediaDrm_openSession(AMediaDrm *, AMediaDrmSessionId *sessionId)
|
Open a new session with the MediaDrm object.
|
AMediaDrm_provideKeyResponse(AMediaDrm *, const AMediaDrmScope *scope, const uint8_t *response, size_t responseSize, AMediaDrmKeySetId *keySetId)
|
A key response is received from the license server by the app, then it is provided to the DRM engine plugin using provideKeyResponse.
|
AMediaDrm_provideProvisionResponse(AMediaDrm *, const uint8_t *response, size_t responseSize)
|
After a provision response is received by the app, it is provided to the DRM engine plugin using this method.
|
AMediaDrm_queryKeyStatus(AMediaDrm *, const AMediaDrmSessionId *sessionId, AMediaDrmKeyValue *keyValuePairs, size_t *numPairs)
|
Request an informative description of the key status for the session.
|
AMediaDrm_release(AMediaDrm *)
|
void
Release a MediaDrm object.
|
AMediaDrm_releaseSecureStops(AMediaDrm *, const AMediaDrmSecureStop *ssRelease)
|
Process the SecureStop server response message ssRelease.
|
AMediaDrm_removeKeys(AMediaDrm *, const AMediaDrmSessionId *keySetId)
|
Remove the current keys from a session.
|
AMediaDrm_restoreKeys(AMediaDrm *, const AMediaDrmSessionId *sessionId, const AMediaDrmKeySetId *keySetId)
|
Restore persisted offline keys into a new session.
|
AMediaDrm_setOnEventListener(AMediaDrm *, AMediaDrmEventListener listener)
|
Register a callback to be invoked when an event occurs.
|
AMediaDrm_setOnExpirationUpdateListener(AMediaDrm *, AMediaDrmExpirationUpdateListener listener)
|
Register a callback to be invoked when an expiration update event occurs.
|
AMediaDrm_setOnKeysChangeListener(AMediaDrm *, AMediaDrmKeysChangeListener listener)
|
Register a callback to be invoked when a key status change event occurs.
|
AMediaDrm_setPropertyByteArray(AMediaDrm *, const char *propertyName, const uint8_t *value, size_t valueSize)
|
Set a DRM engine plugin byte array property value.
|
AMediaDrm_setPropertyString(AMediaDrm *, const char *propertyName, const char *value)
|
Set a DRM engine plugin String property value.
|
AMediaDrm_sign(AMediaDrm *, const AMediaDrmSessionId *sessionId, const char *macAlgorithm, uint8_t *keyId, uint8_t *message, size_t messageSize, uint8_t *signature, size_t *signatureSize)
|
|
AMediaDrm_verify(AMediaDrm *, const AMediaDrmSessionId *sessionId, const char *macAlgorithm, uint8_t *keyId, const uint8_t *message, size_t messageSize, const uint8_t *signature, size_t signatureSize)
|
|
AMediaExtractor_advance(AMediaExtractor *)
|
bool
Advance to the next sample.
|
AMediaExtractor_delete(AMediaExtractor *)
|
Delete a previously created media extractor.
|
AMediaExtractor_getCachedDuration(AMediaExtractor *)
|
int64_t
Returns the duration of cached media samples downloaded from a network data source (AMediaExtractor_setDataSource with a "http(s)" URI) in microseconds.
|
AMediaExtractor_getFileFormat(AMediaExtractor *)
|
AMediaFormat *
Returns the format of the extractor.
|
AMediaExtractor_getPsshInfo(AMediaExtractor *)
|
PsshInfo *
Get the PSSH info if present.
|
AMediaExtractor_getSampleCryptoInfo(AMediaExtractor *)
|
AMediaCodecCryptoInfo *
Available since API level 21.
|
AMediaExtractor_getSampleFlags(AMediaExtractor *)
|
uint32_t
Read the current sample's flags.
|
AMediaExtractor_getSampleFormat(AMediaExtractor *ex, AMediaFormat *fmt)
|
Read the current sample's metadata format into
fmt . |
AMediaExtractor_getSampleSize(AMediaExtractor *)
|
ssize_t
Returns the size of the current sample in bytes, or -1 when no samples are available (end of stream).
|
AMediaExtractor_getSampleTime(AMediaExtractor *)
|
int64_t
Returns the current sample's presentation time in microseconds.
|
AMediaExtractor_getSampleTrackIndex(AMediaExtractor *)
|
int
Returns the track index the current sample originates from (or -1 if no more samples are available)
|
AMediaExtractor_getTrackCount(AMediaExtractor *)
|
size_t
Return the number of tracks in the previously specified media file.
|
AMediaExtractor_getTrackFormat(AMediaExtractor *, size_t idx)
|
AMediaFormat *
Return the format of the specified track.
|
AMediaExtractor_new()
|
AMediaExtractor *
Create new media extractor.
|
AMediaExtractor_readSampleData(AMediaExtractor *, uint8_t *buffer, size_t capacity)
|
ssize_t
Read the current sample.
|
AMediaExtractor_seekTo(AMediaExtractor *, int64_t seekPosUs, SeekMode mode)
|
Available since API level 21.
|
AMediaExtractor_selectTrack(AMediaExtractor *, size_t idx)
|
Select the specified track.
|
AMediaExtractor_setDataSource(AMediaExtractor *, const char *location)
|
Set the URI from which the extractor will read.
|
AMediaExtractor_setDataSourceCustom(AMediaExtractor *, AMediaDataSource *src)
|
Set the custom data source implementation from which the extractor will read.
|
AMediaExtractor_setDataSourceFd(AMediaExtractor *, int fd, off64_t offset, off64_t length)
|
Set the file descriptor from which the extractor will read.
|
AMediaExtractor_unselectTrack(AMediaExtractor *, size_t idx)
|
Unselect the specified track.
|
AMediaFormat_clear(AMediaFormat *)
|
void
Remove all key/value pairs from the given AMediaFormat.
|
AMediaFormat_copy(AMediaFormat *to, AMediaFormat *from)
|
Copy one AMediaFormat to another.
|
AMediaFormat_delete(AMediaFormat *)
|
Available since API level 21.
|
AMediaFormat_getBuffer(AMediaFormat *, const char *name, void **data, size_t *size)
|
bool
The returned data is owned by the format and remains valid as long as the named entry is part of the format.
|
AMediaFormat_getDouble(AMediaFormat *, const char *name, double *out)
|
bool
Available since API level 28.
|
AMediaFormat_getFloat(AMediaFormat *, const char *name, float *out)
|
bool
Available since API level 21.
|
AMediaFormat_getInt32(AMediaFormat *, const char *name, int32_t *out)
|
bool
Available since API level 21.
|
AMediaFormat_getInt64(AMediaFormat *, const char *name, int64_t *out)
|
bool
Available since API level 21.
|
AMediaFormat_getRect(AMediaFormat *, const char *name, int32_t *left, int32_t *top, int32_t *right, int32_t *bottom)
|
bool
Available since API level 28.
|
AMediaFormat_getSize(AMediaFormat *, const char *name, size_t *out)
|
bool
Available since API level 21.
|
AMediaFormat_getString(AMediaFormat *, const char *name, const char **out)
|
bool
The returned string is owned by the format, and remains valid until the next call to getString, or until the format is deleted.
|
AMediaFormat_new()
|
AMediaFormat *
Available since API level 21.
|
AMediaFormat_setBuffer(AMediaFormat *, const char *name, const void *data, size_t size)
|
void
The provided data is copied into the format.
|
AMediaFormat_setDouble(AMediaFormat *, const char *name, double value)
|
void
Available since API level 28.
|
AMediaFormat_setFloat(AMediaFormat *, const char *name, float value)
|
void
Available since API level 21.
|
AMediaFormat_setInt32(AMediaFormat *, const char *name, int32_t value)
|
void
Available since API level 21.
|
AMediaFormat_setInt64(AMediaFormat *, const char *name, int64_t value)
|
void
Available since API level 21.
|
AMediaFormat_setRect(AMediaFormat *, const char *name, int32_t left, int32_t top, int32_t right, int32_t bottom)
|
void
Available since API level 28.
|
AMediaFormat_setSize(AMediaFormat *, const char *name, size_t value)
|
void
Available since API level 28.
|
AMediaFormat_setString(AMediaFormat *, const char *name, const char *value)
|
void
The provided string is copied into the format.
|
AMediaFormat_toString(AMediaFormat *)
|
const char *
Human readable representation of the format.
|
AMediaMuxer_addTrack(AMediaMuxer *, const AMediaFormat *format)
|
ssize_t
Adds a track with the specified format.
|
AMediaMuxer_append(int fd, AppendMode mode)
|
AMediaMuxer *
Creates a new media muxer for appending data to an existing MPEG4 file.
|
AMediaMuxer_delete(AMediaMuxer *)
|
Delete a previously created media muxer.
|
AMediaMuxer_getTrackCount(AMediaMuxer *)
|
ssize_t
Returns the number of tracks added in the file passed to AMediaMuxer_new or the number of existing tracks in the file passed to AMediaMuxer_append.
|
AMediaMuxer_getTrackFormat(AMediaMuxer *muxer, size_t idx)
|
AMediaFormat *
Returns AMediaFormat of the added track with index idx in the file passed to AMediaMuxer_new or the AMediaFormat of the existing track with index idx in the file passed to AMediaMuxer_append.
|
AMediaMuxer_new(int fd, OutputFormat format)
|
AMediaMuxer *
Create new media muxer.
|
AMediaMuxer_setLocation(AMediaMuxer *, float latitude, float longitude)
|
Set and store the geodata (latitude and longitude) in the output file.
|
AMediaMuxer_setOrientationHint(AMediaMuxer *, int degrees)
|
Sets the orientation hint for output video playback.
|
AMediaMuxer_start(AMediaMuxer *)
|
Start the muxer.
|
AMediaMuxer_stop(AMediaMuxer *)
|
Stops the muxer.
|
AMediaMuxer_writeSampleData(AMediaMuxer *muxer, size_t trackIdx, const uint8_t *data, const AMediaCodecBufferInfo *info)
|
Writes an encoded sample into the muxer.
|
Structs |
|
---|---|
AImageCropRect |
Data type describing an cropped rectangle returned by AImage_getCropRect. |
AImageReader_BufferRemovedListener |
A listener to the AHardwareBuffer removal event, use AImageReader_setBufferRemovedListener to register the listener object to AImageReader. |
AImageReader_ImageListener | |
AMediaCodecBufferInfo | |
AMediaCodecOnAsyncNotifyCallback | |
AMediaDrmByteArray | |
AMediaDrmKeyStatus | |
AMediaDrmKeyValuePair |
Data type containing {key, value} pair. |
PsshEntry |
mapping of crypto scheme uuid to the scheme specific data for that scheme |
PsshInfo |
list of crypto schemes and their data |
cryptoinfo_pattern_t |
Enumerations
Anonymous Enum 114
Declared inmedia/NdkMediaCodec.h
Anonymous Enum 114
Definitions of per-buffer flags for operation with NdkMediaCodec.
The semantics of these enums match those of the same name in android.media.MediaCodec.
Properties | |
---|---|
AMEDIACODEC_BUFFER_FLAG_CODEC_CONFIG
|
|
AMEDIACODEC_BUFFER_FLAG_DECODE_ONLY
|
This indicates that the buffer is decoded and updates the internal state of the decoder, but does not produce any output buffer. Semantics are the same as android.media.MediaCodec#BUFFER_FLAG_DECODE_ONLY |
AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM
|
|
AMEDIACODEC_BUFFER_FLAG_KEY_FRAME
|
This indicates that the (encoded) buffer marked as such contains the data for a key frame. Semantics are the same as android.media.MediaCodec#BUFFER_FLAG_KEY_FRAME |
AMEDIACODEC_BUFFER_FLAG_MUXER_DATA
|
This indicates that the buffer contains non-media data for the muxer to process. Semantics are the same as android.media.MediaCodec#BUFFER_FLAG_MUXER_DATA |
AMEDIACODEC_BUFFER_FLAG_PARTIAL_FRAME
|
Anonymous Enum 115
Declared inmedia/NdkMediaCodec.h
Anonymous Enum 115
Anonymous Enum 116
Declared inmedia/NdkMediaExtractor.h
Anonymous Enum 116
AIMAGE_FORMATS
Declared inmedia/NdkImage.h
AIMAGE_FORMATS
AImage supported formats: AImageReader only guarantees the support for the formats listed here.
Properties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AIMAGE_FORMAT_DEPTH16
|
Android dense depth image format. Each pixel is 16 bits, representing a depth ranging measurement from a depth camera or similar sensor. The 16-bit sample consists of a confidence value and the actual ranging measurement. The confidence value is an estimate of correctness for this sample. It is encoded in the 3 most significant bits of the sample, with a value of 0 representing 100% confidence, a value of 1 representing 0% confidence, a value of 2 representing 1/7, a value of 3 representing 2/7, and so on. As an example, the following sample extracts the range and confidence from the first pixel of a DEPTH16-format AImage, and converts the confidence to a floating-point value between 0 and 1.f inclusive, with 1.f representing maximum confidence:
uint16_t* data; int dataLength; AImage_getPlaneData(image, 0, (uint8_t**)&data, &dataLength); uint16_t depthSample = data[0]; uint16_t depthRange = (depthSample & 0x1FFF); uint16_t depthConfidence = ((depthSample >> 13) & 0x7); float depthPercentage = depthConfidence == 0 ? 1.f : (depthConfidence - 1) / 7.f; This format assumes
y_size = stride * height When produced by a camera, the units for the range are millimeters. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_DEPTH_JPEG
|
Depth augmented compressed JPEG format. JPEG compressed main image along with XMP embedded depth metadata following ISO 16684-1:2011(E). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_DEPTH_POINT_CLOUD
|
Android sparse depth point cloud format. A variable-length list of 3D points plus a confidence value, with each point represented by four floats; first the X, Y, Z position coordinates, and then the confidence value. The number of points is ((size of the buffer in bytes) / 16). The coordinate system and units of the position values depend on the source of the point cloud data. The confidence value is between 0.f and 1.f, inclusive, with 0 representing 0% confidence and 1.f representing 100% confidence in the measured position values. As an example, the following code extracts the first depth point in a DEPTH_POINT_CLOUD format AImage: float* data; int dataLength; AImage_getPlaneData(image, 0, (uint8_t**)&data, &dataLength); float x = data[0]; float y = data[1]; float z = data[2]; float confidence = data[3]; |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_HEIC
|
Compressed HEIC format. This format defines the HEIC brand of High Efficiency Image File Format as described in ISO/IEC 23008-12. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_JPEG
|
Compressed JPEG format. This format is always supported as an output format for the android Camera2 NDK API. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_PRIVATE
|
Android private opaque image format. The choices of the actual format and pixel data layout are entirely up to the device-specific and framework internal implementations, and may vary depending on use cases even for the same device. Also note that the contents of these buffers are not directly accessible to the application. When an AImage of this format is obtained from an AImageReader or AImage_getNumberOfPlanes() method will return zero. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_RAW10
|
Android 10-bit raw format. This is a single-plane, 10-bit per pixel, densely packed (in each row), unprocessed format, usually representing raw Bayer-pattern images coming from an image sensor. In an image buffer with this format, starting from the first pixel of each row, each 4 consecutive pixels are packed into 5 bytes (40 bits). Each one of the first 4 bytes contains the top 8 bits of each pixel, The fifth byte contains the 2 least significant bits of the 4 pixels, the exact layout data for each 4 consecutive pixels is illustrated below (Pi[j] stands for the jth bit of the ith pixel):
This format assumes
size = row stride * heightwhere the row stride is in bytes, not pixels. Since this is a densely packed format, the pixel stride is always 0. The application must use the pixel data layout defined in above table to access each row data. When row stride is equal to (width * (10 / 8)), there will be no padding bytes at the end of each row, the entire image data is densely packed. When stride is larger than (width * (10 / 8)), padding bytes will be present at the end of each row. For example, the AImage object can provide data in this format from a ACameraDevice (if supported) through a AImageReader object. The number of planes returned by AImage_getNumberOfPlanes will always be 1. The pixel stride is undefined (AImage_getPlanePixelStride will return AMEDIA_ERROR_UNSUPPORTED), and the AImage_getPlaneRowStride described the vertical neighboring pixel distance (in bytes) between adjacent rows. See also: AImage See also: AImageReader See also: ACameraDevice |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_RAW12
|
Android 12-bit raw format. This is a single-plane, 12-bit per pixel, densely packed (in each row), unprocessed format, usually representing raw Bayer-pattern images coming from an image sensor. In an image buffer with this format, starting from the first pixel of each row, each two consecutive pixels are packed into 3 bytes (24 bits). The first and second byte contains the top 8 bits of first and second pixel. The third byte contains the 4 least significant bits of the two pixels, the exact layout data for each two consecutive pixels is illustrated below (Pi[j] stands for the jth bit of the ith pixel):
This format assumes
size = row stride * heightwhere the row stride is in bytes, not pixels. Since this is a densely packed format, the pixel stride is always 0. The application must use the pixel data layout defined in above table to access each row data. When row stride is equal to (width * (12 / 8)), there will be no padding bytes at the end of each row, the entire image data is densely packed. When stride is larger than (width * (12 / 8)), padding bytes will be present at the end of each row. For example, the AImage object can provide data in this format from a ACameraDevice (if supported) through a AImageReader object. The number of planes returned by AImage_getNumberOfPlanes will always be 1. The pixel stride is undefined (AImage_getPlanePixelStride will return AMEDIA_ERROR_UNSUPPORTED), and the AImage_getPlaneRowStride described the vertical neighboring pixel distance (in bytes) between adjacent rows. See also: AImage See also: AImageReader See also: ACameraDevice |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_RAW16
|
16 bits per pixel raw camera sensor image format, usually representing a single-channel Bayer-mosaic image. The layout of the color mosaic, the maximum and minimum encoding values of the raw pixel data, the color space of the image, and all other needed information to interpret a raw sensor image must be queried from the ACameraDevice which produced the image. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_RAW_PRIVATE
|
Private raw camera sensor image format, a single channel image with implementation depedent pixel layout. AIMAGE_FORMAT_RAW_PRIVATE is a format for unprocessed raw image buffers coming from an image sensor. The actual structure of buffers of this format is implementation-dependent. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_RGBA_8888
|
32 bits RGBA format, 8 bits for each of the four channels. Corresponding formats:
See also: AImage See also: AImageReader See also: AHardwareBuffer |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_RGBA_FP16
|
64 bits RGBA format, 16 bits for each of the four channels. Corresponding formats:
See also: AImage See also: AImageReader See also: AHardwareBuffer |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_RGBX_8888
|
32 bits RGBX format, 8 bits for each of the four channels. The values of the alpha channel bits are ignored (image is assumed to be opaque). Corresponding formats:
See also: AImage See also: AImageReader See also: AHardwareBuffer |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_RGB_565
|
16 bits RGB format, 5 bits for Red channel, 6 bits for Green channel, and 5 bits for Blue channel. Corresponding formats:
See also: AImage See also: AImageReader See also: AHardwareBuffer |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_RGB_888
|
24 bits RGB format, 8 bits for each of the three channels. Corresponding formats:
See also: AImage See also: AImageReader See also: AHardwareBuffer |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_Y8
|
Android Y8 format. Y8 is a planar format comprised of a WxH Y plane only, with each pixel being represented by 8 bits. This format assumes
size = stride * height For example, the AImage object can provide data in this format from a ACameraDevice (if supported) through a AImageReader object. The number of planes returned by AImage_getNumberOfPlanes will always be 1. The pixel stride returned by AImage_getPlanePixelStride will always be 1, and the AImage_getPlaneRowStride described the vertical neighboring pixel distance (in bytes) between adjacent rows. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AIMAGE_FORMAT_YUV_420_888
|
Multi-plane Android YUV 420 format. This format is a generic YCbCr format, capable of describing any 4:2:0 chroma-subsampled planar or semiplanar buffer (but not fully interleaved), with 8 bits per color sample. Images in this format are always represented by three separate buffers of data, one for each color plane. Additional information always accompanies the buffers, describing the row stride and the pixel stride for each plane. The order of planes is guaranteed such that plane #0 is always Y, plane #1 is always U (Cb), and plane #2 is always V (Cr). The Y-plane is guaranteed not to be interleaved with the U/V planes (in particular, pixel stride is always 1 in AImage_getPlanePixelStride). The U/V planes are guaranteed to have the same row stride and pixel stride, that is, the return value of AImage_getPlaneRowStride for the U/V plane are guaranteed to be the same, and the return value of AImage_getPlanePixelStride for the U/V plane are also guaranteed to be the same. For example, the AImage object can provide data in this format from a ACameraDevice through an AImageReader object. This format is always supported as an output format for the android Camera2 NDK API. See also: AImage See also: AImageReader See also: ACameraDevice |
AMediaDrmEventType
Declared inmedia/NdkMediaDrm.h
AMediaDrmEventType
AMediaDrmKeyRequestType
Declared inmedia/NdkMediaDrm.h
AMediaDrmKeyRequestType
Introduced in API 33.
AMediaDrmKeyType
Declared inmedia/NdkMediaDrm.h
AMediaDrmKeyType
AMediaKeyStatusType
Declared inmedia/NdkMediaDrm.h
AMediaKeyStatusType
AppendMode
Declared inmedia/NdkMediaMuxer.h
AppendMode
OutputFormat
Declared inmedia/NdkMediaMuxer.h
OutputFormat
Defines the output format.
These constants are used with constructor.
These enums match the ones used in android.media.MediaMuxer.OutputFormat
SeekMode
Declared inmedia/NdkMediaExtractor.h
SeekMode
cryptoinfo_mode_t
Declared inmedia/NdkMediaCodec.h
cryptoinfo_mode_t
media_status_t
Declared inmedia/NdkMediaError.h
media_status_t
Media error message types returned from NDK media functions.
Typedefs
AImage
Declared inmedia/NdkImage.h
struct AImage AImage
AImage is an opaque type that provides access to image generated by AImageReader.
AImageCropRect
Declared inmedia/NdkImage.h
struct AImageCropRect AImageCropRect
Data type describing an cropped rectangle returned by AImage_getCropRect.
Note that the right and bottom coordinates are exclusive, so the width of the rectangle is (right - left) and the height of the rectangle is (bottom - top).
AImageReader
Declared inmedia/NdkImageReader.h
struct AImageReader AImageReader
AImage is an opaque type that allows direct application access to image data rendered into a ANativeWindow.
AImageReader_BufferRemovedCallback
Declared inmedia/NdkImageReader.h
void(* AImageReader_BufferRemovedCallback)(void *context, AImageReader *reader, AHardwareBuffer *buffer)
Signature of the callback which is called when AImageReader is about to remove a buffer.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
AImageReader_BufferRemovedListener
Declared inmedia/NdkImageReader.h
struct AImageReader_BufferRemovedListener AImageReader_BufferRemovedListener
A listener to the AHardwareBuffer removal event, use AImageReader_setBufferRemovedListener to register the listener object to AImageReader.
AImageReader_ImageCallback
Declared inmedia/NdkImageReader.h
void(* AImageReader_ImageCallback)(void *context, AImageReader *reader)
Signature of the callback which is called when a new image is available from AImageReader.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
AImageReader_ImageListener
Declared inmedia/NdkImageReader.h
struct AImageReader_ImageListener AImageReader_ImageListener
AMediaCodec
Declared inmedia/NdkMediaCodec.h
struct AMediaCodec AMediaCodec
AMediaCodecBufferInfo
Declared inmedia/NdkMediaCodec.h
struct AMediaCodecBufferInfo AMediaCodecBufferInfo
AMediaCodecCryptoInfo
Declared inmedia/NdkMediaCodec.h
struct AMediaCodecCryptoInfo AMediaCodecCryptoInfo
AMediaCodecOnAsyncError
Declared inmedia/NdkMediaCodec.h
void(* AMediaCodecOnAsyncError)(AMediaCodec *codec, void *userdata, media_status_t error, int32_t actionCode, const char *detail)
Called when the MediaCodec encountered an error.
The specified actionCode indicates the possible actions that client can take, and it can be checked by calling AMediaCodecActionCode_isRecoverable or AMediaCodecActionCode_isTransient. If both AMediaCodecActionCode_isRecoverable() and AMediaCodecActionCode_isTransient() return false, then the codec error is fatal and the codec must be deleted. The specified detail may contain more detailed messages about this error.
AMediaCodecOnAsyncFormatChanged
Declared inmedia/NdkMediaCodec.h
void(* AMediaCodecOnAsyncFormatChanged)(AMediaCodec *codec, void *userdata, AMediaFormat *format)
Called when the output format has changed.
The specified format contains the new output format.
AMediaCodecOnAsyncInputAvailable
Declared inmedia/NdkMediaCodec.h
void(* AMediaCodecOnAsyncInputAvailable)(AMediaCodec *codec, void *userdata, int32_t index)
Called when an input buffer becomes available.
The specified index is the index of the available input buffer.
AMediaCodecOnAsyncNotifyCallback
Declared inmedia/NdkMediaCodec.h
struct AMediaCodecOnAsyncNotifyCallback AMediaCodecOnAsyncNotifyCallback
AMediaCodecOnAsyncOutputAvailable
Declared inmedia/NdkMediaCodec.h
void(* AMediaCodecOnAsyncOutputAvailable)(AMediaCodec *codec, void *userdata, int32_t index, AMediaCodecBufferInfo *bufferInfo)
Called when an output buffer becomes available.
The specified index is the index of the available output buffer. The specified bufferInfo contains information regarding the available output buffer.
AMediaCodecOnFrameRendered
Declared inmedia/NdkMediaCodec.h
void(* AMediaCodecOnFrameRendered)(AMediaCodec *codec, void *userdata, int64_t mediaTimeUs, int64_t systemNano)
Called when an output frame has rendered on the output surface.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
AMediaCrypto
Declared inmedia/NdkMediaCrypto.h
struct AMediaCrypto AMediaCrypto
AMediaDataSource
Declared inmedia/NdkMediaDataSource.h
struct AMediaDataSource AMediaDataSource
AMediaDataSourceClose
Declared inmedia/NdkMediaDataSource.h
void(* AMediaDataSourceClose)(void *userdata)
Called to close the data source, unblock reads, and release associated resources.
The NDK media framework guarantees that after the first close
is called, no future callbacks will be invoked on the data source except for close
itself.
Closing a data source allows readAt calls that were blocked waiting for I/O data to return promptly.
When using AMediaDataSource as input to AMediaExtractor, closing has the effect of unblocking slow reads inside of setDataSource and readSampleData.
AMediaDataSourceGetAvailableSize
Declared inmedia/NdkMediaDataSource.h
ssize_t(* AMediaDataSourceGetAvailableSize)(void *userdata, off64_t offset)
Called to get an estimate of the number of bytes that can be read from this data source starting at offset
without blocking for I/O.
Return -1 when such an estimate is not possible.
AMediaDataSourceGetSize
Declared inmedia/NdkMediaDataSource.h
ssize_t(* AMediaDataSourceGetSize)(void *userdata)
Called to get the size of the data source.
Return the size of data source in bytes, or -1 if the size is unknown.
AMediaDataSourceReadAt
Declared inmedia/NdkMediaDataSource.h
ssize_t(* AMediaDataSourceReadAt)(void *userdata, off64_t offset, void *buffer, size_t size)
Called to request data from the given offset
.
Implementations should should write up to size
bytes into buffer
, and return the number of bytes written.
Return 0 if size is zero (thus no bytes are read).
Return -1 to indicate that end of stream is reached.
AMediaDrm
Declared inmedia/NdkMediaDrm.h
struct AMediaDrm AMediaDrm
AMediaDrmEventListener
Declared inmedia/NdkMediaDrm.h
void(* AMediaDrmEventListener)(AMediaDrm *, const AMediaDrmSessionId *sessionId, AMediaDrmEventType eventType, int extra, const uint8_t *data, size_t dataSize)
AMediaDrmExpirationUpdateListener
Declared inmedia/NdkMediaDrm.h
void(* AMediaDrmExpirationUpdateListener)(AMediaDrm *, const AMediaDrmSessionId *sessionId, int64_t expiryTimeInMS)
AMediaDrmKeyRequestType
Declared inmedia/NdkMediaDrm.h
enum AMediaDrmKeyRequestType AMediaDrmKeyRequestType
Introduced in API 33.
AMediaDrmKeyStatusType
Declared inmedia/NdkMediaDrm.h
enum AMediaKeyStatusType AMediaDrmKeyStatusType
AMediaDrmKeyValue
Declared inmedia/NdkMediaDrm.h
struct AMediaDrmKeyValuePair AMediaDrmKeyValue
Data type containing {key, value} pair.
AMediaDrmKeysChangeListener
Declared inmedia/NdkMediaDrm.h
void(* AMediaDrmKeysChangeListener)(AMediaDrm *, const AMediaDrmSessionId *sessionId, const AMediaDrmKeyStatus *keyStatus, size_t numKeys, bool hasNewUsableKey)
AMediaExtractor
Declared inmedia/NdkMediaExtractor.h
struct AMediaExtractor AMediaExtractor
AMediaFormat
Declared inmedia/NdkMediaFormat.h
struct AMediaFormat AMediaFormat
AMediaMuxer
Declared inmedia/NdkMediaMuxer.h
struct AMediaMuxer AMediaMuxer
AMediaUUID
Declared inmedia/NdkMediaCrypto.h
uint8_t AMediaUUID[16]
PsshEntry
Declared inmedia/NdkMediaExtractor.h
struct PsshEntry PsshEntry
mapping of crypto scheme uuid to the scheme specific data for that scheme
PsshInfo
Declared inmedia/NdkMediaExtractor.h
struct PsshInfo PsshInfo
list of crypto schemes and their data
Variables
AMEDIACODEC_KEY_HDR10_PLUS_INFO
Declared inmedia/NdkMediaCodec.h
const char * AMEDIACODEC_KEY_HDR10_PLUS_INFO
AMEDIACODEC_KEY_LOW_LATENCY
Declared inmedia/NdkMediaCodec.h
const char * AMEDIACODEC_KEY_LOW_LATENCY
AMEDIACODEC_KEY_OFFSET_TIME
Declared inmedia/NdkMediaCodec.h
const char * AMEDIACODEC_KEY_OFFSET_TIME
AMEDIACODEC_KEY_REQUEST_SYNC_FRAME
Declared inmedia/NdkMediaCodec.h
const char * AMEDIACODEC_KEY_REQUEST_SYNC_FRAME
AMEDIACODEC_KEY_SUSPEND
Declared inmedia/NdkMediaCodec.h
const char * AMEDIACODEC_KEY_SUSPEND
AMEDIACODEC_KEY_SUSPEND_TIME
Declared inmedia/NdkMediaCodec.h
const char * AMEDIACODEC_KEY_SUSPEND_TIME
AMEDIACODEC_KEY_VIDEO_BITRATE
Declared inmedia/NdkMediaCodec.h
const char * AMEDIACODEC_KEY_VIDEO_BITRATE
AMEDIAFORMAT_KEY_AAC_DRC_ATTENUATION_FACTOR
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AAC_DRC_ATTENUATION_FACTOR
AMEDIAFORMAT_KEY_AAC_DRC_BOOST_FACTOR
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AAC_DRC_BOOST_FACTOR
AMEDIAFORMAT_KEY_AAC_DRC_HEAVY_COMPRESSION
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AAC_DRC_HEAVY_COMPRESSION
AMEDIAFORMAT_KEY_AAC_DRC_TARGET_REFERENCE_LEVEL
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AAC_DRC_TARGET_REFERENCE_LEVEL
AMEDIAFORMAT_KEY_AAC_ENCODED_TARGET_LEVEL
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AAC_ENCODED_TARGET_LEVEL
AMEDIAFORMAT_KEY_AAC_MAX_OUTPUT_CHANNEL_COUNT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AAC_MAX_OUTPUT_CHANNEL_COUNT
AMEDIAFORMAT_KEY_AAC_PROFILE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AAC_PROFILE
AMEDIAFORMAT_KEY_AAC_SBR_MODE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AAC_SBR_MODE
AMEDIAFORMAT_KEY_ALBUM
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_ALBUM
AMEDIAFORMAT_KEY_ALBUMART
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_ALBUMART
AMEDIAFORMAT_KEY_ALBUMARTIST
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_ALBUMARTIST
AMEDIAFORMAT_KEY_ALLOW_FRAME_DROP
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_ALLOW_FRAME_DROP
A key for applications to opt out of allowing a Surface to discard undisplayed/unconsumed frames as means to catch up after falling behind.
Semantics match those of android.media.MediaFormat#KEY_ALLOW_FRAME_DROP
AMEDIAFORMAT_KEY_ARTIST
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_ARTIST
AMEDIAFORMAT_KEY_AUDIO_PRESENTATION_INFO
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AUDIO_PRESENTATION_INFO
AMEDIAFORMAT_KEY_AUDIO_PRESENTATION_PRESENTATION_ID
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AUDIO_PRESENTATION_PRESENTATION_ID
AMEDIAFORMAT_KEY_AUDIO_PRESENTATION_PROGRAM_ID
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AUDIO_PRESENTATION_PROGRAM_ID
AMEDIAFORMAT_KEY_AUDIO_SESSION_ID
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AUDIO_SESSION_ID
AMEDIAFORMAT_KEY_AUTHOR
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_AUTHOR
AMEDIAFORMAT_KEY_BITRATE_MODE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_BITRATE_MODE
AMEDIAFORMAT_KEY_BITS_PER_SAMPLE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_BITS_PER_SAMPLE
AMEDIAFORMAT_KEY_BIT_RATE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_BIT_RATE
AMEDIAFORMAT_KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE
AMEDIAFORMAT_KEY_BUFFER_BATCH_THRESHOLD_OUTPUT_SIZE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_BUFFER_BATCH_THRESHOLD_OUTPUT_SIZE
AMEDIAFORMAT_KEY_CAPTURE_RATE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CAPTURE_RATE
AMEDIAFORMAT_KEY_CDTRACKNUMBER
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CDTRACKNUMBER
AMEDIAFORMAT_KEY_CHANNEL_COUNT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CHANNEL_COUNT
AMEDIAFORMAT_KEY_CHANNEL_MASK
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CHANNEL_MASK
AMEDIAFORMAT_KEY_COLOR_FORMAT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_COLOR_FORMAT
AMEDIAFORMAT_KEY_COLOR_RANGE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_COLOR_RANGE
AMEDIAFORMAT_KEY_COLOR_STANDARD
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_COLOR_STANDARD
AMEDIAFORMAT_KEY_COLOR_TRANSFER
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_COLOR_TRANSFER
AMEDIAFORMAT_KEY_COMPILATION
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_COMPILATION
AMEDIAFORMAT_KEY_COMPLEXITY
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_COMPLEXITY
AMEDIAFORMAT_KEY_COMPOSER
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_COMPOSER
AMEDIAFORMAT_KEY_CREATE_INPUT_SURFACE_SUSPENDED
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CREATE_INPUT_SURFACE_SUSPENDED
AMEDIAFORMAT_KEY_CRYPTO_DEFAULT_IV_SIZE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CRYPTO_DEFAULT_IV_SIZE
AMEDIAFORMAT_KEY_CRYPTO_ENCRYPTED_BYTE_BLOCK
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CRYPTO_ENCRYPTED_BYTE_BLOCK
AMEDIAFORMAT_KEY_CRYPTO_ENCRYPTED_SIZES
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CRYPTO_ENCRYPTED_SIZES
AMEDIAFORMAT_KEY_CRYPTO_IV
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CRYPTO_IV
AMEDIAFORMAT_KEY_CRYPTO_KEY
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CRYPTO_KEY
AMEDIAFORMAT_KEY_CRYPTO_MODE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CRYPTO_MODE
AMEDIAFORMAT_KEY_CRYPTO_PLAIN_SIZES
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CRYPTO_PLAIN_SIZES
AMEDIAFORMAT_KEY_CRYPTO_SKIP_BYTE_BLOCK
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CRYPTO_SKIP_BYTE_BLOCK
AMEDIAFORMAT_KEY_CSD
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CSD
AMEDIAFORMAT_KEY_CSD_0
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CSD_0
AMEDIAFORMAT_KEY_CSD_1
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CSD_1
AMEDIAFORMAT_KEY_CSD_2
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CSD_2
AMEDIAFORMAT_KEY_CSD_AVC
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CSD_AVC
AMEDIAFORMAT_KEY_CSD_HEVC
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_CSD_HEVC
AMEDIAFORMAT_KEY_D263
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_D263
AMEDIAFORMAT_KEY_DATE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_DATE
AMEDIAFORMAT_KEY_DISCNUMBER
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_DISCNUMBER
AMEDIAFORMAT_KEY_DISPLAY_CROP
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_DISPLAY_CROP
AMEDIAFORMAT_KEY_DISPLAY_HEIGHT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_DISPLAY_HEIGHT
AMEDIAFORMAT_KEY_DISPLAY_WIDTH
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_DISPLAY_WIDTH
AMEDIAFORMAT_KEY_DURATION
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_DURATION
AMEDIAFORMAT_KEY_ENCODER_DELAY
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_ENCODER_DELAY
AMEDIAFORMAT_KEY_ENCODER_PADDING
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_ENCODER_PADDING
AMEDIAFORMAT_KEY_ESDS
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_ESDS
AMEDIAFORMAT_KEY_EXIF_OFFSET
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_EXIF_OFFSET
AMEDIAFORMAT_KEY_EXIF_SIZE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_EXIF_SIZE
AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL
AMEDIAFORMAT_KEY_FRAME_COUNT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_FRAME_COUNT
AMEDIAFORMAT_KEY_FRAME_RATE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_FRAME_RATE
AMEDIAFORMAT_KEY_GENRE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_GENRE
AMEDIAFORMAT_KEY_GRID_COLUMNS
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_GRID_COLUMNS
AMEDIAFORMAT_KEY_GRID_ROWS
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_GRID_ROWS
AMEDIAFORMAT_KEY_HAPTIC_CHANNEL_COUNT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_HAPTIC_CHANNEL_COUNT
AMEDIAFORMAT_KEY_HDR10_PLUS_INFO
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_HDR10_PLUS_INFO
AMEDIAFORMAT_KEY_HDR_STATIC_INFO
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_HDR_STATIC_INFO
AMEDIAFORMAT_KEY_HEIGHT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_HEIGHT
AMEDIAFORMAT_KEY_ICC_PROFILE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_ICC_PROFILE
AMEDIAFORMAT_KEY_IMPORTANCE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_IMPORTANCE
AMEDIAFORMAT_KEY_INTRA_REFRESH_PERIOD
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_INTRA_REFRESH_PERIOD
AMEDIAFORMAT_KEY_IS_ADTS
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_IS_ADTS
AMEDIAFORMAT_KEY_IS_AUTOSELECT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_IS_AUTOSELECT
AMEDIAFORMAT_KEY_IS_DEFAULT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_IS_DEFAULT
AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE
AMEDIAFORMAT_KEY_IS_SYNC_FRAME
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_IS_SYNC_FRAME
AMEDIAFORMAT_KEY_I_FRAME_INTERVAL
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_I_FRAME_INTERVAL
AMEDIAFORMAT_KEY_LANGUAGE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_LANGUAGE
AMEDIAFORMAT_KEY_LAST_SAMPLE_INDEX_IN_CHUNK
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_LAST_SAMPLE_INDEX_IN_CHUNK
AMEDIAFORMAT_KEY_LATENCY
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_LATENCY
AMEDIAFORMAT_KEY_LEVEL
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_LEVEL
AMEDIAFORMAT_KEY_LOCATION
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_LOCATION
AMEDIAFORMAT_KEY_LOOP
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_LOOP
AMEDIAFORMAT_KEY_LOW_LATENCY
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_LOW_LATENCY
An optional key describing the low latency decoding mode.
This is an optional parameter that applies only to decoders. If enabled, the decoder doesn't hold input and output data more than required by the codec standards. The associated value is an integer (0 or 1): 1 when low-latency decoding is enabled, 0 otherwise. The default value is 0.
Available since API level 30.
AMEDIAFORMAT_KEY_LYRICIST
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_LYRICIST
AMEDIAFORMAT_KEY_MANUFACTURER
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MANUFACTURER
AMEDIAFORMAT_KEY_MAX_BIT_RATE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MAX_BIT_RATE
AMEDIAFORMAT_KEY_MAX_B_FRAMES
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MAX_B_FRAMES
A key describing the maximum number of B frames between I or P frames, to be used by a video encoder.
Semantics match those of android.media.MediaFormat#KEY_MAX_B_FRAMES
AMEDIAFORMAT_KEY_MAX_FPS_TO_ENCODER
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MAX_FPS_TO_ENCODER
AMEDIAFORMAT_KEY_MAX_HEIGHT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MAX_HEIGHT
AMEDIAFORMAT_KEY_MAX_INPUT_SIZE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MAX_INPUT_SIZE
AMEDIAFORMAT_KEY_MAX_PTS_GAP_TO_ENCODER
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MAX_PTS_GAP_TO_ENCODER
AMEDIAFORMAT_KEY_MAX_WIDTH
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MAX_WIDTH
AMEDIAFORMAT_KEY_MIME
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MIME
AMEDIAFORMAT_KEY_MPEG2_STREAM_HEADER
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MPEG2_STREAM_HEADER
AMEDIAFORMAT_KEY_MPEGH_COMPATIBLE_SETS
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MPEGH_COMPATIBLE_SETS
MPEG-H audio profile and level compatibility.
See FDAmd_2 of ISO_IEC_23008-3;2019 MHAProfileAndLevelCompatibilitySetBox.
Available since API level 32.
AMEDIAFORMAT_KEY_MPEGH_PROFILE_LEVEL_INDICATION
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MPEGH_PROFILE_LEVEL_INDICATION
MPEG-H audio profile level indication.
See ISO_IEC_23008-3;2019 MHADecoderConfigurationRecord mpegh3daProfileLevelIndication.
Available since API level 32.
AMEDIAFORMAT_KEY_MPEGH_REFERENCE_CHANNEL_LAYOUT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MPEGH_REFERENCE_CHANNEL_LAYOUT
MPEG-H audio reference channel layout.
See ISO_IEC_23008-3;2019 MHADecoderConfigurationRecord referenceChannelLayout and ISO_IEC_23001‐8 ChannelConfiguration value.
Available since API level 32.
AMEDIAFORMAT_KEY_MPEG_USER_DATA
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_MPEG_USER_DATA
AMEDIAFORMAT_KEY_OPERATING_RATE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_OPERATING_RATE
AMEDIAFORMAT_KEY_PCM_BIG_ENDIAN
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_PCM_BIG_ENDIAN
AMEDIAFORMAT_KEY_PCM_ENCODING
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_PCM_ENCODING
AMEDIAFORMAT_KEY_PICTURE_TYPE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_PICTURE_TYPE
AMEDIAFORMAT_KEY_PRIORITY
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_PRIORITY
AMEDIAFORMAT_KEY_PROFILE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_PROFILE
AMEDIAFORMAT_KEY_PSSH
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_PSSH
AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP
AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER
AMEDIAFORMAT_KEY_ROTATION
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_ROTATION
AMEDIAFORMAT_KEY_SAMPLE_FILE_OFFSET
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_SAMPLE_FILE_OFFSET
AMEDIAFORMAT_KEY_SAMPLE_RATE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_SAMPLE_RATE
AMEDIAFORMAT_KEY_SAMPLE_TIME_BEFORE_APPEND
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_SAMPLE_TIME_BEFORE_APPEND
AMEDIAFORMAT_KEY_SAR_HEIGHT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_SAR_HEIGHT
AMEDIAFORMAT_KEY_SAR_WIDTH
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_SAR_WIDTH
AMEDIAFORMAT_KEY_SEI
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_SEI
AMEDIAFORMAT_KEY_SLICE_HEIGHT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_SLICE_HEIGHT
AMEDIAFORMAT_KEY_SLOW_MOTION_MARKERS
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_SLOW_MOTION_MARKERS
AMEDIAFORMAT_KEY_STRIDE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_STRIDE
AMEDIAFORMAT_KEY_TARGET_TIME
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TARGET_TIME
AMEDIAFORMAT_KEY_TEMPORAL_LAYERING
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TEMPORAL_LAYERING
AMEDIAFORMAT_KEY_TEMPORAL_LAYER_COUNT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TEMPORAL_LAYER_COUNT
AMEDIAFORMAT_KEY_TEMPORAL_LAYER_ID
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TEMPORAL_LAYER_ID
AMEDIAFORMAT_KEY_TEXT_FORMAT_DATA
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TEXT_FORMAT_DATA
AMEDIAFORMAT_KEY_THUMBNAIL_CSD_AV1C
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_THUMBNAIL_CSD_AV1C
AMEDIAFORMAT_KEY_THUMBNAIL_CSD_HEVC
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_THUMBNAIL_CSD_HEVC
AMEDIAFORMAT_KEY_THUMBNAIL_HEIGHT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_THUMBNAIL_HEIGHT
AMEDIAFORMAT_KEY_THUMBNAIL_TIME
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_THUMBNAIL_TIME
AMEDIAFORMAT_KEY_THUMBNAIL_WIDTH
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_THUMBNAIL_WIDTH
AMEDIAFORMAT_KEY_TILE_HEIGHT
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TILE_HEIGHT
AMEDIAFORMAT_KEY_TILE_WIDTH
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TILE_WIDTH
AMEDIAFORMAT_KEY_TIME_US
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TIME_US
AMEDIAFORMAT_KEY_TITLE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TITLE
AMEDIAFORMAT_KEY_TRACK_ID
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TRACK_ID
AMEDIAFORMAT_KEY_TRACK_INDEX
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_TRACK_INDEX
AMEDIAFORMAT_KEY_VALID_SAMPLES
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_VALID_SAMPLES
AMEDIAFORMAT_KEY_VIDEO_ENCODING_STATISTICS_LEVEL
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_VIDEO_ENCODING_STATISTICS_LEVEL
AMEDIAFORMAT_KEY_VIDEO_QP_AVERAGE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_VIDEO_QP_AVERAGE
AMEDIAFORMAT_KEY_WIDTH
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_WIDTH
AMEDIAFORMAT_KEY_XMP_OFFSET
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_XMP_OFFSET
AMEDIAFORMAT_KEY_XMP_SIZE
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_XMP_SIZE
AMEDIAFORMAT_KEY_YEAR
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_KEY_YEAR
AMEDIAFORMAT_VIDEO_QP_B_MAX
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_VIDEO_QP_B_MAX
AMEDIAFORMAT_VIDEO_QP_B_MIN
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_VIDEO_QP_B_MIN
AMEDIAFORMAT_VIDEO_QP_I_MAX
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_VIDEO_QP_I_MAX
AMEDIAFORMAT_VIDEO_QP_I_MIN
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_VIDEO_QP_I_MIN
AMEDIAFORMAT_VIDEO_QP_MAX
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_VIDEO_QP_MAX
AMEDIAFORMAT_VIDEO_QP_MIN
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_VIDEO_QP_MIN
AMEDIAFORMAT_VIDEO_QP_P_MAX
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_VIDEO_QP_P_MAX
AMEDIAFORMAT_VIDEO_QP_P_MIN
Declared inmedia/NdkMediaFormat.h
const char * AMEDIAFORMAT_VIDEO_QP_P_MIN
Functions
AImageReader_acquireLatestImage
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_acquireLatestImage( AImageReader *reader, AImage **image )
Acquire the latest AImage from the image reader's queue, dropping older images.
This operation will acquire all the images possible from the image reader, but AImage_delete all images that aren't the latest. This function is recommended to use over AImageReader_acquireNextImage for most use-cases, as it's more suited for real-time processing.
Note that maxImages should be at least 2 for AImageReader_acquireLatestImage to be any different than AImageReader_acquireNextImage - discarding all-but-the-newest AImage requires temporarily acquiring two AImages at once. Or more generally, calling AImageReader_acquireLatestImage with less than two images of margin, that is (maxImages - currentAcquiredImages < 2) will not discard as expected.
This method will fail if maxImages have been acquired with AImageReader_acquireNextImage or AImageReader_acquireLatestImage. In particular a sequence of AImageReader_acquireNextImage or AImageReader_acquireLatestImage calls greater than maxImages without calling AImage_delete in-between will exhaust the underlying queue. At such a time, AMEDIA_IMGREADER_MAX_IMAGES_ACQUIRED will be returned until more images are released with AImage_delete.
Available since API level 24.
See also: AImageReader_acquireNextImage
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImageReader_acquireLatestImageAsync
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_acquireLatestImageAsync( AImageReader *reader, AImage **image, int *acquireFenceFd )
Acquire the latest AImage from the image reader's queue asynchronously, dropping older images.
AImageReader acquire method similar to AImageReader_acquireLatestImage that takes an additional parameter for the sync fence. All other parameters and the return values are identical to those passed to AImageReader_acquireLatestImage.
Available since API level 26.
See also:sync.hSee also:sync_get_fence_info
Details | |||
---|---|---|---|
Parameters |
|
AImageReader_acquireNextImage
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_acquireNextImage( AImageReader *reader, AImage **image )
Acquire the next AImage from the image reader's queue.
Warning: Consider using AImageReader_acquireLatestImage instead, as it will automatically release older images, and allow slower-running processing routines to catch up to the newest frame. Usage of AImageReader_acquireNextImage is recommended for batch/background processing. Incorrectly using this method can cause images to appear with an ever-increasing delay, followed by a complete stall where no new images seem to appear.
This method will fail if maxImages have been acquired with AImageReader_acquireNextImage or AImageReader_acquireLatestImage. In particular a sequence of AImageReader_acquireNextImage or AImageReader_acquireLatestImage calls greater than maxImages without calling AImage_delete in-between will exhaust the underlying queue. At such a time, AMEDIA_IMGREADER_MAX_IMAGES_ACQUIRED will be returned until more images are released with AImage_delete.
Available since API level 24.
See also: AImageReader_acquireLatestImage
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImageReader_acquireNextImageAsync
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_acquireNextImageAsync( AImageReader *reader, AImage **image, int *acquireFenceFd )
Acquire the next AImage from the image reader's queue asynchronously.
AImageReader acquire method similar to AImageReader_acquireNextImage that takes an additional parameter for the sync fence. All other parameters and the return values are identical to those passed to AImageReader_acquireNextImage.
Available since API level 26.
See also:sync.hSee also:sync_get_fence_info
Details | |||
---|---|---|---|
Parameters |
|
AImageReader_delete
Declared inmedia/NdkImageReader.h
void AImageReader_delete( AImageReader *reader )
Delete an AImageReader and return all images generated by this reader to system.
This method will return all AImage objects acquired by this reader (via AImageReader_acquireNextImage or AImageReader_acquireLatestImage) to system, making any of data pointers obtained from AImage_getPlaneData invalid. Do NOT access the reader object or any of those data pointers after this method returns.
Available since API level 24.
Details | |||
---|---|---|---|
Parameters |
|
AImageReader_getFormat
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_getFormat( const AImageReader *reader, int32_t *format )
Query the format of the AImage generated by this reader.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImageReader_getHeight
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_getHeight( const AImageReader *reader, int32_t *height )
Query the default height of the AImage generated by this reader, in pixels.
The height may be overridden by the producer sending buffers to this reader's ANativeWindow. If so, the actual height of the images can be found using AImage_getHeight.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImageReader_getMaxImages
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_getMaxImages( const AImageReader *reader, int32_t *maxImages )
Query the maximum number of concurrently acquired AImages of this reader.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImageReader_getWidth
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_getWidth( const AImageReader *reader, int32_t *width )
Query the default width of the AImage generated by this reader, in pixels.
The width may be overridden by the producer sending buffers to this reader's ANativeWindow. If so, the actual width of the images can be found using AImage_getWidth.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImageReader_getWindow
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_getWindow( AImageReader *reader, ANativeWindow **window )
Get a ANativeWindow that can be used to produce AImage for this image reader.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImageReader_getWindowNativeHandle
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_getWindowNativeHandle( AImageReader *reader, native_handle_t **handle )
AImageReader_new
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_new( int32_t width, int32_t height, int32_t format, int32_t maxImages, AImageReader **reader )
Create a new reader for images of the desired size and format.
The maxImages parameter determines the maximum number of AImage objects that can be acquired from the AImageReader simultaneously. Requesting more buffers will use up more memory, so it is important to use only the minimum number necessary for the use case.
The valid sizes and formats depend on the source of the image data.
Available since API level 24.
See also: AImage
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Returns |
|
AImageReader_newWithDataSpace
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_newWithDataSpace( int32_t width, int32_t height, uint64_t usage, int32_t maxImages, uint32_t hardwareBufferFormat, int32_t dataSpace, AImageReader **reader )
AImageReader constructor similar to AImageReader_newWithUsage that takes two additional parameters to build the format of the Image.
All other parameters and the return values are identical to those passed to AImageReader_newWithUsage.
Instead of passing
formatparameter, this constructor accepts the combination of
hardwareBufferFormatand
dataSpacefor the format of the Image that the reader will produce.
Available since API level 34.
See also: AImageReader_newWithUsage
Details | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||||
Returns |
|
AImageReader_newWithUsage
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_newWithUsage( int32_t width, int32_t height, int32_t format, uint64_t usage, int32_t maxImages, AImageReader **reader )
AImageReader constructor similar to AImageReader_new that takes an additional parameter for the consumer usage.
All other parameters and the return values are identical to those passed to AImageReader_new.
If the format
is AIMAGE_FORMAT_PRIVATE, the created AImageReader will produce images whose contents are not directly accessible by the application. The application can still acquire images from this AImageReader and access AHardwareBuffer via AImage_getHardwareBuffer(). The AHardwareBuffer gained this way can then be passed back to hardware (such as GPU or hardware encoder if supported) for future processing. For example, you can obtain an EGLClientBuffer from the AHardwareBuffer by using eglGetNativeClientBufferANDROID extension and pass that EGLClientBuffer to eglCreateImageKHR to create an EGLImage resource type, which may then be bound to a texture via glEGLImageTargetTexture2DOES on supported devices. This can be useful for transporting textures that may be shared cross-process.
In general, when software access to image data is not necessary, an AImageReader created with AIMAGE_FORMAT_PRIVATE format is more efficient, compared with AImageReaders using other format such as AIMAGE_FORMAT_YUV_420_888.
Note that not all format and usage flag combination is supported by the AImageReader, especially if format
is AIMAGE_FORMAT_PRIVATE, usage
must not include either AHARDWAREBUFFER_USAGE_CPU_READ_RARELY or AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN
Note that not all format and usage flag combination is supported by the AImageReader. Below are the combinations supported by the AImageReader.
Format | Compatible usage flags |
non-AIMAGE_FORMAT_PRIVATE formats defined in NdkImage.h | AHARDWAREBUFFER_USAGE_CPU_READ_RARELY or AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN |
AIMAGE_FORMAT_RGBA_8888 | AHARDWAREBUFFER_USAGE_VIDEO_ENCODE or AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE, or combined |
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
Available since API level 26.
See also: AImage See also: AImageReader_new See also: AHardwareBuffer
Details | |
---|---|
Returns |
|
AImageReader_setBufferRemovedListener
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_setBufferRemovedListener( AImageReader *reader, AImageReader_BufferRemovedListener *listener )
Set the onBufferRemoved listener of this image reader.
Note that calling this method will replace previously registered listeners.
Available since API level 26.
See also: AImage_getHardwareBuffer
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImageReader_setImageListener
Declared inmedia/NdkImageReader.h
media_status_t AImageReader_setImageListener( AImageReader *reader, AImageReader_ImageListener *listener )
Set the onImageAvailable listener of this image reader.
Calling this method will replace previously registered listeners.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImage_delete
Declared inmedia/NdkImage.h
void AImage_delete( AImage *image )
Return the image back the the system and delete the AImage object from memory.
Do NOT use the image pointer after this method returns. Note that if the parent AImageReader is closed, all the AImage objects acquired from the parent reader will be returned to system. All AImage_* methods except this method will return AMEDIA_ERROR_INVALID_OBJECT. Application still needs to call this method on those AImage objects to fully delete the AImage object from memory.
Available since API level 24.
Details | |||
---|---|---|---|
Parameters |
|
AImage_deleteAsync
Declared inmedia/NdkImage.h
void AImage_deleteAsync( AImage *image, int releaseFenceFd )
Return the image back the the system and delete the AImage object from memory asynchronously.
Similar to AImage_delete, do NOT use the image pointer after this method returns. However, the caller can still hold on to the AHardwareBuffer returned from this image and signal the release of the hardware buffer back to the AImageReader's queue using releaseFenceFd.
Available since API level 26.
See also: sync.h
Details | |||||
---|---|---|---|---|---|
Parameters |
|
AImage_getCropRect
Declared inmedia/NdkImage.h
media_status_t AImage_getCropRect( const AImage *image, AImageCropRect *rect )
Query the cropped rectangle of the input AImage.
The crop rectangle specifies the region of valid pixels in the image, using coordinates in the largest-resolution plane.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImage_getDataSpace
Declared inmedia/NdkImage.h
media_status_t AImage_getDataSpace( const AImage *image, int32_t *dataSpace )
Query the dataspace of the input AImage.
Available since API level 34.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImage_getFormat
Declared inmedia/NdkImage.h
media_status_t AImage_getFormat( const AImage *image, int32_t *format )
Query the format of the input AImage.
The format value will be one of AIMAGE_FORMAT_* enum value.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImage_getHardwareBuffer
Declared inmedia/NdkImage.h
media_status_t AImage_getHardwareBuffer( const AImage *image, AHardwareBuffer **buffer )
Get the hardware buffer handle of the input image intended for GPU and/or hardware access.
Note that no reference on the returned AHardwareBuffer handle is acquired automatically. Once the AImage or the parent AImageReader is deleted, the AHardwareBuffer handle from previous AImage_getHardwareBuffer becomes invalid.
If the caller ever needs to hold on a reference to the AHardwareBuffer handle after the AImage or the parent AImageReader is deleted, it must call AHardwareBuffer_acquire to acquire an extra reference, and call AHardwareBuffer_release once it has finished using it in order to properly deallocate the underlying memory managed by AHardwareBuffer. If the caller has acquired extra reference on an AHardwareBuffer returned from this function, it must also register a listener using the function AImageReader_setBufferRemovedListener to be notified when the buffer is no longer used by AImageReader.
Available since API level 26.
See also: AImageReader_ImageCallback
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImage_getHeight
Declared inmedia/NdkImage.h
media_status_t AImage_getHeight( const AImage *image, int32_t *height )
Query the height of the input AImage.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImage_getNumberOfPlanes
Declared inmedia/NdkImage.h
media_status_t AImage_getNumberOfPlanes( const AImage *image, int32_t *numPlanes )
Query the number of planes of the input AImage.
The number of plane of an AImage is determined by its format, which can be queried by AImage_getFormat method.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImage_getPlaneData
Declared inmedia/NdkImage.h
media_status_t AImage_getPlaneData( const AImage *image, int planeIdx, uint8_t **data, int *dataLength )
Get the data pointer of the input image for direct application access.
Note that once the AImage or the parent AImageReader is deleted, the data pointer from previous AImage_getPlaneData call becomes invalid. Do NOT use it after the AImage or the parent AImageReader is deleted.
Available since API level 24.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Returns |
|
AImage_getPlanePixelStride
Declared inmedia/NdkImage.h
media_status_t AImage_getPlanePixelStride( const AImage *image, int planeIdx, int32_t *pixelStride )
Query the pixel stride of the input AImage.
This is the distance between two consecutive pixel values in a row of pixels. It may be larger than the size of a single pixel to account for interleaved image data or padded formats. Note that pixel stride is undefined for some formats such as AIMAGE_FORMAT_RAW_PRIVATE, and calling this method on images of these formats will cause AMEDIA_ERROR_UNSUPPORTED being returned. For formats where pixel stride is well defined, the pixel stride is always greater than 0.
Available since API level 24.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
|
AImage_getPlaneRowStride
Declared inmedia/NdkImage.h
media_status_t AImage_getPlaneRowStride( const AImage *image, int planeIdx, int32_t *rowStride )
Query the row stride of the input AImage.
This is the distance between the start of two consecutive rows of pixels in the image. Note that row stried is undefined for some formats such as AIMAGE_FORMAT_RAW_PRIVATE, and calling this method on images of these formats will cause AMEDIA_ERROR_UNSUPPORTED being returned. For formats where row stride is well defined, the row stride is always greater than 0.
Available since API level 24.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
|
AImage_getTimestamp
Declared inmedia/NdkImage.h
media_status_t AImage_getTimestamp( const AImage *image, int64_t *timestampNs )
Query the timestamp of the input AImage.
The timestamp is measured in nanoseconds, and is normally monotonically increasing. The timestamps for the images from different sources may have different timebases therefore may not be comparable. The specific meaning and timebase of the timestamp depend on the source providing images. For images generated by camera, the timestamp value will match ACAMERA_SENSOR_TIMESTAMP of the ACameraMetadata in ACameraCaptureSession_captureCallbacks#onCaptureStarted and ACameraCaptureSession_captureCallbacks#onCaptureCompleted callback.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AImage_getWidth
Declared inmedia/NdkImage.h
media_status_t AImage_getWidth( const AImage *image, int32_t *width )
Query the width of the input AImage.
Available since API level 24.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
|
AMediaCodecActionCode_isRecoverable
Declared inmedia/NdkMediaCodec.h
bool AMediaCodecActionCode_isRecoverable( int32_t actionCode )
Returns true if the codec cannot proceed further, but can be recovered by stopping, configuring, and starting again.
Available since API level 28.
AMediaCodecActionCode_isTransient
Declared inmedia/NdkMediaCodec.h
bool AMediaCodecActionCode_isTransient( int32_t actionCode )
Returns true if the codec error is a transient issue, perhaps due to resource constraints, and that the method (or encoding/decoding) may be retried at a later time.
Available since API level 28.
AMediaCodecCryptoInfo_delete
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodecCryptoInfo_delete( AMediaCodecCryptoInfo * )
Delete an AMediaCodecCryptoInfo created previously with AMediaCodecCryptoInfo_new, or obtained from AMediaExtractor.
Available since API level 21.
AMediaCodecCryptoInfo_getClearBytes
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodecCryptoInfo_getClearBytes( AMediaCodecCryptoInfo *, size_t *dst )
The number of leading unencrypted bytes in each subsample.
Available since API level 21.
AMediaCodecCryptoInfo_getEncryptedBytes
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodecCryptoInfo_getEncryptedBytes( AMediaCodecCryptoInfo *, size_t *dst )
The number of trailing encrypted bytes in each subsample.
Available since API level 21.
AMediaCodecCryptoInfo_getIV
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodecCryptoInfo_getIV( AMediaCodecCryptoInfo *, uint8_t *dst )
A 16-byte initialization vector.
Available since API level 21.
AMediaCodecCryptoInfo_getKey
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodecCryptoInfo_getKey( AMediaCodecCryptoInfo *, uint8_t *dst )
A 16-byte opaque key.
Available since API level 21.
AMediaCodecCryptoInfo_getMode
Declared inmedia/NdkMediaCodec.h
cryptoinfo_mode_t AMediaCodecCryptoInfo_getMode( AMediaCodecCryptoInfo * )
The type of encryption that has been applied, one of AMEDIACODECRYPTOINFO_MODE_CLEAR or AMEDIACODECRYPTOINFO_MODE_AES_CTR.
Available since API level 21.
AMediaCodecCryptoInfo_getNumSubSamples
Declared inmedia/NdkMediaCodec.h
size_t AMediaCodecCryptoInfo_getNumSubSamples( AMediaCodecCryptoInfo * )
The number of subsamples that make up the buffer's contents.
Available since API level 21.
AMediaCodecCryptoInfo_new
Declared inmedia/NdkMediaCodec.h
AMediaCodecCryptoInfo * AMediaCodecCryptoInfo_new( int numsubsamples, uint8_t key[16], uint8_t iv[16], cryptoinfo_mode_t mode, size_t *clearbytes, size_t *encryptedbytes )
Create an AMediaCodecCryptoInfo from scratch.
Use this if you need to use custom crypto info, rather than one obtained from AMediaExtractor.
AMediaCodecCryptoInfo describes the structure of an (at least partially) encrypted input sample. A buffer's data is considered to be partitioned into "subsamples", each subsample starts with a (potentially empty) run of plain, unencrypted bytes followed by a (also potentially empty) run of encrypted bytes. numBytesOfClearData can be null to indicate that all data is encrypted. This information encapsulates per-sample metadata as outlined in ISO/IEC FDIS 23001-7:2011 "Common encryption in ISO base media file format files".
Available since API level 21.
AMediaCodecCryptoInfo_setPattern
Declared inmedia/NdkMediaCodec.h
void AMediaCodecCryptoInfo_setPattern( AMediaCodecCryptoInfo *info, cryptoinfo_pattern_t *pattern )
Set the crypto pattern on an AMediaCryptoInfo object.
Available since API level 21.
AMediaCodec_configure
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_configure( AMediaCodec *, const AMediaFormat *format, ANativeWindow *surface, AMediaCrypto *crypto, uint32_t flags )
Configure the codec.
For decoding you would typically get the format from an extractor.
Available since API level 21.
AMediaCodec_createCodecByName
Declared inmedia/NdkMediaCodec.h
AMediaCodec * AMediaCodec_createCodecByName( const char *name )
Create codec by name.
Use this if you know the exact codec you want to use. When configuring, you will need to specify whether to use the codec as an encoder or decoder.
Available since API level 21.
AMediaCodec_createDecoderByType
Declared inmedia/NdkMediaCodec.h
AMediaCodec * AMediaCodec_createDecoderByType( const char *mime_type )
Create codec by mime type.
Most applications will use this, specifying a mime type obtained from media extractor.
Available since API level 21.
AMediaCodec_createEncoderByType
Declared inmedia/NdkMediaCodec.h
AMediaCodec * AMediaCodec_createEncoderByType( const char *mime_type )
Create encoder by name.
Available since API level 21.
AMediaCodec_createInputSurface
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_createInputSurface( AMediaCodec *mData, ANativeWindow **surface )
Creates a Surface that can be used as the input to encoder, in place of input buffers.
This can only be called after the codec has been configured via AMediaCodec_configure(..); and before AMediaCodec_start() has been called.
The application is responsible for releasing the surface by calling ANativeWindow_release() when done.
For more details, see the Java documentation for MediaCodec.createInputSurface.
Available since API level 26.
AMediaCodec_createPersistentInputSurface
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_createPersistentInputSurface( ANativeWindow **surface )
Creates a persistent Surface that can be used as the input to encoder.
Persistent surface can be reused by MediaCodec instances and can be set on a new instance via AMediaCodec_setInputSurface(). A persistent surface can be connected to at most one instance of MediaCodec at any point in time.
The application is responsible for releasing the surface by calling ANativeWindow_release() when done.
For more details, see the Java documentation for MediaCodec.createPersistentInputSurface.
Available since API level 26.
AMediaCodec_delete
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_delete( AMediaCodec * )
Delete the codec and free its resources.
Available since API level 21.
AMediaCodec_dequeueInputBuffer
Declared inmedia/NdkMediaCodec.h
ssize_t AMediaCodec_dequeueInputBuffer( AMediaCodec *, int64_t timeoutUs )
Get the index of the next available input buffer.
An app will typically use this with getInputBuffer() to get a pointer to the buffer, then copy the data to be encoded or decoded into the buffer before passing it to the codec.
Available since API level 21.
AMediaCodec_dequeueOutputBuffer
Declared inmedia/NdkMediaCodec.h
ssize_t AMediaCodec_dequeueOutputBuffer( AMediaCodec *, AMediaCodecBufferInfo *info, int64_t timeoutUs )
Get the index of the next available buffer of processed data.
Available since API level 21.
AMediaCodec_flush
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_flush( AMediaCodec * )
AMediaCodec_getBufferFormat
Declared inmedia/NdkMediaCodec.h
AMediaFormat * AMediaCodec_getBufferFormat( AMediaCodec *, size_t index )
Get format of the buffer.
The specified buffer index must have been previously obtained from dequeueOutputBuffer. The caller must free the returned format.
Available since API level 28.
AMediaCodec_getInputBuffer
Declared inmedia/NdkMediaCodec.h
uint8_t * AMediaCodec_getInputBuffer( AMediaCodec *, size_t idx, size_t *out_size )
Get an input buffer.
The specified buffer index must have been previously obtained from dequeueInputBuffer, and not yet queued.
Available since API level 21.
AMediaCodec_getInputFormat
Declared inmedia/NdkMediaCodec.h
AMediaFormat * AMediaCodec_getInputFormat( AMediaCodec * )
Call this after AMediaCodec_configure() returns successfully to get the input format accepted by the codec.
Do this to determine what optional configuration parameters were supported by the codec. The caller must free the returned format.
Available since API level 28.
AMediaCodec_getName
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_getName( AMediaCodec *, char **out_name )
Get the component name.
If the codec was created by createDecoderByType or createEncoderByType, what component is chosen is not known beforehand. Caller shall call AMediaCodec_releaseName to free the returned pointer.
Available since API level 28.
AMediaCodec_getOutputBuffer
Declared inmedia/NdkMediaCodec.h
uint8_t * AMediaCodec_getOutputBuffer( AMediaCodec *, size_t idx, size_t *out_size )
Get an output buffer.
The specified buffer index must have been previously obtained from dequeueOutputBuffer, and not yet queued.
Available since API level 21.
AMediaCodec_getOutputFormat
Declared inmedia/NdkMediaCodec.h
AMediaFormat * AMediaCodec_getOutputFormat( AMediaCodec * )
Returns the format of the codec's output.
The caller must free the returned format.
Available since API level 21.
AMediaCodec_queueInputBuffer
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_queueInputBuffer( AMediaCodec *, size_t idx, _off_t_compat offset, size_t size, uint64_t time, uint32_t flags )
Send the specified buffer to the codec for processing.
Available since API level 21.
AMediaCodec_queueSecureInputBuffer
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_queueSecureInputBuffer( AMediaCodec *, size_t idx, _off_t_compat offset, AMediaCodecCryptoInfo *, uint64_t time, uint32_t flags )
Send the specified buffer to the codec for processing.
Available since API level 21.
AMediaCodec_releaseCrypto
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_releaseCrypto( AMediaCodec * )
Release the crypto if applicable.
Available since API level 28.
AMediaCodec_releaseName
Declared inmedia/NdkMediaCodec.h
void AMediaCodec_releaseName( AMediaCodec *, char *name )
Free the memory pointed by name which is returned by AMediaCodec_getName.
Available since API level 28.
AMediaCodec_releaseOutputBuffer
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_releaseOutputBuffer( AMediaCodec *, size_t idx, bool render )
If you are done with a buffer, use this call to return the buffer to the codec.
If you previously specified a surface when configuring this video decoder you can optionally render the buffer.
Available since API level 21.
AMediaCodec_releaseOutputBufferAtTime
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_releaseOutputBufferAtTime( AMediaCodec *mData, size_t idx, int64_t timestampNs )
If you are done with a buffer, use this call to update its surface timestamp and return it to the codec to render it on the output surface.
If you have not specified an output surface when configuring this video codec, this call will simply return the buffer to the codec.
For more details, see the Java documentation for MediaCodec.releaseOutputBuffer.
Available since API level 21.
AMediaCodec_setAsyncNotifyCallback
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_setAsyncNotifyCallback( AMediaCodec *, AMediaCodecOnAsyncNotifyCallback callback, void *userdata )
Set an asynchronous callback for actionable AMediaCodec events.
When asynchronous callback is enabled, it is an error for the client to call AMediaCodec_getInputBuffers(), AMediaCodec_getOutputBuffers(), AMediaCodec_dequeueInputBuffer() or AMediaCodec_dequeueOutputBuffer().
AMediaCodec_flush() behaves differently in asynchronous mode. After calling AMediaCodec_flush(), the client must call AMediaCodec_start() to "resume" receiving input buffers. Even if the client does not receive AMediaCodecOnAsyncInputAvailable callbacks from video encoders configured with an input surface, the client still needs to call AMediaCodec_start() to resume the input surface to send buffers to the encoders.
When called with null callback, this method unregisters any previously set callback.
Refer to the definition of AMediaCodecOnAsyncNotifyCallback on how each callback function is called and what are specified. The specified userdata is opaque data which will be passed along when the callback functions are called. MediaCodec does not look at or alter the value of userdata. Often it is a pointer to a client-owned object, and client manages the lifecycle of the object in that case.
Once the callback is unregistered or the codec is reset / released, the previously registered callback will not be called.
All callbacks are fired on one NDK internal thread. AMediaCodec_setAsyncNotifyCallback should not be called on the callback thread. No heavy duty task should be performed on callback thread.
Available since API level 28.
AMediaCodec_setInputSurface
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_setInputSurface( AMediaCodec *mData, ANativeWindow *surface )
Set a persistent-surface that can be used as the input to encoder, in place of input buffers.
The surface provided must be a persistent surface created via AMediaCodec_createPersistentInputSurface() This can only be called after the codec has been configured by calling AMediaCodec_configure(..); and before AMediaCodec_start() has been called.
For more details, see the Java documentation for MediaCodec.setInputSurface.
Available since API level 26.
AMediaCodec_setOnFrameRenderedCallback
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_setOnFrameRenderedCallback( AMediaCodec *, AMediaCodecOnFrameRendered callback, void *userdata )
Registers a callback to be invoked when an output frame is rendered on the output surface.
This method can be called in any codec state, but will only have an effect in the Executing state for codecs that render buffers to the output surface.
This callback is for informational purposes only: to get precise render timing samples, and can be significantly delayed and batched. Some frames may have been rendered even if there was no callback generated.
When called with null callback, this method unregisters any previously set callback.
Refer to the definition of AMediaCodecOnFrameRendered on how each callback function is called and what are specified. The specified userdata is opaque data which will be passed along when the callback functions are called. MediaCodec does not look at or alter the value of userdata. Often it is a pointer to a client-owned object, and client manages the lifecycle of the object in that case.
Once the callback is unregistered or the codec is reset / released, the previously registered callback will not be called.
All callbacks are fired on one NDK internal thread. AMediaCodec_setOnFrameRenderedCallback should not be called on the callback thread. No heavy duty task should be performed on callback thread.
Available since Android T.
AMediaCodec_setOutputSurface
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_setOutputSurface( AMediaCodec *, ANativeWindow *surface )
Dynamically sets the output surface of a codec.
This can only be used if the codec was configured with an output surface. The new output surface should have a compatible usage type to the original output surface. E.g. codecs may not support switching from a SurfaceTexture (GPU readable) output to ImageReader (software readable) output.
For more details, see the Java documentation for MediaCodec.setOutputSurface.
Available since API level 21.
AMediaCodec_setParameters
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_setParameters( AMediaCodec *mData, const AMediaFormat *params )
Signal additional parameters to the codec instance.
Parameters can be communicated only when the codec is running, i.e after AMediaCodec_start() has been called.
NOTE: Some of these parameter changes may silently fail to apply.
Available since API level 26.
AMediaCodec_signalEndOfInputStream
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_signalEndOfInputStream( AMediaCodec *mData )
Signals end-of-stream on input.
Equivalent to submitting an empty buffer with AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM set.
Returns AMEDIA_ERROR_INVALID_OPERATION when used with an encoder not in executing state or not receiving input from a Surface created by AMediaCodec_createInputSurface or AMediaCodec_createPersistentInputSurface.
Returns the previous codec error if one exists.
Returns AMEDIA_OK when completed succesfully.
For more details, see the Java documentation for MediaCodec.signalEndOfInputStream.
Available since API level 26.
AMediaCodec_start
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_start( AMediaCodec * )
Start the codec.
A codec must be configured before it can be started, and must be started before buffers can be sent to it.
Available since API level 21.
AMediaCodec_stop
Declared inmedia/NdkMediaCodec.h
media_status_t AMediaCodec_stop( AMediaCodec * )
Stop the codec.
Available since API level 21.
AMediaCrypto_delete
Declared inmedia/NdkMediaCrypto.h
void AMediaCrypto_delete( AMediaCrypto *crypto )
Available since API level 21.
AMediaCrypto_isCryptoSchemeSupported
Declared inmedia/NdkMediaCrypto.h
bool AMediaCrypto_isCryptoSchemeSupported( const AMediaUUID uuid )
Available since API level 21.
AMediaCrypto_new
Declared inmedia/NdkMediaCrypto.h
AMediaCrypto * AMediaCrypto_new( const AMediaUUID uuid, const void *initData, size_t initDataSize )
Available since API level 21.
AMediaCrypto_requiresSecureDecoderComponent
Declared inmedia/NdkMediaCrypto.h
bool AMediaCrypto_requiresSecureDecoderComponent( const char *mime )
Available since API level 21.
AMediaDataSource_close
Declared inmedia/NdkMediaDataSource.h
void AMediaDataSource_close( AMediaDataSource * )
Close the data source, unblock reads, and release associated resources.
Please refer to the definition of AMediaDataSourceClose for additional details.
Available since API level 29.
AMediaDataSource_delete
Declared inmedia/NdkMediaDataSource.h
void AMediaDataSource_delete( AMediaDataSource * )
Delete a previously created media data source.
Available since API level 28.
AMediaDataSource_new
Declared inmedia/NdkMediaDataSource.h
AMediaDataSource * AMediaDataSource_new()
Create new media data source.
Returns NULL if memory allocation for the new data source object fails.
Available since API level 28.
AMediaDataSource_newUri
Declared inmedia/NdkMediaDataSource.h
AMediaDataSource * AMediaDataSource_newUri( const char *uri, int numheaders, const char *const *key_values )
Create new media data source.
Returns NULL if memory allocation for the new data source object fails.
Set the uri
from which the data source will read, plus additional http headers when initiating the request.
Headers will contain corresponding items from key_values
in the following fashion:
key_values[0]:key_values[1] key_values[2]:key_values[3] ... key_values[(numheaders - 1) * 2]:key_values[(numheaders - 1) * 2 + 1]
Available since API level 29.
AMediaDataSource_setClose
Declared inmedia/NdkMediaDataSource.h
void AMediaDataSource_setClose( AMediaDataSource *, AMediaDataSourceClose )
Set a custom callback to receive signal from the NDK media framework when the data source is closed.
Please refer to the definition of AMediaDataSourceClose for additional details.
Available since API level 28.
AMediaDataSource_setGetAvailableSize
Declared inmedia/NdkMediaDataSource.h
void AMediaDataSource_setGetAvailableSize( AMediaDataSource *, AMediaDataSourceGetAvailableSize )
Set a custom callback for supplying the estimated number of bytes that can be read from this data source starting at an offset without blocking for I/O.
Please refer to the definition of AMediaDataSourceGetAvailableSize for additional details.
Available since API level 29.
AMediaDataSource_setGetSize
Declared inmedia/NdkMediaDataSource.h
void AMediaDataSource_setGetSize( AMediaDataSource *, AMediaDataSourceGetSize )
Set a custom callback for supplying the size of the data source to the NDK media framework.
Please refer to the definition of AMediaDataSourceGetSize for additional details.
Available since API level 28.
AMediaDataSource_setReadAt
Declared inmedia/NdkMediaDataSource.h
void AMediaDataSource_setReadAt( AMediaDataSource *, AMediaDataSourceReadAt )
Set a custom callback for supplying random access media data to the NDK media framework.
Implement this if your app has special requirements for the way media data is obtained, or if you need a callback when data is read by the NDK media framework.
Please refer to the definition of AMediaDataSourceReadAt for additional details.
Available since API level 28.
AMediaDataSource_setUserdata
Declared inmedia/NdkMediaDataSource.h
void AMediaDataSource_setUserdata( AMediaDataSource *, void *userdata )
Set an user provided opaque handle.
This opaque handle is passed as the first argument to the data source callbacks.
Available since API level 28.
AMediaDrm_closeSession
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_closeSession( AMediaDrm *, const AMediaDrmSessionId *sessionId )
Close a session on the MediaDrm object that was previously opened with AMediaDrm_openSession.
Available since API level 21.
AMediaDrm_createByUUID
Declared inmedia/NdkMediaDrm.h
AMediaDrm * AMediaDrm_createByUUID( const uint8_t *uuid )
Create a MediaDrm instance from a UUID.
uuid identifies the universal unique ID of the crypto scheme. uuid must be 16 bytes.
Available since API level 21.
AMediaDrm_decrypt
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_decrypt( AMediaDrm *, const AMediaDrmSessionId *sessionId, const char *cipherAlgorithm, uint8_t *keyId, uint8_t *iv, const uint8_t *input, uint8_t *output, size_t dataSize )
AMediaDrm_encrypt
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_encrypt( AMediaDrm *, const AMediaDrmSessionId *sessionId, const char *cipherAlgorithm, uint8_t *keyId, uint8_t *iv, const uint8_t *input, uint8_t *output, size_t dataSize )
In addition to supporting decryption of DASH Common Encrypted Media, the MediaDrm APIs provide the ability to securely deliver session keys from an operator's session key server to a client device, based on the factory-installed root of trust, and then perform encrypt, decrypt, sign and verify operations with the session key on arbitrary user data.
Operators create session key servers that receive session key requests and provide encrypted session keys which can be used for general purpose crypto operations.
Generic encrypt/decrypt/sign/verify methods are based on the established session keys. These keys are exchanged using the getKeyRequest/provideKeyResponse methods.
Applications of this capability include securing various types of purchased or private content, such as applications, books and other media, photos or media delivery protocols.
AMediaDrm_getKeyRequest
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_getKeyRequest( AMediaDrm *, const AMediaDrmScope *scope, const uint8_t *init, size_t initSize, const char *mimeType, AMediaDrmKeyType keyType, const AMediaDrmKeyValue *optionalParameters, size_t numOptionalParameters, const uint8_t **keyRequest, size_t *keyRequestSize )
A key request/response exchange occurs between the app and a license server to obtain or release keys used to decrypt encrypted content.
AMediaDrm_getKeyRequest is used to obtain an opaque key request byte array that is delivered to the license server. The opaque key request byte array is returned in *keyRequest and the number of bytes in the request is returned in *keyRequestSize. This API has same functionality as AMediaDrm_getKeyRequestWithDefaultUrlAndType() when defaultUrl and keyRequestType are passed in as NULL.
After the app has received the key request response from the server, it should deliver to the response to the DRM engine plugin using the method AMediaDrm_provideKeyResponse.
scope may be a sessionId or a keySetId, depending on the specified keyType. When the keyType is KEY_TYPE_STREAMING or KEY_TYPE_OFFLINE, scope should be set to the sessionId the keys will be provided to. When the keyType is KEY_TYPE_RELEASE, scope should be set to the keySetId of the keys being released. Releasing keys from a device invalidates them for all sessions.
init container-specific data, its meaning is interpreted based on the mime type provided in the mimeType parameter. It could contain, for example, the content ID, key ID or other data obtained from the content metadata that is required in generating the key request. init may be null when keyType is KEY_TYPE_RELEASE.
initSize is the number of bytes of initData
mimeType identifies the mime type of the content.
keyType specifes the type of the request. The request may be to acquire keys for streaming or offline content, or to release previously acquired keys, which are identified by a keySetId.
optionalParameters are included in the key request message to allow a client application to provide additional message parameters to the server.
numOptionalParameters indicates the number of optional parameters provided by the caller
On exit: If this returns AMEDIA_OK,
- The keyRequest pointer will reference the opaque key request data. It will reside in memory owned by the AMediaDrm object, and will remain accessible until the next call to AMediaDrm_getKeyRequest or AMediaDrm_getKeyRequestWithDefaultUrlAndType or until the MediaDrm object is released.
- keyRequestSize will be set to the size of the request If this does not return AMEDIA_OK, value of these parameters should not be used.
Returns AMEDIA_DRM_NOT_PROVISIONED if reprovisioning is needed, due to a problem with the device certificate.
Available since API level 21.
AMediaDrm_getKeyRequestWithDefaultUrlAndType
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_getKeyRequestWithDefaultUrlAndType( AMediaDrm *, const AMediaDrmScope *scope, const uint8_t *init, size_t initSize, const char *mimeType, AMediaDrmKeyType keyType, const AMediaDrmKeyValue *optionalParameters, size_t numOptionalParameters, const uint8_t **keyRequest, size_t *keyRequestSize, const char **defaultUrl, AMediaDrmKeyRequestType *keyRequestType )
A key request/response exchange occurs between the app and a license server to obtain or release keys used to decrypt encrypted content.
AMediaDrm_getKeyRequest is used to obtain an opaque key request byte array that is delivered to the license server. The opaque key request byte array is returned in *keyRequest and the number of bytes in the request is returned in *keyRequestSize.
After the app has received the key request response from the server, it should deliver to the response to the DRM engine plugin using the method AMediaDrm_provideKeyResponse.
scope may be a sessionId or a keySetId, depending on the specified keyType. When the keyType is KEY_TYPE_STREAMING or KEY_TYPE_OFFLINE, scope should be set to the sessionId the keys will be provided to. When the keyType is KEY_TYPE_RELEASE, scope should be set to the keySetId of the keys being released. Releasing keys from a device invalidates them for all sessions.
init container-specific data, its meaning is interpreted based on the mime type provided in the mimeType parameter. It could contain, for example, the content ID, key ID or other data obtained from the content metadata that is required in generating the key request. init may be null when keyType is KEY_TYPE_RELEASE.
initSize is the number of bytes of initData
mimeType identifies the mime type of the content.
keyType specifes the type of the request. The request may be to acquire keys for streaming or offline content, or to release previously acquired keys, which are identified by a keySetId.
optionalParameters are included in the key request message to allow a client application to provide additional message parameters to the server.
numOptionalParameters indicates the number of optional parameters provided by the caller
On exit: If this returns AMEDIA_OK,
- The keyRequest pointer will reference the opaque key request data. It will reside in memory owned by the AMediaDrm object, and will remain accessible until the next call to either AMediaDrm_getKeyRequest or AMediaDrm_getKeyRequestWithDefaultUrlAndType or until the MediaDrm object is released.
- keyRequestSize will be set to the size of the request.
- defaultUrl will be set to the recommended URL to deliver the key request. The defaultUrl pointer will reference a NULL terminated URL string. It will be UTF-8 encoded and have same lifetime with the key request data KeyRequest pointer references to. Passing in NULL means you don't need it to be reported.
- keyRequestType will be set to the key request type. Passing in NULL means you don't need it to be reported.
Returns AMEDIA_DRM_NOT_PROVISIONED if reprovisioning is needed, due to a problem with the device certificate.
Available since API level 33.
AMediaDrm_getPropertyByteArray
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_getPropertyByteArray( AMediaDrm *, const char *propertyName, AMediaDrmByteArray *propertyValue )
Read a DRM engine plugin byte array property value, given the property name string.
On return, *propertyValue will be set to point to the property value. The memory that the value resides in is owned by the NDK MediaDrm API and will remain valid until the next call to AMediaDrm_getPropertyByteArray.
Available since API level 21.
AMediaDrm_getPropertyString
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_getPropertyString( AMediaDrm *, const char *propertyName, const char **propertyValue )
Read a DRM engine plugin String property value, given the property name string.
propertyName identifies the property to query On return, propertyValue will be set to point to the property value. The memory that the value resides in is owned by the NDK MediaDrm API and will remain valid until the next call to AMediaDrm_getPropertyString.
Available since API level 21.
AMediaDrm_getProvisionRequest
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_getProvisionRequest( AMediaDrm *, const uint8_t **provisionRequest, size_t *provisionRequestSize, const char **serverUrl )
A provision request/response exchange occurs between the app and a provisioning server to retrieve a device certificate.
If provisionining is required, the EVENT_PROVISION_REQUIRED event will be sent to the event handler. getProvisionRequest is used to obtain the opaque provision request byte array that should be delivered to the provisioning server. On exit:
- The provision request data will be referenced by provisionRequest, in memory owned by the AMediaDrm object. It will remain accessible until the next call to getProvisionRequest.
- provisionRequestSize will be set to the size of the request data.
- serverUrl will reference a NULL terminated string containing the URL the provisioning request should be sent to. It will remain accessible until the next call to getProvisionRequest.
Available since API level 21.
AMediaDrm_getSecureStops
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_getSecureStops( AMediaDrm *, AMediaDrmSecureStop *secureStops, size_t *numSecureStops )
A means of enforcing limits on the number of concurrent streams per subscriber across devices is provided via SecureStop.
This is achieved by securely monitoring the lifetime of sessions.
Information from the server related to the current playback session is written to persistent storage on the device when each MediaCrypto object is created.
In the normal case, playback will be completed, the session destroyed and the Secure Stops will be queried. The app queries secure stops and forwards the secure stop message to the server which verifies the signature and notifies the server side database that the session destruction has been confirmed. The persisted record on the client is only removed after positive confirmation that the server received the message using releaseSecureStops().
numSecureStops is set by the caller to the maximum number of secure stops to return. On exit, *numSecureStops will be set to the number actually returned. If *numSecureStops is too small for the number of secure stops available, AMEDIA_DRM_SHORT_BUFFER will be returned and *numSecureStops will be set to the number required.
Available since API level 21.
AMediaDrm_isCryptoSchemeSupported
Declared inmedia/NdkMediaDrm.h
bool AMediaDrm_isCryptoSchemeSupported( const uint8_t *uuid, const char *mimeType )
Query if the given scheme identified by its UUID is supported on this device, and whether the drm plugin is able to handle the media container format specified by mimeType.
uuid identifies the universal unique ID of the crypto scheme. uuid must be 16 bytes. mimeType is the MIME type of the media container, e.g. "video/mp4". If mimeType is not known or required, it can be provided as NULL.
Available since API level 21.
AMediaDrm_openSession
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_openSession( AMediaDrm *, AMediaDrmSessionId *sessionId )
Open a new session with the MediaDrm object.
A session ID is returned.
Returns AMEDIA_DRM_NOT_PROVISIONED if provisioning is needed. Returns AMEDIA_DRM_RESOURCE_BUSY if required resources are in use.
Available since API level 21.
AMediaDrm_provideKeyResponse
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_provideKeyResponse( AMediaDrm *, const AMediaDrmScope *scope, const uint8_t *response, size_t responseSize, AMediaDrmKeySetId *keySetId )
A key response is received from the license server by the app, then it is provided to the DRM engine plugin using provideKeyResponse.
When the response is for an offline key request, a keySetId is returned that can be used to later restore the keys to a new session with AMediaDrm_restoreKeys. When the response is for a streaming or release request, a null keySetId is returned.
scope may be a sessionId or keySetId depending on the type of the response. Scope should be set to the sessionId when the response is for either streaming or offline key requests. Scope should be set to the keySetId when the response is for a release request.
response points to the opaque response from the server responseSize should be set to the size of the response in bytes
Available since API level 21.
AMediaDrm_provideProvisionResponse
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_provideProvisionResponse( AMediaDrm *, const uint8_t *response, size_t responseSize )
After a provision response is received by the app, it is provided to the DRM engine plugin using this method.
response is the opaque provisioning response byte array to provide to the DRM engine plugin. responseSize is the length of the provisioning response in bytes.
Returns AMEDIA_DRM_DEVICE_REVOKED if the response indicates that the server rejected the request
Available since API level 21.
AMediaDrm_queryKeyStatus
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_queryKeyStatus( AMediaDrm *, const AMediaDrmSessionId *sessionId, AMediaDrmKeyValue *keyValuePairs, size_t *numPairs )
Request an informative description of the key status for the session.
The status is in the form of {key, value} pairs. Since DRM license policies vary by vendor, the specific status field names are determined by each DRM vendor. Refer to your DRM provider documentation for definitions of the field names for a particular DRM engine plugin.
On entry, numPairs should be set by the caller to the maximum number of pairs that can be returned (the size of the array). On exit, numPairs will be set to the number of entries written to the array. If the number of {key, value} pairs to be returned is greater than *numPairs, AMEDIA_DRM_SHORT_BUFFER will be returned and numPairs will be set to the number of pairs available.
Available since API level 21.
AMediaDrm_release
Declared inmedia/NdkMediaDrm.h
void AMediaDrm_release( AMediaDrm * )
Release a MediaDrm object.
Available since API level 21.
AMediaDrm_releaseSecureStops
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_releaseSecureStops( AMediaDrm *, const AMediaDrmSecureStop *ssRelease )
Process the SecureStop server response message ssRelease.
After authenticating the message, remove the SecureStops identified in the response.
ssRelease is the server response indicating which secure stops to release
Available since API level 21.
AMediaDrm_removeKeys
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_removeKeys( AMediaDrm *, const AMediaDrmSessionId *keySetId )
Remove the current keys from a session.
keySetId identifies keys to remove.
Available since API level 21.
AMediaDrm_restoreKeys
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_restoreKeys( AMediaDrm *, const AMediaDrmSessionId *sessionId, const AMediaDrmKeySetId *keySetId )
Restore persisted offline keys into a new session.
keySetId identifies the keys to load, obtained from a prior call to AMediaDrm_provideKeyResponse.
sessionId is the session ID for the DRM session. keySetId identifies the saved key set to restore.
Available since API level 21.
AMediaDrm_setOnEventListener
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_setOnEventListener( AMediaDrm *, AMediaDrmEventListener listener )
Register a callback to be invoked when an event occurs.
listener is the callback that will be invoked on event.
Available since API level 21.
AMediaDrm_setOnExpirationUpdateListener
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_setOnExpirationUpdateListener( AMediaDrm *, AMediaDrmExpirationUpdateListener listener )
Register a callback to be invoked when an expiration update event occurs.
listener is the callback that will be invoked on event.
Available since API level 29.
AMediaDrm_setOnKeysChangeListener
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_setOnKeysChangeListener( AMediaDrm *, AMediaDrmKeysChangeListener listener )
Register a callback to be invoked when a key status change event occurs.
listener is the callback that will be invoked on event.
Available since API level 29.
AMediaDrm_setPropertyByteArray
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_setPropertyByteArray( AMediaDrm *, const char *propertyName, const uint8_t *value, size_t valueSize )
Set a DRM engine plugin byte array property value.
Available since API level 21.
AMediaDrm_setPropertyString
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_setPropertyString( AMediaDrm *, const char *propertyName, const char *value )
Set a DRM engine plugin String property value.
Available since API level 21.
AMediaDrm_sign
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_sign( AMediaDrm *, const AMediaDrmSessionId *sessionId, const char *macAlgorithm, uint8_t *keyId, uint8_t *message, size_t messageSize, uint8_t *signature, size_t *signatureSize )
AMediaDrm_verify
Declared inmedia/NdkMediaDrm.h
media_status_t AMediaDrm_verify( AMediaDrm *, const AMediaDrmSessionId *sessionId, const char *macAlgorithm, uint8_t *keyId, const uint8_t *message, size_t messageSize, const uint8_t *signature, size_t signatureSize )
AMediaExtractor_advance
Declared inmedia/NdkMediaExtractor.h
bool AMediaExtractor_advance( AMediaExtractor * )
Advance to the next sample.
Returns false if no more sample data is available (end of stream).
Available since API level 21.
AMediaExtractor_delete
Declared inmedia/NdkMediaExtractor.h
media_status_t AMediaExtractor_delete( AMediaExtractor * )
Delete a previously created media extractor.
Available since API level 21.
AMediaExtractor_getCachedDuration
Declared inmedia/NdkMediaExtractor.h
int64_t AMediaExtractor_getCachedDuration( AMediaExtractor * )
Returns the duration of cached media samples downloaded from a network data source (AMediaExtractor_setDataSource with a "http(s)" URI) in microseconds.
This information is calculated using total bitrate; if total bitrate is not in the media container it is calculated using total duration and file size.
Returns -1 when the extractor is not reading from a network data source, or when the cached duration cannot be calculated (bitrate, duration, and file size information not available).
Available since API level 28.
AMediaExtractor_getFileFormat
Declared inmedia/NdkMediaExtractor.h
AMediaFormat * AMediaExtractor_getFileFormat( AMediaExtractor * )
Returns the format of the extractor.
The caller must free the returned format using AMediaFormat_delete(format).
This function will always return a format; however, the format could be empty (no key-value pairs) if the media container does not provide format information.
Available since API level 28.
AMediaExtractor_getPsshInfo
Declared inmedia/NdkMediaExtractor.h
PsshInfo * AMediaExtractor_getPsshInfo( AMediaExtractor * )
Get the PSSH info if present.
Available since API level 21.
AMediaExtractor_getSampleCryptoInfo
Declared inmedia/NdkMediaExtractor.h
AMediaCodecCryptoInfo * AMediaExtractor_getSampleCryptoInfo( AMediaExtractor * )
Available since API level 21.
AMediaExtractor_getSampleFlags
Declared inmedia/NdkMediaExtractor.h
uint32_t AMediaExtractor_getSampleFlags( AMediaExtractor * )
Read the current sample's flags.
Available since API level 21.
AMediaExtractor_getSampleFormat
Declared inmedia/NdkMediaExtractor.h
media_status_t AMediaExtractor_getSampleFormat( AMediaExtractor *ex, AMediaFormat *fmt )
Read the current sample's metadata format into fmt
.
Examples of sample metadata are SEI (supplemental enhancement information) and MPEG user data, both of which can embed closed-caption data.
Returns AMEDIA_OK on success or AMEDIA_ERROR_* to indicate failure reason. Existing key-value pairs in fmt
would be removed if this API returns AMEDIA_OK. The contents of fmt
is undefined if this API returns AMEDIA_ERROR_*.
Available since API level 28.
AMediaExtractor_getSampleSize
Declared inmedia/NdkMediaExtractor.h
ssize_t AMediaExtractor_getSampleSize( AMediaExtractor * )
Returns the size of the current sample in bytes, or -1 when no samples are available (end of stream).
This API can be used in in conjunction with AMediaExtractor_readSampleData:
ssize_t sampleSize = AMediaExtractor_getSampleSize(ex); uint8_t *buf = new uint8_t[sampleSize]; AMediaExtractor_readSampleData(ex, buf, sampleSize);
Available since API level 28.
AMediaExtractor_getSampleTime
Declared inmedia/NdkMediaExtractor.h
int64_t AMediaExtractor_getSampleTime( AMediaExtractor * )
Returns the current sample's presentation time in microseconds.
or -1 if no more samples are available.
Available since API level 21.
AMediaExtractor_getSampleTrackIndex
Declared inmedia/NdkMediaExtractor.h
int AMediaExtractor_getSampleTrackIndex( AMediaExtractor * )
Returns the track index the current sample originates from (or -1 if no more samples are available)
Available since API level 21.
AMediaExtractor_getTrackCount
Declared inmedia/NdkMediaExtractor.h
size_t AMediaExtractor_getTrackCount( AMediaExtractor * )
Return the number of tracks in the previously specified media file.
Available since API level 21.
AMediaExtractor_getTrackFormat
Declared inmedia/NdkMediaExtractor.h
AMediaFormat * AMediaExtractor_getTrackFormat( AMediaExtractor *, size_t idx )
Return the format of the specified track.
The caller must free the returned format
Available since API level 21.
AMediaExtractor_new
Declared inmedia/NdkMediaExtractor.h
AMediaExtractor * AMediaExtractor_new()
Create new media extractor.
Available since API level 21.
AMediaExtractor_readSampleData
Declared inmedia/NdkMediaExtractor.h
ssize_t AMediaExtractor_readSampleData( AMediaExtractor *, uint8_t *buffer, size_t capacity )
Read the current sample.
Available since API level 21.
AMediaExtractor_seekTo
Declared inmedia/NdkMediaExtractor.h
media_status_t AMediaExtractor_seekTo( AMediaExtractor *, int64_t seekPosUs, SeekMode mode )
Available since API level 21.
AMediaExtractor_selectTrack
Declared inmedia/NdkMediaExtractor.h
media_status_t AMediaExtractor_selectTrack( AMediaExtractor *, size_t idx )
Select the specified track.
Subsequent calls to readSampleData, getSampleTrackIndex and getSampleTime only retrieve information for the subset of tracks selected. Selecting the same track multiple times has no effect, the track is only selected once.
Available since API level 21.
AMediaExtractor_setDataSource
Declared inmedia/NdkMediaExtractor.h
media_status_t AMediaExtractor_setDataSource( AMediaExtractor *, const char *location )
Set the URI from which the extractor will read.
Available since API level 21.
AMediaExtractor_setDataSourceCustom
Declared inmedia/NdkMediaExtractor.h
media_status_t AMediaExtractor_setDataSourceCustom( AMediaExtractor *, AMediaDataSource *src )
Set the custom data source implementation from which the extractor will read.
Available since API level 28.
AMediaExtractor_setDataSourceFd
Declared inmedia/NdkMediaExtractor.h
media_status_t AMediaExtractor_setDataSourceFd( AMediaExtractor *, int fd, off64_t offset, off64_t length )
Set the file descriptor from which the extractor will read.
Available since API level 21.
AMediaExtractor_unselectTrack
Declared inmedia/NdkMediaExtractor.h
media_status_t AMediaExtractor_unselectTrack( AMediaExtractor *, size_t idx )
Unselect the specified track.
Subsequent calls to readSampleData, getSampleTrackIndex and getSampleTime only retrieve information for the subset of tracks selected.
Available since API level 21.
AMediaFormat_clear
Declared inmedia/NdkMediaFormat.h
void AMediaFormat_clear( AMediaFormat * )
Remove all key/value pairs from the given AMediaFormat.
Available since API level 29.
AMediaFormat_copy
Declared inmedia/NdkMediaFormat.h
media_status_t AMediaFormat_copy( AMediaFormat *to, AMediaFormat *from )
Copy one AMediaFormat to another.
Available since API level 29.
AMediaFormat_delete
Declared inmedia/NdkMediaFormat.h
media_status_t AMediaFormat_delete( AMediaFormat * )
Available since API level 21.
AMediaFormat_getBuffer
Declared inmedia/NdkMediaFormat.h
bool AMediaFormat_getBuffer( AMediaFormat *, const char *name, void **data, size_t *size )
The returned data is owned by the format and remains valid as long as the named entry is part of the format.
Available since API level 21.
AMediaFormat_getDouble
Declared inmedia/NdkMediaFormat.h
bool AMediaFormat_getDouble( AMediaFormat *, const char *name, double *out )
Available since API level 28.
AMediaFormat_getFloat
Declared inmedia/NdkMediaFormat.h
bool AMediaFormat_getFloat( AMediaFormat *, const char *name, float *out )
Available since API level 21.
AMediaFormat_getInt32
Declared inmedia/NdkMediaFormat.h
bool AMediaFormat_getInt32( AMediaFormat *, const char *name, int32_t *out )
Available since API level 21.
AMediaFormat_getInt64
Declared inmedia/NdkMediaFormat.h
bool AMediaFormat_getInt64( AMediaFormat *, const char *name, int64_t *out )
Available since API level 21.
AMediaFormat_getRect
Declared inmedia/NdkMediaFormat.h
bool AMediaFormat_getRect( AMediaFormat *, const char *name, int32_t *left, int32_t *top, int32_t *right, int32_t *bottom )
Available since API level 28.
AMediaFormat_getSize
Declared inmedia/NdkMediaFormat.h
bool AMediaFormat_getSize( AMediaFormat *, const char *name, size_t *out )
Available since API level 21.
AMediaFormat_getString
Declared inmedia/NdkMediaFormat.h
bool AMediaFormat_getString( AMediaFormat *, const char *name, const char **out )
The returned string is owned by the format, and remains valid until the next call to getString, or until the format is deleted.
Available since API level 21.
AMediaFormat_new
Declared inmedia/NdkMediaFormat.h
AMediaFormat * AMediaFormat_new()
Available since API level 21.
AMediaFormat_setBuffer
Declared inmedia/NdkMediaFormat.h
void AMediaFormat_setBuffer( AMediaFormat *, const char *name, const void *data, size_t size )
The provided data is copied into the format.
Available since API level 21.
AMediaFormat_setDouble
Declared inmedia/NdkMediaFormat.h
void AMediaFormat_setDouble( AMediaFormat *, const char *name, double value )
Available since API level 28.
AMediaFormat_setFloat
Declared inmedia/NdkMediaFormat.h
void AMediaFormat_setFloat( AMediaFormat *, const char *name, float value )
Available since API level 21.
AMediaFormat_setInt32
Declared inmedia/NdkMediaFormat.h
void AMediaFormat_setInt32( AMediaFormat *, const char *name, int32_t value )
Available since API level 21.
AMediaFormat_setInt64
Declared inmedia/NdkMediaFormat.h
void AMediaFormat_setInt64( AMediaFormat *, const char *name, int64_t value )
Available since API level 21.
AMediaFormat_setRect
Declared inmedia/NdkMediaFormat.h
void AMediaFormat_setRect( AMediaFormat *, const char *name, int32_t left, int32_t top, int32_t right, int32_t bottom )
Available since API level 28.
AMediaFormat_setSize
Declared inmedia/NdkMediaFormat.h
void AMediaFormat_setSize( AMediaFormat *, const char *name, size_t value )
Available since API level 28.
AMediaFormat_setString
Declared inmedia/NdkMediaFormat.h
void AMediaFormat_setString( AMediaFormat *, const char *name, const char *value )
The provided string is copied into the format.
Available since API level 21.
AMediaFormat_toString
Declared inmedia/NdkMediaFormat.h
const char * AMediaFormat_toString( AMediaFormat * )
Human readable representation of the format.
The returned string is owned by the format, and remains valid until the next call to toString, or until the format is deleted.
Available since API level 21.
AMediaMuxer_addTrack
Declared inmedia/NdkMediaMuxer.h
ssize_t AMediaMuxer_addTrack( AMediaMuxer *, const AMediaFormat *format )
Adds a track with the specified format.
Returns the index of the new track or a negative value in case of failure, which can be interpreted as a media_status_t.
Available since API level 21.
AMediaMuxer_append
Declared inmedia/NdkMediaMuxer.h
AMediaMuxer * AMediaMuxer_append( int fd, AppendMode mode )
Creates a new media muxer for appending data to an existing MPEG4 file.
This is a synchronous API call and could take a while to return if the existing file is large. Only works for MPEG4 files matching one of the following characteristics:
- a single audio track.
- a single video track.
- a single audio and a single video track.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Pointer to AMediaMuxer if the file(fd) has tracks already, otherwise, nullptr. AMediaMuxer_delete should be used to free the returned pointer.
|
AMediaMuxer_delete
Declared inmedia/NdkMediaMuxer.h
media_status_t AMediaMuxer_delete( AMediaMuxer * )
Delete a previously created media muxer.
Available since API level 21.
AMediaMuxer_getTrackCount
Declared inmedia/NdkMediaMuxer.h
ssize_t AMediaMuxer_getTrackCount( AMediaMuxer * )
Returns the number of tracks added in the file passed to AMediaMuxer_new or the number of existing tracks in the file passed to AMediaMuxer_append.
Should be called in INITIALIZED or STARTED state, otherwise returns -1.
Available since API level 31.
AMediaMuxer_getTrackFormat
Declared inmedia/NdkMediaMuxer.h
AMediaFormat * AMediaMuxer_getTrackFormat( AMediaMuxer *muxer, size_t idx )
Returns AMediaFormat of the added track with index idx in the file passed to AMediaMuxer_new or the AMediaFormat of the existing track with index idx in the file passed to AMediaMuxer_append.
Should be called in INITIALIZED or STARTED state, otherwise returns nullptr. AMediaFormat_delete should be used to free the returned pointer.
Available since API level 31.
AMediaMuxer_new
Declared inmedia/NdkMediaMuxer.h
AMediaMuxer * AMediaMuxer_new( int fd, OutputFormat format )
Create new media muxer.
Available since API level 21.
AMediaMuxer_setLocation
Declared inmedia/NdkMediaMuxer.h
media_status_t AMediaMuxer_setLocation( AMediaMuxer *, float latitude, float longitude )
Set and store the geodata (latitude and longitude) in the output file.
This method should be called before AMediaMuxer_start. The geodata is stored in udta box if the output format is AMEDIAMUXER_OUTPUT_FORMAT_MPEG_4, and is ignored for other output formats. The geodata is stored according to ISO-6709 standard.
Both values are specified in degrees. Latitude must be in the range [-90, 90]. Longitude must be in the range [-180, 180].
Available since API level 21.
AMediaMuxer_setOrientationHint
Declared inmedia/NdkMediaMuxer.h
media_status_t AMediaMuxer_setOrientationHint( AMediaMuxer *, int degrees )
Sets the orientation hint for output video playback.
This method should be called before AMediaMuxer_start. Calling this method will not rotate the video frame when muxer is generating the file, but add a composition matrix containing the rotation angle in the output video if the output format is AMEDIAMUXER_OUTPUT_FORMAT_MPEG_4, so that a video player can choose the proper orientation for playback. Note that some video players may choose to ignore the composition matrix during playback. The angle is specified in degrees, clockwise. The supported angles are 0, 90, 180, and 270 degrees.
Available since API level 21.
AMediaMuxer_start
Declared inmedia/NdkMediaMuxer.h
media_status_t AMediaMuxer_start( AMediaMuxer * )
Start the muxer.
Should be called after AMediaMuxer_addTrack and before AMediaMuxer_writeSampleData.
Available since API level 21.
AMediaMuxer_stop
Declared inmedia/NdkMediaMuxer.h
media_status_t AMediaMuxer_stop( AMediaMuxer * )
Stops the muxer.
Once the muxer stops, it can not be restarted.
Available since API level 21.
AMediaMuxer_writeSampleData
Declared inmedia/NdkMediaMuxer.h
media_status_t AMediaMuxer_writeSampleData( AMediaMuxer *muxer, size_t trackIdx, const uint8_t *data, const AMediaCodecBufferInfo *info )
Writes an encoded sample into the muxer.
The application needs to make sure that the samples are written into the right tracks. Also, it needs to make sure the samples for each track are written in chronological order (e.g. in the order they are provided by the encoder.)
Available since API level 21.