]> git.sesse.net Git - vlc/commitdiff
Merge branch 1.0-bugfix
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 13 May 2009 18:57:34 +0000 (21:57 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 13 May 2009 18:57:34 +0000 (21:57 +0300)
Conflicts:
include/vlc/deprecated.h
src/control/video.c
src/libvlc.sym

53 files changed:
NEWS
configure.ac
include/vlc/deprecated.h
include/vlc_codecs.h
include/vlc_input.h
include/vlc_osd.h
modules/access/dv.c
modules/codec/subtitles/subsass.c
modules/codec/subtitles/subsusf.c
modules/gui/fbosd.c
modules/gui/macosx/voutgl.m
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp
modules/gui/wince/preferences.cpp
modules/video_filter/dynamicoverlay/dynamicoverlay.c
modules/video_filter/dynamicoverlay/dynamicoverlay.h
modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
modules/video_filter/marq.c
modules/video_filter/rss.c
modules/video_output/aa.c
modules/video_output/drawable.c
projects/mozilla/support/npunix.c
projects/mozilla/support/npwin.cpp
projects/mozilla/test.html
projects/mozilla/vlcplugin.cpp
projects/mozilla/vlcshell.cpp
src/Makefile.am
src/config/file.c
src/control/event.c
src/control/libvlc_internal.h
src/control/media_list_path.h
src/control/media_list_player.c
src/control/media_player.c
src/control/playlist.c
src/control/video.c
src/input/control.c
src/input/es_out.c
src/input/event.c
src/input/event.h
src/input/input.c
src/libvlc.c
src/libvlc.sym
src/libvlccore.sym
src/modules/cache.c
src/osd/osd_text.c
src/text/filesystem.c
src/text/strings.c
src/video_output/video_text.c
src/video_output/vout_subpictures.c
test/Makefile.am
test/libvlc/core.c

diff --git a/NEWS b/NEWS
index 52671ec67dff8efcfbffe2a707a44bd8558e2a37..382489dead1b6241bb54d139651e6011a2dfe616 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Changes between 1.0.0-rc1 and 1.1.0-git:
+----------------------------------------
+
+
 Changes between 0.9.9a and 1.0.0-rc1:
 ------------------------------------
 
index be6e24cdd612620160f5e822355f4e47d8e3fb9f..34de252e25b9c81757e15ec61d98baeb8f4a9acd 100644 (file)
@@ -2,11 +2,11 @@ dnl Autoconf settings for vlc
 
 AC_COPYRIGHT([Copyright 2002-2009 the VideoLAN team])
 
-AC_INIT(vlc, 1.0.0-rc1)
+AC_INIT(vlc, 1.1.0-git)
 VERSION_MAJOR="1"
-VERSION_MINOR="0"
+VERSION_MINOR="1"
 VERSION_REVISION="0"
-VERSION_EXTRA="-rc1"
+VERSION_EXTRA="-git"
 PKGDIR="vlc"
 AC_SUBST(PKGDIR)
 
@@ -2024,28 +2024,28 @@ AC_ARG_ENABLE(dc1394,
   [  --enable-dc1394         dc1394 access module (default disabled)])
 if test "${enable_dc1394}" = "yes"
 then
-  AC_CHECK_HEADERS(libraw1394/raw1394.h, [
-    AC_CHECK_LIB( raw1394, raw1394_get_nodecount, [
-        AC_CHECK_HEADERS(libdc1394/dc1394_control.h , [
-dnl         AC_CHECK_LIB( dc1394_control, dc1394_setup_capture, [
-              VLC_ADD_PLUGIN([dc1394])
-              VLC_ADD_LIBS([dc1394],[-ldc1394_control -lraw1394])
-dnl         ],
-dnl         [
-dnl           AC_MSG_ERROR([libdc1394 is mandatory for the dc1394 input module. try --disable-dc1394 or install this library])
-dnl         ])
-      ],
-      [
-        AC_MSG_ERROR([libdc1394 is mandatory for the dc1394 input module. try --disable-dc1394 or install this library])
-      ])
+  dnl
+  dnl Check for libraw1394
+  dnl
+  PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 2.0.1,
+    [
+      VLC_ADD_LIBS([dc1394],[`${PKG_CONFIG} --libs libraw1394`])
+      VLC_ADD_CPPFLAGS([dc1394],[`${PKG_CONFIG} --cflags libraw1394`])
     ],
+    [AC_MSG_ERROR([Couldn't find libraw1394 >= 2.0.1, install libraw1394 development package])]
+  )
+
+  dnl
+  dnl Check for libdc1394
+  dnl
+  PKG_CHECK_MODULES(LIBDC1394, libdc1394-2 >= 2.0.2,
     [
-      AC_MSG_ERROR([libraw1394 is mandatory for the dc1394 input module. try --disable-dc1394 or install this library])
-    ])
-  ],
-  [
-    AC_MSG_ERROR([libraw1394 is mandatory for the dc1394 input module. try --disable-dc1394 or install this library])
-  ])
+      VLC_ADD_PLUGIN([dc1394])
+      VLC_ADD_LIBS([dc1394],[`${PKG_CONFIG} --libs libdc1394-2`])
+      VLC_ADD_CPPFLAGS([access_dv],[`${PKG_CONFIG} --cflags libdc1394-2`])
+    ],
+    [AC_MSG_ERROR([Couldn't find libdc1394 >= 2.0.2, install libdc1394 development package])]
+  )
 fi
 
 dnl
@@ -2055,120 +2055,28 @@ AC_ARG_ENABLE(dv,
 [  --enable-dv             dv input module (default disabled)])
 if test "${enable_dv}" = "yes"
 then
-  AC_ARG_WITH(dv-raw1394,
-  [    --with-dv-raw1394=PATH   libraw1394 headers and libraries])
-  AC_ARG_WITH(dv-raw1394-tree,
-  [    --with-dv-raw1394=PATH   libraw1394 tree for static linking])
-
-  if test -z "${with_dv_raw1394}" -a "${with_dv_raw1394}" != ""
-  then
-    AC_MSG_CHECKING(for raw1394 headers in ${with_dv_raw1394})
-    if test -f ${with_dv_raw1394}/include/libraw1394/raw1394.h
-    then
-      dnl  Use ${with_dv_raw1394}/include/libraw1394/raw1394.h
-      AC_MSG_RESULT(yes)
-      VLC_ADD_PLUGIN([access_dv])
-      VLC_ADD_LIBS([access_dv],[-L${with_dv_raw1394}/lib -lraw1394 -lpthread])
-      VLC_ADD_CPPFLAGS([access_dv],[-I${with_dv_raw1394}/include])
-    else
-      dnl  No libraw1394 could be found, sorry
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot find ${with_dv_raw1394}/include/libraw1394/raw1394.h])
-    fi
-  else
-    AC_CHECK_HEADERS(libraw1394/raw1394.h,
-    [ VLC_ADD_PLUGIN([access_dv])
-        VLC_ADD_LIBS([access_dv],[-lraw1394 -lavc1394])
-    ],[
-        if test -n "${enable_dv}"
-        then
-          AC_MSG_ERROR([cannot find libraw1394 headers])
-        fi
-    ])
-  fi
-
-  dnl Check for static linking of libraw1394
-  if test -z "${with_dv_raw1394_tree}" -a "${with_dv_raw1394_tree}" != ""
-  then
-    AC_MSG_CHECKING(for libraw1394.a in ${with_dv_raw1394_tree})
-    real_dv_raw1394_tree="`cd ${with_dv_raw1394_tree} 2>/dev/null && pwd`"
-    if test -z "${real_dv_raw1394_tree}"
-    then
-      dnl  The given directory can't be found
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot cd to ${real_dv_raw1394_tree}])
-    fi
-    if test -f "${real_dv_raw1394_tree}/src/.libs/libraw1394.a"
-    then
-      dnl  Use a custom libraw1394
-      AC_MSG_RESULT(${real_dv_raw1394_tree}/src/.libs/libraw1394.a)
-      VLC_ADD_PLUGIN([access_dv])
-      VLC_ADD_LIBS([access_dv],[-L${real_dv_raw1394_tree}/src/.libs -lraw1394])
-      VLC_ADD_CPPFLAGS([access_dv],[-I${real_dv_raw1394_tree}])
-    else
-      dnl  The given libraw1394 wasn't built
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot find ${real_dv_raw1394_tree}/src/.libs/libraw1394.a, make sure you compiled libraw1394 in ${with_dv_raw1394_tree}])
-    fi
-  fi
+  dnl
+  dnl Check for libraw1394
+  dnl
+  PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 2.0.1,
+    [
+      VLC_ADD_LIBS([access_dv],[`${PKG_CONFIG} --libs libraw1394`])
+      VLC_ADD_CPPFLAGS([access_dv],[`${PKG_CONFIG} --cflags libraw1394`])
+    ],
+    [AC_MSG_ERROR([Couldn't find libraw1394 >= 2.0.1, install libraw1394 development package])]
+  )
 
   dnl
   dnl Check for libavc1394
   dnl
-
-  AC_ARG_WITH(dv-avc1394,
-  [    --with-dv-avc1394=PATH   libavc1394 headers and libraries])
-  AC_ARG_WITH(dv-avc1394-tree,
-  [    --with-dv-avc1394=PATH   libavc1394 tree for static linking])
-
-  if test -z "${with_dv_avc1394}" -a "${with_dv_avc1394}" != ""
-  then
-    AC_MSG_CHECKING(for avc1394 headers in ${with_dv_avc1394})
-    if test -f ${with_dv_avc1394}/include/libavc1394/avc1394.h
-    then
-      dnl  Use ${with_dv_avc1394}/include/libavc1394/avc1394.h
-      AC_MSG_RESULT(yes)
-      VLC_ADD_LIBS([access_dv],[-L${with_dv_avc1394}/lib -lavc1394 -lrom1394 -lpthread])
-      VLC_ADD_CPPFLAGS([access_dv],[-I${with_avc1394}/include])
-    else
-      dnl  No libavc1394 could be found, sorry
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot find ${with_dv_avc1394}/include/libavc1394/avc1394.h])
-    fi
-  else
-    AC_CHECK_HEADERS(libavc1394/avc1394.h,
-    [ VLC_ADD_LIBS([access_dv],[-lavc1394 -lrom1394 -lpthread])
-    ],[
-        if test -n "${enable_dv}"
-        then
-          AC_MSG_ERROR([cannot find libavc1394 headers])
-        fi
-    ])
-  fi
-
-  dnl Check for static linking of libavc1394
-  if test -z "${with_dv_avc1394_tree}" -a "${with_dv_avc1394_tree}" != ""
-  then
-    AC_MSG_CHECKING(for libavc1394.a in ${with_dv_avc1394_tree})
-    real_dv_avc1394_tree="`cd ${with_dv_avc1394_tree} 2>/dev/null && pwd`"
-    if test -z "${real_dv_avc1394_tree}"
-    then
-      dnl  The given directory can't be found
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot cd to ${real_dv_avc1394_tree}])
-    fi
-    if test -f "${real_dv_avc1394_tree}/src/.libs/libavc1394.a"
-    then
-      dnl  Use a custom libavc1394
-      AC_MSG_RESULT(${real_dv_avc1394_tree}/src/.libs/libavc1394.a)
-      VLC_ADD_LIBS([access_dv],[-L${real_dv_avc1394_tree}/src/.libs -lavc1394 -lrom1394 -lpthread])
-      VLC_ADD_CPPFLAGS([access_dv],[-I${real_dv_avc1394_tree}])
-    else
-      dnl  The given libavc1394 wasn't built
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot find ${real_dv_avc1394_tree}/src/.libs/libavc1394.a, make sure you compiled libavc1394 in ${with_dv_avc1394_tree}])
-    fi
-  fi
+  PKG_CHECK_MODULES(LIBAVC1394, libavc1394 >= 0.5.3,
+    [
+      VLC_ADD_PLUGIN([access_dv])
+      VLC_ADD_LIBS([access_dv],[`${PKG_CONFIG} --libs libavc1394`])
+      VLC_ADD_CPPFLAGS([access_dv],[`${PKG_CONFIG} --cflags libavc1394`])
+    ],
+    [AC_MSG_ERROR([Couldn't find libavc1394 >= 0.5.1, install libavc1394 development package])]
+  )
 fi
 
 dnl
@@ -4106,12 +4014,14 @@ AS_IF([test "$enable_xinerama" != "no"], [
       VLC_ADD_LIBS([xvideo],[-lXinerama_pic])
       VLC_ADD_LIBS([x11],[-lXinerama_pic])
       VLC_ADD_LIBS([glx],[-lXinerama_pic])
+      VLC_ADD_LIBS([xvmc],[-lXinerama_pic])
       ac_cv_have_xinerama="yes"
     ],[
       AC_CHECK_LIB(Xinerama, XineramaQueryExtension,[
         VLC_ADD_LIBS([xvideo],[-lXinerama])
         VLC_ADD_LIBS([x11],[-lXinerama])
         VLC_ADD_LIBS([glx],[-lXinerama])
+        VLC_ADD_LIBS([xvmc],[-lXinerama])
         ac_cv_have_xinerama="yes"
       ])
     ])
index 2cb82e11034c42b79115efd043f41fdfd06aa1eb..93053490ec6c97ca53f7f33fb25a711b68ac0b16 100644 (file)
@@ -71,88 +71,6 @@ VLC_DEPRECATED_API void libvlc_media_player_set_drawable ( libvlc_media_player_t
 VLC_DEPRECATED_API libvlc_drawable_t
                     libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
 
-/**
- * Set the default video output's parent.
- *
- * This setting will be used as default for any video output.
- *
- * \param p_instance libvlc instance
- * \param drawable the new parent window
- *                 (see libvlc_media_player_set_drawable() for details)
- * \param p_e an initialized exception pointer
- * @deprecated Use libvlc_media_player_set_drawable
- */
-VLC_DEPRECATED_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
-
-/**
- * Set the default video output parent.
- *
- * This setting will be used as default for all video outputs.
- *
- * \param p_instance libvlc instance
- * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
- * \param p_e an initialized exception pointer
- * @deprecated Use libvlc_media_player_get_drawable
- */
-VLC_DEPRECATED_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
-
-/**
- * Does nothing. Do not use this function.
- */
-VLC_DEPRECATED_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
-
-/**
- * Resize the current video output window.
- * This might crash. Please use libvlc_video_set_scale() instead.
- *
- * \param p_mi media player instance
- * \param width new width for video output window
- * \param height new height for video output window
- * \param p_e an initialized exception pointer
- * \return the success status (boolean)
- */
-VLC_DEPRECATED_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
-
-/**
- * Tell windowless video output to redraw rectangular area (MacOS X only).
- * This might crash. Do not use this function.
- *
- * \param p_mi media player instance
- * \param area coordinates within video drawable
- * \param p_e an initialized exception pointer
- */
-VLC_DEPRECATED_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
-
-/**
- * Set the default video output size.
- * This setting will be used as default for all video outputs.
- *
- * \param p_instance libvlc instance
- * \param width new width for video drawable
- * \param height new height for video drawable
- * \param p_e an initialized exception pointer
- */
-VLC_DEPRECATED_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
-
-/**
- * Set the default video output viewport for a windowless video output
- * (MacOS X only). This might crash. Do not use this function.
- *
- * This setting will be used as default for all video outputs.
- *
- * \param p_instance libvlc instance
- * \param p_mi media player instance
- * \param view coordinates within video drawable
- * \param clip coordinates within video drawable
- * \param p_e an initialized exception pointer
- */
-VLC_DEPRECATED_API void libvlc_video_set_viewport( libvlc_instance_t *, libvlc_media_player_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
-
-/*
- * This function shall not be used at all. It may lead to crash and race condition.
- */
-VLC_DEPRECATED_API int libvlc_video_destroy( libvlc_media_player_t *, libvlc_exception_t *);
-
 /*****************************************************************************
  * Playlist (Deprecated)
  *****************************************************************************/
@@ -163,17 +81,6 @@ VLC_DEPRECATED_API int libvlc_video_destroy( libvlc_media_player_t *, libvlc_exc
  * @{
  */
 
-/**
- * Set the playlist's loop attribute. If set, the playlist runs continuously
- * and wraps around when it reaches the end.
- *
- * \param p_instance the playlist instance
- * \param loop the loop attribute. 1 sets looping, 0 disables it
- * \param p_e an initialized exception pointer
- */
-VLC_DEPRECATED_API void libvlc_playlist_loop( libvlc_instance_t* , int,
-                                          libvlc_exception_t * );
-
 /**
  * Start playing.
  *
@@ -191,158 +98,6 @@ VLC_DEPRECATED_API void libvlc_playlist_loop( libvlc_instance_t* , int,
 VLC_DEPRECATED_API void libvlc_playlist_play( libvlc_instance_t*, int, int,
                                           char **, libvlc_exception_t * );
 
-/**
- * Toggle the playlist's pause status.
- *
- * If the playlist was running, it is paused. If it was paused, it is resumed.
- *
- * \param p_instance the playlist instance to pause
- * \param p_e an initialized exception pointer
- */
-VLC_DEPRECATED_API void libvlc_playlist_pause( libvlc_instance_t *,
-                                           libvlc_exception_t * );
-
-/**
- * Checks whether the playlist is running
- *
- * \param p_instance the playlist instance
- * \param p_e an initialized exception pointer
- * \return 0 if the playlist is stopped or paused, 1 if it is running
- */
-VLC_DEPRECATED_API int libvlc_playlist_isplaying( libvlc_instance_t *,
-                                              libvlc_exception_t * );
-
-/**
- * Get the number of items in the playlist
- *
- * Expects the playlist instance to be locked already.
- *
- * \param p_instance the playlist instance
- * \param p_e an initialized exception pointer
- * \return the number of items
- */
-VLC_DEPRECATED_API int libvlc_playlist_items_count( libvlc_instance_t *,
-                                                libvlc_exception_t * );
-
-VLC_DEPRECATED_API int libvlc_playlist_get_current_index( libvlc_instance_t *,
-                                                 libvlc_exception_t *);
-/**
- * Lock the playlist.
- *
- * \param p_instance the playlist instance
- */
-VLC_DEPRECATED_API void libvlc_playlist_lock( libvlc_instance_t * );
-
-/**
- * Unlock the playlist.
- *
- * \param p_instance the playlist instance
- */
-VLC_DEPRECATED_API void libvlc_playlist_unlock( libvlc_instance_t * );
-
-/**
- * Stop playing.
- *
- * \param p_instance the playlist instance to stop
- * \param p_e an initialized exception pointer
- */
-VLC_DEPRECATED_API void libvlc_playlist_stop( libvlc_instance_t *,
-                                          libvlc_exception_t * );
-
-/**
- * Go to the next playlist item. If the playlist was stopped, playback
- * is started.
- *
- * \param p_instance the playlist instance
- * \param p_e an initialized exception pointer
- */
-VLC_DEPRECATED_API void libvlc_playlist_next( libvlc_instance_t *,
-                                          libvlc_exception_t * );
-
-/**
- * Go to the previous playlist item. If the playlist was stopped, playback
- * is started.
- *
- * \param p_instance the playlist instance
- * \param p_e an initialized exception pointer
- */
-VLC_DEPRECATED_API void libvlc_playlist_prev( libvlc_instance_t *,
-                                          libvlc_exception_t * );
-
-/**
- * Empty a playlist. All items in the playlist are removed.
- *
- * \param p_instance the playlist instance
- * \param p_e an initialized exception pointer
- */
-VLC_DEPRECATED_API void libvlc_playlist_clear( libvlc_instance_t *,
-                                           libvlc_exception_t * );
-
-/**
- * Append an item to the playlist. The item is added at the end. If more
- * advanced options are required, \see libvlc_playlist_add_extended instead.
- *
- * \param p_instance the playlist instance
- * \param psz_uri the URI to open, using VLC format
- * \param psz_name a name that you might want to give or NULL
- * \param p_e an initialized exception pointer
- * \return the identifier of the new item
- */
-VLC_DEPRECATED_API int libvlc_playlist_add( libvlc_instance_t *, const char *,
-                                        const char *, libvlc_exception_t * );
-
-/**
- * Append an item to the playlist. The item is added at the end, with
- * additional input options.
- *
- * \param p_instance the playlist instance
- * \param psz_uri the URI to open, using VLC format
- * \param psz_name a name that you might want to give or NULL
- * \param i_options the number of options to add
- * \param ppsz_options strings representing the options to add
- * \param p_e an initialized exception pointer
- * \return the identifier of the new item
- */
-VLC_DEPRECATED_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
-                                                 const char *, int, const char **,
-                                                 libvlc_exception_t * );
-
-/**
- * Append an item to the playlist. The item is added at the end, with
- * additional input options from an untrusted source.
- *
- * \param p_instance the playlist instance
- * \param psz_uri the URI to open, using VLC format
- * \param psz_name a name that you might want to give or NULL
- * \param i_options the number of options to add
- * \param ppsz_options strings representing the options to add
- * \param p_e an initialized exception pointer
- * \return the identifier of the new item
- */
-VLC_DEPRECATED_API int libvlc_playlist_add_extended_untrusted( libvlc_instance_t *, const char *,
-                                                 const char *, int, const char **,
-                                                 libvlc_exception_t * );
-
-/**
- * Delete the playlist item with the given ID.
- *
- * \param p_instance the playlist instance
- * \param i_id the id to remove
- * \param p_e an initialized exception pointer
- * \return 0 in case of success, a non-zero value otherwise
- */
-VLC_DEPRECATED_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
-                                                libvlc_exception_t * );
-
-/** Get the input that is currently being played by the playlist.
- *
- * \param p_instance the playlist instance to use
- * \param p_e an initialized exception pointern
- * \return a media instance object
- */
-VLC_DEPRECATED_API libvlc_media_player_t * libvlc_playlist_get_media_player(
-                                libvlc_instance_t *, libvlc_exception_t * );
-
 /** @}*/
 
 # ifdef __cplusplus
index 85176d02054cc44f179e77c6f05e034d605b3726..c9ff3292d95e7d3ddad2397831b14568b052b2ea 100644 (file)
@@ -393,31 +393,4 @@ static inline void sf_tag_to_fourcc( GUID *guid_tag,
     if( ppsz_name ) *ppsz_name = sub_format_tag_to_fourcc[i].psz_name;
 }
 
-/**
- * Structure to hold information concerning subtitles.
- * Used between demuxers and decoders of subtitles.
- */
-typedef struct es_sys_t
-{
-    char               *psz_header; /* for 'ssa ' and 'subt' */
-
-    /* for spudec */
-    unsigned int        i_orig_height;
-    unsigned int        i_orig_width;
-    unsigned int        i_origin_x;
-    unsigned int        i_origin_y;
-    unsigned int        i_scale_h;
-    unsigned int        i_scale_v;
-    unsigned int        i_alpha;
-    bool          b_smooth;
-    mtime_t             i_fade_in;
-    mtime_t             i_fade_out;
-    unsigned int        i_align;
-    mtime_t             i_time_offset;
-    bool          b_forced_subs;
-    unsigned int        palette[16];
-    unsigned int        colors[4];
-
-} subtitle_data_t;
-
 #endif /* "codecs.h" */
index 06f6fc2bf33010d1c238bf601cb5171e897766f5..561a75396481dfedb7c86ca6564c6399105c05fb 100644 (file)
@@ -383,8 +383,11 @@ typedef enum input_event_type_e
     /* "rate" has changed */
     INPUT_EVENT_RATE,
 
-    /* At least one of "position" or "time" or "length" has changed */
-    INPUT_EVENT_TIMES,
+    /* At least one of "position" or "time" */
+    INPUT_EVENT_POSITION,
+
+    /* "length" has changed */
+    INPUT_EVENT_LENGTH,
 
     /* A title has been added or removed or selected.
      * It imply that chapter has changed (not chapter event is sent) */
index df855f662e4fb643c955b753099255a3a68c609b..0aff210871579b4b731c49bac1a387e16ece3374 100644 (file)
@@ -265,8 +265,25 @@ struct text_style_t
 #define STYLE_UNDERLINE   32
 #define STYLE_STRIKEOUT   64
 
-static const text_style_t default_text_style = { NULL, 22, 0xffffff, 0xff, STYLE_OUTLINE,
-                0x000000, 0xff, 0x000000, 0xff, 0xffffff, 0x80, 0xffffff, 0xff, 1, 0, -1 };
+/**
+ * Create a default text style
+ */
+VLC_EXPORT( text_style_t *, text_style_New, ( void ) );
+
+/**
+ * Copy a text style into another
+ */
+VLC_EXPORT( text_style_t *, text_style_Copy, ( text_style_t *, const text_style_t * ) );
+
+/**
+ * Duplicate a text style
+ */
+VLC_EXPORT( text_style_t *, text_style_Duplicate, ( const text_style_t * ) );
+
+/**
+ * Delete a text style created by text_style_New or text_style_Duplicate
+ */
+VLC_EXPORT( void, text_style_Delete, ( text_style_t * ) );
 
 /**
  * OSD menu button states
@@ -590,8 +607,8 @@ static inline void osd_SetMenuUpdate( osd_menu_t *p_osd, bool b_value )
  * object. The types are declared in the include file include/vlc_osd.h
  * @see vlc_osd.h
  */
-VLC_EXPORT( int, osd_ShowTextRelative, ( spu_t *, int, const char *, text_style_t *, int, int, int, mtime_t ) );
-VLC_EXPORT( int, osd_ShowTextAbsolute, ( spu_t *, int, const char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
+VLC_EXPORT( int, osd_ShowTextRelative, ( spu_t *, int, const char *, const text_style_t *, int, int, int, mtime_t ) );
+VLC_EXPORT( int, osd_ShowTextAbsolute, ( spu_t *, int, const char *, const text_style_t *, int, int, int, mtime_t, mtime_t ) );
 VLC_EXPORT( void, osd_Message, ( spu_t *, int, char *, ... ) LIBVLC_FORMAT( 3, 4 ) );
 
 /**
@@ -611,34 +628,9 @@ VLC_EXPORT( int, osd_Icon, ( vlc_object_t *, spu_t *, int, int, int, int, int, s
  * Vout text and widget overlays
  **********************************************************************/
 
-/**
- * Show text on the video for some time
- * \param p_vout pointer to the vout the text is to be showed on
- * \param i_channel Subpicture channel
- * \param psz_string The text to be shown
- * \param p_style Pointer to a struct with text style info
- * \param i_flags flags for alignment and such
- * \param i_hmargin horizontal margin in pixels
- * \param i_vmargin vertical margin in pixels
- * \param i_duration Amount of time the text is to be shown.
- */
-VLC_EXPORT( int, vout_ShowTextRelative, ( vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t ) );
+VLC_EXPORT( int, vout_ShowTextRelative, ( vout_thread_t *, int, char *, const text_style_t *, int, int, int, mtime_t ) );
 
-/**
- * Show text on the video from a given start date to a given end date
- * \param p_vout pointer to the vout the text is to be showed on
- * \param i_channel Subpicture channel
- * \param psz_string The text to be shown
- * \param p_style Pointer to a struct with text style info
- * \param i_flags flags for alignment and such
- * \param i_hmargin horizontal margin in pixels
- * \param i_vmargin vertical margin in pixels
- * \param i_start the time when this string is to appear on the video
- * \param i_stop the time when this string should stop to be displayed
- *               if this is 0 the string will be shown untill the next string
- *               is about to be shown
- */
-VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, int, const char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
+VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, int, const char *, const text_style_t *, int, int, int, mtime_t, mtime_t ) );
 
 /**
  * Write an informative message at the default location,
index 638440377d426dcf3b9bb6d32b7e3982b472898c..f611a04f4423fdfbda47ffb4340cb8520c6bbcd5 100644 (file)
@@ -232,7 +232,7 @@ static int Open( vlc_object_t *p_this )
         free( psz_name );
         return VLC_EGENERIC;
     }
+
     p_sys->p_ev->p_frame = NULL;
     p_sys->p_ev->pp_last = &p_sys->p_ev->p_frame;
     p_sys->p_ev->p_access = p_access;
@@ -340,14 +340,6 @@ static block_t *Block( access_t *p_access )
     access_sys_t *p_sys = p_access->p_sys;
     block_t *p_block = NULL;
 
-#if 0
-    if( !p_access->psz_demux )
-    {
-        free( p_access->psz_demux );
-        p_access->psz_demux = strdup( "rawdv" );
-    }
-#endif
-
     vlc_mutex_lock( &p_sys->lock );
     p_block = p_sys->p_frame;
     //msg_Dbg( p_access, "sending frame %p",p_block );
@@ -401,7 +393,7 @@ static int Raw1394Handler( raw1394handle_t handle, int channel, size_t length, q
     p_sys = p_access->p_sys;
 
     /* skip empty packets */
-    if ( length > 16 )
+    if( length > 16 )
     {
         unsigned char * p = ( unsigned char* ) &data[ 3 ];
         int section_type = p[ 0 ] >> 5;           /* section type is in bits 5 - 7 */
@@ -476,13 +468,13 @@ static int Raw1394GetNumPorts( access_t *p_access )
     raw1394handle_t handle;
 
     /* get a raw1394 handle */
-    if ( !( handle = raw1394_new_handle() ) )
+    if( !( handle = raw1394_new_handle() ) )
     {
         msg_Err( p_access, "raw1394 - failed to get handle: %m." );
         return VLC_EGENERIC;
     }
 
-    if ( ( n_ports = raw1394_get_port_info( handle, pinf, 16 ) ) < 0 )
+    if( ( n_ports = raw1394_get_port_info( handle, pinf, 16 ) ) < 0 )
     {
         msg_Err( p_access, "raw1394 - failed to get port info: %m." );
         raw1394_destroy_handle( handle );
@@ -500,21 +492,14 @@ static raw1394handle_t Raw1394Open( access_t *p_access, int port )
     raw1394handle_t handle;
 
     /* get a raw1394 handle */
-#ifdef RAW1394_V_0_8
-
-    handle = raw1394_get_handle();
-#else
-
     handle = raw1394_new_handle();
-#endif
-
-    if ( !handle )
+    if( !handle )
     {
         msg_Err( p_access, "raw1394 - failed to get handle: %m." );
         return NULL;
     }
 
-    if ( ( n_ports = raw1394_get_port_info( handle, pinf, 16 ) ) < 0 )
+    if( ( n_ports = raw1394_get_port_info( handle, pinf, 16 ) ) < 0 )
     {
         msg_Err( p_access, "raw1394 - failed to get port info: %m." );
         raw1394_destroy_handle( handle );
@@ -522,7 +507,7 @@ static raw1394handle_t Raw1394Open( access_t *p_access, int port )
     }
 
     /* tell raw1394 which host adapter to use */
-    if ( raw1394_set_port( handle, port ) < 0 )
+    if( raw1394_set_port( handle, port ) < 0 )
     {
         msg_Err( p_access, "raw1394 - failed to set set port: %m." );
         return NULL;
@@ -598,8 +583,8 @@ static int DiscoverAVC( access_t *p_access, int* port, uint64_t guid )
 static raw1394handle_t AVCOpen( access_t *p_access, int port )
 {
     access_sys_t *p_sys = p_access->p_sys;
-    int numcards;
     struct raw1394_portinfo pinf[ 16 ];
+    int numcards;
 
     p_sys->p_avc1394 = raw1394_new_handle();
     if( !p_sys->p_avc1394 )
@@ -627,7 +612,6 @@ static void AVCClose( access_t *p_access )
     }
 }
 
-
 static int AVCResetHandler( raw1394handle_t handle, unsigned int generation )
 {
     raw1394_update_generation( handle, generation );
index e642673288c6426079a4a1cf27c6679268fa018e..0284f8be380c7a618f55e57b849b1e692ef61e97 100644 (file)
@@ -38,7 +38,7 @@ void ParseSSAString( decoder_t *p_dec,
      * MarginV, Effect, Text */
     decoder_sys_t   *p_sys = p_dec->p_sys;
     subpicture_t    *p_spu = p_spu_in;
-    ssa_style_t     *p_style = NULL;
+    ssa_style_t     *p_ssa_style = NULL;
     char            *psz_new_subtitle = NULL;
     char            *psz_buffer_sub = NULL;
     char            *psz_style = NULL;
@@ -118,12 +118,12 @@ void ParseSSAString( decoder_t *p_dec,
     for( i = 0; i < p_sys->i_ssa_styles; i++ )
     {
         if( !strcmp( p_sys->pp_ssa_styles[i]->psz_stylename, psz_style ) )
-            p_style = p_sys->pp_ssa_styles[i];
+            p_ssa_style = p_sys->pp_ssa_styles[i];
     }
     free( psz_style );
 
     p_spu->p_region->psz_text = psz_new_subtitle;
-    if( p_style == NULL )
+    if( p_ssa_style == NULL )
     {
         p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
         p_spu->p_region->i_x = p_sys->i_align ? 20 : 0;
@@ -131,18 +131,18 @@ void ParseSSAString( decoder_t *p_dec,
     }
     else
     {
-        msg_Dbg( p_dec, "style is: %s", p_style->psz_stylename);
-        p_spu->p_region->p_style = &p_style->font_style;
-        p_spu->p_region->i_align = p_style->i_align;
-        if( p_style->i_align & SUBPICTURE_ALIGN_LEFT )
+        msg_Dbg( p_dec, "style is: %s", p_ssa_style->psz_stylename );
+        p_spu->p_region->p_style = text_style_Duplicate( &p_ssa_style->font_style );
+        p_spu->p_region->i_align = p_ssa_style->i_align;
+        if( p_ssa_style->i_align & SUBPICTURE_ALIGN_LEFT )
         {
-            p_spu->p_region->i_x = (i_margin_l) ? i_margin_l : p_style->i_margin_h;
+            p_spu->p_region->i_x = (i_margin_l) ? i_margin_l : p_ssa_style->i_margin_h;
         }
-        else if( p_style->i_align & SUBPICTURE_ALIGN_RIGHT )
+        else if( p_ssa_style->i_align & SUBPICTURE_ALIGN_RIGHT )
         {
-            p_spu->p_region->i_x = (i_margin_r) ? i_margin_r : p_style->i_margin_h;
+            p_spu->p_region->i_x = (i_margin_r) ? i_margin_r : p_ssa_style->i_margin_h;
         }
-        p_spu->p_region->i_y = (i_margin_v) ? i_margin_v : p_style->i_margin_v;
+        p_spu->p_region->i_y = (i_margin_v) ? i_margin_v : p_ssa_style->i_margin_v;
     }
 }
 
@@ -233,52 +233,52 @@ void ParseSSAHeader( decoder_t *p_dec )
                     &i_border, &i_outline, &i_shadow, &i_align, &i_margin_l,
                     &i_margin_r, &i_margin_v ) == 16 )
                 {
-                    ssa_style_t *p_style = malloc( sizeof(ssa_style_t) );
+                    ssa_style_t *p_ssa_style = malloc( sizeof(ssa_style_t) );
 
-                    p_style->psz_stylename = strdup( psz_temp_stylename );
-                    p_style->font_style.psz_fontname = strdup( psz_temp_fontname );
-                    p_style->font_style.i_font_size = i_font_size;
+                    p_ssa_style->psz_stylename = strdup( psz_temp_stylename );
+                    p_ssa_style->font_style.psz_fontname = strdup( psz_temp_fontname );
+                    p_ssa_style->font_style.i_font_size = i_font_size;
 
-                    ParseColor( psz_temp_color1, &p_style->font_style.i_font_color, NULL );
-                    ParseColor( psz_temp_color4, &p_style->font_style.i_shadow_color, NULL );
-                    p_style->font_style.i_outline_color = p_style->font_style.i_shadow_color;
-                    p_style->font_style.i_font_alpha = p_style->font_style.i_outline_alpha
-                                                     = p_style->font_style.i_shadow_alpha = 0x00;
-                    p_style->font_style.i_style_flags = 0;
-                    if( i_bold ) p_style->font_style.i_style_flags |= STYLE_BOLD;
-                    if( i_italic ) p_style->font_style.i_style_flags |= STYLE_ITALIC;
+                    ParseColor( psz_temp_color1, &p_ssa_style->font_style.i_font_color, NULL );
+                    ParseColor( psz_temp_color4, &p_ssa_style->font_style.i_shadow_color, NULL );
+                    p_ssa_style->font_style.i_outline_color = p_ssa_style->font_style.i_shadow_color;
+                    p_ssa_style->font_style.i_font_alpha = p_ssa_style->font_style.i_outline_alpha
+                                                     = p_ssa_style->font_style.i_shadow_alpha = 0x00;
+                    p_ssa_style->font_style.i_style_flags = 0;
+                    if( i_bold ) p_ssa_style->font_style.i_style_flags |= STYLE_BOLD;
+                    if( i_italic ) p_ssa_style->font_style.i_style_flags |= STYLE_ITALIC;
 
                     if( i_border == 1 )
-                        p_style->font_style.i_style_flags |= (STYLE_ITALIC | STYLE_OUTLINE);
+                        p_ssa_style->font_style.i_style_flags |= (STYLE_ITALIC | STYLE_OUTLINE);
                     else if( i_border == 3 )
                     {
-                        p_style->font_style.i_style_flags |= STYLE_BACKGROUND;
-                        p_style->font_style.i_background_color = p_style->font_style.i_shadow_color;
-                        p_style->font_style.i_background_alpha = p_style->font_style.i_shadow_alpha;
+                        p_ssa_style->font_style.i_style_flags |= STYLE_BACKGROUND;
+                        p_ssa_style->font_style.i_background_color = p_ssa_style->font_style.i_shadow_color;
+                        p_ssa_style->font_style.i_background_alpha = p_ssa_style->font_style.i_shadow_alpha;
                     }
-                    p_style->font_style.i_shadow_width = i_shadow;
-                    p_style->font_style.i_outline_width = i_outline;
+                    p_ssa_style->font_style.i_shadow_width = i_shadow;
+                    p_ssa_style->font_style.i_outline_width = i_outline;
 
-                    p_style->i_align = 0;
+                    p_ssa_style->i_align = 0;
                     if( i_align == 1 || i_align == 5 || i_align == 9 )
-                        p_style->i_align |= SUBPICTURE_ALIGN_LEFT;
+                        p_ssa_style->i_align |= SUBPICTURE_ALIGN_LEFT;
                     if( i_align == 3 || i_align == 7 || i_align == 11 )
-                        p_style->i_align |= SUBPICTURE_ALIGN_RIGHT;
+                        p_ssa_style->i_align |= SUBPICTURE_ALIGN_RIGHT;
                     if( i_align < 4 )
-                        p_style->i_align |= SUBPICTURE_ALIGN_BOTTOM;
+                        p_ssa_style->i_align |= SUBPICTURE_ALIGN_BOTTOM;
                     else if( i_align < 8 )
-                        p_style->i_align |= SUBPICTURE_ALIGN_TOP;
+                        p_ssa_style->i_align |= SUBPICTURE_ALIGN_TOP;
 
-                    p_style->i_margin_h = ( p_style->i_align & SUBPICTURE_ALIGN_RIGHT ) ?
+                    p_ssa_style->i_margin_h = ( p_ssa_style->i_align & SUBPICTURE_ALIGN_RIGHT ) ?
                                                         i_margin_r : i_margin_l;
-                    p_style->i_margin_v = i_margin_v;
-                    p_style->i_margin_percent_h = 0;
-                    p_style->i_margin_percent_v = 0;
+                    p_ssa_style->i_margin_v = i_margin_v;
+                    p_ssa_style->i_margin_percent_h = 0;
+                    p_ssa_style->i_margin_percent_v = 0;
 
-                    p_style->font_style.i_karaoke_background_color = 0xffffff;
-                    p_style->font_style.i_karaoke_background_alpha = 0xff;
+                    p_ssa_style->font_style.i_karaoke_background_color = 0xffffff;
+                    p_ssa_style->font_style.i_karaoke_background_alpha = 0xff;
 
-                    TAB_APPEND( p_sys->i_ssa_styles, p_sys->pp_ssa_styles, p_style );
+                    TAB_APPEND( p_sys->i_ssa_styles, p_sys->pp_ssa_styles, p_ssa_style );
                 }
                 else msg_Warn( p_dec, "SSA v4 styleline parsing failed" );
             }
@@ -294,55 +294,55 @@ void ParseSSAHeader( decoder_t *p_dec )
                     &i_underline, &i_strikeout, &i_scale_x, &i_scale_y, &i_spacing, &i_border, &i_outline,
                     &i_shadow, &i_align, &i_margin_l, &i_margin_r, &i_margin_v ) == 21 )
                 {
-                    ssa_style_t *p_style = malloc( sizeof(ssa_style_t) );
-
-                    p_style->psz_stylename = strdup( psz_temp_stylename );
-                    p_style->font_style.psz_fontname = strdup( psz_temp_fontname );
-                    p_style->font_style.i_font_size = i_font_size;
-                    ParseColor( psz_temp_color1, &p_style->font_style.i_font_color,
-                                &p_style->font_style.i_font_alpha );
-                    ParseColor( psz_temp_color3, &p_style->font_style.i_outline_color,
-                                &p_style->font_style.i_outline_alpha );
-                    ParseColor( psz_temp_color4, &p_style->font_style.i_shadow_color,
-                                &p_style->font_style.i_shadow_alpha );
-
-                    p_style->font_style.i_style_flags = 0;
-                    if( i_bold ) p_style->font_style.i_style_flags |= STYLE_BOLD;
-                    if( i_italic ) p_style->font_style.i_style_flags |= STYLE_ITALIC;
-                    if( i_underline ) p_style->font_style.i_style_flags |= STYLE_UNDERLINE;
-                    if( i_strikeout ) p_style->font_style.i_style_flags |= STYLE_STRIKEOUT;
-                    if( i_border == 1 ) p_style->font_style.i_style_flags |= (STYLE_ITALIC | STYLE_OUTLINE);
+                    ssa_style_t *p_ssa_style = malloc( sizeof(ssa_style_t) );
+
+                    p_ssa_style->psz_stylename = strdup( psz_temp_stylename );
+                    p_ssa_style->font_style.psz_fontname = strdup( psz_temp_fontname );
+                    p_ssa_style->font_style.i_font_size = i_font_size;
+                    ParseColor( psz_temp_color1, &p_ssa_style->font_style.i_font_color,
+                                &p_ssa_style->font_style.i_font_alpha );
+                    ParseColor( psz_temp_color3, &p_ssa_style->font_style.i_outline_color,
+                                &p_ssa_style->font_style.i_outline_alpha );
+                    ParseColor( psz_temp_color4, &p_ssa_style->font_style.i_shadow_color,
+                                &p_ssa_style->font_style.i_shadow_alpha );
+
+                    p_ssa_style->font_style.i_style_flags = 0;
+                    if( i_bold ) p_ssa_style->font_style.i_style_flags |= STYLE_BOLD;
+                    if( i_italic ) p_ssa_style->font_style.i_style_flags |= STYLE_ITALIC;
+                    if( i_underline ) p_ssa_style->font_style.i_style_flags |= STYLE_UNDERLINE;
+                    if( i_strikeout ) p_ssa_style->font_style.i_style_flags |= STYLE_STRIKEOUT;
+                    if( i_border == 1 ) p_ssa_style->font_style.i_style_flags |= (STYLE_ITALIC | STYLE_OUTLINE);
                     else if( i_border == 3 )
                     {
-                        p_style->font_style.i_style_flags |= STYLE_BACKGROUND;
-                        p_style->font_style.i_background_color = p_style->font_style.i_shadow_color;
-                        p_style->font_style.i_background_alpha = p_style->font_style.i_shadow_alpha;
+                        p_ssa_style->font_style.i_style_flags |= STYLE_BACKGROUND;
+                        p_ssa_style->font_style.i_background_color = p_ssa_style->font_style.i_shadow_color;
+                        p_ssa_style->font_style.i_background_alpha = p_ssa_style->font_style.i_shadow_alpha;
                     }
-                    p_style->font_style.i_shadow_width  = ( i_border == 1 ) ? i_shadow : 0;
-                    p_style->font_style.i_outline_width = ( i_border == 1 ) ? i_outline : 0;
-                    p_style->font_style.i_spacing = i_spacing;
-                    //p_style->font_style.f_angle = f_angle;
+                    p_ssa_style->font_style.i_shadow_width  = ( i_border == 1 ) ? i_shadow : 0;
+                    p_ssa_style->font_style.i_outline_width = ( i_border == 1 ) ? i_outline : 0;
+                    p_ssa_style->font_style.i_spacing = i_spacing;
+                    //p_ssa_style->font_style.f_angle = f_angle;
 
-                    p_style->i_align = 0;
+                    p_ssa_style->i_align = 0;
                     if( i_align == 0x1 || i_align == 0x4 || i_align == 0x7 )
-                        p_style->i_align |= SUBPICTURE_ALIGN_LEFT;
+                        p_ssa_style->i_align |= SUBPICTURE_ALIGN_LEFT;
                     if( i_align == 0x3 || i_align == 0x6 || i_align == 0x9 )
-                        p_style->i_align |= SUBPICTURE_ALIGN_RIGHT;
+                        p_ssa_style->i_align |= SUBPICTURE_ALIGN_RIGHT;
                     if( i_align == 0x7 || i_align == 0x8 || i_align == 0x9 )
-                        p_style->i_align |= SUBPICTURE_ALIGN_TOP;
+                        p_ssa_style->i_align |= SUBPICTURE_ALIGN_TOP;
                     if( i_align == 0x1 || i_align == 0x2 || i_align == 0x3 )
-                        p_style->i_align |= SUBPICTURE_ALIGN_BOTTOM;
-                    p_style->i_margin_h = ( p_style->i_align & SUBPICTURE_ALIGN_RIGHT ) ?
+                        p_ssa_style->i_align |= SUBPICTURE_ALIGN_BOTTOM;
+                    p_ssa_style->i_margin_h = ( p_ssa_style->i_align & SUBPICTURE_ALIGN_RIGHT ) ?
                                             i_margin_r : i_margin_l;
-                    p_style->i_margin_v = i_margin_v;
-                    p_style->i_margin_percent_h = 0;
-                    p_style->i_margin_percent_v = 0;
+                    p_ssa_style->i_margin_v = i_margin_v;
+                    p_ssa_style->i_margin_percent_h = 0;
+                    p_ssa_style->i_margin_percent_v = 0;
 
-                    p_style->font_style.i_karaoke_background_color = 0xffffff;
-                    p_style->font_style.i_karaoke_background_alpha = 0xff;
+                    p_ssa_style->font_style.i_karaoke_background_color = 0xffffff;
+                    p_ssa_style->font_style.i_karaoke_background_alpha = 0xff;
 
                     /*TODO: Ignored: angle i_scale_x|y (fontscaling), i_encoding */
-                    TAB_APPEND( p_sys->i_ssa_styles, p_sys->pp_ssa_styles, p_style );
+                    TAB_APPEND( p_sys->i_ssa_styles, p_sys->pp_ssa_styles, p_ssa_style );
                 }
                 else msg_Dbg( p_dec, "SSA V4+ styleline parsing failed" );
             }
index 330e167ab3c10f21b9cb53c7e77628ee90370e81..717f8da1272fa517d270a0d7c036781d8f531ff7 100644 (file)
@@ -146,6 +146,7 @@ static void CloseDecoder( vlc_object_t *p_this )
                 continue;
 
             free( p_sys->pp_ssa_styles[i]->psz_stylename );
+            //FIXME: Make font_style a pointer and use text_style_* functions
             free( p_sys->pp_ssa_styles[i]->font_style.psz_fontname );
             free( p_sys->pp_ssa_styles[i] );
         }
@@ -261,7 +262,7 @@ static char *GrabAttributeValue( const char *psz_attribute,
 
 static ssa_style_t *ParseStyle( decoder_sys_t *p_sys, char *psz_subtitle )
 {
-    ssa_style_t *p_style   = NULL;
+    ssa_style_t *p_ssa_style = NULL;
     char        *psz_style = GrabAttributeValue( "style", psz_subtitle );
 
     if( psz_style )
@@ -271,11 +272,11 @@ static ssa_style_t *ParseStyle( decoder_sys_t *p_sys, char *psz_subtitle )
         for( i = 0; i < p_sys->i_ssa_styles; i++ )
         {
             if( !strcmp( p_sys->pp_ssa_styles[i]->psz_stylename, psz_style ) )
-                p_style = p_sys->pp_ssa_styles[i];
+                p_ssa_style = p_sys->pp_ssa_styles[i];
         }
         free( psz_style );
     }
-    return p_style;
+    return p_ssa_style;
 }
 
 static int ParsePositionAttributeList( char *psz_subtitle, int *i_align,
@@ -390,7 +391,7 @@ static subpicture_region_t *CreateTextRegion( decoder_t *p_dec,
 
     if( p_text_region != NULL )
     {
-        ssa_style_t  *p_style = NULL;
+        ssa_style_t  *p_ssa_style = NULL;
 
         p_text_region->psz_text = NULL;
         p_text_region->psz_html = strndup( psz_subtitle, i_len );
@@ -400,34 +401,34 @@ static subpicture_region_t *CreateTextRegion( decoder_t *p_dec,
             return NULL;
         }
 
-        p_style = ParseStyle( p_sys, p_text_region->psz_html );
-        if( !p_style )
+        p_ssa_style = ParseStyle( p_sys, p_text_region->psz_html );
+        if( !p_ssa_style )
         {
             int i;
 
             for( i = 0; i < p_sys->i_ssa_styles; i++ )
             {
                 if( !strcasecmp( p_sys->pp_ssa_styles[i]->psz_stylename, "Default" ) )
-                    p_style = p_sys->pp_ssa_styles[i];
+                    p_ssa_style = p_sys->pp_ssa_styles[i];
             }
         }
 
-        if( p_style )
+        if( p_ssa_style )
         {
-            msg_Dbg( p_dec, "style is: %s", p_style->psz_stylename );
+            msg_Dbg( p_dec, "style is: %s", p_ssa_style->psz_stylename );
 
-            p_text_region->p_style = &p_style->font_style;
-            p_text_region->i_align = p_style->i_align;
+            p_text_region->p_style = text_style_Duplicate( &p_ssa_style->font_style );
+            p_text_region->i_align = p_ssa_style->i_align;
 
             /* TODO: Setup % based offsets properly, without adversely affecting
              *       everything else in vlc. Will address with separate patch,
              *       to prevent this one being any more complicated.
 
-                     * p_style->i_margin_percent_h;
-                     * p_style->i_margin_percent_v;
+                     * p_ssa_style->i_margin_percent_h;
+                     * p_ssa_style->i_margin_percent_v;
              */
-            p_text_region->i_x         = p_style->i_margin_h;
-            p_text_region->i_y         = p_style->i_margin_v;
+            p_text_region->i_x         = p_ssa_style->i_margin_h;
+            p_text_region->i_y         = p_ssa_style->i_margin_v;
 
         }
         else
@@ -532,7 +533,7 @@ static void ParseUSFHeaderTags( decoder_t *p_dec, xml_reader_t *p_xml_reader )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
     char *psz_node;
-    ssa_style_t *p_style = NULL;
+    ssa_style_t *p_ssa_style = NULL;
     int i_style_level = 0;
     int i_metadata_level = 0;
 
@@ -565,9 +566,9 @@ static void ParseUSFHeaderTags( decoder_t *p_dec, xml_reader_t *p_xml_reader )
                     case 2:
                         if( !strcasecmp( "style", psz_node ) )
                         {
-                            TAB_APPEND( p_sys->i_ssa_styles, p_sys->pp_ssa_styles, p_style );
+                            TAB_APPEND( p_sys->i_ssa_styles, p_sys->pp_ssa_styles, p_ssa_style );
 
-                            p_style = NULL;
+                            p_ssa_style = NULL;
                             i_style_level--;
                         }
                         break;
@@ -612,8 +613,8 @@ static void ParseUSFHeaderTags( decoder_t *p_dec, xml_reader_t *p_xml_reader )
                 {
                     i_style_level++;
 
-                    p_style = calloc( 1, sizeof(ssa_style_t) );
-                    if( ! p_style )
+                    p_ssa_style = calloc( 1, sizeof(ssa_style_t) );
+                    if( !p_ssa_style )
                     {
                         free( psz_node );
                         return;
@@ -630,9 +631,11 @@ static void ParseUSFHeaderTags( decoder_t *p_dec, xml_reader_t *p_xml_reader )
                         {
                             ssa_style_t *p_default_style = p_sys->pp_ssa_styles[i];
 
-                            memcpy( p_style, p_default_style, sizeof( ssa_style_t ) );
-                            p_style->font_style.psz_fontname = strdup( p_style->font_style.psz_fontname );
-                            p_style->psz_stylename = NULL;
+                            memcpy( p_ssa_style, p_default_style, sizeof( ssa_style_t ) );
+                            //FIXME: Make font_style a pointer. Actually we double copy some data here,
+                            //   we use text_style_Copy to avoid copying psz_fontname, though .
+                            text_style_Copy( &p_ssa_style->font_style, &p_default_style->font_style );
+                            p_ssa_style->psz_stylename = NULL;
                         }
                     }
 
@@ -644,7 +647,7 @@ static void ParseUSFHeaderTags( decoder_t *p_dec, xml_reader_t *p_xml_reader )
                         if( psz_name && psz_value )
                         {
                             if( !strcasecmp( "name", psz_name ) )
-                                p_style->psz_stylename = strdup( psz_value);
+                                p_ssa_style->psz_stylename = strdup( psz_value );
                         }
                         free( psz_name );
                         free( psz_value );
@@ -661,8 +664,8 @@ static void ParseUSFHeaderTags( decoder_t *p_dec, xml_reader_t *p_xml_reader )
                         {
                             if( !strcasecmp( "face", psz_name ) )
                             {
-                                free( p_style->font_style.psz_fontname );
-                                p_style->font_style.psz_fontname = strdup( psz_value );
+                                free( p_ssa_style->font_style.psz_fontname );
+                                p_ssa_style->font_style.psz_fontname = strdup( psz_value );
                             }
                             else if( !strcasecmp( "size", psz_name ) )
                             {
@@ -671,44 +674,44 @@ static void ParseUSFHeaderTags( decoder_t *p_dec, xml_reader_t *p_xml_reader )
                                     int i_value = atoi( psz_value );
 
                                     if( ( i_value >= -5 ) && ( i_value <= 5 ) )
-                                        p_style->font_style.i_font_size  +=
-                                            ( i_value * p_style->font_style.i_font_size ) / 10;
+                                        p_ssa_style->font_style.i_font_size  +=
+                                            ( i_value * p_ssa_style->font_style.i_font_size ) / 10;
                                     else if( i_value < -5 )
-                                        p_style->font_style.i_font_size  = - i_value;
+                                        p_ssa_style->font_style.i_font_size  = - i_value;
                                     else if( i_value > 5 )
-                                        p_style->font_style.i_font_size  = i_value;
+                                        p_ssa_style->font_style.i_font_size  = i_value;
                                 }
                                 else
-                                    p_style->font_style.i_font_size  = atoi( psz_value );
+                                    p_ssa_style->font_style.i_font_size  = atoi( psz_value );
                             }
                             else if( !strcasecmp( "italic", psz_name ) )
                             {
                                 if( !strcasecmp( "yes", psz_value ))
-                                    p_style->font_style.i_style_flags |= STYLE_ITALIC;
+                                    p_ssa_style->font_style.i_style_flags |= STYLE_ITALIC;
                                 else
-                                    p_style->font_style.i_style_flags &= ~STYLE_ITALIC;
+                                    p_ssa_style->font_style.i_style_flags &= ~STYLE_ITALIC;
                             }
                             else if( !strcasecmp( "weight", psz_name ) )
                             {
                                 if( !strcasecmp( "bold", psz_value ))
-                                    p_style->font_style.i_style_flags |= STYLE_BOLD;
+                                    p_ssa_style->font_style.i_style_flags |= STYLE_BOLD;
                                 else
-                                    p_style->font_style.i_style_flags &= ~STYLE_BOLD;
+                                    p_ssa_style->font_style.i_style_flags &= ~STYLE_BOLD;
                             }
                             else if( !strcasecmp( "underline", psz_name ) )
                             {
                                 if( !strcasecmp( "yes", psz_value ))
-                                    p_style->font_style.i_style_flags |= STYLE_UNDERLINE;
+                                    p_ssa_style->font_style.i_style_flags |= STYLE_UNDERLINE;
                                 else
-                                    p_style->font_style.i_style_flags &= ~STYLE_UNDERLINE;
+                                    p_ssa_style->font_style.i_style_flags &= ~STYLE_UNDERLINE;
                             }
                             else if( !strcasecmp( "color", psz_name ) )
                             {
                                 if( *psz_value == '#' )
                                 {
                                     unsigned long col = strtol(psz_value+1, NULL, 16);
-                                    p_style->font_style.i_font_color = (col & 0x00ffffff);
-                                    p_style->font_style.i_font_alpha = (col >> 24) & 0xff;
+                                    p_ssa_style->font_style.i_font_color = (col & 0x00ffffff);
+                                    p_ssa_style->font_style.i_font_alpha = (col >> 24) & 0xff;
                                 }
                             }
                             else if( !strcasecmp( "outline-color", psz_name ) )
@@ -716,39 +719,39 @@ static void ParseUSFHeaderTags( decoder_t *p_dec, xml_reader_t *p_xml_reader )
                                 if( *psz_value == '#' )
                                 {
                                     unsigned long col = strtol(psz_value+1, NULL, 16);
-                                    p_style->font_style.i_outline_color = (col & 0x00ffffff);
-                                    p_style->font_style.i_outline_alpha = (col >> 24) & 0xff;
+                                    p_ssa_style->font_style.i_outline_color = (col & 0x00ffffff);
+                                    p_ssa_style->font_style.i_outline_alpha = (col >> 24) & 0xff;
                                 }
                             }
                             else if( !strcasecmp( "outline-level", psz_name ) )
                             {
-                                p_style->font_style.i_outline_width = atoi( psz_value );
+                                p_ssa_style->font_style.i_outline_width = atoi( psz_value );
                             }
                             else if( !strcasecmp( "shadow-color", psz_name ) )
                             {
                                 if( *psz_value == '#' )
                                 {
                                     unsigned long col = strtol(psz_value+1, NULL, 16);
-                                    p_style->font_style.i_shadow_color = (col & 0x00ffffff);
-                                    p_style->font_style.i_shadow_alpha = (col >> 24) & 0xff;
+                                    p_ssa_style->font_style.i_shadow_color = (col & 0x00ffffff);
+                                    p_ssa_style->font_style.i_shadow_alpha = (col >> 24) & 0xff;
                                 }
                             }
                             else if( !strcasecmp( "shadow-level", psz_name ) )
                             {
-                                p_style->font_style.i_shadow_width = atoi( psz_value );
+                                p_ssa_style->font_style.i_shadow_width = atoi( psz_value );
                             }
                             else if( !strcasecmp( "back-color", psz_name ) )
                             {
                                 if( *psz_value == '#' )
                                 {
                                     unsigned long col = strtol(psz_value+1, NULL, 16);
-                                    p_style->font_style.i_karaoke_background_color = (col & 0x00ffffff);
-                                    p_style->font_style.i_karaoke_background_alpha = (col >> 24) & 0xff;
+                                    p_ssa_style->font_style.i_karaoke_background_color = (col & 0x00ffffff);
+                                    p_ssa_style->font_style.i_karaoke_background_alpha = (col >> 24) & 0xff;
                                 }
                             }
                             else if( !strcasecmp( "spacing", psz_name ) )
                             {
-                                p_style->font_style.i_spacing = atoi( psz_value );
+                                p_ssa_style->font_style.i_spacing = atoi( psz_value );
                             }
                         }
                         free( psz_name );
@@ -767,48 +770,48 @@ static void ParseUSFHeaderTags( decoder_t *p_dec, xml_reader_t *p_xml_reader )
                             if( !strcasecmp( "alignment", psz_name ) )
                             {
                                 if( !strcasecmp( "TopLeft", psz_value ) )
-                                    p_style->i_align = SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_LEFT;
+                                    p_ssa_style->i_align = SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_LEFT;
                                 else if( !strcasecmp( "TopCenter", psz_value ) )
-                                    p_style->i_align = SUBPICTURE_ALIGN_TOP;
+                                    p_ssa_style->i_align = SUBPICTURE_ALIGN_TOP;
                                 else if( !strcasecmp( "TopRight", psz_value ) )
-                                    p_style->i_align = SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_RIGHT;
+                                    p_ssa_style->i_align = SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_RIGHT;
                                 else if( !strcasecmp( "MiddleLeft", psz_value ) )
-                                    p_style->i_align = SUBPICTURE_ALIGN_LEFT;
+                                    p_ssa_style->i_align = SUBPICTURE_ALIGN_LEFT;
                                 else if( !strcasecmp( "MiddleCenter", psz_value ) )
-                                    p_style->i_align = 0;
+                                    p_ssa_style->i_align = 0;
                                 else if( !strcasecmp( "MiddleRight", psz_value ) )
-                                    p_style->i_align = SUBPICTURE_ALIGN_RIGHT;
+                                    p_ssa_style->i_align = SUBPICTURE_ALIGN_RIGHT;
                                 else if( !strcasecmp( "BottomLeft", psz_value ) )
-                                    p_style->i_align = SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_LEFT;
+                                    p_ssa_style->i_align = SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_LEFT;
                                 else if( !strcasecmp( "BottomCenter", psz_value ) )
-                                    p_style->i_align = SUBPICTURE_ALIGN_BOTTOM;
+                                    p_ssa_style->i_align = SUBPICTURE_ALIGN_BOTTOM;
                                 else if( !strcasecmp( "BottomRight", psz_value ) )
-                                    p_style->i_align = SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_RIGHT;
+                                    p_ssa_style->i_align = SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_RIGHT;
                             }
                             else if( !strcasecmp( "horizontal-margin", psz_name ) )
                             {
                                 if( strchr( psz_value, '%' ) )
                                 {
-                                    p_style->i_margin_h = 0;
-                                    p_style->i_margin_percent_h = atoi( psz_value );
+                                    p_ssa_style->i_margin_h = 0;
+                                    p_ssa_style->i_margin_percent_h = atoi( psz_value );
                                 }
                                 else
                                 {
-                                    p_style->i_margin_h = atoi( psz_value );
-                                    p_style->i_margin_percent_h = 0;
+                                    p_ssa_style->i_margin_h = atoi( psz_value );
+                                    p_ssa_style->i_margin_percent_h = 0;
                                 }
                             }
                             else if( !strcasecmp( "vertical-margin", psz_name ) )
                             {
                                 if( strchr( psz_value, '%' ) )
                                 {
-                                    p_style->i_margin_v = 0;
-                                    p_style->i_margin_percent_v = atoi( psz_value );
+                                    p_ssa_style->i_margin_v = 0;
+                                    p_ssa_style->i_margin_percent_v = atoi( psz_value );
                                 }
                                 else
                                 {
-                                    p_style->i_margin_v = atoi( psz_value );
-                                    p_style->i_margin_percent_v = 0;
+                                    p_ssa_style->i_margin_v = atoi( psz_value );
+                                    p_ssa_style->i_margin_percent_v = 0;
                                 }
                             }
                         }
@@ -821,7 +824,7 @@ static void ParseUSFHeaderTags( decoder_t *p_dec, xml_reader_t *p_xml_reader )
                 break;
         }
     }
-    free( p_style );
+    free( p_ssa_style );
 }
 
 
index 9af2a75873aeed672c3bc0508633a66fe3debeb3..47ae92dca5d4e3064bfd9f625f727b8135155a77 100644 (file)
@@ -234,7 +234,7 @@ struct fbosd_render_t
     int             i_state;
 
     /* Font style */
-    text_style_t    text_style;                              /* font control */
+    text_style_t*   p_text_style;                            /* font control */
     char            *psz_string;
 
     /* Position */
@@ -310,20 +310,19 @@ static int Create( vlc_object_t *p_this )
     if( !p_intf->p_sys )
         return VLC_ENOMEM;
 
-    p_sys->p_style = malloc( sizeof( text_style_t ) );
+    p_sys->p_style = text_style_New();
     if( !p_sys->p_style )
     {
         free( p_intf->p_sys );
         return VLC_ENOMEM;
     }
-    vlc_memcpy( p_sys->p_style, &default_text_style, sizeof( text_style_t ) );
 
     p_intf->pf_run = Run;
 
     p_sys->p_image = image_HandlerCreate( p_this );
     if( !p_sys->p_image )
     {
-        free( p_sys->p_style );
+        text_style_Delete( p_sys->p_style );
         free( p_sys );
         return VLC_ENOMEM;
     }
@@ -395,10 +394,7 @@ static int Create( vlc_object_t *p_this )
     var_AddCallback( p_intf, "fbosd-font-opacity", OverlayCallback, NULL );
 
     for( i = 0; i < FBOSD_RENDER_MAX; i++ )
-    {
-        vlc_memcpy( &p_sys->render[i].text_style, &default_text_style,
-                    sizeof( text_style_t ) );
-    }
+        p_sys->render[i].p_text_style = text_style_New();
 
     p_sys->b_clear = var_CreateGetBoolCommand( p_intf, "fbosd-clear" );
     p_sys->b_render = var_CreateGetBoolCommand( p_intf, "fbosd-render" );
@@ -508,6 +504,7 @@ static void Destroy( vlc_object_t *p_this )
     {
         free( p_sys->render[i].psz_string );
         p_sys->render[i].i_state = FBOSD_STATE_FREE;
+        text_style_Delete( p_sys->render[i].p_text_style );
     }
 
 #if defined(FBOSD_BLENDING)
@@ -520,7 +517,7 @@ static void Destroy( vlc_object_t *p_this )
     if( p_sys->p_overlay )
         picture_Release( p_sys->p_overlay );
 
-    free( p_sys->p_style );
+    text_style_Delete( p_sys->p_style );
     free( p_sys );
 }
 
