Closed GTechAlpha closed 6 years ago
In general this is a good approach. I only found one flaw, which I sent you in https://github.com/GTechAlpha/xbmc/pull/1. Once this gets cleaned up it's good to go.
I see one more change that's needed:
std::map<AVPixelFormat, SwsContext*> m_scalers;
m_scalers needs to be indexed by format, width and height instead of just format.
This should be good to go, AFAIK.
What about this? we could split configuration and reconfiguration: https://github.com/garbear/xbmc/commit/rp-video
Switch to Fullscreen msg should only be sent once. I imagine your amlogic patch doesn't need to be called multiple times either. "re"configuration of the renderers, by definition, doesn't need to happen in the first configuration. So having separate configuration and reconfiguration states makes sense.
Also this: https://github.com/garbear/xbmc/commit/rp-buffers
Buffers need to be protected by the buffer mutex.
The buffer is protected by m_bFlush plus this being on the render thread.
The game thread can access the buffers.
Also I looked into the m_scalers
comment above and no changes are needed for this.
I see that m_bFlush protects the buffers. Still, should we be defensive?
It is inefficient to lock when unnecessary though right? Maybe a comment?
Comment is fine. When I see buffer access without a mutex I get worried, so explaining why would be good.
Also, thoughts on https://github.com/garbear/xbmc/pull/98#issuecomment-397124590?
What about this? we could split configuration and reconfiguration: rp-vide
Switch to Fullscreen msg should only be sent once. I imagine your amlogic patch doesn't need to be called multiple times either. "re"configuration of the renderers, by definition, doesn't need to happen in the first configuration. So having separate configuration and reconfiguration states makes sense.
Yes, the Amlogic code only needs to be called once. I think would be a good addition.
K, Configure() needs a way to know which state to set
I'll add when I get a chance.
Anything else on this one?
Almost :) In the buffer lock commit, m_bHasCachedFrame
and m_cachedFrame
should be reset within the lock. Also I'll send you a PR with a reconfig tweak that I think improves the code.
@GTechAlpha: https://github.com/GTechAlpha/xbmc/pull/4
squash into two commits and i'll merge!
:thumbsup:
Description
Add basic resolution changing.
Motivation and Context
RetroPlayer does not render after resolution change.
How Has This Been Tested?
PCSX, GenesisPlus, Nestopia. Example: FFVII on PCSX changes resolution every time the in-game menu is accessed.
Screenshots (if appropriate):
Types of change