]> git.sesse.net Git - casparcg/blobdiff - modules/ffmpeg/producer/input.cpp
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / modules / ffmpeg / producer / input.cpp
index 327a39fa6e3cd2a8660393289b06b2c9b8d8826c..47f6ebf7489e98212a1c871c28d0bb0bb892985a 100644 (file)
@@ -55,11 +55,11 @@ extern "C"
 #pragma warning (pop)\r
 #endif\r
 \r
-namespace caspar {\r
+namespace caspar { namespace ffmpeg {\r
 \r
-static const size_t MAX_BUFFER_COUNT = 32;\r
+static const size_t MAX_BUFFER_COUNT = 100;\r
 static const size_t MIN_BUFFER_COUNT = 4;\r
-static const size_t MAX_BUFFER_SIZE  = 32 * 1000000;\r
+static const size_t MAX_BUFFER_SIZE  = 16 * 1000000;\r
        \r
 struct input::implementation : boost::noncopyable\r
 {              \r
@@ -115,9 +115,9 @@ public:
                for(int n = 0; n < 16 && !full(); ++n)\r
                        read_next_packet();\r
                                                \r
-               graph_->set_color("seek", diagnostics::color(0.5f, 1.0f, 0.5f));        \r
-               graph_->set_color("buffer-count", diagnostics::color(0.2f, 0.8f, 1.0f));\r
-               graph_->set_color("buffer-size", diagnostics::color(0.2f, 0.4f, 1.0f)); \r
+               graph_->set_color("seek", diagnostics::color(1.0f, 0.5f, 0.0f));        \r
+               graph_->set_color("buffer-count", diagnostics::color(0.7f, 0.4f, 0.4f));\r
+               graph_->set_color("buffer-size", diagnostics::color(1.0f, 1.0f, 0.0f)); \r
 \r
                thread_ = boost::thread([this]{run();});\r
        }\r
@@ -217,17 +217,17 @@ private:
 \r
                                seek_frame(start_, flags);\r
                                graph_->add_tag("seek");                \r
-                               CASPAR_LOG(trace) << print() << " Looping.";                    \r
+                               CASPAR_LOG(debug) << print() << " Looping.";                    \r
                        }       \r
                        else\r
                        {\r
                                is_running_ = false;\r
-                               CASPAR_LOG(trace) << print() << " Stopping.";\r
+                               CASPAR_LOG(debug) << print() << " Stopping.";\r
                        }\r
                }\r
                else\r
                {               \r
-                       THROW_ON_ERROR(ret, print(), "av_read_frame");\r
+                       THROW_ON_ERROR(ret, "av_read_frame", print());\r
 \r
                        if(read_packet->stream_index == default_stream_index_)\r
                        {\r
@@ -272,7 +272,7 @@ private:
                if(ret == AVERROR(EIO))\r
                        CASPAR_LOG(trace) << print() << " Received EIO, assuming EOF. " << nb_frames_;\r
                if(ret == AVERROR_EOF)\r
-                       CASPAR_LOG(trace) << print() << " Received EOF. " << nb_frames_;\r
+                       CASPAR_LOG(debug) << print() << " Received EOF. " << nb_frames_;\r
 \r
                return ret == AVERROR_EOF || ret == AVERROR(EIO) || frame_number_ >= length_; // av_read_frame doesn't always correctly return AVERROR_EOF;\r
        }\r
@@ -287,7 +287,7 @@ input::input(const safe_ptr<diagnostics::graph>& graph, const std::wstring& file
        : impl_(new implementation(graph, filename, loop, start, length)){}\r
 bool input::eof() const {return !impl_->is_running_;}\r
 bool input::try_pop(std::shared_ptr<AVPacket>& packet){return impl_->try_pop(packet);}\r
-safe_ptr<AVFormatContext> input::context(){return make_safe(impl_->format_context_);}\r
+safe_ptr<AVFormatContext> input::context(){return make_safe_ptr(impl_->format_context_);}\r
 size_t input::nb_frames() const {return impl_->nb_frames();}\r
 size_t input::nb_loops() const {return impl_->nb_loops();}\r
-}
\ No newline at end of file
+}}\r