webrtc_source: Return error when loopback pipeline has already been set 23/265023/2
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 7 Oct 2021 08:08:39 +0000 (17:08 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 7 Oct 2021 08:16:39 +0000 (17:16 +0900)
[Version] 0.2.116
[Issue Type] Bug fix

Change-Id: Ie6b408cfb75cc7a827a94b068e8d0042a064cb3a
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
src/webrtc_source.c

index 6fbc5c7055656c35bfd27173ae5245907b1d6bb1..db161ffda9407bd9ebaaddc14b0e814e4b074dd3 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.2.115
+Version:    0.2.116
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 915382debb9cf48dfb3adf03642c6c8d40d3f8d8..55a99ecdb43ec7bd1b47abbcd889326bb2b80ecb 100644 (file)
@@ -3943,6 +3943,7 @@ int _set_audio_loopback(webrtc_s *webrtc, unsigned int source_id, sound_stream_i
        RET_VAL_IF((source->type == WEBRTC_MEDIA_SOURCE_TYPE_MEDIA_PACKET), WEBRTC_ERROR_INVALID_PARAMETER,
                "this API does not support the media packet source");
        RET_VAL_IF(stream_info == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "stream_info is NULL");
+       RET_VAL_IF(source->av[AV_IDX_AUDIO].render.pipeline, WEBRTC_ERROR_INVALID_OPERATION, "audio loopback has already been set");
 
        LOG_INFO("source_id[%u] stream_info[%p]", source_id, stream_info);
 
@@ -3982,6 +3983,7 @@ int _set_video_loopback(webrtc_s *webrtc, unsigned int source_id, unsigned int t
                "invalid media_type for source[media_types:0x%x, id:%u]", source->media_types, source_id);
        RET_VAL_IF((source->type == WEBRTC_MEDIA_SOURCE_TYPE_MEDIA_PACKET), WEBRTC_ERROR_INVALID_PARAMETER,
                "this API does not support the media packet source");
+       RET_VAL_IF(source->av[AV_IDX_VIDEO].render.pipeline, WEBRTC_ERROR_INVALID_OPERATION, "video loopback has already been set");
 
        if (source->display == NULL) {
                source->display = _alloc_display();