]> git.sesse.net Git - casparcg/blobdiff - modules/ffmpeg/producer/input/input.h
[ffmpeg] Ported 2.0.7 ffmpeg producer to 2.1.0 while still keeping the usage of the...
[casparcg] / modules / ffmpeg / producer / input / input.h
index 29495c39072292095636476ccab30895f4a0de9e..28dd7f480322f7fca42382113abb7d7d5827f896 100644 (file)
@@ -1,63 +1,76 @@
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-*  This file is part of CasparCG.\r
-*\r
-*    CasparCG is free software: you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation, either version 3 of the License, or\r
-*    (at your option) any later version.\r
-*\r
-*    CasparCG is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
-#pragma once\r
-\r
-#include <common/memory/safe_ptr.h>\r
-\r
-#include <memory>\r
-#include <string>\r
-#include <cstdint>\r
-\r
-#include <boost/noncopyable.hpp>\r
-\r
-struct AVFormatContext;\r
-struct AVPacket;\r
-\r
-namespace caspar {\r
-\r
-namespace diagnostics {\r
-\r
-class graph;\r
-\r
-}\r
-        \r
-namespace ffmpeg {\r
-\r
-class input : boost::noncopyable\r
-{\r
-public:\r
-       explicit input(const safe_ptr<diagnostics::graph>& graph, const std::wstring& filename, bool loop, size_t start = 0, size_t length = std::numeric_limits<size_t>::max());\r
-\r
-       bool try_pop(std::shared_ptr<AVPacket>& packet);\r
-       bool eof() const;\r
-\r
-       void loop(bool value);\r
-       bool loop() const;\r
-\r
-       void seek(int64_t target);\r
-\r
-       safe_ptr<AVFormatContext> context();\r
-private:\r
-       struct implementation;\r
-       std::shared_ptr<implementation> impl_;\r
-};\r
-\r
-       \r
-}}\r
+/*
+* Copyright 2013 Sveriges Television AB http://casparcg.com/
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Robert Nagy, ronag89@gmail.com
+*/
+
+#pragma once
+
+#include "../util/util.h"
+
+#include <common/memory.h>
+
+#include <memory>
+#include <string>
+#include <cstdint>
+#include <future>
+
+#include <boost/noncopyable.hpp>
+#include <boost/rational.hpp>
+
+struct AVFormatContext;
+struct AVPacket;
+
+namespace caspar {
+
+namespace diagnostics {
+
+class graph;
+
+}
+        
+namespace ffmpeg {
+
+class input : boost::noncopyable
+{
+public:
+       explicit input(const spl::shared_ptr<diagnostics::graph>& graph, const std::wstring& filename, FFMPEG_Resource resource_type, bool loop, uint32_t start, uint32_t length, bool thumbnail_mode, const ffmpeg_options& vid_params);
+
+       bool                                                            try_pop(std::shared_ptr<AVPacket>& packet);
+       bool                                                            eof() const;
+
+       void                                                            start(uint32_t value);
+       uint32_t                                                        start() const;
+       void                                                            length(uint32_t value);
+       uint32_t                                                        length() const;
+       void                                                            loop(bool value);
+       bool                                                            loop() const;
+
+       int                                                                     num_audio_streams() const;
+       boost::rational<int>                            framerate() const;
+
+       std::future<bool>                                       seek(uint32_t target);
+
+       spl::shared_ptr<AVFormatContext>        context();
+private:
+       struct implementation;
+       std::shared_ptr<implementation> impl_;
+};
+
+       
+}}