webrtc_sink: Set channels or rate to media format even if only one has a valid value 97/290197/4
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 21 Mar 2023 08:59:08 +0000 (17:59 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 21 Mar 2023 23:51:58 +0000 (08:51 +0900)
More logs are added.

[Version] 0.4.4
[Issue Type] Improvement

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

index cb7c1119f9641f2f82343e99ce85c65dfaf46609..22bb7be1ecb931b1e0ad4c2ba8c007ddffb64fab 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.4.3
+Version:    0.4.4
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index d9c3df1f1243decd160a9928aafcc9cba90f58cd..7c9c9a3a13ad7a8ad6b104a6ef942a4859b78e3e 100644 (file)
@@ -821,7 +821,11 @@ static media_format_h __make_media_format(GstPad *pad)
                                LOG_ERROR("failed to media_format_set_video_width/height()");
                                goto error;
                        }
+                       LOG_INFO("width[%d] height[%d]", width, height);
+               } else {
+                       LOG_WARNING("width[%d] height[%d], skip setting it to media format", width, height);
                }
+
        } else if (mimetype & MEDIA_FORMAT_AUDIO) {
                gint channels = 0;
                gint rate = 0;
@@ -834,14 +838,24 @@ static media_format_h __make_media_format(GstPad *pad)
 
                gst_structure_get_int(structure, "channels", &channels);
                gst_structure_get_int(structure, "rate", &rate);
-               if (channels > 0 && rate > 0) {
-                       ret |= media_format_set_audio_channel(format, channels);
-                       ret |= media_format_set_audio_samplerate(format, rate);
+               if (channels > 0) {
+                       ret = media_format_set_audio_channel(format, channels);
+                       if (ret != MEDIA_FORMAT_ERROR_NONE) {
+                               LOG_ERROR("failed to media_format_set_audio_channel()");
+                               goto error;
+                       }
+                       LOG_INFO("channels[%d]", channels);
+               }
+               if (rate > 0) {
+                       ret = media_format_set_audio_samplerate(format, rate);
                        if (ret != MEDIA_FORMAT_ERROR_NONE) {
-                               LOG_ERROR("failed to media_format_set_audio_channel/samplerate()");
+                               LOG_ERROR("failed to media_format_set_audio_samplerate()");
                                goto error;
                        }
+                       LOG_INFO("rate[%d]", rate);
                }
+               if (channels <= 0 && rate <= 0)
+                       LOG_WARNING("channels[%d] rate[%d], skip setting it to media format", channels, rate);
        }
 
        gst_caps_unref(caps);