diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-09-26 20:59:39 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-10-16 17:57:18 +0200 |
| commit | 85478ad2bb44244efa6ad1be8ad9d3f88b84c18f (patch) | |
| tree | 9ae75d3086f0fac30179847e2ee8efe5dad1684e | |
| parent | 385bbd794c2c0823b61ad335299aad1cc7f50d08 (diff) | |
Cleanup: coding style.
| -rw-r--r-- | src/lib/grok/messenger.h | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/lib/grok/messenger.h b/src/lib/grok/messenger.h index 50d44e251..bb7ada213 100644 --- a/src/lib/grok/messenger.h +++ b/src/lib/grok/messenger.h @@ -758,6 +758,7 @@ struct Msg std::vector<std::string> cs_; size_t ct_; }; + static void processorThread(Messenger* messenger, std::function<void(std::string)> processor) { while (messenger->running) { @@ -765,31 +766,26 @@ static void processorThread(Messenger* messenger, std::function<void(std::string if (!messenger->receiveQueue.waitAndPop(message)) { break; } - if(!messenger->running) + + if (!messenger->running) { break; + } + Msg msg(message); auto tag = msg.next(); - if(tag == GRK_MSGR_BATCH_COMPRESS_INIT) - { + if (tag == GRK_MSGR_BATCH_COMPRESS_INIT) { auto width = msg.nextUint(); - auto stride = msg.nextUint(); - (void)stride; + msg.nextUint(); // stride auto height = msg.nextUint(); - auto samplesPerPixel = msg.nextUint(); - auto depth = msg.nextUint(); - (void)depth; - messenger->init_.uncompressedFrameSize_ = - Messenger::uncompressedFrameSize(width, height, samplesPerPixel); - auto compressedFrameSize = msg.nextUint(); - auto numFrames = msg.nextUint(); - messenger->initClient(compressedFrameSize, compressedFrameSize, numFrames); - } - else if(tag == GRK_MSGR_BATCH_PROCESSED_UNCOMPRESSED) - { + auto samples_per_pixel = msg.nextUint(); + msg.nextUint(); // depth + messenger->init_.uncompressedFrameSize_ = Messenger::uncompressedFrameSize(width, height, samples_per_pixel); + auto compressed_frame_size = msg.nextUint(); + auto num_frames = msg.nextUint(); + messenger->initClient(compressed_frame_size, compressed_frame_size, num_frames); + } else if (tag == GRK_MSGR_BATCH_PROCESSED_UNCOMPRESSED) { messenger->reclaimUncompressed(msg.nextUint()); - } - else if(tag == GRK_MSGR_BATCH_PROCESSSED_COMPRESSED) - { + } else if (tag == GRK_MSGR_BATCH_PROCESSSED_COMPRESSED) { messenger->reclaimCompressed(msg.nextUint()); } processor(message); |
