From: Sangchul Lee Date: Wed, 8 Mar 2023 02:08:49 +0000 (+0900) Subject: Add new error type - WEBRTC_ERROR_NETWORK_RESOURCE_FAILED X-Git-Tag: accepted/tizen/unified/20230322.080551~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e25b078ebf28917d181cfdc24fe1272eb63cde8d;p=platform%2Fcore%2Fapi%2Fwebrtc.git Add new error type - WEBRTC_ERROR_NETWORK_RESOURCE_FAILED [Version] 0.4.2 [Issue type] API Change-Id: I640059cf94bac87fba28ef4e5ff37cadc6f86680 Signed-off-by: Sangchul Lee --- diff --git a/include/webrtc.h b/include/webrtc.h index 44a46f5f..e1a93c48 100644 --- a/include/webrtc.h +++ b/include/webrtc.h @@ -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. diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index c461f43d..75c8872c 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -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 diff --git a/src/webrtc_private.c b/src/webrtc_private.c index c119dc62..b871a36c 100644 --- a/src/webrtc_private.c +++ b/src/webrtc_private.c @@ -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;