#define _MEDIAEDITOR_FEATURE_DISPLAY "http://tizen.org/feature/display"
+static gint gst_initialized = 0;
+
int mediaeditor_create(mediaeditor_h *editor)
{
int ret = MEDIAEDITOR_ERROR_NONE;
#endif
}
- if ((ret = _gst_init(_editor)) != MEDIAEDITOR_ERROR_NONE)
- goto error;
+ if (!g_atomic_int_get(&gst_initialized)) {
+ if ((ret = _gst_init(_editor)) != MEDIAEDITOR_ERROR_NONE)
+ goto error;
+
+ g_atomic_int_set(&gst_initialized, 1);
+ } else {
+ LOG_INFO("gstreamer is already initialized.");
+ }
if ((ret = _mediaeditor_create_pipeline(_editor)) != MEDIAEDITOR_ERROR_NONE)
goto error;
ges_deinit();
+ g_atomic_int_set(&gst_initialized, 0);
+
g_cond_clear(&_editor->cond);
g_mutex_clear(&_editor->event_src_mutex);
ret = _mediaeditor_get_clip_volume(_editor, clip_id, volume);
- LOG_DEBUG("editor[%p], clip_id[%d], volumd[%f]", editor, clip_id, *volume);
+ LOG_DEBUG("editor[%p], clip_id[%d], volume[%f]", editor, clip_id, *volume);
return ret;
}
audio_caps = gst_caps_from_string(audio_mime_type);
RET_VAL_IF(audio_caps == NULL, MEDIAEDITOR_ERROR_INVALID_OPERATION, "failed to create audio_caps");
if (!gst_encoding_container_profile_add_profile(profile, (GstEncodingProfile *)gst_encoding_audio_profile_new(audio_caps, NULL, NULL, 0))) {
- LOG_ERROR("failed to add audio prifile");
+ LOG_ERROR("failed to add audio profile");
ret = MEDIAEDITOR_ERROR_INVALID_OPERATION;
g_object_unref(profile);
goto error_audio_caps;
video_caps = gst_caps_from_string(video_mime_type);
RET_VAL_IF(video_caps == NULL, MEDIAEDITOR_ERROR_INVALID_OPERATION, "failed to create video_caps");
if (!gst_encoding_container_profile_add_profile(profile, (GstEncodingProfile *)gst_encoding_video_profile_new(video_caps, NULL, NULL, 0))) {
- LOG_ERROR("failed to add audio prifile");
+ LOG_ERROR("failed to add audio profile");
ret = MEDIAEDITOR_ERROR_INVALID_OPERATION;
g_object_unref(profile);
goto error_video_caps;
}
if (!ges_pipeline_set_render_settings(editor->gst.pipeline, uri, (GstEncodingProfile *)profile)) {
- LOG_ERROR("failed to add audio prifile");
+ LOG_ERROR("failed to add audio profile");
ret = MEDIAEDITOR_ERROR_INVALID_OPERATION;
g_object_unref(profile);
}
int _gst_init(mediaeditor_s *editor)
{
- static gboolean initialized = FALSE;
gboolean ret = FALSE;
char **argv = NULL;
gint argc = 1;
NULL_PARAM_CHECK(editor);
- if (initialized) {
- LOG_INFO("gstreamer is already initialized.");
- return MEDIAEDITOR_ERROR_NONE;
- }
-
gst_args = editor->ini.general.gst_args;
if (gst_args)
/* Initialize the GStreamer Editing Services */
ges_init();
- initialized = TRUE;
-
return MEDIAEDITOR_ERROR_NONE;
}