mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
Add the code back to request an IDR frame when switching back to Moonlight
This commit is contained in:
parent
c2fde815fa
commit
12e34a9f4e
@ -23,6 +23,11 @@ static int ConvertPPButtonToLiButton(PP_InputEvent_MouseButton ppButton) {
|
|||||||
|
|
||||||
void MoonlightInstance::DidLockMouse(int32_t result) {
|
void MoonlightInstance::DidLockMouse(int32_t result) {
|
||||||
m_MouseLocked = (result == PP_OK);
|
m_MouseLocked = (result == PP_OK);
|
||||||
|
if (m_MouseLocked) {
|
||||||
|
// Request an IDR frame to dump the frame queue that may have
|
||||||
|
// built up from the GL pipeline being stalled.
|
||||||
|
g_Instance->m_RequestIdrFrame = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoonlightInstance::MouseLockLost() {
|
void MoonlightInstance::MouseLockLost() {
|
||||||
|
@ -53,6 +53,7 @@ class MoonlightInstance : public pp::Instance, public pp::MouseLock {
|
|||||||
pp::MouseLock(this),
|
pp::MouseLock(this),
|
||||||
m_HasNextPicture(false),
|
m_HasNextPicture(false),
|
||||||
m_IsPainting(false),
|
m_IsPainting(false),
|
||||||
|
m_RequestIdrFrame(false),
|
||||||
m_OpusDecoder(NULL),
|
m_OpusDecoder(NULL),
|
||||||
m_CallbackFactory(this),
|
m_CallbackFactory(this),
|
||||||
m_MouseLocked(false),
|
m_MouseLocked(false),
|
||||||
@ -122,6 +123,7 @@ class MoonlightInstance : public pp::Instance, public pp::MouseLock {
|
|||||||
void PictureReady(int32_t result, PP_VideoPicture picture);
|
void PictureReady(int32_t result, PP_VideoPicture picture);
|
||||||
void PaintPicture(void);
|
void PaintPicture(void);
|
||||||
void InitializeRenderingSurface(int width, int height);
|
void InitializeRenderingSurface(int width, int height);
|
||||||
|
void DidChangeFocus(bool got_focus);
|
||||||
|
|
||||||
static void VidDecSetup(int videoFormat, int width, int height, int redrawRate, void* context, int drFlags);
|
static void VidDecSetup(int videoFormat, int width, int height, int redrawRate, void* context, int drFlags);
|
||||||
static void VidDecCleanup(void);
|
static void VidDecCleanup(void);
|
||||||
@ -159,6 +161,7 @@ class MoonlightInstance : public pp::Instance, public pp::MouseLock {
|
|||||||
bool m_HasNextPicture;
|
bool m_HasNextPicture;
|
||||||
PP_VideoPicture m_CurrentPicture;
|
PP_VideoPicture m_CurrentPicture;
|
||||||
bool m_IsPainting;
|
bool m_IsPainting;
|
||||||
|
bool m_RequestIdrFrame;
|
||||||
|
|
||||||
OpusMSDecoder* m_OpusDecoder;
|
OpusMSDecoder* m_OpusDecoder;
|
||||||
pp::Audio m_AudioPlayer;
|
pp::Audio m_AudioPlayer;
|
||||||
|
14
viddec.cpp
14
viddec.cpp
@ -62,6 +62,14 @@ static const char k_FragmentShaderExternal[] =
|
|||||||
" gl_FragColor = texture2D(s_texture, v_texCoord); \n"
|
" gl_FragColor = texture2D(s_texture, v_texCoord); \n"
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
|
void MoonlightInstance::DidChangeFocus(bool got_focus) {
|
||||||
|
// Request an IDR frame to dump the frame queue that may have
|
||||||
|
// built up from the GL pipeline being stalled.
|
||||||
|
if (got_focus) {
|
||||||
|
g_Instance->m_RequestIdrFrame = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MoonlightInstance::InitializeRenderingSurface(int width, int height) {
|
void MoonlightInstance::InitializeRenderingSurface(int width, int height) {
|
||||||
if (!glInitializePPAPI(pp::Module::Get()->get_browser_interface())) {
|
if (!glInitializePPAPI(pp::Module::Get()->get_browser_interface())) {
|
||||||
return;
|
return;
|
||||||
@ -230,6 +238,12 @@ int MoonlightInstance::VidDecSubmitDecodeUnit(PDECODE_UNIT decodeUnit) {
|
|||||||
bool isSps = false;
|
bool isSps = false;
|
||||||
bool isPps = false;
|
bool isPps = false;
|
||||||
bool isIframe = false;
|
bool isIframe = false;
|
||||||
|
|
||||||
|
// Request an IDR frame if needed
|
||||||
|
if (g_Instance->m_RequestIdrFrame) {
|
||||||
|
g_Instance->m_RequestIdrFrame = false;
|
||||||
|
return DR_NEED_IDR;
|
||||||
|
}
|
||||||
|
|
||||||
// Look at the NALU type
|
// Look at the NALU type
|
||||||
if (decodeUnit->bufferList->length > 5) {
|
if (decodeUnit->bufferList->length > 5) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user