From db043cb402515837303880cb0948d060e9d76490 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期一, 15 四月 2019 17:13:16 +0800
Subject: [PATCH] 整合代码
---
QiaoJiaSystem/VideoToImageMulth/pushStream/PushStreamAppPipeController.cpp | 42 ++++++++++++++++++++++++++----------------
1 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/QiaoJiaSystem/VideoToImageMulth/pushStream/PushStreamAppPipeController.cpp b/QiaoJiaSystem/VideoToImageMulth/pushStream/PushStreamAppPipeController.cpp
index 553a451..1c01b86 100644
--- a/QiaoJiaSystem/VideoToImageMulth/pushStream/PushStreamAppPipeController.cpp
+++ b/QiaoJiaSystem/VideoToImageMulth/pushStream/PushStreamAppPipeController.cpp
@@ -12,29 +12,30 @@
index(chanPubID),
videoPublishElement(nullptr) {
- string path = appConfig.getStringProperty("srsAddr") + "cam" + chanPubID + ".flv";
- cv::Size size_(appPref.getIntData("pulish.width"), appPref.getIntData("pulish.height"));
- int gupIdx = appPref.getLongData("gpu.index");
- videoPublishElement = new ffmpeg::VideoPublishElement(path, size_, "flv", 25, gupIdx);
- if (appPref.getIntData("pulish.width") < 0 || appPref.getIntData("pulish.height") < 0) {
- ERR("pulish.width: " << appPref.getIntData("pulish.width") << " Height: "
- << appPref.getIntData("pulish.height"));
- }
- videoCaptureElement.registerConnector([&] {
- //if(!videoPublishElement.isBusy()){
- videoPublishElement->setImage(videoCaptureElement.getImage());
- //videoPublishElement.submit();
- //}
- });
+// 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);
+// registerElement(*videoPublishElement);
// videoCaptureElement.setOutPutInterval(3);
}
std::string PushStreamAppPipeController::getRtmp() {
- std::string ret = videoPublishElement->getPath();
+ //#todo videoPublishElement is nullptr
+ std::string ret = "";// videoPublishElement->getPath();
size_t pos = ret.find(".flv");
ret = ret.substr(0, pos);
INFO(ret);
@@ -48,3 +49,12 @@
void PushStreamAppPipeController::SetVideoMinMaxSeconds(const int minSeconds, const int maxSeconds) {
videoCaptureElement.SetVideoMinMaxSeconds(minSeconds, maxSeconds);
}
+
+void PushStreamAppPipeController::startPublishVideo() {
+ videoCaptureElement.startPublishVideo();
+}
+
+void PushStreamAppPipeController::stopPublishVideo() {
+
+ videoCaptureElement.stopPublishVideo();
+}
--
Gitblit v1.8.0