From 11aa114c7c5564d0c128f5cc68da6544fba4b1b9 Mon Sep 17 00:00:00 2001 From: ronag Date: Fri, 19 Aug 2011 10:54:47 +0000 Subject: [PATCH] 2.0. ffmpeg_producer: Tweaked input buffer params. git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1227 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- modules/ffmpeg/producer/format/flv.cpp | 38 ++--------------------- modules/ffmpeg/producer/input.cpp | 8 ++--- modules/flash/producer/flash_producer.cpp | 6 ++-- shell/casparcg.config | 15 ++++++--- shell/shell.vcxproj | 3 -- shell/shell.vcxproj.filters | 3 -- 6 files changed, 20 insertions(+), 53 deletions(-) diff --git a/modules/ffmpeg/producer/format/flv.cpp b/modules/ffmpeg/producer/format/flv.cpp index 0e87dcbea..21b917a65 100644 --- a/modules/ffmpeg/producer/format/flv.cpp +++ b/modules/ffmpeg/producer/format/flv.cpp @@ -12,40 +12,6 @@ namespace caspar { -double next_double(std::fstream& fileStream) -{ - std::vector bytes(8); - - auto tmp2 = fileStream.tellg(); - tmp2; - - fileStream.read(bytes.data(), 8); - - auto tmp3 = fileStream.gcount(); - tmp3; - - tmp2 = fileStream.tellg(); - tmp2; - - fileStream.seekg(1, std::ios::cur); - - tmp2 = fileStream.tellg(); - tmp2; - - std::reverse(bytes.begin(), bytes.end()); - double* tmp = (double*)bytes.data(); - - return *tmp; -} - -bool next_bool(std::fstream& fileStream) -{ - std::vector bytes(1); - fileStream.read(bytes.data(), bytes.size()); - fileStream.seekg(1, std::ios::cur); - return bytes[0] != 0; -} - std::map read_flv_meta_info(const std::string& filename) { std::map values; @@ -84,7 +50,7 @@ std::map read_flv_meta_info(const std::string& filenam char data_type = *ptr++; switch(data_type) { - case 0: + case 0: // double { std::reverse(ptr, ptr+8); values[name] = boost::lexical_cast(*(double*)(ptr)); @@ -92,7 +58,7 @@ std::map read_flv_meta_info(const std::string& filenam break; } - case 1: + case 1: // bool { values[name] = boost::lexical_cast(*ptr != 0); ptr += 2; diff --git a/modules/ffmpeg/producer/input.cpp b/modules/ffmpeg/producer/input.cpp index 44d549fb2..480e7e5d5 100644 --- a/modules/ffmpeg/producer/input.cpp +++ b/modules/ffmpeg/producer/input.cpp @@ -57,9 +57,9 @@ extern "C" namespace caspar { -static const size_t MAX_BUFFER_COUNT = 50; +static const size_t MAX_BUFFER_COUNT = 100; static const size_t MIN_BUFFER_COUNT = 4; -static const size_t MAX_BUFFER_SIZE = 32 * 1000000; +static const size_t MAX_BUFFER_SIZE = 16 * 1000000; struct input::implementation : boost::noncopyable { @@ -116,8 +116,8 @@ public: read_next_packet(); graph_->set_color("seek", diagnostics::color(1.0f, 0.5f, 0.0f)); - graph_->set_color("buffer-count", diagnostics::color(0.4f, 0.8f, 0.8f)); - graph_->set_color("buffer-size", diagnostics::color(0.2f, 0.4f, 0.8f)); + graph_->set_color("buffer-count", diagnostics::color(0.7f, 0.4f, 0.4f)); + graph_->set_color("buffer-size", diagnostics::color(1.0f, 1.0f, 0.0f)); thread_ = boost::thread([this]{run();}); } diff --git a/modules/flash/producer/flash_producer.cpp b/modules/flash/producer/flash_producer.cpp index cfc4ca739..554ce85e3 100644 --- a/modules/flash/producer/flash_producer.cpp +++ b/modules/flash/producer/flash_producer.cpp @@ -279,7 +279,7 @@ public: fps_ = 0; graph_ = diagnostics::create_graph([this]{return print();}); - graph_->set_color("output-buffer", diagnostics::color(0.0f, 1.0f, 0.0f)); + graph_->set_color("output-buffer-count", diagnostics::color(1.0f, 1.0f, 0.0f)); frame_buffer_.set_capacity(frame_factory_->get_video_format_desc().fps > 30.0 ? 2 : 1); @@ -295,7 +295,7 @@ public: virtual safe_ptr receive(int) { - graph_->set_value("output-buffer", static_cast(frame_buffer_.size())/static_cast(frame_buffer_.capacity())); + graph_->set_value("output-buffer-count", static_cast(frame_buffer_.size())/static_cast(frame_buffer_.capacity())); auto frame = core::basic_frame::late(); if(frame_buffer_.try_pop(frame)) @@ -376,7 +376,7 @@ public: frame_buffer_.push(frame); } - graph_->set_value("output-buffer", static_cast(frame_buffer_.size())/static_cast(frame_buffer_.capacity())); + graph_->set_value("output-buffer-count", static_cast(frame_buffer_.size())/static_cast(frame_buffer_.capacity())); fps_.fetch_and_store(static_cast(context_->fps()*100.0)); render(renderer); diff --git a/shell/casparcg.config b/shell/casparcg.config index 0069a42fd..20d4ea53e 100644 --- a/shell/casparcg.config +++ b/shell/casparcg.config @@ -46,16 +46,23 @@ - 1080i5000 + 1080p5000 1 true true - - 1 - + + + + 1080p5000 + + + 2 + true + true + diff --git a/shell/shell.vcxproj b/shell/shell.vcxproj index 244b58fdb..03d70ddbd 100644 --- a/shell/shell.vcxproj +++ b/shell/shell.vcxproj @@ -70,9 +70,6 @@ - - - {8C26C94F-8092-4769-8D84-DEA479721C5B} Win32Proj diff --git a/shell/shell.vcxproj.filters b/shell/shell.vcxproj.filters index d31f67e1f..8f6e62cc3 100644 --- a/shell/shell.vcxproj.filters +++ b/shell/shell.vcxproj.filters @@ -20,9 +20,6 @@ source - - - {39e46848-dfec-441d-b0c0-f131380cdc6e} -- 2.39.2