<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVSampleBufferVideoRenderer/Receiver/flush(removingDisplayedImage:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "s:So27AVSampleBufferVideoRendererC12AVFoundationE8ReceiverC5flush22removingDisplayedImageySb_tYaF"
  },
  "title" : "flush(removingDisplayedImage:)"
}
-->

# flush(removingDisplayedImage:)

Instructs the receiver to discard pending enqueued sample buffers and call the provided block when complete. This method suspends until the flush is complete.

```
nonisolated(nonsending) func flush(removingDisplayedImage removeDisplayedImage: Bool) async
```

## Parameters

`removeDisplayedImage`

Set to true to remove any currently displayed image, false to preserve any current image.

## Discussion

A flush resets decoder state. The next frame passed to enqueueSampleBuffer: should be an IDR frame (also known as a key frame or sync sample).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)