]> git.sesse.net Git - casparcg/commitdiff
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 15 Jan 2011 10:40:10 +0000 (10:40 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 15 Jan 2011 10:40:10 +0000 (10:40 +0000)
core/channel.cpp
core/channel.h
core/consumer/frame_consumer_device.cpp
core/processor/draw_frame.cpp
core/processor/frame_processor_device.h
core/processor/fwd.h
core/producer/ffmpeg/ffmpeg_producer.cpp
core/producer/frame_producer.h
core/video_format.cpp
core/video_format.h

index 8dabf1664ca4ed0cfcb77b51f49670914d5af68d..837bd8e3b369560b57a2f56e00388ce47c1a6073 100644 (file)
@@ -66,13 +66,13 @@ public:
                return draw_frame(frames);\r
        }\r
 \r
-       void load(int index, const safe_ptr<frame_producer>& producer, bool autoplay)\r
+       void load(int index, const safe_ptr<frame_producer>& producer, bool play_on_load)\r
        {\r
                producer->initialize(processor_device_);\r
                executor_.begin_invoke([=]\r
                {\r
                        auto it = layers_.insert(std::make_pair(index, layer(index))).first;\r
-                       it->second.load(producer, autoplay);\r
+                       it->second.load(producer, play_on_load);\r
                });\r
        }\r
                        \r
@@ -162,7 +162,7 @@ public:
 \r
 channel::channel(channel&& other) : impl_(std::move(other.impl_)){}\r
 channel::channel(const video_format_desc& format_desc, const std::vector<safe_ptr<frame_consumer>>& consumers) : impl_(new implementation(format_desc, consumers)){}\r
-void channel::load(int index, const safe_ptr<frame_producer>& producer, bool autoplay){impl_->load(index, producer, autoplay);}\r
+void channel::load(int index, const safe_ptr<frame_producer>& producer, bool play_on_load){impl_->load(index, producer, play_on_load);}\r
 void channel::preview(int index, const safe_ptr<frame_producer>& producer){impl_->preview(index, producer);}\r
 void channel::pause(int index){impl_->pause(index);}\r
 void channel::play(int index){impl_->play(index);}\r
index d393565636c1c6597538d5e6c98c06055d221ca6..397f78c5b47e25e4edaefa181fe913df1b34303a 100644 (file)
@@ -26,7 +26,7 @@ public:
        explicit channel(const video_format_desc& format_desc, const std::vector<safe_ptr<frame_consumer>>& consumers);\r
        channel(channel&& other);\r
        \r
-       void load(int index, const safe_ptr<frame_producer>& producer, bool autoplay = false);\r
+       void load(int index, const safe_ptr<frame_producer>& producer, bool play_on_load = false);\r
        void preview(int index, const safe_ptr<frame_producer>& producer);\r
        void pause(int index);\r
        void play(int index);\r
index 17f0dd65a22c926787bcc2d657ece505b4cb78a0..d18a881d25061ba879e99c6556179418dbdbb703 100644 (file)
@@ -52,7 +52,7 @@ public:
                        if(!buffer_.full())\r
                                return;\r
        \r
-                       boost::range::for_each(consumers_, [&](const safe_ptr<frame_consumer>& consumer)\r
+                       BOOST_FOREACH(auto consumer, consumers_)\r
                        {\r
                                try\r
                                {\r
@@ -64,7 +64,7 @@ public:
                                        boost::range::remove_erase(consumers_, consumer);\r
                                        CASPAR_LOG(warning) << "Removed consumer from frame_consumer_device.";\r
                                }\r
-                       });\r
+                       }\r
        \r
                        clock_.wait(fmt_.fps);\r
                });\r
index 177be619f804bb5abc1cb8326be2ba09739beac3..bf90469864a34e89784f70cacb9f56810e0ebc63 100644 (file)
@@ -26,14 +26,16 @@ public:
        void process_image(image_processor& processor)\r
        {\r
                processor.begin(image_transform_);\r
-               boost::range::for_each(frames_, std::bind(&draw_frame::process_image, std::placeholders::_1, std::ref(processor)));\r
+               BOOST_FOREACH(auto frame, frames_)\r
+                       frame->process_image(processor);\r
                processor.end();\r
        }\r
 \r
        void process_audio(audio_processor& processor)\r
        {\r
                processor.begin(audio_transform_);\r
-               boost::range::for_each(frames_, std::bind(&draw_frame::process_audio, std::placeholders::_1, std::ref(processor)));\r
+               BOOST_FOREACH(auto frame, frames_)\r
+                       frame->process_audio(processor);\r
                processor.end();\r
        }       \r
 };\r
