forked from paullouisageneau/libdatachannel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathh264rtpdepacketizer.hpp
42 lines (30 loc) · 1 KB
/
h264rtpdepacketizer.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Copyright (c) 2020 Staz Modrzynski
* Copyright (c) 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_H264_RTP_DEPACKETIZER_H
#define RTC_H264_RTP_DEPACKETIZER_H
#if RTC_ENABLE_MEDIA
#include "common.hpp"
#include "mediahandler.hpp"
#include "message.hpp"
#include "rtp.hpp"
#include <iterator>
namespace rtc {
/// RTP depacketization for H264
class RTC_CPP_EXPORT H264RtpDepacketizer : public MediaHandler {
public:
H264RtpDepacketizer() = default;
virtual ~H264RtpDepacketizer() = default;
void incoming(message_vector &messages, const message_callback &send) override;
private:
std::vector<message_ptr> mRtpBuffer;
message_vector buildFrames(message_vector::iterator firstPkt, message_vector::iterator lastPkt);
};
} // namespace rtc
#endif // RTC_ENABLE_MEDIA
#endif /* RTC_H264_RTP_DEPACKETIZER_H */