[0.0.6] add media transporter param 91/280691/1
authorEunhye Choi <eunhae1.choi@samsung.com>
Fri, 2 Sep 2022 08:21:36 +0000 (17:21 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Fri, 2 Sep 2022 08:22:06 +0000 (17:22 +0900)
- add param to remove duplicated code

Change-Id: Idcced37255cb93d51be2f8a959bafc69b9404a7b

14 files changed:
include/MediaSourceBinAudioTest.h
include/MediaSourceBinCamera.h
include/MediaSourceBinMic.h
include/MediaSourceBinVideoTest.h
include/MediaTransporterParam.h [new file with mode: 0644]
include/mtpr.h
packaging/capi-media-transporter.spec
src/MediaSourceBinAudioTest.cpp
src/MediaSourceBinCamera.cpp
src/MediaSourceBinMic.cpp
src/MediaSourceBinVideoTest.cpp
src/MediaTransporterParam.cpp [new file with mode: 0644]
src/MediaTransporterReceiver.cpp
test/mtpr_test.c

index 0cf315c..e28c87c 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "MediaTransporter.h"
 #include "MediaTransporterGst.h"
+#include "MediaTransporterParam.h"
 #include "MediaSourceBinBase.h"
 
 namespace tizen_media_transporter {
@@ -38,25 +39,14 @@ public:
        MediaSourceBinInfo generate() override;
 
 private:
-       void parseSourceParam(bundle* params);
        GstElement* createMicSource();
        void setEncoderParam(gst::GstElements& elements);
        void setSourceParam(gst::GstElements& elements);
        void replaceCapsWithAudioInfo(GstElement* element);
        void replaceEncCapsWithAudioInfo(GstElement* element);
 
-       struct audioInfo {
-               int channel { -1 };
-               int rate { -1 };
-               std::string format;
-       };
-       audioInfo _audioInfo;
-
-       struct encodingInfo {
-               int bitrate = 0;
-       };
-       encodingInfo _encInfo;
-
+       param::audioInfo _audioInfo;
+       param::encodingInfo _encInfo;
 };
 
 } // namespace
index caddb6c..3256ad5 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "MediaTransporter.h"
 #include "MediaTransporterGst.h"
+#include "MediaTransporterParam.h"
 #include "MediaSourceBinBase.h"
 
 namespace tizen_media_transporter {
@@ -38,25 +39,14 @@ public:
        MediaSourceBinInfo generate() override;
 
 private:
-       void parseSourceParam(bundle* params);
        GstElement* createCameraSource();
        void setEncoderParam(gst::GstElements& elements);
        void setSourceParam(gst::GstElements& elements);
        void replaceCapsWithVideoInfo(GstElement* element);
        void replaceEncCapsWithVideoInfo(GstElement* element);
 
-       struct videoInfo {
-               int width { -1 };
-               int height { -1 };
-               int frameRate { -1 };
-       };
-       videoInfo _videoInfo;
-
-       struct encodingInfo {
-               int bitrate { 0 };
-       };
-       encodingInfo _encInfo;
-
+       param::videoInfo _videoInfo;
+       param::encodingInfo _encInfo;
 };
 
 } // namespace
index 2520b1c..b5b3b44 100644 (file)
@@ -25,8 +25,9 @@
 #include <sound_manager.h>
 
 #include "MediaTransporter.h"
-#include "MediaSourceBinBase.h"
 #include "MediaTransporterGst.h"
+#include "MediaTransporterParam.h"
+#include "MediaSourceBinBase.h"
 
 namespace tizen_media_transporter {
 
@@ -42,24 +43,14 @@ public:
        void setSoundStreamInfo(sound_stream_info_h streamInfo);
 
 private:
-       void parseSourceParam(bundle* params);
        GstElement* createMicSource();
        void setEncoderParam(gst::GstElements& elements);
        void setSourceParam(gst::GstElements& elements);
        void replaceCapsWithAudioInfo(GstElement* element);
        void replaceEncCapsWithAudioInfo(GstElement* element);
 
-       struct audioInfo {
-               int channel { -1 };
-               int rate { -1 };
-               std::string format;
-       };
-       audioInfo _audioInfo;
-
-       struct encodingInfo {
-               int bitrate { 0 };
-       };
-       encodingInfo _encInfo;
+       param::audioInfo _audioInfo;
+       param::encodingInfo _encInfo;
 
        std::string _streamInfo;
 };
