#define MICROPHONE_FEATURE "http://tizen.org/feature/microphone"
#define CAMERA_FEATURE "http://tizen.org/feature/camera"
+#define DISPLAY_FEATURE "http://tizen.org/feature/display"
#define TEST_DATA_CHANNEL_LABEL "test data channel"
#define TEST_STRING_DATA "test string"
#define TEST_BUFFER_SIZE 16
static char g_test_buffer[TEST_BUFFER_SIZE] = {'t', 'e', 's', 't', 'b', 'u', 'f', '\0', };
static bool g_bIsMicrophoneFeatureSupported;
static bool g_bIsCameraFeatureSupported;
+static bool g_bIsDisplayFeatureSupported;
static Evas_Object *g_win = NULL;
static void winDeleteCB(void *data, Evas_Object *obj, void *event)
g_bIsCameraFeatureSupported = false;
IS_FEATURE_SUPPORTED(CAMERA_FEATURE, g_bIsCameraFeatureSupported, API_NAMESPACE);
+ g_bIsDisplayFeatureSupported = false;
+ IS_FEATURE_SUPPORTED(DISPLAY_FEATURE, g_bIsDisplayFeatureSupported, API_NAMESPACE);
+
g_bWebRTCCreation = false;
int nRet = webrtc_create(&g_hWebRtcHandle);
if (nRet != WEBRTC_ERROR_NONE) {
PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_set_state_changed_cb", WebRtcGetError(nRet));
nRet = webrtc_media_source_set_video_loopback(g_hWebRtcHandle, nId, WEBRTC_DISPLAY_TYPE_OVERLAY, g_win, NULL);
- PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_set_video_loopback", WebRtcGetError(nRet));
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(nRet, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_set_video_loopback", WebRtcGetError(nRet));
g_mutex_lock(&cb_data.mutex);
nRet = webrtc_stop(g_hWebRtcHandle);
PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_stop", WebRtcGetError(nRet));
- nRet = webrtc_media_source_unset_video_loopback(g_hWebRtcHandle, nId);
- PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_unset_video_loopback", WebRtcGetError(nRet));
+ nRet = webrtc_media_source_unset_video_loopback(g_hWebRtcHandle, nId);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(nRet, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_unset_video_loopback", WebRtcGetError(nRet));
destroyWindow();
PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_set_state_changed_cb", WebRtcGetError(nRet));
nRet = webrtc_media_source_set_video_loopback(g_hWebRtcHandle, nId, WEBRTC_DISPLAY_TYPE_OVERLAY, g_win, &nTrackId);
- PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_set_video_loopback", WebRtcGetError(nRet));
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(nRet, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_set_video_loopback", WebRtcGetError(nRet));
g_mutex_lock(&cb_data.mutex);
}
nRet = webrtc_set_display_mode(g_hWebRtcHandle, nTrackId, WEBRTC_DISPLAY_MODE_FULL);
- PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_set_display_mode", WebRtcGetError(nRet));
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(nRet, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_set_display_mode", WebRtcGetError(nRet));
nRet = webrtc_get_display_mode(g_hWebRtcHandle, nTrackId, &eMode);
- PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_get_display_mode", WebRtcGetError(nRet));
- PRINT_RESULT(WEBRTC_DISPLAY_MODE_FULL, eMode, "webrtc_get_display_mode", WebRtcGetError(nRet));
+ if (!g_bIsDisplayFeatureSupported) {
+ assert_eq(nRet, WEBRTC_ERROR_NOT_SUPPORTED);
+ } else {
+ PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_get_display_mode", WebRtcGetError(nRet));
+ PRINT_RESULT(WEBRTC_DISPLAY_MODE_FULL, eMode, "webrtc_get_display_mode", WebRtcGetError(nRet));
+ }
nRet = webrtc_stop(g_hWebRtcHandle);
PRINT_RESULT_NORETURN(WEBRTC_ERROR_NONE, nRet, "webrtc_stop", WebRtcGetError(nRet));
createWindow();
nRet = webrtc_media_source_set_video_loopback(g_hWebRtcHandle, nId, WEBRTC_DISPLAY_TYPE_OVERLAY, g_win, &nTrackId);
- PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_set_video_loopback", WebRtcGetError(nRet));
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(nRet, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_set_video_loopback", WebRtcGetError(nRet));
g_mutex_lock(&cb_data.mutex);
}
nRet = webrtc_set_display_visible(g_hWebRtcHandle, nTrackId, bSetVisible);
- PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_set_display_visible", WebRtcGetError(nRet));
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(nRet, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_set_display_visible", WebRtcGetError(nRet));
nRet = webrtc_get_display_visible(g_hWebRtcHandle, nTrackId, &bGetVisible);
- PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_get_display_visible", WebRtcGetError(nRet));
- PRINT_RESULT(bGetVisible, bSetVisible, "webrtc_get_display_visible", WebRtcGetError(nRet));
+ if (!g_bIsDisplayFeatureSupported) {
+ assert_eq(nRet, WEBRTC_ERROR_NOT_SUPPORTED);
+ } else {
+ PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_get_display_visible", WebRtcGetError(nRet));
+ PRINT_RESULT(bGetVisible, bSetVisible, "webrtc_get_display_visible", WebRtcGetError(nRet));
+ }
nRet = webrtc_stop(g_hWebRtcHandle);
PRINT_RESULT_NORETURN(WEBRTC_ERROR_NONE, nRet, "webrtc_stop", WebRtcGetError(nRet));
* @reviewer SRID(shobhit.v)
* @type auto
* @description Gets the buffered amount of the data channel.
-* @scenario Sets and Gets the display mode of the video track.
+* @scenario Gets the buffered amount of the data channel.
* @apicovered webrtc_create_data_chanel,webrtc_data_channel_get_buffered_amount, webrtc_destroy_data_channel
* @passcase If webrtc_data_channel_get_buffered_amount is successful
* @failcase If webrtc_data_channel_get_buffered_amount is unsuccessful
* @author SRID(ankit.sri1)
* @reviewer SRID(shobhit.v)
* @type auto
-* @description Sets and unsets the buffered amount of the data channel.
-* @scenario Sets and Gets the display mode of the video track.
+* @description Sets and unsets the buffered amount low callback of the data channel.
+* @scenario Sets and unsets the buffered amount low callback of the data channel.
* @apicovered webrtc_create_data_chanel,webrtc_data_channel_set_buffered_amount_low_cb, webrtc_data_channel_unset_buffered_amount_low_cb, webrtc_destroy_data_channel
* @passcase If webrtc_data_channel_set_buffered_amount_low_cb and webrtc_data_channel_unset_buffered_amount_low_cb is successful
* @failcase If webrtc_data_channel_set_buffered_amount_low_cb or webrtc_data_channel_unset_buffered_amount_low_cb fails