forked from shadowfacts/Tusker
Maybe improve grayscale gifv playback performance
This commit is contained in:
parent
08bd78d51b
commit
f447150bbc
|
@ -79,13 +79,12 @@ class GifvController {
|
|||
#if os(visionOS)
|
||||
#warning("Use async AVVideoComposition CIFilter initializer")
|
||||
#else
|
||||
item.videoComposition = AVVideoComposition(asset: asset, applyingCIFiltersWithHandler: { (request) in
|
||||
let filter = CIFilter(name: "CIColorMonochrome")!
|
||||
|
||||
filter.setValue(request.sourceImage, forKey: "inputImage")
|
||||
filter.setValue(CIColor(red: 0.85, green: 0.85, blue: 0.85), forKey: "inputColor")
|
||||
filter.setValue(1.0, forKey: "inputIntensity")
|
||||
|
||||
item.videoComposition = AVVideoComposition(asset: asset, applyingCIFiltersWithHandler: { (request) in
|
||||
filter.setValue(request.sourceImage, forKey: "inputImage")
|
||||
request.finish(with: filter.outputImage!, context: nil)
|
||||
})
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue