Ticket #5324 (closed patch: fixed)
Opened 5 years ago
Last modified 4 years ago
|Reported by:||mark.kendall@…||Owned by:||danielk|
1 Remove OpenGLVideo::ReInit?
This is only used in one place (PiP) and will become increasingly tricky to maintain. Simply delete and recreate instead.
2 Remove offscreen rendering code
Unlikely to be used and just complicating the source.
3 Rename variables
Rename key variables in line with VideoOutput? to make opengl code easier to follow.
4 Remove an unnecessary #ifdef
5 Move OpenGL state management to OpenGLContext
The opengl state logically sits with the context and allows us to avoid some state thrashing.
6 FramebufferObject? Memory fix
On slower systems, I would get intermittent failures/crashes when switching between different opengl deinterlacers. FramebufferObject? creation was failing with out of memory errors when framebuffers were deleted and re-created in quick succession. Flushing the pipeline appears to fix the issue - this ties up with the ogl spec where it is recommended that we ensure any resource has actually been created (or released) before using it. For completeness I've added some flushing around other resource creation/deletion (textures, frag progs etc) and left some glCheck's in CreateFramebuffer? to catch any other fbo issues (fbo's appear to tricky at the best of times). N.B. glFlush doesn't actually guarantee execution of the pipeline. I'm looking at implementing NV_FENCE to help.
7 HD fix
Ensure sources that report 1088 frame height are rendered correctly.
8 Thread safety/locking.
This implements a fairly comprehensive thread safety 'policy' to fix stability issues. gl_context_lock is created as a recursive qmutex. This is used by itself when creating and deleting gl_context. It is then passed to gl_context which uses the mutex in combination with MakeCurrent? to ensure only one thread can access the context - i.e. the one it is current to. By tracking the lock, we also avoid unnecessary calls to glxMakeCurrent and do not release the context early (which has caught me out a number of times!). We then ensure that all public members of OpenGLContext and OpenGLVideo are wrapped by a MakeCurrent? 'pair'. Finally ContextLocker? is provided as a convenience class (as the folks at Trolltech would say).
9 Simplify OpenGLVideo::Teardown
10 Implement PixelBufferObject? support
Uploading video frame data is currently a significant bottleneck for opengl performance. In the current code, the driver will take the luminance and chroma information and pad them internally to 4 bytes per 'pixel' before sending them to the gpu. We then have to access 3 different textures to retrieve all of our video data. Hence there is overhead at every stage (300% overhead on data transfer alone) PixelBufferObjects? are optimised for data transfer/streaming when the texture format is BGRA. So we pack the YUV data into one texture, tell the driver it is BGRA, use a PBO to transfer the data and then we only need to access one texture on the GPU. Performance is further improved by using some mmx optimisations to pack the video frame into one texture. For reference, some test code I have will blit a video sequence at 440 fps using the current (trunk) opengl code. This a 720x576 frame size dispayed at 720x576 (i.e no scaling) with no audio and all vsync's turned off (using an 8800GT). The same code will run at 660 fps using the XVideo renderer. With pbo support (and using mmx), the opengl renderer will run at 590 fps.
11 Picture controls
Move the picture control code from OpenGLVideo to OpenGLContext so that the picture attributes can be shared between the main video, PiP and osd. I couldn't decide whether to apply picture controls to the osd but in the end enabled them for consistency with the Xv renderer.
12 glx1.3 fixes
glx1.2 calls aren't deprecated but their use is not recommended. Will also facilitate moving xvmc-opengl code into OpenGLVideo/OpenGLContext.
comment:1 Changed 5 years ago by mark.kendall@…
comment:2 Changed 5 years ago by mark.kendall@…
comment:3 Changed 5 years ago by skamithi
comment:4 Changed 5 years ago by skamithi
comment:5 Changed 5 years ago by skamithi
comment:6 Changed 5 years ago by skamithi
comment:7 Changed 5 years ago by skamithi
comment:8 Changed 5 years ago by skamithi
comment:9 Changed 5 years ago by skamithi
comment:10 Changed 5 years ago by skamithi
comment:11 Changed 5 years ago by skamithi
comment:12 Changed 5 years ago by skamithi
comment:13 Changed 5 years ago by skamithi
comment:14 Changed 5 years ago by skamithi
comment:15 Changed 5 years ago by skamithi
comment:18 Changed 5 years ago by elkin@…
comment:19 Changed 5 years ago by danielk
- Owner changed from ijr to danielk
- Status changed from new to assigned
- Version changed from unknown to head
- Milestone changed from unknown to 0.22
comment:20 Changed 5 years ago by danielk
comment:21 Changed 5 years ago by danielk
comment:22 Changed 5 years ago by danielk
comment:23 Changed 5 years ago by danielk
comment:24 Changed 5 years ago by danielk
comment:25 Changed 5 years ago by danielk
comment:26 Changed 4 years ago by danielk
- Status changed from assigned to closed
- Resolution set to fixed