_setup_done = true;
}
- //std::cout << "add to batch.\n";
- timestamped_printf("fv sends %d to gpu\n", pv->time.frames_round(24));
+ //timestamped_printf("fv sends %d to gpu\n", pv->time.frames_round(24));
fastDecoderJ2kAddImageToBatch(_decoder, proxy->j2k().data().get(), proxy->j2k().size());
_batch.push_back (pv);
int free_slots = 0;
fastDecoderJ2kFreeSlotsInBatch(_decoder, &free_slots);
- timestamped_printf("now %d slots left.\n", free_slots);
- //std::cout << free_slots << " left in batch.\n";
if (free_slots == 0) {
/* Do some decoding */
- timestamped_printf("tx & extract\n");
+ PeriodTimer pt("tx/extract");
transform_and_extract ();
}
void
FastvideoPlayerVideoPreparer::transform_and_extract ()
{
+ StateTimer st("transform_and_extract", "tx");
fastDecoderJ2kReport_t report;
fastStatus_t r = fastDecoderJ2kTransformBatch(_decoder, &report);
if (r != FAST_OK) {
DCPOMATIC_ASSERT (index <= _batch.size());
shared_ptr<PlayerVideo> pv = _batch[index].lock();
if (pv) {
- //std::cout << "got a pv for batch number " << index << "\n";
- /* XXX: this should be memlocked or whatever fastMalloc does */
+ st.set("copy gpu -> host");
shared_ptr<J2KImageProxy> proxy = const_pointer_cast<J2KImageProxy>(dynamic_pointer_cast<const J2KImageProxy>(pv->image_proxy()));
DCPOMATIC_ASSERT (proxy);
fastExportParameters_t export_parameters;
if (r != FAST_OK) {
throw FastvideoError ("ExportToHostCopy", r);
}
+ //timestamped_printf("fv copies _decoded to Image\n");
+ st.set("convert to Image");
shared_ptr<dcpomatic::Image> image(new dcpomatic::Image(AV_PIX_FMT_XYZ12LE, size, true));
uint8_t* from = reinterpret_cast<uint8_t*>(_decoded);
uint16_t* to = reinterpret_cast<uint16_t*>(image->data()[0]);
to += image->stride()[0] / 2;
}
- timestamped_printf("fv sets image for %d\n", pv->time.frames_round(24));
+ //timestamped_printf("fv sets image for %d\n", pv->time.frames_round(24));
proxy->set_image (image);
_cpu.request (pv);
if (images_left == 0) {
break;
}
+ st.set("get next");
fastStatus_t r = fastDecoderJ2kGetNextDecodedImage(_decoder, &report, &images_left);
if (r != FAST_OK) {
throw FastvideoError ("DecoderJ2kGetNextDecodedImage", r);
parameters.truncationMode = 0;
parameters.truncationRate = 0;
- parameters.DecodePasses = 0;
+ parameters.DecodePasses = 22;
parameters.imageInfo = &info;
parameters.maxStreamSize = max_stream_size;
void
GLVideoView::thread_playing ()
{
- StateTimer st("wake to done");
if (length() != dcpomatic::DCPTime()) {
- st.set("get next time");
dcpomatic::DCPTime const next = position() + one_video_frame();
if (next >= length()) {
return;
}
- st.set("get next frame");
get_next_frame (false);
- st.set("set im and draw");
set_image_and_draw ();
}
- printf("done that frame: time til next frame %d\n", time_until_next_frame().get_value_or(0));
+ //printf("done that frame: time til next frame %d\n", time_until_next_frame().get_value_or(0));
while (true) {
optional<int> n = time_until_next_frame();
}
get_next_frame (true);
add_dropped ();
+ timestamped_printf("_____________DROP______________________\n");
}
}
void
GLVideoView::set_image_and_draw ()
{
- StateTimer st("set_image_and_draw");
shared_ptr<PlayerVideo> pv = player_video().first;
if (pv) {
- timestamped_printf("view gets image for %d\n", pv->time.frames_round(24));
- st.set("get-image");
+ //timestamped_printf("view gets image for %d\n", pv->time.frames_round(24));
shared_ptr<Image> im = pv->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true);
- st.set("set-image");
set_image (im);
- st.set("draw");
draw (pv->inter_position(), pv->inter_size());
}
}
_thread_work_condition.wait (lm);
}
lm.unlock ();
- printf("awake: time til next frame %d\n", time_until_next_frame().get_value_or(0));
if (_playing) {
thread_playing ();