summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-09-26 20:59:39 +0200
committerCarl Hetherington <cth@carlh.net>2024-01-28 02:01:57 +0100
commit91817226ade75dd8e35e979131ac038bb161d7f9 (patch)
treef19eca601b5fba8f7c1e2f63580a2612fb07fdca /src/lib
parentac40cbf774f3093d09807a47304b5fca10212e98 (diff)
Cleanup: coding style.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/grok/messenger.h34
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);