本文整理汇总了C++中tbb::concurrent_bounded_queue::set_capacity方法的典型用法代码示例。如果您正苦于以下问题:C++ concurrent_bounded_queue::set_capacity方法的具体用法?C++ concurrent_bounded_queue::set_capacity怎么用?C++ concurrent_bounded_queue::set_capacity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tbb::concurrent_bounded_queue
的用法示例。
在下文中一共展示了concurrent_bounded_queue::set_capacity方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
channel_consumer()
: consumer_index_(next_consumer_index())
, first_frame_available_(first_frame_promise_.get_future())
, first_frame_reported_(false)
{
is_running_ = true;
current_age_ = 0;
frame_buffer_.set_capacity(3);
}
示例2:
oal_consumer()
: container_(16)
, channel_index_(-1)
, started_(false)
, channel_layout_(
core::default_channel_layout_repository().get_by_name(
L"STEREO"))
{
graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f));
graph_->set_color("dropped-frame", diagnostics::color(0.3f, 0.6f, 0.3f));
diagnostics::register_graph(graph_);
is_running_ = true;
presentation_age_ = 0;
input_.set_capacity(2);
}
示例3:
decklink_producer(const core::video_format_desc& format_desc, size_t device_index, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filter)
: decklink_(get_device(device_index))
, input_(decklink_)
, attributes_(decklink_)
, model_name_(get_model_name(decklink_))
, device_index_(device_index)
, filter_(filter)
, format_desc_(format_desc)
, audio_cadence_(format_desc.audio_cadence)
, muxer_(format_desc.fps, frame_factory, filter)
, sync_buffer_(format_desc.audio_cadence.size())
, frame_factory_(frame_factory)
{
hints_ = 0;
frame_buffer_.set_capacity(2);
graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f));
graph_->set_color("late-frame", diagnostics::color(0.6f, 0.3f, 0.3f));
graph_->set_color("frame-time", diagnostics::color(1.0f, 0.0f, 0.0f));
graph_->set_color("dropped-frame", diagnostics::color(0.3f, 0.6f, 0.3f));
graph_->set_color("output-buffer", diagnostics::color(0.0f, 1.0f, 0.0f));
graph_->set_text(print());
diagnostics::register_graph(graph_);
auto display_mode = get_display_mode(input_, format_desc_.format, bmdFormat8BitYUV, bmdVideoInputFlagDefault);
// NOTE: bmdFormat8BitARGB is currently not supported by any decklink card. (2011-05-08)
if(FAILED(input_->EnableVideoInput(display_mode, bmdFormat8BitYUV, bmdVideoInputFlagDefault)))
BOOST_THROW_EXCEPTION(caspar_exception()
<< msg_info(narrow(print()) + " Could not enable video input.")
<< boost::errinfo_api_function("EnableVideoInput"));
if(FAILED(input_->EnableAudioInput(bmdAudioSampleRate48kHz, bmdAudioSampleType32bitInteger, format_desc_.audio_channels)))
BOOST_THROW_EXCEPTION(caspar_exception()
<< msg_info(narrow(print()) + " Could not enable audio input.")
<< boost::errinfo_api_function("EnableAudioInput"));
if (FAILED(input_->SetCallback(this)) != S_OK)
BOOST_THROW_EXCEPTION(caspar_exception()
<< msg_info(narrow(print()) + " Failed to set input callback.")
<< boost::errinfo_api_function("SetCallback"));
if(FAILED(input_->StartStreams()))
BOOST_THROW_EXCEPTION(caspar_exception()
<< msg_info(narrow(print()) + " Failed to start input stream.")
<< boost::errinfo_api_function("StartStreams"));
}
示例4: print
route_producer(std::shared_ptr<route> route, int buffer)
: route_(route)
, connection_(route_->signal.connect([this](const core::draw_frame& frame) {
if (!buffer_.try_push(frame)) {
graph_->set_tag(diagnostics::tag_severity::WARNING, "dropped-frame");
}
graph_->set_value("produce-time", produce_timer_.elapsed() * route_->format_desc.fps * 0.5);
produce_timer_.restart();
}))
{
buffer_.set_capacity(buffer > 0 ? buffer : route->format_desc.field_count);
graph_->set_color("late-frame", diagnostics::color(0.6f, 0.3f, 0.3f));
graph_->set_color("produce-time", caspar::diagnostics::color(0.0f, 1.0f, 0.0f));
graph_->set_color("consume-time", caspar::diagnostics::color(1.0f, 0.4f, 0.0f, 0.8f));
graph_->set_color("dropped-frame", diagnostics::color(0.3f, 0.6f, 0.3f));
graph_->set_text(print());
diagnostics::register_graph(graph_);
CASPAR_LOG(debug) << print() << L" Initialized";
}
示例5:
layer_consumer() : first_frame_reported_(false)
{
first_frame_available_ = first_frame_promise_.get_future();
frame_buffer_.set_capacity(2);
}