const std::wstring filename_;\r
const bool loop_;\r
\r
- std::shared_ptr<diagnostics::graph> graph_;\r
+ const safe_ptr<diagnostics::graph> graph_;\r
boost::timer frame_timer_;\r
\r
std::deque<safe_ptr<core::write_frame>> video_frame_buffer_; \r
std::deque<std::vector<short>> audio_chunk_buffer_;\r
\r
- std::shared_ptr<core::frame_factory> frame_factory_;\r
+ const safe_ptr<core::frame_factory> frame_factory_;\r
\r
input input_; \r
std::unique_ptr<video_decoder> video_decoder_;\r
(L"mpg")(L"mpeg")(L"avi")(L"mov")(L"qt")(L"webm")(L"dv")(L"mp4")(L"f4v")(L"flv")(L"mkv")(L"mka")(L"wmv")(L"wma")(L"ogg")(L"divx")(L"xvid")(L"wav")(L"mp3")(L"m2v");\r
std::wstring filename = env::media_folder() + L"\\" + params[0];\r
\r
- auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::wstring& ex) -> bool\r
- { \r
- return boost::filesystem::is_regular_file(boost::filesystem::wpath(filename).replace_extension(ex));\r
- });\r
+ auto ext = boost::find_if(extensions, [&](const std::wstring& ex)\r
+ { \r
+ return boost::filesystem::is_regular_file(boost::filesystem::wpath(filename).replace_extension(ex));\r
+ });\r
\r
if(ext == extensions.end())\r
return core::frame_producer::empty();\r
\r
std::wstring path = filename + L"." + *ext;\r
- bool loop = std::find(params.begin(), params.end(), L"LOOP") != params.end();\r
+ bool loop = boost::find(params, L"LOOP") != params.end();\r
\r
static const boost::wregex expr(L"\\((?<START>\\d+)(,(?<LENGTH>\\d+)?)?\\)");//(,(?<END>\\d+))?\\]"); // boost::regex has no repeated captures?\r
boost::wsmatch what;\r
#include <tbb/concurrent_queue.h>\r
#include <tbb/mutex.h>\r
\r
+#include <boost/range/iterator_range.hpp>\r
+#include <boost/range/algorithm.hpp>\r
+\r
#if defined(_MSC_VER)\r
#pragma warning (disable : 4244)\r
#endif\r
\r
std::shared_ptr<AVCodecContext> open_stream(int codec_type, int& s_index) const\r
{ \r
- AVStream** streams_end = format_context_->streams+format_context_->nb_streams;\r
- AVStream** stream = std::find_if(format_context_->streams, streams_end, [&](AVStream* stream) \r
+ const auto streams = boost::iterator_range<AVStream**>(format_context_->streams, format_context_->streams+format_context_->nb_streams);\r
+ const auto stream = boost::find_if(streams, [&](AVStream* stream) \r
{\r
return stream != nullptr && stream->codec->codec_type == codec_type;\r
});\r
\r
- if(stream == streams_end) \r
+ if(stream == streams.end()) \r
return nullptr;\r
\r
auto codec = avcodec_find_decoder((*stream)->codec->codec_id); \r
void seek_frame(int64_t frame, int flags = 0)\r
{ \r
// Convert from frames into seconds.\r
- auto ts = frame*static_cast<int64_t>((AV_TIME_BASE*get_default_context()->time_base.num) / get_default_context()->time_base.den);\r
+ const auto ts = frame*static_cast<int64_t>((AV_TIME_BASE*get_default_context()->time_base.num) / get_default_context()->time_base.den);\r
\r
const int errn = av_seek_frame(format_context_.get(), -1, ts, flags | AVSEEK_FLAG_FRAME);\r
\r
transform(s.begin(), s.end(), s.begin(), toupper);\r
\r
if (s == TEXT("MIXER")) return std::make_shared<MixerCommand>();\r
+ else if(s == TEXT("PARAM")) return std::make_shared<ParamCommand>();\r
else if(s == TEXT("SWAP")) return std::make_shared<SwapCommand>();\r
else if(s == TEXT("LOAD")) return std::make_shared<LoadCommand>();\r
else if(s == TEXT("LOADBG")) return std::make_shared<LoadbgCommand>();\r