index 394699b7ce706f772dd1dc17046a238624ab4388..cce7cfa8feeef60ed9cc39c6d7dc7b3bc3330db6 100644 (file)
 \r
 #include "fwd.h"\r
 \r
-#include "pixel_format.h"\r
 #include "write_frame.h"\r
-\r
-#include "../video_format.h"\r
+#include "pixel_format.h"\r
 \r
 #include <common/memory/safe_ptr.h>\r
 \r
-#include <tbb/concurrent_queue.h>\r
-\r
-#include <boost/thread/future.hpp>\r
-\r
-#include <memory>\r
-\r
 namespace caspar { namespace core {\r
 \r
+struct video_format;\r
+\r
 class frame_processor_device : boost::noncopyable\r
 {\r
 public:\r
@@ -51,7 +45,7 @@ public:
        const video_format_desc& get_video_format_desc() const; // nothrow\r
 private:\r
        struct implementation;\r
-       std::shared_ptr<implementation> impl_;\r
+       safe_ptr<implementation> impl_;\r
 };\r
 \r
 }}
\ No newline at end of file
index 29d2ff68469deff9335df7441b075ec9ef73c59e..3b482352ae0869c43e81dd6cedc6ace17b29ade8 100644 (file)
@@ -15,4 +15,6 @@ class frame_processor;
 class audio_processor;\r
 class frame_processor_device;\r
 \r
+struct pixel_format_desc;\r
+\r
 }}
\ No newline at end of file
index ddc75437e7a389705a2c1e0bc5505f998cd89f59..c5149a4b0110d66e5a59e3df25bcb902f6b6821a 100644 (file)
 \r
 #include <tbb/parallel_invoke.h>\r
 \r
-#include <boost/regex.hpp>\r
-\r
 #include <deque>\r
 \r