@@ -865,7 +862,7 @@ static picture_t *RenderText( intf_thread_t *p_intf, const char *psz_string,
             subpicture_region_Delete( p_region );
             return NULL;
         }
-        p_region->p_style = p_style;
+        p_region->p_style = text_style_Duplicate( p_style );
         p_region->i_align = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
 
         if( p_sys->p_text->pf_render_text )
@@ -1194,7 +1191,7 @@ static void Render( intf_thread_t *p_intf, struct fbosd_render_t *render )
 #if defined(FBOSD_BLENDING)
         video_format_t fmt_in;
         memset( &fmt_in, 0, sizeof(video_format_t) );
-        p_text = RenderText( p_intf, render->psz_string, &render->text_style,
+        p_text = RenderText( p_intf, render->psz_string, render->p_text_style,
                              &fmt_in );
         if( p_text )
         {
@@ -1204,7 +1201,7 @@ static void Render( intf_thread_t *p_intf, struct fbosd_render_t *render )
             DeAllocatePicture( p_text, &fmt_in );
         }
 #else
-        p_text = RenderText( p_intf, render->psz_string, &render->text_style,
+        p_text = RenderText( p_intf, render->psz_string, render->p_text_style,
                              &p_sys->fmt_out );
         if( p_text )
         {
@@ -1220,8 +1217,8 @@ static void RenderClear( intf_thread_t *p_intf, struct fbosd_render_t *render )
 {
     intf_sys_t *p_sys = p_intf->p_sys;
 
-    vlc_memcpy( &render->text_style, &default_text_style,
-                sizeof( text_style_t ) );
+    text_style_Delete( render->p_text_style );
+    render->p_text_style = text_style_New();
     free( render->psz_string );
     render->psz_string = NULL;
 
@@ -1399,15 +1396,15 @@ static int OverlayCallback( vlc_object_t *p_this, char const *psz_cmd,
         }
         else if( !strncmp( psz_cmd, "fbosd-font-size", 15 ) )
         {
-            p_sys->render[i].text_style.i_font_size = newval.i_int;
+            p_sys->render[i].p_text_style->i_font_size = newval.i_int;
         }
         else if( !strncmp( psz_cmd, "fbosd-font-color", 16 ) )
         {
-            p_sys->render[i].text_style.i_font_color = newval.i_int;
+            p_sys->render[i].p_text_style->i_font_color = newval.i_int;
         }
         else if( !strncmp( psz_cmd, "fbosd-font-opacity", 18 ) )
         {
-            p_sys->render[i].text_style.i_font_alpha = 255 - newval.i_int;
+            p_sys->render[i].p_text_style->i_font_alpha = 255 - newval.i_int;
         }
         else if( !strncmp( psz_cmd, "fbosd-alpha", 11 ) )
         {
index 6921963e1dcf7873066be847438108db03b43e44..7f88fe2b34ae0d012ab6672ed296b5fb8179e28e 100644 (file)
@@ -211,6 +211,19 @@ void CloseVideoGL ( vlc_object_t * p_this )
     msg_Dbg( p_this, "Closing" );
 
 #ifndef __x86_64__
+    /* If the fullscreen window is still open, close it */
+    if( p_vout->b_fullscreen )
+    {
+        p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+        if( p_vout->p_sys->b_embedded )
+        {
+            aglManage( p_vout );
+            var_SetBool( p_vout->p_parent, "fullscreen", false );
+        }
+        else
+            Manage( p_vout );
+    }
+
     if( p_vout->p_sys->b_embedded )
     {
         if( p_vout->p_sys->agl_ctx )
index 6a995efa2ee5a701d812f25cb0b80f7a24ef68c0..5da79af8b216a4138444890ace1668ac8c07db51 100644 (file)
@@ -121,7 +121,7 @@ WId VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
 
 /* Set the Widget to the correct Size */
 /* Function has to be called by the parent
-   Parent has to care about resizing himself*/
+   Parent has to care about resizing itself */
 void VideoWidget::SetSizing( unsigned int w, unsigned int h )
 {
     msg_Dbg( p_intf, "Video is resizing to: %i %i", w, h );
index 94b08b4b9510f0a5cb21b8ce3fb70838d0184033..8064fac0e453ffbd58501ec4cf13e3b72181dba7 100644 (file)
@@ -275,7 +275,8 @@ static int InputEvent( vlc_object_t *p_this, const char *,
     case INPUT_EVENT_RATE:
         event = new IMEvent( ItemRateChanged_Type, 0 );
         break;
-    case INPUT_EVENT_TIMES:
+    case INPUT_EVENT_POSITION:
+    //case INPUT_EVENT_LENGTH:
         event = new IMEvent( PositionUpdate_Type, 0 );
         break;
 
index 8baf686df71f3ebcf5fddb614bf7fd8338086109..7bb39c12796abaad08b199e28a414935e4f6f5b8 100644 (file)
@@ -760,7 +760,7 @@ void MainInterface::releaseVideoSlot( void )
     videoIsActive = false;
 
     /* Try to resize, except when you are in Fullscreen mode */
-    if( !isFullScreen() ) doComponentsUpdate();
+    doComponentsUpdate();
 }
 
 /* Call from WindowControl function */
index 2f74e238f95403358bfd9d17e904276a998d60a2..515f79f367f2f576fbc9c3f9c3b4bbb952a7d999 100644 (file)
@@ -182,7 +182,6 @@ signals:
     void askReleaseVideo( );
     void askVideoToResize( unsigned int, unsigned int );
     void askVideoToShow( unsigned int, unsigned int );
-    void askVideoToToggle();
     void askBgWidgetToToggle();
     void askUpdate();
     void minimalViewToggled( bool );
index 554a37ac5c1814b738fb6fdffba3afd6ee2be0ed..012dab91d425bdfa31f6cb59c79c471c917e780c 100644 (file)
@@ -403,7 +403,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
                     psz_help = config_CategoryHelpGet( p_item->value.i );
                     if( psz_help )
                     {
-                        config_data->psz_help = wraptext( strdup( psz_help ), 72 );
+                        config_data->psz_help = strdup( psz_help );
                     }
                     else
                     {
@@ -447,7 +447,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
                         const char *psz_help = config_CategoryHelpGet( p_item->value.i );
                         if( psz_help )
                         {
-                            config_data->psz_help = wraptext( strdup( psz_help ), 72 );
+                            config_data->psz_help = strdup( psz_help );
                         }
                         else
                         {
@@ -462,7 +462,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
                     psz_help = config_CategoryHelpGet( p_item->value.i );
                     if( psz_help )
                     {
-                        config_data->psz_help = wraptext( strdup( psz_help ), 72 );
+                        config_data->psz_help = strdup( psz_help );
                     }
                     else
                     {
index c015c4ccbc16c91f84f85cb64f0e18f2ea91fa65..8d2fce48f1c880a411e812eb5dab5ac31605307b 100644 (file)
@@ -358,9 +358,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         if( p_overlay->format.i_chroma == VLC_FOURCC('T','E','X','T') )
         {
             p_region->psz_text = strdup( p_overlay->data.p_text );
-            p_region->p_style = malloc( sizeof(struct text_style_t) );
-            if( p_region->p_style )
-                *p_region->p_style = p_overlay->fontstyle;
+            p_region->p_style = text_style_Duplicate( p_overlay->p_fontstyle );
         }
         else
         {
index 8eb500a527a32bfc0c9de63395e930f00c63e41c..a40c73dfb636a273d6924a253ed931a6ca73d002 100644 (file)
@@ -122,7 +122,7 @@ typedef struct overlay_t
     bool b_active;
 
     video_format_t format;
-    struct text_style_t fontstyle;
+    struct text_style_t *p_fontstyle;
     union {
         picture_t *p_pic;
         char *p_text;
index 3f3f5b82fc5e513dff7f3d5beea1bf936c92297e..95bdd85d95a0d3f62cc8105f008d3119c86520aa 100644 (file)
@@ -58,7 +58,7 @@ overlay_t *OverlayCreate( void )
     p_ovl->b_active = false;
     vout_InitFormat( &p_ovl->format, VLC_FOURCC( '\0','\0','\0','\0') , 0, 0,
                      VOUT_ASPECT_FACTOR );
-    memcpy( &p_ovl->fontstyle, &default_text_style, sizeof(struct text_style_t) );
+    p_ovl->p_fontstyle = text_style_New();
     p_ovl->data.p_text = NULL;
 
     return p_ovl;
@@ -68,6 +68,7 @@ int OverlayDestroy( overlay_t *p_ovl )
 {
     if( p_ovl->data.p_text != NULL )
         free( p_ovl->data.p_text );
+    text_style_Delete( p_ovl->p_fontstyle );
 
     return VLC_SUCCESS;
 }
@@ -636,7 +637,7 @@ static int exec_GetTextAlpha( filter_t *p_filter,
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_results->fontstyle.i_font_alpha = p_ovl->fontstyle.i_font_alpha;
+    p_results->fontstyle.i_font_alpha = p_ovl->p_fontstyle->i_font_alpha;
     return VLC_SUCCESS;
 }
 
@@ -649,7 +650,7 @@ static int exec_GetTextColor( filter_t *p_filter,
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_results->fontstyle.i_font_color = p_ovl->fontstyle.i_font_color;
+    p_results->fontstyle.i_font_color = p_ovl->p_fontstyle->i_font_color;
     return VLC_SUCCESS;
 }
 
@@ -662,7 +663,7 @@ static int exec_GetTextSize( filter_t *p_filter,
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_results->fontstyle.i_font_size = p_ovl->fontstyle.i_font_size;
+    p_results->fontstyle.i_font_size = p_ovl->p_fontstyle->i_font_size;
     return VLC_SUCCESS;
 }
 
@@ -725,7 +726,7 @@ static int exec_SetTextAlpha( filter_t *p_filter,
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_ovl->fontstyle.i_font_alpha = p_params->fontstyle.i_font_alpha;
+    p_ovl->p_fontstyle->i_font_alpha = p_params->fontstyle.i_font_alpha;
     p_sys->b_updated = p_ovl->b_active;
     return VLC_SUCCESS;
 }
@@ -741,7 +742,7 @@ static int exec_SetTextColor( filter_t *p_filter,
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_ovl->fontstyle.i_font_color = p_params->fontstyle.i_font_color;
+    p_ovl->p_fontstyle->i_font_color = p_params->fontstyle.i_font_color;
     p_sys->b_updated = p_ovl->b_active;
     return VLC_SUCCESS;
 }
@@ -757,7 +758,7 @@ static int exec_SetTextSize( filter_t *p_filter,
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_ovl->fontstyle.i_font_size = p_params->fontstyle.i_font_size;
+    p_ovl->p_fontstyle->i_font_size = p_params->fontstyle.i_font_size;
     p_sys->b_updated = p_ovl->b_active;
     return VLC_SUCCESS;
 }
index 0d2565f61dfb18d42b172f9b38ddc8bf40e4f2a3..1d8388b7a7c3c0a2b57f0903aad70a98e224f819 100644 (file)
@@ -204,8 +204,7 @@ static int CreateFilter( vlc_object_t *p_this )
         return VLC_ENOMEM;
 
     vlc_mutex_init( &p_sys->lock );
-    p_sys->p_style = malloc( sizeof( text_style_t ) );
-    memcpy( p_sys->p_style, &default_text_style, sizeof( text_style_t ) );
+    p_sys->p_style = text_style_New();
 
     config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,
                        p_filter->p_cfg );
@@ -242,7 +241,7 @@ static void DestroyFilter( vlc_object_t *p_this )
     filter_t *p_filter = (filter_t *)p_this;
     filter_sys_t *p_sys = p_filter->p_sys;
 
-    free( p_sys->p_style );
+    text_style_Delete( p_sys->p_style );
     free( p_sys->psz_marquee );
 
     /* Delete the marquee variables */
@@ -323,7 +322,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
     p_spu->p_region->i_x = p_sys->i_xoff;
     p_spu->p_region->i_y = p_sys->i_yoff;
 
-    p_spu->p_region->p_style = p_sys->p_style;
+    p_spu->p_region->p_style = text_style_Duplicate( p_sys->p_style );
 
 out:
     vlc_mutex_unlock( &p_sys->lock );
index 8eef177220630dd8bde0f8792924646dd62b459e..c08083aa643b689a5f041ae33fa10731f7e86e0a 100644 (file)
@@ -272,7 +272,7 @@ static int CreateFilter( vlc_object_t *p_this )
     }
     p_sys->psz_marquee[p_sys->i_length] = '\0';
 
-    p_sys->p_style = malloc( sizeof( text_style_t ));
+    p_sys->p_style = text_style_New();
     if( p_sys->p_style == NULL )
     {
         free( p_sys->psz_marquee );
@@ -282,7 +282,6 @@ static int CreateFilter( vlc_object_t *p_this )
         free( p_sys );
         return VLC_ENOMEM;
     }
-    memcpy( p_sys->p_style, &default_text_style, sizeof( text_style_t ));
 
     p_sys->i_xoff = var_CreateGetInteger( p_filter, CFG_PREFIX "x" );
     p_sys->i_yoff = var_CreateGetInteger( p_filter, CFG_PREFIX "y" );
@@ -299,7 +298,7 @@ static int CreateFilter( vlc_object_t *p_this )
     if( FetchRSS( p_filter ) )
     {
         msg_Err( p_filter, "failed while fetching RSS ... too bad" );
-        free( p_sys->p_style );
+        text_style_Delete( p_sys->p_style );
         free( p_sys->psz_marquee );
         vlc_mutex_unlock( &p_sys->lock );
         vlc_mutex_destroy( &p_sys->lock );
@@ -311,7 +310,7 @@ static int CreateFilter( vlc_object_t *p_this )
 
     if( p_sys->i_feeds == 0 )
     {
-        free( p_sys->p_style );
+        text_style_Delete( p_sys->p_style );
         free( p_sys->psz_marquee );
         vlc_mutex_unlock( &p_sys->lock );
         vlc_mutex_destroy( &p_sys->lock );
@@ -323,7 +322,7 @@ static int CreateFilter( vlc_object_t *p_this )
     {
         if( p_sys->p_feeds[i_feed].i_items == 0 )
         {
-            free( p_sys->p_style );
+            text_style_Delete( p_sys->p_style );
             free( p_sys->psz_marquee );
             FreeRSS( p_filter );
             vlc_mutex_unlock( &p_sys->lock );
@@ -351,7 +350,7 @@ static void DestroyFilter( vlc_object_t *p_this )
 
     vlc_mutex_lock( &p_sys->lock );
 
-    free( p_sys->p_style );
+    text_style_Delete( p_sys->p_style );
     free( p_sys->psz_marquee );
     free( p_sys->psz_urls );
     FreeRSS( p_filter );
@@ -530,7 +529,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         p_spu->b_absolute = false;
     }
 
-    p_spu->p_region->p_style = p_sys->p_style;
+    p_spu->p_region->p_style = text_style_Duplicate( p_sys->p_style );
 
     if( p_feed->p_pic )
     {
index 0e256851465e28b1d0f2f7c3c4fa5016bd95588c..9777707117aa66232af98d229dd29ffef0bf7232 100644 (file)
@@ -231,7 +231,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
 static void Display( vout_thread_t *p_vout, picture_t *p_pic )
 {
     /* No need to do anything, the fake direct buffers stay as they are */
-    int i_width, i_height, i_x, i_y;
+    unsigned int i_width, i_height, i_x, i_y;
 
     vout_PlacePicture( p_vout, p_vout->p_sys->i_width, p_vout->p_sys->i_height,
                        &i_x, &i_y, &i_width, &i_height );
index b041adaf3dda284cc67626bd2a03abba9adaaa59..39513690c8cfb96cf46bff8ac188404792a3df5e 100644 (file)
@@ -69,44 +69,17 @@ static int Control (vout_window_t *, int, va_list);
  */
 static int Open (vlc_object_t *obj, const char *varname, bool ptr)
 {
-    static vlc_mutex_t serializer = VLC_STATIC_MUTEX;
     vout_window_t *wnd = (vout_window_t *)obj;
-    vlc_value_t val, globval;
+    vlc_value_t val;
 
-    if (var_Create (obj->p_libvlc, "drawable-busy", VLC_VAR_BOOL)
-     || var_Create (obj, varname, VLC_VAR_DOINHERIT
+    if (var_Create (obj, varname, VLC_VAR_DOINHERIT
                                   | (ptr ? VLC_VAR_ADDRESS : VLC_VAR_INTEGER)))
         return VLC_ENOMEM;
     var_Get (obj, varname, &val);
-
-    vlc_mutex_lock (&serializer);
-    /* Note: We cannot simply clear the drawable variable.
-     * It would break libvlc_video_get_parent(). */
-    var_Get (obj->p_libvlc, varname, &globval);
-    if (ptr ? (val.p_address == globval.p_address)
-            : (val.i_int == globval.i_int))
-    {
-        if (var_GetBool (obj->p_libvlc, "drawable-busy"))
-        {   /* LibVLC-wide drawable already in use */
-            if (ptr)
-                val.p_address = NULL;
-            else
-                val.i_int = 0;
-        }
-        else
-            var_SetBool (obj->p_libvlc, "drawable-busy", true);
-    }
-    /* If we got a drawable _not_ from the root object (from the input?),
-     * We assume it is not busy. This is a bug. */
-    vlc_mutex_unlock (&serializer);
-
     var_Destroy (obj, varname);
 
     if (ptr ? (val.p_address == NULL) : (val.i_int == 0))
-    {
-        var_Destroy (obj->p_libvlc, "drawable-busy");
         return VLC_EGENERIC;
-    }
 
     if (ptr)
         wnd->handle.hwnd = val.p_address;
@@ -136,11 +109,7 @@ static int  OpenHWND (vlc_object_t *obj)
  */
 static void Close (vlc_object_t *obj)
 {
-    /* This is atomic with regards to var_GetBool() in Open(): */
-    var_SetBool (obj->p_libvlc, "drawable-busy", false);
-
-    /* Variables are reference-counted... */
-    var_Destroy (obj->p_libvlc, "drawable-busy");
+    (void)obj;
 }
 
 
index 7cabe6654bfd726737f6f375279b774c993951fe..0f6efc0b09e2a03b11c57b675ee5e03e17fe7d58 100644 (file)
@@ -128,14 +128,14 @@ NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notify
 
 NPError
 NPN_PostURL(NPP instance, const char* url, const char* window,
-         uint32 len, const char* buf, NPBool file)
+         uint32_t len, const char* buf, NPBool file)
 {
     return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance,
                     url, window, len, buf, file);
 }
 
 NPError
-NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len,
+NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len,
                   const char* buf, NPBool file, void* notifyData)
 {
     return CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify,
@@ -157,8 +157,8 @@ NPN_NewStream(NPP instance, NPMIMEType type, const char *window,
                     type, window, stream_ptr);
 }
 
-int32
-NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer)
+int32_t
+NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
 {
     return CallNPN_WriteProc(gNetscapeFuncs.write, instance,
                     stream, len, buffer);
@@ -183,8 +183,7 @@ NPN_UserAgent(NPP instance)
     return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance);
 }
 
-void*
-NPN_MemAlloc(uint32 size)
+void *NPN_MemAlloc(uint32_t size)
 {
     return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
 }
@@ -194,7 +193,7 @@ void NPN_MemFree(void* ptr)
     CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
 }
 
-uint32 NPN_MemFlush(uint32 size)
+uint32_t NPN_MemFlush(uint32_t size)
 {
     return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
 }
@@ -443,15 +442,15 @@ void NPN_SetException(NPObject* obj, const NPUTF8 *message)
  ***********************************************************************/
 
 /* Function prototypes */
-NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode,
-        int16 argc, char* argn[], char* argv[], NPSavedData* saved);
+NPError Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode,
+        int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
 NPError Private_Destroy(NPP instance, NPSavedData** save);
 NPError Private_SetWindow(NPP instance, NPWindow* window);
 NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
-                          NPBool seekable, uint16* stype);
-int32 Private_WriteReady(NPP instance, NPStream* stream);
-int32 Private_Write(NPP instance, NPStream* stream, int32 offset,
-                    int32 len, void* buffer);
+                          NPBool seekable, uint16_t* stype);
+int32_t Private_WriteReady(NPP instance, NPStream* stream);
+int32_t Private_Write(NPP instance, NPStream* stream, int32_t offset,
+                    int32_t len, void* buffer);
 void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
 NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason);
 void Private_URLNotify(NPP instance, const char* url,
@@ -465,8 +464,8 @@ JRIGlobalRef Private_GetJavaClass(void);
 
 /* function implementations */
 NPError
-Private_New(NPMIMEType pluginType, NPP instance, uint16 mode,
-        int16 argc, char* argn[], char* argv[], NPSavedData* saved)
+Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode,
+        int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
 {
     NPError ret;
     PLUGINDEBUGSTR("New");
@@ -492,7 +491,7 @@ Private_SetWindow(NPP instance, NPWindow* window)
 
 NPError
 Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
-            NPBool seekable, uint16* stype)
+            NPBool seekable, uint16_t* stype)
 {
     NPError err;
     PLUGINDEBUGSTR("NewStream");
@@ -500,7 +499,7 @@ Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
     return err;
 }
 
-int32
+int32_t
 Private_WriteReady(NPP instance, NPStream* stream)
 {
     unsigned int result;
@@ -509,8 +508,8 @@ Private_WriteReady(NPP instance, NPStream* stream)
     return result;
 }
 
-int32
-Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len,
+int32_t
+Private_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len,
         void* buffer)
 {
     unsigned int result;
index f802c2e396c2034c79262e7818a6206d02a6558d..463c7606cd83c35b53e8d6d3834ce5e25c3ee0d7 100644 (file)
@@ -449,7 +449,7 @@ NPError NPN_GetURL(NPP instance, const char *url, const char *target)
     return g_pNavigatorFuncs->geturl(instance, url, target);
 }
 
-NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
+NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData)
 {
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     NPError err;
@@ -463,7 +463,7 @@ NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uin
 }
 
 
-NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file)
+NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file)
 {
     return g_pNavigatorFuncs->posturl(instance, url, window, len, buf, file);
 }
@@ -497,11 +497,11 @@ NPError NPN_NewStream(NPP instance, NPMIMEType type,
 
 /* Provides len bytes of data.
  */
-int32 NPN_Write(NPP instance, NPStream *stream,
-                int32 len, void *buffer)
+int32_t NPN_Write(NPP instance, NPStream *stream,
+                int32_t len, void *buffer)
 {
     int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
-    int32 result;
+    int32_t result;
 
     if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
         result = g_pNavigatorFuncs->write(instance, stream, len, buffer);
@@ -546,7 +546,7 @@ const char* NPN_UserAgent(NPP instance)
 /* allocates memory from the Navigator's memory space.  Necessary so that
  * saved instance data may be freed by Navigator when exiting.
  */
-voidNPN_MemAlloc(uint32 size)
+void *NPN_MemAlloc(uint32 size)
 {
     return g_pNavigatorFuncs->memalloc(size);
 }
index 2f6086089134f97a81cde1cd358c279909349447..5c26ced69e0051d3b249c1503ed5e43a6df247e3 100644 (file)
@@ -670,6 +670,7 @@ function onPlay()
 function onEnd()\r
 {\r
     document.getElementById("state").innerHTML = "End...";\r
+    doStop();\r
 }\r
 \r
 var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "((  Live  ))");\r
index 51704b18df12d0bd907ffb0de989c5d62b8d7f3d..0d137cd225fe38d2558454074c96c3a07d90dbb3 100644 (file)
@@ -136,7 +136,7 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
     /* parse plugin arguments */
     for( int i = 0; i < argc ; i++ )
     {
-        fprintf(stderr, "argn=%s, argv=%s\n", argn[i], argv[i]);
+       /* fprintf(stderr, "argn=%s, argv=%s\n", argn[i], argv[i]); */
 
         if( !strcmp( argn[i], "target" )
          || !strcmp( argn[i], "mrl")
@@ -187,7 +187,7 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
         }
         else if( !strcmp( argn[i], "toolbar" ) )
         {
-/* FIXME: Remove this when toolbar functionality has been implemented on\
+/* FIXME: Remove this when toolbar functionality has been implemented on
  * MacOS X and Win32 for Firefox/Mozilla/Safari. */
 #ifdef XP_UNIX
             b_toolbar = boolValue(argv[i]);
@@ -199,7 +199,6 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
     libvlc_exception_init(&ex);
 
     libvlc_instance = libvlc_new(ppsz_argc, ppsz_argv, &ex);
-
     if( libvlc_exception_raised(&ex) )
     {
         libvlc_exception_clear(&ex);
index b59c42d1651d92c5f7105510ccd1aab0a60740e6..e0b937bf239041d01dcc0788ec4ac07626ccbb54 100644 (file)
@@ -167,8 +167,7 @@ int16 NPP_HandleEvent( NPP instance, void * event )
         return false;
     }
 
-    VlcPlugin *p_plugin = (VlcPlugin*)instance->pdata;
-
+    VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
     if( p_plugin == NULL )
     {
         return false;
@@ -388,14 +387,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     {
         /* check if plugin has a new parent window */
         CGrafPtr drawable = (((NP_Port*) (window->window))->port);
-        if( !curwin.window || drawable != (((NP_Port*) (curwin.window))->port) )
-        {
-            /* set/change parent window */
-            libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, &ex);
-            if( libvlc_exception_raised(&ex) )
-                fprintf( stderr, "Exception: %s\n", libvlc_exception_get_message(&ex) );
-            libvlc_exception_clear(&ex);
-        }
 
         /* as MacOS X video output is windowless, set viewport */
         libvlc_rectangle_t view, clip;
@@ -417,8 +408,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
         clip.right   = window->clipRect.right;
 
         libvlc_video_set_viewport(p_vlc, p_plugin->getMD(&ex), &view, &clip, &ex);
-        if( libvlc_exception_raised(&ex) )
-            fprintf( stderr, "Exception: %s\n", libvlc_exception_get_message(&ex) );
         libvlc_exception_clear(&ex);
 
         /* remember new window */
@@ -427,11 +416,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     else if( curwin.window )
     {
         /* change/set parent */
-        libvlc_video_set_parent(p_vlc, 0, &ex);
-        if( libvlc_exception_raised(&ex) )
-            fprintf( stderr, "Exception: %s\n", libvlc_exception_get_message(&ex) );
-        libvlc_exception_clear(&ex);
-
         curwin.window = NULL;
     }
 #endif /* XP_MACOSX */
@@ -464,12 +448,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
             style |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
             SetWindowLong((HWND)drawable, GWL_STYLE, style);
 
-            /* change/set parent */
-            libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, &ex);
-            if( libvlc_exception_raised(&ex) )
-                fprintf( stderr, "Exception: %s\n", libvlc_exception_get_message(&ex) );
-            libvlc_exception_clear(&ex);
-
             /* remember new window */
             p_plugin->setWindow(*window);
 
@@ -485,12 +463,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
         SetWindowLong( oldwin, GWL_WNDPROC, (LONG)(p_plugin->getWindowProc()) );
         p_plugin->setWindowProc(NULL);
 
-        /* change/set parent */
-        libvlc_video_set_parent(p_vlc, 0, &ex);
-        if( libvlc_exception_raised(&ex) )
-            fprintf( stderr, "Exception: %s\n", libvlc_exception_get_message(&ex) );
-        libvlc_exception_clear(&ex);
-
         curwin.window = NULL;
     }
 #endif /* XP_WIN */
@@ -540,12 +512,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
             XtAddEventHandler( w, ButtonReleaseMask, FALSE,
                                (XtEventHandler)ControlHandler, p_plugin );
 
-            /* set/change parent window */
-            libvlc_video_set_parent( p_vlc, (libvlc_drawable_t) video, &ex );
-            if( libvlc_exception_raised(&ex) )
-                fprintf( stderr, "Exception: %s\n", libvlc_exception_get_message(&ex) );
-            libvlc_exception_clear(&ex);
-
             /* remember window */
             p_plugin->setWindow( *window );
             p_plugin->setVideoWindow( video );
@@ -566,11 +532,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     }
     else if( curwin.window )
     {
-        /* change/set parent */
-        libvlc_video_set_parent(p_vlc, 0, &ex);
-        if( libvlc_exception_raised(&ex) )
-            fprintf( stderr, "Exception: %s\n", libvlc_exception_get_message(&ex) );
-        libvlc_exception_clear(&ex);
         curwin.window = NULL;
     }
 #endif /* XP_UNIX */
@@ -838,13 +799,9 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
 
         libvlc_exception_init( &ex );
         libvlc_media_player_t *p_md = p_plugin->getMD(&ex);
-        if( libvlc_exception_raised(&ex) )
-            fprintf( stderr, "%s\n", libvlc_exception_get_message(&ex));
         libvlc_exception_clear( &ex );
 
         i_playing = p_plugin->playlist_isplaying( &ex );
-        if( libvlc_exception_raised(&ex) )
-            fprintf( stderr, "%s\n", libvlc_exception_get_message(&ex));
         libvlc_exception_clear( &ex );
 
         vlc_toolbar_clicked_t clicked;
@@ -859,8 +816,6 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
                 else
                     p_plugin->playlist_play( &ex );
 
-                if( libvlc_exception_raised(&ex) )
-                    fprintf( stderr, "%s\n", libvlc_exception_get_message(&ex));
                 libvlc_exception_clear( &ex );
             }
             break;
@@ -868,8 +823,6 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
             case clicked_Stop:
             {
                 p_plugin->playlist_stop(&ex);
-                if( libvlc_exception_raised(&ex) )
-                    fprintf( stderr, "%s\n", libvlc_exception_get_message(&ex));
                 libvlc_exception_clear( &ex );
             }
             break;
@@ -877,8 +830,6 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
             case clicked_Fullscreen:
             {
                 p_plugin->set_fullscreen( 1, &ex );
-                if( libvlc_exception_raised(&ex) )
-                    fprintf( stderr, "%s\n", libvlc_exception_get_message(&ex));
                 libvlc_exception_clear( &ex );
             }
             break;
@@ -887,8 +838,6 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
             case clicked_Unmute:
             {
                 libvlc_audio_toggle_mute( p_plugin->getVLC(), &ex );
-                if( libvlc_exception_raised(&ex) )
-                    fprintf( stderr, "%s\n", libvlc_exception_get_message(&ex));
                 libvlc_exception_clear( &ex );
             }
             break;
@@ -906,8 +855,6 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
                             ( ((float)i_xPos-4.0 ) / ( ((float)i_width-8.0)/100) );
 
                     libvlc_media_player_set_time( p_md, f_length, &ex );
-                    if( libvlc_exception_raised(&ex) )
-                        fprintf( stderr, "%s\n", libvlc_exception_get_message(&ex));
                     libvlc_exception_clear( &ex );
                 }
             }
index 059b4d43541d513b659544cdd713eded09722b3c..0c6a4b4cf2d755b20161a8e56cdad88750f781db 100644 (file)
@@ -176,7 +176,7 @@ libvlc_la_LIBADD = `$(VLC_CONFIG) -libs libvlc` \
        libvlccore.la ../compat/libcompat.la
 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
 libvlc_la_LDFLAGS = $(AM_LDFLAGS) `$(VLC_CONFIG) --ldflags libvlc` \
-       -version-info 4:0:2 \
+       -version-info 5:0:0 \
        -export-symbols $(srcdir)/libvlc.sym
 libvlc_la_DEPENDENCIES = libvlc.sym libvlccore.la
 if HAVE_WIN32
index 0b2ba422c36e911c1dc1801d96b376d5b2a617f2..6c411f23ed9308c07c889b69aac826845a45c6b9 100644 (file)
@@ -512,7 +512,13 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
         goto error;
     }
 
-    if (asprintf (&temporary, "%s.%u", permanent, getpid ()) == -1)
+    if (asprintf (&temporary, "%s.%u", permanent,
+#ifdef UNDER_CE
+                  GetCurrentProcessId ()
+#else
+                  getpid ()
+#endif
+                 ) == -1)
     {
         temporary = NULL;
         module_list_free (list);
index d7f0b41facbe27bba69cf38d89846a2d5844f216..69d8b265f3bae0e4632cb3f37d5e6559bb91f32f 100644 (file)
@@ -93,8 +93,8 @@ void libvlc_event_manager_release( libvlc_event_manager_t * p_em )
     libvlc_event_listeners_group_t * p_lg;
     int i,j ;
 
-    vlc_mutex_destroy( &p_em->event_sending_lock );
-    vlc_mutex_destroy( &p_em->object_lock );
+    vlc_mutex_lock( &p_em->event_sending_lock );
+    vlc_mutex_lock( &p_em->object_lock );
 
     for( i = 0; i < vlc_array_count(&p_em->listeners_groups); i++)
     {
@@ -107,7 +107,15 @@ void libvlc_event_manager_release( libvlc_event_manager_t * p_em )
         free( p_lg );
     }
     vlc_array_clear( &p_em->listeners_groups );
+
+    vlc_mutex_unlock( &p_em->object_lock );
+    vlc_mutex_unlock( &p_em->event_sending_lock );
+
     libvlc_release( p_em->p_libvlc_instance );
+
+    vlc_mutex_destroy( &p_em->event_sending_lock );
+    vlc_mutex_destroy( &p_em->object_lock );
+
     free( p_em );
 }
 
@@ -122,9 +130,14 @@ void libvlc_event_manager_register_event_type(
         libvlc_exception_t * p_e )
 {
     libvlc_event_listeners_group_t * listeners_group;
+
+    vlc_mutex_lock( &p_em->object_lock );
+
     listeners_group = malloc(sizeof(libvlc_event_listeners_group_t));
     if( !listeners_group )
     {
+        vlc_mutex_unlock( &p_em->object_lock );
+
         libvlc_exception_raise( p_e, "No Memory left" );
         return;
     }
@@ -132,7 +145,6 @@ void libvlc_event_manager_register_event_type(
     listeners_group->event_type = event_type;
     vlc_array_init( &listeners_group->listeners );
 
-    vlc_mutex_lock( &p_em->object_lock );
     vlc_array_append( &p_em->listeners_groups, listeners_group );
     vlc_mutex_unlock( &p_em->object_lock );
 }
@@ -171,6 +183,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
             if( !array_listeners_cached )
             {
                 fprintf(stderr, "Can't alloc memory in libvlc_event_send" );
+                vlc_mutex_unlock( &p_em->object_lock );
                 return;
             }
 
@@ -187,6 +200,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
 
     if( !listeners_group )
     {
+        vlc_mutex_unlock( &p_em->object_lock );
         free( array_listeners_cached );
         return;
     }
@@ -215,9 +229,10 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
         listener_cached->pf_callback( p_event, listener_cached->p_user_data );
         listener_cached++;
     }
-    vlc_mutex_unlock( &p_em->event_sending_lock );
 
     free( array_listeners_cached );
+
+    vlc_mutex_unlock( &p_em->event_sending_lock );
 }
 
 /*
@@ -299,9 +314,13 @@ void libvlc_event_attach( libvlc_event_manager_t * p_event_manager,
     libvlc_event_listener_t * listener;
     int i;
 
+    vlc_mutex_lock( &p_event_manager->object_lock );
+
     listener = malloc(sizeof(libvlc_event_listener_t));
     if( !listener )
     {
+        vlc_mutex_unlock( &p_event_manager->object_lock );
+
         libvlc_exception_raise( p_e, "No Memory left" );
         return;
     }
@@ -310,7 +329,6 @@ void libvlc_event_attach( libvlc_event_manager_t * p_event_manager,
     listener->p_user_data = p_user_data;
     listener->pf_callback = pf_callback;
 
-    vlc_mutex_lock( &p_event_manager->object_lock );
     for( i = 0; i < vlc_array_count(&p_event_manager->listeners_groups); i++ )
     {
         listeners_group = vlc_array_item_at_index(&p_event_manager->listeners_groups, i);
@@ -321,9 +339,11 @@ void libvlc_event_attach( libvlc_event_manager_t * p_event_manager,
             return;
         }
     }
-    vlc_mutex_unlock( &p_event_manager->object_lock );
 
     free(listener);
+
+    vlc_mutex_unlock( &p_event_manager->object_lock );
+
     libvlc_exception_raise( p_e,
             "This object event manager doesn't know about '%s' events",
             libvlc_event_type_name(event_type));
@@ -344,8 +364,8 @@ void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
     libvlc_event_listener_t * listener;
     int i, j;
 
-    vlc_mutex_lock( &p_event_manager->event_sending_lock );
     vlc_mutex_lock( &p_event_manager->object_lock );
+
     for( i = 0; i < vlc_array_count(&p_event_manager->listeners_groups); i++)
     {
         listeners_group = vlc_array_item_at_index(&p_event_manager->listeners_groups, i);
@@ -367,14 +387,13 @@ void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
                     free( listener );
                     vlc_array_remove( &listeners_group->listeners, j );
                     vlc_mutex_unlock( &p_event_manager->object_lock );
-                    vlc_mutex_unlock( &p_event_manager->event_sending_lock );
                     return;
                 }
             }
         }
     }
+
     vlc_mutex_unlock( &p_event_manager->object_lock );
-    vlc_mutex_unlock( &p_event_manager->event_sending_lock );
 
     libvlc_exception_raise( p_e,
             "This object event manager doesn't know about '%s,%p,%p' event observer",
index 67e8c284469e4b7a171784a114f120e29afdc69f..2079d504025e723c0f1f13c9358d679cc68e00dd 100644 (file)
@@ -161,8 +161,6 @@ struct libvlc_media_player_t
         uint32_t xid;
         uint32_t agl;
     } drawable;
-
-    bool        b_own_its_input_thread;
 };
 
 struct libvlc_media_list_player_t
@@ -265,15 +263,6 @@ input_thread_t *libvlc_get_input_thread(
      libvlc_media_player_t *,
     libvlc_exception_t * );
 
-/* Media instance */
-libvlc_media_player_t *
-libvlc_media_player_new_from_input_thread( libvlc_instance_t *,
-                                           input_thread_t *,
-                                           libvlc_exception_t * );
-
-void libvlc_media_player_destroy(
-        libvlc_media_player_t * );
-
 /* Media Descriptor */
 libvlc_media_t * libvlc_media_new_from_input_item(
         libvlc_instance_t *, input_item_t *,
index c3e698d06ded674e221f8b48eebf74f10c36b8e8..00216dad432d8e822814ba7f43ecc44214d20830 100644 (file)
@@ -47,9 +47,9 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_with_root_index( i
 }
 
 /**************************************************************************
- *       path_deepness (Media List Player Internal)
+ *       path_depth (Media List Player Internal)
  **************************************************************************/
-static inline int libvlc_media_list_path_deepness( libvlc_media_list_path_t path )
+static inline int libvlc_media_list_path_depth( libvlc_media_list_path_t path )
 {
     int i;
     for( i = 0; path[i] != -1; i++ );
@@ -61,10 +61,10 @@ static inline int libvlc_media_list_path_deepness( libvlc_media_list_path_t path
  **************************************************************************/
 static inline void libvlc_media_list_path_append( libvlc_media_list_path_t * p_path, int index )
 {
-    int old_deepness = libvlc_media_list_path_deepness( *p_path );
-    *p_path = realloc( *p_path, sizeof(int)*(old_deepness+2));
-    *p_path[old_deepness] = index;
-    *p_path[old_deepness+1] = -1;
+    int old_depth = libvlc_media_list_path_depth( *p_path );
+    *p_path = realloc( *p_path, sizeof(int)*(old_depth+2));
+    *p_path[old_depth] = index;
+    *p_path[old_depth+1] = -1;
 }
 
 /**************************************************************************
@@ -73,11 +73,11 @@ static inline void libvlc_media_list_path_append( libvlc_media_list_path_t * p_p
 static inline libvlc_media_list_path_t libvlc_media_list_path_copy_by_appending( libvlc_media_list_path_t path, int index )
 {
     libvlc_media_list_path_t ret;
-    int old_deepness = libvlc_media_list_path_deepness( path );
-    ret = malloc( sizeof(int)*(old_deepness+2) );
-    memcpy( ret, path, sizeof(int)*(old_deepness+2) );
-    ret[old_deepness] = index;
-    ret[old_deepness+1] = -1;
+    int old_depth = libvlc_media_list_path_depth( path );
+    ret = malloc( sizeof(int)*(old_depth+2) );
+    memcpy( ret, path, sizeof(int)*(old_depth+2) );
+    ret[old_depth] = index;
+    ret[old_depth+1] = -1;
     return ret;
 }
 
@@ -87,9 +87,9 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_copy_by_appending(
 static inline libvlc_media_list_path_t libvlc_media_list_path_copy( libvlc_media_list_path_t path )
 {
     libvlc_media_list_path_t ret;
-    int deepness = libvlc_media_list_path_deepness( path );
-    ret = malloc( sizeof(int)*(deepness+1) );
-    memcpy( ret, path, sizeof(int)*(deepness+1) );
+    int depth = libvlc_media_list_path_depth( path );
+    ret = malloc( sizeof(int)*(depth+1) );
+    memcpy( ret, path, sizeof(int)*(depth+1) );
     return ret;
 }
 
index 0f704bd26998f44a08345abecb84aeffccc056b1..d5865d99c2e6ceb833f1f9938ebdaf2e01baa360 100644 (file)
@@ -64,23 +64,23 @@ get_next_path( libvlc_media_list_player_t * p_mlp )
                             p_mlp->p_mlist,
                             p_mlp->current_playing_item_path );
 
-    int deepness = libvlc_media_list_path_deepness( p_mlp->current_playing_item_path );
-    if( deepness < 1 || !p_parent_of_playing_item )
+    int depth = libvlc_media_list_path_depth( p_mlp->current_playing_item_path );
+    if( depth < 1 || !p_parent_of_playing_item )
         return NULL;
 
     ret = libvlc_media_list_path_copy( p_mlp->current_playing_item_path );
 
-    while( ret[deepness-1] >= libvlc_media_list_count( p_parent_of_playing_item, NULL ) )
+    while( ret[depth-1] >= libvlc_media_list_count( p_parent_of_playing_item, NULL ) )
     {
-        deepness--;
-        if( deepness <= 0 )
+        depth--;
+        if( depth <= 0 )
         {
             free( ret );
             libvlc_media_list_release( p_parent_of_playing_item );
             return NULL;
         }
-        ret[deepness] = -1;
-        ret[deepness-1]++;
+        ret[depth] = -1;
+        ret[depth-1]++;
         p_parent_of_playing_item  = libvlc_media_list_parentlist_at_path(
                                         p_mlp->p_mlist,
                                         ret );
@@ -282,7 +282,31 @@ libvlc_media_list_player_new( libvlc_instance_t * p_instance,
  **************************************************************************/
 void libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp )
 {
-    free(p_mlp);
+    if( !p_mlp )
+        return;
+
+    vlc_mutex_lock( &p_mlp->object_lock );
+
+    p_mlp->i_refcount--;
+    if( p_mlp->i_refcount > 0 )
+    {
+        vlc_mutex_unlock( &p_mlp->object_lock );
+        return;
+    }
+    vlc_mutex_unlock( &p_mlp->object_lock );
+    vlc_mutex_destroy( &p_mlp->object_lock );
+
+    libvlc_event_manager_release( p_mlp->p_event_manager );
+    libvlc_media_player_release( p_mlp->p_mi );
+
+    if( p_mlp->p_mlist )
+    {
+        uninstall_playlist_observer( p_mlp );
+        libvlc_media_list_release( p_mlp->p_mlist );
+    }
+
+    free( p_mlp->current_playing_item_path );
+    free( p_mlp );
 }
 
 /**************************************************************************
index 98ca4b38ba1065ddecd785b4f0e554ec1980567e..41845add076070f04784a083e565daad0f3246ff 100644 (file)
@@ -78,24 +78,20 @@ static void release_input_thread( libvlc_media_player_t *p_mi, bool b_input_abor
 
     p_input_thread = p_mi->p_input_thread;
 
-    /* No one is tracking this input_thread apart from us. Destroy it. */
-    if( p_mi->b_own_its_input_thread )
-    {
-        var_DelCallback( p_input_thread, "can-seek",
-                         input_seekable_changed, p_mi );
-        var_DelCallback( p_input_thread, "can-pause",
-                         input_pausable_changed, p_mi );
-        var_DelCallback( p_input_thread, "intf-event",
-                         input_event_changed, p_mi );
-
-        /* We owned this one */
-        input_Stop( p_input_thread, b_input_abort );
-        vlc_thread_join( p_input_thread );
-
-        var_Destroy( p_input_thread, "drawable-hwnd" );
-        var_Destroy( p_input_thread, "drawable-xid" );
-        var_Destroy( p_input_thread, "drawable-agl" );
-    }
+    var_DelCallback( p_input_thread, "can-seek",
+                     input_seekable_changed, p_mi );
+    var_DelCallback( p_input_thread, "can-pause",
+                    input_pausable_changed, p_mi );
+    var_DelCallback( p_input_thread, "intf-event",
+                     input_event_changed, p_mi );
+
+    /* We owned this one */
+    input_Stop( p_input_thread, b_input_abort );
+    vlc_thread_join( p_input_thread );
+
+    var_Destroy( p_input_thread, "drawable-hwnd" );
+    var_Destroy( p_input_thread, "drawable-xid" );
+    var_Destroy( p_input_thread, "drawable-agl" );
 
     vlc_object_release( p_input_thread );
 
@@ -219,7 +215,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
         libvlc_media_set_state( p_mi->p_md, libvlc_state, NULL );
         libvlc_event_send( p_mi->p_event_manager, &event );
     }
-    else if( newval.i_int == INPUT_EVENT_TIMES )
+    else if( newval.i_int == INPUT_EVENT_POSITION )
     {
         if( var_GetInteger( p_input, "state" ) != PLAYING_S )
             return VLC_SUCCESS; /* Don't send the position while stopped */
@@ -241,6 +237,8 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
 
 }
 
+static void libvlc_media_player_destroy( libvlc_media_player_t * );
+
 /**************************************************************************
  * Create a Media Instance object.
  *
@@ -280,7 +278,6 @@ libvlc_media_player_new( libvlc_instance_t * p_libvlc_instance,
     p_mi->p_libvlc_instance = p_libvlc_instance;
     p_mi->p_input_thread = NULL;
     p_mi->i_refcount = 1;
-    p_mi->b_own_its_input_thread = true;
     vlc_mutex_init( &p_mi->object_lock );
     p_mi->p_event_manager = libvlc_event_manager_new( p_mi,
             p_libvlc_instance, p_e );
@@ -326,6 +323,7 @@ libvlc_media_player_new( libvlc_instance_t * p_libvlc_instance,
     /* Snapshot initialization */
     libvlc_event_manager_register_event_type( p_mi->p_event_manager,
            libvlc_MediaPlayerSnapshotTaken, p_e );
+
     /* Attach a var callback to the global object to provide the glue between
         vout_thread that generates the event and media_player that re-emits it
         with its own event manager
@@ -347,8 +345,8 @@ libvlc_media_player_new_from_media(
                                     libvlc_exception_t *p_e )
 {
     libvlc_media_player_t * p_mi;
-    p_mi = libvlc_media_player_new( p_md->p_libvlc_instance, p_e );
 
+    p_mi = libvlc_media_player_new( p_md->p_libvlc_instance, p_e );
     if( !p_mi )
         return NULL;
 
@@ -358,80 +356,35 @@ libvlc_media_player_new_from_media(
     return p_mi;
 }
 
-/**************************************************************************
- * Create a new media instance object from an input_thread (Libvlc Internal).
- **************************************************************************/
-libvlc_media_player_t * libvlc_media_player_new_from_input_thread(
-                                   struct libvlc_instance_t *p_libvlc_instance,
-                                   input_thread_t *p_input,
-                                   libvlc_exception_t *p_e )
-{
-    libvlc_media_player_t * p_mi;
-
-    if( !p_input )
-    {
-        libvlc_exception_raise( p_e, "invalid input thread" );
-        return NULL;
-    }
-
-    p_mi = libvlc_media_player_new( p_libvlc_instance, p_e );
-
-    if( !p_mi )
-        return NULL;
-
-    p_mi->p_md = libvlc_media_new_from_input_item(
-                    p_libvlc_instance,
-                    input_GetItem( p_input ), p_e );
-
-    if( !p_mi->p_md )
-    {
-        libvlc_media_player_destroy( p_mi );
-        return NULL;
-    }
-
-    /* will be released in media_player_release() */
-    vlc_object_hold( p_input );
-
-    p_mi->p_input_thread = p_input;
-    p_mi->b_own_its_input_thread = false;
-
-    return p_mi;
-}
-
 /**************************************************************************
  * Destroy a Media Instance object (libvlc internal)
  *
  * Warning: No lock held here, but hey, this is internal. Caller must lock.
  **************************************************************************/
-void libvlc_media_player_destroy( libvlc_media_player_t *p_mi )
+static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi )
 {
     input_thread_t *p_input_thread;
     libvlc_exception_t p_e;
 
-    libvlc_exception_init( &p_e );
-
-    if( !p_mi )
-        return;
+    assert( p_mi );
 
-       /* Detach Callback from the main libvlc object */
+    /* Detach Callback from the main libvlc object */
     var_DelCallback( p_mi->p_libvlc_instance->p_libvlc_int,
                      "vout-snapshottaken", SnapshotTakenCallback, p_mi );
 
+    libvlc_exception_init( &p_e );
     p_input_thread = libvlc_get_input_thread( p_mi, &p_e );
 
     if( libvlc_exception_raised( &p_e ) )
-    {
-        libvlc_event_manager_release( p_mi->p_event_manager );
+        /* no need to worry about no input thread */
         libvlc_exception_clear( &p_e );
-        free( p_mi );
-        return; /* no need to worry about no input thread */
-    }
-    vlc_mutex_destroy( &p_mi->object_lock );
-
-    vlc_object_release( p_input_thread );
-
-    libvlc_media_release( p_mi->p_md );
+    else
+        release_input_thread( p_mi, true );
 
+    libvlc_event_manager_release( p_mi->p_event_manager );
+    if( p_mi->p_md )
+        libvlc_media_release( p_mi->p_md );
+    vlc_mutex_destroy( &p_mi->object_lock );
     free( p_mi );
 }
 
