* @details If @a source_id is not a media source of #WEBRTC_MEDIA_SOURCE_TYPE_MIC, this function will return #WEBRTC_ERROR_INVALID_PARAMETER.
* @since_tizen 6.5
* @remarks You can set sound stream information including audio routing.\n
- * The following sound stream types can be used for the @a stream_info :\n
+ * The following sound stream types can be used to create the @a stream_info :\n
* #SOUND_STREAM_TYPE_MEDIA\n
* #SOUND_STREAM_TYPE_VOICE_RECOGNITION\n
* #SOUND_STREAM_TYPE_VOIP\n
/**
* @brief Sets media format to the media packet source.
* @since_tizen 6.5
+ * @remarks The following media format mimetypes can be used to create the @a format :\n
+ * #MEDIA_FORMAT_VORBIS\n
+ * #MEDIA_FORMAT_OPUS\n
+ * #MEDIA_FORMAT_PCM_S16LE\n
+ * #MEDIA_FORMAT_PCM_S24LE\n
+ * #MEDIA_FORMAT_H264_SP\n
+ * #MEDIA_FORMAT_H264_MP\n
+ * #MEDIA_FORMAT_H264_HP\n
+ * #MEDIA_FORMAT_MJPEG\n
+ * #MEDIA_FORMAT_VP8\n
+ * #MEDIA_FORMAT_VP9\n
+ * #MEDIA_FORMAT_I420\n
+ * #MEDIA_FORMAT_NV12\n
+ * For more details, please refer to @ref CAPI_MEDIA_TOOL_MEDIA_FORMAT_MODULE.
* @param[in] webrtc WebRTC handle
* @param[in] source_id The media packet source id
* @param[in] format The media format
* @since_tizen 6.5
* @remarks Call this function within webrtc_track_added_cb(), otherwise #WEBRTC_ERROR_INVALID_OPERATION will be returned.\n
* If webrtc_set_encoded_audio_frame_cb() has been called, it will return #WEBRTC_ERROR_INVALID_OPERATION.\n
- * The following sound stream types can be used for the @a stream_info :\n
+ * The following sound stream types can be used to create the @a stream_info :\n
* #SOUND_STREAM_TYPE_MEDIA\n
* #SOUND_STREAM_TYPE_VOIP\n
- * #SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY
+ * #SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY\n
+ * For more details, please refer to @ref CAPI_MEDIA_SOUND_MANAGER_MODULE.
* @param[in] webrtc WebRTC handle
* @param[in] track_id The track id
* @param[in] stream_info The sound stream information
* #WEBRTC_MEDIA_SOURCE_TYPE_MIC\n
* #WEBRTC_MEDIA_SOURCE_TYPE_FILE
* @since_tizen 6.5
- * @remarks The following sound stream types can be used for the @a stream_info :\n
+ * @remarks The following sound stream types can be used to create the @a stream_info :\n
* #SOUND_STREAM_TYPE_MEDIA\n
* #SOUND_STREAM_TYPE_VOIP\n
- * #SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY
+ * #SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY\n
+ * For more details, please refer to @ref CAPI_MEDIA_SOUND_MANAGER_MODULE.
* @param[in] webrtc WebRTC handle
* @param[in] source_id The audio source id
* @param[in] stream_info The sound stream information
return ret;
}
-static GstCaps *__make_encoded_caps_for_appsrc(webrtc_gst_slot_s *source)
-{
- media_format_mimetype_e mime_type;
- const char *_media_type;
-
- RET_VAL_IF(source == NULL, NULL, "source is NULL");
- RET_VAL_IF(source->media_format == NULL, NULL, "media_format is NULL");
- RET_VAL_IF(source->type != WEBRTC_MEDIA_SOURCE_TYPE_MEDIA_PACKET, NULL, "invalid media source type(%d)", source->type);
- RET_VAL_IF(media_format_get_video_info(source->media_format, &mime_type, NULL, NULL, NULL, NULL) != MEDIA_FORMAT_ERROR_NONE,
- NULL, "failed to media_format_get_video_info()");
-
- _media_type = __get_video_media_type(__get_video_format_name(mime_type, source->zerocopy_enabled));
- RET_VAL_IF(g_strcmp0(_media_type, MEDIA_TYPE_VIDEO_H264), NULL, "not supported type(%s)", _media_type);
-
- return __make_encoded_caps_from_media_format(source, NULL);
-}
-
static int __complete_mediapacketsrc_from_encoded_format(webrtc_s *webrtc, webrtc_gst_slot_s *source)
{
int ret = WEBRTC_ERROR_NONE;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
RET_VAL_IF(source->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL");
+ RET_VAL_IF(source->media_format == NULL, WEBRTC_ERROR_INVALID_OPERATION, "media_format is NULL");
src_pad = (source->media_types == MEDIA_TYPE_AUDIO) ? &source->av[AV_IDX_AUDIO].src_pad : &source->av[AV_IDX_VIDEO].src_pad;
ret = _add_no_target_ghostpad_to_slot(source, true, src_pad);
if ((ret = __create_rest_of_elements_for_encoded_format(webrtc, source, &payloader, &queue, &capsfilter)) != WEBRTC_ERROR_NONE)
return ret;
- if (!(sink_caps = __make_encoded_caps_for_appsrc(source))) {
+ if (!(sink_caps = __make_encoded_caps_from_media_format(source, NULL))) {
LOG_ERROR("failed to __make_encoded_caps_for_appsrc()");
return WEBRTC_ERROR_INVALID_OPERATION;
}