| 191 | } |
| 192 | |
| 193 | int 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 | |
| 214 | int MediaCodec_Decoder::start() { |
| 215 | JniEnv jniEnv{}; |
no test coverage detected