mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
Combine Fu-A subframes into complete h264 frame
This commit is contained in:
37
src/rtp/rtp_video_receiver.h
Normal file
37
src/rtp/rtp_video_receiver.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef _RTP_VIDEO_RECEIVER_H_
|
||||
#define _RTP_VIDEO_RECEIVER_H_
|
||||
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <queue>
|
||||
|
||||
#include "frame.h"
|
||||
#include "rtp_video_session.h"
|
||||
|
||||
class RtpVideoReceiver {
|
||||
public:
|
||||
RtpVideoReceiver();
|
||||
~RtpVideoReceiver();
|
||||
|
||||
public:
|
||||
void InsertRtpPacket(RtpPacket& rtp_packet);
|
||||
|
||||
void SetOnReceiveCompleteFrame(
|
||||
std::function<void(VideoFrame&)> on_receive_complete_frame) {
|
||||
on_receive_complete_frame_ = on_receive_complete_frame;
|
||||
}
|
||||
|
||||
private:
|
||||
bool CheckIsFrameCompleted(RtpPacket& rtp_packet);
|
||||
|
||||
// private:
|
||||
// void OnReceiveFrame(uint8_t* payload) {}
|
||||
|
||||
private:
|
||||
std::map<uint16_t, RtpPacket> incomplete_frame_list_;
|
||||
std::queue<VideoFrame> compelete_video_frame_queue_;
|
||||
uint8_t* nv12_data_ = nullptr;
|
||||
std::function<void(VideoFrame&)> on_receive_complete_frame_ = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user