Saturday, February 17, 2007

Got vlc_engine working with 1.4.5

Finally got amarok 1.4.5 to recognize vlc-engine plugin and play streams and files on Kubuntu Edgy x86_64.

  1. I started with the ver0.2 source files posted by Eric Alber on the amarok mailing list available here and extracted it under amarok/src/engine directory. I did not have to modify MODULE_SYMBOL as I have 'vlc 0.8.6 Janus' running on my system.
  2. The first step was to add vlc subdirectory to the Makefile.am
    if with_vlc
    VLC_ENGINE_SUBDIR = vlc
    endif
    SUBDIRS += $(VLC_ENGINE_SUBDIR)
  3. Then I needed to modify/correct the amarok_vlc-engine_plugin.desktop file.
    X-KDE-Library=libamarok_vlc-engine_plugin
    X-KDE-Amarok-framework-version=28
  4. Then modified VlcEngine.cpp to return true for http streams in canDecode() function and implement unpause() virtual function.
    if (url.protocol() == "http")
    // play http streams
    return true;
    ------------------------------------
    void VlcEngine::unpause()
    {
    pause();
    }
  5. Then modified configure.in.in file in amarok directory to include VLC into generated ./configure script.
    ###############################################################################
    # BEGIN VLC CHECK
    ###############################################################################

    AC_ARG_WITH(vlc,
    AC_HELP_STRING([--with-vlc],[build Amarok with vlc-engine]),
    [build_vlc=$withval],
    [build_vlc=no]
    )

    if test "$build_vlc" != "no"; then
    AC_PATH_PROG(VLC_CONFIG, vlc-config, no)

    if test $VLC_CONFIG = "no"
    then
    amarok_warning_vlc_notfound=yes
    echo "amarok_warning_vlc_notfound: $amarok_warning_vlc_notfound"
    build_vlc=no
    else
    AC_DEFINE(HAVE_VLC, 1, [have VLC])
    CFLAGS_VLC=[`$VLC_CONFIG --cflags`]
    LIBS_VLC=[`$VLC_CONFIG --libs`]
    build_vlc=yes
    fi
    fi

    AM_CONDITIONAL(with_vlc, test x$build_vlc = xyes)
    AC_SUBST(CFLAGS_VLC)
    AC_SUBST(LIBS_VLC)

    ###############################################################################
    # END VLC CHECK
    ###############################################################################
  6. Then modified configure.in.bot file in amarok directory to tell whether vlc is included/excluded in configure.
    if test x$build_vlc = xno; then
    echo " = - vlc-engine"
    fi
    if test x$build_vlc != xno; then
    echo " = + vlc-engine"
    fi
  7. Then run "make -f Makefile.cvs" to generate the proper configure script. Then the usual steps like ./configure, make, make install. (Make sure that ./configure step creates the Makefile in the vlc directory.)
  8. Then extract vlc-settings.xml file from here in ~/.kde/share/apps/amarok directory and modified it according to my requirement.
  9. Next after running amarok, VLC engine should come up as one of the options in configuration->engine options.
Here is my new version of file with all the above modifications - amarok-vlc-engine-0.3.tgz

2 comments:

Anonymous said...

The links to Elber's page don't seem to be working. Could you put up the files somewhere or mail them?

Sam_dal said...

I have updated the post with the link to the settings file from the same site.