h264fileparser.hpp 861 B

123456789101112131415161718192021222324252627
  1. /**
  2. * libdatachannel streamer example
  3. * Copyright (c) 2020 Filip Klembara (in2core)
  4. *
  5. * This Source Code Form is subject to the terms of the Mozilla Public
  6. * License, v. 2.0. If a copy of the MPL was not distributed with this
  7. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  8. */
  9. #ifndef h264fileparser_hpp
  10. #define h264fileparser_hpp
  11. #include "fileparser.hpp"
  12. #include <optional>
  13. class H264FileParser: public FileParser {
  14. std::optional<std::vector<std::byte>> previousUnitType5 = std::nullopt;
  15. std::optional<std::vector<std::byte>> previousUnitType7 = std::nullopt;
  16. std::optional<std::vector<std::byte>> previousUnitType8 = std::nullopt;
  17. public:
  18. H264FileParser(std::string directory, uint32_t fps, bool loop);
  19. void loadNextSample() override;
  20. std::vector<std::byte> initialNALUS();
  21. };
  22. #endif /* h264fileparser_hpp */