---
title: "CMBufferQueueGetHead(_:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmbufferqueuegethead(_:)"
---

# CMBufferQueueGetHead(_:)

Retrieves the next buffer from a queue, but doesn’t remove it.

## Declaration

```swift
func CMBufferQueueGetHead(_ queue: CMBufferQueue) -> CMBuffer?
```

## Parameters

- `queue`: The CMBufferQueue from which to retrieve a buffer.

## Return Value

Return Value The buffer. Will be NULL if the queue is empty.

## Discussion

Discussion This follows Core Foundation “Get” semantics – it does not retain the returned buffer. Note that with non-FIFO queues it’s not guaranteed that the next dequeue will return this particular buffer (if an intervening Enqueue adds a buffer that will dequeue next).

## See Also

### Inspecting a Queue

- [CMBufferQueueIsEmpty(_:)](coremedia/cmbufferqueueisempty(_:).md)
- [CMBufferQueueGetBufferCount(_:)](coremedia/cmbufferqueuegetbuffercount(_:).md)
- [CMBufferQueueGetTotalSize(_:)](coremedia/cmbufferqueuegettotalsize(_:).md)
- [CMBufferQueueContainsEndOfData(_:)](coremedia/cmbufferqueuecontainsendofdata(_:).md)
- [CMBufferQueueIsAtEndOfData(_:)](coremedia/cmbufferqueueisatendofdata(_:).md)