@@ -442,28 +395,15 @@ void libvlc_media_player_destroy( libvlc_media_player_t *p_mi )
  **************************************************************************/
 void libvlc_media_player_release( libvlc_media_player_t *p_mi )
 {
-    if( !p_mi )
-        return;
+    bool destroy;
 
+    assert( p_mi );
     vlc_mutex_lock( &p_mi->object_lock );
-
-    p_mi->i_refcount--;
-
-    if( p_mi->i_refcount > 0 )
-    {
-        vlc_mutex_unlock( &p_mi->object_lock );
-        return;
-    }
+    destroy = !--p_mi->i_refcount;
     vlc_mutex_unlock( &p_mi->object_lock );
-    vlc_mutex_destroy( &p_mi->object_lock );
-
-    release_input_thread( p_mi, true );
-
-    libvlc_event_manager_release( p_mi->p_event_manager );
-
-    libvlc_media_release( p_mi->p_md );
 
-    free( p_mi );
+    if( destroy )
+        libvlc_media_player_destroy( p_mi );
 }
 
 /**************************************************************************
@@ -711,31 +651,17 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
         libvlc_event_send( p_mi->p_event_manager, &event );
     }
 
-    if( p_mi->b_own_its_input_thread )
-    {
-        vlc_mutex_lock( &p_mi->object_lock );
-        release_input_thread( p_mi, true ); /* This will stop the input thread */
-        vlc_mutex_unlock( &p_mi->object_lock );
-    }
-    else
-    {
-        input_thread_t * p_input_thread = libvlc_get_input_thread( p_mi, p_e );
-
-        if( !p_input_thread )
-            return;
-
-        input_Stop( p_input_thread, true );
-        vlc_object_release( p_input_thread );
-        p_mi->p_input_thread = NULL;
-    }
+    vlc_mutex_lock( &p_mi->object_lock );
+    release_input_thread( p_mi, true ); /* This will stop the input thread */
+    vlc_mutex_unlock( &p_mi->object_lock );
 }
 
 /**************************************************************************
  * set_nsobject
  **************************************************************************/
 void libvlc_media_player_set_nsobject( libvlc_media_player_t *p_mi,
-                                                                void * drawable,
-                                                                libvlc_exception_t *p_e )
+                                        void * drawable,
+                                        libvlc_exception_t *p_e )
 {
     (void) p_e;
     p_mi->drawable.nsobject = drawable;
index 76acbd8f34974c56fac999815c364ff5164993e8..22d593efba1c895e28bf81c13acd3406a8b7e1ab 100644 (file)
 
 #include <assert.h>
 
-#define PL (libvlc_priv (p_instance->p_libvlc_int)->p_playlist)
-
-static inline int playlist_was_locked( libvlc_instance_t *p_instance )
-{
-    int was_locked;
-    vlc_mutex_lock( &p_instance->instance_lock );
-    was_locked = p_instance->b_playlist_locked;
-    vlc_mutex_unlock( &p_instance->instance_lock );
-    return was_locked;
-}
-
-static inline void playlist_mark_locked( libvlc_instance_t *p_instance,
-                                         int locked )
-{
-    vlc_mutex_lock( &p_instance->instance_lock );
-    p_instance->b_playlist_locked = locked;
-    vlc_mutex_unlock( &p_instance->instance_lock );
-}
-
-void libvlc_playlist_loop( libvlc_instance_t *p_instance, int loop,
-                           libvlc_exception_t *p_e)
-{
-    VLC_UNUSED(p_e);
-
-    assert( PL );
-    var_SetBool( PL, "loop", loop );
-}
-
 void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
                            int i_options, char **ppsz_options,
                            libvlc_exception_t *p_e )
 {
-    VLC_UNUSED(p_e); VLC_UNUSED(i_options); VLC_UNUSED(ppsz_options);
-
-    int did_lock = 0;
-    assert( PL );
-    ///\todo Handle additionnal options
-
-    if( PL->items.i_size == 0 ) RAISEVOID( "Empty playlist" );
-    if( i_id > 0 )
-    {
-        playlist_item_t *p_item;
-        if (! playlist_was_locked( p_instance ) )
-        {
-            playlist_mark_locked( p_instance, 1 );
-            playlist_Lock( PL );
-            did_lock = 1;
-        }
-
-        p_item = playlist_ItemGetByInputId( PL, i_id,
-                                            PL->p_root_category );
-        if( p_item )
-            playlist_Control( PL, PLAYLIST_VIEWPLAY, pl_Locked,
-                              PL->p_root_category, p_item );
-       else
-            RAISEVOID( "Unable to find item" );
-
-        if( did_lock == 1 )
-        {
-            playlist_Unlock( PL );
-            playlist_mark_locked( p_instance, 0 );
-        }
-    }
-    else
-    {
-        playlist_Control( PL, PLAYLIST_PLAY,
-                          playlist_was_locked( p_instance ) );
-    }
-}
-
-void libvlc_playlist_pause( libvlc_instance_t *p_instance,
-                            libvlc_exception_t *p_e )
-{
-    assert( PL );
-    if( playlist_Control( PL, PLAYLIST_PAUSE,
-                          playlist_was_locked( p_instance ) ) != VLC_SUCCESS )
-        RAISEVOID( "Empty playlist" );
-}
-
-
-void libvlc_playlist_stop( libvlc_instance_t *p_instance,
-                           libvlc_exception_t *p_e )
-{
-    assert( PL );
-    if( playlist_Control( PL, PLAYLIST_STOP,
-                          playlist_was_locked( p_instance ) ) != VLC_SUCCESS )
-        RAISEVOID( "Empty playlist" );
-}
-
-void libvlc_playlist_clear( libvlc_instance_t *p_instance,
-                            libvlc_exception_t *p_e )
-{
-    VLC_UNUSED(p_e);
-
-    assert( PL );
-    playlist_Clear( PL, playlist_was_locked( p_instance ) );
-}
-
-void libvlc_playlist_next( libvlc_instance_t *p_instance,
-                           libvlc_exception_t *p_e )
-{
-    assert( PL );
-    if( playlist_Control( PL, PLAYLIST_SKIP, playlist_was_locked( p_instance ),
-                          1 ) != VLC_SUCCESS )
-        RAISEVOID( "Empty playlist" );
-}
+    playlist_t *pl = libvlc_priv (p_instance->p_libvlc_int)->p_playlist;
+    VLC_UNUSED(i_id); VLC_UNUSED(i_options); VLC_UNUSED(ppsz_options);
 
