From 26ea9b5cffff3dde6068d688cd1ec5b665fd595b Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 16 Jan 2024 12:19:51 +0100 Subject: [PATCH] h264_rtp: print error if receiving video not H.264 --- src/video_rxtx/h264_rtp.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/video_rxtx/h264_rtp.cpp b/src/video_rxtx/h264_rtp.cpp index c15981c71..5589dc43b 100644 --- a/src/video_rxtx/h264_rtp.cpp +++ b/src/video_rxtx/h264_rtp.cpp @@ -7,7 +7,7 @@ */ /* * Copyright (c) 2013-2014 Fundació i2CAT, Internet I Innovació Digital a Catalunya - * Copyright (c) 2013-2023 CESNET, z. s. p. o. + * Copyright (c) 2013-2024 CESNET, z. s. p. o. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,20 +48,24 @@ #include #include +#include #include "compat/misc.h" +#include "debug.h" #include "host.h" #include "lib_common.h" -#include "transmit.h" -#include "tv.h" #include "rtp/rtp.h" #include "rtp/rtpenc_h264.h" +#include "transmit.h" +#include "tv.h" #include "utils/color_out.h" +#include "video.h" #include "video_rxtx.hpp" #include "video_rxtx/h264_rtp.hpp" -#include "video.h" -using namespace std; +#define MOD_NAME "[vrxtx/h264_rtp] " + +using std::shared_ptr; h264_rtp_video_rxtx::h264_rtp_video_rxtx(std::map const ¶ms, int rtsp_port) : @@ -79,6 +83,11 @@ h264_rtp_video_rxtx::h264_rtp_video_rxtx(std::map const &p void h264_rtp_video_rxtx::send_frame(shared_ptr tx_frame) noexcept { + if (tx_frame->color_spec != H264) { + MSG(ERROR, + "codecs other than H.264 currently not supported, got %s\n", + get_codec_name(tx_frame->color_spec)); + } tx_send_h264(m_tx, tx_frame.get(), m_network_device); if ((m_rxtx_mode & MODE_RECEIVER) == 0) { // send RTCP (receiver thread would otherwise do this time_ns_t curr_time = get_time_in_ns();