index b8dbefc..eb6b31f 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "MediaTransporter.h"
 #include "MediaTransporterGst.h"
+#include "MediaTransporterParam.h"
 #include "MediaSourceBinBase.h"
 
 namespace tizen_media_transporter {
@@ -38,25 +39,14 @@ public:
        MediaSourceBinInfo generate() override;
 
 private:
-       void parseSourceParam(bundle* params);
        GstElement* createVideoTestSource();
        void setEncoderParam(gst::GstElements& elements);
        void setSourceParam(gst::GstElements& elements);
        void replaceCapsWithVideoInfo(GstElement* element);
        void replaceEncCapsWithVideoInfo(GstElement* element);
 
-       struct videoInfo {
-               int width { -1 };
-               int height { -1 };
-               int frameRate { -1 };
-       };
-       videoInfo _videoInfo;
-
-       struct encodingInfo {
-               int bitrate { 0 };
-       };
-       encodingInfo _encInfo;
-
+       param::videoInfo _videoInfo;
+       param::encodingInfo _encInfo;
 };
 
 } // namespace
diff --git a/include/MediaTransporterParam.h b/include/MediaTransporterParam.h
new file mode 100644 (file)
index 0000000..2b50853
--- /dev/null
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __TIZEN_MEDIA_TRANSPORTER_PARAM_H__
+#define __TIZEN_MEDIA_TRANSPORTER_PARAM_H__
+
+#ifdef __cplusplus
+
+#include <glib.h>
+#include <bundle.h>
+
+namespace tizen_media_transporter {
+namespace param {
+
+struct videoInfo {
+  int width { -1 };
+  int height { -1 };
+  int frameRate { -1 };
+};
+
+struct audioInfo {
+  int channel { -1 };
+  int rate { -1 };
+  std::string format;
+};
+
+struct encodingInfo {
+  int bitrate = 0;
+};
+
+void parseSourceParam(bundle* params, videoInfo* vInfo, encodingInfo* eInfo);
+void parseSourceParam(bundle* params, audioInfo* aInfo, encodingInfo * eInfo);
+}; // param
+
+} // tizen_media_transporter
+
+#endif // __cplusplus
+#endif // __TIZEN_MEDIA_TRANSPORTER_PARAM_H__
index 34de8df..2239968 100644 (file)
@@ -135,7 +135,8 @@ typedef enum {
 
 /**
  * @brief Definition for password parameter of SRT.
- * @details The password for the encrypted transmission of SRT.
+ * @details The password for the encrypted transmission of SRT.\n
+ *          The number of characters must be 10 to 79.
  * @since_tizen 7.0
  * @remarks This is write only parameter.
  * @see mtpr_set_connection_params()
index 8bff4b8..b77dfe5 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-transporter
 Summary:    A Media Transporter library in Tizen Native API
-Version:    0.0.5
+Version:    0.0.6
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 91369d1..27a49c2 100644 (file)
@@ -18,6 +18,7 @@
 #include "MediaTransporterLog.h"
 #include "MediaTransporterException.h"
 #include "MediaTransporterParseIni.h"
+#include "MediaTransporterParam.h"
 
 #include <algorithm>
 
@@ -26,43 +27,7 @@ using namespace tizen_media_transporter;
 
 MediaSourceBinAudioTest::MediaSourceBinAudioTest(bundle* params)
 {
-       parseSourceParam(params);
-}
-
-void MediaSourceBinAudioTest::parseSourceParam(bundle* params)
-{
-       int written_count = 0;
-       char* string_val = NULL;
-
-       RET_IF(!params, "input param is NULL");
-
-       /* Will be move to mic/audiotest bin */
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_AUDIO_CHANNEL, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _audioInfo.channel = static_cast<int>(strtoul(string_val, NULL, 10));
-               LOG_DEBUG("Source param audio channel %u", _audioInfo.channel);
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_AUDIO_RATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _audioInfo.rate = static_cast<int>(strtoul(string_val, NULL, 10));
-               LOG_DEBUG("Source param audio rate %u", _audioInfo.rate);
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_AUDIO_FORMAT, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _audioInfo.format = string_val;
-               LOG_DEBUG("Source param audio format %s", _audioInfo.format.c_str());
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_ENCODING_PARAM_BITRATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _encInfo.bitrate = (guint)strtoul(string_val, NULL, 10);
-               LOG_DEBUG("Encoder target bitrate %u", _encInfo.bitrate);
-               written_count++;
-       }
-
-       if (written_count == 0)
-               throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION, "Failed to parse Source Param");
+       param::parseSourceParam(params, &_audioInfo, &_encInfo);
 }
 
 GstElement* MediaSourceBinAudioTest::createMicSource()
