- std::cout << "encoding queue of " << _queue.size() << "\n";
- for (auto const& frame: _queue) {
-
- status = nvjpeg2kEncode(_encoder_handle, _encoder_state, _encoder_params, frame.device_image(), 0);
- if (status != NVJPEG2K_STATUS_SUCCESS) {
- throw CUDAError("nvjpeg2kEncode", status);
- }
-
- size_t compressed_size;
- status = nvjpeg2kEncodeRetrieveBitstream(_encoder_handle, _encoder_state, nullptr, &compressed_size, 0);
+ status = nvjpeg2kEncode(_encoder_handle, _encoder_state, _encoder_params, input.device_image(), _stream);
+ if (status != NVJPEG2K_STATUS_SUCCESS) {
+ throw CUDAError("nvjpeg2kEncode", status);
+ }