Switch between nvenc and software encoding
This commit is contained in:
+12
-14
@@ -604,21 +604,19 @@ void videoBroadcastThread(safe::signal_t *shutdown_event, udp::socket &sock, vid
|
|||||||
|
|
||||||
payload = {(char *) payload_new.data(), payload_new.size()};
|
payload = {(char *) payload_new.data(), payload_new.size()};
|
||||||
|
|
||||||
// // make sure moonlight recognizes the nalu code for IDR frames
|
// make sure moonlight recognizes the nalu code for IDR frames
|
||||||
// if (packet->flags & AV_PKT_FLAG_KEY) {
|
if (packet->flags & AV_PKT_FLAG_KEY) {
|
||||||
// // TODO: Not all encoders encode their IDR frames with the 4 byte NALU prefix
|
// TODO: Not all encoders encode their IDR frames with the 4 byte NALU prefix
|
||||||
// std::string_view frame_old = "\000\000\001e"sv;
|
std::string_view frame_old = "\000\000\001e"sv;
|
||||||
// std::string_view frame_new = "\000\000\000\001e"sv;
|
std::string_view frame_new = "\000\000\000\001e"sv;
|
||||||
// if(session->config.monitor.videoFormat != 0) {
|
if(session->config.monitor.videoFormat != 0) {
|
||||||
// frame_old = "\000\000\001("sv;
|
frame_old = "\000\000\001("sv;
|
||||||
// frame_new = "\000\000\000\001("sv;
|
frame_new = "\000\000\000\001("sv;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// assert(std::search(std::begin(payload), std::end(payload), std::begin(frame_new), std::end(frame_new)) ==
|
payload_new = replace(payload, frame_old, frame_new);
|
||||||
// std::end(payload));
|
payload = {(char *) payload_new.data(), payload_new.size()};
|
||||||
// payload_new = replace(payload, frame_old, frame_new);
|
}
|
||||||
// payload = {(char *) payload_new.data(), payload_new.size()};
|
|
||||||
// }
|
|
||||||
|
|
||||||
// insert packet headers
|
// insert packet headers
|
||||||
auto blocksize = session->config.packetsize + MAX_RTP_HEADER_SIZE;
|
auto blocksize = session->config.packetsize + MAX_RTP_HEADER_SIZE;
|
||||||
|
|||||||
Reference in New Issue
Block a user