<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVPixelBufferLockFlags/readOnly",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "c:@E@CVPixelBufferLockFlags@kCVPixelBufferLock_ReadOnly"
  },
  "title" : "readOnly"
}
-->

# readOnly

A read-only buffer.

```
static var readOnly: CVPixelBufferLockFlags { get }
```

## Discussion

Set this flag if you don’t plan to modify buffer data while holding the lock. Setting this flag improves performance by preventing Core Video from invalidating  existing caches of the buffer’s contents.

> Important:
> If you pass this flag to the ``doc://com.apple.corevideo/documentation/CoreVideo/CVPixelBufferLockBaseAddress(_:_:)`` function, you must also pass it to the ``doc://com.apple.corevideo/documentation/CoreVideo/CVPixelBufferUnlockBaseAddress(_:_:)`` function.

---

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)