0
我的问题非常清楚。编解码器运行时是否可以配置媒体编解码器?动态配置mediaCodec
代码示例:
codec = MediaCodec.createDecoderByType("video/avc");
MediaFormat format = MediaFormat.createVideoFormat(CodecConfigurations.MIME_TYPE,
CodecConfigurations.WIDTH, CodecConfigurations.HEIGHT);
Log.d(LOG_TAG, "Track Format: " + mime);
format.setInteger(MediaFormat.KEY_BIT_RATE, 125000);
format.setInteger(MediaFormat.KEY_FRAME_RATE, 15);
format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar);
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 5);
codec.configure(format, null, null, 0);
codec.start();
是否有可能以如下重新编解码器不停止编解码器?
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 10);
codec.configure(format, null, null, 0);