*/\r
#pragma once\r
\r
-#include <common/diagnostics/graph.h>\r
-\r
-#include <tbb/cache_aligned_allocator.h>\r
+#include <common/memory/safe_ptr.h>\r
\r
#include <memory>\r
#include <string>\r
\r
-struct AVCodecContext;\r
+#include <boost/noncopyable.hpp>\r
+\r
+struct AVFormatContext;\r
+struct AVPacket;\r
\r
namespace caspar {\r
- \r
-typedef std::vector<unsigned char, tbb::cache_aligned_allocator<unsigned char>> aligned_buffer;\r
\r
+namespace diagnostics {\r
+\r
+class graph;\r
+\r
+}\r
+ \r
class input : boost::noncopyable\r
{\r
public:\r
- explicit input(const safe_ptr<diagnostics::graph>& graph, const std::wstring& filename, bool loop, int start_frame, int end_frame);\r
- const std::shared_ptr<AVCodecContext>& get_video_codec_context() const;\r
- const std::shared_ptr<AVCodecContext>& get_audio_codec_context() const;\r
+ explicit input(const safe_ptr<diagnostics::graph>& graph, const std::wstring& filename, bool loop, int start, int length);\r
+\r
+ bool try_pop(std::shared_ptr<AVPacket>& packet);\r
+ bool eof() const;\r
\r
- std::shared_ptr<aligned_buffer> get_video_packet();\r
- std::shared_ptr<aligned_buffer> get_audio_packet();\r
+ size_t nb_frames() const;\r
+ size_t nb_loops() const;\r
\r
- bool has_packet() const;\r
- bool is_running() const;\r
- double fps() const;\r
+ safe_ptr<AVFormatContext> context();\r
private:\r
struct implementation;\r
std::shared_ptr<implementation> impl_;\r