Merge branch 'master' into nacl_pairing

This commit is contained in:
Cameron Gutman 2016-03-10 23:29:16 -08:00
commit 5d17ee2bae
5 changed files with 16 additions and 15 deletions

View File

@ -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;
}

View File

@ -35,29 +35,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() {

@ -1 +1 @@
Subproject commit e1473d7a2d813135b148de5f20ed12919631b6a7
Subproject commit c44cdffdd56ff7167b993fdbd21c02592b28879b

View File

@ -107,7 +107,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);

View File

@ -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;