* Author: Robert Nagy, ronag89@gmail.com
*/
-#include "../stdafx.h"
+#include "../StdAfx.h"
#include "ffmpeg_producer.h"
#include <boost/algorithm/string.hpp>
#include <common/assert.h>
-#include <boost/assign.hpp>
#include <boost/timer.hpp>
-#include <boost/foreach.hpp>
#include <boost/filesystem.hpp>
-#include <boost/range/algorithm/find_if.hpp>
-#include <boost/range/algorithm/find.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/regex.hpp>
#include <boost/thread/future.hpp>
{
spl::shared_ptr<core::monitor::subject> monitor_subject_;
const std::wstring filename_;
- const std::wstring path_relative_to_media_;
+ const std::wstring path_relative_to_media_ = get_relative_or_original(filename_, env::media_folder());
const spl::shared_ptr<diagnostics::graph> graph_;
input input_;
- const double fps_;
+ const double fps_ = read_fps(input_.context(), format_desc_.fps);
const uint32_t start_;
std::unique_ptr<video_decoder> video_decoder_;
frame_muxer muxer_;
core::constraints constraints_;
- core::draw_frame last_frame_;
+ core::draw_frame last_frame_ = core::draw_frame::empty();
boost::optional<uint32_t> seek_target_;
uint32_t start,
uint32_t length)
: filename_(filename)
- , path_relative_to_media_(get_relative_or_original(filename, env::media_folder()))
, frame_factory_(frame_factory)
, format_desc_(format_desc)
, input_(graph_, filename_, loop, start, length)
, fps_(read_fps(input_.context(), format_desc_.fps))
, muxer_(fps_, frame_factory, format_desc_, filter)
, start_(start)
- , last_frame_(core::draw_frame::empty())
{
graph_->set_color("frame-time", diagnostics::color(0.1f, 1.0f, 0.1f));
graph_->set_color("underflow", diagnostics::color(0.6f, 0.3f, 0.9f));
std::future<std::wstring> call(const std::vector<std::wstring>& params) override
{
- static const boost::wregex loop_exp(L"LOOP\\s*(?<VALUE>\\d?)?", boost::regex::icase);
- static const boost::wregex seek_exp(L"SEEK\\s+(?<VALUE>\\d+)", boost::regex::icase);
- static const boost::wregex length_exp(L"LENGTH\\s+(?<VALUE>\\d+)?", boost::regex::icase);
- static const boost::wregex start_exp(L"START\\s+(?<VALUE>\\d+)?", boost::regex::icase);
+ static const boost::wregex loop_exp(LR"(LOOP\s*(?<VALUE>\d?)?)", boost::regex::icase);
+ static const boost::wregex seek_exp(LR"(SEEK\s+(?<VALUE>\d+))", boost::regex::icase);
+ static const boost::wregex length_exp(LR"(LENGTH\s+(?<VALUE>\d+)?)", boost::regex::icase);
+ static const boost::wregex start_exp(LR"(START\\s+(?<VALUE>\\d+)?)", boost::regex::icase);
auto param = boost::algorithm::join(params, L" ");
spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<core::frame_factory>& frame_factory, const core::video_format_desc& format_desc, const std::vector<std::wstring>& params)
{
- auto filename = probe_stem(env::media_folder() + L"\\" + params.at(0));
+ auto filename = probe_stem(env::media_folder() + L"/" + params.at(0));
if(filename.empty())
return core::frame_producer::empty();
return create_destroy_proxy(spl::make_shared_ptr(std::make_shared<ffmpeg_producer>(frame_factory, format_desc, filename, filter_str, loop, start, length)));
}
-}}
\ No newline at end of file
+}}