]> git.sesse.net Git - casparcg/blob - modules/ffmpeg/producer/input/input.h
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / modules / ffmpeg / producer / input / input.h
1 /*\r
2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
3 *\r
4 *  This file is part of CasparCG.\r
5 *\r
6 *    CasparCG is free software: you can redistribute it and/or modify\r
7 *    it under the terms of the GNU General Public License as published by\r
8 *    the Free Software Foundation, either version 3 of the License, or\r
9 *    (at your option) any later version.\r
10 *\r
11 *    CasparCG is distributed in the hope that it will be useful,\r
12 *    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14 *    GNU General Public License for more details.\r
15 \r
16 *    You should have received a copy of the GNU General Public License\r
17 *    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
18 *\r
19 */\r
20 #pragma once\r
21 \r
22 #include "../util/util.h"\r
23 \r
24 #include <common/memory/safe_ptr.h>\r
25 #include <common/concurrency/governor.h>\r
26 \r
27 #include <agents.h>\r
28 #include <concrt.h>\r
29 \r
30 #include <memory>\r
31 #include <string>\r
32 \r
33 #include <boost/noncopyable.hpp>\r
34 #include <boost/range/iterator_range.hpp>\r
35 \r
36 struct AVFormatContext;\r
37 struct AVPacket;\r
38 \r
39 namespace caspar {\r
40 \r
41 namespace diagnostics {\r
42 \r
43 class graph;\r
44 \r
45 }\r
46          \r
47 namespace ffmpeg {\r
48                                 \r
49 class input : boost::noncopyable\r
50 {\r
51 public:\r
52         \r
53         typedef safe_ptr<AVPacket> target_element_t;\r
54 \r
55         typedef Concurrency::ITarget<target_element_t> target_t;\r
56 \r
57         explicit input(target_t& target, \r
58                                    const safe_ptr<diagnostics::graph>& graph, \r
59                                    const std::wstring& filename, bool loop, \r
60                                    size_t start = 0, \r
61                                    size_t length = std::numeric_limits<size_t>::max());\r
62                 \r
63         size_t nb_frames() const;\r
64         size_t nb_loops() const;\r
65         \r
66         safe_ptr<AVFormatContext> context();\r
67 \r
68         bool loop() const;\r
69         void loop(bool value);\r
70 \r
71         void stop();\r
72 private:\r
73         friend struct implemenation;\r
74         struct implementation;\r
75         std::shared_ptr<implementation> impl_;\r
76 };\r
77 \r
78         \r
79 }}\r