| 170 | } |
| 171 | |
| 172 | int MediaCodec_Decoder::configureVideo(const std::string &mime, int width, int height, int angle, |
| 173 | void *surface) { |
| 174 | JniEnv jniEnv{}; |
| 175 | |
| 176 | JNIEnv *env = jniEnv.getEnv(); |
| 177 | if (env == nullptr) { |
| 178 | return MC_ERROR; |
| 179 | } |
| 180 | |
| 181 | if (mMediaCodec == nullptr) { |
| 182 | return MC_ERROR; |
| 183 | } |
| 184 | |
| 185 | mCodecCategory = CATEGORY_VIDEO; |
| 186 | NewStringUTF jMime(env, mime.c_str()); |
| 187 | int ret = env->CallIntMethod(mMediaCodec, jMediaCodec_configureVideo, jMime.getString(), |
| 188 | (jint) width, (jint) height, (jint) angle, (jobject) surface); |
| 189 | |
| 190 | return ret; |
| 191 | } |
| 192 | |
| 193 | int MediaCodec_Decoder::configureAudio(const std::string &mime, int sampleRate, int channelCount, |
| 194 | int isADTS) { |
no test coverage detected