| | |
| | | #ifdef TestCode |
| | | DBG("waitSignal(\"DecoderImageOK\") after"); |
| | | #endif |
| | | // 从ffmpeg解码类中获取图片 |
| | | p_this->m_fFmpegDecoderJPG.getImage().copyTo(p_this->m_image); |
| | | |
| | | { |
| | | if (p_this->m_publishVideoRet) { |
| | | if (p_this->videoPublishElement == nullptr) { |
| | |
| | | cv::Size size_(appConfig.getIntProperty("pulish.width"), appConfig.getIntProperty("pulish.height")); |
| | | int gupIdx = appPref.getIntData("gpu.index"); |
| | | DBG("videoPublishpath: " << p_this->m_chanPubID << path << " h:" << size_.height); |
| | | p_this->videoPublishElement = new ffmpeg::VideoPublishElement(path, size_, "flv", 25, gupIdx); |
| | | p_this->videoPublishElement = new ffmpeg::PipeVideoPublishElement(path, size_, "flv", 25, gupIdx); |
| | | p_this->videoPublishElement->start(); |
| | | } else { |
| | | // DBG("videoPublishElement->setImage() : " << p_this->m_chanPubID); |
| | | if (!p_this->m_image.empty()) { |
| | | // DBG("videoPublishElement->setImage() : " << p_this->m_chanPubID); |
| | | p_this->videoPublishElement->setImage(p_this->m_image); |
| | | p_this->videoPublishElement->submit(); |
| | | } else { |
| | | ERR("m_image.empty()"); |
| | | } |
| | |
| | | p_this->m_picCount.store(0); |
| | | } |
| | | |
| | | // 从ffmpeg解码类中获取图片 |
| | | p_this->m_fFmpegDecoderJPG.getImage().copyTo(p_this->m_image); |
| | | { |
| | | cv::Mat copyMat; |
| | | std::string imageName = p_this->m_fFmpegDecoderJPG.GetImageName(); |
| | |
| | | } else { |
| | | |
| | | // 根据reopenTime判断是否需要重启 |
| | | if (reopenTime < 0) { |
| | | if (p_this->reopenTime < 0) { |
| | | p_this->m_running = false; |
| | | stop(); |
| | | INFO("grabFrame faild, element stopping"); |
| | | } else { |
| | | //todo 业务死锁 |
| | | usleep((6 - reopenTime--) * 1000000); |
| | | INFO("grabFrame faild, try reopen video, reopenTime:" << reopenTime); |
| | | usleep((6 - p_this->reopenTime--) * 1000000); |
| | | INFO("grabFrame faild, try reopen video, reopenTime:" << p_this->reopenTime); |
| | | |
| | | //关闭ffmpeg解码模块 |
| | | p_this->m_fFmpegDecoderJPG.stopThd(); |