]> 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>
Fri, 26 Nov 2010 17:54:43 +0000 (17:54 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Fri, 26 Nov 2010 17:54:43 +0000 (17:54 +0000)
26 files changed:
core/consumer/bluefish/bluefish_consumer.cpp
core/consumer/decklink/DecklinkVideoConsumer.cpp
core/consumer/frame_consumer_device.cpp
core/consumer/oal/oal_consumer.cpp
core/core.vcxproj
core/core.vcxproj.filters
core/format/pixel_format.cpp [new file with mode: 0644]
core/format/pixel_format.h
core/format/video_format.cpp
core/format/video_format.h
core/processor/composite_frame.cpp
core/processor/composite_frame.h
core/processor/frame.cpp
core/processor/frame.h
core/processor/frame_processor_device.cpp
core/processor/frame_processor_device.h
core/processor/frame_renderer.cpp
core/producer/color/color_producer.cpp
core/producer/ffmpeg/ffmpeg_producer.cpp
core/producer/ffmpeg/video/video_transformer.cpp
core/producer/flash/flash_producer.cpp
core/producer/frame_producer.h
core/producer/image/image_scroll_producer.cpp
core/producer/layer.cpp
core/producer/transition/transition_producer.cpp
core/server.cpp

index 52e917d70747bffe8f8fc5f1b7dea46f365d497f..aa4045c814e43649d1992ee2a67650b35cc76e8f 100644 (file)
@@ -192,7 +192,7 @@ struct consumer::implementation
                static size_t audio_nchannels = 2;\r
                static std::vector<short> silence(audio_samples*audio_nchannels*2, 0);\r
 \r
-               auto& frame_audio_data = frame->audio_data().empty() ? silence : frame->audio_data();\r
+               auto& frame_audio_data = frame->get_audio_data().empty() ? silence : frame->get_audio_data();\r
 \r
                unsigned long fieldCount = 0;\r
                sdk_->wait_output_video_synch(UPD_FMT_FRAME, fieldCount);\r
index b0cf332b29a5ae9c7d4df4c7edcdc6b896b61f69..cdadf6ad4d0ae03f4892d1412ec4787f70388a4e 100644 (file)
@@ -407,7 +407,7 @@ struct DecklinkVideoConsumer::Implementation : public IDeckLinkVideoOutputCallba
 \r
        const video_format_desc& get_video_format_desc() const \r
        {\r
-               return video_format_desc::format_descs[currentFormat_];\r
+               return video_format_desc::get(currentFormat_);\r
        }\r
 \r
        unsigned long GetDecklinkVideoFormat(video_format::type fmt) \r
index 901d4656fc6d39898bcdded37b8fee045d6e1809..62c40ea4b36cf21df3223d71ea270099bc4f06b6 100644 (file)
@@ -27,7 +27,7 @@ class video_sync_clock
 public:\r
        video_sync_clock(const video_format_desc& format_desc)\r
        {\r
-               period_ = static_cast<long>(render_video_format_period(format_desc)*1000000.0);\r
+               period_ = static_cast<long>(format_desc.period*1000000.0);\r
                time_ = boost::posix_time::microsec_clock::local_time();\r
        }\r
 \r
index e7b371c54d6d6e735bddaead957ab4984fef1791..23b08d533ad5b9190e01f2aa68001a37ca0fcca9 100644 (file)
@@ -49,7 +49,7 @@ struct consumer::implementation : public sf::SoundStream, boost::noncopyable
        {\r
                // NOTE: tbb::concurrent_queue does not have rvalue support. \r
                // Use shared_ptr to emulate move semantics\r
-               input_.push(std::make_shared<std::vector<short>>(std::move(frame->audio_data()))); \r
+               input_.push(std::make_shared<std::vector<short>>(std::move(frame->get_audio_data()))); \r
                \r
                if(GetStatus() != Playing && input_.size() > 2)\r
                        Play();\r
index 6900ae489449687b5fc5b30ac3da0f325f53ec23..160c70769e8244c73fe99e2d12bd576ac24c74a2 100644 (file)
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../StdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../StdAfx.h</PrecompiledHeaderFile>\r
     </ClCompile>\r
+    <ClCompile Include="format\pixel_format.cpp">\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\StdAfx.h</PrecompiledHeaderFile>\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\StdAfx.h</PrecompiledHeaderFile>\r
+    </ClCompile>\r
     <ClCompile Include="format\video_format.cpp">\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
index ecec160e2a68cb0abe0800a2f8c37fcb3cfa06de..37c82ae49fbd202cc998d3a9a16da6b9d201447e 100644 (file)
     <Filter Include="My Amplifier Results">\r
       <UniqueIdentifier>{bb801cd9-8dc8-4300-a5c7-a7f5ee0805fb}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\consumer">\r
+    <Filter Include="Source\channel">\r
+      <UniqueIdentifier>{0eb1ae03-858d-4248-96d9-5c99e8c6e7a1}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Source\channel\processor">\r
+      <UniqueIdentifier>{53e41831-70b4-4214-bc38-77e0d7aa288b}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Source\channel\processor\renderer">\r
+      <UniqueIdentifier>{30fe40ca-8bf0-4a46-a882-16d07b2b441e}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Source\channel\consumer">\r
       <UniqueIdentifier>{35d7835f-f813-4b4b-8d8d-8a35dfef68d3}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\consumer\oal">\r
+    <Filter Include="Source\channel\consumer\oal">\r
       <UniqueIdentifier>{3dab53b0-e0ef-4431-8c1d-9a973b269ae7}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\consumer\ogl">\r
+    <Filter Include="Source\channel\consumer\ogl">\r
       <UniqueIdentifier>{7217dee5-b7ca-4128-9994-03a844c06903}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\consumer\bluefish">\r
+    <Filter Include="Source\channel\consumer\bluefish">\r
       <UniqueIdentifier>{89e746b3-5d4d-4ff2-a66e-279b5371ac9d}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\consumer\decklink">\r
+    <Filter Include="Source\channel\consumer\decklink">\r
       <UniqueIdentifier>{aa3626b2-ad7a-4e84-8867-0f5868a21567}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\consumer\decklink\interop">\r
+    <Filter Include="Source\channel\consumer\decklink\interop">\r
       <UniqueIdentifier>{a5cb89d7-dbbb-4fca-b899-f53a069727b4}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\format">\r
-      <UniqueIdentifier>{f19ced4f-4ad2-4c0a-b51f-50e89909d669}</UniqueIdentifier>\r
-    </Filter>\r
-    <Filter Include="Source\processor">\r
-      <UniqueIdentifier>{53e41831-70b4-4214-bc38-77e0d7aa288b}</UniqueIdentifier>\r
-    </Filter>\r
-    <Filter Include="Source\processor\renderer">\r
-      <UniqueIdentifier>{30fe40ca-8bf0-4a46-a882-16d07b2b441e}</UniqueIdentifier>\r
-    </Filter>\r
-    <Filter Include="Source\producer">\r
+    <Filter Include="Source\channel\producer">\r
       <UniqueIdentifier>{71accefc-1437-4e1d-9ff7-9de654a32df9}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\producer\ffmpeg">\r
+    <Filter Include="Source\channel\producer\ffmpeg">\r
       <UniqueIdentifier>{671d13be-c7e1-4f65-9909-03b7c8adcbde}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\producer\ffmpeg\video">\r
+    <Filter Include="Source\channel\producer\ffmpeg\video">\r
       <UniqueIdentifier>{a6d6bcc9-7ef1-47a3-9800-76e71f2b3f62}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\producer\ffmpeg\audio">\r
+    <Filter Include="Source\channel\producer\ffmpeg\audio">\r
       <UniqueIdentifier>{4031dc0c-88e9-46b5-b279-955639dca8b7}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\producer\color">\r
+    <Filter Include="Source\channel\producer\color">\r
       <UniqueIdentifier>{78b16c14-bf29-4511-9122-684ff513dbf5}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\producer\transition">\r
+    <Filter Include="Source\channel\producer\transition">\r
       <UniqueIdentifier>{26bf9811-1954-46f5-86ce-ecdc26e6db16}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\producer\flash">\r
+    <Filter Include="Source\channel\producer\flash">\r
       <UniqueIdentifier>{fc25232a-cab1-4c79-962a-b51dc51161fb}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\producer\flash\interop">\r
+    <Filter Include="Source\channel\producer\flash\interop">\r
       <UniqueIdentifier>{f99e4727-2b1b-4009-a445-99b11b071e8e}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\producer\image">\r
+    <Filter Include="Source\channel\producer\image">\r
       <UniqueIdentifier>{3d4314f3-8a39-44e3-a0c9-9b833bb8f809}</UniqueIdentifier>\r
     </Filter>\r
+    <Filter Include="Source\channel\format">\r
+      <UniqueIdentifier>{f19ced4f-4ad2-4c0a-b51f-50e89909d669}</UniqueIdentifier>\r
+    </Filter>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="StdAfx.h">\r
       <Filter>Source\protocol\clk</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\decklink\DecklinkVideoConsumer.h">\r
-      <Filter>Source\consumer\decklink</Filter>\r
+      <Filter>Source\channel\consumer\decklink</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\decklink\DeckLinkAPI_h.h">\r
-      <Filter>Source\consumer\decklink\interop</Filter>\r
+      <Filter>Source\channel\consumer\decklink\interop</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\color\color_producer.h">\r
-      <Filter>Source\producer\color</Filter>\r
+      <Filter>Source\channel\producer\color</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\ffmpeg\ffmpeg_producer.h">\r
-      <Filter>Source\producer\ffmpeg</Filter>\r
+      <Filter>Source\channel\producer\ffmpeg</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\ffmpeg\input.h">\r
-      <Filter>Source\producer\ffmpeg</Filter>\r
+      <Filter>Source\channel\producer\ffmpeg</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\ffmpeg\audio\audio_decoder.h">\r
-      <Filter>Source\producer\ffmpeg\audio</Filter>\r
+      <Filter>Source\channel\producer\ffmpeg\audio</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\ffmpeg\video\video_decoder.h">\r
-      <Filter>Source\producer\ffmpeg\video</Filter>\r
+      <Filter>Source\channel\producer\ffmpeg\video</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\image\image_loader.h">\r
-      <Filter>Source\producer\image</Filter>\r
+      <Filter>Source\channel\producer\image</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\image\image_producer.h">\r
-      <Filter>Source\producer\image</Filter>\r
+      <Filter>Source\channel\producer\image</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\image\image_scroll_producer.h">\r
-      <Filter>Source\producer\image</Filter>\r
+      <Filter>Source\channel\producer\image</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\transition\transition_producer.h">\r
-      <Filter>Source\producer\transition</Filter>\r
+      <Filter>Source\channel\producer\transition</Filter>\r
     </ClInclude>\r
     <ClInclude Include="protocol\media.h">\r
       <Filter>Source\protocol</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\frame_producer.h">\r
-      <Filter>Source\producer</Filter>\r
+      <Filter>Source\channel\producer</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\ffmpeg\video\video_transformer.h">\r
-      <Filter>Source\producer\ffmpeg\video</Filter>\r
+      <Filter>Source\channel\producer\ffmpeg\video</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\flash\cg_producer.h">\r
-      <Filter>Source\producer\flash</Filter>\r
+      <Filter>Source\channel\producer\flash</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\flash\ct_producer.h">\r
-      <Filter>Source\producer\flash</Filter>\r
+      <Filter>Source\channel\producer\flash</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\flash\flash_producer.h">\r
-      <Filter>Source\producer\flash</Filter>\r
+      <Filter>Source\channel\producer\flash</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\flash\axflash.h">\r
-      <Filter>Source\producer\flash\interop</Filter>\r
+      <Filter>Source\channel\producer\flash\interop</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\flash\FlashAxContainer.h">\r
-      <Filter>Source\producer\flash\interop</Filter>\r
+      <Filter>Source\channel\producer\flash\interop</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\flash\TimerHelper.h">\r
-      <Filter>Source\producer\flash\interop</Filter>\r
+      <Filter>Source\channel\producer\flash\interop</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\bluefish\util.h">\r
-      <Filter>Source\consumer\bluefish</Filter>\r
+      <Filter>Source\channel\consumer\bluefish</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\bluefish\exception.h">\r
-      <Filter>Source\consumer\bluefish</Filter>\r
+      <Filter>Source\channel\consumer\bluefish</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\bluefish\memory.h">\r
-      <Filter>Source\consumer\bluefish</Filter>\r
+      <Filter>Source\channel\consumer\bluefish</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\bluefish\fwd.h">\r
-      <Filter>Source\consumer\bluefish</Filter>\r
+      <Filter>Source\channel\consumer\bluefish</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\ogl\ogl_consumer.h">\r
-      <Filter>Source\consumer\ogl</Filter>\r
+      <Filter>Source\channel\consumer\ogl</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\oal\oal_consumer.h">\r
-      <Filter>Source\consumer\oal</Filter>\r
+      <Filter>Source\channel\consumer\oal</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\bluefish\bluefish_consumer.h">\r
-      <Filter>Source\consumer\bluefish</Filter>\r
+      <Filter>Source\channel\consumer\bluefish</Filter>\r
     </ClInclude>\r
     <ClInclude Include="config.h">\r
       <Filter>Source</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\frame_consumer.h">\r
-      <Filter>Source\consumer</Filter>\r
+      <Filter>Source\channel\consumer</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\flash\bitmap.h">\r
-      <Filter>Source\producer\flash</Filter>\r
+      <Filter>Source\channel\producer\flash</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\layer.h">\r
-      <Filter>Source\producer</Filter>\r
+      <Filter>Source\channel\producer</Filter>\r
     </ClInclude>\r
     <ClInclude Include="consumer\frame_consumer_device.h">\r
-      <Filter>Source\consumer</Filter>\r
+      <Filter>Source\channel\consumer</Filter>\r
     </ClInclude>\r
     <ClInclude Include="producer\frame_producer_device.h">\r
-      <Filter>Source\producer</Filter>\r
+      <Filter>Source\channel\producer</Filter>\r
     </ClInclude>\r
     <ClInclude Include="server.h">\r
       <Filter>Source</Filter>\r
     </ClInclude>\r
     <ClInclude Include="processor\frame_processor_device.h">\r
-      <Filter>Source\processor</Filter>\r
+      <Filter>Source\channel\processor</Filter>\r
     </ClInclude>\r
     <ClInclude Include="processor\frame.h">\r
-      <Filter>Source\processor</Filter>\r
+      <Filter>Source\channel\processor</Filter>\r
     </ClInclude>\r
     <ClInclude Include="processor\composite_frame.h">\r
-      <Filter>Source\processor</Filter>\r
+      <Filter>Source\channel\processor</Filter>\r
     </ClInclude>\r
     <ClInclude Include="processor\frame_shader.h">\r
-      <Filter>Source\processor\renderer</Filter>\r
+      <Filter>Source\channel\processor\renderer</Filter>\r
     </ClInclude>\r
     <ClInclude Include="processor\frame_renderer.h">\r
-      <Filter>Source\processor\renderer</Filter>\r
+      <Filter>Source\channel\processor\renderer</Filter>\r
     </ClInclude>\r
     <ClInclude Include="format\pixel_format.h">\r
-      <Filter>Source\format</Filter>\r
+      <Filter>Source\channel\format</Filter>\r
     </ClInclude>\r
     <ClInclude Include="format\video_format.h">\r
-      <Filter>Source\format</Filter>\r
+      <Filter>Source\channel\format</Filter>\r
     </ClInclude>\r
     <ClInclude Include="channel.h">\r
-      <Filter>Source</Filter>\r
+      <Filter>Source\channel</Filter>\r
     </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
       <Filter>Source\protocol\clk</Filter>\r
     </ClCompile>\r
     <ClCompile Include="consumer\decklink\DecklinkVideoConsumer.cpp">\r
-      <Filter>Source\consumer\decklink</Filter>\r
+      <Filter>Source\channel\consumer\decklink</Filter>\r
     </ClCompile>\r
     <ClCompile Include="consumer\decklink\DeckLinkAPI_i.c">\r
-      <Filter>Source\consumer\decklink\interop</Filter>\r
+      <Filter>Source\channel\consumer\decklink\interop</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\color\color_producer.cpp">\r
-      <Filter>Source\producer\color</Filter>\r
+      <Filter>Source\channel\producer\color</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\ffmpeg\ffmpeg_producer.cpp">\r
-      <Filter>Source\producer\ffmpeg</Filter>\r
+      <Filter>Source\channel\producer\ffmpeg</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\ffmpeg\input.cpp">\r
-      <Filter>Source\producer\ffmpeg</Filter>\r
+      <Filter>Source\channel\producer\ffmpeg</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\ffmpeg\audio\audio_decoder.cpp">\r
-      <Filter>Source\producer\ffmpeg\audio</Filter>\r
+      <Filter>Source\channel\producer\ffmpeg\audio</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\ffmpeg\video\video_decoder.cpp">\r
-      <Filter>Source\producer\ffmpeg\video</Filter>\r
+      <Filter>Source\channel\producer\ffmpeg\video</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\image\image_loader.cpp">\r
-      <Filter>Source\producer\image</Filter>\r
+      <Filter>Source\channel\producer\image</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\image\image_producer.cpp">\r
-      <Filter>Source\producer\image</Filter>\r
+      <Filter>Source\channel\producer\image</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\image\image_scroll_producer.cpp">\r
-      <Filter>Source\producer\image</Filter>\r
+      <Filter>Source\channel\producer\image</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\transition\transition_producer.cpp">\r
-      <Filter>Source\producer\transition</Filter>\r
+      <Filter>Source\channel\producer\transition</Filter>\r
     </ClCompile>\r
     <ClCompile Include="protocol\media.cpp">\r
       <Filter>Source\protocol</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\ffmpeg\video\video_transformer.cpp">\r
-      <Filter>Source\producer\ffmpeg\video</Filter>\r
+      <Filter>Source\channel\producer\ffmpeg\video</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\flash\cg_producer.cpp">\r
-      <Filter>Source\producer\flash</Filter>\r
+      <Filter>Source\channel\producer\flash</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\flash\ct_producer.cpp">\r
-      <Filter>Source\producer\flash</Filter>\r
+      <Filter>Source\channel\producer\flash</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\flash\flash_producer.cpp">\r
-      <Filter>Source\producer\flash</Filter>\r
+      <Filter>Source\channel\producer\flash</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\flash\Flash9e_i.c">\r
-      <Filter>Source\producer\flash\interop</Filter>\r
+      <Filter>Source\channel\producer\flash\interop</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\flash\FlashAxContainer.cpp">\r
-      <Filter>Source\producer\flash\interop</Filter>\r
+      <Filter>Source\channel\producer\flash\interop</Filter>\r
     </ClCompile>\r
     <ClCompile Include="consumer\ogl\ogl_consumer.cpp">\r
-      <Filter>Source\consumer\ogl</Filter>\r
+      <Filter>Source\channel\consumer\ogl</Filter>\r
     </ClCompile>\r
     <ClCompile Include="consumer\oal\oal_consumer.cpp">\r
-      <Filter>Source\consumer\oal</Filter>\r
+      <Filter>Source\channel\consumer\oal</Filter>\r
     </ClCompile>\r
     <ClCompile Include="consumer\bluefish\bluefish_consumer.cpp">\r
-      <Filter>Source\consumer\bluefish</Filter>\r
+      <Filter>Source\channel\consumer\bluefish</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\flash\bitmap.cpp">\r
-      <Filter>Source\producer\flash</Filter>\r
+      <Filter>Source\channel\producer\flash</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\layer.cpp">\r
-      <Filter>Source\producer</Filter>\r
+      <Filter>Source\channel\producer</Filter>\r
     </ClCompile>\r
     <ClCompile Include="consumer\frame_consumer_device.cpp">\r
-      <Filter>Source\consumer</Filter>\r
+      <Filter>Source\channel\consumer</Filter>\r
     </ClCompile>\r
     <ClCompile Include="producer\frame_producer_device.cpp">\r
-      <Filter>Source\producer</Filter>\r
+      <Filter>Source\channel\producer</Filter>\r
     </ClCompile>\r
     <ClCompile Include="server.cpp">\r
       <Filter>Source</Filter>\r
     </ClCompile>\r
     <ClCompile Include="processor\frame_processor_device.cpp">\r
-      <Filter>Source\processor</Filter>\r
+      <Filter>Source\channel\processor</Filter>\r
     </ClCompile>\r
     <ClCompile Include="processor\frame.cpp">\r
-      <Filter>Source\processor</Filter>\r
+      <Filter>Source\channel\processor</Filter>\r
     </ClCompile>\r
     <ClCompile Include="processor\composite_frame.cpp">\r
-      <Filter>Source\processor</Filter>\r
+      <Filter>Source\channel\processor</Filter>\r
     </ClCompile>\r
     <ClCompile Include="processor\frame_renderer.cpp">\r
-      <Filter>Source\processor\renderer</Filter>\r
+      <Filter>Source\channel\processor\renderer</Filter>\r
     </ClCompile>\r
     <ClCompile Include="processor\frame_shader.cpp">\r
-      <Filter>Source\processor\renderer</Filter>\r
+      <Filter>Source\channel\processor\renderer</Filter>\r
     </ClCompile>\r
     <ClCompile Include="format\video_format.cpp">\r
-      <Filter>Source\format</Filter>\r
+      <Filter>Source\channel\format</Filter>\r
     </ClCompile>\r
     <ClCompile Include="channel.cpp">\r
-      <Filter>Source</Filter>\r
+      <Filter>Source\channel</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="format\pixel_format.cpp">\r
+      <Filter>Source\channel\format</Filter>\r
     </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Midl Include="consumer\decklink\DeckLinkAPI_v7_3.idl">\r
-      <Filter>Source\consumer\decklink\interop</Filter>\r
+      <Filter>Source\channel\consumer\decklink\interop</Filter>\r
     </Midl>\r
     <Midl Include="consumer\decklink\DeckLinkAPI.idl">\r
-      <Filter>Source\consumer\decklink\interop</Filter>\r
+      <Filter>Source\channel\consumer\decklink\interop</Filter>\r
     </Midl>\r
     <Midl Include="consumer\decklink\DeckLinkAPI_v7_1.idl">\r
-      <Filter>Source\consumer\decklink\interop</Filter>\r
+      <Filter>Source\channel\consumer\decklink\interop</Filter>\r
     </Midl>\r
     <Midl Include="producer\flash\Flash9e.IDL">\r
-      <Filter>Source\producer\flash\interop</Filter>\r
+      <Filter>Source\channel\producer\flash\interop</Filter>\r
     </Midl>\r
   </ItemGroup>\r
   <ItemGroup>\r
diff --git a/core/format/pixel_format.cpp b/core/format/pixel_format.cpp
new file mode 100644 (file)
index 0000000..10d802f
--- /dev/null
@@ -0,0 +1,48 @@
+#include "..\StdAfx.h"\r
+\r
+#include "pixel_format.h"\r
+\r
+namespace caspar { namespace core {\r
+       \r
+size_t hash(const pixel_format_desc& desc)\r
+{\r
+       size_t hash = 0;\r
+       switch(desc.pix_fmt)\r
+       {\r
+       case pixel_format::ycbcr:\r
+       case pixel_format::ycbcra:\r
+               //  0-10 (11) width\r
+               // 11-21 (11) height\r
+               // 22-24 (3)  x-ratio\r
+               // 25-27 (3)  y-ratio\r
+               // 28-29 (2)  unused\r
+               // 30    (1)  alpha\r
+               // 31    (1)  yuv = true => 1\r
+               hash |= ( desc.planes[0].width                                                  & 0x7FF ) << 0;\r
+               hash |= ( desc.planes[0].height                                                 & 0x7FF ) << 11;\r
+               hash |= ((desc.planes[0].height/desc.planes[1].height)  & 0x7   ) << 22;\r
+               hash |= ((desc.planes[0].width/desc.planes[1].width)    & 0x7   ) << 25;\r
+               hash |= desc.pix_fmt == pixel_format::ycbcra ? (1 << 30) : 0;\r
+               hash |= 1 << 31;\r
+               return hash;\r
+       case pixel_format::bgra:\r
+       case pixel_format::rgba:\r
+       case pixel_format::argb:\r
+       case pixel_format::abgr:\r
+               \r
+               //0-10  (11) height\r
+               //11-21 (11) width\r
+               //22-29 (8)  unused\r
+               //30    (1)  alpha\r
+               //31    (1)  yuv = false => 0\r
+               hash |= (desc.planes[0].height & 0xFFFF) << 0;\r
+               hash |= (desc.planes[0].width  & 0xFFFF) << 15;\r
+               hash |= 1 << 30;\r
+               return hash;\r
+\r
+       default:\r
+               return hash;\r
+       };\r
+}\r
+       \r
+}}\r
index cf117d57584de12995860b397abb9a91bad6b971..82cc40f665322b21f1362cd33874e99040f5ed1e 100644 (file)
@@ -44,56 +44,8 @@ struct pixel_format_desc
        std::array<plane, 4> planes;\r
 };\r
 \r
-static size_t hash(const pixel_format_desc& desc)\r
-{\r
-       size_t hash = 0;\r
-       switch(desc.pix_fmt)\r
-       {\r
-       case pixel_format::ycbcr:\r
-       case pixel_format::ycbcra:\r
-               //  0-10 (11) width\r
-               // 11-21 (11) height\r
-               // 22-24 (3)  x-ratio\r
-               // 25-27 (3)  y-ratio\r
-               // 28-29 (2)  unused\r
-               // 30    (1)  alpha\r
-               // 31    (1)  yuv = true => 1\r
-               hash |= ( desc.planes[0].width                                                  & 0x7FF ) << 0;\r
-               hash |= ( desc.planes[0].height                                                 & 0x7FF ) << 11;\r
-               hash |= ((desc.planes[0].height/desc.planes[1].height)  & 0x7   ) << 22;\r
-               hash |= ((desc.planes[0].width/desc.planes[1].width)    & 0x7   ) << 25;\r
-               hash |= desc.pix_fmt == pixel_format::ycbcra ? (1 << 30) : 0;\r
-               hash |= 1 << 31;\r
-               return hash;\r
-       case pixel_format::bgra:\r
-       case pixel_format::rgba:\r
-       case pixel_format::argb:\r
-       case pixel_format::abgr:\r
-               \r
-               //0-10  (11) height\r
-               //11-21 (11) width\r
-               //22-29 (8)  unused\r
-               //30    (1)  alpha\r
-               //31    (1)  yuv = false => 0\r
-               hash |= (desc.planes[0].height & 0xFFFF) << 0;\r
-               hash |= (desc.planes[0].width  & 0xFFFF) << 15;\r
-               hash |= 1 << 30;\r
-               return hash;\r
-\r
-       default:\r
-               return hash;\r
-       };\r
-}\r
+size_t hash(const pixel_format_desc& desc);\r
        \r
-class pixel_format_desc_hash\r
-{\r
-public:\r
-       size_t operator()(const pixel_format_desc& desc) const\r
-       {\r
-               return hash(desc);\r
-       }\r
-};\r
-\r
 inline bool operator==(const pixel_format_desc& lhs, const pixel_format_desc& rhs)\r
 {\r
        return hash(lhs) == hash(rhs);\r
@@ -104,4 +56,13 @@ inline bool operator!=(const pixel_format_desc& lhs, const pixel_format_desc& rh
        return !(lhs == rhs);\r
 }\r
        \r
-}}
\ No newline at end of file
+}}\r
+\r
+namespace std {\r
+\r
+template<> struct hash<caspar::core::pixel_format_desc>\r
+{\r
+       size_t operator()(const caspar::core::pixel_format_desc& desc) const { return caspar::core::hash(desc);}\r
+};\r
+\r
+}
\ No newline at end of file
index 73f839e74dddb5408e38d83522f4f02d6d5cd2a6..915716d1ddcfe29f517ccd4481b3cb9ab38508b2 100644 (file)
 \r
 #include <boost/algorithm/string.hpp>\r
 \r
