[1.0.3][RIST] combine receiver address and bonding address 16/281816/3 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.061503 accepted/tizen/7.0/unified/hotfix/20221116.104734 accepted/tizen/unified/20220927.132317 tizen_7.0_m2_release
authorGilbok Lee <gilbok.lee@samsung.com>
Thu, 22 Sep 2022 06:07:46 +0000 (15:07 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Fri, 23 Sep 2022 05:18:52 +0000 (14:18 +0900)
Change-Id: I98e2694c20a2f011198b87a74c69c19b28e0d911

include/MediaTransporterSenderRist.h
packaging/capi-media-transporter.spec
src/MediaTransporterSenderRist.cpp

index 0aba474..9a6785b 100644 (file)
@@ -51,6 +51,8 @@ public:
        mtprConnectionType type() override { return MTPR_CONNECTION_TYPE_RIST_SENDER; }
 
 private:
+       std::string _getCombinedAddress();
+
        struct MtprConnectionParamRist {
                std::string bondingAddress;
                double maxRtcpBandwidth { DEFAULT_MAX_RTCP_BANDWIDTH };
index 46e733a..3f42f7a 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-transporter
 Summary:    A Media Transporter library in Tizen Native API
-Version:    1.0.2
+Version:    1.0.3
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index ebc0e76..98f4780 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#include <sstream>
 #include "MediaTransporterBase.h"
 #include "MediaTransporterException.h"
 #include "MediaTransporterSenderRist.h"
@@ -38,6 +39,25 @@ MediaTransporterSenderRist::~MediaTransporterSenderRist()
        LOG_DEBUG("dtor: %p", this);
 }
 
+std::string MediaTransporterSenderRist::_getCombinedAddress()
+{
+       if (_connectionParam.bondingAddress.empty())
+               return _receiverAddress;
+
+       std::string combineAddr = _receiverAddress + ",";
+       std::stringstream addr(_connectionParam.bondingAddress);
+       std::string token;
+       while (getline(addr, token, ',')) {
+               if (token != _receiverAddress)
+                       combineAddr = combineAddr + token + ",";
+       }
+
+       if (combineAddr.back() == ',')
+               combineAddr.pop_back();
+
+       return combineAddr;
+}
+
 void MediaTransporterSenderRist::buildPipeline()
 {
        GstElement* mux = NULL;
@@ -56,7 +76,9 @@ void MediaTransporterSenderRist::buildPipeline()
                g_object_set(G_OBJECT(mux), "alignment", 7, NULL);
 
                sink = gst::_createElement(gst::DEFAULT_ELEMENT_RISTSINK);
-               g_object_set(G_OBJECT(sink), "bonding-addresses", _receiverAddress.c_str(), NULL);
+               std::string setAddr = _getCombinedAddress();
+               SECURE_LOG_INFO("set bonding addresses = %s", setAddr.c_str());
+               g_object_set(G_OBJECT(sink), "bonding-addresses", setAddr.c_str(), NULL);
 
                if (_connectionParam.maxRtcpBandwidth != DEFAULT_MAX_RTCP_BANDWIDTH)
                        g_object_set(G_OBJECT(sink), "max-rtcp-bandwidth", _connectionParam.maxRtcpBandwidth, NULL);