Skip to content

Commit 840ed1f

Browse files
committed
keycontrol: print Transmitted vfmt + in codec
- s/Captured/Transmitted/ video format (has compressed codec) - print the input codec in brackets - do not parse the format from istringstream and print directly
1 parent a98c7de commit 840ed1f

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/keyboard_control.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* With code taken from Olivier Mehani (set_tio()).
66
*/
77
/*
8-
* Copyright (c) 2015-2024 CESNET
8+
* Copyright (c) 2015-2025 CESNET, zájmové sdružení právnických osob
99
* All rights reserved.
1010
*
1111
* Redistribution and use in source and binary forms, with or without
@@ -764,15 +764,12 @@ void keyboard_control::impl::info()
764764
}
765765

766766
{
767-
struct video_desc desc{};
768767
struct msg_sender *m = (struct msg_sender *) new_message(sizeof(struct msg_sender));
769768
m->type = SENDER_MSG_QUERY_VIDEO_MODE;
770769
struct response *r = send_message_sync(m_root, "sender", (struct message *) m, 100, SEND_MESSAGE_FLAG_QUIET | SEND_MESSAGE_FLAG_NO_STORE);
771770
if (response_get_status(r) == RESPONSE_OK) {
772771
const char *text = response_get_text(r);
773-
istringstream iss(text);
774-
iss >> desc;
775-
col() << TBOLD("Captured video format: ") << desc << "\n";
772+
col() << TBOLD("Transmitted video format: ") << text << "\n";
776773
}
777774
free_response(r);
778775
}

src/video_rxtx.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,12 @@ void video_rxtx::send(shared_ptr<video_frame> frame) {
158158
if (!frame && m_poisoned) {
159159
return;
160160
}
161-
compress_frame(m_compression, frame);
162161
if (!frame) {
163162
m_poisoned = true;
163+
} else {
164+
m_input_codec = frame->color_spec;
164165
}
166+
compress_frame(m_compression, frame);
165167
}
166168

167169
void *video_rxtx::sender_thread(void *args) {
@@ -179,7 +181,9 @@ void video_rxtx::check_sender_messages() {
179181
r = new_response(RESPONSE_NO_CONTENT, nullptr);
180182
} else {
181183
ostringstream oss;
182-
oss << m_video_desc;
184+
oss << m_video_desc
185+
<< " (input " << get_codec_name(m_input_codec)
186+
<< ")";
183187
r = new_response(RESPONSE_OK,
184188
oss.str().c_str());
185189
}

src/video_rxtx.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#ifndef VIDEO_RXTX_H_
3939
#define VIDEO_RXTX_H_
4040

41+
#include <atomic>
4142
#include <map>
4243
#include <memory>
4344
#include <string>
@@ -124,6 +125,7 @@ struct video_rxtx {
124125
bool m_poisoned, m_joined;
125126

126127
video_desc m_video_desc{};
128+
std::atomic<codec_t> m_input_codec{};
127129
};
128130

129131
class video_rxtx_loader {

0 commit comments

Comments
 (0)