-#define DEFINE_VIDEOFORMATDESC(w, h, m, f, s, fmt) { (fmt), (w), (h), (m), (f), (w)*(h)*4, (s) }\r
+#include <array>\r
 \r
-namespace caspar { namespace core {\r
+#define DEFINE_VIDEOFORMATDESC(w, h, m, f, s, fmt) { (fmt), (w), (h), (m), (f), (1.0/(m == video_mode::progressive ? f : f/2.0)), ((w)*(h)*4), (s) }\r
 \r
-const video_format_desc video_format_desc::format_descs[video_format::count] =  \r
+namespace caspar { namespace core {\r
+       \r
+const video_format_desc format_descs[video_format::invalid] =  \r
 {                                                                         \r
-       DEFINE_VIDEOFORMATDESC(720,  576,  video_update_format::upper,                  50,                     TEXT("PAL"),            video_format::pal               ), \r
-       DEFINE_VIDEOFORMATDESC(720,  486,  video_update_format::lower,                  60/1.001,       TEXT("NTSC"),           video_format::ntsc              ), \r
-       DEFINE_VIDEOFORMATDESC(720,  576,  video_update_format::progressive,            25,                     TEXT("576p2500"),       video_format::x576p2500 ),\r
-       DEFINE_VIDEOFORMATDESC(1280, 720,  video_update_format::progressive,            25,                     TEXT("720p2500"),       video_format::x720p2500 ), \r
-       DEFINE_VIDEOFORMATDESC(1280, 720,  video_update_format::progressive,            50,                     TEXT("720p5000"),       video_format::x720p5000 ), \r
-       DEFINE_VIDEOFORMATDESC(1280, 720,  video_update_format::progressive,            60/1.001,       TEXT("720p5994"),       video_format::x720p5994 ),\r
-       DEFINE_VIDEOFORMATDESC(1280, 720,  video_update_format::progressive,            60,                     TEXT("720p6000"),       video_format::x720p6000 ),\r
-       DEFINE_VIDEOFORMATDESC(1920, 1080, video_update_format::progressive,            24/1.001,       TEXT("1080p2397"),      video_format::x1080p2397),\r
-       DEFINE_VIDEOFORMATDESC(1920, 1080, video_update_format::progressive,            24,                     TEXT("1080p2400"),      video_format::x1080p2400),\r
-       DEFINE_VIDEOFORMATDESC(1920, 1080, video_update_format::upper,                  50,                     TEXT("1080i5000"),      video_format::x1080i5000),\r
-       DEFINE_VIDEOFORMATDESC(1920, 1080, video_update_format::upper,                  60/1.001,       TEXT("1080i5994"),      video_format::x1080i5994),\r
-       DEFINE_VIDEOFORMATDESC(1920, 1080, video_update_format::upper,                  60,                     TEXT("1080i6000"),      video_format::x1080i6000),\r
-       DEFINE_VIDEOFORMATDESC(1920, 1080, video_update_format::progressive,            25,                     TEXT("1080p2500"),      video_format::x1080p2500),\r
-       DEFINE_VIDEOFORMATDESC(1920, 1080, video_update_format::progressive,            30/1.001,       TEXT("1080p2997"),      video_format::x1080p2997),\r
-       DEFINE_VIDEOFORMATDESC(1920, 1080, video_update_format:: progressive,   30,                     TEXT("1080p3000"),      video_format::x1080p3000)\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 ), \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),\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),\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)\r
 };\r
 \r
