Add new error type - WEBRTC_ERROR_NETWORK_RESOURCE_FAILED 57/289457/5
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 8 Mar 2023 02:08:49 +0000 (11:08 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 20 Mar 2023 03:01:51 +0000 (12:01 +0900)
[Version] 0.4.2
[Issue type] API

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

index 44a46f5f8f86769b36eefbce817b88a6c30f737e..e1a93c48fbd8ffb9bd60bf4f498a0744c6f59a04 100644 (file)
@@ -58,6 +58,7 @@ typedef enum {
        WEBRTC_ERROR_STREAM_FAILED = TIZEN_ERROR_MEDIA_WEBRTC | 0x03,        /**< Stream failed */
        WEBRTC_ERROR_RESOURCE_FAILED = TIZEN_ERROR_MEDIA_WEBRTC | 0x04,      /**< Resource failed */
        WEBRTC_ERROR_RESOURCE_CONFLICT = TIZEN_ERROR_MEDIA_WEBRTC | 0x05,    /**< Resource conflict */
+       WEBRTC_ERROR_NETWORK_RESOURCE_FAILED = TIZEN_ERROR_MEDIA_WEBRTC | 0x06,  /**< Network resource failed (Since 7.5) */
 } webrtc_error_e;
 
 /**
@@ -486,7 +487,8 @@ typedef struct {
  *          #WEBRTC_ERROR_CONNECTION_FAILED\n
  *          #WEBRTC_ERROR_STREAM_FAILED\n
  *          #WEBRTC_ERROR_RESOURCE_FAILED\n
- *          #WEBRTC_ERROR_RESOURCE_CONFLICT
+ *          #WEBRTC_ERROR_RESOURCE_CONFLICT\n
+ *          #WEBRTC_ERROR_NETWORK_RESOURCE_FAILED (Since 7.5)
  * @since_tizen 6.5
  * @remarks The @a webrtc is the same object for which the callback was set.\n
  *          The @a webrtc should not be released.
index c461f43d7b605fe6b3856ea8ca09f15287e5172b..75c8872c9c18f30d477818e3ac31bf89a40ef80b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.4.1
+Version:    0.4.2
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index c119dc628a26929085dbd1127b1b6f49f3fdfc0b..b871a36c4c97a0029633613a4ff6b417928023b5 100644 (file)
@@ -123,6 +123,8 @@ static const char *__get_error_string(webrtc_error_e error)
                return "RESOURCE_FAILED";
        case WEBRTC_ERROR_RESOURCE_CONFLICT:
                return "RESOURCE_CONFLICT";
+       case WEBRTC_ERROR_NETWORK_RESOURCE_FAILED:
+               return "NETWORK_RESOURCE_FAILED";
        default:
                LOG_ERROR_IF_REACHED("invalid error(0x%x)", error);
                return "(invalid error)";
@@ -551,10 +553,14 @@ static gboolean __bus_watch_cb(GstBus *bus, GstMessage *message, gpointer user_d
                        webrtc, GST_OBJECT_NAME(GST_OBJECT_CAST(GST_ELEMENT(GST_MESSAGE_SRC(message)))),
                        err->message, err->code, debug ? debug : "none");
 
-               if (err->domain == GST_RESOURCE_ERROR)
-                       error = WEBRTC_ERROR_RESOURCE_FAILED;
-               else if (err->domain == GST_STREAM_ERROR)
+               if (err->domain == GST_RESOURCE_ERROR) {
+                       if (debug && g_strrstr(debug, "timeout"))
+                               error = WEBRTC_ERROR_NETWORK_RESOURCE_FAILED;
+                       else
+                               error = WEBRTC_ERROR_RESOURCE_FAILED;
+               } else if (err->domain == GST_STREAM_ERROR) {
                        error = WEBRTC_ERROR_STREAM_FAILED;
+               }
 
                __invoke_error_cb(webrtc, error);
                break;