]> git.sesse.net Git - casparcg/blob - modules/ffmpeg/producer/frame_muxer.h
2.0. audio:
[casparcg] / modules / ffmpeg / producer / frame_muxer.h
1 #pragma once\r
2 \r
3 #include <common/memory/safe_ptr.h>\r
4 \r
5 #include <core/mixer/audio/audio_mixer.h>\r
6 \r
7 #include <boost/noncopyable.hpp>\r
8 \r
9 #include <vector>\r
10 \r
11 struct AVFrame;\r
12 \r
13 namespace caspar { \r
14         \r
15 namespace core {\r
16 \r
17 class write_frame;\r
18 class basic_frame;\r
19 struct frame_factory;\r
20 \r
21 }\r
22 \r
23 class frame_muxer : boost::noncopyable\r
24 {\r
25 public:\r
26         frame_muxer(double in_fps, const safe_ptr<core::frame_factory>& frame_factory);\r
27         \r
28         void push(const std::shared_ptr<AVFrame>& video_frame, int hints = 0);\r
29         void push(const std::shared_ptr<core::audio_buffer>& audio_samples);\r
30         \r
31         void commit();\r
32 \r
33         bool video_ready() const;\r
34         bool audio_ready() const;\r
35 \r
36         size_t size() const;\r
37         bool empty() const;\r
38 \r
39         int64_t calc_nb_frames(int64_t nb_frames) const;\r
40 \r
41         safe_ptr<core::basic_frame> pop();\r
42 private:\r
43         struct implementation;\r
44         safe_ptr<implementation> impl_;\r
45 };\r
46 \r
47 }