cpp_frame_test.cpp 726 B

12345678910111213141516171819202122232425262728293031
  1. #include <pybind11/pybind11.h>
  2. #include <pybind11/stl.h>
  3. #include <memory>
  4. #include "cnstream_frame.hpp"
  5. namespace py = pybind11;
  6. namespace cnstream {
  7. class CppCNFrameInfoTestHelper {
  8. public:
  9. CppCNFrameInfoTestHelper() {
  10. frame_info_ = cnstream::CNFrameInfo::Create("test_stream_id_0");
  11. }
  12. std::shared_ptr<CNFrameInfo> GetFrameInfo() {
  13. return frame_info_;
  14. }
  15. private:
  16. std::shared_ptr<CNFrameInfo> frame_info_;
  17. }; // class CppCNFrameInfoTestHelper
  18. } // namespace cnstream
  19. void FrameTestWrapper(const py::module& m) {
  20. py::class_<cnstream::CppCNFrameInfoTestHelper>(m, "CppCNFrameInfoTestHelper")
  21. .def(py::init())
  22. .def("get_frame_info", &cnstream::CppCNFrameInfoTestHelper::GetFrameInfo);
  23. }