Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class DefaultThumbnailsEngine(
) {
var actualLocalizedUs: Long = localizedUs
override fun toString(): String {
return positionUs.toString()
return request.sourceId() + ":" + positionUs.toString()
}
}

Expand All @@ -91,6 +91,8 @@ class DefaultThumbnailsEngine(

override fun getSeekThreshold() = source.seekThreshold

override fun mediaId() = source.mediaId()

override fun isDrained(): Boolean {
if (source.isDrained) {
source.seekTo(stubs.firstOrNull()?.positionUs ?: -1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ protected void initializeExtractor(@NonNull MediaExtractor extractor) throws IOE
protected void initializeRetriever(@NonNull MediaMetadataRetriever retriever) {
retriever.setDataSource(context, uri);
}

@Override
public String mediaId() {
return uri.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ interface ThumbnailRequest {
fun locate(durationUs: Long): List<Long>

fun threshold(): Long = 0

fun sourceId() : String = ""
// Could make it so that if locate() is empty, accept is called for each frame (no seeking).
// But this only makes sense if accept signature has more information (segment, ...), and
// it should also have a way to say - we're done, stop transcoding.
Expand Down