提交 ca129051 authored 作者: blu's avatar blu

big refacting of communitation architect

上级 327bb284
...@@ -242,7 +242,6 @@ class EvDaemon{ ...@@ -242,7 +242,6 @@ class EvDaemon{
} }
int handleMsg(vector<vector<uint8_t> > &body) int handleMsg(vector<vector<uint8_t> > &body)
{ {
int ret = 0; int ret = 0;
...@@ -287,7 +286,9 @@ class EvDaemon{ ...@@ -287,7 +286,9 @@ class EvDaemon{
spdlog::warn("evdaemon {} peer disconnected: {}", devSn, selfId); spdlog::warn("evdaemon {} peer disconnected: {}", devSn, selfId);
// restart this module // restart this module
startSubModule(selfId); if(bBootstrap) {
startSubModule(selfId);
}
} }
if(ret < 0) { if(ret < 0) {
......
...@@ -246,16 +246,19 @@ protected: ...@@ -246,16 +246,19 @@ protected:
void run() void run()
{ {
int ret = 0; int ret = 0;
AVDictionary * optsIn; // AVDictionary * optsIn;
av_dict_set(&optsIn, "timeout", "7", 0); // av_dict_set(&optsIn, "timeout", "7", 0);
spdlog::info("evpuller {} openning stream: {}", selfId, urlIn);
if ((ret = avformat_open_input(&pAVFormatInput, urlIn.c_str(), NULL, NULL)) < 0) { if ((ret = avformat_open_input(&pAVFormatInput, urlIn.c_str(), NULL, NULL)) < 0) {
spdlog::error("Could not open input stream {}", urlIn); spdlog::error("Could not open input stream {}", urlIn);
} }
spdlog::info("evpuller {} finding sgtream info: {}", selfId, urlIn);
if ((ret = avformat_find_stream_info(pAVFormatInput, NULL)) < 0) { if ((ret = avformat_find_stream_info(pAVFormatInput, NULL)) < 0) {
spdlog::error("Failed to retrieve input stream information"); spdlog::error("Failed to retrieve input stream information");
} }
pAVFormatInput->flags = AVFMT_FLAG_NOBUFFER | AVFMT_FLAG_FLUSH_PACKETS; //pAVFormatInput->flags = AVFMT_FLAG_NOBUFFER | AVFMT_FLAG_FLUSH_PACKETS;
numStreams = pAVFormatInput->nb_streams; numStreams = pAVFormatInput->nb_streams;
int *streamList = (int *)av_mallocz_array(numStreams, sizeof(*streamList)); int *streamList = (int *)av_mallocz_array(numStreams, sizeof(*streamList));
......
...@@ -191,7 +191,7 @@ int encode(AVFormatContext *ctx, char **bytes) ...@@ -191,7 +191,7 @@ int encode(AVFormatContext *ctx, char **bytes)
wholeSize += strlen(PS_MARK_S); wholeSize += strlen(PS_MARK_S);
// num streams // num streams
wholeSize += sizeof(ctx->nb_streams); wholeSize += sizeof(ctx->nb_streams);
spdlog::info("encode sizeof streams: {:d}, {:d}", sizeof(ctx->nb_streams), ctx->nb_streams); spdlog::info("encode num of streams: {:d}", ctx->nb_streams);
for (int i = 0; i < ctx->nb_streams; i++) for (int i = 0; i < ctx->nb_streams; i++)
{ {
wholeSize += sizeof(AVStream); wholeSize += sizeof(AVStream);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论