UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
gl_vdpau.hpp
Go to the documentation of this file.
1#ifndef GL_VDPAU_HPP_667244de5757
2#define GL_VDPAU_HPP_667244de5757
3
4#ifdef HWACC_VDPAU
5
6#ifdef __APPLE__
7#include <OpenGL/gl.h>
8#include <OpenGL/OpenGL.h> // CGL
9#include <OpenGL/glext.h>
10#else
11#include <GL/glew.h>
12#endif /* __APPLE__ */
13
14#include "hwaccel_vdpau.h"
15typedef GLintptr vdpauSurfaceNV;
16#define NV_CAST(x) ((void *)(uintptr_t)(x))
17
18struct state_vdpau {
19 bool initialized = false;
20 GLuint textures[4] = {0};
21 hw_vdpau_frame lastFrame;
22
23 bool interopInitialized = false;
24 bool mixerInitialized = false;
25 VdpDevice device = VDP_INVALID_HANDLE;
26 VdpGetProcAddress *get_proc_address = nullptr;
27 vdpauSurfaceNV vdpgl_surf = 0;
28
29 VdpOutputSurface out_surf = VDP_INVALID_HANDLE;
30 VdpVideoMixer mixer = VDP_INVALID_HANDLE;
31
32 uint32_t surf_width = 0;
33 uint32_t surf_height = 0;
34 VdpChromaType surf_ct = 0;
35
36 bool init();
37 void checkInterop(VdpDevice device, VdpGetProcAddress *get_proc_address);
38 void initInterop(VdpDevice device, VdpGetProcAddress *get_proc_address);
39 void uninitInterop();
40
41 void loadFrame(hw_vdpau_frame *frame);
42
43 void initMixer(uint32_t w, uint32_t h, VdpChromaType ct);
44 void mixerRender(VdpVideoSurface f);
45 void uninitMixer();
46
47 void uninit();
48
49 vdp_funcs funcs;
50
51};
52
53
54
55#endif //HWACC_VDPAU
56#endif //GL_VDPAU_HPP_667244de5757
struct video_frame * frame
static af_result_code init(struct module *parent, const char *cfg, void **state)
This file contains functions related to hw acceleration.