mf_devices.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_DEVICES_H
  20. #define PLUGIN_WIN_MF_DEVICES_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. //
  28. // DeviceList [Declaration]
  29. //
  30. class DeviceList
  31. {
  32. UINT32 m_cDevices;
  33. IMFActivate **m_ppDevices;
  34. public:
  35. DeviceList();
  36. virtual ~DeviceList();
  37. UINT32 Count()const;
  38. void Clear();
  39. HRESULT GetDeviceAtIndex(UINT32 index, IMFActivate **ppActivate);
  40. HRESULT GetDeviceBest(IMFActivate **ppActivate, WCHAR *pszName = NULL);
  41. HRESULT GetDeviceName(UINT32 index, WCHAR **ppszName);
  42. protected:
  43. HRESULT EnumerateDevices(const GUID& sourceType);
  44. };
  45. class DeviceListAudio : public DeviceList
  46. {
  47. public:
  48. HRESULT EnumerateDevices();
  49. };
  50. class DeviceListVideo : public DeviceList
  51. {
  52. public:
  53. HRESULT EnumerateDevices();
  54. };
  55. #endif /* PLUGIN_WIN_MF_DEVICES_H */