index 0d66f1a..b45f448 100644 (file)
@@ -19,6 +19,7 @@
 #include "MediaTransporterException.h"
 #include "MediaTransporterParseIni.h"
 #include "MediaTransporterUtil.h"
+#include "MediaTransporterParam.h"
 
 #include <algorithm>
 
@@ -30,42 +31,7 @@ MediaSourceBinCamera::MediaSourceBinCamera(bundle* params)
        util::throwIfFeatureNotSupported(util::MTPR_FEATURE_CAMERA);
        util::throwIfNotPrivileged(util::MTPR_PRIVILEGE_CAMERA);
 
-       parseSourceParam(params);
-}
-
-void MediaSourceBinCamera::parseSourceParam(bundle* params)
-{
-       int written_count = 0;
-       char* string_val = NULL;
-
-       RET_IF(!params, "input param is NULL");
-
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_VIDEO_WIDTH, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _videoInfo.width = static_cast<int>(strtoul(string_val, NULL, 10));
-               LOG_DEBUG("Source param video width %u", _videoInfo.width);
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_VIDEO_HEIGHT, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _videoInfo.height = static_cast<int>(strtoul(string_val, NULL, 10));
-               LOG_DEBUG("Source param video height %u", _videoInfo.height);
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_VIDEO_FRAMERATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _videoInfo.frameRate = static_cast<int>(strtoul(string_val, NULL, 10));
-               LOG_DEBUG("Source param video framerate %u", _videoInfo.frameRate);
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_ENCODING_PARAM_BITRATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _encInfo.bitrate = (guint)strtoul(string_val, NULL, 10);
-               LOG_DEBUG("Encoder target bitrate %u", _encInfo.bitrate);
-               written_count++;
-       }
-
-       if (written_count == 0)
-               throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION, "Failed to parse Source Param");
+       param::parseSourceParam(params, &_videoInfo, &_encInfo);
 }
 
 GstElement* MediaSourceBinCamera::createCameraSource()
@@ -184,7 +150,7 @@ MediaSourceBinInfo MediaSourceBinCamera::generate()
        try {
                elements.push_back(createCameraSource());
 
-               auto created = createVideoRestOfElements(MediaTransporterIni::get().mediaSource(static_cast<int>(MTPR_SOURCE_TYPE_CAMERA))); // FIXME
+               auto created = createVideoRestOfElements(MediaTransporterIni::get().mediaSource(static_cast<int>(MTPR_SOURCE_TYPE_CAMERA)));
                std::copy(created.begin(), created.end(), std::back_inserter(elements));
 
                setSourceParam(elements);
index 4ea6af1..cd53891 100644 (file)
@@ -19,6 +19,7 @@
 #include "MediaTransporterException.h"
 #include "MediaTransporterParseIni.h"
 #include "MediaTransporterUtil.h"
+#include "MediaTransporterParam.h"
 
 #include <sound_manager_internal.h>
 #include <pulse/proplist.h>
@@ -33,43 +34,7 @@ MediaSourceBinMic::MediaSourceBinMic(bundle* params)
        util::throwIfFeatureNotSupported(util::MTPR_FEATURE_MICROPHONE);
        util::throwIfNotPrivileged(util::MTPR_PRIVILEGE_RECORDER);
 
-       parseSourceParam(params);
-}
-
-void MediaSourceBinMic::parseSourceParam(bundle* params)
-{
-       int written_count = 0;
-       char* string_val = NULL;
-
-       RET_IF(!params, "input param is NULL");
-
-       /* Will be move to mic/audiotest bin */
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_AUDIO_CHANNEL, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _audioInfo.channel = static_cast<int>(strtoul(string_val, NULL, 10));
-               LOG_DEBUG("Source param audio channel %u", _audioInfo.channel);
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_AUDIO_RATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _audioInfo.rate = static_cast<int>(strtoul(string_val, NULL, 10));
-               LOG_DEBUG("Source param audio rate %u", _audioInfo.rate);
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_AUDIO_FORMAT, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _audioInfo.format = string_val;
-               LOG_DEBUG("Source param audio format %s", _audioInfo.format.c_str());
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_ENCODING_PARAM_BITRATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _encInfo.bitrate = (guint)strtoul(string_val, NULL, 10);
-               LOG_DEBUG("Encoder target bitrate %u", _encInfo.bitrate);
-               written_count++;
-       }
-
-       if (written_count == 0)
-               throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION, "Failed to parse Source Param");
+       param::parseSourceParam(params, &_audioInfo, &_encInfo);
 }
 
 GstElement* MediaSourceBinMic::createMicSource()
