/*
-* 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;
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_;
};