From 0f6716eae43ad6f4c14e94b93687d72bfb994441 Mon Sep 17 00:00:00 2001 From: Eunhye Choi Date: Fri, 2 Sep 2022 17:21:36 +0900 Subject: [PATCH] [0.0.6] add media transporter param - add param to remove duplicated code Change-Id: Idcced37255cb93d51be2f8a959bafc69b9404a7b --- include/MediaSourceBinAudioTest.h | 16 ++---- include/MediaSourceBinCamera.h | 16 ++---- include/MediaSourceBinMic.h | 17 ++----- include/MediaSourceBinVideoTest.h | 16 ++---- include/MediaTransporterParam.h | 51 +++++++++++++++++++ include/mtpr.h | 3 +- packaging/capi-media-transporter.spec | 2 +- src/MediaSourceBinAudioTest.cpp | 39 +------------- src/MediaSourceBinCamera.cpp | 40 ++------------- src/MediaSourceBinMic.cpp | 39 +------------- src/MediaSourceBinVideoTest.cpp | 38 +------------- src/MediaTransporterParam.cpp | 96 +++++++++++++++++++++++++++++++++++ src/MediaTransporterReceiver.cpp | 2 +- test/mtpr_test.c | 4 +- 14 files changed, 175 insertions(+), 204 deletions(-) create mode 100644 include/MediaTransporterParam.h create mode 100644 src/MediaTransporterParam.cpp diff --git a/include/MediaSourceBinAudioTest.h b/include/MediaSourceBinAudioTest.h index 0cf315c..e28c87c 100644 --- a/include/MediaSourceBinAudioTest.h +++ b/include/MediaSourceBinAudioTest.h @@ -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 diff --git a/include/MediaSourceBinCamera.h b/include/MediaSourceBinCamera.h index caddb6c..3256ad5 100644 --- a/include/MediaSourceBinCamera.h +++ b/include/MediaSourceBinCamera.h @@ -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 diff --git a/include/MediaSourceBinMic.h b/include/MediaSourceBinMic.h index 2520b1c..b5b3b44 100644 --- a/include/MediaSourceBinMic.h +++ b/include/MediaSourceBinMic.h @@ -25,8 +25,9 @@ #include #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; }; diff --git a/include/MediaSourceBinVideoTest.h b/include/MediaSourceBinVideoTest.h index b8dbefc..eb6b31f 100644 --- a/include/MediaSourceBinVideoTest.h +++ b/include/MediaSourceBinVideoTest.h @@ -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 index 0000000..2b50853 --- /dev/null +++ b/include/MediaTransporterParam.h @@ -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 +#include + +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__ diff --git a/include/mtpr.h b/include/mtpr.h index 34de8df..2239968 100644 --- a/include/mtpr.h +++ b/include/mtpr.h @@ -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() diff --git a/packaging/capi-media-transporter.spec b/packaging/capi-media-transporter.spec index 8bff4b8..b77dfe5 100644 --- a/packaging/capi-media-transporter.spec +++ b/packaging/capi-media-transporter.spec @@ -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 diff --git a/src/MediaSourceBinAudioTest.cpp b/src/MediaSourceBinAudioTest.cpp index 91369d1..27a49c2 100644 --- a/src/MediaSourceBinAudioTest.cpp +++ b/src/MediaSourceBinAudioTest.cpp @@ -18,6 +18,7 @@ #include "MediaTransporterLog.h" #include "MediaTransporterException.h" #include "MediaTransporterParseIni.h" +#include "MediaTransporterParam.h" #include @@ -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(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(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() diff --git a/src/MediaSourceBinCamera.cpp b/src/MediaSourceBinCamera.cpp index 0d66f1a..b45f448 100644 --- a/src/MediaSourceBinCamera.cpp +++ b/src/MediaSourceBinCamera.cpp @@ -19,6 +19,7 @@ #include "MediaTransporterException.h" #include "MediaTransporterParseIni.h" #include "MediaTransporterUtil.h" +#include "MediaTransporterParam.h" #include @@ -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(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(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(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(MTPR_SOURCE_TYPE_CAMERA))); // FIXME + auto created = createVideoRestOfElements(MediaTransporterIni::get().mediaSource(static_cast(MTPR_SOURCE_TYPE_CAMERA))); std::copy(created.begin(), created.end(), std::back_inserter(elements)); setSourceParam(elements); diff --git a/src/MediaSourceBinMic.cpp b/src/MediaSourceBinMic.cpp index 4ea6af1..cd53891 100644 --- a/src/MediaSourceBinMic.cpp +++ b/src/MediaSourceBinMic.cpp @@ -19,6 +19,7 @@ #include "MediaTransporterException.h" #include "MediaTransporterParseIni.h" #include "MediaTransporterUtil.h" +#include "MediaTransporterParam.h" #include #include @@ -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(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(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() diff --git a/src/MediaSourceBinVideoTest.cpp b/src/MediaSourceBinVideoTest.cpp index 179d7f6..74b0228 100644 --- a/src/MediaSourceBinVideoTest.cpp +++ b/src/MediaSourceBinVideoTest.cpp @@ -18,6 +18,7 @@ #include "MediaTransporterLog.h" #include "MediaTransporterException.h" #include "MediaTransporterParseIni.h" +#include "MediaTransporterParam.h" #include @@ -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(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(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(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 index 0000000..b29ae5a --- /dev/null +++ b/src/MediaTransporterParam.cpp @@ -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 +#include +#include +#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(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(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(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(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(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"); +} diff --git a/src/MediaTransporterReceiver.cpp b/src/MediaTransporterReceiver.cpp index 1bd0ef2..e24f6e8 100644 --- a/src/MediaTransporterReceiver.cpp +++ b/src/MediaTransporterReceiver.cpp @@ -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); diff --git a/test/mtpr_test.c b/test/mtpr_test.c index 473c66e..e10be22 100644 --- a/test/mtpr_test.c +++ b/test/mtpr_test.c @@ -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; } -- 2.7.4