#include "PushStreamAppPipeController.h"
|
#include <basic/util/app/AppPreference.hpp>
|
#include <basic/util/app/AppUtil.h>
|
//#include <sstream>
|
#include <algorithm>
|
#include <basic/util/app/AppConfig.h>
|
|
PushStreamAppPipeController::PushStreamAppPipeController(std::string &chanPubID, int fps,
|
int streamTransType,
|
int gpuIdx, RtspAnalysManager *manager) :
|
videoCaptureElement(chanPubID, fps, streamTransType, gpuIdx, manager),
|
index(chanPubID),
|
videoPublishElement(nullptr) {
|
|
// string path = appConfig.getStringProperty("srsAddr") + "cam" + chanPubID + ".flv";
|
// cv::Size size_(appConfig.getIntProperty("pulish.width"), appConfig.getIntProperty("pulish.height"));
|
// int gupIdx = appPref.getIntData("gpu.index");
|
// videoPublishElement = new ffmpeg::VideoPublishElement(path, size_, "flv", 25, gupIdx);
|
// if (appConfig.getIntProperty("pulish.width") < 0 || appConfig.getIntProperty("pulish.height") < 0) {
|
// ERR("pulish.width: " << appConfig.getIntProperty("pulish.width") << " Height: "
|
// << appConfig.getIntProperty("pulish.height"));
|
// }
|
// videoCaptureElement.registerConnector([&] {
|
// //if(!videoPublishElement.isBusy()){
|
// videoPublishElement->setImage(videoCaptureElement.getImage());
|
// //videoPublishElement.submit();
|
// //}
|
// });
|
|
registerElement(videoCaptureElement);
|
// registerElement(*videoPublishElement);
|
|
// videoCaptureElement.setOutPutInterval(3);
|
}
|
|
std::string PushStreamAppPipeController::getRtmp() {
|
//#todo videoPublishElement is nullptr
|
std::string ret = "";// videoPublishElement->getPath();
|
size_t pos = ret.find(".flv");
|
ret = ret.substr(0, pos);
|
INFO(ret);
|
return ret;
|
}
|
|
void PushStreamAppPipeController::SaveVideo(const std::string &strImageName) {
|
videoCaptureElement.SaveVideo(strImageName);
|
}
|
|
void PushStreamAppPipeController::SetVideoMinMaxSeconds(const int minSeconds, const int maxSeconds) {
|
videoCaptureElement.SetVideoMinMaxSeconds(minSeconds, maxSeconds);
|
}
|
|
void PushStreamAppPipeController::startPublishVideo() {
|
videoCaptureElement.startPublishVideo();
|
}
|
|
void PushStreamAppPipeController::stopPublishVideo() {
|
|
videoCaptureElement.stopPublishVideo();
|
}
|