12345678910111213141516171819202122232425262728293031323334353637 |
- #pragma once
- #include "demuxer.h"
- #include "display.h"
- #include "format_converter.h"
- #include "queue.h"
- #include "timer.h"
- #include "video_decoder.h"
- #include <memory>
- #include <stdexcept>
- #include <string>
- #include <thread>
- #include <vector>
- extern "C" {
- #include <libavcodec/avcodec.h>
- }
- class Player {
- public:
- Player(const std::string &file_name);
- void operator()();
- private:
- void demultiplex();
- void decode_video();
- void video();
- private:
- std::unique_ptr<Demuxer> demuxer_;
- std::unique_ptr<VideoDecoder> video_decoder_;
- std::unique_ptr<FormatConverter> format_converter_;
- std::unique_ptr<Display> display_;
- std::unique_ptr<Timer> timer_;
- std::unique_ptr<PacketQueue> packet_queue_;
- std::unique_ptr<FrameQueue> frame_queue_;
- std::vector<std::thread> stages_;
- static const size_t queue_size_;
- std::exception_ptr exception_{};
- };
|