yellowcath / VideoProcessor

process video(cut & scale & increase & decrease & reverse) with mediacodec
Apache License 2.0
968 stars 141 forks source link

压缩结束回调事件? #31

Closed landsnail closed 3 years ago

landsnail commented 5 years ago

请问哪个压缩结束回调事件?

我使用进度来进行判断回调,但是发现进度会多次触发1(即为100%),感觉这个进度有问题。

xxxifan commented 4 years ago

整个操作是阻塞线程的,执行完毕就是压缩结束这样是最准确的

yudu233 commented 4 years ago

VideoEncodeThread类中, while(true){ } 执行完成之后, 新增:mProgressAve.setCompressSuccess(); VideoProgressListener接口新增onSuccess()接口

public class VideoProgressAve {

public VideoProgressAve(VideoProgressListener listener) {
    mListener = listener;
}

public void setCompressSuccess() {
    mListener.onSuccess();
}

调用: VideoProcessor.processor(getApplicationContext()) .... .progressListener(new VideoProgressListener() { @Override public void onProgress(float progress) { Log.e("Rain","progress = " + progress); } @Override public void onSuccess() { Log.e("Rain","onSuccess! " ); } }).process(); 即可!

yys730 commented 4 years ago

VideoProgressListener 没有找到新增的onSuccess方法呢

yellowcath commented 3 years ago

VideoProgressListener 没有找到新增的onSuccess方法呢

方法本身是阻塞的,执行完就是success,需要自己在子线程执行