return NULL;
}
+#define GST_PLAY_FLAG_AUDIO (1 << 1)
+
static void
em_audio_channel_mute_set(void *video,
int mute)
{
Emotion_Gstreamer_Video *ev;
+ int flags;
ev = (Emotion_Gstreamer_Video *)video;
ev->audio_mute = mute;
- if (mute)
- g_object_set(G_OBJECT(ev->pipeline), "mute", 1, NULL);
- else
- g_object_set(G_OBJECT(ev->pipeline), "mute", 0, NULL);
+ g_object_set(G_OBJECT(ev->pipeline), "mute", !!mute, NULL);
+ /* This code should stop the decoding of only the audio stream, but everything stop :"( */
+ /* g_object_get(G_OBJECT(ev->pipeline), "flags", &flags, NULL); */
+ /* if (mute) */
+ /* flags &= ~GST_PLAY_FLAG_AUDIO; */
+ /* else */
+ /* flags |= GST_PLAY_FLAG_AUDIO; */
+ /* g_object_set(G_OBJECT(ev->pipeline), "flags", flags, NULL); */
+ /* g_object_get(G_OBJECT(ev->pipeline), "flags", &flags, NULL); */
+ /* fprintf(stderr, "flags-n: %x\n", flags); */
}
static int
// to deadlocks because render() holds the stream lock.
//
// Protected by the buffer mutex
- gboolean unlocked;
+ Eina_Bool unlocked : 1;
+ Eina_Bool preroll : 1;
};
#define _do_init(bla) \
GST_DEBUG_CATEGORY_INIT(evas_video_sink_debug, \
- "evassink", \
+ "emotion-sink", \
0, \
- "evas video sink")
+ "emotion video sink")
GST_BOILERPLATE_FULL(EvasVideoSink,
evas_video_sink,
priv->format = GST_VIDEO_FORMAT_UNKNOWN;
priv->data_cond = g_cond_new();
priv->buffer_mutex = g_mutex_new();
+ priv->preroll = EINA_FALSE;
+ priv->unlocked = EINA_FALSE;
}
res = FALSE;
else
{
- priv->unlocked = FALSE;
+ priv->unlocked = EINA_FALSE;
}
}
g_mutex_unlock(priv->buffer_mutex);
static GstFlowReturn
evas_video_sink_preroll(GstBaseSink* bsink, GstBuffer* buffer)
{
+ GstBuffer *send;
+ EvasVideoSink* sink;
+ EvasVideoSinkPrivate* priv;
+
+ sink = EVAS_VIDEO_SINK(bsink);
+ priv = sink->priv;
+
+ send = gst_buffer_ref(buffer);
+
+ priv->preroll = EINA_TRUE;
+
+ ecore_pipe_write(priv->p, &send, sizeof(buffer));
return GST_FLOW_OK;
}
return GST_FLOW_OK;
}
+ priv->preroll = EINA_FALSE;
+
send = gst_buffer_ref(buffer);
ret = ecore_pipe_write(priv->p, &send, sizeof(buffer));
if (!ret)
exit_point:
gst_buffer_unref(buffer);
+ if (priv->preroll) return ;
+
g_mutex_lock(priv->buffer_mutex);
if (priv->unlocked) {
{
g_mutex_lock(priv->buffer_mutex);
- priv->unlocked = TRUE;
+ priv->unlocked = EINA_TRUE;
g_cond_signal(priv->data_cond);
g_mutex_unlock(priv->buffer_mutex);
}