/**
* @ingroup CAPI_MEDIA_FRAMEWORK
* @defgroup CAPI_MEDIA_STREAMER_MODULE Media Streamer
- * @brief The @ref CAPI_MEDIA_STREAMER_MODULE APIs provides functions for building custom pipeline
+ * @brief The @ref CAPI_MEDIA_STREAMER_MODULE APIs provides functions for building custom player
*
* @section CAPI_MEDIA_STREAMER_MODULE_HEADER Required Header
* \#include <media_streamer.h>
*
* @section CAPI_MEDIA_STREAMER_MODULE_OVERVIEW Overview
+ * The Media Streamer API allows application developers to construct the custom player.
+ * It includes provides a way to handle media content by user speicific player.
*
* MEDIASTREAMER allows :
- * Create streamer handle and elements to build custom pipeline.
- * Application can create, add and link elements manually.
+ * - Application can decide input type of media source.
+ * - Application can decide output type of media content.
+ * - Application can create filter nodes considering requirements.
+ * - Application can set/get properties of each nodes.
+ *
+ * The Media Streamer API also notifies you by callback mechanism when state is changed.
+ *
+ * @section CAPI_MEDIA_STREAMER_MODULE_FEATURE Related Features
+ * This API is related with the following features:\n
+ * - http://tizen.org/feature/network.wifi\n
+ * - http://tizen.org/feature/network.telephony\n
+ * - http://tizen.org/feature/network.ethernet\n
+ * - http://tizen.org/feature/camera\n
+ * - http://tizen.org/feature/microphone
+ *
+ * It is recommended to design feature related codes in your application for reliability.\n
+ * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
+ * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tools/native-tools/manifest-text-editor#feature"><b>Feature Element</b>.</a>
*
*/
MEDIA_STREAMER_NODE_SRC_TYPE_AUDIO_TEST, /**< Audio test src type */
MEDIA_STREAMER_NODE_SRC_TYPE_VIDEO_TEST, /**< Video test src type */
MEDIA_STREAMER_NODE_SRC_TYPE_CUSTOM, /**< Custom src type */
- MEDIA_STREAMER_NODE_SRC_TYPE_ADAPTIVE /**< Adaptive src type */
+ MEDIA_STREAMER_NODE_SRC_TYPE_ADAPTIVE /**< Adaptive src type, Network internet feature is required */
} media_streamer_node_src_type_e;
/**
MEDIA_STREAMER_NODE_SINK_TYPE_EVAS, /**< EVAS sink type */
MEDIA_STREAMER_NODE_SINK_TYPE_FAKE, /**< Fake sink type */
MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM, /**< Custom sink type */
- MEDIA_STREAMER_NODE_SINK_TYPE_ADAPTIVE /**< Adaptive sink type */
+ MEDIA_STREAMER_NODE_SINK_TYPE_ADAPTIVE /**< Adaptive sink type to generate fragmented files */
} media_streamer_node_sink_type_e;
/**
MEDIA_STREAMER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
MEDIA_STREAMER_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
MEDIA_STREAMER_ERROR_FILE_NO_SPACE_ON_DEVICE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on the device */
- MEDIA_STREAMER_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
+ MEDIA_STREAMER_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< The feature is not supported */
MEDIA_STREAMER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
MEDIA_STREAMER_ERROR_INVALID_STATE = TIZEN_ERROR_MEDIA_STREAMER | 0x01, /**< Invalid state */
MEDIA_STREAMER_ERROR_CONNECTION_FAILED = TIZEN_ERROR_MEDIA_STREAMER | 0x02, /**< Connection failed */
#include <media_streamer_util.h>
#include <media_streamer_gst.h>
#include <cynara-client.h>
+#include <system_info.h>
#define SMACK_LABEL_LEN 255
#define DEFAULT_URI_SCHEME_LENGTH 10
return ret;
}
+static int __ms_node_check_feature(media_streamer_node_s *node)
+{
+#define _FEATURE_NAME_WIFI "http://tizen.org/feature/network.wifi"
+#define _FEATURE_NAME_TELEPHONY "http://tizen.org/feature/network.telephony"
+#define _FEATURE_NAME_ETHERNET "http://tizen.org/feature/network.ethernet"
+#define _FEATURE_NAME_CAMERA "http://tizen.org/feature/camera"
+#define _FEATURE_NAME_MICROPHONE "http://tizen.org/feature/microphone"
+
+ int ret = MEDIA_STREAMER_ERROR_NONE;
+ bool enabled = FALSE;
+ bool supported = FALSE;
+
+ if (node->type == MEDIA_STREAMER_NODE_TYPE_SRC) {
+ switch (node->subtype) {
+ case MEDIA_STREAMER_NODE_SRC_TYPE_HTTP:
+ case MEDIA_STREAMER_NODE_SRC_TYPE_RTSP:
+ case MEDIA_STREAMER_NODE_SRC_TYPE_ADAPTIVE:
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_WIFI, &enabled)) {
+ ms_info("wifi status = %d", enabled);
+ if (enabled)
+ supported = TRUE;
+ } else {
+ ms_error("SYSTEM_INFO_ERROR");
+ }
+
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_TELEPHONY, &enabled)) {
+ ms_info("telephony status = %d", enabled);
+ if (enabled)
+ supported = TRUE;
+ } else {
+ ms_error("SYSTEM_INFO_ERROR");
+ }
+
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_ETHERNET, &enabled)) {
+ ms_info("ethernet status = %d", enabled);
+ if (enabled)
+ supported = TRUE;
+ } else {
+ ms_error("SYSTEM_INFO_ERROR");
+ }
+ if (!supported)
+ ret = MEDIA_STREAMER_ERROR_NOT_SUPPORTED;
+ break;
+ case MEDIA_STREAMER_NODE_SRC_TYPE_AUDIO_CAPTURE:
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_MICROPHONE, &enabled)) {
+ ms_info("ethernet status = %d", enabled);
+ if (enabled)
+ supported = TRUE;
+ } else {
+ ms_error("SYSTEM_INFO_ERROR");
+ }
+ if (!supported)
+ ret = MEDIA_STREAMER_ERROR_NOT_SUPPORTED;
+ break;
+ case MEDIA_STREAMER_NODE_SRC_TYPE_CAMERA:
+ case MEDIA_STREAMER_NODE_SRC_TYPE_VIDEO_CAPTURE:
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_CAMERA, &enabled)) {
+ ms_info("ethernet status = %d", enabled);
+ if (enabled)
+ supported = TRUE;
+ } else {
+ ms_error("SYSTEM_INFO_ERROR");
+ }
+ if (!supported)
+ ret = MEDIA_STREAMER_ERROR_NOT_SUPPORTED;
+ break;
+ default:
+ ms_info("For current Src Node [%s] subtype [%d] privileges are not needed", node->name, node->subtype);
+ break;
+ }
+ }
+
+ if (node->type == MEDIA_STREAMER_NODE_TYPE_SINK) {
+ switch (node->subtype) {
+ case MEDIA_STREAMER_NODE_SINK_TYPE_HTTP:
+ case MEDIA_STREAMER_NODE_SINK_TYPE_RTSP:
+ /* case MEDIA_STREAMER_NODE_SINK_TYPE_ADAPTIVE: */
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_WIFI, &enabled)) {
+ ms_info("wifi status = %d", enabled);
+ if (enabled)
+ supported = TRUE;
+ } else {
+ ms_error("SYSTEM_INFO_ERROR");
+ }
+
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_TELEPHONY, &enabled)) {
+ ms_info("telephony status = %d", enabled);
+ if (enabled)
+ supported = TRUE;
+ } else {
+ ms_error("SYSTEM_INFO_ERROR");
+ }
+
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_ETHERNET, &enabled)) {
+ ms_info("ethernet status = %d", enabled);
+ if (enabled)
+ supported = TRUE;
+ } else {
+ ms_error("SYSTEM_INFO_ERROR");
+ }
+ if (!supported)
+ ret = MEDIA_STREAMER_ERROR_NOT_SUPPORTED;
+ break;
+ default:
+ ms_info("For current Sink Node [%s] subtype [%d] privileges are not needed", node->name, node->subtype);
+ break;
+ }
+ }
+
+ return ret;
+}
+
int __ms_src_node_create(media_streamer_node_s *node)
{
ms_retvm_if(node == NULL, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "Handle is NULL");
return ret;
}
+ ret = __ms_node_check_feature(node);
+ if (ret != MEDIA_STREAMER_ERROR_NONE) {
+ ms_error("Error getting feature for Src Node");
+ return ret;
+ }
+
switch (node->subtype) {
case MEDIA_STREAMER_NODE_SRC_TYPE_FILE:
plugin_name = __ms_ini_get_string("node type 1:file", DEFAULT_FILE_SOURCE);
return ret;
}
+ ret = __ms_node_check_feature(node);
+ if (ret != MEDIA_STREAMER_ERROR_NONE) {
+ ms_error("Error getting feature for Sink Node");
+ return ret;
+ }
+
switch (node->subtype) {
case MEDIA_STREAMER_NODE_SINK_TYPE_FILE:
plugin_name = __ms_ini_get_string("node type 2:file", DEFAULT_FILE_SINK);