-void libvlc_playlist_prev( libvlc_instance_t *p_instance,
-                           libvlc_exception_t *p_e )
-{
-    if( playlist_Control( PL, PLAYLIST_SKIP, playlist_was_locked( p_instance ),
-                          -1  ) != VLC_SUCCESS )
-        RAISEVOID( "Empty playlist" );
+    assert( pl );
+    if( pl->items.i_size == 0 ) RAISEVOID( "Empty playlist" );
+    playlist_Control( pl, PLAYLIST_PLAY, false );
 }
-
-int libvlc_playlist_add( libvlc_instance_t *p_instance, const char *psz_uri,
-                         const char *psz_name, libvlc_exception_t *p_e )
-{
-    return libvlc_playlist_add_extended( p_instance, psz_uri, psz_name,
-                                         0, NULL, p_e );
-}
-
-static int PlaylistAddExtended( libvlc_instance_t *p_instance,
-                                const char *psz_uri, const char *psz_name,
-                                int i_options, const char **ppsz_options,
-                                unsigned i_option_flags,
-                                libvlc_exception_t *p_e )
-{
-    assert( PL );
-    if( playlist_was_locked( p_instance ) )
-    {
-        libvlc_exception_raise( p_e, "You must unlock playlist before "
-                               "calling libvlc_playlist_add" );
-        return VLC_EGENERIC;
-    }
-    return playlist_AddExt( PL, psz_uri, psz_name,
-                            PLAYLIST_INSERT, PLAYLIST_END, -1,
-                            i_options, ppsz_options, i_option_flags,
-                            true, pl_Unlocked );
-}
-int libvlc_playlist_add_extended( libvlc_instance_t *p_instance,
-                                  const char *psz_uri, const char *psz_name,
-                                  int i_options, const char **ppsz_options,
-                                  libvlc_exception_t *p_e )
-{
-    return PlaylistAddExtended( p_instance, psz_uri, psz_name,
-                                i_options, ppsz_options, VLC_INPUT_OPTION_TRUSTED,
-                                p_e );
-}
-int libvlc_playlist_add_extended_untrusted( libvlc_instance_t *p_instance,
-                                            const char *psz_uri, const char *psz_name,
-                                            int i_options, const char **ppsz_options,
-                                            libvlc_exception_t *p_e )
-{
-    return PlaylistAddExtended( p_instance, psz_uri, psz_name,
-                                i_options, ppsz_options, 0,
-                                p_e );
-}
-
-int libvlc_playlist_delete_item( libvlc_instance_t *p_instance, int i_id,
-                                 libvlc_exception_t *p_e )
-{
-    assert( PL );
-
-    if( playlist_DeleteFromInput( PL, i_id,
-                                  playlist_was_locked( p_instance ) ) )
-    {
-        libvlc_exception_raise( p_e, "deletion failed" );
-        return VLC_ENOITEM;
-    }
-    return VLC_SUCCESS;
-}
-
-int libvlc_playlist_isplaying( libvlc_instance_t *p_instance,
-                               libvlc_exception_t *p_e )
-{
-    VLC_UNUSED(p_e);
-
-    assert( PL );
-    return playlist_Status( PL ) == PLAYLIST_RUNNING;
-}
-
-int libvlc_playlist_items_count( libvlc_instance_t *p_instance,
-                                 libvlc_exception_t *p_e )
-{
-    VLC_UNUSED(p_e);
-
-    assert( PL );
-    return playlist_CurrentSize( PL );
-}
-
-int libvlc_playlist_get_current_index ( libvlc_instance_t *p_instance,
-                                        libvlc_exception_t *p_e )
-{
-    VLC_UNUSED(p_e);
-
-    assert( PL );
-    playlist_item_t *p_item = playlist_CurrentPlayingItem( PL );
-    if( !p_item )
-        return -1;
-    return p_item->i_id;
-}
-
-void libvlc_playlist_lock( libvlc_instance_t *p_instance )
-{
-    assert( PL );
-    playlist_Lock( PL );
-    p_instance->b_playlist_locked = 1;
-}
-
-void libvlc_playlist_unlock( libvlc_instance_t *p_instance )
-{
-    assert( PL );
-    p_instance->b_playlist_locked = 0;
-    playlist_Unlock( PL );
-}
-
-libvlc_media_player_t * libvlc_playlist_get_media_player(
-                                libvlc_instance_t *p_instance,
-                                libvlc_exception_t *p_e )
-{
-    libvlc_media_player_t *p_mi;
-    assert( PL );
-    input_thread_t * input = playlist_CurrentInput( PL );
-    if( input )
-    {
-        p_mi = libvlc_media_player_new_from_input_thread(
-                            p_instance, input, p_e );
-        vlc_object_release( input );
-    }
-    else
-    {
-        /* no active input */
-        p_mi = NULL;
-        libvlc_exception_raise( p_e, "No active input" );
-    }
-
-    return p_mi;
-}
-
index 7904aa29fbef50b98b403968a3eee65da7e62fb3..fd62e005a72deb7e165116d887fa2994e2d7b3f9 100644 (file)
@@ -187,157 +187,6 @@ int libvlc_media_player_has_vout( libvlc_media_player_t *p_mi,
     return has_vout;
 }
 
