]> 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 5f843b9d11770c8973a151cf7a695c6baa52dd2b..28dd7f480322f7fca42382113abb7d7d5827f896 100644 (file)
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+* Copyright 2013 Sveriges Television AB http://casparcg.com/
 *
 * This file is part of CasparCG (www.casparcg.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;
@@ -45,36 +49,27 @@ namespace ffmpeg {
 class input : boost::noncopyable
 {
 public:
-       explicit input(
-                       const spl::shared_ptr<diagnostics::graph>& graph,
-                       const std::wstring& filename,
-                       bool loop, uint32_t start,
-                       uint32_t length,
-                       bool thumbnail_mode);
-
-       int                     num_audio_streams() const;
-       int                     get_actual_audio_stream_index(int audio_stream_index) const;
-
-       bool            try_pop_video(std::shared_ptr<AVPacket>& packet);
-       bool            try_pop_audio(std::shared_ptr<AVPacket>& packet, int audio_stream_index);
-
-       void            loop(bool value);
-       bool            loop() const;
+       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);
 
-       void            start(uint32_t value);
-       uint32_t        start() const;
+       bool                                                            try_pop(std::shared_ptr<AVPacket>& packet);
+       bool                                                            eof() const;
 
-       void            length(uint32_t value);
-       uint32_t        length() 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;
 
-       bool            eof() const;
+       int                                                                     num_audio_streams() const;
+       boost::rational<int>                            framerate() const;
 
-       void            seek(uint32_t target);
+       std::future<bool>                                       seek(uint32_t target);
 
-       AVFormatContext& context();
+       spl::shared_ptr<AVFormatContext>        context();
 private:
-       struct impl;
-       std::shared_ptr<impl> impl_;
+       struct implementation;
+       std::shared_ptr<implementation> impl_;
 };