@@ -15,39 +15,44 @@ public MediaVideoDecoder(MediaInput input) {
1515 this .ctx = input .ctx ;
1616 shared = true ;
1717 }
18- public native long nstart (int codec_id , int new_width , int new_height );
18+ private native long nstart (int codec_id , int new_width , int new_height );
1919 public boolean start (int codec_id , int new_width , int new_height ) {
2020 if (ctx != 0 || shared ) return false ;
2121 ctx = nstart (codec_id , new_width , new_height );
2222 return ctx != 0 ;
2323 }
24- public native void nstop (long ctx );
24+ private native void nstop (long ctx );
2525 public void stop () {
2626 if (ctx == 0 || shared ) return ;
2727 nstop (ctx );
2828 ctx = 0 ;
2929 }
30- public native int [] ndecode (long ctx , byte [] data , int offset , int length );
30+ private native int [] ndecode (long ctx , byte [] data , int offset , int length );
3131 public int [] decode (byte [] data , int offset , int length ) {
3232 if (ctx == 0 ) return null ;
3333 return ndecode (ctx , data , offset , length );
3434 }
3535 public int [] decode (Packet packet ) {
3636 return decode (packet .data , packet .offset , packet .length );
3737 }
38- public native int ngetWidth (long ctx );
38+ private native int ngetWidth (long ctx );
3939 public int getWidth () {
4040 if (ctx == 0 ) return -1 ;
4141 return ngetWidth (ctx );
4242 }
43- public native int ngetHeight (long ctx );
43+ private native int ngetHeight (long ctx );
4444 public int getHeight () {
4545 if (ctx == 0 ) return -1 ;
4646 return ngetHeight (ctx );
4747 }
48- public native float ngetFrameRate (long ctx );
48+ private native float ngetFrameRate (long ctx );
4949 public float getFrameRate () {
5050 if (ctx == 0 ) return -1 ;
5151 return ngetFrameRate (ctx );
5252 }
53+ private native void nchange (long ctx , int width , int height );
54+ /** Changes output width/height only. All other fields ignored. */
55+ public void change (CodecInfo info ) {
56+ nchange (ctx , info .width , info .height );
57+ }
5358}
0 commit comments