Decodes 8-bit palettized video (AV_PIX_FMT_PAL8): GIF, QuickTime and MS RLE, and the screen and game codecs of the 90s. More...
Detailed Description
Decodes 8-bit palettized video (AV_PIX_FMT_PAL8): GIF, QuickTime and MS RLE, and the screen and game codecs of the 90s.
Each pixel is an index into a 256-entry palette that the frame carries in data[1] and that may change from one frame to the next, so it is uploaded with every frame into a 256x1 texture. The entries are native-endian 0xAARRGGBB words, i.e. B, G, R, A bytes on every platform score runs on: a BGRA8 texture reads them as they are, and the alpha is the palette's own (GIF transparency).
Public Member Functions | |
| PAL8Decoder (Video::ImageFormat &d, QString f="") | |
| std::pair< QShader, QShader > | init (RenderList &r) override |
| Initialize a GPUVideoDecoder. | |
| void | exec (RenderList &, QRhiResourceUpdateBatch &res, AVFrame &frame) override |
| Decode and upload a video frame to the GPU. | |
Public Member Functions inherited from score::gfx::GPUVideoDecoder | |
| virtual void | release (RenderList &) |
| This method will release all the created samplers and textures. | |
Public Attributes | |
| Video::ImageFormat & | decoder |
| QString | filter |
Public Attributes inherited from score::gfx::GPUVideoDecoder | |
| std::vector< Sampler > | samplers |
| bool | hasFrame {} |
| bool | failed {} |
| bool | formatChanged {} |
Static Public Attributes | |
| static const constexpr auto | frag |
Additional Inherited Members | |
Static Public Member Functions inherited from score::gfx::GPUVideoDecoder | |
| static QRhiTextureSubresourceUploadDescription | createTextureUpload (uint8_t *pixels, int w, int h, int bytesPerPixel, int stride) |
| Utility method to create a QRhiTextureSubresourceUploadDescription. | |
| static bool | isTopField (const AVFrame &frame) noexcept |
| Whether this frame carries the EVEN lines of its picture. | |
| static PlaneRows | planeRows (const Video::ImageFormat &fmt, const AVFrame &frame, int textureRows) noexcept |
| static QString | vertexShader (bool invertY=false) noexcept |
Member Function Documentation
◆ exec()
|
inlineoverridevirtual |
Decode and upload a video frame to the GPU.
Implements score::gfx::GPUVideoDecoder.
◆ init()
|
inlineoverridevirtual |
Initialize a GPUVideoDecoder.
This method must :
- Create samplers and textures for the video format.
- Create shaders that will render the data put into these textures.
It returns a {vertex, fragment} shader pair.
Implements score::gfx::GPUVideoDecoder.
Member Data Documentation
◆ frag
|
staticconstexpr |
The documentation for this struct was generated from the following file:
Public Member Functions inherited from