[vlc-commits] lib: add libvlc_media_player_set_evas_object

Thomas Guillem git at videolan.org
Fri Oct 23 19:37:52 CEST 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Oct 23 18:46:02 2015 +0200| [994505345052fe8ff605b271487291ea9e36d091] | committer: Thomas Guillem

lib: add libvlc_media_player_set_evas_object

Used to pass an Evas_Object * for the future Evas video_output.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=994505345052fe8ff605b271487291ea9e36d091
---

 include/vlc/libvlc_media_player.h |   13 +++++++++++++
 lib/libvlc.sym                    |    1 +
 lib/media_player.c                |   21 +++++++++++++++++++++
 3 files changed, 35 insertions(+)

diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 0c7351b..d181d0b 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -552,6 +552,19 @@ LIBVLC_API void libvlc_media_player_set_android_context( libvlc_media_player_t *
                                                          void *p_awindow_handler );
 
 /**
+ * Set the EFL Evas Object.
+ *
+ * \version LibVLC 3.0.0 and later.
+ *
+ * \param p_mi the media player
+ * \param p_evas_object a valid EFL Evas Object (Evas_Object)
+ * \return -1 if an error was detected, 0 otherwise.
+ */
+LIBVLC_API int libvlc_media_player_set_evas_object( libvlc_media_player_t *p_mi,
+                                                    void *p_evas_object );
+
+
+/**
  * Callback prototype for audio playback.
  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
  * \param samples pointer to the first audio sample to play back [IN]
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index e7527bd..49207db 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -177,6 +177,7 @@ libvlc_media_player_set_agl
 libvlc_media_player_set_android_context
 libvlc_media_player_set_chapter
 libvlc_media_player_set_equalizer
+libvlc_media_player_set_evas_object
 libvlc_media_player_set_hwnd
 libvlc_media_player_set_media
 libvlc_media_player_set_nsobject
diff --git a/lib/media_player.c b/lib/media_player.c
index 532d1b3..3bffabf 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -584,6 +584,9 @@ libvlc_media_player_new( libvlc_instance_t *instance )
     var_Create (mp, "android-jvm", VLC_VAR_ADDRESS);
     var_Create (mp, "drawable-androidwindow", VLC_VAR_ADDRESS);
 #endif
+#ifdef HAVE_EVAS
+    var_Create (mp, "drawable-evasobject", VLC_VAR_ADDRESS);
+#endif
 
     var_Create (mp, "keyboard-events", VLC_VAR_BOOL);
     var_SetBool (mp, "keyboard-events", true);
@@ -1173,6 +1176,24 @@ void libvlc_media_player_set_android_context( libvlc_media_player_t *p_mi,
 #endif
 }
 
+/**************************************************************************
+ * set_evas_object
+ **************************************************************************/
+int libvlc_media_player_set_evas_object( libvlc_media_player_t *p_mi,
+                                         void *p_evas_object )
+{
+    assert (p_mi != NULL);
+#ifdef HAVE_EVAS
+    var_SetString (p_mi, "vout", "evas");
+    var_SetString (p_mi, "window", "none");
+    var_SetAddress (p_mi, "drawable-evasobject", p_evas_object);
+    return 0;
+#else
+    (void) p_mi; (void) p_evas_object;
+    return -1;
+#endif
+}
+
 void libvlc_audio_set_callbacks( libvlc_media_player_t *mp,
                                  libvlc_audio_play_cb play_cb,
                                  libvlc_audio_pause_cb pause_cb,



More information about the vlc-commits mailing list