void jpeg_decoder_thread()
{
+ size_t num_decoded = 0, num_dropped = 0;
+
pthread_setname_np(pthread_self(), "JPEGDecoder");
for ( ;; ) {
JPEGID id;
}
}
if (num_pending > 3) {
+ ++num_dropped;
continue;
}
if (cache.size() > CACHE_SIZE) {
prune_cache();
}
+ ++num_decoded;
+ if (num_decoded % 1000 == 0) {
+ fprintf(stderr, "Decoded %zu images, dropped %zu (%.2f%% dropped)\n",
+ num_decoded, num_dropped, (100.0 * num_dropped) / (num_decoded + num_dropped));
+ }
}
dest->setPixmap(pixmap);
if (av_read_frame(format_ctx.get(), &pkt) != 0) {
break;
}
- fprintf(stderr, "Got a frame from camera %d, pts = %ld, size = %d\n",
- pkt.stream_index, pkt.pts, pkt.size);
+ //fprintf(stderr, "Got a frame from camera %d, pts = %ld, size = %d\n",
+ // pkt.stream_index, pkt.pts, pkt.size);
string filename = filename_for_frame(pkt.stream_index, pkt.pts);
FILE *fp = fopen(filename.c_str(), "wb");
if (fp == nullptr) {