1 #ifndef _packet_processor__hpp__included__
2 #define _packet_processor__hpp__included__
6 #include "hardsubs.hpp"
7 #include "newpacket.hpp"
8 #include "resampler.hpp"
10 #include "timecounter.hpp"
11 #include "framerate-reducer.hpp"
13 class packet_processor
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
);
21 void send_packet(struct packet
& p
, uint64_t timebase
);
22 uint64_t get_last_timestamp();
23 void send_end_of_stream();
25 int64_t get_real_time(struct packet
& p
);
26 void handle_packet(struct packet
& q
);
28 int64_t subtitle_delay
;
30 resizer
& using_resizer
;
31 std::map
<std::pair
<uint32_t, uint32_t>, resizer
*> special_resizers
;
37 std::list
<subtitle
*> hardsubs
;
39 timecounter audio_timer
;
40 timecounter video_timer
;
41 std::list
<packet
*> unprocessed
;
42 uint64_t sequence_length
;
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
);