Skip to content

Commit

Permalink
Add MediaSample
Browse files Browse the repository at this point in the history
Depacketizers will include metadata about assembled media.
  • Loading branch information
Sean-Der committed Mar 2, 2024
1 parent 437a758 commit fcf2f3a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions include/rtc/mediasample.hpp
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions include/rtc/message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define RTC_MESSAGE_H

#include "common.hpp"
#include "mediasample.hpp"
#include "reliability.hpp"

#include <functional>
Expand All @@ -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> reliability;
shared_ptr<MediaSample> media_sample;
};

using message_ptr = shared_ptr<Message>;
Expand Down

0 comments on commit fcf2f3a

Please sign in to comment.