-video_format::type get_video_format(const std::wstring& name)\r
+const video_format_desc& video_format_desc::get(video_format::type format)     \r
+{\r
+       return format_descs[format];\r
+}\r
+\r
+const video_format_desc& video_format_desc::get(const std::wstring& name)      \r
 {\r
-       for(int n = 0; n < video_format::count; ++n)\r
+       for(int n = 0; n < video_format::invalid; ++n)\r
        {\r
-               if(boost::iequals(video_format_desc::format_descs[n].name, name))\r
-                       return static_cast<video_format::type>(n);\r
+               if(boost::iequals(format_descs[n].name, name))\r
+                       return format_descs[n];\r
        }\r
-\r
-       return video_format::invalid;\r
+       return format_descs[video_format::invalid];\r
 }\r
 \r
 }}\r
index efa1b239ee230ec55f38ece7c4637a6e6478743f..9c6605ea202ea97b12c4726a4c446263ea8f7c65 100644 (file)
@@ -6,10 +6,6 @@
 \r
 namespace caspar { namespace core {\r
        \r
-////////////////////////////////////////////////////////////////////////////////////////////////////\r
-/// \enum      video_format\r
-///\r
-////////////////////////////////////////////////////////////////////////////////////////////////////\r
 struct video_format \r
 { \r
        enum type\r
@@ -34,38 +30,32 @@ struct video_format
        };\r
 };\r
 \r
-////////////////////////////////////////////////////////////////////////////////////////////////////\r
-/// \enum      video_update_format\r
-///\r
-////////////////////////////////////////////////////////////////////////////////////////////////////\r
-struct video_update_format \r
+struct video_mode \r
 { \r
        enum type\r
        {\r
-                       progressive,\r
-                       lower,\r
-                       upper,\r
-                       count,\r
-                       invalid\r
+               progressive,\r
+               lower,\r
+               upper,\r
+               count,\r
+               invalid\r
        };\r
 };\r
 \r
-////////////////////////////////////////////////////////////////////////////////////////////////////\r
-/// \struct    video_format_desc\r
-///\r
-////////////////////////////////////////////////////////////////////////////////////////////////////\r
 struct video_format_desc\r
 {\r
-       video_format::type                      format;\r
+       video_format::type              format;\r
 \r
-       size_t                                          width;\r
-       size_t                                          height;\r
-       video_update_format::type       update;\r
-       double                                          fps;\r
-       size_t                                          size;\r
-       std::wstring                            name;\r
+       size_t                                  width;\r
+       size_t                                  height;\r
+       video_mode::type                mode;\r
+       double                                  fps;\r
+       double                                  period;\r
+       size_t                                  size;\r
+       std::wstring                    name;\r
 \r
-       static const video_format_desc format_descs[video_format::count];\r
+       static const video_format_desc& get(video_format::type format);\r
+       static const video_format_desc& get(const std::wstring& name);\r
 };\r
 \r
 inline bool operator==(const video_format_desc& rhs, const video_format_desc& lhs)\r
@@ -78,43 +68,10 @@ inline bool operator!=(const video_format_desc& rhs, const video_format_desc& lh
        return !(rhs == lhs);\r
 }\r
 \r
-////////////////////////////////////////////////////////////////////////////////////////////////////\r
-/// \fn        video_format get_video_format(const std::wstring& strVideoMode);\r
-///\r
-/// \brief     Gets the *video_format* associated with the specified name.\r
-///\r
-/// \param     name    Name of the *video_format*.. \r
-///\r
-/// \return    The video format. \r
-////////////////////////////////////////////////////////////////////////////////////////////////////\r
-video_format::type get_video_format(const std::wstring& name);\r
-\r
-////////////////////////////////////////////////////////////////////////////////////////////////////\r
-/// \fn        video_format get_video_format_desc(const std::wstring& strVideoMode);\r
-///\r
-/// \brief     Gets the *video_format_desc* associated with the specified name.\r
-///\r
-/// \param     name    Name of the *video_format_desc*.. \r
-///\r
-/// \return    The video format. \r
-////////////////////////////////////////////////////////////////////////////////////////////////////\r
-inline video_format_desc get_video_format_desc(const std::wstring& name, video_format::type default_format = video_format::x576p2500)\r
-{                      \r
-       auto casparVideoFormat = default_format;\r
-       if(!name.empty())\r
-               casparVideoFormat = get_video_format(name);\r
-       return video_format_desc::format_descs[casparVideoFormat];\r
-}\r
-\r
-inline double render_video_format_period(const video_format_desc& format_desc)\r
-{\r
-       return 1.0/(format_desc.update == video_update_format::progressive ? format_desc.fps : format_desc.fps/2.0);\r
-}\r
-\r
 inline std::wostream& operator<<(std::wostream& out, const video_format_desc& format_desc)\r
 {\r
-  out << format_desc.name.c_str();\r
-  return out;\r
+       out << format_desc.name.c_str();\r
+       return out;\r
 }\r
 \r
 }}
