return renderer_(std::move(items_), format_desc);\r
}\r
\r
- virtual core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode)\r
+ virtual core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc)\r
{\r
std::vector<array<std::uint8_t>> buffers;\r
BOOST_FOREACH(auto& plane, desc.planes)\r
auto buf = spl::make_shared<buffer>(plane.size);\r
buffers.push_back(array<std::uint8_t>(buf->data(), plane.size, true, buf));\r
}\r
- return core::mutable_frame(std::move(buffers), core::audio_buffer(), tag, desc, frame_rate, field_mode);\r
+ return core::mutable_frame(std::move(buffers), core::audio_buffer(), tag, desc);\r
}\r
};\r
\r
boost::unique_future<array<const std::uint8_t>> image_mixer::operator()(const core::video_format_desc& format_desc){return impl_->render(format_desc);}\r
void image_mixer::begin_layer(core::blend_mode blend_mode){impl_->begin_layer(blend_mode);}\r
void image_mixer::end_layer(){impl_->end_layer();}\r
-core::mutable_frame image_mixer::create_frame(const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) {return impl_->create_frame(tag, desc, frame_rate, field_mode);}\r
+core::mutable_frame image_mixer::create_frame(const void* tag, const core::pixel_format_desc& desc) {return impl_->create_frame(tag, desc);}\r
\r
}}}
\ No newline at end of file
\r
boost::unique_future<array<const std::uint8_t>> operator()(const core::video_format_desc& format_desc) override;\r
\r
- core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) override;\r
+ core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc) override;\r
\r
// Properties\r
\r
struct item\r
{\r
core::pixel_format_desc pix_desc;\r
- core::field_mode field_mode;\r
std::vector<future_texture> textures;\r
core::image_transform transform;\r
\r
item()\r
: pix_desc(core::pixel_format::invalid)\r
- , field_mode(core::field_mode::empty)\r
{\r
}\r
};\r
std::shared_ptr<texture>& layer_key_texture,\r
const core::video_format_desc& format_desc,\r
core::field_mode field_mode)\r
- { \r
- // Fix frames \r
- BOOST_FOREACH(auto& item, layer.items) \r
- {\r
+ { \r
+ // REMOVED: This is done in frame_muxer. \r
+ // Fix frames\r
+ //BOOST_FOREACH(auto& item, layer.items) \r
+ //{\r
//if(std::abs(item.transform.fill_scale[1]-1.0) > 1.0/target_texture->height() ||\r
// std::abs(item.transform.fill_translation[1]) > 1.0/target_texture->height()) \r
// CASPAR_LOG(warning) << L"[image_mixer] Frame should be deinterlaced. Send FILTER DEINTERLACE_BOB when creating producer."; \r
\r
- if(item.pix_desc.planes.at(0).height == 480) // NTSC DV\r
- {\r
- item.transform.fill_translation[1] += 2.0/static_cast<double>(format_desc.height);\r
- item.transform.fill_scale[1] *= 1.0 - 6.0*1.0/static_cast<double>(format_desc.height);\r
- }\r
+ //if(item.pix_desc.planes.at(0).height == 480) // NTSC DV\r
+ //{\r
+ // item.transform.fill_translation[1] += 2.0/static_cast<double>(format_desc.height);\r
+ // item.transform.fill_scale[1] *= 1.0 - 6.0*1.0/static_cast<double>(format_desc.height);\r
+ //}\r
\r
- // Fix field-order if needed\r
- if(item.field_mode == core::field_mode::lower && format_desc.field_mode == core::field_mode::upper)\r
- item.transform.fill_translation[1] += 1.0/static_cast<double>(format_desc.height);\r
- else if(item.field_mode == core::field_mode::upper && format_desc.field_mode == core::field_mode::lower)\r
- item.transform.fill_translation[1] -= 1.0/static_cast<double>(format_desc.height);\r
- }\r
+ //// Fix field-order if needed\r
+ //if(item.field_mode == core::field_mode::lower && format_desc.field_mode == core::field_mode::upper)\r
+ // item.transform.fill_translation[1] += 1.0/static_cast<double>(format_desc.height);\r
+ //else if(item.field_mode == core::field_mode::upper && format_desc.field_mode == core::field_mode::lower)\r
+ // item.transform.fill_translation[1] -= 1.0/static_cast<double>(format_desc.height);\r
+ //}\r
\r
// Mask out fields\r
BOOST_FOREACH(auto& item, layer.items) \r
\r
item item;\r
item.pix_desc = frame.pixel_format_desc();\r
- item.field_mode = frame.field_mode();\r
item.transform = transform_stack_.back();\r
\r
// NOTE: Once we have copied the arrays they are no longer valid for reading!!! Check for alternative solution e.g. transfer with AMD_pinned_memory.\r
return renderer_(std::move(layers_), format_desc);\r
}\r
\r
- core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) override\r
+ core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc) override\r
{\r
std::vector<array<std::uint8_t>> buffers;\r
BOOST_FOREACH(auto& plane, desc.planes) \r
buffers.push_back(ogl_->create_array(plane.size)); \r
\r
- return core::mutable_frame(std::move(buffers), core::audio_buffer(), tag, desc, frame_rate, field_mode);\r
+ return core::mutable_frame(std::move(buffers), core::audio_buffer(), tag, desc);\r
}\r
};\r
\r
boost::unique_future<array<const std::uint8_t>> image_mixer::operator()(const core::video_format_desc& format_desc){return impl_->render(format_desc);}\r
void image_mixer::begin_layer(core::blend_mode blend_mode){impl_->begin_layer(blend_mode);}\r
void image_mixer::end_layer(){impl_->end_layer();}\r
-core::mutable_frame image_mixer::create_frame(const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) {return impl_->create_frame(tag, desc, frame_rate, field_mode);}\r
+core::mutable_frame image_mixer::create_frame(const void* tag, const core::pixel_format_desc& desc) {return impl_->create_frame(tag, desc);}\r
\r
}}}
\ No newline at end of file
// Methods\r
\r
boost::unique_future<array<const std::uint8_t>> operator()(const core::video_format_desc& format_desc) override; \r
- core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) override;\r
+ core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc) override;\r
\r
// core::image_mixer\r
\r
\r
struct mutable_frame::impl : boost::noncopyable\r
{ \r
- std::vector<array<std::uint8_t>> buffers_;\r
+ std::vector<array<std::uint8_t>> buffers_;\r
core::audio_buffer audio_data_;\r
const core::pixel_format_desc desc_;\r
const void* tag_;\r
- double frame_rate_;\r
- core::field_mode field_mode_;\r
\r
- impl(std::vector<array<std::uint8_t>> buffers, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) \r
+ impl(std::vector<array<std::uint8_t>> buffers, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc) \r
: buffers_(std::move(buffers))\r
, audio_data_(std::move(audio_buffer))\r
, desc_(desc)\r
, tag_(tag)\r
- , frame_rate_(frame_rate)\r
- , field_mode_(field_mode)\r
{\r
BOOST_FOREACH(auto& buffer, buffers_)\r
if(!buffer.data())\r
}\r
};\r
\r
-mutable_frame::mutable_frame(std::vector<array<std::uint8_t>> image_buffers, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) \r
- : impl_(new impl(std::move(image_buffers), std::move(audio_buffer), tag, desc, frame_rate, field_mode)){}\r
+mutable_frame::mutable_frame(std::vector<array<std::uint8_t>> image_buffers, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc) \r
+ : impl_(new impl(std::move(image_buffers), std::move(audio_buffer), tag, desc)){}\r
mutable_frame::~mutable_frame(){}\r
mutable_frame::mutable_frame(mutable_frame&& other) : impl_(std::move(other.impl_)){}\r
mutable_frame& mutable_frame::operator=(mutable_frame&& other)\r
const core::audio_buffer& mutable_frame::audio_data() const{return impl_->audio_data_;}\r
array<std::uint8_t>& mutable_frame::image_data(std::size_t index){return impl_->buffers_.at(index);}\r
core::audio_buffer& mutable_frame::audio_data(){return impl_->audio_data_;}\r
-double mutable_frame::frame_rate() const{return impl_->frame_rate_;}\r
-core::field_mode mutable_frame::field_mode() const{return impl_->field_mode_;}\r
std::size_t mutable_frame::width() const{return impl_->desc_.planes.at(0).width;}\r
std::size_t mutable_frame::height() const{return impl_->desc_.planes.at(0).height;} \r
const void* mutable_frame::stream_tag()const{return impl_->tag_;} \r
core::audio_buffer audio_data_;\r
const core::pixel_format_desc desc_;\r
const void* tag_;\r
- double frame_rate_;\r
- core::field_mode field_mode_;\r
\r
impl(const void* tag)\r
: desc_(core::pixel_format::invalid)\r
, tag_(tag) \r
, id_(0)\r
- , field_mode_(core::field_mode::empty)\r
{\r
}\r
\r
- impl(boost::shared_future<array<const std::uint8_t>> image, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) \r
+ impl(boost::shared_future<array<const std::uint8_t>> image, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc) \r
: audio_data_(std::move(audio_buffer))\r
, desc_(desc)\r
, tag_(tag)\r
, id_(reinterpret_cast<int>(this))\r
- , frame_rate_(frame_rate)\r
- , field_mode_(field_mode)\r
{\r
if(desc.format != core::pixel_format::bgra)\r
BOOST_THROW_EXCEPTION(not_implemented());\r
, desc_(other.pixel_format_desc())\r
, tag_(other.stream_tag())\r
, id_(reinterpret_cast<int>(this))\r
- , frame_rate_(other.frame_rate())\r
- , field_mode_(other.field_mode())\r
{\r
for(std::size_t n = 0; n < desc_.planes.size(); ++n)\r
{\r
};\r
\r
const_frame::const_frame(const void* tag) : impl_(new impl(tag)){}\r
-const_frame::const_frame(boost::shared_future<array<const std::uint8_t>> image, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) \r
- : impl_(new impl(std::move(image), std::move(audio_buffer), tag, desc, frame_rate, field_mode)){}\r
+const_frame::const_frame(boost::shared_future<array<const std::uint8_t>> image, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc) \r
+ : impl_(new impl(std::move(image), std::move(audio_buffer), tag, desc)){}\r
const_frame::const_frame(mutable_frame&& other) : impl_(new impl(std::move(other))){}\r
const_frame::~const_frame(){}\r
const_frame::const_frame(const_frame&& other) : impl_(std::move(other.impl_)){}\r
const core::pixel_format_desc& const_frame::pixel_format_desc()const{return impl_->desc_;}\r
array<const std::uint8_t> const_frame::image_data(int index)const{return impl_->image_data(index);}\r
const core::audio_buffer& const_frame::audio_data()const{return impl_->audio_data_;}\r
-double const_frame::frame_rate()const{return impl_->frame_rate_;}\r
-core::field_mode const_frame::field_mode()const{return impl_->field_mode_;}\r
std::size_t const_frame::width()const{return impl_->width();}\r
std::size_t const_frame::height()const{return impl_->height();} \r
std::size_t const_frame::size()const{return impl_->size();} \r
explicit mutable_frame(std::vector<array<std::uint8_t>> image_buffers, \r
audio_buffer audio_buffer, \r
const void* tag, \r
- const struct pixel_format_desc& desc, \r
- double frame_rate, \r
- core::field_mode field_mode);\r
+ const struct pixel_format_desc& desc);\r
~mutable_frame();\r
\r
// Methods\r
array<std::uint8_t>& image_data(std::size_t index = 0);\r
core::audio_buffer& audio_data();\r
\r
- double frame_rate() const;\r
- core::field_mode field_mode() const;\r
-\r
std::size_t width() const;\r
std::size_t height() const;\r
\r
explicit const_frame(boost::shared_future<array<const std::uint8_t>> image, \r
audio_buffer audio_buffer, \r
const void* tag, \r
- const struct pixel_format_desc& desc, \r
- double frame_rate, \r
- core::field_mode field_mode);\r
+ const struct pixel_format_desc& desc);\r
const_frame(mutable_frame&& other);\r
~const_frame();\r
\r
array<const std::uint8_t> image_data(int index = 0) const;\r
const core::audio_buffer& audio_data() const;\r
\r
- double frame_rate() const;\r
- core::field_mode field_mode() const;\r
-\r
std::size_t width() const;\r
std::size_t height() const;\r
std::size_t size() const;\r
\r
#include <common/memory.h>\r
\r
-#include <core/video_format.h>\r
-\r
namespace caspar { namespace core {\r
\r
class frame_factory : boost::noncopyable\r
\r
// Methods\r
\r
- virtual class mutable_frame create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) = 0; \r
- class mutable_frame create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc)\r
- {\r
- auto format_desc = video_format_desc();\r
- return create_frame(video_stream_tag, desc, format_desc.fps, format_desc.field_mode);\r
- }\r
+ virtual class mutable_frame create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc) = 0; \r
\r
// Properties\r
};\r
\r
virtual boost::unique_future<array<const std::uint8_t>> operator()(const struct video_format_desc& format_desc) = 0;\r
\r
- virtual class mutable_frame create_frame(const void* tag, const struct pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) = 0;\r
+ virtual class mutable_frame create_frame(const void* tag, const struct pixel_format_desc& desc) = 0;\r
\r
// Properties\r
};\r
\r
auto desc = core::pixel_format_desc(core::pixel_format::bgra);\r
desc.planes.push_back(core::pixel_format_desc::plane(format_desc.width, format_desc.height, 4));\r
- return const_frame(std::move(image), std::move(audio), this, desc, format_desc.fps, format_desc.field_mode); \r
+ return const_frame(std::move(image), std::move(audio), this, desc); \r
}\r
catch(...)\r
{\r
void mixer::set_blend_mode(int index, blend_mode value){impl_->set_blend_mode(index, value);}\r
boost::unique_future<boost::property_tree::wptree> mixer::info() const{return impl_->info();}\r
const_frame mixer::operator()(std::map<int, draw_frame> frames, const struct video_format_desc& format_desc){return (*impl_)(std::move(frames), format_desc);}\r
-mutable_frame mixer::create_frame(const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) {return impl_->image_mixer_->create_frame(tag, desc, frame_rate, field_mode);}\r
+mutable_frame mixer::create_frame(const void* tag, const core::pixel_format_desc& desc) {return impl_->image_mixer_->create_frame(tag, desc);}\r
}}
\ No newline at end of file
\r
void set_blend_mode(int index, blend_mode value);\r
\r
- class mutable_frame create_frame(const void* tag, const struct pixel_format_desc& desc, double frame_rate, core::field_mode field_mode);\r
+ class mutable_frame create_frame(const void* tag, const struct pixel_format_desc& desc);\r
\r
// Properties\r
\r
display_mode_ = display_mode::simple;\r
}\r
\r
+ if(frame->height == 480)\r
+ {\r
+ auto pad_str = L"PAD=" + boost::lexical_cast<std::wstring>(frame->width) + L":486:0:2:black";\r
+ filter_str = append_filter(filter_str, pad_str);\r
+ }\r
+\r
filter_ = filter(filter_str);\r
CASPAR_LOG(info) << L"[frame_muxer] " << display_mode_ << L" " << print_mode(frame->width, frame->height, in_fps_, frame->interlaced_frame > 0);\r
}\r
\r
auto target_desc = pixel_format_desc(target_pix_fmt, width, height);\r
\r
- auto write = frame_factory.create_frame(tag, target_desc, fps, get_mode(*decoded_frame));\r
+ auto write = frame_factory.create_frame(tag, target_desc);\r
\r
std::shared_ptr<SwsContext> sws_context;\r
\r
}\r
else\r
{\r
- auto write = frame_factory.create_frame(tag, desc, fps, get_mode(*decoded_frame));\r
+ auto write = frame_factory.create_frame(tag, desc);\r
\r
for(int n = 0; n < static_cast<int>(desc.planes.size()); ++n)\r
{\r
\r
core::pixel_format_desc desc = core::pixel_format::bgra;\r
desc.planes.push_back(core::pixel_format_desc::plane(width_, height_, 4));\r
- auto frame = frame_factory_->create_frame(this, desc, fps(), core::field_mode::progressive);\r
+ auto frame = frame_factory_->create_frame(this, desc);\r
\r
A_memcpy(frame.image_data(0).begin(), bmp_.data(), width_*height_*4);\r
head_ = core::draw_frame(std::move(frame)); \r