Loading...
Searching...
No Matches
HWVideoToolbox_metal.hpp
1#pragma once
2#if defined(__APPLE__)
3
4#include <cstddef>
5#include <cstdint>
6
7typedef struct __CVBuffer* CVPixelBufferRef;
8
9namespace score::gfx
10{
11
13void* createMetalTextureCache(void* mtlDevice);
14void releaseMetalTextureCache(void* cache);
15
17struct MetalTextureFromPixelBuffer
18{
19 void* cvMetalTexture; // CVMetalTextureRef, retained. Must release via releaseMetalTextureRef().
20 void* mtlTexture; // id<MTLTexture>, borrowed from cvMetalTexture. Valid while cvMetalTexture is alive.
21 size_t width;
22 size_t height;
23};
24
30MetalTextureFromPixelBuffer createMetalTextureFromPixelBuffer(
31 void* cache, CVPixelBufferRef pixbuf, unsigned planeIndex,
32 unsigned pixelFormat);
33
35void releaseMetalTextureRef(void* cvMetalTexture);
36
38size_t getPixelBufferPlaneCount(CVPixelBufferRef pixbuf);
39
40} // namespace score::gfx
41
42#endif // __APPLE__
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:12