gboolean ms_src_node_prepare_iter(const GValue *item, GValue *g_ret, gpointer user_data);
gboolean ms_node_resources_acquire_iter(const GValue *item, GValue *ret, gpointer user_data);
gboolean ms_node_resources_release_iter(const GValue *item, GValue *ret, gpointer user_data);
-gboolean ms_node_policy_check_iter(const GValue *item, GValue *ret, gpointer user_data);
+gboolean ms_node_dpm_policy_check_iter(const GValue *item, GValue *ret, gpointer user_data);
#ifdef __cplusplus
}
* limitations under the License.
*/
-#ifndef __TIZEN_MEDIA_STREAMER_NODE_POLICY_H__
-#define __TIZEN_MEDIA_STREAMER_NODE_POLICY_H__
+#ifndef __TIZEN_MEDIA_STREAMER_NODE_DPM_POLICY_H__
+#define __TIZEN_MEDIA_STREAMER_NODE_DPM_POLICY_H__
#include "media_streamer_priv.h"
POLICY_TYPE_NONE,
POLICY_TYPE_CAMERA,
POLICY_TYPE_MIC,
-} media_streamer_policy_type_e;
+} media_streamer_dpm_policy_type_e;
-int ms_node_policy_init(media_streamer_node_s *node);
-int ms_node_policy_deinit(media_streamer_node_s *node);
-int ms_node_policy_check(media_streamer_node_s *node, gboolean *allowed);
+int ms_node_dpm_policy_init(media_streamer_node_s *node);
+int ms_node_dpm_policy_deinit(media_streamer_node_s *node);
+int ms_node_dpm_policy_check(media_streamer_node_s *node, gboolean *allowed);
#ifdef __cplusplus
}
#endif
-#endif /* __TIZEN_MEDIA_STREAMER_NODE_POLICY_H__ */
+#endif /* __TIZEN_MEDIA_STREAMER_NODE_DPM_POLICY_H__ */
Name: capi-media-streamer
Summary: A Media Streamer API
-Version: 0.1.43
+Version: 0.1.44
Release: 0
Group: Multimedia/API
License: Apache-2.0
#include <gst/video/videooverlay.h>
#include "media_streamer_node.h"
#include "media_streamer_node_resources.h"
-#include "media_streamer_node_policy.h"
+#include "media_streamer_node_dpm_policy.h"
#include "media_streamer_util.h"
#include "media_streamer_gst.h"
else
node->name = gst_element_get_name(node->gst_element);
- ret = ms_node_policy_init(node);
+ ret = ms_node_dpm_policy_init(node);
if (MEDIA_STREAMER_ERROR_NONE != ret) {
- ms_error("Failed to init policy for node [%s]", node->name);
+ ms_error("Failed to init DPM policy for node [%s]", node->name);
return ret;
}
g_list_free_full(node->sig_list, ms_signal_destroy);
/* Deinitialize policy manager */
- if (MEDIA_STREAMER_ERROR_NONE != ms_node_policy_deinit(node))
- ms_error("Failed to deinitialize policy manager");
+ if (MEDIA_STREAMER_ERROR_NONE != ms_node_dpm_policy_deinit(node))
+ ms_error("Failed to deinitialize DPM policy");
MS_SAFE_UNREF(node->gst_element);
MS_SAFE_FREE(node->name);
return TRUE;
}
-gboolean ms_node_policy_check_iter(const GValue *item, GValue *ret, gpointer user_data)
+gboolean ms_node_dpm_policy_check_iter(const GValue *item, GValue *ret, gpointer user_data)
{
media_streamer_s *ms_streamer = (media_streamer_s *) user_data;
media_streamer_node_s *node = NULL;
return TRUE;
}
- if (ms_node_policy_check(node, &allowed)) {
- ms_error("Failed to check policy for node [%s]", node->name);
+ if (ms_node_dpm_policy_check(node, &allowed)) {
+ ms_error("Failed to check DPM policy for node [%s]", node->name);
/* Note that it should be TRUE(allowed) if the DPM API failed. */
g_value_set_boolean(ret, TRUE);
g_object_unref(element);
#include "media_streamer_gst.h"
#include "media_streamer_priv.h"
#include "media_streamer_node.h"
-#include "media_streamer_node_policy.h"
+#include "media_streamer_node_dpm_policy.h"
#define DPM_ALLOWED 1
#define DPM_DISALLOWED 0
DPM_POLICY_MAX,
};
-static void __ms_node_get_dpm_check_needed(media_streamer_node_s *node, media_streamer_policy_type_e *policy)
+static void __ms_node_get_dpm_check_needed(media_streamer_node_s *node, media_streamer_dpm_policy_type_e *policy)
{
int subtype;
}
//LCOV_EXCL_START
-static void __ms_node_policy_changed_cb(const char *name, const char *value, void *user_data)
+static void __ms_node_dpm_policy_changed_cb(const char *name, const char *value, void *user_data)
{
media_streamer_node_s *node;
media_streamer_s *streamer;
}
//LCOV_EXCL_STOP
-int ms_node_policy_init(media_streamer_node_s *node)
+int ms_node_dpm_policy_init(media_streamer_node_s *node)
{
- media_streamer_policy_type_e policy = POLICY_TYPE_NONE;
+ media_streamer_dpm_policy_type_e policy = POLICY_TYPE_NONE;
int ret = MEDIA_STREAMER_ERROR_NONE;
const char *policy_name = NULL;
static const char* policy_str[DPM_POLICY_MAX] = {"camera", "microphone"};
if (node->dpm_handle) {
int dpm_ret = DPM_ERROR_NONE;
dpm_ret = dpm_add_policy_changed_cb(node->dpm_handle, policy_name,
- __ms_node_policy_changed_cb, (void *)node, &node->policy_changed_cb_id);
+ __ms_node_dpm_policy_changed_cb, (void *)node, &node->policy_changed_cb_id);
if (dpm_ret != DPM_ERROR_NONE) {
ms_error("add DPM changed cb failed, keep going");
return ret;
}
-int ms_node_policy_deinit(media_streamer_node_s *node)
+int ms_node_dpm_policy_deinit(media_streamer_node_s *node)
{
- media_streamer_policy_type_e policy = POLICY_TYPE_NONE;
+ media_streamer_dpm_policy_type_e policy = POLICY_TYPE_NONE;
int ret = MEDIA_STREAMER_ERROR_NONE;
ms_debug_fenter();
return ret;
}
-int ms_node_policy_check(media_streamer_node_s *node, gboolean *allowed)
+int ms_node_dpm_policy_check(media_streamer_node_s *node, gboolean *allowed)
{
- media_streamer_policy_type_e policy = POLICY_TYPE_NONE;
+ media_streamer_dpm_policy_type_e policy = POLICY_TYPE_NONE;
int dpm_state = DPM_ALLOWED;
int dpm_ret = DPM_ERROR_NONE;
#define GST_TIME_TO_MSEC(t) (t == GST_CLOCK_TIME_NONE ? t : (int)(((GstClockTime)(t)) / GST_MSECOND))
static int __ms_change_resources_state(media_streamer_s *ms_streamer, media_streamer_state_e state);
-static int __ms_change_policy_state(media_streamer_s *ms_streamer, media_streamer_state_e state);
+static int __ms_change_dpm_policy_state(media_streamer_s *ms_streamer, media_streamer_state_e state);
static gboolean __ms_resource_node_find(gpointer key, gpointer value, gpointer user_data);
static int __ms_resource_release_cb(mm_resource_manager_h rm,
mm_resource_manager_res_h resource_h, void *user_data);
ms_retvm_if(ms_streamer->state == state, MEDIA_STREAMER_ERROR_NONE, "Media streamer already in this state");
if (!ms_streamer->is_interrupted) {
- ret = __ms_change_policy_state(ms_streamer, state);
+ ret = __ms_change_dpm_policy_state(ms_streamer, state);
if (MEDIA_STREAMER_ERROR_NONE != ret) {
ms_error("Failed to change policy state for streamer %p", ms_streamer);
return MEDIA_STREAMER_ERROR_INVALID_OPERATION;
}
//LCOV_EXCL_STOP
-static int __ms_check_policy(media_streamer_s *ms_streamer)
+static int __ms_check_dpm_policy(media_streamer_s *ms_streamer)
{
int ret = MEDIA_STREAMER_ERROR_NONE;
ms_retvm_if(ms_streamer == NULL, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "ms_streamer is NULL");
- /* Acquire resources for src bin */
ret = ms_bin_foreach_elements(GST_BIN(ms_streamer->src_bin),
- ms_node_policy_check_iter, ms_streamer);
+ ms_node_dpm_policy_check_iter, ms_streamer);
if (MEDIA_STREAMER_ERROR_NONE != ret) {
- ms_error("Failed to check policies for src bin");
+ ms_error("Failed to check DPM policies for src bin");
return ret;
}
return MEDIA_STREAMER_ERROR_NONE;
}
-static int __ms_change_policy_state(media_streamer_s *ms_streamer, media_streamer_state_e state)
+static int __ms_change_dpm_policy_state(media_streamer_s *ms_streamer, media_streamer_state_e state)
{
int ret = MEDIA_STREAMER_ERROR_NONE;
switch (ms_streamer->pend_state) {
case MEDIA_STREAMER_STATE_IDLE:
/* After prepare function */
- ret = __ms_check_policy(ms_streamer);
+ ret = __ms_check_dpm_policy(ms_streamer);
break;
case MEDIA_STREAMER_STATE_PAUSED:
case MEDIA_STREAMER_STATE_PLAYING:
return ret;
}
-//LCOV_EXCL_STOP
\ No newline at end of file
+//LCOV_EXCL_STOP