\ No newline at end of file
index f5022f308556fa995d6e3d571f4740feb9e2739e..d682777c1f323b51cbd04576beff35826a64be62 100644 (file)
@@ -33,17 +33,17 @@ struct composite_frame::implementation : boost::noncopyable
                boost::range::remove_erase(frames_, frame::empty());\r
                boost::for_each(frames_, [&](const frame_ptr& frame)\r
                {\r
-                       if(self_->audio_data().empty())\r
-                               self_->audio_data() = std::move(frame->audio_data());\r
+                       if(self_->get_audio_data().empty())\r
+                               self_->get_audio_data() = std::move(frame->get_audio_data());\r
                        else\r
                        {\r
                                tbb::parallel_for\r
                                (\r
-                                       tbb::blocked_range<size_t>(0, frame->audio_data().size()),\r
+                                       tbb::blocked_range<size_t>(0, frame->get_audio_data().size()),\r
                                        [&](const tbb::blocked_range<size_t>& r)\r
                                        {\r
                                                for(size_t n = r.begin(); n < r.end(); ++n)\r
-                                                       self_->audio_data()[n] = static_cast<short>(    static_cast<int>(self_->audio_data()[n]) + static_cast<int>(frame->audio_data()[n]) & 0xFFFF);  \r
+                                                       self_->get_audio_data()[n] = static_cast<short>(        static_cast<int>(self_->get_audio_data()[n]) + static_cast<int>(frame->get_audio_data()[n]) & 0xFFFF);  \r
                                        }\r
                                );\r
                        }\r
@@ -73,7 +73,7 @@ struct composite_frame::implementation : boost::noncopyable
        void draw(frame_shader& shader)\r
        {\r
                glPushMatrix();\r
-               glTranslated(self_->x()*2.0, self_->y()*2.0, 0.0);\r
+               glTranslated(self_->get_render_transform().pos.get<0>()*2.0, self_->get_render_transform().pos.get<1>()*2.0, 0.0);\r
                boost::range::for_each(frames_, std::bind(&frame::draw, std::placeholders::_1, shader));\r
                glPopMatrix();\r
        }\r
@@ -94,18 +94,18 @@ void composite_frame::begin_read(){impl_->begin_read();}
 void composite_frame::end_read(){impl_->end_read();}\r
 void composite_frame::draw(frame_shader& shader){impl_->draw(shader);}\r
 \r
-frame_ptr composite_frame::interlace(const frame_ptr& frame1, const frame_ptr& frame2, video_update_format::type mode)\r
+frame_ptr composite_frame::interlace(const frame_ptr& frame1, const frame_ptr& frame2, video_mode::type mode)\r
 {                      \r
        auto result = std::make_shared<composite_frame>(frame1, frame2);\r
-       if(mode == video_update_format::upper)\r
+       if(mode == video_mode::upper)\r
        {\r
-               frame1->update_fmt(video_update_format::upper);\r
-               frame2->update_fmt(video_update_format::lower);\r
+               frame1->get_render_transform().mode = video_mode::upper;\r
+               frame2->get_render_transform().mode = video_mode::lower;\r
        }\r
        else\r
        {\r
-               frame1->update_fmt(video_update_format::lower);\r
-               frame2->update_fmt(video_update_format::upper);\r
+               frame1->get_render_transform().mode = video_mode::lower;\r
+               frame2->get_render_transform().mode = video_mode::upper;\r
        }\r
        return result;\r
 }\r
index d5cbe7dd43b35310cfa6d5827e5544f615382290..1f8f3c7e88afaadcb51244ea6e56dc80b0aa830a 100644 (file)
@@ -13,7 +13,7 @@ public:
        composite_frame(const std::vector<frame_ptr>& container);\r
        composite_frame(const frame_ptr& frame1, const frame_ptr& frame2);\r
 \r
-       static frame_ptr interlace(const frame_ptr& frame1,     const frame_ptr& frame2, video_update_format::type mode);\r
+       static frame_ptr interlace(const frame_ptr& frame1,     const frame_ptr& frame2, video_mode::type mode);\r
        \r
 private:\r
 \r
index 42d674d1f784860c54a48286a7847e914711233f..4c02d6e84c9cde16edbdec20fc5b60b5745063c5 100644 (file)
@@ -9,17 +9,6 @@
 \r
 namespace caspar { namespace core {\r
        \r
-struct rectangle\r
-{\r
-       rectangle(double left, double top, double right, double bottom)\r
-               : left(left), top(top), right(right), bottom(bottom)\r
-       {}\r
-       double left;\r
-       double top;\r
-       double right;\r
-       double bottom;\r
-};\r
-\r
 GLubyte progressive_pattern[] = {\r
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\r
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\r
@@ -52,10 +41,9 @@ GLubyte lower_pattern[] = {
                                                                                                                                                                                                                                                                                                                \r
 struct frame::implementation : boost::noncopyable\r
 {\r
-       implementation(const pixel_format_desc& desc) : alpha_(1.0f), x_(0.0f), y_(0.0f), update_fmt_(video_update_format::progressive), texcoords_(0.0, 1.0, 1.0, 0.0)\r
+       implementation(const pixel_format_desc& desc) : desc_(desc)\r
        {                       \r
                std::fill(pixel_data_.begin(), pixel_data_.end(), nullptr);\r
-               desc_ = desc;\r
 \r
                for(size_t n = 0; n < desc_.planes.size(); ++n)\r
                {\r
@@ -105,14 +93,14 @@ struct frame::implementation : boost::noncopyable
        {\r
                shader.use(desc_);\r
                glPushMatrix();\r
-               glTranslated(x_*2.0, y_*2.0, 0.0);\r
-               glColor4d(1.0, 1.0, 1.0, alpha_);\r
+               glTranslated(transform_.pos.get<0>()*2.0, transform_.pos.get<1>()*2.0, 0.0);\r
+               glColor4d(1.0, 1.0, 1.0, transform_.alpha);\r
 \r
-               if(update_fmt_ == video_update_format::progressive)\r
+               if(transform_.mode == video_mode::progressive)\r
                        glPolygonStipple(progressive_pattern);\r
-               else if(update_fmt_ == video_update_format::upper)\r
+               else if(transform_.mode == video_mode::upper)\r
                        glPolygonStipple(upper_pattern);\r
-               else if(update_fmt_ == video_update_format::lower)\r
+               else if(transform_.mode == video_mode::lower)\r
                        glPolygonStipple(lower_pattern);\r
 \r
                for(size_t n = 0; n < pbo_.size(); ++n)\r
@@ -121,58 +109,44 @@ struct frame::implementation : boost::noncopyable
                        pbo_[n]->bind_texture();\r
                }\r
                glBegin(GL_QUADS);\r
-                       glTexCoord2d(texcoords_.left,   texcoords_.bottom); glVertex2d(-1.0, -1.0);\r
-                       glTexCoord2d(texcoords_.right,  texcoords_.bottom); glVertex2d( 1.0, -1.0);\r
-                       glTexCoord2d(texcoords_.right,  texcoords_.top);        glVertex2d( 1.0,  1.0);\r
-                       glTexCoord2d(texcoords_.left,   texcoords_.top);        glVertex2d(-1.0,  1.0);\r
+                       glTexCoord2d(transform_.uv.get<0>(), transform_.uv.get<3>()); glVertex2d(-1.0, -1.0);\r
+                       glTexCoord2d(transform_.uv.get<2>(), transform_.uv.get<3>()); glVertex2d( 1.0, -1.0);\r
+                       glTexCoord2d(transform_.uv.get<2>(), transform_.uv.get<1>()); glVertex2d( 1.0,  1.0);\r
+                       glTexCoord2d(transform_.uv.get<0>(), transform_.uv.get<1>()); glVertex2d(-1.0,  1.0);\r
                glEnd();\r
                glPopMatrix();\r
        }\r
 \r
        unsigned char* data(size_t index)\r
        {\r
-               return static_cast<unsigned char*>(pixel_data_.at(index));\r
+               return static_cast<unsigned char*>(pixel_data_[index]);\r
        }\r
 \r
        void reset()\r
        {\r
                audio_data_.clear();\r
-               alpha_          = 1.0f;\r
-               x_                      = 0.0f;\r
-               y_                      = 0.0f;\r
-               texcoords_      = rectangle(0.0, 1.0, 1.0, 0.0);\r
-               update_fmt_ = video_update_format::progressive;\r
+               transform_ = render_transform();\r
                end_write();\r
        }\r
 \r
        std::vector<common::gl::pixel_buffer_object_ptr> pbo_;\r
        std::array<void*, 4> pixel_data_;       \r
        std::vector<short> audio_data_;\r
-\r
-       double alpha_;\r
-       double x_;\r
-       double y_;\r
-       video_update_format::type update_fmt_;\r
-       rectangle texcoords_;\r
-\r
-       pixel_format_desc desc_;\r
+       \r
+       const pixel_format_desc desc_;\r
+       frame::render_transform transform_;\r
 };\r
-frame::frame(const pixel_format_desc& desc)\r
-       : impl_(new implementation(desc)){}\r
+frame::frame(const pixel_format_desc& desc) : impl_(new implementation(desc)){}\r
 void frame::draw(frame_shader& shader){impl_->draw(shader);}\r
 void frame::begin_write(){impl_->begin_write();}\r
 void frame::end_write(){impl_->end_write();}   \r
 void frame::begin_read(){impl_->begin_read();}\r
 void frame::end_read(){impl_->end_read();}\r
-void frame::pix_fmt(pixel_format::type format) {impl_->desc_.pix_fmt = format;}\r
 unsigned char* frame::data(size_t index){return impl_->data(index);}\r
 size_t frame::size(size_t index) const { return impl_->desc_.planes[index].size; }\r
-std::vector<short>& frame::audio_data() { return impl_->audio_data_; }\r
+std::vector<short>& frame::get_audio_data() { return impl_->audio_data_; }\r
+const std::vector<short>& frame::get_audio_data() const { return const_cast<frame*>(this)->get_audio_data(); }\r
 void frame::reset(){impl_->reset();}\r
-void frame::alpha(double value){ impl_->alpha_ = value;}\r
-void frame::translate(double x, double y) { impl_->x_ += x; impl_->y_ += y; }\r
-void frame::texcoords(double left, double top, double right, double bottom){impl_->texcoords_ = rectangle(left, top, right, bottom);}\r
-void frame::update_fmt(video_update_format::type fmt){ impl_->update_fmt_ = fmt;}\r
-double frame::x() const { return impl_->x_;}\r
-double frame::y() const { return impl_->y_;}\r
+frame::render_transform& frame::get_render_transform() { return impl_->transform_;}\r
+const frame::render_transform& frame::get_render_transform() const { return const_cast<frame*>(this)->get_render_transform();}\r
 }}
\ No newline at end of file
index a7241609f684861ffe371d4eb463b1d860976af8..9e1cb7db0f08448f4488ed6aa5cdcf35b3e36aa9 100644 (file)
@@ -9,36 +9,40 @@
 #include <array>\r
 \r
 #include <boost/noncopyable.hpp>\r
-\r
 #include <boost/tuple/tuple.hpp>\r
 \r
 #include <vector>\r
 \r
 namespace caspar { namespace core {\r
        \r
-class frame :  boost::noncopyable\r
+class frame : boost::noncopyable\r
 {\r
 public:\r
+       \r
+       struct render_transform\r
+       {\r
+               render_transform() : alpha(1.0), pos(boost::make_tuple(0.0, 0.0)), uv(boost::make_tuple(0.0, 1.0, 1.0, 0.0)), mode(video_mode::progressive){}\r
+               double alpha;\r
+               boost::tuple<double, double> pos;\r
+               boost::tuple<double, double, double, double> uv;\r
+               video_mode::type mode; \r
+       };\r
+\r
        virtual ~frame(){}\r
                        \r
        virtual unsigned char* data(size_t index = 0);\r
        virtual size_t size(size_t index = 0) const;\r
                                \r
-       virtual std::vector<short>& audio_data();\r
-\r
-       virtual void alpha(double value);\r
-       virtual void translate(double x, double y);\r
-       virtual void texcoords(double left, double top, double right, double bottom);\r
-       virtual void update_fmt(video_update_format::type fmt); \r
-       virtual void pix_fmt(pixel_format::type fmt);\r
+       virtual std::vector<short>& get_audio_data();\r
+       const std::vector<short>& get_audio_data() const;\r
        \r
-       virtual double x() const;\r
-       virtual double y() const;\r
-\r
-       static std::shared_ptr<frame> empty()\r
+       virtual render_transform& get_render_transform();\r
+       const render_transform& get_render_transform() const;\r
+       \r
+       static std::shared_ptr<frame>& empty()\r
        {\r
-               static auto my_null_frame = std::shared_ptr<frame>(new frame(pixel_format_desc()));\r
-               return my_null_frame;\r
+               static auto empty_frame = std::shared_ptr<frame>(new frame(pixel_format_desc()));\r
+               return empty_frame;\r
        }\r
 \r
 protected:\r
@@ -53,10 +57,10 @@ protected:
        virtual void end_write();\r
        virtual void begin_read();\r
        virtual void end_read();\r
+\r
        virtual void draw(frame_shader& shader);\r
 \r
 private:\r
-\r
        struct implementation;\r
        std::shared_ptr<implementation> impl_;\r
 };\r
index b6b00882b7f0a6d81a45b9520a7025567d64bb65..304a71fcbe48e39caddb7ca3888d4b9b486071a4 100644 (file)
@@ -59,15 +59,13 @@ struct frame_processor_device::implementation : boost::noncopyable
                if(!pool->try_pop(my_frame))            \r
                        my_frame = executor_.invoke([&]{return std::shared_ptr<frame>(new frame(desc));});              \r
                \r
-               auto destructor = [=]\r
-               {\r
-                       my_frame->reset();\r
-                       pool->push(my_frame);\r
-               };\r
-\r
                return frame_ptr(my_frame.get(), [=](frame*)\r
                {\r
-                       executor_.begin_invoke(destructor);\r
+                       executor_.begin_invoke([=]\r
+                       {\r
+                               my_frame->reset();\r
+                               pool->push(my_frame);\r
+                       });\r
                });\r
        }\r
                \r
@@ -107,7 +105,7 @@ struct frame_processor_device::implementation : boost::noncopyable
        std::unique_ptr<frame_renderer> renderer_;\r
                                \r
        tbb::concurrent_bounded_queue<boost::shared_future<frame_ptr>> output_; \r
-       tbb::concurrent_unordered_map<pixel_format_desc, tbb::concurrent_bounded_queue<frame_ptr>, pixel_format_desc_hash> frame_pools_;\r
+       tbb::concurrent_unordered_map<pixel_format_desc, tbb::concurrent_bounded_queue<frame_ptr>, std::hash<pixel_format_desc>> frame_pools_;\r
        \r
        video_format_desc fmt_;\r
        long underrun_count_;\r
index 62d904b9674fc4b7de51366de3f82fa9b338bb59..7be445855543887dd8ea90e504b104ae4c0a847b 100644 (file)
@@ -38,7 +38,7 @@ public:
        void clear();\r
        \r
        frame_ptr create_frame(const pixel_format_desc& desc);          \r
-       frame_ptr create_frame(size_t width, size_t heightg);                   \r
+       frame_ptr create_frame(size_t width, size_t height);                    \r
        frame_ptr create_frame();\r
        \r
        const video_format_desc& get_video_format_desc() const;\r
index 6413c462ac22bf99cdfdc39df4dc0744084638ac..5c9be9b4fdcf4ff4942a4cea08ada8c0977ab642 100644 (file)
@@ -64,7 +64,7 @@ struct frame_renderer::implementation : boost::noncopyable
                        \r
                        // Read from framebuffer into page-locked memory.\r
                        output_frame_->begin_read();\r
-                       output_frame_->audio_data() = std::move(writing_[next_index]->audio_data());\r
+                       output_frame_->get_audio_data() = std::move(writing_[next_index]->get_audio_data());\r
                        \r
                        // Return frames to pool.\r
                        //writing_[next_index]->end_write(); // Is done in frame->reset();\r
index 6fe1e7a6e2b2b75b07f5cefa5bbd23462b0a8aa2..556127788a6f290d1148bfc0f936e82282110289 100644 (file)
@@ -74,20 +74,18 @@ public:
 \r
        void initialize(const frame_processor_device_ptr& frame_processor)\r
        {\r
-               frame_processor_ = frame_processor;\r
                auto frame = frame_processor->create_frame();\r
                __stosd(reinterpret_cast<unsigned long*>(frame->data()), color_value_, frame->size() / sizeof(unsigned long));\r
                frame_ = frame;\r
        }\r
        \r
-       std::wstring print()\r
+       std::wstring print() const\r
        {\r
                std::wstringstream str;\r
                str << L"color_producer " << color_str_ << L".";\r
                return str.str();\r
        }\r
 \r
-       frame_processor_device_ptr frame_processor_;\r
        frame_ptr frame_;\r
        unsigned int color_value_;\r
        std::wstring color_str_;\r
index ac38941f2c80b21479ee0141f34e946d0222b0d4..12bc168967187a4697fda0dd6cd7afcb64b16cc7 100644 (file)
@@ -111,7 +111,7 @@ public:
                                        CASPAR_LOG(warning) << "### File read underflow has STARTED.";\r
 \r
                                // Return last frame without audio.\r
-                               last_frame_->audio_data().clear();\r
+                               last_frame_->get_audio_data().clear();\r
                                return last_frame_;\r
                        }\r
                        else if(underrun_count_ > 0)\r
@@ -124,7 +124,7 @@ public:
                        {\r
                                if(has_audio_ && video_frame_channel_.front() != nullptr)\r
                                {\r
-                                       video_frame_channel_.front()->audio_data() = std::move(audio_chunk_channel_.front());\r
+                                       video_frame_channel_.front()->get_audio_data() = std::move(audio_chunk_channel_.front());\r
                                        audio_chunk_channel_.pop_front();\r
                                }\r
                                \r
@@ -145,7 +145,7 @@ public:
                return last_frame_;\r
        }\r
 \r
-       std::wstring print()\r
+       std::wstring print() const\r
        {\r
                std::wstringstream str;\r
                str << L"ffmpeg_producer " << filename_ << L".";\r
index ccf7ce6474e0f2237af0a483649015127dd28e9c..ec5e7d5bab83a0261a6c843ba58dd6423b32bfe4 100644 (file)
@@ -147,7 +147,7 @@ struct video_transformer::implementation : boost::noncopyable
 \r
                // TODO: Make generic for all formats and modes.\r
                if(codec_context_->codec_id == CODEC_ID_DVVIDEO) // Move up one field\r
-                       result_frame->translate(0.0f, 1.0/static_cast<double>(frame_processor_->get_video_format_desc().height));\r
+                       result_frame->get_render_transform().pos = boost::make_tuple(0.0f, 1.0/static_cast<double>(frame_processor_->get_video_format_desc().height));\r
                \r
                return result_frame;\r
        }\r
index 8bc08a65d64c382bc753daf148d0135763fc02bb..e6c3f5577975eeee212d25f062bcca3a57d15b03 100644 (file)
@@ -223,7 +223,7 @@ struct flash_producer::implementation
                        }\r
 \r
                        auto format_desc = frame_processor_->get_video_format_desc();\r
-                       bool is_progressive = format_desc.update == video_update_format::progressive || (flashax_container_->GetFPS() - format_desc.fps/2 == 0);\r
+                       bool is_progressive = format_desc.mode == video_mode::progressive || (flashax_container_->GetFPS() - format_desc.fps/2 == 0);\r
 \r
                        frame_ptr result;\r
 \r
@@ -233,7 +233,7 @@ struct flash_producer::implementation
                        {\r
                                frame_ptr frame1 = do_render_frame();\r
                                frame_ptr frame2 = do_render_frame();\r
-                               result = composite_frame::interlace(frame1, frame2, format_desc.update);\r
+                               result = composite_frame::interlace(frame1, frame2, format_desc.mode);\r
                        }\r
 \r
                        frame_buffer_.push(result);\r
@@ -264,7 +264,7 @@ struct flash_producer::implementation
        frame_ptr render_frame()\r
        {\r
                if(!frame_buffer_.try_pop(last_frame_) && is_empty_)\r
-                       return frame::empty();\r
+                       last_frame_ = frame::empty();\r
                \r
                return last_frame_;\r
        }\r
index 0222a183772010a93b4cc37d97ddddeb7cde51b3..020475d3647a5d0c089d415cfa02d7c4dd207085 100644 (file)
@@ -71,8 +71,14 @@ public:
        ////////////////////////////////////////////////////////////////////////////////////////////////////\r
        virtual void initialize(const frame_processor_device_ptr& frame_processor) = 0;\r
 \r
-       virtual std::wstring print() { return L"Unknown frame_producer.";}\r
+       virtual std::wstring print() const { return L"Unknown frame_producer.";}\r
 };\r
 typedef std::shared_ptr<frame_producer> frame_producer_ptr;\r
 \r
+inline std::wostream& operator<<(std::wostream& out, const frame_producer& producer)\r
+{\r
+       out << producer.print().c_str();\r
+       return out;\r
+}\r
+\r
 }}
\ No newline at end of file
index e923d2fb57cb847d94843d16568a99429fb073e6..dfb8a444c21747b77c8aa705bcd9cffe761829f5 100644 (file)
@@ -114,12 +114,12 @@ struct image_scroll_producer : public frame_producer
                \r
        frame_ptr render_frame()\r
        {               \r
-               if(format_desc_.update != video_update_format::progressive)                             \r
+               if(format_desc_.mode != video_mode::progressive)                                \r
                {\r
                        frame_ptr frame1;\r
                        frame_ptr frame2;\r
                        tbb::parallel_invoke([&]{ frame1 = do_render_frame(); }, [&]{ frame2 = do_render_frame(); });\r
-                       return composite_frame::interlace(frame1, frame2, format_desc_.update);\r
+                       return composite_frame::interlace(frame1, frame2, format_desc_.mode);\r
                }                       \r
 \r
                return render_frame();  \r
index d04c36dd1071e0e6514711fddd13cc4480ef673d..c430308d69dec9d3404e8172afb69828b39331d4 100644 (file)
@@ -23,7 +23,7 @@ struct layer::implementation
                        foreground_ = nullptr;  \r
                        last_frame_ = frame_producer->render_frame();\r
                        if(last_frame_ != nullptr)\r
-                               last_frame_->audio_data().clear(); // No audio\r
+                               last_frame_->get_audio_data().clear(); // No audio\r
                }\r
                else if(option == load_option::auto_play)\r
                        play();                 \r
@@ -76,7 +76,7 @@ struct layer::implementation
                catch(...)\r
                {\r
                        CASPAR_LOG_CURRENT_EXCEPTION();\r
-                       CASPAR_LOG(warning) << L"Removed " << (foreground_ ? foreground_->print() : L"frame_producer") << L" from layer.";\r
+                       CASPAR_LOG(warning) << L"Removed " << (foreground_ ? foreground_->print() : L"null producer") << L" from layer.";\r
                        foreground_ = nullptr;\r
                        last_frame_ = nullptr;\r
                }\r
index 0b1a937b0d8689e6770271fee634fb7049a667c7..1cb6b00f5e3b9bf14afe570f26f72c59bf06f8fa 100644 (file)
@@ -124,8 +124,8 @@ struct transition_producer::implementation : boost::noncopyable
                if(!frame)\r
                        return;\r
 \r
-               for(size_t n = 0; n < frame->audio_data().size(); ++n)\r
-                       frame->audio_data()[n] = static_cast<short>((static_cast<int>(frame->audio_data()[n])*volume)>>8);\r
+               for(size_t n = 0; n < frame->get_audio_data().size(); ++n)\r
+                       frame->get_audio_data()[n] = static_cast<short>((static_cast<int>(frame->get_audio_data()[n])*volume)>>8);\r
        }\r
                \r
        frame_ptr compose(const frame_ptr& dest_frame, frame_ptr src_frame) \r