index 179d7f6..74b0228 100644 (file)
@@ -18,6 +18,7 @@
 #include "MediaTransporterLog.h"
 #include "MediaTransporterException.h"
 #include "MediaTransporterParseIni.h"
+#include "MediaTransporterParam.h"
 
 #include <algorithm>
 
@@ -26,42 +27,7 @@ using namespace tizen_media_transporter;
 
 MediaSourceBinVideoTest::MediaSourceBinVideoTest(bundle* params)
 {
-       parseSourceParam(params);
-}
-
-void MediaSourceBinVideoTest::parseSourceParam(bundle* params)
-{
-       int written_count = 0;
-       char* string_val = NULL;
-
-       RET_IF(!params, "input param is NULL");
-
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_VIDEO_WIDTH, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _videoInfo.width = static_cast<int>(strtoul(string_val, NULL, 10));
-               LOG_DEBUG("Source param video width %u", _videoInfo.width);
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_VIDEO_HEIGHT, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _videoInfo.height = static_cast<int>(strtoul(string_val, NULL, 10));
-               LOG_DEBUG("Source param video height %u", _videoInfo.height);
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_SOURCE_PARAM_VIDEO_FRAMERATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _videoInfo.frameRate = static_cast<int>(strtoul(string_val, NULL, 10));
-               LOG_DEBUG("Source param video framerate %u", _videoInfo.frameRate);
-               written_count++;
-       }
-
-       if (bundle_get_str(params, MTPR_ENCODING_PARAM_BITRATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
-               _encInfo.bitrate = (guint)strtoul(string_val, NULL, 10);
-               LOG_DEBUG("Encoder target bitrate %u", _encInfo.bitrate);
-               written_count++;
-       }
-
-       if (written_count == 0)
-               throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION, "Failed to parse Source Param");
+       param::parseSourceParam(params, &_videoInfo, &_encInfo);
 }
 
 GstElement* MediaSourceBinVideoTest::createVideoTestSource()
