PjsuaMediaPort.hpp 765 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef MUMSI_PJSUAMEDIAPORT_HPP
  2. #define MUMSI_PJSUAMEDIAPORT_HPP
  3. #include <pjmedia.h>
  4. #include <string>
  5. #include <stdexcept>
  6. namespace pjsua {
  7. constexpr int SAMPLING_RATE = 48000;
  8. inline pj_str_t toPjString(std::string str) {
  9. return pj_str(const_cast<char *>(str.c_str()));
  10. }
  11. class Exception : public std::runtime_error {
  12. public:
  13. Exception(const char *title, pj_status_t status) : std::runtime_error(title) {
  14. //todo status code
  15. }
  16. };
  17. class PjsuaMediaPort {
  18. public:
  19. PjsuaMediaPort() : _pjmedia_port(nullptr) { }
  20. ~PjsuaMediaPort();
  21. pjmedia_port *create_pjmedia_port();
  22. private:
  23. pjmedia_port *_pjmedia_port;
  24. };
  25. }
  26. #endif //MUMSI_PJSUAMEDIAPORT_HPP