diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioTrack.h | 5 | ||||
-rw-r--r-- | include/ndk/NdkMediaCodec.h | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 2c48bbf..79db323 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -154,8 +154,9 @@ public: * streamType: Select the type of audio stream this track is attached to * (e.g. AUDIO_STREAM_MUSIC). * sampleRate: Data source sampling rate in Hz. - * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed - * 16 bits per sample). + * format: Audio format. For mixed tracks, any PCM format supported by server is OK + * or AUDIO_FORMAT_PCM_8_BIT which is handled on client side. For direct + * and offloaded tracks, the possible format(s) depends on the output sink. * channelMask: Channel mask, such that audio_is_output_channel(channelMask) is true. * frameCount: Minimum size of track PCM buffer in frames. This defines the * application's contribution to the diff --git a/include/ndk/NdkMediaCodec.h b/include/ndk/NdkMediaCodec.h index 73ece1b..2af88d0 100644 --- a/include/ndk/NdkMediaCodec.h +++ b/include/ndk/NdkMediaCodec.h @@ -49,6 +49,7 @@ typedef struct AMediaCodecBufferInfo AMediaCodecBufferInfo; enum { AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM = 4, + AMEDIACODEC_CONFIGURE_FLAG_ENCODE = 1, AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED = -3, AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED = -2, AMEDIACODEC_INFO_TRY_AGAIN_LATER = -1 @@ -56,20 +57,22 @@ enum { /** - * Create decoder by name. Use this if you know the exact codec you want to use. + * 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. */ -AMediaCodec* AMediaCodec_createByCodecName(const char *name); +AMediaCodec* AMediaCodec_createCodecByName(const char *name); /** * Create codec by mime type. Most applications will use this, specifying a * mime type obtained from media extractor. */ -AMediaCodec* AMediaCodec_createByCodecType(const char *mime_type); +AMediaCodec* AMediaCodec_createDecoderByType(const char *mime_type); /** * Create encoder by name. */ -AMediaCodec* AMediaCodec_createEncoderByName(const char *name); +AMediaCodec* AMediaCodec_createEncoderByType(const char *mime_type); /** * delete the codec and free its resources @@ -79,7 +82,8 @@ int AMediaCodec_delete(AMediaCodec*); /** * Configure the codec. For decoding you would typically get the format from an extractor. */ -int AMediaCodec_configure(AMediaCodec*, const AMediaFormat* format, ANativeWindow* surface); // TODO: other args +int AMediaCodec_configure(AMediaCodec*, const AMediaFormat* format, + ANativeWindow* surface, uint32_t flags); // TODO: other args /** * Start the codec. A codec must be configured before it can be started, and must be started |