DSDisplay.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango.org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. #ifndef PLUGIN_DSHOW_DIRECTSHOW_DISPLAY_H
  23. #define PLUGIN_DSHOW_DIRECTSHOW_DISPLAY_H
  24. #include "plugin_dshow_config.h"
  25. #include "internals/DSDisplayGraph.h"
  26. #include "internals/DSDisplayOverlay.h"
  27. #define WM_FULLSCREEN_SET (WM_USER + 401)
  28. class DSDisplay
  29. {
  30. public:
  31. DSDisplay(HRESULT *hr);
  32. virtual ~DSDisplay();
  33. virtual void attach(INT64 parent);
  34. virtual void attach(void *parent);
  35. virtual void detach(void *parent);
  36. virtual void detach();
  37. virtual bool isAttached();
  38. virtual void start();
  39. virtual void pause();
  40. virtual void stop();
  41. virtual int getWidth();
  42. virtual int getHeight();
  43. virtual void setSize(int w, int h);
  44. virtual bool isFullscreen();
  45. virtual void setFullscreen(bool value);
  46. virtual void setPluginFirefox(bool value);
  47. virtual bool canFullscreen();
  48. virtual void setFps(int fps_);
  49. virtual void handleVideoFrame(const void* data, int w, int h);
  50. LRESULT handleEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  51. private:
  52. void hook();
  53. void unhook();
  54. void applyRatio(RECT rect);
  55. private:
  56. DSDisplayGraph *graph;
  57. DSDisplayOverlay *overlay;
  58. int fps;
  59. int left, top, width, height, imgWidth, imgHeight;
  60. bool bPluginFirefox;
  61. bool fullscreen;
  62. HWND window;
  63. WNDPROC parentWindowProc;
  64. bool hooked;
  65. };
  66. #endif