-using namespace boost::assign;\r
-\r
 namespace caspar { namespace core { namespace ffmpeg{\r
        \r
 struct ffmpeg_producer : public frame_producer\r
@@ -128,7 +124,7 @@ public:
 \r
 safe_ptr<frame_producer> create_ffmpeg_producer(const std::vector<std::wstring>& params)\r
 {                      \r
-       static const std::vector<std::wstring> extensions = list_of(L"mpg")(L"avi")(L"mov")(L"dv")(L"wav")(L"mp3")(L"mp4")(L"f4v")(L"flv");\r
+       static const std::vector<std::wstring> extensions = boost::assign::list_of(L"mpg")(L"avi")(L"mov")(L"dv")(L"wav")(L"mp3")(L"mp4")(L"f4v")(L"flv");\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
index bad2e30d00cb1380edec039b64b4a3729d336059..6db0a322263f806ebd6aa0548e2c86b7eaff0ada 100644 (file)
@@ -95,4 +95,10 @@ inline std::wostream& operator<<(std::wostream& out, const frame_producer& produ
        return out;\r
 }\r
 \r
+inline std::wostream& operator<<(std::wostream& out, const safe_ptr<const frame_producer>& producer)\r
+{\r
+       out << producer->print().c_str();\r
+       return out;\r
+}\r
+\r
 }}\r
index e6922e301d32efecac048ce47cda6b7f62cc134f..d5030259e56c5ca3947114a8af0d4378b08b2bfe 100644 (file)
 \r
 #include <array>\r
 \r
-#define DEFINE_VIDEOFORMATDESC(w, h, m, f, s, fmt, t, d) { (fmt), (w), (h), (m), (m == video_mode::progressive ? f : f/2.0), (1.0/(m == video_mode::progressive ? f : f/2.0)), ((w)*(h)*4), (s), (t), (d) }\r
+#define DEFINE_VIDEOFORMATDESC(w, h, m, f, s, fmt) { (fmt), (w), (h), (m), (m == video_mode::progressive ? f : f/2.0), (1.0/(m == video_mode::progressive ? f : f/2.0)), ((w)*(h)*4), (s)}\r
 \r
 namespace caspar { namespace core {\r
        \r
 const video_format_desc format_descs[video_format::invalid] =  \r
 {                                                                         \r
-       DEFINE_VIDEOFORMATDESC(720,  576,  video_mode::upper,                   50,                     TEXT("PAL"),            video_format::pal               , 25, 1), \r
+       DEFINE_VIDEOFORMATDESC(720,  576,  video_mode::upper,                   50,                     TEXT("PAL"),            video_format::pal               ), \r
        //DEFINE_VIDEOFORMATDESC(720,  486,  video_mode::lower,                 60/1.001,       TEXT("NTSC"),           video_format::ntsc              ), \r
        //DEFINE_VIDEOFORMATDESC(720,  576,  video_mode::progressive,           25,                     TEXT("576p2500"),       video_format::x576p2500 ),\r
-       DEFINE_VIDEOFORMATDESC(1280, 720,  video_mode::progressive,             25,                     TEXT("720p2500"),       video_format::x720p2500 , 25, 1), \r
-       DEFINE_VIDEOFORMATDESC(1280, 720,  video_mode::progressive,             50,                     TEXT("720p5000"),       video_format::x720p5000 , 50, 1), \r
+       DEFINE_VIDEOFORMATDESC(1280, 720,  video_mode::progressive,             25,                     TEXT("720p2500"),       video_format::x720p2500 ), \r
+       DEFINE_VIDEOFORMATDESC(1280, 720,  video_mode::progressive,             50,                     TEXT("720p5000"),       video_format::x720p5000 ), \r
        //DEFINE_VIDEOFORMATDESC(1280, 720,  video_mode::progressive,   60/1.001,       TEXT("720p5994"),       video_format::x720p5994 ),\r
        //DEFINE_VIDEOFORMATDESC(1280, 720,  video_mode::progressive,   60,                     TEXT("720p6000"),       video_format::x720p6000 ),\r
        //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive,   24/1.001,       TEXT("1080p2397"),      video_format::x1080p2397),\r
        //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive,   24,                     TEXT("1080p2400"),      video_format::x1080p2400),\r
-       DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper,                   50,                     TEXT("1080i5000"),      video_format::x1080i5000, 25, 1),\r
+       DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper,                   50,                     TEXT("1080i5000"),      video_format::x1080i5000),\r
        //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper,                 60/1.001,       TEXT("1080i5994"),      video_format::x1080i5994),\r
        //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper,                 60,                     TEXT("1080i6000"),      video_format::x1080i6000),\r
-       DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive,             25,                     TEXT("1080p2500"),      video_format::x1080p2500, 25, 1),\r
+       DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive,             25,                     TEXT("1080p2500"),      video_format::x1080p2500),\r
        //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive,   30/1.001,       TEXT("1080p2997"),      video_format::x1080p2997),\r
        //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive,   30,                     TEXT("1080p3000"),      video_format::x1080p3000),\r
-       DEFINE_VIDEOFORMATDESC(0,               0, video_mode::invalid,                 -1,                     TEXT("invalid"),        video_format::invalid,    0, 0)\r
+       DEFINE_VIDEOFORMATDESC(0,               0, video_mode::invalid,                 -1,                     TEXT("invalid"),        video_format::invalid   )\r
 };\r
 \r
 const video_format_desc& video_format_desc::get(video_format::type format)     \r
index 8caa42c12a99b5b9b8e6d5c0a09005b5d9db4b9f..bdcf3f8ac47d1167baf294e062e77968f7013337 100644 (file)
@@ -53,8 +53,6 @@ struct video_format_desc
        double                                  interval;       // time between frames\r
        size_t                                  size;           // output frame size in bytes \r
        std::wstring                    name;           // name of output format\r
-       size_t                                  time_scale;\r
-       size_t                                  display_duration;\r
 \r
        static const video_format_desc& get(video_format::type format);\r
        static const video_format_desc& get(const std::wstring& name);\r