public class

MediaVariationsFallbackProducer

extends Object
implements Producer<T>
java.lang.Object
   ↳ com.facebook.imagepipeline.producers.MediaVariationsFallbackProducer

Class Overview

Disk cache read producer.

This producer looks in the disk cache for variations of the original image which hasn't been found in cache itself.

If an alternative image is found, then it is passed to the consumer. If it's big enough for the request's ResizeOptions then the request goes no further down the pipeline. If it's smaller than required then it will be passed as a non-final response.

If the image is not found or is sent as non-final, then the request is passed to the next producer in the sequence. Any results that the producer returns are passed to the consumer.

This producer is used only if the media variations experiment is turned on and does nothing unless the image request includes defined MediaVariations and ResizeOptions.

Summary

Constants
String EXTRA_CACHED_VALUE_FOUND
String EXTRA_CACHED_VALUE_USED_AS_LAST
String EXTRA_VARIANTS_COUNT
String EXTRA_VARIANTS_SOURCE
String PRODUCER_NAME
Public Constructors
MediaVariationsFallbackProducer(BufferedDiskCache defaultBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, CacheKeyFactory cacheKeyFactory, MediaVariationsIndex mediaVariationsIndex, MediaIdExtractor mediaIdExtractor, DiskCachePolicy diskCachePolicy, Producer<EncodedImage> inputProducer)
Public Methods
void produceResults(Consumer<EncodedImage> consumer, ProducerContext producerContext)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.imagepipeline.producers.Producer

Constants

public static final String EXTRA_CACHED_VALUE_FOUND

Constant Value: "cached_value_found"

public static final String EXTRA_CACHED_VALUE_USED_AS_LAST

Constant Value: "cached_value_used_as_last"

public static final String EXTRA_VARIANTS_COUNT

Constant Value: "variants_count"

public static final String EXTRA_VARIANTS_SOURCE

Constant Value: "variants_source"

public static final String PRODUCER_NAME

Constant Value: "MediaVariationsFallbackProducer"

Public Constructors

public MediaVariationsFallbackProducer (BufferedDiskCache defaultBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, CacheKeyFactory cacheKeyFactory, MediaVariationsIndex mediaVariationsIndex, MediaIdExtractor mediaIdExtractor, DiskCachePolicy diskCachePolicy, Producer<EncodedImage> inputProducer)

Public Methods

public void produceResults (Consumer<EncodedImage> consumer, ProducerContext producerContext)