dbusvideomanager.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (C) 2012-2017 Savoir-faire Linux Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. #ifndef __RING_DBUSVIDEOMANAGER_H__
  19. #define __RING_DBUSVIDEOMANAGER_H__
  20. #include <vector>
  21. #include <map>
  22. #include <string>
  23. #include "dbus_cpp.h"
  24. #if __GNUC__ >= 5 || (__GNUC__ >=4 && __GNUC_MINOR__ >= 6)
  25. /* This warning option only exists for gcc 4.6.0 and greater. */
  26. #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  27. #endif
  28. #pragma GCC diagnostic ignored "-Wignored-qualifiers"
  29. #pragma GCC diagnostic ignored "-Wunused-parameter"
  30. #include "dbusvideomanager.adaptor.h"
  31. #pragma GCC diagnostic warning "-Wignored-qualifiers"
  32. #pragma GCC diagnostic warning "-Wunused-parameter"
  33. #if __GNUC__ >= 5 || (__GNUC__ >=4 && __GNUC_MINOR__ >= 6)
  34. /* This warning option only exists for gcc 4.6.0 and greater. */
  35. #pragma GCC diagnostic warning "-Wunused-but-set-variable"
  36. #endif
  37. class DBusVideoManager :
  38. public cx::ring::Ring::VideoManager_adaptor,
  39. public DBus::IntrospectableAdaptor,
  40. public DBus::ObjectAdaptor
  41. {
  42. public:
  43. DBusVideoManager(DBus::Connection& connection);
  44. // Methods
  45. std::vector<std::string> getDeviceList();
  46. std::map<std::string, std::map<std::string, std::vector<std::string>>> getCapabilities(const std::string& name);
  47. std::map<std::string, std::string> getSettings(const std::string& name);
  48. void applySettings(const std::string& name, const std::map<std::string, std::string>& settings);
  49. void setDefaultDevice(const std::string& dev);
  50. std::string getDefaultDevice();
  51. void startCamera();
  52. void stopCamera();
  53. bool switchInput(const std::string& resource);
  54. bool hasCameraStarted();
  55. };
  56. #endif // __RING_DBUSVIDEOMANAGER_H__