frameinfo.hpp 880 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Copyright (c) 2019-2020 Paul-Louis Ageneau
  3. *
  4. * This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  7. */
  8. #ifndef RTC_FRAMEINFO_H
  9. #define RTC_FRAMEINFO_H
  10. #include "common.hpp"
  11. #include <chrono>
  12. namespace rtc {
  13. struct RTC_CPP_EXPORT FrameInfo {
  14. FrameInfo(uint32_t timestamp) : timestamp(timestamp) {};
  15. template<typename Period = std::ratio<1>> FrameInfo(std::chrono::duration<double, Period> timestamp) : timestampSeconds(timestamp) {};
  16. [[deprecated]] FrameInfo(uint8_t payloadType, uint32_t timestamp) : timestamp(timestamp), payloadType(payloadType) {};
  17. uint32_t timestamp = 0;
  18. uint8_t payloadType = 0;
  19. optional<std::chrono::duration<double>> timestampSeconds;
  20. };
  21. } // namespace rtc
  22. #endif // RTC_FRAMEINFO_H