sftp 下载实现

使用零拷贝技术优化合并分块的功能
This commit is contained in:
laoyuyu
2020-01-15 20:28:10 +08:00
parent 6f53235807
commit 50b265f22a
37 changed files with 934 additions and 257 deletions

View File

@@ -20,6 +20,7 @@ import com.arialyy.aria.core.ThreadRecord;
import com.arialyy.aria.core.common.RecordHandler;
import com.arialyy.aria.core.loader.IRecordHandler;
import com.arialyy.aria.core.wrapper.AbsTaskWrapper;
import com.arialyy.aria.core.wrapper.ITaskWrapper;
import com.arialyy.aria.m3u8.M3U8TaskOption;
import com.arialyy.aria.util.RecordUtil;
import java.util.ArrayList;
@@ -74,7 +75,7 @@ final class LiveRecordHandler extends RecordHandler {
tr.taskKey = taskRecord.filePath;
tr.isComplete = false;
tr.tsUrl = tsUrl;
tr.threadType = getEntity().getTaskType();
tr.threadType = taskRecord.taskType;
tr.threadId = threadId;
tr.startLocation = 0;
taskRecord.threadRecords.add(tr);
@@ -88,7 +89,7 @@ final class LiveRecordHandler extends RecordHandler {
record.threadRecords = new ArrayList<>();
record.threadNum = threadNum;
record.isBlock = true;
record.taskType = getEntity().getTaskType();
record.taskType = ITaskWrapper.M3U8_LIVE;
record.bandWidth = mOption.getBandWidth();
return record;
}

View File

@@ -103,7 +103,7 @@ final class VodRecordHandler extends RecordHandler {
tr.threadId = threadId;
tr.isComplete = false;
tr.startLocation = 0;
tr.threadType = getEntity().getTaskType();
tr.threadType = record.taskType;
tr.tsUrl = mOption.getUrls().get(threadId);
return tr;
}
@@ -115,7 +115,7 @@ final class VodRecordHandler extends RecordHandler {
record.threadRecords = new ArrayList<>();
record.threadNum = threadNum;
record.isBlock = true;
record.taskType = getEntity().getTaskType();
record.taskType = ITaskWrapper.M3U8_VOD;
record.bandWidth = mOption.getBandWidth();
return record;
}