-int libvlc_video_reparent( libvlc_media_player_t *p_mi, libvlc_drawable_t d,
-                           libvlc_exception_t *p_e )
-{
-    (void) p_mi; (void) d;
-    libvlc_exception_raise(p_e, "Reparenting not supported");
-    return -1;
-}
-
-void libvlc_video_resize( libvlc_media_player_t *p_mi, int width, int height, libvlc_exception_t *p_e )
-{
-    vout_thread_t *p_vout = GetVout( p_mi, p_e );
-    if( p_vout )
-    {
-        vout_Control( p_vout, VOUT_SET_SIZE, width, height );
-        vlc_object_release( p_vout );
-    }
-}
-
-void libvlc_video_redraw_rectangle( libvlc_media_player_t *p_mi,
-                           const libvlc_rectangle_t *area,
-                           libvlc_exception_t *p_e )
-{
-#ifdef __APPLE__
-    if( (NULL != area)
-     && ((area->bottom - area->top) > 0)
-     && ((area->right - area->left) > 0) )
-    {
-        vout_thread_t *p_vout = GetVout( p_mi, p_e );
-        if( p_vout )
-        {
-            /* tell running vout to redraw area */
-            vout_Control( p_vout , VOUT_REDRAW_RECT,
-                               area->top, area->left, area->bottom, area->right );
-            vlc_object_release( p_vout );
-        }
-    }
-#else
-    (void) p_mi; (void) area; (void) p_e;
-#endif
-}
-
-/* global video settings */
-
-/* Deprecated use libvlc_media_player_set_drawable() */
-void libvlc_video_set_parent( libvlc_instance_t *p_instance, libvlc_drawable_t d,
-                              libvlc_exception_t *p_e )
-{
-    /* set as default for future vout instances */
-#ifdef WIN32
-    vlc_value_t val;
-
-    if( sizeof(HWND) > sizeof(libvlc_drawable_t) )
-        return; /* BOOM! we told you not to use this function! */
-    val.p_address = (void *)(uintptr_t)d;
-    var_Set( p_instance->p_libvlc_int, "drawable-hwnd", val );
-#elif defined(__APPLE__)
-    var_SetInteger( p_instance->p_libvlc_int, "drawable-agl", d );
-#else
-    var_SetInteger( p_instance->p_libvlc_int, "drawable-xid", d );
-#endif
-
-    libvlc_media_player_t *p_mi = libvlc_playlist_get_media_player(p_instance, p_e);
-    if( p_mi )
-    {
-        libvlc_media_player_set_drawable( p_mi, d, p_e );
-        libvlc_media_player_release(p_mi);
-    }
-}
-
-/* Deprecated use libvlc_media_player_get_drawable() */
-libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *p_instance, libvlc_exception_t *p_e )
-{
-    VLC_UNUSED(p_e);
-
-#ifdef WIN32
-    vlc_value_t val;
-
-    if( sizeof(HWND) > sizeof(libvlc_drawable_t) )
-        return 0;
-    var_Get( p_instance->p_libvlc_int, "drawable-hwnd", &val );
-    return (uintptr_t)val.p_address;
-#elif defined(__APPLE__)
-    return var_GetInteger( p_instance->p_libvlc_int, "drawable-agl" );
-#else
-    return var_GetInteger( p_instance->p_libvlc_int, "drawable-xid" );
-#endif
-}
-
-void libvlc_video_set_size( libvlc_instance_t *p_instance, int width, int height,
-                           libvlc_exception_t *p_e )
-{
-    /* set as default for future vout instances */
-    config_PutInt(p_instance->p_libvlc_int, "width", width);
-    config_PutInt(p_instance->p_libvlc_int, "height", height);
-
-    libvlc_media_player_t *p_mi = libvlc_playlist_get_media_player(p_instance, p_e);
-    if( p_mi )
-    {
-        vout_thread_t *p_vout = GetVout( p_mi, p_e );
-        if( p_vout )
-        {
-            /* tell running vout to re-size */
-            vout_Control( p_vout , VOUT_SET_SIZE, width, height);
-            vlc_object_release( p_vout );
-        }
-        libvlc_media_player_release(p_mi);
-    }
-}
-
-void libvlc_video_set_viewport( libvlc_instance_t *p_instance, libvlc_media_player_t *p_mi,
-                            const libvlc_rectangle_t *view, const libvlc_rectangle_t *clip,
-                           libvlc_exception_t *p_e )
-{
-#ifdef __APPLE__
-    if( !view )
-    {
-        libvlc_exception_raise( p_e, "viewport is NULL" );
-        return;
-    }
-
-    /* if clip is NULL, then use view rectangle as clip */
-    if( !clip )
-        clip = view;
-
-    /* set as default for future vout instances */
-    var_SetInteger( p_instance->p_libvlc_int, "drawable-view-top", view->top );
-    var_SetInteger( p_instance->p_libvlc_int, "drawable-view-left", view->left );
-    var_SetInteger( p_instance->p_libvlc_int, "drawable-view-bottom", view->bottom );
-    var_SetInteger( p_instance->p_libvlc_int, "drawable-view-right", view->right );
-    var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-top", clip->top );
-    var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-left", clip->left );
-    var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-bottom", clip->bottom );
-    var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-right", clip->right );
-
-    if( p_mi )
-    {
-        vout_thread_t *p_vout = GetVout( p_mi, p_e );
-        if( p_vout )
-        {
-            /* change viewport for running vout */
-            vout_Control( p_vout, VOUT_SET_VIEWPORT,
-                               view->top, view->left, view->bottom, view->right,
-                               clip->top, clip->left, clip->bottom, clip->right );
-            vlc_object_release( p_vout );
-        }
-    }
-#else
-    (void) p_instance; (void) view; (void) clip; (void) p_e;
-#endif
-}
-
 float libvlc_video_get_scale( libvlc_media_player_t *p_mp,
                               libvlc_exception_t *p_e )
 {
@@ -731,14 +580,3 @@ void libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track,
     libvlc_exception_raise( p_e, "Video track out of range" );
     vlc_object_release( p_input_thread );
 }
