int mediaeditor_get_state(mediaeditor_h editor, mediaeditor_state_e *state)
{
+ g_autoptr(GMutexLocker) locker = NULL;
mediaeditor_s *_editor = (mediaeditor_s *)editor;
RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
LOG_DEBUG("Enter editor[%p]", editor);
- g_mutex_lock(&_editor->mutex);
+ locker = g_mutex_locker_new(&_editor->mutex);
*state = _editor->state;
- g_mutex_unlock(&_editor->mutex);
-
LOG_DEBUG("Leave editor[%p], state[%d]", editor, *state);
return MEDIAEDITOR_ERROR_NONE;
int mediaeditor_get_layer_priority(mediaeditor_h editor, unsigned int layer_id, unsigned int *layer_priority)
{
int ret = MEDIAEDITOR_ERROR_NONE;
+ g_autoptr(GMutexLocker) locker = NULL;
mediaeditor_s *_editor = (mediaeditor_s *)editor;
RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
RET_VAL_IF(layer_priority == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "layer_priority is NULL");
- g_mutex_lock(&_editor->mutex);
+ locker = g_mutex_locker_new(&_editor->mutex);
LOG_DEBUG("Enter editor[%p]", editor);
ret = _mediaeditor_get_layer_priority(_editor, layer_id, layer_priority);
- g_mutex_unlock(&_editor->mutex);
-
- LOG_DEBUG("Leave editor[%p], id[%d], priority[%d]", editor, layer_id, *layer_priority);
+ LOG_DEBUG("Leave editor[%p], layer_id[%d], priority[%d]", editor, layer_id, *layer_priority);
return ret;
}
int mediaeditor_get_layer_lowest_priority(mediaeditor_h editor, unsigned int *layer_priority)
{
int ret = MEDIAEDITOR_ERROR_NONE;
+ g_autoptr(GMutexLocker) locker = NULL;
mediaeditor_s *_editor = (mediaeditor_s *)editor;
RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
RET_VAL_IF(layer_priority == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "layer_priority is NULL");
- g_mutex_lock(&_editor->mutex);
+ locker = g_mutex_locker_new(&_editor->mutex);
LOG_DEBUG("Enter editor[%p]", editor);
ret = _mediaeditor_get_layer_lowest_priority(_editor, layer_priority);
- g_mutex_unlock(&_editor->mutex);
-
LOG_DEBUG("Leave editor[%p], priority[%d]", editor, *layer_priority);
return ret;
int mediaeditor_get_layer_id(mediaeditor_h editor, unsigned int layer_priority, unsigned int *layer_id)
{
int ret = MEDIAEDITOR_ERROR_NONE;
+ g_autoptr(GMutexLocker) locker = NULL;
mediaeditor_s *_editor = (mediaeditor_s *)editor;
RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
RET_VAL_IF(layer_id == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "layer_id is NULL");
- g_mutex_lock(&_editor->mutex);
+ locker = g_mutex_locker_new(&_editor->mutex);
LOG_DEBUG("Enter editor[%p]", editor);
ret = _mediaeditor_get_layer_id(_editor, layer_priority, layer_id);
- g_mutex_unlock(&_editor->mutex);
-
- LOG_DEBUG("Leave editor[%p], priority[%d], id[%d]", editor, layer_priority, *layer_id);
+ LOG_DEBUG("Leave editor[%p], priority[%d], layer_id[%d]", editor, layer_priority, *layer_id);
return ret;
}
int mediaeditor_get_clip_start(mediaeditor_h editor, unsigned int clip_id, unsigned int *start)
{
int ret = MEDIAEDITOR_ERROR_NONE;
+ g_autoptr(GMutexLocker) locker = NULL;
mediaeditor_s *_editor = (mediaeditor_s *)editor;
RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
LOG_DEBUG("Enter editor[%p]", editor);
- g_mutex_lock(&_editor->mutex);
+ locker = g_mutex_locker_new(&_editor->mutex);
ret = _mediaeditor_get_clip_start(_editor, clip_id, start);
g_mutex_unlock(&_editor->mutex);
- LOG_DEBUG("Leave editor[%p], id[%d], start[%d]", editor, clip_id, *start);
+ LOG_DEBUG("Leave editor[%p], clip_id[%d], start[%d]", editor, clip_id, *start);
return ret;
}
-int mediaeditor_set_clip_start(mediaeditor_h editor, unsigned int id, unsigned int start)
+int mediaeditor_set_clip_start(mediaeditor_h editor, unsigned int clip_id, unsigned int start)
{
int ret = MEDIAEDITOR_ERROR_NONE;
g_autoptr(GMutexLocker) locker = NULL;
locker = g_mutex_locker_new(&_editor->mutex);
- LOG_DEBUG("Enter editor[%p], id[%d], start[%d]", editor, id, start);
+ LOG_DEBUG("Enter editor[%p], clip_id[%d], start[%d]", editor, clip_id, start);
RET_VAL_IF(_editor->state != MEDIAEDITOR_STATE_IDLE, MEDIAEDITOR_ERROR_INVALID_STATE,
"the state should be IDLE");
- ret = _mediaeditor_set_clip_start(_editor, id, start);
+ ret = _mediaeditor_set_clip_start(_editor, clip_id, start);
LOG_DEBUG("Leave editor[%p]", editor);
return ret;
}
-int mediaeditor_get_clip_duration(mediaeditor_h editor, unsigned int id, unsigned int *duration)
+int mediaeditor_get_clip_duration(mediaeditor_h editor, unsigned int clip_id, unsigned int *duration)
{
int ret = MEDIAEDITOR_ERROR_NONE;
+ g_autoptr(GMutexLocker) locker = NULL;
mediaeditor_s *_editor = (mediaeditor_s *)editor;
RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
LOG_DEBUG("Enter editor[%p]", editor);
- g_mutex_lock(&_editor->mutex);
-
- ret = _mediaeditor_get_clip_duration(_editor, id, duration);
+ locker = g_mutex_locker_new(&_editor->mutex);
- g_mutex_unlock(&_editor->mutex);
+ ret = _mediaeditor_get_clip_duration(_editor, clip_id, duration);
- LOG_DEBUG("Leave editor[%p], id[%d], duration[%d]", editor, id, *duration);
+ LOG_DEBUG("Leave editor[%p], clip_id[%d], duration[%d]", editor, clip_id, *duration);
return ret;
}
-int mediaeditor_set_clip_duration(mediaeditor_h editor, unsigned int id, unsigned int duration)
+int mediaeditor_set_clip_duration(mediaeditor_h editor, unsigned int clip_id, unsigned int duration)
{
int ret = MEDIAEDITOR_ERROR_NONE;
g_autoptr(GMutexLocker) locker = NULL;
locker = g_mutex_locker_new(&_editor->mutex);
- LOG_DEBUG("Enter editor[%p], id[%d], duration[%d]", editor, id, duration);
+ LOG_DEBUG("Enter editor[%p], clip_id[%d], duration[%d]", editor, clip_id, duration);
RET_VAL_IF(_editor->state != MEDIAEDITOR_STATE_IDLE, MEDIAEDITOR_ERROR_INVALID_STATE,
"the state should be IDLE");
- ret = _mediaeditor_set_clip_duration(_editor, id, duration);
+ ret = _mediaeditor_set_clip_duration(_editor, clip_id, duration);
LOG_DEBUG("Leave editor[%p]", editor);
return ret;
}
-int mediaeditor_get_clip_in_point(mediaeditor_h editor, unsigned int id, unsigned int *in_point)
+int mediaeditor_get_clip_in_point(mediaeditor_h editor, unsigned int clip_id, unsigned int *in_point)
{
int ret = MEDIAEDITOR_ERROR_NONE;
+ g_autoptr(GMutexLocker) locker = NULL;
mediaeditor_s *_editor = (mediaeditor_s *)editor;
RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
LOG_DEBUG("Enter editor[%p]", editor);
- g_mutex_lock(&_editor->mutex);
-
- ret = _mediaeditor_get_clip_in_point(_editor, id, in_point);
+ locker = g_mutex_locker_new(&_editor->mutex);
- g_mutex_unlock(&_editor->mutex);
+ ret = _mediaeditor_get_clip_in_point(_editor, clip_id, in_point);
- LOG_DEBUG("Leave editor[%p], id[%d], in_point[%d]", editor, id, *in_point);
+ LOG_DEBUG("Leave editor[%p], clip_id[%d], in_point[%d]", editor, clip_id, *in_point);
return ret;
}
-int mediaeditor_set_clip_in_point(mediaeditor_h editor, unsigned int id, unsigned int in_point)
+int mediaeditor_set_clip_in_point(mediaeditor_h editor, unsigned int clip_id, unsigned int in_point)
{
int ret = MEDIAEDITOR_ERROR_NONE;
g_autoptr(GMutexLocker) locker = NULL;
locker = g_mutex_locker_new(&_editor->mutex);
- LOG_DEBUG("Enter editor[%p], id[%d], in_point[%d]", editor, id, in_point);
+ LOG_DEBUG("Enter editor[%p], clip_id[%d], in_point[%d]", editor, clip_id, in_point);
RET_VAL_IF(_editor->state != MEDIAEDITOR_STATE_IDLE, MEDIAEDITOR_ERROR_INVALID_STATE,
"the state should be IDLE");
- ret = _mediaeditor_set_clip_in_point(_editor, id, in_point);
+ ret = _mediaeditor_set_clip_in_point(_editor, clip_id, in_point);
LOG_DEBUG("Leave editor[%p]", editor);
return ret;
}
-int mediaeditor_get_clip_resolution(mediaeditor_h editor, unsigned int id, unsigned int *width, unsigned int *height)
+int mediaeditor_get_clip_resolution(mediaeditor_h editor, unsigned int clip_id, unsigned int *width, unsigned int *height)
{
int ret = MEDIAEDITOR_ERROR_NONE;
+ g_autoptr(GMutexLocker) locker = NULL;
mediaeditor_s *_editor = (mediaeditor_s *)editor;
RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
LOG_DEBUG("Enter editor[%p]", editor);
- g_mutex_lock(&_editor->mutex);
+ locker = g_mutex_locker_new(&_editor->mutex);
- ret = _mediaeditor_get_clip_resolution(_editor, id, width, height);
+ ret = _mediaeditor_get_clip_resolution(_editor, clip_id, width, height);
- g_mutex_unlock(&_editor->mutex);
+ LOG_DEBUG("Leave editor[%p], clip_id[%d], width[%d], height[%d]", editor, clip_id, *width, *height);
- LOG_DEBUG("Leave editor[%p], id[%d], width[%d], height[%d]", editor, id, *width, *height);
+ return ret;
+}
+
+int mediaeditor_set_clip_resolution(mediaeditor_h editor, unsigned int clip_id, unsigned int width, unsigned int height)
+{
+ int ret = MEDIAEDITOR_ERROR_NONE;
+ g_autoptr(GMutexLocker) locker = NULL;
+ mediaeditor_s *_editor = (mediaeditor_s *)editor;
+
+ RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
+
+ locker = g_mutex_locker_new(&_editor->mutex);
+
+ LOG_DEBUG("Enter editor[%p], clip_id[%d], width[%d], height[%d]", editor, clip_id, width, height);
+
+ RET_VAL_IF(_editor->state != MEDIAEDITOR_STATE_IDLE, MEDIAEDITOR_ERROR_INVALID_STATE,
+ "the state should be IDLE");
+
+ ret = _mediaeditor_set_clip_resolution(_editor, clip_id, width, height);
+
+ LOG_DEBUG("Leave editor[%p]", editor);
return ret;
}
-int mediaeditor_set_clip_resolution(mediaeditor_h editor, unsigned int id, unsigned int width, unsigned int height)
+int mediaeditor_get_clip_position(mediaeditor_h editor, unsigned int clip_id, unsigned int *pos_x, unsigned int *pos_y)
{
int ret = MEDIAEDITOR_ERROR_NONE;
g_autoptr(GMutexLocker) locker = NULL;
mediaeditor_s *_editor = (mediaeditor_s *)editor;
RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
+ RET_VAL_IF(pos_x == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "pos_x is NULL");
+ RET_VAL_IF(pos_y == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "pos_y is NULL");
+
+ LOG_DEBUG("Enter editor[%p]", editor);
locker = g_mutex_locker_new(&_editor->mutex);
- LOG_DEBUG("Enter editor[%p], id[%d], width[%d], height[%d]", editor, id, width, height);
+ ret = _mediaeditor_get_clip_position(_editor, clip_id, pos_x, pos_y);
+
+ LOG_DEBUG("Leave editor[%p], clip_id[%d], pos_x[%d], pos_x[%d]", editor, clip_id, *pos_x, *pos_y);
+
+ return ret;
+}
+
+int mediaeditor_set_clip_position(mediaeditor_h editor, unsigned int clip_id, unsigned int pos_x, unsigned int pos_y)
+{
+ int ret = MEDIAEDITOR_ERROR_NONE;
+ g_autoptr(GMutexLocker) locker = NULL;
+ mediaeditor_s *_editor = (mediaeditor_s *)editor;
+
+ RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
+
+ locker = g_mutex_locker_new(&_editor->mutex);
+
+ LOG_DEBUG("Enter editor[%p], clip_id[%d], pos_x[%d], pos_y[%d]", editor, clip_id, pos_x, pos_y);
RET_VAL_IF(_editor->state != MEDIAEDITOR_STATE_IDLE, MEDIAEDITOR_ERROR_INVALID_STATE,
"the state should be IDLE");
- ret = _mediaeditor_set_clip_resolution(_editor, id, width, height);
+ ret = _mediaeditor_set_clip_position(_editor, clip_id, pos_x, pos_y);
LOG_DEBUG("Leave editor[%p]", editor);
return ret;
}
-int mediaeditor_get_clip_volume(mediaeditor_h editor, unsigned int id, double *volume)
+int mediaeditor_get_clip_volume(mediaeditor_h editor, unsigned int clip_id, double *volume)
{
int ret = MEDIAEDITOR_ERROR_NONE;
+ g_autoptr(GMutexLocker) locker = NULL;
mediaeditor_s *_editor = (mediaeditor_s *)editor;
RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL");
LOG_DEBUG("Enter editor[%p]", editor);
- g_mutex_lock(&_editor->mutex);
-
- ret = _mediaeditor_get_clip_volume(_editor, id, volume);
+ locker = g_mutex_locker_new(&_editor->mutex);
- g_mutex_unlock(&_editor->mutex);
+ ret = _mediaeditor_get_clip_volume(_editor, clip_id, volume);
- LOG_DEBUG("Leave editor[%p], id[%d], volumd[%f]", editor, id, *volume);
+ LOG_DEBUG("Leave editor[%p], clip_id[%d], volumd[%f]", editor, clip_id, *volume);
return ret;
}
-int mediaeditor_set_clip_volume(mediaeditor_h editor, unsigned int id, double volume)
+int mediaeditor_set_clip_volume(mediaeditor_h editor, unsigned int clip_id, double volume)
{
int ret = MEDIAEDITOR_ERROR_NONE;
g_autoptr(GMutexLocker) locker = NULL;
locker = g_mutex_locker_new(&_editor->mutex);
- LOG_DEBUG("Enter editor[%p], id[%d], volume[%f]", editor, id, volume);
+ LOG_DEBUG("Enter editor[%p], clip_id[%d], volume[%f]", editor, clip_id, volume);
RET_VAL_IF(_editor->state != MEDIAEDITOR_STATE_IDLE, MEDIAEDITOR_ERROR_INVALID_STATE,
"the state should be IDLE");
- ret = _mediaeditor_set_clip_volume(_editor, id, volume);
+ ret = _mediaeditor_set_clip_volume(_editor, clip_id, volume);
LOG_DEBUG("Leave editor[%p]", editor);