Missing preconditions are added to doxygen of some functions.
[Version] 0.3.266
[Issue Type] Internal API
Change-Id: I3ccfbf39e122a753023dafe16e5a13f36513a039
* @retval #WEBRTC_ERROR_NONE Successful
* @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
+ * @pre webrtc_track_added_cb() must be set by calling webrtc_set_track_added_cb().
* @pre Call webrtc_set_sound_stream_info() before calling this function.
* @see webrtc_get_audio_mute()
*/
* @retval #WEBRTC_ERROR_NONE Successful
* @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
+ * @pre webrtc_track_added_cb() must be set by calling webrtc_set_track_added_cb().
* @pre Call webrtc_set_sound_stream_info() before calling this function.
* @see webrtc_set_audio_mute()
*/
int webrtc_get_audio_mute(webrtc_h webrtc, unsigned int track_id, bool *muted);
+/**
+ * @internal
+ * @brief Gets the video resolution of the video track.
+ * @since_tizen 7.0
+ * @param[in] webrtc WebRTC handle
+ * @param[in] track_id The track id
+ * @param[out] width The video width
+ * @param[out] height The video height
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #WEBRTC_ERROR_NONE Successful
+ * @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
+ * @pre webrtc_track_added_cb() must be set by calling webrtc_set_track_added_cb().
+ */
+int webrtc_get_video_resolution(webrtc_h webrtc, unsigned int track_id, int *width, int *height);
+
/**
* @internal
* @brief Sets a video loopback to render the video frames of the media source to an ecore wayland display.
int _get_display_visible_from_sink(webrtc_s *webrtc, unsigned int track_id, bool *visible);
int _set_audio_mute_to_sink(webrtc_s *webrtc, unsigned int track_id, bool mute);
int _get_audio_mute_from_sink(webrtc_s *webrtc, unsigned int track_id, bool *muted);
+int _get_video_resolution_from_sink(webrtc_s *webrtc, unsigned int track_id, int *width, int *height);
/* sink dump */
GstPadProbeReturn _depayloaded_data_probe_cb(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
Name: capi-media-webrtc
Summary: A WebRTC library in Tizen Native API
-Version: 0.3.265
+Version: 0.3.266
Release: 0
Group: Multimedia/API
License: Apache-2.0
return _get_audio_mute_from_sink(_webrtc, track_id, muted);
}
+int webrtc_get_video_resolution(webrtc_h webrtc, unsigned int track_id, int *width, int *height)
+{
+ g_autoptr(GMutexLocker) locker = NULL;
+ webrtc_s *_webrtc = (webrtc_s *)webrtc;
+
+ RET_VAL_IF(_webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
+ RET_VAL_IF(width == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "width is NULL");
+ RET_VAL_IF(height == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "height is NULL");
+
+ locker = g_mutex_locker_new(&_webrtc->mutex);
+
+ RET_VAL_IF(_webrtc->track_added_cb.callback == NULL, WEBRTC_ERROR_INVALID_OPERATION, "track added callback was not set");
+
+ return _get_video_resolution_from_sink(_webrtc, track_id, width, height);
+}
+
int webrtc_media_source_set_video_loopback_to_ecore_wl(webrtc_h webrtc, unsigned int source_id, void *ecore_wl_window, unsigned int *track_id)
{
int ret = WEBRTC_ERROR_NONE;
return WEBRTC_ERROR_NONE;
}
+int _get_video_resolution_from_sink(webrtc_s *webrtc, unsigned int track_id, int *width, int *height)
+{
+ webrtc_gst_slot_s *sink;
+
+ RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
+ RET_VAL_IF(track_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "track id is 0");
+ RET_VAL_IF(width == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "width is NULL");
+ RET_VAL_IF(height == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "height is NULL");
+
+ sink = __find_sink_slot_by_id(webrtc, track_id);
+ RET_VAL_IF(sink == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "sink is NULL");
+ RET_VAL_IF(sink->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL");
+ RET_VAL_IF(sink->encoded_frame_cb != NULL, WEBRTC_ERROR_INVALID_OPERATION, "it may be a forwarding sink for encoded frame callback");
+ RET_VAL_IF((sink->media_types & MEDIA_TYPE_VIDEO) == 0x0, WEBRTC_ERROR_INVALID_OPERATION, "it's not a video track");
+
+ *width = sink->video_info.width;
+ *height = sink->video_info.height;
+
+ LOG_INFO("webrtc[%p] track_id[%u] width[%d] height[%d]", webrtc, track_id, *width, *height);
+
+ return WEBRTC_ERROR_NONE;
+}
+
//LCOV_EXCL_STOP