-
-int libvlc_video_destroy( libvlc_media_player_t *p_mi,
-                          libvlc_exception_t *p_e )
-{
-    vout_thread_t *p_vout = GetVout( p_mi, p_e );
-    vlc_object_detach( p_vout );
-    vlc_object_release( p_vout );
-    vlc_object_release( p_vout );
-
-    return 0;
-}
index 8cf6addf5fee5f334718bcb2502bd55f1e10038d..450905b90bd2f445b3180c493cc037196740c7aa 100644 (file)
@@ -140,7 +140,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
             char *psz_format = (char *)va_arg( args, char * );
 
             char *psz_value;
-            
+
             if( vasprintf( &psz_value, psz_format, args ) == -1 )
                 return VLC_EGENERIC;
 
index 22d40261304b225b9b3b728ae7f0eca2c6c13c55..86cf9e4c6d52d7305db5f46258a639b277a48f7c 100644 (file)
@@ -2445,20 +2445,24 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
             mtime_t i_time = (mtime_t)va_arg( args, mtime_t );
             mtime_t i_length = (mtime_t)va_arg( args, mtime_t );
 
-            /* Fix for buffering delay */
-            const mtime_t i_delay = EsOutGetBuffering( out );
+            input_SendEventLength( p_sys->p_input, i_length );
 