diff --git a/src/MediaTransporterParam.cpp b/src/MediaTransporterParam.cpp
new file mode 100644 (file)
index 0000000..b29ae5a
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <iostream>
+#include <string>
+#include <algorithm>
+#include "mtpr.h"
+#include "MediaTransporterParam.h"
+#include "MediaTransporterException.h"
+#include "MediaTransporterLog.h"
+
+using namespace tizen_media_transporter;
+
+void param::parseSourceParam(bundle* params, param::videoInfo* vInfo, param::encodingInfo* eInfo)
+{
+       int written_count = 0;
+       char* string_val = NULL;
+
+       RET_IF(!params, "input param is NULL");
+
+       if (bundle_get_str(params, MTPR_SOURCE_PARAM_VIDEO_WIDTH, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
+               vInfo->width = static_cast<int>(strtoul(string_val, NULL, 10));
+               LOG_DEBUG("Source param video width %u", vInfo->width);
+               written_count++;
+       }
+
+       if (bundle_get_str(params, MTPR_SOURCE_PARAM_VIDEO_HEIGHT, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
+               vInfo->height = static_cast<int>(strtoul(string_val, NULL, 10));
+               LOG_DEBUG("Source param video height %u", vInfo->height);
+               written_count++;
+       }
+
+       if (bundle_get_str(params, MTPR_SOURCE_PARAM_VIDEO_FRAMERATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
+               vInfo->frameRate = static_cast<int>(strtoul(string_val, NULL, 10));
+               LOG_DEBUG("Source param video framerate %u", vInfo->frameRate);
+               written_count++;
+       }
+
+       if (bundle_get_str(params, MTPR_ENCODING_PARAM_BITRATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
+               eInfo->bitrate = (guint)strtoul(string_val, NULL, 10);
+               LOG_DEBUG("Encoder target bitrate %u", eInfo->bitrate);
+               written_count++;
+       }
+
+       if (written_count == 0)
+               throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION, "Failed to parse Source Param");
+}
+
+void param::parseSourceParam(bundle* params, param::audioInfo* aInfo, param::encodingInfo* eInfo)
+{
+       int written_count = 0;
+       char* string_val = NULL;
+
+       RET_IF(!params, "input param is NULL");
+
+       /* Will be move to mic/audiotest bin */
+       if (bundle_get_str(params, MTPR_SOURCE_PARAM_AUDIO_CHANNEL, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
+               aInfo->channel = static_cast<int>(strtoul(string_val, NULL, 10));
+               LOG_DEBUG("Source param audio channel %u", aInfo->channel);
+               written_count++;
+       }
+
+       if (bundle_get_str(params, MTPR_SOURCE_PARAM_AUDIO_RATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
+               aInfo->rate = static_cast<int>(strtoul(string_val, NULL, 10));
+               LOG_DEBUG("Source param audio rate %u", aInfo->rate);
+               written_count++;
+       }
+
+       if (bundle_get_str(params, MTPR_SOURCE_PARAM_AUDIO_FORMAT, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
+               aInfo->format = string_val;
+               LOG_DEBUG("Source param audio format %s", aInfo->format.c_str());
+               written_count++;
+       }
+
+       if (bundle_get_str(params, MTPR_ENCODING_PARAM_BITRATE, &string_val) != BUNDLE_ERROR_KEY_NOT_AVAILABLE) {
+               eInfo->bitrate = (guint)strtoul(string_val, NULL, 10);
+               LOG_DEBUG("Encoder target bitrate %u", eInfo->bitrate);
+               written_count++;
+       }
+
+       if (written_count == 0)
+               throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION, "Failed to parse Source Param");
+}
index 1bd0ef2..e24f6e8 100644 (file)
@@ -184,7 +184,7 @@ static void _setCodecDataIfExist(media_packet_h packet, GstPad* pad)
                if (ret != MEDIA_PACKET_ERROR_NONE)
                        LOG_ERROR("failed to media_packet_set_codec_data()");
                else
-                       LOG_DEBUG("codec_data[%p, size:%" G_GSIZE_FORMAT "] is set to the media packet[%p]",
+                       LOG_VERBOSE("codec_data[%p, size:%" G_GSIZE_FORMAT "] is set to the media packet[%p]",
                                        buff_info.data, buff_info.size, packet);
 
                gst_buffer_unmap(codec_data, &buff_info);
index 473c66e..e10be22 100644 (file)
@@ -952,7 +952,7 @@ static void displaymenu()
                display_sub_basic();
        } else if (g_menu_state == CURRENT_STATUS_CONNECTION_TYPE) {
                g_print("*** Input connection type.\n\
-    (1:RIST_SENDER, 2:RIST_RECEIVER, 3:SRT_SENDER, 4:SRT_RECEIVER, 5:RTSP_SENDER, 6:RTSP_SENDER_TO_SERVER)\n");
+    (0:RIST_SENDER, 1:RIST_RECEIVER, 2:SRT_SENDER, 3:SRT_RECEIVER, 4:RTSP_SENDER, 5:RTSP_SENDER_TO_SERVER)\n");
        } else if (g_menu_state == CURRENT_STATUS_SENDER_ADDRESS) {
                g_print("*** Input sender address:\n");
        } else if (g_menu_state == CURRENT_STATUS_RECEIVER_ADDRESS) {
@@ -1040,7 +1040,7 @@ static void interpret(char *cmd)
                break;
        case CURRENT_STATUS_CONNECTION_TYPE: {
                value = atoi(cmd);
-               _mtpr_test_create(value - 1);
+               _mtpr_test_create(value);
                reset_menu_state();
                break;
        }