2016-11-22 16 views
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); 

答えて

0

documentation ...

enter image description here

によると、あなたが唯一の停止/そうするように実行されているコーデックをリセットするためにあなたを必要とし、初期化されていない状態からコーデックを設定することができように思われます。

関連する問題