emotion - properly track subtitle mute state and init emotion obj early

fix setting things on an emotion obj early bu initting engine early
and also track spu mute flags to set on pipe later

@fix
This commit is contained in:
Carsten Haitzler 2021-09-26 21:23:24 +01:00
parent ec527a9026
commit 2ce7feb3d5
3 changed files with 16 additions and 10 deletions

View File

@ -242,12 +242,17 @@ emotion_object_add(Evas *evas)
}
EOLIAN static Eo *
_efl_canvas_video_efl_object_constructor(Eo *obj, Efl_Canvas_Video_Data *pd EINA_UNUSED)
_efl_canvas_video_efl_object_constructor(Eo *obj, Efl_Canvas_Video_Data *pd)
{
efl_canvas_group_clipped_set(obj, EINA_TRUE);
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, E_OBJ_NAME);
eina_stringshare_replace(&(pd->engine), "gstreamer1");
pd->spu.button = -1;
pd->ratio = 1.0;
_engine_init(obj, pd);
return obj;
}

View File

@ -922,15 +922,13 @@ em_spu_channel_mute_set(void *video, int mute)
Emotion_Gstreamer *ev = video;
gint flags;
ev->spu_mute = !!mute;
if (!ev->pipeline) return;
g_object_get(ev->pipeline, "flags", &flags, NULL);
if (mute)
flags &= ~GST_PLAY_FLAG_TEXT;
else
flags |= GST_PLAY_FLAG_TEXT;
if (ev->spu_mute) flags &= ~GST_PLAY_FLAG_TEXT;
else flags |= GST_PLAY_FLAG_TEXT;
g_object_set(ev->pipeline, "flags", flags, NULL);
}
@ -1113,10 +1111,11 @@ em_add(const Emotion_Engine *api,
/* Default values */
ev->vis = EMOTION_VIS_NONE;
ev->volume = 0.8;
ev->volume = 1.0;
ev->ready = EINA_FALSE;
ev->shutdown = EINA_FALSE;
ev->threads = NULL;
ev->spu_mute = EINA_TRUE;
return ev;
}
@ -1772,8 +1771,9 @@ _create_pipeline(Emotion_Gstreamer *ev,
g_object_set(G_OBJECT(vsink), "emotion-object", o, NULL);
g_object_get(G_OBJECT(playbin), "flags", &flags, NULL);
g_object_set(G_OBJECT(playbin), "flags",
(flags | GST_PLAY_FLAG_DOWNLOAD) & ~GST_PLAY_FLAG_TEXT, NULL);
if (ev->spu_mute) flags &= ~GST_PLAY_FLAG_TEXT;
else flags |= GST_PLAY_FLAG_TEXT;
g_object_set(G_OBJECT(playbin), "flags", (flags | GST_PLAY_FLAG_DOWNLOAD), NULL);
g_object_set(G_OBJECT(playbin), "video-sink", vsink, NULL);
g_object_set(G_OBJECT(playbin), "uri", uri, NULL);
if (suburi)

View File

@ -87,6 +87,7 @@ struct _Emotion_Gstreamer
Eina_Bool play : 1;
Eina_Bool video_mute : 1;
Eina_Bool audio_mute : 1;
Eina_Bool spu_mute : 1;
Eina_Bool ready : 1;
Eina_Bool live : 1;
Eina_Bool buffering : 1;