-            i_time -= i_delay;
-            if( i_time < 0 )
-                i_time = 0;
+            if( !p_sys->b_buffering )
+            {
+                /* Fix for buffering delay */
+                const mtime_t i_delay = EsOutGetBuffering( out );
 
-            if( i_length > 0 )
-                f_position -= (double)i_delay / i_length;
-            if( f_position < 0 )
-                f_position = 0;
+                i_time -= i_delay;
+                if( i_time < 0 )
+                    i_time = 0;
 
-            if( !p_sys->b_buffering )
-                input_SendEventTimes( p_sys->p_input, f_position, i_time, i_length );
+                if( i_length > 0 )
+                    f_position -= (double)i_delay / i_length;
+                if( f_position < 0 )
+                    f_position = 0;
+
+                input_SendEventPosition( p_sys->p_input, f_position, i_time );
+            }
             return VLC_SUCCESS;
         }
         case ES_OUT_SET_JITTER:
index 242bf1fd01b61e6bf5c45f7fd9deb58499abe022..6703dfed395c64a1bbc418aed0767fa061a65521 100644 (file)
@@ -60,8 +60,7 @@ void input_SendEventAbort( input_thread_t *p_input )
     Trigger( p_input, INPUT_EVENT_ABORT );
 }
 
-void input_SendEventTimes( input_thread_t *p_input,
-                           double f_position, mtime_t i_time, mtime_t i_length )
+void input_SendEventPosition( input_thread_t *p_input, double f_position, mtime_t i_time )
 {
     vlc_value_t val;
 
@@ -73,13 +72,22 @@ void input_SendEventTimes( input_thread_t *p_input,
     val.i_time = i_time;
     var_Change( p_input, "time", VLC_VAR_SETVALUE, &val, NULL );
 
+    Trigger( p_input, INPUT_EVENT_POSITION );
+}
+void input_SendEventLength( input_thread_t *p_input, mtime_t i_length )
+{
+    vlc_value_t val;
+
        /* FIXME ugly + what about meta change event ? */
-    if( var_GetTime( p_input, "length" ) != i_length )
-        input_item_SetDuration( p_input->p->p_item, i_length );
+    if( var_GetTime( p_input, "length" ) == i_length )
+        return;
+
+    input_item_SetDuration( p_input->p->p_item, i_length );
+
     val.i_time = i_length;
     var_Change( p_input, "length", VLC_VAR_SETVALUE, &val, NULL );
 
-    Trigger( p_input, INPUT_EVENT_TIMES );
+    Trigger( p_input, INPUT_EVENT_LENGTH );
 }
 void input_SendEventStatistics( input_thread_t *p_input )
 {
index b6ed2bfc607af1652b0f7645278da43af2526bc5..6fc9d9935253b4985debe3b675793a67d1155b99 100644 (file)
@@ -35,7 +35,8 @@
  *****************************************************************************/
 void input_SendEventDead( input_thread_t *p_input );
 void input_SendEventAbort( input_thread_t *p_input );
-void input_SendEventTimes( input_thread_t *p_input, double f_position, mtime_t i_time, mtime_t i_length );
+void input_SendEventPosition( input_thread_t *p_input, double f_position, mtime_t i_time );
+void input_SendEventLength( input_thread_t *p_input, mtime_t i_length );
 void input_SendEventStatistics( input_thread_t *p_input );
 void input_SendEventRate( input_thread_t *p_input, int i_rate );
 void input_SendEventAudioDelay( input_thread_t *p_input, mtime_t i_delay );
index 396994b2674a52cb6f2b67d4519293718bef1c68..bf5373eeeabc3cc3aa7fcf5a121808d63188bf9e 100644 (file)
@@ -1205,7 +1205,9 @@ static int Init( input_thread_t * p_input )
         i_length = 0;
     if( i_length <= 0 )
         i_length = input_item_GetDuration( p_input->p->p_item );
-    input_SendEventTimes( p_input, 0.0, 0, i_length );
+    input_SendEventLength( p_input, i_length );
+
+    input_SendEventPosition( p_input, 0.0, 0 );
 
     if( !p_input->b_preparsing )
     {
index 2f5d2f13f87773ce0600426db22478553188abfd..0fb54b02469b35346f7f80fbfa0fd2207009d535 100644 (file)
@@ -973,14 +973,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     }
 #endif
 
-    /*
-     * FIXME: kludge to use a p_libvlc-local variable for the Mozilla plugin
-     */
-    var_Create( p_libvlc, "drawable-xid", VLC_VAR_DOINHERIT|VLC_VAR_INTEGER );
-    var_Create( p_libvlc, "drawable-hwnd", VLC_VAR_ADDRESS );
-    var_Create( p_libvlc, "drawable-agl", VLC_VAR_INTEGER );
-    var_Create( p_libvlc, "drawable-gl", VLC_VAR_INTEGER );
-
     var_Create( p_libvlc, "drawable-view-top", VLC_VAR_INTEGER );
     var_Create( p_libvlc, "drawable-view-left", VLC_VAR_INTEGER );
     var_Create( p_libvlc, "drawable-view-bottom", VLC_VAR_INTEGER );
index 8da4a03fe3eeceaff94622b89b1c2c957c21f121..c8c489b4c042927fc5966a641f959dc4e203d6b9 100644 (file)
@@ -119,7 +119,6 @@ libvlc_media_new
 libvlc_media_new_as_node
 libvlc_media_new_from_input_item
 libvlc_media_player_can_pause
-libvlc_media_player_destroy
 libvlc_media_player_event_manager
 libvlc_media_player_get_agl
 libvlc_media_player_get_chapter
@@ -142,7 +141,6 @@ libvlc_media_player_has_vout
 libvlc_media_player_is_seekable
 libvlc_media_player_is_playing
 libvlc_media_player_new
-libvlc_media_player_new_from_input_thread
 libvlc_media_player_new_from_media
 libvlc_media_player_next_chapter
 libvlc_media_player_pause
@@ -169,23 +167,7 @@ libvlc_media_set_state
 libvlc_media_set_user_data
 libvlc_media_subitems
 libvlc_new
-libvlc_playlist_add
-libvlc_playlist_add_extended
-libvlc_playlist_add_extended_untrusted
-libvlc_playlist_clear
-libvlc_playlist_delete_item
-libvlc_playlist_get_media_player
-libvlc_playlist_isplaying
-libvlc_playlist_items_count
-libvlc_playlist_get_current_index
-libvlc_playlist_lock
-libvlc_playlist_loop
-libvlc_playlist_next
-libvlc_playlist_pause
 libvlc_playlist_play
-libvlc_playlist_prev
-libvlc_playlist_stop
-libvlc_playlist_unlock
 libvlc_release
 libvlc_retain
 libvlc_set_fullscreen
@@ -193,12 +175,10 @@ libvlc_set_log_verbosity
 libvlc_toggle_fullscreen
 libvlc_toggle_teletext
 libvlc_track_description_release
-libvlc_video_destroy
 libvlc_video_get_aspect_ratio
 libvlc_video_get_chapter_description
 libvlc_video_get_crop_geometry
 libvlc_video_get_height
-libvlc_video_get_parent
 libvlc_video_get_scale
 libvlc_video_get_spu
 libvlc_video_get_spu_count
@@ -209,19 +189,13 @@ libvlc_video_get_track
 libvlc_video_get_track_count
 libvlc_video_get_track_description
 libvlc_video_get_width
-libvlc_video_redraw_rectangle
-libvlc_video_reparent
-libvlc_video_resize
 libvlc_video_set_aspect_ratio
 libvlc_video_set_crop_geometry
-libvlc_video_set_parent
 libvlc_video_set_scale
-libvlc_video_set_size
 libvlc_video_set_spu
 libvlc_video_set_subtitle_file
 libvlc_video_set_teletext
 libvlc_video_set_track
-libvlc_video_set_viewport
 libvlc_video_take_snapshot
 libvlc_vlm_add_broadcast
 libvlc_vlm_add_vod
index d72c10f8051a2271ad641244972b59e4f3f6cc6d..3976c70d636f4bc1f5c5bfddbdac69eeda814e43 100644 (file)
@@ -376,6 +376,10 @@ subpicture_New
 subpicture_region_ChainDelete
 subpicture_region_Delete
 subpicture_region_New
+text_style_Copy
+text_style_Delete
+text_style_Duplicate
+text_style_New
 tls_ClientCreate
 tls_ClientDelete
 ToLocale
index 2c190e0b6509cab8806a9a4899b54f13584e760b..89d1a99a6d51f0a798c25fc33b2133097c058f5e 100644 (file)
@@ -508,7 +508,12 @@ void CacheSave( vlc_object_t *p_this, module_bank_t *p_bank )
 
     char psz_tmpname[sizeof (psz_filename) + 12];
     snprintf (psz_tmpname, sizeof (psz_tmpname), "%s.%"PRIu32, psz_filename,
-              (uint32_t)getpid ());
+#ifdef UNDER_CE
+              (uint32_t)GetCurrentProcessId ()
+#else
+              (uint32_t)getpid ()
+#endif
+             );
     file = utf8_fopen( psz_tmpname, "wb" );
     if (file == NULL)
         goto error;
index 2c7a1c557939d6ec570e9623e339a8fd3d3dcd60..7ae4be9b5d6990f09c587d23e6a5b9f1eed960e7 100644 (file)
  * \param p_spu pointer to the subpicture queue the text is to be showed on
  * \param i_channel Subpicture channel
  * \param psz_string The text to be shown
- * \param p_style Pointer to a struct with text style info
+ * \param p_style Pointer to a struct with text style info (it is duplicated)
  * \param i_flags flags for alignment and such
  * \param i_hmargin horizontal margin in pixels
  * \param i_vmargin vertical margin in pixels
  * \param i_duration Amount of time the text is to be shown.
  */
 int osd_ShowTextRelative( spu_t *p_spu, int i_channel,
-                           const char *psz_string, text_style_t *p_style,
+                           const char *psz_string, const text_style_t *p_style,
                            int i_flags, int i_hmargin, int i_vmargin,
                            mtime_t i_duration )
 {
@@ -58,7 +58,7 @@ int osd_ShowTextRelative( spu_t *p_spu, int i_channel,
  * \param p_spu pointer to the subpicture queue the text is to be showed on
  * \param i_channel Subpicture channel
  * \param psz_string The text to be shown
- * \param p_style Pointer to a struct with text style info
+ * \param p_style Pointer to a struct with text style info (it is duplicated)
  * \param i_flags flags for alignment and such
  * \param i_hmargin horizontal margin in pixels
  * \param i_vmargin vertical margin in pixels
@@ -68,7 +68,7 @@ int osd_ShowTextRelative( spu_t *p_spu, int i_channel,
  *               is about to be shown
  */
 int osd_ShowTextAbsolute( spu_t *p_spu_channel, int i_channel,
-                           const char *psz_string, text_style_t *p_style,
+                           const char *psz_string, const text_style_t *p_style,
                            int i_flags, int i_hmargin, int i_vmargin,
                            mtime_t i_start, mtime_t i_stop )
 {
index 7b93bebbabac6d8dc2505ebf3dd9d83b66c13e59..bc602ae5f366c3511e74af4cf750a67a4d37efca 100644 (file)
@@ -463,7 +463,15 @@ int utf8_rename (const char *oldpath, const char *newpath)
 #if defined (WIN32)
     CONVERT_PATH (oldpath, wold, -1);
     CONVERT_PATH (newpath, wnew, -1);
+# ifdef UNDER_CE
+    /* FIXME: errno support */
+    if (MoveFileW (wold, wnew))
+        return 0;
+    else
+        return -1;
+#else
     return _wrename (wold, wnew);
+#endif
 
 #endif
     const char *lo = ToLocale (oldpath);
index 860aae7c22748903e9483509cd521b29fd545469..9c6d9315e107c8912cd06ce99bbb701d9319313d 100644 (file)
@@ -36,6 +36,7 @@
 
 /* Needed by str_format_time */
 #include <time.h>
+#include <limits.h>
 
 /* Needed by str_format_meta */
 #include <vlc_input.h>
index d0e7a0ac3c7ca4e8faea8c94bf2f1891c5a2aa94..d153b2017930268071485efb764a8a7c3c31b4ab 100644 (file)
  * \param p_vout pointer to the vout the text is to be showed on
  * \param i_channel Subpicture channel
  * \param psz_string The text to be shown
- * \param p_style Pointer to a struct with text style info
+ * \param p_style Pointer to a struct with text style info (it is duplicated if non NULL)
  * \param i_flags flags for alignment and such
  * \param i_hmargin horizontal margin in pixels
  * \param i_vmargin vertical margin in pixels
  * \param i_duration Amount of time the text is to be shown.
  */
 int vout_ShowTextRelative( vout_thread_t *p_vout, int i_channel,
-                           char *psz_string, text_style_t *p_style,
+                           char *psz_string, const text_style_t *p_style,
                            int i_flags, int i_hmargin, int i_vmargin,
                            mtime_t i_duration )
 {
@@ -59,7 +59,7 @@ int vout_ShowTextRelative( vout_thread_t *p_vout, int i_channel,
  * \param p_vout pointer to the vout the text is to be showed on
  * \param i_channel Subpicture channel
  * \param psz_string The text to be shown
- * \param p_style Pointer to a struct with text style info
+ * \param p_style Pointer to a struct with text style info (it is duplicated if non NULL)
  * \param i_flags flags for alignment and such
  * \param i_hmargin horizontal margin in pixels
  * \param i_vmargin vertical margin in pixels
@@ -69,14 +69,12 @@ int vout_ShowTextRelative( vout_thread_t *p_vout, int i_channel,
  *               is about to be shown
  */
 int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel,
-                           const char *psz_string, text_style_t *p_style,
+                           const char *psz_string, const text_style_t *p_style,
                            int i_flags, int i_hmargin, int i_vmargin,
                            mtime_t i_start, mtime_t i_stop )
 {
-    (void)p_style;
     subpicture_t *p_spu;
     video_format_t fmt;
-    /* (void)p_style; FIXME: <-- why ask for this if it's unused?!? */
 
     if( !psz_string ) return VLC_EGENERIC;
 
@@ -110,6 +108,8 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel,
     p_spu->p_region->i_align = i_flags & SUBPICTURE_ALIGN_MASK;
     p_spu->p_region->i_x = i_hmargin;
     p_spu->p_region->i_y = i_vmargin;
+    if( p_style )
+        p_spu->p_region->p_style = text_style_Duplicate( p_style );
 
     spu_DisplaySubpicture( p_vout->p_spu, p_spu );
 
@@ -151,3 +151,69 @@ void __vout_OSDMessage( vlc_object_t *p_caller, int i_channel,
         va_end( args );
     }
 }
+
+/* */
+text_style_t *text_style_New( void )
+{
+    text_style_t *p_style = calloc( 1, sizeof(*p_style) );
+    if( !p_style )
+        return NULL;
+
+    /* initialize to default text style */
+    p_style->psz_fontname = NULL;
+    p_style->i_font_size = 22;
+    p_style->i_font_color = 0xffffff;
+    p_style->i_font_alpha = 0xff;
+    p_style->i_style_flags = STYLE_OUTLINE;
+    p_style->i_outline_color = 0x000000;
+    p_style->i_outline_alpha = 0xff;
+    p_style->i_shadow_color = 0x000000;
+    p_style->i_shadow_alpha = 0xff;
+    p_style->i_background_color = 0xffffff;
+    p_style->i_background_alpha = 0x80;
+    p_style->i_karaoke_background_color = 0xffffff;
+    p_style->i_karaoke_background_alpha = 0xff;
+    p_style->i_outline_width = 1;
+    p_style->i_shadow_width = 0;
+    p_style->i_spacing = -1;
+
+    return p_style;
+}
+
+text_style_t *text_style_Copy( text_style_t *p_dst, const text_style_t *p_src )
+{
+    if( !p_src )
+        return p_dst;
+
+    /* */
+    if( p_dst->psz_fontname )
+        free( p_dst->psz_fontname );
+
+    /* */
+    *p_dst = *p_src;
+
+    /* */
+    if( p_dst->psz_fontname )
+        p_dst->psz_fontname = strdup( p_dst->psz_fontname );
+
+    return p_dst;
+}
+
+text_style_t *text_style_Duplicate( const text_style_t *p_src )
+{
+    if( !p_src )
+        return NULL;
+
+    text_style_t *p_dst = calloc( 1, sizeof(*p_dst) );
+    if( p_dst )
+        text_style_Copy( p_dst, p_src );
+    return p_dst;
+}
+
+void text_style_Delete( text_style_t *p_style )
+{
+    if( p_style )
+        free( p_style->psz_fontname );
+    free( p_style );
+}
+
index 393b4bbcec3d1de87bc771e50e4f65ae9e7d29ff..104a9b2f6fc095ef180a90469b2d0fbf57955597 100644 (file)
@@ -779,7 +779,8 @@ void subpicture_region_Delete( subpicture_region_t *p_region )
 
     free( p_region->psz_text );
     free( p_region->psz_html );
-    //free( p_region->p_style ); FIXME --fenrir plugin does not allocate the memory for it. I think it might lead to segfault, video renderer can live longer than the decoder
+    if( p_region->p_style )
+        text_style_Delete( p_region->p_style );
     free( p_region );
 }
 
index 73c65b93d27143f05b5b40c59b6be81157b92827..8703d8fe51283da1afaf38613de7d8c62101c5a3 100644 (file)
@@ -38,30 +38,37 @@ samples/meta.sample:
        curl $(SAMPLES_SERVER)/metadata/id3tag/Wesh-Bonneville.mp3 > $@
 
 CFLAGS_tests = `$(VLC_CONFIG) --cflags libvlc` -DSRCDIR=\"$(srcdir)\"
+LDFLAGS_tests = -no-install -static
 
 test_libvlc_core_SOURCES = libvlc/core.c
 test_libvlc_core_LDADD = $(top_builddir)/src/libvlc.la
 test_libvlc_core_CFLAGS = $(CFLAGS_tests)
+test_libvlc_core_LDFLAGS = $(LDFLAGS_tests)
 
 test_libvlc_events_SOURCES = libvlc/events.c
 test_libvlc_events_LDADD = $(top_builddir)/src/libvlc.la
 test_libvlc_events_CFLAGS = $(CFLAGS_tests)
+test_libvlc_events_LDFLAGS = $(LDFLAGS_tests)
 
 test_libvlc_media_list_player_SOURCES = libvlc/media_list_player.c
 test_libvlc_media_list_player_LDADD = $(top_builddir)/src/libvlc.la
 test_libvlc_media_list_player_CFLAGS = $(CFLAGS_tests)
+test_libvlc_media_list_player_LDFLAGS = $(LDFLAGS_tests)
 
 test_libvlc_media_list_SOURCES = libvlc/media_list.c
 test_libvlc_media_list_LDADD = $(top_builddir)/src/libvlc.la
 test_libvlc_media_list_CFLAGS = $(CFLAGS_tests)
+test_libvlc_media_list_LDFLAGS = $(LDFLAGS_tests)
 
 test_libvlc_media_player_SOURCES = libvlc/media_player.c
 test_libvlc_media_player_LDADD = $(top_builddir)/src/libvlc.la
 test_libvlc_media_player_CFLAGS = $(CFLAGS_tests)
+test_libvlc_media_player_LDFLAGS = $(LDFLAGS_tests)
 
 test_libvlc_meta_SOURCES = libvlc/meta.c
 test_libvlc_meta_LDADD = $(top_builddir)/src/libvlc.la
 test_libvlc_meta_CFLAGS = $(CFLAGS_tests)
+test_libvlc_meta_LDFLAGS = $(LDFLAGS_tests)
 
 checkall:
        $(MAKE) check_PROGRAMS="$(check_PROGRAMS) $(EXTRA_PROGRAMS)" check
index 4f68bf110e414995fe21891417d8c5dda60e7f6d..e9d773c1520d1be43281f701f874da44e739467d 100644 (file)
@@ -34,16 +34,6 @@ static void test_core (const char ** argv, int argc)
     vlc = libvlc_new (argc, argv, &ex);
     catch ();
 
-    libvlc_playlist_clear (vlc, &ex);
-    catch ();
-
-    id = libvlc_playlist_add_extended (vlc, "/dev/null", "Test", 0, NULL,
-                                       &ex);
-    catch ();
-
-    libvlc_playlist_clear (vlc, &ex);
-    catch ();
-
     libvlc_retain (vlc);
     libvlc_release (vlc);
     libvlc_release (vlc);