From fcf2f3a82c74b13a7344a90e308f92fafe480d35 Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Wed, 28 Feb 2024 11:40:17 -0500 Subject: [PATCH] Add MediaSample Depacketizers will include metadata about assembled media. --- CMakeLists.txt | 1 + include/rtc/mediasample.hpp | 23 +++++++++++++++++++++++ include/rtc/message.hpp | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 include/rtc/mediasample.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index ca0f12e52..79837a012 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,6 +99,7 @@ set(LIBDATACHANNEL_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/common.hpp ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/global.hpp ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/message.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/mediasample.hpp ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/peerconnection.hpp ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/reliability.hpp ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/rtc.h diff --git a/include/rtc/mediasample.hpp b/include/rtc/mediasample.hpp new file mode 100644 index 000000000..96a70bcb2 --- /dev/null +++ b/include/rtc/mediasample.hpp @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2019-2020 Paul-Louis Ageneau + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#ifndef RTC_FRAMEINFO_H +#define RTC_FRAMEINFO_H + +#if RTC_ENABLE_MEDIA + +namespace rtc { + +struct RTC_CPP_EXPORT MediaSample : binary { + uint32_t timestamp = 0; // RTP Timestamp +}; + +} // namespace rtc + +#endif // RTC_ENABLE_MEDIA +#endif // RTC_FRAMEINFO_H diff --git a/include/rtc/message.hpp b/include/rtc/message.hpp index 486210723..183ea3d6a 100644 --- a/include/rtc/message.hpp +++ b/include/rtc/message.hpp @@ -10,6 +10,7 @@ #define RTC_MESSAGE_H #include "common.hpp" +#include "mediasample.hpp" #include "reliability.hpp" #include @@ -32,6 +33,7 @@ struct RTC_CPP_EXPORT Message : binary { unsigned int stream = 0; // Stream id (SCTP stream or SSRC) unsigned int dscp = 0; // Differentiated Services Code Point shared_ptr reliability; + shared_ptr media_sample; }; using message_ptr = shared_ptr;