Add resizer letterbox2
[jpcrr.git] / streamtools / packet-processor.hpp
blob35761c59ab4691254097acd11dc3573408678aa7
1 #ifndef _packet_processor__hpp__included__
2 #define _packet_processor__hpp__included__
4 #include <stdint.h>
5 #include <list>
6 #include "hardsubs.hpp"
7 #include "newpacket.hpp"
8 #include "resampler.hpp"
9 #include "dedup.hpp"
10 #include "timecounter.hpp"
11 #include "framerate-reducer.hpp"
13 class packet_processor
15 public:
16 packet_processor(int64_t _audio_delay, int64_t _subtitle_delay, uint32_t _audio_rate, packet_demux& _demux,
17 uint32_t _width, uint32_t _height, uint32_t _rate_num, uint32_t _rate_denum, uint32_t _dedup_max,
18 resizer& _using_resizer, std::map<std::pair<uint32_t, uint32_t>, resizer*> _special_resizers,
19 std::list<subtitle*> _hardsubs, framerate_reducer* frame_dropper);
20 ~packet_processor();
21 void send_packet(struct packet& p, uint64_t timebase);
22 uint64_t get_last_timestamp();
23 void send_end_of_stream();
24 private:
25 int64_t get_real_time(struct packet& p);
26 void handle_packet(struct packet& q);
27 int64_t audio_delay;
28 int64_t subtitle_delay;
29 uint32_t audio_rate;
30 resizer& using_resizer;
31 std::map<std::pair<uint32_t, uint32_t>, resizer*> special_resizers;
32 packet_demux& demux;
33 uint32_t width;
34 uint32_t height;
35 uint32_t rate_num;
36 uint32_t rate_denum;
37 std::list<subtitle*> hardsubs;
38 dedup dedupper;
39 timecounter audio_timer;
40 timecounter video_timer;
41 std::list<packet*> unprocessed;
42 uint64_t sequence_length;
43 int64_t min_shift;
44 packet* saved_video_frame;
45 framerate_reducer* frame_dropper;
48 //Returns new timebase.
49 uint64_t send_stream(packet_processor& p, read_channel& rc, uint64_t timebase);
51 packet_processor& create_packet_processor(int64_t _audio_delay, int64_t _subtitle_delay, uint32_t _audio_rate,
52 uint32_t _width, uint32_t _height, uint32_t _rate_num, uint32_t _rate_denum, uint32_t _dedup_max,
53 const std::string& resize_type, std::map<std::pair<uint32_t, uint32_t>, std::string> _special_resizers,
54 int argc, char** argv, framerate_reducer* frame_dropper);
57 #endif