cedric pushed a commit to branch master.

http://git.enlightenment.org/core/emotion_generic_players.git/commit/?id=87f8d95bd14b78b35b407fe7f85986a9e92d3910

commit 87f8d95bd14b78b35b407fe7f85986a9e92d3910
Author: Cedric Bail <[email protected]>
Date:   Fri Nov 29 17:52:14 2013 +0900

    vlc: properly detect frame format size and send information back to emotion.
    
    This should fix T582. There is more to do as on some system mute is not 
working
    and we get a double sound along with the slow startup.
---
 src/vlc/emotion_generic_vlc.c | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/src/vlc/emotion_generic_vlc.c b/src/vlc/emotion_generic_vlc.c
index 204f933..48581e5 100644
--- a/src/vlc/emotion_generic_vlc.c
+++ b/src/vlc/emotion_generic_vlc.c
@@ -325,6 +325,31 @@ _tmp_display(void *data EINA_UNUSED, void *id EINA_UNUSED)
 {
 }
 
+static unsigned
+_tmp_format(void **opaque, char *chroma,
+            unsigned *width, unsigned *height,
+            unsigned *pitches, unsigned *lines)
+{
+   App *app = *opaque;
+
+   app->tmpbuffer = realloc(app->tmpbuffer,
+                            *width * *height * 4 * sizeof (char));
+   strcpy(chroma, "RV32");
+   pitches[0] = pitches[1] = pitches[2] = *width * 4;
+   lines[0] = lines[1] = lines[2] = *height;
+
+   _send_resize(app, *width, *height);
+   
+   return 1;
+}
+
+static void
+_tmp_play(void *data EINA_UNUSED,
+          const void *samples EINA_UNUSED, unsigned count EINA_UNUSED,
+          int64_t pts EINA_UNUSED)
+{
+}
+
 static void
 _file_set(App *app)
 {
@@ -345,6 +370,13 @@ _file_set(App *app)
    app->opening = 1;
    libvlc_video_set_format(app->mp, "RV32", DEFAULTWIDTH, DEFAULTHEIGHT, 
DEFAULTWIDTH * 4);
    libvlc_video_set_callbacks(app->mp, _tmp_lock, _tmp_unlock, _tmp_display, 
app);
+   libvlc_video_set_format_callbacks(app->mp, _tmp_format, NULL);
+   /* On my system the mute below is not working and I can't find a way
+      to make it work, so the following set should help, but then it has
+      other side effect...
+   */
+   /* libvlc_audio_set_callbacks(app->mp, _tmp_play, NULL, NULL, NULL, NULL, 
app); */
+
    app->event_mgr = libvlc_media_player_event_manager(app->mp);
    libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerPositionChanged,
                        _event_cb, app);
@@ -418,7 +450,6 @@ _file_set_done(App *app)
    libvlc_video_set_format(app->mp, "RV32", app->w, app->h, app->w * 4);
    libvlc_video_set_callbacks(app->mp, _lock, _unlock, _display, app);
 
-
    libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerPlaying,
                       _event_cb, app);
    libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerTimeChanged,
@@ -561,7 +592,6 @@ _remote_command(void *data, void *buffer, unsigned int 
nbyte)
 
    if (nbyte == 0)
      {
-        fprintf(stderr, "death is comming\n");                
         ecore_main_loop_quit();
         return ;
      }

-- 


Reply via email to