MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / configureAudio

Method configureAudio

framework/codec/Android/jni/MediaCodec_Decoder.cpp:193–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193int MediaCodec_Decoder::configureAudio(const std::string &mime, int sampleRate, int channelCount,
194 int isADTS) {
195 JniEnv jniEnv{};
196
197 JNIEnv *env = jniEnv.getEnv();
198 if (env == nullptr) {
199 return MC_ERROR;
200 }
201
202 if (mMediaCodec == nullptr) {
203 return MC_ERROR;
204 }
205
206 mCodecCategory = CATEGORY_AUDIO;
207 NewStringUTF jMime(env, mime.c_str());
208 int ret = env->CallIntMethod(mMediaCodec, jMediaCodec_configureAudio, jMime.getString(),
209 (jint) sampleRate, (jint) channelCount, (jint) isADTS);
210
211 return ret;
212}
213
214int MediaCodec_Decoder::start() {
215 JniEnv jniEnv{};

Callers 1

configDecoderMethod · 0.45

Calls 3

getEnvMethod · 0.80
CallIntMethodMethod · 0.45
getStringMethod · 0.45

Tested by

no test coverage detected