7 #ifndef PACKAGER_MEDIA_BASE_TRICK_PLAY_HANDLER_H_
8 #define PACKAGER_MEDIA_BASE_TRICK_PLAY_HANDLER_H_
10 #include "packager/media/base/media_handler.h"
28 void SetHandlerForMainStream(std::shared_ptr<MediaHandler> handler);
29 void SetHandlerForTrickPlay(uint32_t trick_play_factor,
30 std::shared_ptr<MediaHandler> handler);
36 Status
Process(std::unique_ptr<StreamData> stream_data)
override;
42 friend class TrickPlayHandlerTest;
50 Status ProcessCachedStreamData(
51 size_t output_stream_index,
52 std::deque<std::shared_ptr<StreamData>>* cached_stream_data);
59 Status ProcessOneStreamData(
size_t output_stream_index,
60 const std::shared_ptr<StreamData>& stream_data);
69 std::vector<uint32_t> trick_play_factors_;
75 uint32_t total_key_frames_ = 0;
78 uint32_t total_frames_ = 0;
83 int64_t prev_sample_end_timestamp_ = 0;
86 std::vector<uint32_t> playback_rates_;
95 std::vector<std::deque<std::shared_ptr<StreamData>>> cached_stream_data_;
101 #endif // PACKAGER_MEDIA_BASE_TRICK_PLAY_HANDLER_H_