修复编译问题

This commit is contained in:
xiongziliang
2021-01-17 20:15:08 +08:00
parent b6cbc87712
commit 5d752c89b5
20 changed files with 34 additions and 37 deletions

View File

@@ -260,7 +260,7 @@ static string getTrackInfoStr(const TrackSource *track_src){
break;
}
}
return codec_info;
return std::move(codec_info);
}
void MultiMuxerPrivate::onAllTrackReady() {

View File

@@ -83,7 +83,7 @@ void HlsPlayer::playNextTs(bool force){
strongSelf->playNextTs(true);
} else {
//下一个切片慢点播放
strongSelf->_timer_ts.reset(new Timer(delay / 1000.0f, [weakSelf, delay]() {
strongSelf->_timer_ts.reset(new Timer(delay / 1000.0f, [weakSelf]() {
auto strongSelf = weakSelf.lock();
if (!strongSelf) {
return false;

View File

@@ -144,7 +144,7 @@ Buffer::Ptr HttpFileBody::readData(size_t size) {
//读到数据了
ret->setSize(iRead);
_offset += iRead;
return ret;
return std::move(ret);
}
//读取文件异常,文件真实长度小于声明长度
_offset = _max_size;
@@ -218,7 +218,7 @@ string HttpMultiFormBody::multiFormBodySuffix(const string &boundary){
string endMPboundary = MPboundary + "--";
_StrPrinter body;
body << "\r\n" << endMPboundary;
return body;
return std::move(body);
}
size_t HttpMultiFormBody::fileSize(FILE *fp) {
@@ -244,7 +244,7 @@ string HttpMultiFormBody::multiFormBodyPrefix(const HttpArgs &args,const string
body << MPboundary << "\r\n";
body << "Content-Disposition: form-data; name=\"" << "file" << "\";filename=\"" << fileName << "\"\r\n";
body << "Content-Type: application/octet-stream\r\n\r\n" ;
return body;
return std::move(body);
}
}//namespace mediakit

View File

@@ -674,7 +674,7 @@ void HttpSession::Handle_Req_POST(size_t &content_len) {
//返回不固定长度的content
content_len = -1;
auto parserCopy = _parser;
std::shared_ptr<size_t> recvedContentLen = std::make_shared<uint64_t>(0);
std::shared_ptr<size_t> recvedContentLen = std::make_shared<size_t>(0);
bool bClose = !strcasecmp(_parser["Connection"].data(),"close");
_contentCallBack = [this,parserCopy,totalContentLen,recvedContentLen,bClose](const char *data,size_t len){

View File

@@ -53,7 +53,7 @@ do{ \
} \
}while(0) \
void WebSocketSplitter::decode(uint8_t *data,size_t len) {
void WebSocketSplitter::decode(uint8_t *data, size_t len) {
uint8_t *ptr = data;
if(!_got_header) {
//还没有获取数据头

View File

@@ -95,7 +95,7 @@ public:
* @param data 需要解包的数据,可能是不完整的包或多个包
* @param len 数据长度
*/
void decode(uint8_t *data,uint64_t len);
void decode(uint8_t *data, size_t len);
/**
* 编码一个数据包
@@ -119,7 +119,7 @@ protected:
* @param len 负载数据长度
* @param recved 已接收数据长度(包含本次数据长度)等于header._payload_len时则接受完毕
*/
virtual void onWebSocketDecodePayload(const WebSocketHeader &header, const uint8_t *ptr, uint64_t len, uint64_t recved) {};
virtual void onWebSocketDecodePayload(const WebSocketHeader &header, const uint8_t *ptr, size_t len, size_t recved) {};
/**
* 接收到完整的一个webSocket数据包后回调
@@ -135,13 +135,13 @@ protected:
virtual void onWebSocketEncodeData(Buffer::Ptr buffer){};
private:
void onPayloadData(uint8_t *data, uint64_t len);
void onPayloadData(uint8_t *data, size_t len);
private:
string _remain_data;
int _mask_offset = 0;
bool _got_header = false;
uint64_t _payload_offset = 0;
int _mask_offset = 0;
size_t _payload_offset = 0;
string _remain_data;
};
} /* namespace mediakit */

View File

@@ -121,7 +121,7 @@ static struct mov_buffer_t s_io = {
},
[](void *ctx) {
MP4FileIO *thiz = (MP4FileIO *) ctx;
return thiz->onTell();
return (uint64_t)thiz->onTell();
}
};

View File

@@ -214,7 +214,7 @@ inline void RtmpPlayer::send_play() {
AMFEncoder enc;
enc << "play" << ++_send_req_id << nullptr << _stream_id << (double) _stream_index;
sendRequest(MSG_CMD, enc.data());
auto fun = [this](AMFValue &val) {
auto fun = [](AMFValue &val) {
//TraceL << "play onStatus";
auto level = val["level"].as_string();
auto code = val["code"].as_string();

View File

@@ -192,7 +192,7 @@ string RtpProcess::getIdentifier() const {
return _media_info._streamid;
}
int RtpProcess::totalReaderCount() {
int RtpProcess::getTotalReaderCount() {
return _muxer ? _muxer->totalReaderCount() : 0;
}

View File

@@ -15,8 +15,6 @@
#include "ProcessInterface.h"
#include "Common/MultiMediaSourceMuxer.h"
using namespace mediakit;
namespace mediakit {
class RtpProcess : public SockInfo, public MediaSinkInterface, public MediaSourceEventInterceptor, public std::enable_shared_from_this<RtpProcess>{
@@ -65,7 +63,7 @@ public:
uint16_t get_peer_port() override;
string getIdentifier() const override;
int totalReaderCount();
int getTotalReaderCount();
void setListener(const std::weak_ptr<MediaSourceEvent> &listener);
protected:

View File

@@ -138,7 +138,7 @@ void RtpProcessHelper::attachEvent() {
bool RtpProcessHelper::close(MediaSource &sender, bool force) {
//此回调在其他线程触发
if (!_process || (!force && _process->totalReaderCount())) {
if (!_process || (!force && _process->getTotalReaderCount())) {
return false;
}
auto parent = _parent.lock();
@@ -151,7 +151,7 @@ bool RtpProcessHelper::close(MediaSource &sender, bool force) {
}
int RtpProcessHelper::totalReaderCount(MediaSource &sender) {
return _process ? _process->totalReaderCount() : sender.totalReaderCount();
return _process ? _process->getTotalReaderCount() : sender.totalReaderCount();
}
RtpProcess::Ptr &RtpProcessHelper::getProcess() {

View File

@@ -79,7 +79,7 @@ void RtpSession::onRtpPacket(const char *data, size_t len) {
bool RtpSession::close(MediaSource &sender, bool force) {
//此回调在其他线程触发
if(!_process || (!force && _process->totalReaderCount())){
if(!_process || (!force && _process->getTotalReaderCount())){
return false;
}
string err = StrPrinter << "close media:" << sender.getSchema() << "/" << sender.getVhost() << "/" << sender.getApp() << "/" << sender.getId() << " " << force;
@@ -89,7 +89,7 @@ bool RtpSession::close(MediaSource &sender, bool force) {
int RtpSession::totalReaderCount(MediaSource &sender) {
//此回调在其他线程触发
return _process ? _process->totalReaderCount() : sender.totalReaderCount();
return _process ? _process->getTotalReaderCount() : sender.totalReaderCount();
}
}//namespace mediakit

View File

@@ -121,7 +121,7 @@ string SdpTrack::toString() const {
default:
break;
}
return _printer;
return std::move(_printer);
}
static TrackType toTrackType(const string &str) {

View File

@@ -309,7 +309,7 @@ void RtspPusher::handleResSetup(const Parser &parser, unsigned int track_idx) {
}
void RtspPusher::sendOptions() {
_on_res_func = [this](const Parser &parser) {};
_on_res_func = [](const Parser &parser) {};
sendRtspRequest("OPTIONS", _content_base);
}