jetson_jpeg_decoder_pool.h 581 B

1234567891011121314151617181920212223242526272829
  1. #ifndef JETSON_JPEG_DECODER_POOL_H_
  2. #define JETSON_JPEG_DECODER_POOL_H_
  3. #include <memory>
  4. #include <mutex>
  5. #include <queue>
  6. #include "jetson_jpeg_decoder.h"
  7. class NvJPEGDecoder;
  8. namespace sora {
  9. class JetsonJpegDecoder;
  10. class JetsonJpegDecoderPool
  11. : public std::enable_shared_from_this<JetsonJpegDecoderPool> {
  12. public:
  13. std::shared_ptr<JetsonJpegDecoder> Pop();
  14. void Push(std::shared_ptr<NvJPEGDecoder> decoder);
  15. private:
  16. std::mutex mtx_;
  17. std::queue<std::shared_ptr<NvJPEGDecoder>> decoder_queue_;
  18. };
  19. } // namespace sora
  20. #endif //JETSON_JPEG_DECODER_POOL_H_