Search in sources :

Example 1 with LocalContentUriFetchProducer

use of com.facebook.imagepipeline.producers.LocalContentUriFetchProducer in project fresco by facebook.

the class ProducerSequenceFactory method getLocalContentUriFetchSequence.

/**
 * bitmap cache get -> background thread hand-off -> multiplex -> bitmap cache -> decode -> branch
 * on separate images -> thumbnail resize and rotate -> thumbnail branch -> local content
 * thumbnail creation -> exif thumbnail creation -> local image resize and rotate -> add meta data
 * producer -> multiplex -> encoded cache -> (webp transcode) -> local content uri fetch.
 */
private synchronized Producer<CloseableReference<CloseableImage>> getLocalContentUriFetchSequence() {
    if (mLocalContentUriFetchSequence == null) {
        LocalContentUriFetchProducer localContentUriFetchProducer = mProducerFactory.newLocalContentUriFetchProducer();
        ThumbnailProducer<EncodedImage>[] thumbnailProducers = new ThumbnailProducer[2];
        thumbnailProducers[0] = mProducerFactory.newLocalContentUriThumbnailFetchProducer();
        thumbnailProducers[1] = mProducerFactory.newLocalExifThumbnailProducer();
        mLocalContentUriFetchSequence = newBitmapCacheGetToLocalTransformSequence(localContentUriFetchProducer, thumbnailProducers);
    }
    return mLocalContentUriFetchSequence;
}
Also used : LocalVideoThumbnailProducer(com.facebook.imagepipeline.producers.LocalVideoThumbnailProducer) ThumbnailProducer(com.facebook.imagepipeline.producers.ThumbnailProducer) LocalContentUriFetchProducer(com.facebook.imagepipeline.producers.LocalContentUriFetchProducer)

Example 2 with LocalContentUriFetchProducer

use of com.facebook.imagepipeline.producers.LocalContentUriFetchProducer in project fresco by facebook.

the class ProducerSequenceFactory method getBackgroundLocalContentUriFetchToEncodeMemorySequence.

/**
 * background-thread hand-off -> multiplex -> encoded cache -> disk cache -> (webp transcode) ->
 * local content resolver fetch
 */
private synchronized Producer<EncodedImage> getBackgroundLocalContentUriFetchToEncodeMemorySequence() {
    if (FrescoSystrace.isTracing()) {
        FrescoSystrace.beginSection("ProducerSequenceFactory#getBackgroundLocalContentUriFetchToEncodeMemorySequence");
    }
    if (mBackgroundLocalContentUriFetchToEncodedMemorySequence == null) {
        if (FrescoSystrace.isTracing()) {
            FrescoSystrace.beginSection("ProducerSequenceFactory#getBackgroundLocalContentUriFetchToEncodeMemorySequence:init");
        }
        final LocalContentUriFetchProducer localFileFetchProducer = mProducerFactory.newLocalContentUriFetchProducer();
        final Producer<EncodedImage> toEncodedMultiplexProducer = newEncodedCacheMultiplexToTranscodeSequence(localFileFetchProducer);
        mBackgroundLocalContentUriFetchToEncodedMemorySequence = mProducerFactory.newBackgroundThreadHandoffProducer(toEncodedMultiplexProducer, mThreadHandoffProducerQueue);
        if (FrescoSystrace.isTracing()) {
            FrescoSystrace.endSection();
        }
    }
    if (FrescoSystrace.isTracing()) {
        FrescoSystrace.endSection();
    }
    return mBackgroundLocalContentUriFetchToEncodedMemorySequence;
}
Also used : LocalContentUriFetchProducer(com.facebook.imagepipeline.producers.LocalContentUriFetchProducer) EncodedImage(com.facebook.imagepipeline.image.EncodedImage)

Aggregations

LocalContentUriFetchProducer (com.facebook.imagepipeline.producers.LocalContentUriFetchProducer)2 EncodedImage (com.facebook.imagepipeline.image.EncodedImage)1 LocalVideoThumbnailProducer (com.facebook.imagepipeline.producers.LocalVideoThumbnailProducer)1 ThumbnailProducer (com.facebook.imagepipeline.producers.ThumbnailProducer)1