MFMediaEngineNotify.cpp (869B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #include "MFMediaEngineNotify.h" 6 7 #include "MFMediaEngineUtils.h" 8 9 namespace mozilla { 10 11 IFACEMETHODIMP MFMediaEngineNotify::EventNotify(DWORD aEvent, DWORD_PTR aParam1, 12 DWORD aParam2) { 13 auto event = static_cast<MF_MEDIA_ENGINE_EVENT>(aEvent); 14 MFMediaEngineEventWrapper engineEvent{event}; 15 if (event == MF_MEDIA_ENGINE_EVENT_ERROR || 16 event == MF_MEDIA_ENGINE_EVENT_FORMATCHANGE || 17 event == MF_MEDIA_ENGINE_EVENT_NOTIFYSTABLESTATE) { 18 engineEvent.mParam1 = Some(aParam1); 19 engineEvent.mParam2 = Some(aParam2); 20 } 21 mEngineEvents.Notify(engineEvent); 22 return S_OK; 23 } 24 25 } // namespace mozilla