提交 42458c2a authored 作者: blu's avatar blu

evmlmotion: delta packet ts

上级 98b691ca
......@@ -148,11 +148,11 @@ error_exit:
{
auto body = z_recv_multiple(pDealer,false);
if(body.size() == 0) {
spdlog::error("evslicer {} failed to receive multiple msg: {}", this->devSn, zmq_strerror(zmq_errno()));
continue;
}
// full proto msg received.
this->handleCloudMsg(body);
spdlog::error("evslicer {} failed to receive multiple cloud msg: {}", this->devSn, zmq_strerror(zmq_errno()));
}else{
// full proto msg received.
this->handleCloudMsg(body);
}
}
});
thCloudMsgHandler.detach();
......
......@@ -823,11 +823,11 @@ public:
{
auto body = z_recv_multiple(pDaemon,false);
if(body.size() == 0) {
spdlog::error("evslicer {} failed to receive multiple msg: {}", selfId, zmq_strerror(zmq_errno()));
continue;
spdlog::error("evslicer {} failed to receive multiple cloud msg: {}", selfId, zmq_strerror(zmq_errno()));
}else{
// full proto msg received.
this->handleCloudMsg(body);
}
// full proto msg received.
this->handleCloudMsg(body);
}
});
thCloudMsgHandler.detach();
......@@ -837,11 +837,11 @@ public:
{
auto body = z_recv_multiple(pDealer,false);
if(body.size() == 0) {
spdlog::error("evslicer {} failed to receive multiple msg: {}", selfId, zmq_strerror(zmq_errno()));
continue;
spdlog::error("evslicer {} failed to receive multiple edge msg: {}", selfId, zmq_strerror(zmq_errno()));
}else{
// full proto msg received.
this->handleEdgeMsg(body);
}
// full proto msg received.
this->handleEdgeMsg(body);
}
});
thEdgeMsgHandler.detach();
......
......@@ -308,6 +308,7 @@ protected:
{
int ret = 0;
AVDictionary * optsIn = nullptr;
av_dict_set_int(&optsIn, "stimeout", (int64_t)(1000* 1000 * 1), 0);
string proto = urlIn.substr(0,4);
if(proto == "rtsp") {
av_dict_set(&optsIn, "rtsp_transport", "tcp", 0);
......@@ -388,7 +389,7 @@ protected:
ret = av_read_frame(pAVFormatInput, &packet);
if (ret < 0) {
spdlog::error("evpuller {} failed read packet: {}", selfId, av_err2str(ret));
break;
exit(1);
}
in_stream = pAVFormatInput->streams[packet.stream_index];
if (packet.stream_index >= numStreams || streamList[packet.stream_index] < 0) {
......@@ -469,16 +470,17 @@ public:
{
auto body = z_recv_multiple(pDealer,false);
if(body.size() == 0) {
spdlog::error("evslicer {} failed to receive multiple msg: {}", selfId, zmq_strerror(zmq_errno()));
continue;
}
// full proto msg received.
string msg;
for(auto &v: body) {
msg += body2str(v) + ",";
spdlog::error("evslicer {} failed to receive multiple cloud msg: {}", selfId, zmq_strerror(zmq_errno()));
}else{
// full proto msg received.
string msg;
for(auto &v: body) {
msg += body2str(v) + ",";
}
spdlog::info("evpuller {} received edge msg: {}", selfId, msg);
this->handleEdgeMsg(body);
}
spdlog::info("evpuller {} received edge msg: {}", selfId, msg);
this->handleEdgeMsg(body);
}
});
thEdgeMsgHandler.detach();
......@@ -489,11 +491,11 @@ public:
{
auto body = z_recv_multiple(pDaemon,false);
if(body.size() == 0) {
spdlog::error("evslicer {} failed to receive multiple msg: {}", selfId, zmq_strerror(zmq_errno()));
continue;
spdlog::error("evslicer {} failed to receive multiple edge msg: {}", selfId, zmq_strerror(zmq_errno()));
}else{
// full proto msg received.
this->handleCloudMsg(body);
}
// full proto msg received.
this->handleCloudMsg(body);
}
});
thCloudMsgHandler.detach();
......
......@@ -318,6 +318,7 @@ private:
spdlog::error("evpusher {} {} failed set output pOptsRemux", devSn, iid);
ret = AVERROR_UNKNOWN;
}
av_dict_set_int(&pOptsRemux, "stimeout", (int64_t)(1000* 1000 * 1), 0);
ret = avformat_alloc_output_context2(&pAVFormatRemux, nullptr, "rtsp", urlOut.c_str());
}
else if(proto == "rtmp") {
......@@ -383,6 +384,7 @@ private:
ret = avformat_write_header(pAVFormatRemux, &pOptsRemux);
if (ret < 0) {
spdlog::error("evpusher {} {} error occurred when opening output file", devSn, iid);
exit(1);
}
return ret;
......@@ -472,9 +474,9 @@ protected:
av_packet_unref(&packet);
if (ret < 0) {
spdlog::error("evpusher {} error muxing packet: {}, {}, {}, {}, restreaming...", selfId, av_err2str(ret), packet.dts, packet.pts, packet.dts==AV_NOPTS_VALUE);
if(pktCnt != 0 && packet.pts == AV_NOPTS_VALUE) {
if(packet.pts == AV_NOPTS_VALUE) {
// reset
av_write_trailer(pAVFormatRemux);
// av_write_trailer(pAVFormatRemux);
freeStream();
getInputFormat();
setupStream();
......@@ -532,11 +534,11 @@ public:
{
auto body = z_recv_multiple(pDaemon,false);
if(body.size() == 0) {
spdlog::error("evslicer {} failed to receive multiple msg: {}", selfId, zmq_strerror(zmq_errno()));
continue;
}
// full proto msg received.
this->handleCloudMsg(body);
spdlog::error("evslicer {} failed to receive multiple cloud msg: {}", selfId, zmq_strerror(zmq_errno()));
}else{
// full proto msg received.
this->handleCloudMsg(body);
}
}
});
thCloudMsgHandler.detach();
......@@ -546,11 +548,11 @@ public:
{
auto body = z_recv_multiple(pDealer,false);
if(body.size() == 0) {
spdlog::error("evslicer {} failed to receive multiple msg: {}", selfId, zmq_strerror(zmq_errno()));
continue;
}
// full proto msg received.
this->handleEdgeMsg(body);
spdlog::error("evslicer {} failed to receive multiple edge msg: {}", selfId, zmq_strerror(zmq_errno()));
}else{
// full proto msg received.
this->handleEdgeMsg(body);
}
}
});
thEdgeMsgHandler.detach();
......@@ -588,7 +590,7 @@ public:
zmq_close(pDaemon);
pDaemon = nullptr;
}
if(pDaemonCtx != nullptr) {
zmq_ctx_destroy(pDaemonCtx);
pDaemonCtx = nullptr;
......
......@@ -883,11 +883,12 @@ public:
while(true) {
auto body = z_recv_multiple(pDealer,false);
if(body.size() == 0) {
spdlog::error("evslicer {} failed to receive multiple msg: {}", selfId, zmq_strerror(zmq_errno()));
continue;
spdlog::error("evslicer {} failed to receive multiple edge msg: {}", selfId, zmq_strerror(zmq_errno()));
}else{
// full proto msg received.
handleEdgeMsg(body);
}
// full proto msg received.
handleEdgeMsg(body);
}
});
thEdgeMsgHandler.detach();
......@@ -897,11 +898,11 @@ public:
{
auto body = z_recv_multiple(pDaemon,false);
if(body.size() == 0) {
spdlog::error("evslicer {} failed to receive multiple msg: {}", selfId, zmq_strerror(zmq_errno()));
continue;
}
// full proto msg received.
this->handleCloudMsg(body);
spdlog::error("evslicer {} failed to receive multiple cloud msg: {}", selfId, zmq_strerror(zmq_errno()));
}else{
// full proto msg received.
this->handleCloudMsg(body);
}
}
});
thCloudMsgHandler.detach();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论