ashea-code / BLUI

Rich HTML UI engine for UE4
MIT License
860 stars 258 forks source link

Black rectangles when play full HD youtube video in fullscreen #54

Open deniskoronchik opened 8 years ago

deniskoronchik commented 8 years ago

You need to make copy of buffer when you pass it into: parentUI->TextureUpdate(buffer, updateRegions, dirtyRects.size());

This is why, when you copy it to render target in void UBluEye::TextureUpdate(const void buffer, FUpdateTextureRegion2D updateRegions, uint32 regionCount) you use ENQUEUE_UNIQUE_RENDER_COMMAND_ONEPARAMETER

So if image large, then we have black artefacts on it, because during copying in render thread it changes in browser thread. I think you can alloc buffer in RenderHandler::RenderHandler(int32 width, int32 height, UBluEye* ui), if size doens't changed.

I've tested solution (not optimized with allocs on each update) and it works.

ashea-code commented 8 years ago

I'll look into this, I saw your pull request. I'm concerned with performance overall, another memcpy is expensive. I'll be doing some testing on this.

deniskoronchik commented 8 years ago

Yes it will decrease perfomance, but another way to synchronize threads will be cost more (i think) because it would be depend on copied image size directly. There you copy data in browser thread, and render thread doen't wait it. If you will synchronize these threads, then you rendering thread or browser thread will wait. Maybe cef has a double buffering, then you can just toogle used buffers?

ashea-code commented 8 years ago

It could be simpler to do some locking. I'll have to look into how it's done properly with CEF3.

Could you possibly capture a video or image of these artifacts? I tried playing a large video taking up the whole window and did not notice anything.

deniskoronchik commented 8 years ago

I will capture them today 8 нояб. 2015 г. 8:56 PM пользователь "Aaron Shea" notifications@github.com написал:

It could be simpler to do some locking. I'll have to look into how it's done properly with CEF3.

Could you possibly capture a video or image of these artifacts? I tried playing a large video taking up the whole window and did not notice anything.

— Reply to this email directly or view it on GitHub https://github.com/AaronShea/BLUI/issues/54#issuecomment-154853138.

peinguin commented 8 years ago

@deniskoronchik, try to remove transition from player. I have the same problem on current project.

var styles = [
            'body * {',
                '-webkit-transition: none !important;',
                '-webkit-backface-visibility: visible !important;',
                '-webkit-transform: none !important',
            ' }',
            '.ytp-bezel {',
                'display: none !important',
            ' }',
            '.ytp-subtitles-button {',
                'display: none !important',
            ' }'].join('');
var customStyle = document.createElement('style');
customStyle.appendChild(iframe.contentDocument.createTextNode(styles));
deniskoronchik commented 8 years ago

I'm playing video directly from youtube tv 9 нояб. 2015 г. 11:00 AM пользователь "Sergey" notifications@github.com написал:

@deniskoronchik https://github.com/deniskoronchik, try to remove transition from player. I have the same problem on current project.

var styles = [ 'body * {', '-webkit-transition: none !important;', '-webkit-backface-visibility: visible !important;', '-webkit-transform: none !important', ' }', '.ytp-bezel {', 'display: none !important', ' }', '.ytp-subtitles-button {', 'display: none !important', ' }'].join(''); var customStyle = document.createElement('style'); customStyle.appendChild(iframe.contentDocument.createTextNode(styles));

— Reply to this email directly or view it on GitHub https://github.com/AaronShea/BLUI/issues/54#issuecomment-154991444.

deniskoronchik commented 8 years ago

https://www.youtube.com/tv#/watch?v=GKg5ZylmvVk&resume Just try to play this one, with width 1920 height 1080

ashea-code commented 8 years ago

Still don't seem to be getting anything on my desktop. Out of curiosity, what are the specs for the machine you're running this on?

deniskoronchik commented 8 years ago

Before fix: https://drive.google.com/file/d/0B9nRd_434bwfcUx3cW1yOHJrelU/view?usp=sharing After fix: https://drive.google.com/file/d/0B9nRd_434bwfMVNRVDNIZHRFX1U/view?usp=sharing

Sound problems is a bandicam record issue. Machine not new Intel Core i5 2.67 GHz, Nvidia Geforce GTX 460, 16 GB RAM