From 62df62f8572f33754453703ddd40cb1081a1e70f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 29 Feb 2016 13:36:46 -0500 Subject: [PATCH 1/3] Update common to disable dynamic resolution switching --- moonlight-common-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moonlight-common-c b/moonlight-common-c index e1473d7..fbd58c6 160000 --- a/moonlight-common-c +++ b/moonlight-common-c @@ -1 +1 @@ -Subproject commit e1473d7a2d813135b148de5f20ed12919631b6a7 +Subproject commit fbd58c60ea12d8760bae86b7d98b2d0208418baf From be7f316c50f4565e2ecb9cf14b14e0d29f8bc9fd Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 29 Feb 2016 13:37:53 -0500 Subject: [PATCH 2/3] Reduce usage of g_Instance --- input.cpp | 6 +++--- main.cpp | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/input.cpp b/input.cpp index e9ca6bc..616dc3a 100644 --- a/input.cpp +++ b/input.cpp @@ -30,7 +30,7 @@ void MoonlightInstance::DidLockMouse(int32_t result) { 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; + m_RequestIdrFrame = true; } } @@ -75,7 +75,7 @@ bool MoonlightInstance::HandleInputEvent(const pp::InputEvent& event) { case PP_INPUTEVENT_TYPE_MOUSEDOWN: { // Lock the mouse cursor when the user clicks on the stream if (!m_MouseLocked) { - g_Instance->LockMouse(g_Instance->m_CallbackFactory.NewCallback(&MoonlightInstance::DidLockMouse)); + LockMouse(m_CallbackFactory.NewCallback(&MoonlightInstance::DidLockMouse)); // Assume it worked until we get a callback telling us otherwise m_MouseLocked = true; @@ -173,7 +173,7 @@ bool MoonlightInstance::HandleInputEvent(const pp::InputEvent& event) { // Check if all modifiers are up now if (m_WaitingForAllModifiersUp && m_KeyModifiers == 0) { - g_Instance->UnlockMouse(); + UnlockMouse(); m_MouseLocked = false; m_WaitingForAllModifiersUp = false; } diff --git a/main.cpp b/main.cpp index 8631b7f..dd0fd3c 100644 --- a/main.cpp +++ b/main.cpp @@ -31,29 +31,30 @@ class MoonlightModule : public pp::Module { void MoonlightInstance::OnConnectionStarted(uint32_t unused) { // Tell the front end pp::Var response("Connection Established"); - g_Instance->PostMessage(response); + PostMessage(response); + // Start receiving input events - g_Instance->RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE); - g_Instance->RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); + RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE); + RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); } void MoonlightInstance::OnConnectionStopped(uint32_t error) { // Not running anymore - g_Instance->m_Running = false; + m_Running = false; // Stop receiving input events - g_Instance->ClearInputEventRequest(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); + ClearInputEventRequest(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); // Unlock the mouse - g_Instance->UnlockMouse(); + UnlockMouse(); // Join threads - pthread_join(g_Instance->m_ConnectionThread, NULL); - pthread_join(g_Instance->m_GamepadThread, NULL); + pthread_join(m_ConnectionThread, NULL); + pthread_join(m_GamepadThread, NULL); // Notify the JS code that the stream has ended pp::Var response(MSG_STREAM_TERMINATED); - g_Instance->PostMessage(response); + PostMessage(response); } void MoonlightInstance::StopConnection() { From 47ede93af009e3c8abca39b455785f3f02b8f8f4 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 3 Mar 2016 21:15:48 -0500 Subject: [PATCH 3/3] Update common submodule --- moonlight-common-c | 2 +- moonlight.hpp | 2 +- viddec.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moonlight-common-c b/moonlight-common-c index fbd58c6..c44cdff 160000 --- a/moonlight-common-c +++ b/moonlight-common-c @@ -1 +1 @@ -Subproject commit fbd58c60ea12d8760bae86b7d98b2d0208418baf +Subproject commit c44cdffdd56ff7167b993fdbd21c02592b28879b diff --git a/moonlight.hpp b/moonlight.hpp index 1228746..4b2c62e 100644 --- a/moonlight.hpp +++ b/moonlight.hpp @@ -100,7 +100,7 @@ class MoonlightInstance : public pp::Instance, public pp::MouseLock { void PaintPicture(void); void InitializeRenderingSurface(int width, int height); - static void VidDecSetup(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 int VidDecSubmitDecodeUnit(PDECODE_UNIT decodeUnit); diff --git a/viddec.cpp b/viddec.cpp index 39c2168..5e95182 100644 --- a/viddec.cpp +++ b/viddec.cpp @@ -127,7 +127,7 @@ void MoonlightInstance::InitializeRenderingSurface(int width, int height) { g_Instance->m_Graphics3D.SwapBuffers(pp::BlockUntilComplete()); } -void MoonlightInstance::VidDecSetup(int width, int height, int redrawRate, void* context, int drFlags) { +void MoonlightInstance::VidDecSetup(int videoFormat, int width, int height, int redrawRate, void* context, int drFlags) { g_Instance->m_VideoDecoder = new pp::VideoDecoder(g_Instance); s_DecodeBufferLength = INITIAL_DECODE_BUFFER_LEN;