mf_display_watcher.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Copyright (C) 2013 Mamadou DIOP
  2. * Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
  3. *
  4. * This file is part of Open Source Doubango Framework.
  5. *
  6. * DOUBANGO is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * DOUBANGO is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with DOUBANGO.
  18. */
  19. #ifndef PLUGIN_WIN_MF_DISPLAY_WATCHER_H
  20. #define PLUGIN_WIN_MF_DISPLAY_WATCHER_H
  21. #include "../plugin_win_mf_config.h"
  22. #include <new>
  23. #include <mfapi.h>
  24. #include <mfidl.h>
  25. #include <Mferror.h>
  26. #include <shlwapi.h>
  27. #include <Evr.h>
  28. class DisplayWatcher
  29. {
  30. public:
  31. DisplayWatcher(HWND hWnd, IMFMediaSink* pMediaSink, HRESULT &hr);
  32. virtual ~DisplayWatcher();
  33. public:
  34. HRESULT Start();
  35. HRESULT SetFullscreen(BOOL bEnabled);
  36. HRESULT SetHwnd(HWND hWnd);
  37. HRESULT Stop();
  38. private:
  39. void UpdatePosition();
  40. static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  41. private:
  42. IMFVideoDisplayControl *m_pDisplayControl;
  43. HWND m_hWnd;
  44. WNDPROC m_pWndProc;
  45. BOOL m_bStarted;
  46. BOOL m_bFullScreen;
  47. };
  48. #endif /* PLUGIN_WIN_MF_DISPLAY_WATCHER_H */