@@ -146,40 +146,40 @@ struct transition_producer::implementation : boost::noncopyable
                );\r
                \r
                if(info_.type == transition::mix)\r
-                       dest_frame->alpha(alpha);               \r
+                       dest_frame->get_render_transform().alpha = alpha;               \r
                else if(info_.type == transition::slide)\r
                {       \r
                        if(info_.direction == transition_direction::from_left)                  \r
-                               dest_frame->translate(-1.0+alpha, 0.0);                 \r
+                               dest_frame->get_render_transform().pos = boost::make_tuple(-1.0+alpha, 0.0);                    \r
                        else if(info_.direction == transition_direction::from_right)\r
-                               dest_frame->translate(1.0-alpha, 0.0);          \r
+                               dest_frame->get_render_transform().pos = boost::make_tuple(1.0-alpha, 0.0);             \r
                }\r
                else if(info_.type == transition::push)\r
                {\r
                        if(info_.direction == transition_direction::from_left)          \r
                        {\r
-                               dest_frame->translate(-1.0+alpha, 0.0);\r
+                               dest_frame->get_render_transform().pos = boost::make_tuple(-1.0+alpha, 0.0);\r
                                if(src_frame)\r
-                                       src_frame->translate(0.0+alpha, 0.0);\r
+                                       src_frame->get_render_transform().pos = boost::make_tuple(0.0+alpha, 0.0);\r
                        }\r
                        else if(info_.direction == transition_direction::from_right)\r
                        {\r
-                               dest_frame->translate(1.0-alpha, 0.0);\r
+                               dest_frame->get_render_transform().pos = boost::make_tuple(1.0-alpha, 0.0);\r
                                if(src_frame)\r
-                                       src_frame->translate(0.0-alpha, 0.0);\r
+                                       src_frame->get_render_transform().pos = boost::make_tuple(0.0-alpha, 0.0);\r
                        }\r
                }\r
                else if(info_.type == transition::wipe)\r
                {\r
                        if(info_.direction == transition_direction::from_left)          \r
                        {\r
-                               dest_frame->translate(-1.0+alpha, 0.0);\r
-                               dest_frame->texcoords(-1.0+alpha, 1.0, alpha, 0.0);\r
+                               dest_frame->get_render_transform().pos = boost::make_tuple(-1.0+alpha, 0.0);\r
+                               dest_frame->get_render_transform().uv = boost::make_tuple(-1.0+alpha, 1.0, alpha, 0.0);\r
                        }\r
                        else if(info_.direction == transition_direction::from_right)\r
                        {\r
-                               dest_frame->translate(1.0-alpha, 0.0);\r
-                               dest_frame->texcoords(1.0-alpha, 1.0, 2.0-alpha, 0.0);\r
+                               dest_frame->get_render_transform().pos = boost::make_tuple(1.0-alpha, 0.0);\r
+                               dest_frame->get_render_transform().uv = boost::make_tuple(1.0-alpha, 1.0, 2.0-alpha, 0.0);\r
                        }\r
                }\r
                                                \r
index 3e62f131ec339ae6ca5b4abbc2208dc3f3e6d83c..fa5523c8034360cecc1dcac68beb6b6f97bb65bd 100644 (file)
@@ -15,6 +15,7 @@
 #include "protocol/CLK/CLKProtocolStrategy.h"\r
 #include "producer/flash/FlashAxContainer.h"\r
 \r
+#include "../common/exception/exceptions.h"\r
 #include "../common/io/AsyncEventServer.h"\r
 #include "../common/utility/string_convert.h"\r
 \r
@@ -73,7 +74,9 @@ struct server::implementation : boost::noncopyable
                using boost::property_tree::ptree;\r
                BOOST_FOREACH(auto& xml_channel, pt.get_child("configuration.channels"))\r
                {               \r
-                       auto format_desc = get_video_format_desc(common::widen(xml_channel.second.get("videomode", "PAL")));                    \r
+                       auto format_desc = video_format_desc::get(common::widen(xml_channel.second.get("videomode", "PAL")));           \r
+                       if(format_desc.format == video_format::invalid)\r
+                               BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Invalid videomode."));\r
                        std::vector<frame_consumer_ptr> consumers;\r
 \r
                        BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child("consumers"))\r