Change class name RtpVideoSession to RtpCodec

This commit is contained in:
dijunkun
2023-09-11 15:23:51 +08:00
parent f52142fc00
commit a2d7bb7ff5
5 changed files with 18 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
#include "rtp_video_session.h"
#include "rtp_codec.h"
#include <chrono>
@@ -9,14 +9,14 @@
#define FU_A 28
#define FU_B 29
RtpVideoSession ::RtpVideoSession(PAYLOAD_TYPE payload_type)
RtpCodec ::RtpCodec(PAYLOAD_TYPE payload_type)
: version_(RTP_VERSION),
has_padding_(false),
has_extension_(false),
payload_type_(payload_type),
sequence_number_(0) {}
RtpVideoSession ::~RtpVideoSession() {
RtpCodec ::~RtpCodec() {
if (extension_data_) {
delete extension_data_;
extension_data_ = nullptr;
@@ -28,8 +28,8 @@ RtpVideoSession ::~RtpVideoSession() {
// }
}
void RtpVideoSession::Encode(uint8_t* buffer, size_t size,
std::vector<RtpPacket>& packets) {
void RtpCodec::Encode(uint8_t* buffer, size_t size,
std::vector<RtpPacket>& packets) {
// if (!rtp_packet_) {
// rtp_packet_ = new RtpPacket();
// }
@@ -118,7 +118,7 @@ void RtpVideoSession::Encode(uint8_t* buffer, size_t size,
}
}
size_t RtpVideoSession::Decode(RtpPacket& packet, uint8_t* payload) {
size_t RtpCodec::Decode(RtpPacket& packet, uint8_t* payload) {
// if ((packet.Buffer()[13] >> 6) & 0x01) {
// LOG_ERROR("End bit!!!!!!!!!!!!!!!");
// }

View File

@@ -1,5 +1,5 @@
#ifndef _RTP_VIDEO_SESSION_H_
#define _RTP_VIDEO_SESSION_H_
#ifndef _RTP_CODEC_H_
#define _RTP_CODEC_H_
#include <stdint.h>
@@ -7,10 +7,10 @@
#include "rtp_packet.h"
class RtpVideoSession {
class RtpCodec {
public:
RtpVideoSession(PAYLOAD_TYPE payload_type);
~RtpVideoSession();
RtpCodec(PAYLOAD_TYPE payload_type);
~RtpCodec();
public:
void Encode(uint8_t* buffer, size_t size, std::vector<RtpPacket>& packets);

View File

@@ -7,7 +7,7 @@
#include "frame.h"
#include "ringbuffer.h"
#include "rtp_video_session.h"
#include "rtp_codec.h"
#include "thread_base.h"
class RtpVideoReceiver : public ThreadBase {