extras/package/macosx/Resources/English.lproj/ErrorPanel.nib/info.nib \
extras/package/macosx/Resources/English.lproj/ErrorPanel.nib/keyedobjects.nib \
extras/package/macosx/Resources/English.lproj/InfoPlist.strings.in \
- extras/package/macosx/Resources/a52.icns \
- extras/package/macosx/Resources/aac.icns \
- extras/package/macosx/Resources/asf.icns \
- extras/package/macosx/Resources/asx.icns \
+ extras/package/macosx/Resources/aiff.icns \
+ extras/package/macosx/Resources/audio.icns \
extras/package/macosx/Resources/avi.icns \
- extras/package/macosx/Resources/bin.icns \
- extras/package/macosx/Resources/cue.icns \
- extras/package/macosx/Resources/dat.icns \
- extras/package/macosx/Resources/divx.icns \
- extras/package/macosx/Resources/dv.icns \
+ extras/package/macosx/Resources/flv.icns \
extras/package/macosx/Resources/generic.icns \
- extras/package/macosx/Resources/m3u.icns \
+ extras/package/macosx/Resources/m4a.icns \
+ extras/package/macosx/Resources/m4v.icns \
+ extras/package/macosx/Resources/mkv.icns \
extras/package/macosx/Resources/mov.icns \
+ extras/package/macosx/Resources/movie.icns \
extras/package/macosx/Resources/mp3.icns \
- extras/package/macosx/Resources/mp4.icns \
extras/package/macosx/Resources/mpeg.icns \
- extras/package/macosx/Resources/mpeg1.icns \
- extras/package/macosx/Resources/mpeg2.icns \
- extras/package/macosx/Resources/mpeg4.icns \
- extras/package/macosx/Resources/mpg.icns \
extras/package/macosx/Resources/ogg.icns \
- extras/package/macosx/Resources/ogm.icns \
- extras/package/macosx/Resources/pls.icns \
- extras/package/macosx/Resources/srt.icns \
- extras/package/macosx/Resources/sub.icns \
- extras/package/macosx/Resources/vlc.icns \
+ extras/package/macosx/Resources/playlist.icns \
+ extras/package/macosx/Resources/rm.icns \
+ extras/package/macosx/Resources/subtitle.icns \
extras/package/macosx/Resources/vob.icns \
+ extras/package/macosx/Resources/wav.icns \
+ extras/package/macosx/Resources/vlc.icns \
extras/package/macosx/Resources/wma.icns \
extras/package/macosx/Resources/wmv.icns \
extras/package/macosx/Resources/pause.png \
+Changes between 1.0.0-rc1 and 1.1.0-git:
+----------------------------------------
+
+
Changes between 0.9.9a and 1.0.0-rc1:
------------------------------------
----------------
* Alsa and OSS audio capture has been removed from the v4l and v4l2 accesses.
See 'Access:' for more info.
+ * Support for Mac OS X 10.4.x was dropped due to its technical limitations
Playback:
* Instantaneous pausing
EXPERIMENTAL work for the winCE port has been done.
Mac OS X Port:
- * Support for Mac OS X 10.4.x was dropped due to its technical limitations
* Speed improvements by using llvm-gcc
+ * New Document icons by Dominic Spitaler
Audio output:
* Removed obsolete Esound and aRts plugins
Dermot McGahon <dermot at dspsrv dot com> - Bug fixes, RC interface loop and repeat
Diego Petteno <flameeyes at gentoo dot org> - remove usage of internal ffmpeg symbols, configure fixes
DirektX <direktx at freemail.hu> - Hungarian translation
+Dominic Spitaler <Dominic dot Spitaler at gmx dot at> - Mac OS X Document Icons (v1.0)
Dominique Leuenberger <dominique-vlc dot suse at leuenberger dot net> - SuSE packaging
Dugal Harris - DirectShow fixes and MJPEG patches
Dylan Aïssi <aissi dot dylan at free dot fr> - French translation
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)
echo " Assuming --disable-skins2"
enable_x11="no"
echo " Assuming --disable-x11"
+ enable_xcb="no"
+ echo " Assuming --disable-xcb"
enable_glx="no"
echo " Assuming --disable-glx"
enable_xvideo="no"
[ --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
[ --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
AC_PATH_XTRA()
AC_ARG_ENABLE(x11,
- [ --enable-x11 X11 support (default enabled)],, [
+ [ --enable-x11 X11 support with Xlib (default enabled)],, [
AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"], [
enable_x11="yes"
], [
dnl (disabled by default except on win32)
dnl
AC_ARG_ENABLE(xvmc,
- [ --enable-xvmc XVMC support (default disabled)],, [
+ [ --enable-xvmc XvMC support (default disabled)],, [
enable_xvmc="no"
])
AS_IF([test "${enable_xvmc}" != "no"], [
dnl
dnl X C Bindings modules
-dnl (work in progress)
dnl
AC_ARG_ENABLE(xcb,
- [ --enable-xcb X C Bindings work-in-progress (default disabled)],
- ,[enable_xcb="no"])
+ [ --enable-xcb X11 support with XCB (default enabled)],, [
+ AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"], [
+ enable_xcb="yes"
+ ], [
+ enable_xcb="no"
+ ])
+])
+
AS_IF([test "${enable_xcb}" != "no"], [
PKG_CHECK_MODULES(XPROTO, [xproto])
dnl libxcb
PKG_CHECK_MODULES(XCB, [xcb])
PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
+ VLC_ADD_PLUGIN([xcb])
AS_IF([test "${enable_xvideo}" != "no"], [
PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [
dnl xcb-utils
PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms])
- VLC_ADD_PLUGIN([xcb])
VLC_ADD_PLUGIN([xcb_window])
+ VLC_ADD_PLUGIN([globalhotkeys])
+ VLC_ADD_CFLAGS([globalhotkeys],[${XCB_KEYSYMS_CFLAGS} ${XCB_CFLAGS}] )
+ VLC_ADD_LIBS([globalhotkeys],[${XCB_KEYSYMS_LIBS} ${XCB_LIBS}] )
])
+
dnl
dnl OpenGL module
dnl (enabled by default except on beos)
VLC_ADD_LIBS([maemo],[${HILDON_LIBS}])
VLC_ADD_PLUGIN([maemo])
VLC_ADD_PLUGIN([swscale_maemo])
- AC_DEFINE([BUILD_MAEMO], 1, [Define if you're using Maemo interfaces])
+ AC_DEFINE([BUILD_MAEMO], 1, [Define if you are using Maemo interfaces])
ALIASES="${ALIASES} mvlc"
], [
AS_IF([test "${enable_maemo}" = "yes"],[
AS_IF([test "${SYS}" = "darwin"], [enable_qt4=no])
])
AS_IF([test "${enable_qt4}" != "no"], [
- PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.3.0], [
+ PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.4.0], [
VLC_ADD_PLUGIN([qt4])
AC_DEFINE([HAVE_QT4], 1, [Define to 1 if you have QT4 library.])
ALIASES="${ALIASES} qvlc"
fi
fi
-dnl
-dnl Global hotkeys using XCB
-dnl
-PKG_CHECK_MODULES(XCB, [xcb], [
- PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms], [
- PKG_CHECK_MODULES(XPROTO, [xproto], [
- VLC_ADD_PLUGIN([globalhotkeys])
- VLC_ADD_CFLAGS([globalhotkeys],[${XCB_KEYSYMS_CFLAGS} ${XCB_CFLAGS}] )
- VLC_ADD_LIBS([globalhotkeys],[${XCB_KEYSYMS_LIBS} ${XCB_LIBS}] )
- ], [ AC_MSG_WARN( [Xproto not found] ) ])
- ], [ AC_MSG_WARN( [XCB keysyms was not found]) ])
-], [ AC_MSG_WARN( [XCB was not found]) ])
AC_ARG_WITH(,[Misc options:])
- "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \
- "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \
- "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \
-+ $(WINDRES) `$(top_srcdir)/../windows/windres-options --escape $(VERSION)`\
++ $(WINDRES) --use-temp-file `$(top_srcdir)/../windows/windres-options --escape $(VERSION)`\
-i $(srcdir)/libintl.rc -o libintl.res --output-format=coff
ref-add.sed: $(srcdir)/ref-add.sin
+--- gettext-0.17/gettext-runtime/intl/libintl.rc 2007-05-27 21:46:52.000000000 +0000
++++ gettext/gettext-runtime/intl/libintl.rc 2009-05-18 18:09:12.000000000 +0000
+@@ -22,13 +22,13 @@
+ VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\0"
+ VALUE "CompanyName", "Free Software Foundation\0"
+ VALUE "FileDescription", "LGPLed libintl for Windows NT/2000/XP/Vista and Windows 95/98/ME\0"
+- VALUE "FileVersion", PACKAGE_VERSION_STRING "\0"
++ VALUE "FileVersion", "\0"
+ VALUE "InternalName", "intl.dll\0"
+ VALUE "LegalCopyright", "Copyright (C) 1995-2007\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "intl.dll\0"
+ VALUE "ProductName", "libintl: accessing NLS message catalogs\0"
+- VALUE "ProductVersion", PACKAGE_VERSION_STRING "\0"
++ VALUE "ProductVersion", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
<string>flv</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>flv.icns</string>
<key>CFBundleTypeName</key>
<string>Flash Video File</string>
<key>CFBundleTypeRole</key>
<string>gvp</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>playlist.icns</string>
<key>CFBundleTypeName</key>
<string>Google Video Playlist</string>
<key>CFBundleTypeRole</key>
<string>flac</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>audio.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>audio/flac</string>
<string>xspf</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>Generic.icns</string>
+ <string>playlist.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/xspf+xml</string>
<string>rm</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>rm.icns</string>
<key>CFBundleTypeName</key>
<string>RealPlayer Media Files</string>
<key>CFBundleTypeRole</key>
<array>
<string>mod</string>
</array>
+ <key>CFBundleTypeIconFile</key>
+ <string>audio.icns</string>
<key>CFBundleTypeName</key>
<string>MOD Audio File</string>
<key>CFBundleTypeOSTypes</key>
<string>it</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>audio.icns</string>
<key>CFBundleTypeName</key>
<string>Impulse Tracker Module File</string>
<key>CFBundleTypeRole</key>
<string>aif</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>aiff.icns</string>
<key>CFBundleTypeName</key>
<string>AIFF file</string>
<key>CFBundleTypeRole</key>
<string>vlc</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>playlist.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/x-videolan-vlc</string>
<array>
<string>wav</string>
</array>
+ <key>CFBundleTypeIconFile</key>
+ <string>wav.icns</string>
<key>CFBundleTypeName</key>
<string>WAVE Audio File</string>
<key>CFBundleTypeRole</key>
<string>asx</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>asx.icns</string>
+ <string>playlist.icns</string>
<key>CFBundleTypeName</key>
<string>ASX file</string>
<key>CFBundleTypeRole</key>
<string>srt</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>sub.icns</string>
+ <string>subtitle.icns</string>
<key>CFBundleTypeName</key>
<string>Subtitle file</string>
<key>CFBundleTypeRole</key>
<string>pls</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>pls.icns</string>
+ <string>playlist.icns</string>
<key>CFBundleTypeName</key>
<string>Shoutcast playlist</string>
<key>CFBundleTypeRole</key>
<string>m3u</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>m3u.icns</string>
+ <string>playlist.icns</string>
<key>CFBundleTypeName</key>
<string>Playlist file</string>
<key>CFBundleTypeRole</key>
<string>dat</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>dat.icns</string>
+ <string>generic.icns</string>
<key>CFBundleTypeName</key>
<string>DAT file</string>
<key>CFBundleTypeRole</key>
<string>cue</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>cue.icns</string>
+ <string>generic.icns</string>
<key>CFBundleTypeName</key>
<string>CUE file</string>
<key>CFBundleTypeRole</key>
<string>bin</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>bin.icns</string>
+ <string>generic.icns</string>
<key>CFBundleTypeName</key>
<string>ISO file</string>
<key>CFBundleTypeRole</key>
<string>ac3</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>a52.icns</string>
+ <string>audio.icns</string>
<key>CFBundleTypeName</key>
<string>Digital Audio</string>
<key>CFBundleTypeRole</key>
<string>aac</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>mpeg4.icns</string>
+ <string>audio.icns</string>
<key>CFBundleTypeName</key>
<string>AAC file</string>
<key>CFBundleTypeRole</key>
<string>ogm</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>ogm.icns</string>
+ <string>video.icns</string>
<key>CFBundleTypeName</key>
<string>Ogg MPEG-4 Video File</string>
<key>CFBundleTypeRole</key>
<string>ogv</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>ogg.icns</string>
+ <string>video.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>video/ogg</string>
<string>ogx</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>ogg.icns</string>
+ <string>generic.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/ogg</string>
<string>anx</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>ogg.icns</string>
+ <string>generic.icns</string>
<key>CFBundleTypeName</key>
<string>Annodex Application File</string>
<key>CFBundleTypeRole</key>
<string>axa</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>ogg.icns</string>
+ <string>audio.icns</string>
<key>CFBundleTypeName</key>
<string>Annodex Audio File</string>
<key>CFBundleTypeRole</key>
<string>axv</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>ogg.icns</string>
+ <string>video.icns</string>
<key>CFBundleTypeName</key>
<string>Annodex Video File</string>
<key>CFBundleTypeRole</key>
<string>qt</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>mov.icns</string>
<key>CFBundleTypeName</key>
<string>Apple QuickTime container</string>
<key>CFBundleTypeRole</key>
<string>divx</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>divx.icns</string>
+ <string>video.icns</string>
<key>CFBundleTypeName</key>
<string>DivX file</string>
<key>CFBundleTypeRole</key>
<string>dv</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>dv.icns</string>
+ <string>video.icns</string>
<key>CFBundleTypeName</key>
<string>DV file</string>
<key>CFBundleTypeRole</key>
<string>asf</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>asf.icns</string>
+ <string>video.icns</string>
<key>CFBundleTypeName</key>
<string>Advanced Streaming Format</string>
<key>CFBundleTypeRole</key>
<string>m1v</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>mpeg1.icns</string>
+ <string>mpeg.icns</string>
<key>CFBundleTypeName</key>
<string>MPEG-1 Video File</string>
<key>CFBundleTypeRole</key>
<string>mp2</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>mpeg2.icns</string>
+ <string>mpeg.icns</string>
<key>CFBundleTypeName</key>
<string>MPEG Audio Layer 2</string>
<key>CFBundleTypeRole</key>
<string>ps</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>mpeg2.icns</string>
+ <string>mpeg.icns</string>
<key>CFBundleTypeName</key>
<string>MPEG-2 Program Stream</string>
<key>CFBundleTypeRole</key>
<string>ts</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>mpeg2.icns</string>
+ <string>mpeg.icns</string>
<key>CFBundleTypeName</key>
<string>MPEG-2 Transport Stream</string>
<key>CFBundleTypeRole</key>
<string>mpv</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>mpeg2.icns</string>
+ <string>mpeg.icns</string>
<key>CFBundleTypeName</key>
<string>MPEG-2 Video File</string>
<key>CFBundleTypeRole</key>
<string>mpa</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>mpeg.icns</string>
+ <string>audio.icns</string>
<key>CFBundleTypeName</key>
<string>MPEG-2 Audio File</string>
<key>CFBundleTypeRole</key>
<string>m4v</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>mpeg4.icns</string>
+ <string>m4v.icns</string>
<key>CFBundleTypeName</key>
<string>MPEG-4 File</string>
<key>CFBundleTypeRole</key>
<string>mka</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>audio.icns</string>
<key>CFBundleTypeName</key>
<string>Matroska Audio File</string>
<key>CFBundleTypeRole</key>
<string>mkv</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>mkv.icns</string>
<key>CFBundleTypeName</key>
<string>Matroska Video File</string>
<key>CFBundleTypeRole</key>
<string>m4a</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>mpeg4.icns</string>
+ <string>m4a.icns</string>
<key>CFBundleTypeName</key>
<string>MPEG-4 Audio File</string>
<key>CFBundleTypeRole</key>
<string>mpc</string>
</array>
<key>CFBundleTypeIconFile</key>
- <string>generic.icns</string>
+ <string>audio.icns</string>
<key>CFBundleTypeName</key>
<string>Musepack Audio File</string>
<key>CFBundleTypeRole</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@VERSION@</string>
- <key>CFBundleVersion</key>
- <string>#REVISION#</string>
<key>CFBundleSignature</key>
<string>VLC#</string>
<key>CFBundleURLTypes</key>
</array>
</dict>
</array>
+ <key>CFBundleVersion</key>
+ <string>#REVISION#</string>
<key>NSAppleScriptEnabled</key>
<string>YES</string>
<key>NSMainNibFile</key>
CC0FB34C0F8BED1100F057F7 /* CoreDialogs.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC0FB34A0F8BED1100F057F7 /* CoreDialogs.nib */; };
CC402EB00E00ABBB006A4BA4 /* vlc.icns in Resources */ = {isa = PBXBuildFile; fileRef = F74F13DF02C2A53401EE194C /* vlc.icns */; };
CC402EB10E00ABBB006A4BA4 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = F74F13EA02C2A79C01EE194C /* MainMenu.nib */; };
- CC402EB20E00ABBB006A4BA4 /* divx.icns in Resources */ = {isa = PBXBuildFile; fileRef = F6E4F90A02D2648B01A80112 /* divx.icns */; };
CC402EB30E00ABBB006A4BA4 /* generic.icns in Resources */ = {isa = PBXBuildFile; fileRef = F6E4F90B02D2648B01A80112 /* generic.icns */; };
CC402EB40E00ABBB006A4BA4 /* mpeg.icns in Resources */ = {isa = PBXBuildFile; fileRef = F6E4F90C02D2648B01A80112 /* mpeg.icns */; };
- CC402EB50E00ABBB006A4BA4 /* mpeg1.icns in Resources */ = {isa = PBXBuildFile; fileRef = F6E4F90D02D2648B01A80112 /* mpeg1.icns */; };
- CC402EB60E00ABBB006A4BA4 /* mpeg2.icns in Resources */ = {isa = PBXBuildFile; fileRef = F6E4F90E02D2648B01A80112 /* mpeg2.icns */; };
- CC402EB70E00ABBB006A4BA4 /* mpeg4.icns in Resources */ = {isa = PBXBuildFile; fileRef = F6E4F90F02D2648B01A80112 /* mpeg4.icns */; };
CC402EB80E00ABBB006A4BA4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F69B0CA602E24F6401A80112 /* InfoPlist.strings */; };
CC402EB90E00ABBB006A4BA4 /* vlc.scriptSuite in Resources */ = {isa = PBXBuildFile; fileRef = 8EBF3FA303F13FFB0059A3A7 /* vlc.scriptSuite */; };
CC402EBA0E00ABBB006A4BA4 /* vlc.scriptTerminology in Resources */ = {isa = PBXBuildFile; fileRef = 8EBF3FA503F140960059A3A7 /* vlc.scriptTerminology */; };
CC402EBB0E00ABBB006A4BA4 /* README.MacOSX.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 8EDAC3430440F72D0059A3A7 /* README.MacOSX.rtf */; };
- CC402EBC0E00ABBB006A4BA4 /* a52.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8704728A700059A3A7 /* a52.icns */; };
- CC402EBD0E00ABBB006A4BA4 /* aac.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8804728A700059A3A7 /* aac.icns */; };
- CC402EBE0E00ABBB006A4BA4 /* asf.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8904728A700059A3A7 /* asf.icns */; };
- CC402EBF0E00ABBB006A4BA4 /* asx.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8A04728A700059A3A7 /* asx.icns */; };
CC402EC00E00ABBB006A4BA4 /* avi.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8B04728A700059A3A7 /* avi.icns */; };
- CC402EC10E00ABBB006A4BA4 /* bin.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8C04728A700059A3A7 /* bin.icns */; };
- CC402EC20E00ABBB006A4BA4 /* cue.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8D04728A700059A3A7 /* cue.icns */; };
- CC402EC30E00ABBB006A4BA4 /* dat.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8E04728A700059A3A7 /* dat.icns */; };
- CC402EC40E00ABBB006A4BA4 /* dv.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8F04728A700059A3A7 /* dv.icns */; };
- CC402EC50E00ABBB006A4BA4 /* m3u.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9004728A700059A3A7 /* m3u.icns */; };
CC402EC60E00ABBB006A4BA4 /* mov.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9104728A700059A3A7 /* mov.icns */; };
CC402EC70E00ABBB006A4BA4 /* mp3.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9204728A700059A3A7 /* mp3.icns */; };
- CC402EC80E00ABBB006A4BA4 /* mp4.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9304728A700059A3A7 /* mp4.icns */; };
- CC402EC90E00ABBB006A4BA4 /* mpg.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9404728A700059A3A7 /* mpg.icns */; };
CC402ECA0E00ABBB006A4BA4 /* ogg.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9504728A700059A3A7 /* ogg.icns */; };
- CC402ECB0E00ABBB006A4BA4 /* ogm.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9604728A700059A3A7 /* ogm.icns */; };
- CC402ECC0E00ABBB006A4BA4 /* pls.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9704728A700059A3A7 /* pls.icns */; };
- CC402ECD0E00ABBB006A4BA4 /* srt.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9804728A700059A3A7 /* srt.icns */; };
- CC402ECE0E00ABBB006A4BA4 /* sub.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9904728A700059A3A7 /* sub.icns */; };
CC402ECF0E00ABBB006A4BA4 /* vob.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9A04728A700059A3A7 /* vob.icns */; };
CC402ED00E00ABBB006A4BA4 /* wma.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9B04728A700059A3A7 /* wma.icns */; };
CC402ED10E00ABBB006A4BA4 /* wmv.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F9C04728A700059A3A7 /* wmv.icns */; };
CC402F420E00ABBB006A4BA4 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC3DC89B0A7CDB9600B53F32 /* ApplicationServices.framework */; };
CC402F430E00ABBB006A4BA4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC1941240B9C1F8400635F6B /* QTKit.framework */; };
CC402F440E00ABBB006A4BA4 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC962E2C0CC7992800A56695 /* WebKit.framework */; };
+ CC62B8D00FC5787D0077BB8C /* aiff.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8C50FC5787D0077BB8C /* aiff.icns */; };
+ CC62B8D10FC5787D0077BB8C /* audio.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8C60FC5787D0077BB8C /* audio.icns */; };
+ CC62B8D20FC5787D0077BB8C /* flv.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8C70FC5787D0077BB8C /* flv.icns */; };
+ CC62B8D30FC5787D0077BB8C /* m4a.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8C80FC5787D0077BB8C /* m4a.icns */; };
+ CC62B8D40FC5787D0077BB8C /* m4v.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8C90FC5787D0077BB8C /* m4v.icns */; };
+ CC62B8D50FC5787D0077BB8C /* mkv.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8CA0FC5787D0077BB8C /* mkv.icns */; };
+ CC62B8D60FC5787D0077BB8C /* movie.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8CB0FC5787D0077BB8C /* movie.icns */; };
+ CC62B8D70FC5787D0077BB8C /* playlist.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8CC0FC5787D0077BB8C /* playlist.icns */; };
+ CC62B8D80FC5787D0077BB8C /* rm.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8CD0FC5787D0077BB8C /* rm.icns */; };
+ CC62B8D90FC5787D0077BB8C /* subtitle.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8CE0FC5787D0077BB8C /* subtitle.icns */; };
+ CC62B8DA0FC5787D0077BB8C /* wav.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8CF0FC5787D0077BB8C /* wav.icns */; };
CCB60A420E6E5E3F00407004 /* VLM.nib in Resources */ = {isa = PBXBuildFile; fileRef = CCB60A400E6E5E3F00407004 /* VLM.nib */; };
CCBE999F0F922C51000705F8 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CCBE999E0F922C51000705F8 /* CoreServices.framework */; };
CCD90F4E0E87C86D0034564A /* add_schedule.png in Resources */ = {isa = PBXBuildFile; fileRef = CCD90F4B0E87C86D0034564A /* add_schedule.png */; };
2A16E07F06C5074F00C87B09 /* equalizerdrawer_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = equalizerdrawer_blue.png; path = Resources/equalizerdrawer_blue.png; sourceTree = "<group>"; };
2AEF857609A5FEC900130822 /* fspanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fspanel.h; path = ../../../modules/gui/macosx/fspanel.h; sourceTree = SOURCE_ROOT; };
2AEF857709A5FEC900130822 /* fspanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = fspanel.m; path = ../../../modules/gui/macosx/fspanel.m; sourceTree = SOURCE_ROOT; };
- 8E445F8704728A700059A3A7 /* a52.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = a52.icns; path = Resources/a52.icns; sourceTree = SOURCE_ROOT; };
- 8E445F8804728A700059A3A7 /* aac.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = aac.icns; path = Resources/aac.icns; sourceTree = SOURCE_ROOT; };
- 8E445F8904728A700059A3A7 /* asf.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = asf.icns; path = Resources/asf.icns; sourceTree = SOURCE_ROOT; };
- 8E445F8A04728A700059A3A7 /* asx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = asx.icns; path = Resources/asx.icns; sourceTree = SOURCE_ROOT; };
8E445F8B04728A700059A3A7 /* avi.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = avi.icns; path = Resources/avi.icns; sourceTree = SOURCE_ROOT; };
- 8E445F8C04728A700059A3A7 /* bin.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = bin.icns; path = Resources/bin.icns; sourceTree = SOURCE_ROOT; };
- 8E445F8D04728A700059A3A7 /* cue.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = cue.icns; path = Resources/cue.icns; sourceTree = SOURCE_ROOT; };
- 8E445F8E04728A700059A3A7 /* dat.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = dat.icns; path = Resources/dat.icns; sourceTree = SOURCE_ROOT; };
- 8E445F8F04728A700059A3A7 /* dv.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = dv.icns; path = Resources/dv.icns; sourceTree = SOURCE_ROOT; };
- 8E445F9004728A700059A3A7 /* m3u.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = m3u.icns; path = Resources/m3u.icns; sourceTree = SOURCE_ROOT; };
8E445F9104728A700059A3A7 /* mov.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = mov.icns; path = Resources/mov.icns; sourceTree = SOURCE_ROOT; };
8E445F9204728A700059A3A7 /* mp3.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = mp3.icns; path = Resources/mp3.icns; sourceTree = SOURCE_ROOT; };
- 8E445F9304728A700059A3A7 /* mp4.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = mp4.icns; path = Resources/mp4.icns; sourceTree = SOURCE_ROOT; };
- 8E445F9404728A700059A3A7 /* mpg.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = mpg.icns; path = Resources/mpg.icns; sourceTree = SOURCE_ROOT; };
8E445F9504728A700059A3A7 /* ogg.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = ogg.icns; path = Resources/ogg.icns; sourceTree = SOURCE_ROOT; };
- 8E445F9604728A700059A3A7 /* ogm.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = ogm.icns; path = Resources/ogm.icns; sourceTree = SOURCE_ROOT; };
- 8E445F9704728A700059A3A7 /* pls.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = pls.icns; path = Resources/pls.icns; sourceTree = SOURCE_ROOT; };
- 8E445F9804728A700059A3A7 /* srt.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = srt.icns; path = Resources/srt.icns; sourceTree = SOURCE_ROOT; };
- 8E445F9904728A700059A3A7 /* sub.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = sub.icns; path = Resources/sub.icns; sourceTree = SOURCE_ROOT; };
8E445F9A04728A700059A3A7 /* vob.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = vob.icns; path = Resources/vob.icns; sourceTree = SOURCE_ROOT; };
8E445F9B04728A700059A3A7 /* wma.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = wma.icns; path = Resources/wma.icns; sourceTree = SOURCE_ROOT; };
8E445F9C04728A700059A3A7 /* wmv.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = wmv.icns; path = Resources/wmv.icns; sourceTree = SOURCE_ROOT; };
CC4ED9B00ABE07C800CA4CC5 /* repeat_single_embedded_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_single_embedded_blue.png; path = Resources/repeat_single_embedded_blue.png; sourceTree = "<group>"; };
CC4ED9B10ABE07C800CA4CC5 /* shuffle_embedded_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = shuffle_embedded_blue.png; path = Resources/shuffle_embedded_blue.png; sourceTree = "<group>"; };
CC4ED9B20ABE07C800CA4CC5 /* shuffle_embedded.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = shuffle_embedded.png; path = Resources/shuffle_embedded.png; sourceTree = "<group>"; };
+ CC62B8C50FC5787D0077BB8C /* aiff.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = aiff.icns; path = Resources/aiff.icns; sourceTree = "<group>"; };
+ CC62B8C60FC5787D0077BB8C /* audio.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = audio.icns; path = Resources/audio.icns; sourceTree = "<group>"; };
+ CC62B8C70FC5787D0077BB8C /* flv.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = flv.icns; path = Resources/flv.icns; sourceTree = "<group>"; };
+ CC62B8C80FC5787D0077BB8C /* m4a.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = m4a.icns; path = Resources/m4a.icns; sourceTree = "<group>"; };
+ CC62B8C90FC5787D0077BB8C /* m4v.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = m4v.icns; path = Resources/m4v.icns; sourceTree = "<group>"; };
+ CC62B8CA0FC5787D0077BB8C /* mkv.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = mkv.icns; path = Resources/mkv.icns; sourceTree = "<group>"; };
+ CC62B8CB0FC5787D0077BB8C /* movie.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = movie.icns; path = Resources/movie.icns; sourceTree = "<group>"; };
+ CC62B8CC0FC5787D0077BB8C /* playlist.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = playlist.icns; path = Resources/playlist.icns; sourceTree = "<group>"; };
+ CC62B8CD0FC5787D0077BB8C /* rm.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = rm.icns; path = Resources/rm.icns; sourceTree = "<group>"; };
+ CC62B8CE0FC5787D0077BB8C /* subtitle.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = subtitle.icns; path = Resources/subtitle.icns; sourceTree = "<group>"; };
+ CC62B8CF0FC5787D0077BB8C /* wav.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = wav.icns; path = Resources/wav.icns; sourceTree = "<group>"; };
CC6C01A90DDF3E9200C7D754 /* intf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = intf.h; path = ../../../modules/gui/minimal_macosx/intf.h; sourceTree = SOURCE_ROOT; };
CC6C01AA0DDF3E9200C7D754 /* intf.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = intf.m; path = ../../../modules/gui/minimal_macosx/intf.m; sourceTree = SOURCE_ROOT; };
CC6C01AB0DDF3E9200C7D754 /* macosx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = macosx.c; path = ../../../modules/gui/minimal_macosx/macosx.c; sourceTree = SOURCE_ROOT; };
DCF358BA077F10BA007DB450 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/Preferences.nib; sourceTree = "<group>"; };
DCFCCDB8085CE18F001E36AF /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/Wizard.nib; sourceTree = "<group>"; };
F69B0CA702E24F6401A80112 /* English */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.plist.strings; name = English; path = Resources/English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- F6E4F90A02D2648B01A80112 /* divx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = divx.icns; path = Resources/divx.icns; sourceTree = "<group>"; };
F6E4F90B02D2648B01A80112 /* generic.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = generic.icns; path = Resources/generic.icns; sourceTree = "<group>"; };
F6E4F90C02D2648B01A80112 /* mpeg.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = mpeg.icns; path = Resources/mpeg.icns; sourceTree = "<group>"; };
- F6E4F90D02D2648B01A80112 /* mpeg1.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = mpeg1.icns; path = Resources/mpeg1.icns; sourceTree = "<group>"; };
- F6E4F90E02D2648B01A80112 /* mpeg2.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = mpeg2.icns; path = Resources/mpeg2.icns; sourceTree = "<group>"; };
- F6E4F90F02D2648B01A80112 /* mpeg4.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = mpeg4.icns; path = Resources/mpeg4.icns; sourceTree = "<group>"; };
F74F13DF02C2A53401EE194C /* vlc.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = vlc.icns; path = Resources/vlc.icns; sourceTree = "<group>"; };
F74F13EB02C2A79C01EE194C /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/MainMenu.nib; sourceTree = "<group>"; };
/* End PBXFileReference section */
8E445F86047289E50059A3A7 /* fileicons */ = {
isa = PBXGroup;
children = (
+ CC62B8C50FC5787D0077BB8C /* aiff.icns */,
+ CC62B8C60FC5787D0077BB8C /* audio.icns */,
+ CC62B8C70FC5787D0077BB8C /* flv.icns */,
+ CC62B8C80FC5787D0077BB8C /* m4a.icns */,
+ CC62B8C90FC5787D0077BB8C /* m4v.icns */,
+ CC62B8CA0FC5787D0077BB8C /* mkv.icns */,
+ CC62B8CB0FC5787D0077BB8C /* movie.icns */,
+ CC62B8CC0FC5787D0077BB8C /* playlist.icns */,
+ CC62B8CD0FC5787D0077BB8C /* rm.icns */,
+ CC62B8CE0FC5787D0077BB8C /* subtitle.icns */,
+ CC62B8CF0FC5787D0077BB8C /* wav.icns */,
F74F13DF02C2A53401EE194C /* vlc.icns */,
- F6E4F90A02D2648B01A80112 /* divx.icns */,
F6E4F90B02D2648B01A80112 /* generic.icns */,
F6E4F90C02D2648B01A80112 /* mpeg.icns */,
- F6E4F90D02D2648B01A80112 /* mpeg1.icns */,
- F6E4F90E02D2648B01A80112 /* mpeg2.icns */,
- F6E4F90F02D2648B01A80112 /* mpeg4.icns */,
- 8E445F8704728A700059A3A7 /* a52.icns */,
- 8E445F8804728A700059A3A7 /* aac.icns */,
- 8E445F8904728A700059A3A7 /* asf.icns */,
- 8E445F8A04728A700059A3A7 /* asx.icns */,
8E445F8B04728A700059A3A7 /* avi.icns */,
- 8E445F8C04728A700059A3A7 /* bin.icns */,
- 8E445F8D04728A700059A3A7 /* cue.icns */,
- C2F2A6FA0958A6E600018C74 /* skip_forward_active_embedded.png */,
- 8E445F8E04728A700059A3A7 /* dat.icns */,
- 8E445F8F04728A700059A3A7 /* dv.icns */,
- 8E445F9004728A700059A3A7 /* m3u.icns */,
8E445F9104728A700059A3A7 /* mov.icns */,
8E445F9204728A700059A3A7 /* mp3.icns */,
- 8E445F9304728A700059A3A7 /* mp4.icns */,
- 8E445F9404728A700059A3A7 /* mpg.icns */,
8E445F9504728A700059A3A7 /* ogg.icns */,
- 8E445F9604728A700059A3A7 /* ogm.icns */,
- 8E445F9704728A700059A3A7 /* pls.icns */,
- 8E445F9804728A700059A3A7 /* srt.icns */,
- 8E445F9904728A700059A3A7 /* sub.icns */,
8E445F9A04728A700059A3A7 /* vob.icns */,
8E445F9B04728A700059A3A7 /* wma.icns */,
8E445F9C04728A700059A3A7 /* wmv.icns */,
8ECA7E520563CD9500DFC000 /* Controller */ = {
isa = PBXGroup;
children = (
+ C2F2A6FA0958A6E600018C74 /* skip_forward_active_embedded.png */,
CC33C2790D2579B2008C4683 /* graphite main window */,
CC33C2740D257994008C4683 /* blue main window */,
CC33C26C0D257958008C4683 /* embedded */,
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ CC62B8D00FC5787D0077BB8C /* aiff.icns in Resources */,
+ CC62B8D10FC5787D0077BB8C /* audio.icns in Resources */,
+ CC62B8D20FC5787D0077BB8C /* flv.icns in Resources */,
+ CC62B8D30FC5787D0077BB8C /* m4a.icns in Resources */,
+ CC62B8D40FC5787D0077BB8C /* m4v.icns in Resources */,
+ CC62B8D50FC5787D0077BB8C /* mkv.icns in Resources */,
+ CC62B8D60FC5787D0077BB8C /* movie.icns in Resources */,
+ CC62B8D70FC5787D0077BB8C /* playlist.icns in Resources */,
+ CC62B8D80FC5787D0077BB8C /* rm.icns in Resources */,
+ CC62B8D90FC5787D0077BB8C /* subtitle.icns in Resources */,
+ CC62B8DA0FC5787D0077BB8C /* wav.icns in Resources */,
CC402EB00E00ABBB006A4BA4 /* vlc.icns in Resources */,
- CC402EB10E00ABBB006A4BA4 /* MainMenu.nib in Resources */,
- CC402EB20E00ABBB006A4BA4 /* divx.icns in Resources */,
CC402EB30E00ABBB006A4BA4 /* generic.icns in Resources */,
+ CC402EB10E00ABBB006A4BA4 /* MainMenu.nib in Resources */,
CC402EB40E00ABBB006A4BA4 /* mpeg.icns in Resources */,
- CC402EB50E00ABBB006A4BA4 /* mpeg1.icns in Resources */,
- CC402EB60E00ABBB006A4BA4 /* mpeg2.icns in Resources */,
- CC402EB70E00ABBB006A4BA4 /* mpeg4.icns in Resources */,
CC402EB80E00ABBB006A4BA4 /* InfoPlist.strings in Resources */,
CC402EB90E00ABBB006A4BA4 /* vlc.scriptSuite in Resources */,
CC402EBA0E00ABBB006A4BA4 /* vlc.scriptTerminology in Resources */,
CC402EBB0E00ABBB006A4BA4 /* README.MacOSX.rtf in Resources */,
- CC402EBC0E00ABBB006A4BA4 /* a52.icns in Resources */,
- CC402EBD0E00ABBB006A4BA4 /* aac.icns in Resources */,
- CC402EBE0E00ABBB006A4BA4 /* asf.icns in Resources */,
- CC402EBF0E00ABBB006A4BA4 /* asx.icns in Resources */,
CC402EC00E00ABBB006A4BA4 /* avi.icns in Resources */,
- CC402EC10E00ABBB006A4BA4 /* bin.icns in Resources */,
- CC402EC20E00ABBB006A4BA4 /* cue.icns in Resources */,
- CC402EC30E00ABBB006A4BA4 /* dat.icns in Resources */,
- CC402EC40E00ABBB006A4BA4 /* dv.icns in Resources */,
- CC402EC50E00ABBB006A4BA4 /* m3u.icns in Resources */,
CC402EC60E00ABBB006A4BA4 /* mov.icns in Resources */,
CC402EC70E00ABBB006A4BA4 /* mp3.icns in Resources */,
- CC402EC80E00ABBB006A4BA4 /* mp4.icns in Resources */,
- CC402EC90E00ABBB006A4BA4 /* mpg.icns in Resources */,
CC402ECA0E00ABBB006A4BA4 /* ogg.icns in Resources */,
- CC402ECB0E00ABBB006A4BA4 /* ogm.icns in Resources */,
- CC402ECC0E00ABBB006A4BA4 /* pls.icns in Resources */,
- CC402ECD0E00ABBB006A4BA4 /* srt.icns in Resources */,
- CC402ECE0E00ABBB006A4BA4 /* sub.icns in Resources */,
CC402ECF0E00ABBB006A4BA4 /* vob.icns in Resources */,
CC402ED00E00ABBB006A4BA4 /* wma.icns in Resources */,
CC402ED10E00ABBB006A4BA4 /* wmv.icns in Resources */,
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)
*****************************************************************************/
* @{
*/
-/**
- * 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.
*
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
libvlc_MediaPlayerTitleChanged,
libvlc_MediaPlayerSnapshotTaken,
+ libvlc_MediaPlayerLengthChanged,
/* New event types HERE */
} libvlc_event_type_t;
char* psz_filename ;
} media_player_snapshot_taken ;
+ /* Length changed */
+ struct
+ {
+ libvlc_time_t new_length;
+ } media_player_length_changed;
} u;
} libvlc_event_t;
&& ((p_first)->i_physical_channels == (p_second)->i_physical_channels)\
&& ((p_first)->i_original_channels == (p_second)->i_original_channels) )
-#ifdef WORDS_BIGENDIAN
-# define AOUT_FMT_S16_NE VLC_FOURCC('s','1','6','b')
-# define AOUT_FMT_U16_NE VLC_FOURCC('u','1','6','b')
-# define AOUT_FMT_S24_NE VLC_FOURCC('s','2','4','b')
-# define AOUT_FMT_S32_NE VLC_FOURCC('s','3','2','b')
-# define AOUT_FMT_SPDIF_NE VLC_FOURCC('s','p','d','b')
-#else
-# define AOUT_FMT_S16_NE VLC_FOURCC('s','1','6','l')
-# define AOUT_FMT_U16_NE VLC_FOURCC('u','1','6','l')
-# define AOUT_FMT_S24_NE VLC_FOURCC('s','2','4','l')
-# define AOUT_FMT_S32_NE VLC_FOURCC('s','3','2','l')
-# define AOUT_FMT_SPDIF_NE VLC_FOURCC('s','p','d','i')
-#endif
-
-#define AOUT_FMT_NON_LINEAR( p_format ) \
- ( ((p_format)->i_format == VLC_FOURCC('s','p','d','i')) \
- || ((p_format)->i_format == VLC_FOURCC('s','p','d','b')) \
- || ((p_format)->i_format == VLC_FOURCC('a','5','2',' ')) \
- || ((p_format)->i_format == VLC_FOURCC('d','t','s',' ')) )
+#define VLC_CODEC_SPDIFL VLC_FOURCC('s','p','d','i')
+#define VLC_CODEC_SPDIFB VLC_FOURCC('s','p','d','b')
+
+#define AOUT_FMT_NON_LINEAR( p_format ) \
+ ( ((p_format)->i_format == VLC_CODEC_SPDIFL) \
+ || ((p_format)->i_format == VLC_CODEC_SPDIFB) \
+ || ((p_format)->i_format == VLC_CODEC_A52) \
+ || ((p_format)->i_format == VLC_CODEC_DTS) )
/* This is heavily borrowed from libmad, by Robert Leslie <rob@mars.org> */
/*
#include <vlc_block.h>
#include <vlc_es.h>
+#include <vlc_picture.h>
+#include <vlc_subpicture.h>
/**
* \file
#ifndef VLC_CODECS_H
#define VLC_CODECS_H 1
+#include <vlc_fourcc.h>
/**
* \file
* This file defines codec related structures needed by the demuxers and decoders
{ WAVE_FORMAT_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Raw audio" },
{ WAVE_FORMAT_ADPCM, VLC_FOURCC( 'm', 's', 0x00,0x02), "ADPCM" },
{ WAVE_FORMAT_IEEE_FLOAT, VLC_FOURCC( 'a', 'f', 'l', 't' ), "IEEE Float audio" },
- { WAVE_FORMAT_ALAW, VLC_FOURCC( 'a', 'l', 'a', 'w' ), "A-Law" },
- { WAVE_FORMAT_MULAW, VLC_FOURCC( 'm', 'l', 'a', 'w' ), "Mu-Law" },
+ { WAVE_FORMAT_ALAW, VLC_CODEC_ALAW, "A-Law" },
+ { WAVE_FORMAT_MULAW, VLC_CODEC_MULAW, "Mu-Law" },
{ WAVE_FORMAT_IMA_ADPCM, VLC_FOURCC( 'm', 's', 0x00,0x11), "Ima-ADPCM" },
- { WAVE_FORMAT_GSM610, VLC_FOURCC( 'a', 'g', 's', 'm' ), "Microsoft WAV GSM" },
- { WAVE_FORMAT_G726, VLC_FOURCC( 'g', '7', '2', '6' ), "G.726 ADPCM" },
- { WAVE_FORMAT_MPEGLAYER3, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
- { WAVE_FORMAT_MPEG, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
- { WAVE_FORMAT_A52, VLC_FOURCC( 'a', '5', '2', ' ' ), "A/52" },
- { WAVE_FORMAT_WMA1, VLC_FOURCC( 'w', 'm', 'a', '1' ), "Window Media Audio v1" },
- { WAVE_FORMAT_WMA2, VLC_FOURCC( 'w', 'm', 'a', '2' ), "Window Media Audio v2" },
- { WAVE_FORMAT_WMA2, VLC_FOURCC( 'w', 'm', 'a', ' ' ), "Window Media Audio v2" },
- { WAVE_FORMAT_WMAP, VLC_FOURCC( 'w', 'm', 'a', 'p' ), "Window Media Audio 9 Professional" },
- { WAVE_FORMAT_WMAL, VLC_FOURCC( 'w', 'm', 'a', 'l' ), "Window Media Audio 9 Lossless" },
- { WAVE_FORMAT_WMAS, VLC_FOURCC( 'w', 'm', 'a', 's' ), "Window Media Audio 9 Speech" },
+ { WAVE_FORMAT_GSM610, VLC_CODEC_GSM_MS, "Microsoft WAV GSM" },
+ { WAVE_FORMAT_G726, VLC_CODEC_ADPCM_G726, "G.726 ADPCM" },
+ { WAVE_FORMAT_MPEGLAYER3, VLC_CODEC_MPGA, "Mpeg Audio" },
+ { WAVE_FORMAT_MPEG, VLC_CODEC_MPGA, "Mpeg Audio" },
+ { WAVE_FORMAT_A52, VLC_CODEC_A52, "A/52" },
+ { WAVE_FORMAT_WMA1, VLC_CODEC_WMA1, "Window Media Audio v1" },
+ { WAVE_FORMAT_WMA2, VLC_CODEC_WMA2, "Window Media Audio v2" },
+ { WAVE_FORMAT_WMAP, VLC_CODEC_WMAP, "Window Media Audio 9 Professional" },
+ { WAVE_FORMAT_WMAL, VLC_CODEC_WMAL, "Window Media Audio 9 Lossless" },
+ { WAVE_FORMAT_WMAS, VLC_CODEC_WMAS, "Window Media Audio 9 Speech" },
{ WAVE_FORMAT_DK3, VLC_FOURCC( 'm', 's', 0x00,0x61), "Duck DK3" },
{ WAVE_FORMAT_DK4, VLC_FOURCC( 'm', 's', 0x00,0x62), "Duck DK4" },
- { WAVE_FORMAT_DTS, VLC_FOURCC( 'd', 't', 's', ' ' ), "DTS Coherent Acoustics" },
- { WAVE_FORMAT_DTS_MS, VLC_FOURCC( 'd', 't', 's', ' ' ), "DTS Coherent Acoustics" },
- { WAVE_FORMAT_DIVIO_AAC, VLC_FOURCC( 'm', 'p', '4', 'a' ), "MPEG-4 Audio (Divio)" },
- { WAVE_FORMAT_AAC, VLC_FOURCC( 'm', 'p', '4', 'a' ), "MPEG-4 Audio" },
- { WAVE_FORMAT_FFMPEG_AAC, VLC_FOURCC( 'm', 'p', '4', 'a' ), "MPEG-4 Audio" },
- { WAVE_FORMAT_VORBIS, VLC_FOURCC( 'v', 'o', 'r', 'b' ), "Vorbis Audio" },
+ { WAVE_FORMAT_DTS, VLC_CODEC_DTS, "DTS Coherent Acoustics" },
+ { WAVE_FORMAT_DTS_MS, VLC_CODEC_DTS, "DTS Coherent Acoustics" },
+ { WAVE_FORMAT_DIVIO_AAC, VLC_CODEC_MP4A, "MPEG-4 Audio (Divio)" },
+ { WAVE_FORMAT_AAC, VLC_CODEC_MP4A, "MPEG-4 Audio" },
+ { WAVE_FORMAT_FFMPEG_AAC, VLC_CODEC_MP4A, "MPEG-4 Audio" },
+ { WAVE_FORMAT_VORBIS, VLC_CODEC_VORBIS, "Vorbis Audio" },
{ WAVE_FORMAT_VORB_1, VLC_FOURCC( 'v', 'o', 'r', '1' ), "Vorbis 1 Audio" },
{ WAVE_FORMAT_VORB_1PLUS, VLC_FOURCC( 'v', 'o', '1', '+' ), "Vorbis 1+ Audio" },
{ WAVE_FORMAT_VORB_2, VLC_FOURCC( 'v', 'o', 'r', '2' ), "Vorbis 2 Audio" },
{ WAVE_FORMAT_VORB_2PLUS, VLC_FOURCC( 'v', 'o', '2', '+' ), "Vorbis 2+ Audio" },
{ WAVE_FORMAT_VORB_3, VLC_FOURCC( 'v', 'o', 'r', '3' ), "Vorbis 3 Audio" },
{ WAVE_FORMAT_VORB_3PLUS, VLC_FOURCC( 'v', 'o', '3', '+' ), "Vorbis 3+ Audio" },
- { WAVE_FORMAT_SPEEX, VLC_FOURCC( 's', 'p', 'x', ' ' ), "Speex Audio" },
+ { WAVE_FORMAT_SPEEX, VLC_CODEC_SPEEX, "Speex Audio" },
{ WAVE_FORMAT_UNKNOWN, VLC_FOURCC( 'u', 'n', 'd', 'f' ), "Unknown" }
};
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" */
/* FIXME: i'm not too sure about this include but it fixes compilation of
* video chromas -- dionoea */
#include "vlc_common.h"
+#include <vlc_fourcc.h>
/**
* \file
uint8_t i_flavor;
};
-#ifdef WORDS_BIGENDIAN
-# define AUDIO_FMT_S16_NE VLC_FOURCC('s','1','6','b')
-# define AUDIO_FMT_U16_NE VLC_FOURCC('u','1','6','b')
-#else
-# define AUDIO_FMT_S16_NE VLC_FOURCC('s','1','6','l')
-# define AUDIO_FMT_U16_NE VLC_FOURCC('u','1','6','l')
-#endif
-
/**
* video format description
*/
p_src->p_palette = NULL;
}
+/**
+ * It will fill up a video_format_tvideo_format_t using the given arguments.
+ * Becarefull that the video_format_t must already be initialized.
+ */
+VLC_EXPORT( void, video_format_Setup, ( video_format_t *, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect ) );
+
/**
* subtitles format description
*/
*/
struct es_format_t
{
- int i_cat; /**< ES category @see es_format_category_e */
- vlc_fourcc_t i_codec; /**< FOURCC value as used in vlc */
+ int i_cat; /**< ES category @see es_format_category_e */
+ vlc_fourcc_t i_codec; /**< FOURCC value as used in vlc */
+ vlc_fourcc_t i_original_fourcc; /**< original FOURCC from the container */
int i_id; /**< es identifier, where means
-1: let the core mark the right id
#define VLC_FILTER_H 1
#include <vlc_es.h>
+#include <vlc_picture.h>
+#include <vlc_subpicture.h>
/**
* \file
--- /dev/null
+/*****************************************************************************
+ * vlc_fourcc.h: Definition of various FOURCC and helpers
+ *****************************************************************************
+ * Copyright (C) 2009 Laurent Aimar
+ * $Id$
+ *
+ * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef VLC_FOURCC_H
+#define VLC_FOURCC_H 1
+
+#include <vlc_common.h>
+#include <vlc_es.h>
+
+/* Video codec */
+#define VLC_CODEC_MPGV VLC_FOURCC('m','p','g','v')
+#define VLC_CODEC_MP4V VLC_FOURCC('m','p','4','v')
+#define VLC_CODEC_DIV1 VLC_FOURCC('D','I','V','1')
+#define VLC_CODEC_DIV2 VLC_FOURCC('D','I','V','2')
+#define VLC_CODEC_DIV3 VLC_FOURCC('D','I','V','3')
+#define VLC_CODEC_SVQ1 VLC_FOURCC('S','V','Q','1')
+#define VLC_CODEC_SVQ3 VLC_FOURCC('S','V','Q','3')
+#define VLC_CODEC_H264 VLC_FOURCC('h','2','6','4')
+#define VLC_CODEC_H263 VLC_FOURCC('h','2','6','3')
+#define VLC_CODEC_H263I VLC_FOURCC('I','2','6','3')
+#define VLC_CODEC_H263P VLC_FOURCC('I','L','V','R')
+#define VLC_CODEC_FLV1 VLC_FOURCC('F','L','V','1')
+#define VLC_CODEC_H261 VLC_FOURCC('h','2','6','1')
+#define VLC_CODEC_MJPG VLC_FOURCC('M','J','P','G')
+#define VLC_CODEC_MJPGB VLC_FOURCC('m','j','p','b')
+#define VLC_CODEC_LJPG VLC_FOURCC('L','J','P','G')
+#define VLC_CODEC_WMV1 VLC_FOURCC('W','M','V','1')
+#define VLC_CODEC_WMV2 VLC_FOURCC('W','M','V','2')
+#define VLC_CODEC_WMV3 VLC_FOURCC('W','M','V','3')
+#define VLC_CODEC_WMVA VLC_FOURCC('W','M','V','A')
+#define VLC_CODEC_VC1 VLC_FOURCC('V','C','-','1')
+#define VLC_CODEC_THEORA VLC_FOURCC('t','h','e','o')
+#define VLC_CODEC_TARKIN VLC_FOURCC('t','a','r','k')
+#define VLC_CODEC_SNOW VLC_FOURCC('S','N','O','W')
+#define VLC_CODEC_DIRAC VLC_FOURCC('d','r','a','c')
+#define VLC_CODEC_CAVS VLC_FOURCC('C','A','V','S')
+#define VLC_CODEC_NUV VLC_FOURCC('N','J','P','G')
+#define VLC_CODEC_RV10 VLC_FOURCC('R','V','1','0')
+#define VLC_CODEC_RV13 VLC_FOURCC('R','V','1','3')
+#define VLC_CODEC_RV20 VLC_FOURCC('R','V','2','0')
+#define VLC_CODEC_RV30 VLC_FOURCC('R','V','3','0')
+#define VLC_CODEC_RV40 VLC_FOURCC('R','V','4','0')
+#define VLC_CODEC_VP3 VLC_FOURCC('V','P','3',' ')
+#define VLC_CODEC_VP5 VLC_FOURCC('V','P','5',' ')
+#define VLC_CODEC_VP6 VLC_FOURCC('V','P','6','2')
+#define VLC_CODEC_VP6F VLC_FOURCC('V','P','6','F')
+#define VLC_CODEC_VP6A VLC_FOURCC('V','P','6','A')
+#define VLC_CODEC_MSVIDEO1 VLC_FOURCC('M','S','V','C')
+#define VLC_CODEC_FLIC VLC_FOURCC('F','L','I','C')
+#define VLC_CODEC_SP5X VLC_FOURCC('S','P','5','X')
+#define VLC_CODEC_DV VLC_FOURCC('d','v',' ',' ')
+#define VLC_CODEC_MSRLE VLC_FOURCC('m','r','l','e')
+#define VLC_CODEC_INDEO3 VLC_FOURCC('I','V','3','1')
+#define VLC_CODEC_HUFFYUV VLC_FOURCC('H','F','Y','U')
+#define VLC_CODEC_FFVHUFF VLC_FOURCC('F','F','V','H')
+#define VLC_CODEC_ASV1 VLC_FOURCC('A','S','V','1')
+#define VLC_CODEC_ASV2 VLC_FOURCC('A','S','V','2')
+#define VLC_CODEC_FFV1 VLC_FOURCC('F','F','V','1')
+#define VLC_CODEC_VCR1 VLC_FOURCC('V','C','R','1')
+#define VLC_CODEC_CLJR VLC_FOURCC('C','L','J','R')
+#define VLC_CODEC_RPZA VLC_FOURCC('r','p','z','a')
+#define VLC_CODEC_SMC VLC_FOURCC('s','m','c',' ')
+#define VLC_CODEC_CINEPAK VLC_FOURCC('C','V','I','D')
+#define VLC_CODEC_TSCC VLC_FOURCC('T','S','C','C')
+#define VLC_CODEC_CSCD VLC_FOURCC('C','S','C','D')
+#define VLC_CODEC_ZMBV VLC_FOURCC('Z','M','B','V')
+#define VLC_CODEC_VMNC VLC_FOURCC('V','M','n','c')
+#define VLC_CODEC_FRAPS VLC_FOURCC('F','P','S','1')
+#define VLC_CODEC_TRUEMOTION1 VLC_FOURCC('D','U','C','K')
+#define VLC_CODEC_TRUEMOTION2 VLC_FOURCC('T','M','2','0')
+#define VLC_CODEC_QTRLE VLC_FOURCC('r','l','e',' ')
+#define VLC_CODEC_QDRAW VLC_FOURCC('q','d','r','w')
+#define VLC_CODEC_QPEG VLC_FOURCC('Q','P','E','G')
+#define VLC_CODEC_ULTI VLC_FOURCC('U','L','T','I')
+#define VLC_CODEC_VIXL VLC_FOURCC('V','I','X','L')
+#define VLC_CODEC_LOCO VLC_FOURCC('L','O','C','O')
+#define VLC_CODEC_WNV1 VLC_FOURCC('W','N','V','1')
+#define VLC_CODEC_AASC VLC_FOURCC('A','A','S','C')
+#define VLC_CODEC_INDEO2 VLC_FOURCC('I','V','2','0')
+#define VLC_CODEC_FLASHSV VLC_FOURCC('F','S','V','1')
+#define VLC_CODEC_KMVC VLC_FOURCC('K','M','V','C')
+#define VLC_CODEC_SMACKVIDEO VLC_FOURCC('S','M','K','2')
+#define VLC_CODEC_DNXHD VLC_FOURCC('A','V','d','n')
+#define VLC_CODEC_8BPS VLC_FOURCC('8','B','P','S')
+#define VLC_CODEC_MIMIC VLC_FOURCC('M','L','2','O')
+#define VLC_CODEC_INTERPLAY VLC_FOURCC('i','m','v','e')
+#define VLC_CODEC_IDCIN VLC_FOURCC('I','D','C','I')
+#define VLC_CODEC_4XM VLC_FOURCC('4','X','M','V')
+#define VLC_CODEC_ROQ VLC_FOURCC('R','o','Q','v')
+#define VLC_CODEC_MDEC VLC_FOURCC('M','D','E','C')
+#define VLC_CODEC_VMDVIDEO VLC_FOURCC('V','M','D','V')
+#define VLC_CODEC_CDG VLC_FOURCC('C','D','G',' ')
+
+/* Planar YUV 4:2:0 Y:V:U */
+#define VLC_CODEC_YV12 VLC_FOURCC('Y','V','1','2')
+/* Planar YUV 4:1:0 Y:U:V */
+#define VLC_CODEC_I410 VLC_FOURCC('I','4','1','0')
+/* Planar YUV 4:1:1 Y:U:V */
+#define VLC_CODEC_I411 VLC_FOURCC('I','4','1','1')
+/* Planar YUV 4:2:0 Y:U:V */
+#define VLC_CODEC_I420 VLC_FOURCC('I','4','2','0')
+/* Planar YUV 4:2:2 Y:U:V */
+#define VLC_CODEC_I422 VLC_FOURCC('I','4','2','2')
+/* Planar YUV 4:4:0 Y:U:V */
+#define VLC_CODEC_I440 VLC_FOURCC('I','4','4','0')
+/* Planar YUV 4:4:4 Y:U:V */
+#define VLC_CODEC_I444 VLC_FOURCC('I','4','4','4')
+/* Planar YUV 4:2:0 Y:U:V full scale */
+#define VLC_CODEC_J420 VLC_FOURCC('J','4','2','0')
+/* Planar YUV 4:2:2 Y:U:V full scale */
+#define VLC_CODEC_J422 VLC_FOURCC('J','4','2','2')
+/* Planar YUV 4:4:0 Y:U:V full scale */
+#define VLC_CODEC_J440 VLC_FOURCC('J','4','4','0')
+/* Planar YUV 4:4:4 Y:U:V full scale */
+#define VLC_CODEC_J444 VLC_FOURCC('J','4','4','4')
+/* Palettized YUV with palette element Y:U:V:A */
+#define VLC_CODEC_YUVP VLC_FOURCC('Y','U','V','P')
+/* Planar YUV 4:4:4 Y:U:V:A */
+#define VLC_CODEC_YUVA VLC_FOURCC('Y','U','V','A')
+/* Palettized RGB with palette element R:G:B */
+#define VLC_CODEC_RGBP VLC_FOURCC('R','G','B','P')
+/* 8 bits RGB */
+#define VLC_CODEC_RGB8 VLC_FOURCC('R','G','B','2')
+/* 15 bits RGB stored on 16 bits */
+#define VLC_CODEC_RGB15 VLC_FOURCC('R','V','1','5')
+/* 16 bits RGB store on a 16 bits */
+#define VLC_CODEC_RGB16 VLC_FOURCC('R','V','1','6')
+/* 24 bits RGB */
+#define VLC_CODEC_RGB24 VLC_FOURCC('R','V','2','4')
+/* 32 bits RGB */
+#define VLC_CODEC_RGB32 VLC_FOURCC('R','V','3','2')
+/* 32 bits VLC RGBA */
+#define VLC_CODEC_RGBA VLC_FOURCC('R','G','B','A')
+/* 8 bits grey */
+#define VLC_CODEC_GREY VLC_FOURCC('G','R','E','Y')
+/* Packed YUV 4:2:2, U:Y:V:Y */
+#define VLC_CODEC_UYVY VLC_FOURCC('U','Y','V','Y')
+/* Packed YUV 4:2:2, V:Y:U:Y */
+#define VLC_CODEC_VYUY VLC_FOURCC('V','Y','U','Y')
+/* Packed YUV 4:2:2, Y:U:Y:V */
+#define VLC_CODEC_YUYV VLC_FOURCC('Y','U','Y','2')
+/* Packed YUV 4:2:2, Y:V:Y:U */
+#define VLC_CODEC_YVYU VLC_FOURCC('Y','V','Y','U')
+/* Packed YUV 2:1:1, Y:U:Y:V */
+#define VLC_CODEC_Y211 VLC_FOURCC('Y','2','1','1')
+/* Planar Y, packed UV, from Matrox */
+#define VLC_CODEC_YMGA VLC_FOURCC('Y','M','G','A')
+/* Packed YUV 4:2:2, U:Y:V:Y, reverted */
+#define VLC_CODEC_CYUV VLC_FOURCC('c','y','u','v')
+/* 10-bit 4:2:2 Component YCbCr */
+#define VLC_CODEC_V210 VLC_FOURCC('v','2','1','0')
+
+/* Image codec (video) */
+#define VLC_CODEC_PNG VLC_FOURCC('p','n','g',' ')
+#define VLC_CODEC_PPM VLC_FOURCC('p','p','m',' ')
+#define VLC_CODEC_PGM VLC_FOURCC('p','g','m',' ')
+#define VLC_CODEC_PGMYUV VLC_FOURCC('p','g','m','y')
+#define VLC_CODEC_PAM VLC_FOURCC('p','a','m',' ')
+#define VLC_CODEC_JPEG VLC_FOURCC('j','p','e','g')
+#define VLC_CODEC_JPEGLS VLC_FOURCC('M','J','L','S')
+#define VLC_CODEC_BMP VLC_FOURCC('b','m','p',' ')
+#define VLC_CODEC_TIFF VLC_FOURCC('t','i','f','f')
+#define VLC_CODEC_GIF VLC_FOURCC('g','i','f',' ')
+#define VLC_CODEC_TARGA VLC_FOURCC('t','g','a',' ')
+#define VLC_CODEC_SGI VLC_FOURCC('s','g','i',' ')
+#define VLC_CODEC_PNM VLC_FOURCC('p','n','m',' ')
+#define VLC_CODEC_PCX VLC_FOURCC('p','c','x',' ')
+
+
+/* Audio codec */
+#define VLC_CODEC_MPGA VLC_FOURCC('m','p','g','a')
+#define VLC_CODEC_MP4A VLC_FOURCC('m','p','4','a')
+#define VLC_CODEC_A52 VLC_FOURCC('a','5','2',' ')
+#define VLC_CODEC_EAC3 VLC_FOURCC('e','a','c','3')
+#define VLC_CODEC_DTS VLC_FOURCC('d','t','s',' ')
+#define VLC_CODEC_WMA1 VLC_FOURCC('W','M','A','1')
+#define VLC_CODEC_WMA2 VLC_FOURCC('W','M','A','2')
+#define VLC_CODEC_WMAP VLC_FOURCC('W','M','A','P')
+#define VLC_CODEC_WMAL VLC_FOURCC('W','M','A','L')
+#define VLC_CODEC_WMAS VLC_FOURCC('W','M','A','S')
+#define VLC_CODEC_FLAC VLC_FOURCC('f','l','a','c')
+#define VLC_CODEC_MLP VLC_FOURCC('m','l','p',' ')
+#define VLC_CODEC_TRUEHD VLC_FOURCC('t','r','h','d')
+#define VLC_CODEC_DVAUDIO VLC_FOURCC('d','v','a','u')
+#define VLC_CODEC_SPEEX VLC_FOURCC('s','p','x',' ')
+#define VLC_CODEC_VORBIS VLC_FOURCC('v','o','r','b')
+#define VLC_CODEC_MACE3 VLC_FOURCC('M','A','C','3')
+#define VLC_CODEC_MACE6 VLC_FOURCC('M','A','C','6')
+#define VLC_CODEC_MUSEPACK7 VLC_FOURCC('M','P','C',' ')
+#define VLC_CODEC_MUSEPACK8 VLC_FOURCC('M','P','C','K')
+#define VLC_CODEC_RA_144 VLC_FOURCC('1','4','_','4')
+#define VLC_CODEC_RA_288 VLC_FOURCC('2','8','_','8')
+#define VLC_CODEC_ADPCM_4XM VLC_FOURCC('4','x','m','a')
+#define VLC_CODEC_ADPCM_EA VLC_FOURCC('A','D','E','A')
+#define VLC_CODEC_INTERPLAY_DPCM VLC_FOURCC('i','d','p','c')
+#define VLC_CODEC_ROQ_DPCM VLC_FOURCC('R','o','Q','a')
+#define VLC_CODEC_DSICINAUDIO VLC_FOURCC('D','C','I','A')
+#define VLC_CODEC_ADPCM_XA VLC_FOURCC('x','a',' ',' ')
+#define VLC_CODEC_ADPCM_ADX VLC_FOURCC('a','d','x',' ')
+#define VLC_CODEC_ADPCM_IMA_WS VLC_FOURCC('A','I','W','S')
+#define VLC_CODEC_VMDAUDIO VLC_FOURCC('v','m','d','a')
+#define VLC_CODEC_ADPCM_G726 VLC_FOURCC('g','7','2','6')
+#define VLC_CODEC_AMR_NB VLC_FOURCC('s','a','m','r')
+#define VLC_CODEC_AMR_WB VLC_FOURCC('s','a','w','b')
+#define VLC_CODEC_ALAC VLC_FOURCC('a','l','a','c')
+#define VLC_CODEC_QDM2 VLC_FOURCC('Q','D','M','2')
+#define VLC_CODEC_COOK VLC_FOURCC('c','o','o','k')
+#define VLC_CODEC_TTA VLC_FOURCC('T','T','A','1')
+#define VLC_CODEC_SHORTEN VLC_FOURCC('s','h','n',' ')
+#define VLC_CODEC_WAVPACK VLC_FOURCC('W','V','P','K')
+#define VLC_CODEC_GSM VLC_FOURCC('g','s','m',' ')
+#define VLC_CODEC_GSM_MS VLC_FOURCC('a','g','s','m')
+#define VLC_CODEC_ATRAC3 VLC_FOURCC('a','t','r','c')
+#define VLC_CODEC_SONIC VLC_FOURCC('S','O','N','C')
+#define VLC_CODEC_IMC VLC_FOURCC(0x1,0x4,0x0,0x0)
+#define VLC_CODEC_TRUESPEECH VLC_FOURCC(0x22,0x0,0x0,0x0)
+#define VLC_CODEC_NELLYMOSER VLC_FOURCC('N','E','L','L')
+#define VLC_CODEC_APE VLC_FOURCC('A','P','E',' ')
+#define VLC_CODEC_QCELP VLC_FOURCC('Q','c','l','p')
+#define VLC_CODEC_302M VLC_FOURCC('3','0','2','m')
+#define VLC_CODEC_DVD_LPCM VLC_FOURCC('l','p','c','m')
+#define VLC_CODEC_BD_LPCM VLC_FOURCC('b','p','c','m')
+#define VLC_CODEC_SDDS VLC_FOURCC('s','d','d','s')
+#define VLC_CODEC_MIDI VLC_FOURCC('M','I','D','I')
+#define VLC_CODEC_S8 VLC_FOURCC('s','8',' ',' ')
+#define VLC_CODEC_U8 VLC_FOURCC('u','8',' ',' ')
+#define VLC_CODEC_S16L VLC_FOURCC('s','1','6','l')
+#define VLC_CODEC_S16B VLC_FOURCC('s','1','6','b')
+#define VLC_CODEC_U16L VLC_FOURCC('u','1','6','l')
+#define VLC_CODEC_U16B VLC_FOURCC('u','1','6','b')
+#define VLC_CODEC_S24L VLC_FOURCC('s','2','4','l')
+#define VLC_CODEC_S24B VLC_FOURCC('s','2','4','b')
+#define VLC_CODEC_U24L VLC_FOURCC('u','2','4','l')
+#define VLC_CODEC_U24B VLC_FOURCC('u','2','4','b')
+#define VLC_CODEC_S32L VLC_FOURCC('s','3','2','l')
+#define VLC_CODEC_S32B VLC_FOURCC('s','3','2','b')
+#define VLC_CODEC_U32L VLC_FOURCC('u','3','2','l')
+#define VLC_CODEC_U32B VLC_FOURCC('u','3','2','b')
+#define VLC_CODEC_ALAW VLC_FOURCC('a','l','a','w')
+#define VLC_CODEC_MULAW VLC_FOURCC('m','l','a','w')
+#define VLC_CODEC_S24DAUD VLC_FOURCC('d','a','u','d')
+#define VLC_CODEC_FI32 VLC_FOURCC('f','i','3','2')
+#define VLC_CODEC_FL32 VLC_FOURCC('f','l','3','2')
+#define VLC_CODEC_FL64 VLC_FOURCC('f','l','6','4')
+
+/* Subtitle */
+#define VLC_CODEC_SPU VLC_FOURCC('s','p','u',' ')
+#define VLC_CODEC_DVBS VLC_FOURCC('d','v','b','s')
+#define VLC_CODEC_SUBT VLC_FOURCC('s','u','b','t')
+#define VLC_CODEC_XSUB VLC_FOURCC('X','S','U','B')
+#define VLC_CODEC_SSA VLC_FOURCC('s','s','a',' ')
+#define VLC_CODEC_TEXT VLC_FOURCC('T','E','X','T')
+#define VLC_CODEC_TELETEXT VLC_FOURCC('t','e','l','x')
+#define VLC_CODEC_KATE VLC_FOURCC('k','a','t','e')
+#define VLC_CODEC_CMML VLC_FOURCC('c','m','m','l')
+#define VLC_CODEC_ITU_T140 VLC_FOURCC('t','1','4','0')
+#define VLC_CODEC_USF VLC_FOURCC('u','s','f',' ')
+#define VLC_CODEC_OGT VLC_FOURCC('o','g','t',' ')
+#define VLC_CODEC_CVD VLC_FOURCC('c','v','d',' ')
+
+
+/* Special endian dependant values
+ * The suffic N means Native
+ * The suffix I means Inverted (ie non native) */
+#ifdef WORDS_BIGENDIAN
+# define VLC_CODEC_S16N VLC_CODEC_S16B
+# define VLC_CODEC_U16N VLC_CODEC_U16B
+# define VLC_CODEC_S24N VLC_CODEC_S24B
+# define VLC_CODEC_S32N VLC_CODEC_S32B
+
+# define VLC_CODEC_S16I VLC_CODEC_S16L
+# define VLC_CODEC_U16I VLC_CODEC_U16L
+# define VLC_CODEC_S24I VLC_CODEC_S24L
+# define VLC_CODEC_S32I VLC_CODEC_S32L
+#else
+# define VLC_CODEC_S16N VLC_CODEC_S16L
+# define VLC_CODEC_U16N VLC_CODEC_U16L
+# define VLC_CODEC_S24N VLC_CODEC_S24L
+# define VLC_CODEC_S32N VLC_CODEC_S32L
+
+# define VLC_CODEC_S16I VLC_CODEC_S16B
+# define VLC_CODEC_U16I VLC_CODEC_U16B
+# define VLC_CODEC_S24I VLC_CODEC_S24B
+# define VLC_CODEC_S32I VLC_CODEC_S32B
+#endif
+
+/* Non official codecs, used to force a profile in an encoder */
+/* MPEG-1 video */
+#define VLC_CODEC_MP1V VLC_FOURCC('m','p','1','v')
+/* MPEG-2 video */
+#define VLC_CODEC_MP2V VLC_FOURCC('m','p','2','v')
+/* MPEG-I/II layer 3 audio */
+#define VLC_CODEC_MP3 VLC_FOURCC('m','p','3',' ')
+
+/**
+ * It returns the codec associated to a fourcc within a ES category.
+ *
+ * If not found, it will return the given fourcc.
+ * If found, it will allways be one of the VLC_CODEC_ defined above.
+ *
+ * You may use UNKNOWN_ES for the ES category if you don't have the information.
+ */
+VLC_EXPORT( vlc_fourcc_t, vlc_fourcc_GetCodec, ( int i_cat, vlc_fourcc_t i_fourcc ) );
+
+/**
+ * It returns the codec associated to a fourcc store in a zero terminated
+ * string.
+ *
+ * If the string is NULL or does not have exactly 4 charateres, it will
+ * return 0, otherwise it behaves like vlc_fourcc_GetCodec.
+ *
+ * Provided for convenience.
+ */
+VLC_EXPORT( vlc_fourcc_t, vlc_fourcc_GetCodecFromString, ( int i_cat, const char * ) );
+
+/**
+ * It convert the gives fourcc to an audio codec when possible.
+ *
+ * The fourcc converted are aflt, araw/pcm , twos, sowt. When an incompatible i_bits
+ * is detected, 0 is returned.
+ * The other fourcc goes through vlc_fourcc_GetCodec and i_bits is not checked.
+ */
+VLC_EXPORT( vlc_fourcc_t, vlc_fourcc_GetCodecAudio, ( vlc_fourcc_t i_fourcc, int i_bits ) );
+
+/**
+ * It returns the description of the given fourcc or NULL if not found.
+ *
+ * You may use UNKNOWN_ES for the ES category if you don't have the information.
+ */
+VLC_EXPORT( const char *, vlc_fourcc_GetDescription, ( int i_cat, vlc_fourcc_t i_fourcc ) );
+
+#endif /* _VLC_FOURCC_H */
+
/* "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) */
#define KEY_MODIFIER_META 0x08000000
#define KEY_MODIFIER_COMMAND 0x10000000
-#define KEY_SPECIAL 0x00FF0000
-#define KEY_LEFT 0x00010000
-#define KEY_RIGHT 0x00020000
-#define KEY_UP 0x00030000
-#define KEY_DOWN 0x00040000
-#define KEY_SPACE 0x00050000
-#define KEY_ENTER 0x00060000
-#define KEY_F1 0x00070000
-#define KEY_F2 0x00080000
-#define KEY_F3 0x00090000
-#define KEY_F4 0x000A0000
-#define KEY_F5 0x000B0000
-#define KEY_F6 0x000C0000
-#define KEY_F7 0x000D0000
-#define KEY_F8 0x000E0000
-#define KEY_F9 0x000F0000
-#define KEY_F10 0x00100000
-#define KEY_F11 0x00110000
-#define KEY_F12 0x00120000
-#define KEY_HOME 0x00130000
-#define KEY_END 0x00140000
-#define KEY_INSERT 0x00150000
-#define KEY_DELETE 0x00160000
-#define KEY_MENU 0x00170000
-#define KEY_ESC 0x00180000
-#define KEY_PAGEUP 0x00190000
-#define KEY_PAGEDOWN 0x001A0000
-#define KEY_TAB 0x001B0000
-#define KEY_BACKSPACE 0x001C0000
-#define KEY_MOUSEWHEELUP 0x001D0000
-#define KEY_MOUSEWHEELDOWN 0x001E0000
-#define KEY_MOUSEWHEELLEFT 0x001F0000
-#define KEY_MOUSEWHEELRIGHT 0x00200000
+#define KEY_UNSET 0x00000000
+/* End of Unicode range: 0x0010FFFF */
+#define KEY_LEFT 0x00210000
+#define KEY_RIGHT 0x00220000
+#define KEY_UP 0x00230000
+#define KEY_DOWN 0x00240000
+#define KEY_SPACE 0x00250000
+#define KEY_ENTER 0x00260000
+#define KEY_F1 0x00270000
+#define KEY_F2 0x00280000
+#define KEY_F3 0x00290000
+#define KEY_F4 0x002A0000
+#define KEY_F5 0x002B0000
+#define KEY_F6 0x002C0000
+#define KEY_F7 0x002D0000
+#define KEY_F8 0x002E0000
+#define KEY_F9 0x002F0000
+#define KEY_F10 0x00300000
+#define KEY_F11 0x00310000
+#define KEY_F12 0x00320000
+#define KEY_HOME 0x00330000
+#define KEY_END 0x00340000
+#define KEY_INSERT 0x00350000
+#define KEY_DELETE 0x00360000
+#define KEY_MENU 0x00370000
+#define KEY_ESC 0x00380000
+#define KEY_PAGEUP 0x00390000
+#define KEY_PAGEDOWN 0x003A0000
+#define KEY_TAB 0x003B0000
+#define KEY_BACKSPACE 0x003C0000
-/* TODO:
- * The media keys are only used in win32. Support for other OSes needs to
- * be added */
-#define KEY_BROWSER_BACK 0x001F0000
-#define KEY_BROWSER_FORWARD 0x00200000
-#define KEY_BROWSER_REFRESH 0x00210000
-#define KEY_BROWSER_STOP 0x00220000
-#define KEY_BROWSER_SEARCH 0x00230000
-#define KEY_BROWSER_FAVORITES 0x00240000
-#define KEY_BROWSER_HOME 0x00250000
-#define KEY_VOLUME_MUTE 0x00260000
-#define KEY_VOLUME_DOWN 0x00270000
-#define KEY_VOLUME_UP 0x00280000
-#define KEY_MEDIA_NEXT_TRACK 0x00290000
-#define KEY_MEDIA_PREV_TRACK 0x002a0000
-#define KEY_MEDIA_STOP 0x002b0000
-#define KEY_MEDIA_PLAY_PAUSE 0x002c0000
+#define KEY_BROWSER_BACK 0x003F0000
+#define KEY_BROWSER_FORWARD 0x00400000
+#define KEY_BROWSER_REFRESH 0x00410000
+#define KEY_BROWSER_STOP 0x00420000
+#define KEY_BROWSER_SEARCH 0x00430000
+#define KEY_BROWSER_FAVORITES 0x00440000
+#define KEY_BROWSER_HOME 0x00450000
+#define KEY_VOLUME_MUTE 0x00460000
+#define KEY_VOLUME_DOWN 0x00470000
+#define KEY_VOLUME_UP 0x00480000
+#define KEY_MEDIA_NEXT_TRACK 0x00490000
+#define KEY_MEDIA_PREV_TRACK 0x004A0000
+#define KEY_MEDIA_STOP 0x004B0000
+#define KEY_MEDIA_PLAY_PAUSE 0x004C0000
-#define KEY_ASCII 0x0000007F
-#define KEY_UNSET 0
+#define KEY_MOUSEWHEELUP 0x00F00000
+#define KEY_MOUSEWHEELDOWN 0x00F10000
+#define KEY_MOUSEWHEELLEFT 0x00F20000
+#define KEY_MOUSEWHEELRIGHT 0x00F30000
typedef struct key_descriptor_s
{
const char *psz_key_string;
- int i_key_code;
+ uint32_t i_key_code;
} key_descriptor_t;
#define ADD_KEY(a) { a, *a }
{ "Meta", KEY_MODIFIER_META },
{ "Command", KEY_MODIFIER_COMMAND }
};
+enum { vlc_num_modifiers=sizeof(vlc_modifiers)
+ /sizeof(struct key_descriptor_s) };
static const struct key_descriptor_s vlc_keys[] =
{
{ "Unset", KEY_UNSET },
- { "Left", KEY_LEFT },
- { "Right", KEY_RIGHT },
- { "Up", KEY_UP },
- { "Down", KEY_DOWN },
- { "Space", KEY_SPACE },
- { "Enter", KEY_ENTER },
- { "F1", KEY_F1 },
- { "F2", KEY_F2 },
- { "F3", KEY_F3 },
- { "F4", KEY_F4 },
- { "F5", KEY_F5 },
- { "F6", KEY_F6 },
- { "F7", KEY_F7 },
- { "F8", KEY_F8 },
- { "F9", KEY_F9 },
- { "F10", KEY_F10 },
- { "F11", KEY_F11 },
- { "F12", KEY_F12 },
- { "Home", KEY_HOME },
- { "End", KEY_END },
- { "Insert", KEY_INSERT },
- { "Delete", KEY_DELETE },
- { "Menu", KEY_MENU },
- { "Esc", KEY_ESC },
- { "Page Up", KEY_PAGEUP },
- { "Page Down", KEY_PAGEDOWN },
- { "Tab", KEY_TAB },
- { "Backspace", KEY_BACKSPACE },
- { "Mouse Wheel Up", KEY_MOUSEWHEELUP },
- { "Mouse Wheel Down", KEY_MOUSEWHEELDOWN },
+ { "!", '!' },
+ { "\"", '\"' },
+ { "#", '#' },
+ { "$", '$' },
+ { "%", '%' },
+ { "&", '&' },
+ { "'", '\'' },
+ { "(", ')' },
+ { ")", ')' },
+ { "*", '*' },
+ { "+", '+' },
+ { ",", ',' },
+ { "-", '-' },
+ { ".", '.' },
+ { "/", '/' },
{ "0", '0' },
{ "1", '1' },
{ "2", '2' },
{ "7", '7' },
{ "8", '8' },
{ "9", '9' },
+ { ":", ':' },
+ { ";", ';' },
+ { "<", '<' },
+ { "=", '=' },
+ { ">", '>' },
+ { "?", '?' },
+ { "@", '@' },
+ { "[", '[' },
+ { "\\", '\\' },
+ { "]", ']' },
+ { "^", '^' },
+ { "_", '_' },
+ { "`", '`' },
{ "a", 'a' },
{ "b", 'b' },
{ "c", 'c' },
{ "x", 'x' },
{ "y", 'y' },
{ "z", 'z' },
- { "!", '!' },
- { "\"", '\"' },
- { "#", '#' },
- { "$", '$' },
- { "%", '%' },
- { "&", '&' },
- { "'", '\'' },
- { "(", ')' },
- { ")", ')' },
- { "*", '*' },
- { "+", '+' },
- { ",", ',' },
- { "-", '-' },
- { ".", '.' },
- { "/", '/' },
- { ":", ':' },
- { ";", ';' },
- { "<", '<' },
- { "=", '=' },
- { ">", '>' },
- { "?", '?' },
- { "@", '@' },
- { "[", '[' },
- { "\\", '\\' },
- { "]", ']' },
- { "^", '^' },
- { "_", '_' },
- { "`", '`' },
+ { "Left", KEY_LEFT },
+ { "Right", KEY_RIGHT },
+ { "Up", KEY_UP },
+ { "Down", KEY_DOWN },
+ { "Space", KEY_SPACE },
+ { "Enter", KEY_ENTER },
+ { "F1", KEY_F1 },
+ { "F2", KEY_F2 },
+ { "F3", KEY_F3 },
+ { "F4", KEY_F4 },
+ { "F5", KEY_F5 },
+ { "F6", KEY_F6 },
+ { "F7", KEY_F7 },
+ { "F8", KEY_F8 },
+ { "F9", KEY_F9 },
+ { "F10", KEY_F10 },
+ { "F11", KEY_F11 },
+ { "F12", KEY_F12 },
+ { "Home", KEY_HOME },
+ { "End", KEY_END },
+ { "Insert", KEY_INSERT },
+ { "Delete", KEY_DELETE },
+ { "Menu", KEY_MENU },
+ { "Esc", KEY_ESC },
+ { "Page Up", KEY_PAGEUP },
+ { "Page Down", KEY_PAGEDOWN },
+ { "Tab", KEY_TAB },
+ { "Backspace", KEY_BACKSPACE },
+ { "Mouse Wheel Up", KEY_MOUSEWHEELUP },
+ { "Mouse Wheel Down", KEY_MOUSEWHEELDOWN },
{ "Browser Back", KEY_BROWSER_BACK },
{ "Browser Forward", KEY_BROWSER_FORWARD },
{ "Browser Refresh", KEY_BROWSER_REFRESH },
{ "Media Stop", KEY_MEDIA_STOP },
{ "Media Play Pause", KEY_MEDIA_PLAY_PAUSE }
};
+enum { vlc_num_keys=sizeof(vlc_keys)/sizeof(struct key_descriptor_s) };
-static inline const char *KeyToString( int i_key )
+#include <stdlib.h>
+
+static inline int cmpkey (const void *key, const void *elem)
{
- unsigned int i = 0;
- for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
- {
- if ( vlc_keys[i].i_key_code == i_key )
- {
- return vlc_keys[i].psz_key_string;
- }
- }
- return NULL;
+ return ((uintptr_t)key) - ((key_descriptor_t *)elem)->i_key_code;
+}
+
+static inline const char *KeyToString( uint32_t i_key )
+{
+ key_descriptor_t *d;
+
+ d = (key_descriptor_t *)
+ bsearch ((void *)(uintptr_t)i_key, vlc_keys, vlc_num_keys,
+ sizeof (vlc_keys[0]), cmpkey);
+ return d ? d->psz_key_string : NULL;
}
static inline int StringToKey( char *psz_key )
{
- unsigned int i = 0;
- for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
+ size_t i;
+ for ( i = 0; i < vlc_num_keys; ++i )
{
if ( !strcmp( vlc_keys[i].psz_key_string, psz_key ))
{
#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
* 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 ) );
/**
* 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,
--- /dev/null
+/*****************************************************************************
+ * vlc_picture.h: picture definitions
+ *****************************************************************************
+ * Copyright (C) 1999 - 2009 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Vincent Seguin <seguin@via.ecp.fr>
+ * Samuel Hocevar <sam@via.ecp.fr>
+ * Olivier Aubert <oaubert 47 videolan d07 org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef VLC_PICTURE_H
+#define VLC_PICTURE_H 1
+
+/**
+ * \file
+ * This file defines picture structures and functions in vlc
+ */
+
+#include <vlc_es.h>
+
+/** Description of a planar graphic field */
+typedef struct plane_t
+{
+ uint8_t *p_pixels; /**< Start of the plane's data */
+
+ /* Variables used for fast memcpy operations */
+ int i_lines; /**< Number of lines, including margins */
+ int i_pitch; /**< Number of bytes in a line, including margins */
+
+ /** Size of a macropixel, defaults to 1 */
+ int i_pixel_pitch;
+
+ /* Variables used for pictures with margins */
+ int i_visible_lines; /**< How many visible lines are there ? */
+ int i_visible_pitch; /**< How many visible pixels are there ? */
+
+} plane_t;
+
+/**
+ * A private definition to help overloading picture release
+ */
+typedef struct picture_release_sys_t picture_release_sys_t;
+
+/**
+ * Video picture
+ *
+ * Any picture destined to be displayed by a video output thread should be
+ * stored in this structure from it's creation to it's effective display.
+ * Picture type and flags should only be modified by the output thread. Note
+ * that an empty picture MUST have its flags set to 0.
+ */
+struct picture_t
+{
+ /**
+ * The properties of the picture
+ */
+ video_frame_format_t format;
+
+ /** Picture data - data can always be freely modified, but p_data may
+ * NEVER be modified. A direct buffer can be handled as the plugin
+ * wishes, it can even swap p_pixels buffers. */
+ uint8_t *p_data;
+ void *p_data_orig; /**< pointer before memalign */
+ plane_t p[ VOUT_MAX_PLANES ]; /**< description of the planes */
+ int i_planes; /**< number of allocated planes */
+
+ /** \name Type and flags
+ * Should NOT be modified except by the vout thread
+ * @{*/
+ int i_status; /**< picture flags */
+ int i_type; /**< is picture a direct buffer ? */
+ bool b_slow; /**< is picture in slow memory ? */
+ /**@}*/
+
+ /** \name Picture management properties
+ * These properties can be modified using the video output thread API,
+ * but should never be written directly */
+ /**@{*/
+ unsigned i_refcount; /**< link reference counter */
+ mtime_t date; /**< display date */
+ bool b_force;
+ /**@}*/
+
+ /** \name Picture dynamic properties
+ * Those properties can be changed by the decoder
+ * @{
+ */
+ bool b_progressive; /**< is it a progressive frame ? */
+ unsigned int i_nb_fields; /**< # of displayed fields */
+ bool b_top_field_first; /**< which field is first */
+ uint8_t *p_q; /**< quantification table */
+ int i_qstride; /**< quantification stride */
+ int i_qtype; /**< quantification style */
+ /**@}*/
+
+ /* Some vouts require the picture to be locked before it can be modified */
+ int (* pf_lock) ( vout_thread_t *, picture_t * );
+ int (* pf_unlock) ( vout_thread_t *, picture_t * );
+
+ /** Private data - the video output plugin might want to put stuff here to
+ * keep track of the picture */
+ picture_sys_t * p_sys;
+
+ /** This way the picture_Release can be overloaded */
+ void (*pf_release)( picture_t * );
+ picture_release_sys_t *p_release_sys;
+
+ /** Next picture in a FIFO a pictures */
+ struct picture_t *p_next;
+};
+
+/**
+ * This function will create a new picture.
+ * The picture created will implement a default release management compatible
+ * with picture_Hold and picture_Release. This default management will release
+ * p_sys, p_q, p_data_orig fields if non NULL.
+ */
+VLC_EXPORT( picture_t *, picture_New, ( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect ) );
+
+/**
+ * This function will force the destruction a picture.
+ * The value of the picture reference count should be 0 before entering this
+ * function.
+ * Unless used for reimplementing pf_release, you should not use this
+ * function but picture_Release.
+ */
+VLC_EXPORT( void, picture_Delete, ( picture_t * ) );
+
+/**
+ * This function will increase the picture reference count.
+ * It will not have any effect on picture obtained from vout
+ */
+static inline void picture_Hold( picture_t *p_picture )
+{
+ if( p_picture->pf_release )
+ p_picture->i_refcount++;
+}
+/**
+ * This function will release a picture.
+ * It will not have any effect on picture obtained from vout
+ */
+static inline void picture_Release( picture_t *p_picture )
+{
+ /* FIXME why do we let pf_release handle the i_refcount ? */
+ if( p_picture->pf_release )
+ p_picture->pf_release( p_picture );
+}
+
+/**
+ * This function will return true if you are not the only owner of the
+ * picture.
+ *
+ * It is only valid if it is created using picture_New.
+ */
+static inline bool picture_IsReferenced( picture_t *p_picture )
+{
+ return p_picture->i_refcount > 1;
+}
+
+/**
+ * Cleanup quantization matrix data and set to 0
+ */
+static inline void picture_CleanupQuant( picture_t *p_pic )
+{
+ free( p_pic->p_q );
+ p_pic->p_q = NULL;
+ p_pic->i_qstride = 0;
+ p_pic->i_qtype = 0;
+}
+
+/**
+ * This function will copy all picture dynamic properties.
+ */
+static inline void picture_CopyProperties( picture_t *p_dst, const picture_t *p_src )
+{
+ p_dst->date = p_src->date;
+ p_dst->b_force = p_src->b_force;
+
+ p_dst->b_progressive = p_src->b_progressive;
+ p_dst->i_nb_fields = p_src->i_nb_fields;
+ p_dst->b_top_field_first = p_src->b_top_field_first;
+
+ /* FIXME: copy ->p_q and ->p_qstride */
+}
+
+/**
+ * This function will copy the picture pixels.
+ * You can safely copy between pictures that do not have the same size,
+ * only the compatible(smaller) part will be copied.
+ */
+VLC_EXPORT( void, picture_CopyPixels, ( picture_t *p_dst, const picture_t *p_src ) );
+VLC_EXPORT( void, plane_CopyPixels, ( plane_t *p_dst, const plane_t *p_src ) );
+
+/**
+ * This function will copy both picture dynamic properties and pixels.
+ * You have to notice that sometime a simple picture_Hold may do what
+ * you want without the copy overhead.
+ * Provided for convenience.
+ *
+ * \param p_dst pointer to the destination picture.
+ * \param p_src pointer to the source picture.
+ */
+static inline void picture_Copy( picture_t *p_dst, const picture_t *p_src )
+{
+ picture_CopyPixels( p_dst, p_src );
+ picture_CopyProperties( p_dst, p_src );
+}
+
+/**
+ * This function will export a picture to an encoded bitstream.
+ *
+ * pp_image will contain the encoded bitstream in psz_format format.
+ *
+ * p_fmt can be NULL otherwise it will be set with the format used for the
+ * picture before encoding.
+ *
+ * i_override_width/height allow to override the width and/or the height of the
+ * picture to be encoded. If at most one of them is > 0 then the picture aspect
+ * ratio will be kept.
+ */
+VLC_EXPORT( int, picture_Export, ( vlc_object_t *p_obj, block_t **pp_image, video_format_t *p_fmt, picture_t *p_picture, vlc_fourcc_t i_format, int i_override_width, int i_override_height ) );
+
+/**
+ * This function will setup all fields of a picture_t without allocating any
+ * memory.
+ * XXX The memory must already be initialized.
+ * It does not need to be released.
+ *
+ * It will return VLC_EGENERIC if the core does not understand the requested
+ * format.
+ *
+ * It can be usefull to get the properties of planes.
+ */
+VLC_EXPORT( int, picture_Setup, ( picture_t *, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect ) );
+
+/*****************************************************************************
+ * Flags used to describe the status of a picture
+ *****************************************************************************/
+
+/* Picture type
+ * FIXME are the values meaningfull ? */
+enum
+{
+ EMPTY_PICTURE = 0, /* empty buffer */
+ MEMORY_PICTURE = 100, /* heap-allocated buffer */
+ DIRECT_PICTURE = 200, /* direct buffer */
+};
+
+/* Picture status */
+enum
+{
+ FREE_PICTURE, /* free and not allocated */
+ RESERVED_PICTURE, /* allocated and reserved */
+ READY_PICTURE, /* ready for display */
+ DISPLAYED_PICTURE, /* been displayed but is linked */
+ DESTROYED_PICTURE, /* allocated but no more used */
+};
+
+/* Quantification type */
+enum
+{
+ QTYPE_NONE,
+
+ QTYPE_MPEG1,
+ QTYPE_MPEG2,
+ QTYPE_H264,
+};
+
+/*****************************************************************************
+ * Shortcuts to access image components
+ *****************************************************************************/
+
+/* Plane indices */
+enum
+{
+ Y_PLANE = 0,
+ U_PLANE = 1,
+ V_PLANE = 2,
+ A_PLANE = 3,
+};
+
+/* Shortcuts */
+#define Y_PIXELS p[Y_PLANE].p_pixels
+#define Y_PITCH p[Y_PLANE].i_pitch
+#define U_PIXELS p[U_PLANE].p_pixels
+#define U_PITCH p[U_PLANE].i_pitch
+#define V_PIXELS p[V_PLANE].p_pixels
+#define V_PITCH p[V_PLANE].i_pitch
+#define A_PIXELS p[A_PLANE].p_pixels
+#define A_PITCH p[A_PLANE].i_pitch
+
+/**@}*/
+
+#endif /* VLC_PICTURE_H */
* Generally speaking, playlist_NodeAddInput should not be used in newer code, it
* will maybe become useful again when we merge VLM;
*
- * To delete an item, use playlist_DeleteFromInput( input_id ) which will
+ * To delete an item, use playlist_DeleteFromInput( p_item ) which will
* remove all occurrences of the input in both trees
*
*
********************************************************/
/*************************** Item deletion **************************/
-VLC_EXPORT( int, playlist_DeleteFromInput, ( playlist_t *, int, bool ) );
+VLC_EXPORT( int, playlist_DeleteFromInput, ( playlist_t *, input_item_t *, bool ) );
/******************** Item addition ********************/
VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char *, int, int, bool, bool ) );
/********************************** Item search *************************/
VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int ) );
VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t * ) );
-VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInputId, (playlist_t *, int, playlist_item_t *) );
VLC_EXPORT( int, playlist_LiveSearchUpdate, (playlist_t *, playlist_item_t *, const char *) );
--- /dev/null
+/*****************************************************************************
+ * vlc_subpicture.h: subpicture definitions
+ *****************************************************************************
+ * Copyright (C) 1999 - 2009 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Vincent Seguin <seguin@via.ecp.fr>
+ * Samuel Hocevar <sam@via.ecp.fr>
+ * Olivier Aubert <oaubert 47 videolan d07 org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef VLC_SUBPICTURE_H
+#define VLC_SUBPICTURE_H 1
+
+/**
+ * \file
+ * This file defines subpicture structures and functions in vlc
+ */
+
+#include <vlc_picture.h>
+
+/**
+ * \defgroup subpicture Video Subpictures
+ * Subpictures are pictures that should be displayed on top of the video, like
+ * subtitles and OSD
+ * \ingroup video_output
+ * @{
+ */
+
+/**
+ * Video subtitle region spu core private
+ */
+typedef struct subpicture_region_private_t subpicture_region_private_t;
+
+/**
+ * Video subtitle region
+ *
+ * A subtitle region is defined by a picture (graphic) and its rendering
+ * coordinates.
+ * Subtitles contain a list of regions.
+ */
+struct subpicture_region_t
+{
+ video_format_t fmt; /**< format of the picture */
+ picture_t *p_picture; /**< picture comprising this region */
+
+ int i_x; /**< position of region */
+ int i_y; /**< position of region */
+ int i_align; /**< alignment within a region */
+ int i_alpha; /**< transparency */
+
+ char *psz_text; /**< text string comprising this region */
+ char *psz_html; /**< HTML version of subtitle (NULL = use psz_text) */
+ text_style_t *p_style; /**< a description of the text style formatting */
+
+ subpicture_region_t *p_next; /**< next region in the list */
+ subpicture_region_private_t *p_private; /**< Private data for spu_t *only* */
+};
+
+/* Subpicture region position flags */
+#define SUBPICTURE_ALIGN_LEFT 0x1
+#define SUBPICTURE_ALIGN_RIGHT 0x2
+#define SUBPICTURE_ALIGN_TOP 0x4
+#define SUBPICTURE_ALIGN_BOTTOM 0x8
+#define SUBPICTURE_ALIGN_MASK ( SUBPICTURE_ALIGN_LEFT|SUBPICTURE_ALIGN_RIGHT| \
+ SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_BOTTOM )
+
+/**
+ * This function will create a new subpicture region.
+ *
+ * You must use subpicture_region_Delete to destroy it.
+ */
+VLC_EXPORT( subpicture_region_t *, subpicture_region_New, ( const video_format_t *p_fmt ) );
+
+/**
+ * This function will destroy a subpicture region allocated by
+ * subpicture_region_New.
+ *
+ * You may give it NULL.
+ */
+VLC_EXPORT( void, subpicture_region_Delete, ( subpicture_region_t *p_region ) );
+
+/**
+ * This function will destroy a list of subpicture regions allocated by
+ * subpicture_region_New.
+ *
+ * Provided for convenience.
+ */
+VLC_EXPORT( void, subpicture_region_ChainDelete, ( subpicture_region_t *p_head ) );
+
+/**
+ * Video subtitle
+ *
+ * Any subtitle destined to be displayed by a video output thread should
+ * be stored in this structure from it's creation to it's effective display.
+ * Subtitle type and flags should only be modified by the output thread. Note
+ * that an empty subtitle MUST have its flags set to 0.
+ */
+struct subpicture_t
+{
+ /** \name Channel ID */
+ /**@{*/
+ int i_channel; /**< subpicture channel ID */
+ /**@}*/
+
+ /** \name Type and flags
+ Should NOT be modified except by the vout thread */
+ /**@{*/
+ int64_t i_order; /** an increasing unique number */
+ subpicture_t * p_next; /**< next subtitle to be displayed */
+ /**@}*/
+
+ /** \name Date properties */
+ /**@{*/
+ mtime_t i_start; /**< beginning of display date */
+ mtime_t i_stop; /**< end of display date */
+ bool b_ephemer; /**< If this flag is set to true the subtitle
+ will be displayed untill the next one appear */
+ bool b_fade; /**< enable fading */
+ /**@}*/
+
+ subpicture_region_t *p_region; /**< region list composing this subtitle */
+
+ /** \name Display properties
+ * These properties are only indicative and may be
+ * changed by the video output thread, or simply ignored depending of the
+ * subtitle type. */
+ /**@{*/
+ int i_original_picture_width; /**< original width of the movie */
+ int i_original_picture_height;/**< original height of the movie */
+ bool b_subtitle; /**< the picture is a movie subtitle */
+ bool b_absolute; /**< position is absolute */
+ int i_alpha; /**< transparency */
+ /**@}*/
+
+ /** Pointer to function that renders this subtitle in a picture */
+ void ( *pf_render ) ( vout_thread_t *, picture_t *, const subpicture_t * );
+ /** Pointer to function that cleans up the private data of this subtitle */
+ void ( *pf_destroy ) ( subpicture_t * );
+
+ /** Pointer to functions for region management */
+ void (*pf_pre_render) ( spu_t *, subpicture_t *, const video_format_t * );
+ void (*pf_update_regions)( spu_t *,
+ subpicture_t *, const video_format_t *, mtime_t );
+
+ /** Private data - the subtitle plugin might want to put stuff here to
+ * keep track of the subpicture */
+ subpicture_sys_t *p_sys; /* subpicture data */
+};
+
+
+/**
+ * This function create a new empty subpicture.
+ *
+ * You must use subpicture_Delete to destroy it.
+ */
+VLC_EXPORT( subpicture_t *, subpicture_New, ( void ) );
+
+/**
+ * This function delete a subpicture created by subpicture_New.
+ * You may give it NULL.
+ */
+VLC_EXPORT( void, subpicture_Delete, ( subpicture_t *p_subpic ) );
+
+/**@}*/
+
+#endif /* _VLC_VIDEO_H */
#define VLC_VAR_GETCHOICES 0x0024
#define VLC_VAR_FREECHOICES 0x0025
#define VLC_VAR_GETLIST 0x0026
-#define VLC_VAR_FREELIST 0x0027
-#define VLC_VAR_CHOICESCOUNT 0x0028
+#define VLC_VAR_CHOICESCOUNT 0x0027
#define VLC_VAR_INHERITVALUE 0x0030
#define var_Command(a,b,c,d,e) __var_Command( VLC_OBJECT( a ), b, c, d, e )
VLC_EXPORT( int, __var_Command, ( vlc_object_t *, const char *, const char *, const char *, char ** ) );
+VLC_EXPORT( void, var_FreeList, ( vlc_value_t *, vlc_value_t * ) );
+
/**
* __var_Create() with automatic casting.
*/
* This file defines common video output structures and functions in vlc
*/
-#include <vlc_es.h>
+#include <vlc_picture.h>
#include <vlc_filter.h>
-
-/** Description of a planar graphic field */
-typedef struct plane_t
-{
- uint8_t *p_pixels; /**< Start of the plane's data */
-
- /* Variables used for fast memcpy operations */
- int i_lines; /**< Number of lines, including margins */
- int i_pitch; /**< Number of bytes in a line, including margins */
-
- /** Size of a macropixel, defaults to 1 */
- int i_pixel_pitch;
-
- /* Variables used for pictures with margins */
- int i_visible_lines; /**< How many visible lines are there ? */
- int i_visible_pitch; /**< How many visible pixels are there ? */
-
-} plane_t;
-
-/**
- * Video picture
- *
- * Any picture destined to be displayed by a video output thread should be
- * stored in this structure from it's creation to it's effective display.
- * Picture type and flags should only be modified by the output thread. Note
- * that an empty picture MUST have its flags set to 0.
- */
-struct picture_t
-{
- /**
- * The properties of the picture
- */
- video_frame_format_t format;
-
- /** Picture data - data can always be freely modified, but p_data may
- * NEVER be modified. A direct buffer can be handled as the plugin
- * wishes, it can even swap p_pixels buffers. */
- uint8_t *p_data;
- void *p_data_orig; /**< pointer before memalign */
- plane_t p[ VOUT_MAX_PLANES ]; /**< description of the planes */
- int i_planes; /**< number of allocated planes */
-
- /** \name Type and flags
- * Should NOT be modified except by the vout thread
- * @{*/
- int i_status; /**< picture flags */
- int i_type; /**< is picture a direct buffer ? */
- bool b_slow; /**< is picture in slow memory ? */
- /**@}*/
-
- /** \name Picture management properties
- * These properties can be modified using the video output thread API,
- * but should never be written directly */
- /**@{*/
- unsigned i_refcount; /**< link reference counter */
- mtime_t date; /**< display date */
- bool b_force;
- /**@}*/
-
- /** \name Picture dynamic properties
- * Those properties can be changed by the decoder
- * @{
- */
- bool b_progressive; /**< is it a progressive frame ? */
- unsigned int i_nb_fields; /**< # of displayed fields */
- bool b_top_field_first; /**< which field is first */
- uint8_t *p_q; /**< quantification table */
- int i_qstride; /**< quantification stride */
- int i_qtype; /**< quantification style */
- /**@}*/
-
- /** The picture heap we are attached to */
- picture_heap_t* p_heap;
-
- /* Some vouts require the picture to be locked before it can be modified */
- int (* pf_lock) ( vout_thread_t *, picture_t * );
- int (* pf_unlock) ( vout_thread_t *, picture_t * );
-
- /** Private data - the video output plugin might want to put stuff here to
- * keep track of the picture */
- picture_sys_t * p_sys;
-
- /** This way the picture_Release can be overloaded */
- void (*pf_release)( picture_t * );
-
- /** Next picture in a FIFO a pictures */
- struct picture_t *p_next;
-};
-
-/**
- * This function will create a new picture.
- * The picture created will implement a default release management compatible
- * with picture_Hold and picture_Release. This default management will release
- * picture_sys_t *p_sys field if non NULL.
- */
-VLC_EXPORT( picture_t *, picture_New, ( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect ) );
-
-/**
- * This function will force the destruction a picture.
- * The value of the picture reference count should be 0 before entering this
- * function.
- * Unless used for reimplementing pf_release, you should not use this
- * function but picture_Release.
- */
-VLC_EXPORT( void, picture_Delete, ( picture_t * ) );
-
-/**
- * This function will increase the picture reference count.
- * It will not have any effect on picture obtained from vout
- */
-static inline void picture_Hold( picture_t *p_picture )
-{
- if( p_picture->pf_release )
- p_picture->i_refcount++;
-}
-/**
- * This function will release a picture.
- * It will not have any effect on picture obtained from vout
- */
-static inline void picture_Release( picture_t *p_picture )
-{
- /* FIXME why do we let pf_release handle the i_refcount ? */
- if( p_picture->pf_release )
- p_picture->pf_release( p_picture );
-}
-
-/**
- * Cleanup quantization matrix data and set to 0
- */
-static inline void picture_CleanupQuant( picture_t *p_pic )
-{
- free( p_pic->p_q );
- p_pic->p_q = NULL;
- p_pic->i_qstride = 0;
- p_pic->i_qtype = 0;
-}
-
-/**
- * This function will copy all picture dynamic properties.
- */
-static inline void picture_CopyProperties( picture_t *p_dst, const picture_t *p_src )
-{
- p_dst->date = p_src->date;
- p_dst->b_force = p_src->b_force;
-
- p_dst->b_progressive = p_src->b_progressive;
- p_dst->i_nb_fields = p_src->i_nb_fields;
- p_dst->b_top_field_first = p_src->b_top_field_first;
-
- /* FIXME: copy ->p_q and ->p_qstride */
-}
-
-/**
- * This function will copy the picture pixels.
- * You can safely copy between pictures that do not have the same size,
- * only the compatible(smaller) part will be copied.
- */
-VLC_EXPORT( void, picture_CopyPixels, ( picture_t *p_dst, const picture_t *p_src ) );
-VLC_EXPORT( void, plane_CopyPixels, ( plane_t *p_dst, const plane_t *p_src ) );
-
-/**
- * This function will copy both picture dynamic properties and pixels.
- * You have to notice that sometime a simple picture_Hold may do what
- * you want without the copy overhead.
- * Provided for convenience.
- *
- * \param p_dst pointer to the destination picture.
- * \param p_src pointer to the source picture.
- */
-static inline void picture_Copy( picture_t *p_dst, const picture_t *p_src )
-{
- picture_CopyPixels( p_dst, p_src );
- picture_CopyProperties( p_dst, p_src );
-}
-
-/**
- * This function will export a picture to an encoded bitstream.
- *
- * pp_image will contain the encoded bitstream in psz_format format.
- *
- * p_fmt can be NULL otherwise it will be set with the format used for the
- * picture before encoding.
- *
- * i_override_width/height allow to override the width and/or the height of the
- * picture to be encoded. If at most one of them is > 0 then the picture aspect
- * ratio will be kept.
- */
-VLC_EXPORT( int, picture_Export, ( vlc_object_t *p_obj, block_t **pp_image, video_format_t *p_fmt, picture_t *p_picture, vlc_fourcc_t i_format, int i_override_width, int i_override_height ) );
-
+#include <vlc_subpicture.h>
/**
* Video picture heap, either render (to store pictures used
void (* pf_setpalette) ( vout_thread_t *, uint16_t *, uint16_t *, uint16_t * );
};
-/*****************************************************************************
- * Flags used to describe the status of a picture
- *****************************************************************************/
-
-/* Picture type
- * FIXME are the values meaningfull ? */
-enum
-{
- EMPTY_PICTURE = 0, /* empty buffer */
- MEMORY_PICTURE = 100, /* heap-allocated buffer */
- DIRECT_PICTURE = 200, /* direct buffer */
-};
-
-/* Picture status */
-enum
-{
- FREE_PICTURE, /* free and not allocated */
- RESERVED_PICTURE, /* allocated and reserved */
- READY_PICTURE, /* ready for display */
- DISPLAYED_PICTURE, /* been displayed but is linked */
- DESTROYED_PICTURE, /* allocated but no more used */
-};
-
-/* Quantification type */
-enum
-{
- QTYPE_NONE,
-
- QTYPE_MPEG1,
- QTYPE_MPEG2,
- QTYPE_H264,
-};
-
-/*****************************************************************************
- * Shortcuts to access image components
- *****************************************************************************/
-
-/* Plane indices */
-enum
-{
- Y_PLANE = 0,
- U_PLANE = 1,
- V_PLANE = 2,
- A_PLANE = 3,
-};
-
-/* Shortcuts */
-#define Y_PIXELS p[Y_PLANE].p_pixels
-#define Y_PITCH p[Y_PLANE].i_pitch
-#define U_PIXELS p[U_PLANE].p_pixels
-#define U_PITCH p[U_PLANE].i_pitch
-#define V_PIXELS p[V_PLANE].p_pixels
-#define V_PITCH p[V_PLANE].i_pitch
-#define A_PIXELS p[A_PLANE].p_pixels
-#define A_PITCH p[A_PLANE].i_pitch
-
-/**
- * \defgroup subpicture Video Subpictures
- * Subpictures are pictures that should be displayed on top of the video, like
- * subtitles and OSD
- * \ingroup video_output
- * @{
- */
-
-/**
- * Video subtitle region spu core private
- */
-typedef struct subpicture_region_private_t subpicture_region_private_t;
-
-/**
- * Video subtitle region
- *
- * A subtitle region is defined by a picture (graphic) and its rendering
- * coordinates.
- * Subtitles contain a list of regions.
- */
-struct subpicture_region_t
-{
- video_format_t fmt; /**< format of the picture */
- picture_t *p_picture; /**< picture comprising this region */
-
- int i_x; /**< position of region */
- int i_y; /**< position of region */
- int i_align; /**< alignment within a region */
- int i_alpha; /**< transparency */
-
- char *psz_text; /**< text string comprising this region */
- char *psz_html; /**< HTML version of subtitle (NULL = use psz_text) */
- text_style_t *p_style; /**< a description of the text style formatting */
-
- subpicture_region_t *p_next; /**< next region in the list */
- subpicture_region_private_t *p_private; /**< Private data for spu_t *only* */
-};
-
-/* Subpicture region position flags */
-#define SUBPICTURE_ALIGN_LEFT 0x1
-#define SUBPICTURE_ALIGN_RIGHT 0x2
-#define SUBPICTURE_ALIGN_TOP 0x4
-#define SUBPICTURE_ALIGN_BOTTOM 0x8
-#define SUBPICTURE_ALIGN_MASK ( SUBPICTURE_ALIGN_LEFT|SUBPICTURE_ALIGN_RIGHT| \
- SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_BOTTOM )
-
-/**
- * This function will create a new subpicture region.
- *
- * You must use subpicture_region_Delete to destroy it.
- */
-VLC_EXPORT( subpicture_region_t *, subpicture_region_New, ( const video_format_t *p_fmt ) );
-
-/**
- * This function will destroy a subpicture region allocated by
- * subpicture_region_New.
- *
- * You may give it NULL.
- */
-VLC_EXPORT( void, subpicture_region_Delete, ( subpicture_region_t *p_region ) );
-
-/**
- * This function will destroy a list of subpicture regions allocated by
- * subpicture_region_New.
- *
- * Provided for convenience.
- */
-VLC_EXPORT( void, subpicture_region_ChainDelete, ( subpicture_region_t *p_head ) );
-
-/**
- * Video subtitle
- *
- * Any subtitle destined to be displayed by a video output thread should
- * be stored in this structure from it's creation to it's effective display.
- * Subtitle type and flags should only be modified by the output thread. Note
- * that an empty subtitle MUST have its flags set to 0.
- */
-struct subpicture_t
-{
- /** \name Channel ID */
- /**@{*/
- int i_channel; /**< subpicture channel ID */
- /**@}*/
-
- /** \name Type and flags
- Should NOT be modified except by the vout thread */
- /**@{*/
- int64_t i_order; /** an increasing unique number */
- subpicture_t * p_next; /**< next subtitle to be displayed */
- /**@}*/
-
- /** \name Date properties */
- /**@{*/
- mtime_t i_start; /**< beginning of display date */
- mtime_t i_stop; /**< end of display date */
- bool b_ephemer; /**< If this flag is set to true the subtitle
- will be displayed untill the next one appear */
- bool b_fade; /**< enable fading */
- /**@}*/
-
- subpicture_region_t *p_region; /**< region list composing this subtitle */
-
- /** \name Display properties
- * These properties are only indicative and may be
- * changed by the video output thread, or simply ignored depending of the
- * subtitle type. */
- /**@{*/
- int i_original_picture_width; /**< original width of the movie */
- int i_original_picture_height;/**< original height of the movie */
- bool b_subtitle; /**< the picture is a movie subtitle */
- bool b_absolute; /**< position is absolute */
- int i_alpha; /**< transparency */
- /**@}*/
-
- /** Pointer to function that renders this subtitle in a picture */
- void ( *pf_render ) ( vout_thread_t *, picture_t *, const subpicture_t * );
- /** Pointer to function that cleans up the private data of this subtitle */
- void ( *pf_destroy ) ( subpicture_t * );
-
- /** Pointer to functions for region management */
- void (*pf_pre_render) ( spu_t *, subpicture_t *, const video_format_t * );
- void (*pf_update_regions)( spu_t *,
- subpicture_t *, const video_format_t *, mtime_t );
-
- /** Private data - the subtitle plugin might want to put stuff here to
- * keep track of the subpicture */
- subpicture_sys_t *p_sys; /* subpicture data */
-};
-
-
-/**
- * This function create a new empty subpicture.
- *
- * You must use subpicture_Delete to destroy it.
- */
-VLC_EXPORT( subpicture_t *, subpicture_New, ( void ) );
-
-/**
- * This function delete a subpicture created by subpicture_New.
- * You may give it NULL.
- */
-VLC_EXPORT( void, subpicture_Delete, ( subpicture_t *p_subpic ) );
-
/* Default subpicture channel ID */
#define DEFAULT_CHAN 1
* Prototypes
*****************************************************************************/
-/**
- * Initialise different fields of a picture_t (but does not allocate memory).
- * \param p_this a vlc object
- * \param p_pic pointer to the picture structure.
- * \param i_chroma the wanted chroma for the picture.
- * \param i_width the wanted width for the picture.
- * \param i_height the wanted height for the picture.
- * \param i_aspect the wanted aspect ratio for the picture.
- */
-#define vout_InitPicture(a,b,c,d,e,f) \
- __vout_InitPicture(VLC_OBJECT(a),b,c,d,e,f)
-VLC_EXPORT( int, __vout_InitPicture, ( vlc_object_t *p_this, picture_t *p_pic, uint32_t i_chroma, int i_width, int i_height, int i_aspect ) );
-
/**
* Initialise different fields of a picture_t and allocates the picture buffer.
* \param p_this a vlc object
VLC_EXPORT( int, vout_ChromaCmp, ( uint32_t, uint32_t ) );
VLC_EXPORT( picture_t *, vout_CreatePicture, ( vout_thread_t *, bool, bool, unsigned int ) );
-VLC_EXPORT( void, vout_InitFormat, ( video_frame_format_t *, uint32_t, int, int, int ) );
VLC_EXPORT( void, vout_DestroyPicture, ( vout_thread_t *, picture_t * ) );
VLC_EXPORT( void, vout_DisplayPicture, ( vout_thread_t *, picture_t * ) );
VLC_EXPORT( void, vout_LinkPicture, ( vout_thread_t *, picture_t * ) );
#include <vlc_access.h>
#include <vlc_demux.h>
#include <vlc_input.h>
-#include <vlc_vout.h>
#include <ctype.h>
#include <fcntl.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_input.h>
-#include <vlc_vout.h>
#include <vlc_demux.h>
int i;
int i_width;
int i_height;
- int i_aspect;
int result = 0;
if( strncmp(p_demux->psz_access, "dc1394", 6) != 0 )
i_width = p_sys->camera.frame_width;
i_height = p_sys->camera.frame_height;
- i_aspect = vout_InitPicture( VLC_OBJECT(p_demux), &p_sys->pic,
- VLC_FOURCC('U', 'Y', 'V', 'Y'),
- i_width, i_height,
- i_width * VOUT_ASPECT_FACTOR / i_height );
+ if( picture_Setup( &p_sys->pic, VLC_CODEC_UYVY,
+ i_width, i_height,
+ i_width * VOUT_ASPECT_FACTOR / i_height ) )
+ {
+ msg_Err( p_demux ,"unknown chroma" );
+ Close( p_this );
+ return VLC_EGENERIC;
+ }
- es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC('U', 'Y', 'V', 'Y') );
+ es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_UYVY );
fmt.video.i_width = i_width;
fmt.video.i_height = i_height;
if( p_sys->fd_audio >= 0 )
{
es_format_t fmt;
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC('a','r','a','w') );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_S16L ); /* FIXME: hmm, ?? */
fmt.audio.i_channels = p_sys->channels ? p_sys->channels : 1;
fmt.audio.i_rate = p_sys->i_sample_rate;
- fmt.audio.i_bitspersample = 16; /* FIXME: hmm, ?? */
+ fmt.audio.i_bitspersample = 16;
fmt.audio.i_blockalign = fmt.audio.i_channels *
fmt.audio.i_bitspersample / 8;
fmt.i_bitrate = fmt.audio.i_channels * fmt.audio.i_rate *
#endif
#include <vlc_common.h>
-#include <vlc_vout.h>
#ifndef _MSC_VER
/* Work-around a bug in w32api-2.5 */
#include <vlc_input.h>
#include <vlc_access.h>
#include <vlc_demux.h>
-#include <vlc_vout.h>
#include <vlc_dialog.h>
#include <vlc_charset.h>
/* Get/parse options and open device(s) */
string vdevname, adevname;
- int i_width = 0, i_height = 0, i_chroma = 0;
+ int i_width = 0, i_height = 0;
+ vlc_fourcc_t i_chroma = 0;
bool b_use_audio = true;
bool b_use_video = true;
p_sys->b_chroma = false;
var_Create( p_this, "dshow-chroma", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Get( p_this, "dshow-chroma", &val );
- if( val.psz_string && strlen( val.psz_string ) >= 4 )
- {
- i_chroma = VLC_FOURCC( val.psz_string[0], val.psz_string[1],
- val.psz_string[2], val.psz_string[3] );
- p_sys->b_chroma = true;
- }
+
+ i_chroma = vlc_fourcc_GetCodecFromString( UNKNOWN_ES, val.psz_string );
+ p_sys->b_chroma = i_chroma != 0;
free( val.psz_string );
var_Create( p_this, "dshow-fps", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
if( p_stream->mt.majortype == MEDIATYPE_Video )
{
if( /* Raw DV stream */
- p_stream->i_fourcc == VLC_FOURCC('d','v','s','l') ||
- p_stream->i_fourcc == VLC_FOURCC('d','v','s','d') ||
- p_stream->i_fourcc == VLC_FOURCC('d','v','h','d') ||
+ p_stream->i_fourcc == VLC_CODEC_DV ||
/* Raw MPEG video stream */
- p_stream->i_fourcc == VLC_FOURCC('m','p','2','v') )
+ p_stream->i_fourcc == VLC_CODEC_MPGV )
{
b_use_audio = false;
}
/* Setup rgb mask for RGB formats */
- if( p_stream->i_fourcc == VLC_FOURCC('R','V','2','4') )
+ if( p_stream->i_fourcc == VLC_CODEC_RGB24 )
{
/* This is in BGR format */
fmt.video.i_bmask = 0x00ff0000;
/* Check if we need to force demuxers */
if( !p_access->psz_demux || !*p_access->psz_demux )
{
- if( p_stream->i_fourcc == VLC_FOURCC('d','v','s','l') ||
- p_stream->i_fourcc == VLC_FOURCC('d','v','s','d') ||
- p_stream->i_fourcc == VLC_FOURCC('d','v','h','d') )
+ if( p_stream->i_fourcc == VLC_CODEC_DV )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "rawdv" );
}
- else if( p_stream->i_fourcc == VLC_FOURCC('m','p','2','v') )
+ else if( p_stream->i_fourcc == VLC_CODEC_MPGV )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "mpgv" );
{
switch( i_fourcc )
{
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('f','l','3','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_FL32:
return 9;
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_YV12:
case VLC_FOURCC('a','r','a','w'):
return 8;
- case VLC_FOURCC('R','V','2','4'):
+ case VLC_CODEC_RGB24:
return 7;
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('R','V','3','2'):
- case VLC_FOURCC('R','G','B','A'):
+ case VLC_CODEC_YUYV:
+ case VLC_CODEC_RGB32:
+ case VLC_CODEC_RGBA:
return 6;
}
val = i_bitspersample;
if( ! val )
{
- if( VLC_FOURCC('f', 'l', '3', '2') == i_current_fourcc )
+ if( VLC_CODEC_FL32 == i_current_fourcc )
val = 32;
else
val = 16;
{
// output format for 'Hauppauge WinTV PVR PCI II Capture'
// try I420 as an input format
- i_current_fourcc = VLC_FOURCC('I','4','2','0');
+ i_current_fourcc = VLC_CODEC_I420;
if( !i_fourcc || i_fourcc == i_current_fourcc )
{
// return alternative media type
((VIDEOINFOHEADER *)p_mt->pbFormat)->bmiHeader.biHeight;
vh.bmiHeader.biPlanes = 3;
vh.bmiHeader.biBitCount = 12;
- vh.bmiHeader.biCompression = VLC_FOURCC('I','4','2','0');
+ vh.bmiHeader.biCompression = VLC_CODEC_I420;
vh.bmiHeader.biSizeImage = vh.bmiHeader.biWidth * 12 *
vh.bmiHeader.biHeight / 8;
mtr.lSampleSize = vh.bmiHeader.biSizeImage;
#endif
#include <vlc_common.h>
-#include <vlc_vout.h>
+#include <vlc_fourcc.h>
#ifndef _MSC_VER
/* Work-around a bug in w32api-2.5 */
else if( media_type.subtype == MEDIASUBTYPE_RGB8 )
i_fourcc = VLC_FOURCC( 'R', 'G', 'B', '8' );
else if( media_type.subtype == MEDIASUBTYPE_RGB555 )
- i_fourcc = VLC_FOURCC( 'R', 'V', '1', '5' );
+ i_fourcc = VLC_CODEC_RGB15;
else if( media_type.subtype == MEDIASUBTYPE_RGB565 )
- i_fourcc = VLC_FOURCC( 'R', 'V', '1', '6' );
+ i_fourcc = VLC_CODEC_RGB16;
else if( media_type.subtype == MEDIASUBTYPE_RGB24 )
- i_fourcc = VLC_FOURCC( 'R', 'V', '2', '4' );
+ i_fourcc = VLC_CODEC_RGB24;
else if( media_type.subtype == MEDIASUBTYPE_RGB32 )
- i_fourcc = VLC_FOURCC( 'R', 'V', '3', '2' );
+ i_fourcc = VLC_CODEC_RGB32;
else if( media_type.subtype == MEDIASUBTYPE_ARGB32 )
- i_fourcc = VLC_FOURCC( 'R', 'G', 'B', 'A' );
+ i_fourcc = VLC_CODEC_RGBA;
/* Planar YUV formats */
else if( media_type.subtype == MEDIASUBTYPE_I420 )
- i_fourcc = VLC_FOURCC( 'I', '4', '2', '0' );
+ i_fourcc = VLC_CODEC_I420;
else if( media_type.subtype == MEDIASUBTYPE_Y41P )
- i_fourcc = VLC_FOURCC( 'I', '4', '1', '1' );
+ i_fourcc = VLC_CODEC_I411;
else if( media_type.subtype == MEDIASUBTYPE_YV12 )
- i_fourcc = VLC_FOURCC( 'Y', 'V', '1', '2' );
+ i_fourcc = VLC_CODEC_YV12;
else if( media_type.subtype == MEDIASUBTYPE_IYUV )
- i_fourcc = VLC_FOURCC( 'Y', 'V', '1', '2' );
+ i_fourcc = VLC_CODEC_YV12;
else if( media_type.subtype == MEDIASUBTYPE_YVU9 )
- i_fourcc = VLC_FOURCC( 'Y', 'V', 'U', '9' );
+ i_fourcc = VLC_CODEC_I410;
/* Packed YUV formats */
else if( media_type.subtype == MEDIASUBTYPE_YVYU )
- i_fourcc = VLC_FOURCC( 'Y', 'V', 'Y', 'U' );
+ i_fourcc = VLC_CODEC_YVYU;
else if( media_type.subtype == MEDIASUBTYPE_YUYV )
- i_fourcc = VLC_FOURCC( 'Y', 'U', 'Y', '2' );
+ i_fourcc = VLC_CODEC_YUYV;
else if( media_type.subtype == MEDIASUBTYPE_Y411 )
i_fourcc = VLC_FOURCC( 'I', '4', '1', 'N' );
else if( media_type.subtype == MEDIASUBTYPE_Y211 )
- i_fourcc = VLC_FOURCC( 'Y', '2', '1', '1' );
+ i_fourcc = VLC_CODEC_Y211;
else if( media_type.subtype == MEDIASUBTYPE_YUY2 )
- i_fourcc = VLC_FOURCC( 'Y', 'U', 'Y', '2' );
+ i_fourcc = VLC_CODEC_YUYV;
else if( media_type.subtype == MEDIASUBTYPE_UYVY )
- i_fourcc = VLC_FOURCC( 'U', 'Y', 'V', 'Y' );
+ i_fourcc = VLC_CODEC_UYVY;
/* HDYC uses UYVY sample positions but Rec709 colourimetry */
/* FIXME: When VLC understands colourspace, something will need
* to be added / changed here. Until then, just make it behave
* like UYVY */
else if( media_type.subtype == MEDIASUBTYPE_HDYC )
- i_fourcc = VLC_FOURCC( 'U', 'Y', 'V', 'Y');
+ i_fourcc = VLC_CODEC_UYVY;
/* MPEG2 video elementary stream */
else if( media_type.subtype == MEDIASUBTYPE_MPEG2_VIDEO )
- i_fourcc = VLC_FOURCC( 'm', 'p', '2', 'v' );
+ i_fourcc = VLC_CODEC_MPGV;
- /* DivX video */
+ /* DivX video */
else if( media_type.subtype == MEDIASUBTYPE_DIVX )
- i_fourcc = VLC_FOURCC( 'D', 'I', 'V', 'X' );
+ i_fourcc = VLC_CODEC_MP4V;
/* DV formats */
else if( media_type.subtype == MEDIASUBTYPE_dvsl )
- i_fourcc = VLC_FOURCC( 'd', 'v', 's', 'l' );
+ i_fourcc = VLC_CODEC_DV;
else if( media_type.subtype == MEDIASUBTYPE_dvsd )
- i_fourcc = VLC_FOURCC( 'd', 'v', 's', 'd' );
+ i_fourcc = VLC_CODEC_DV;
else if( media_type.subtype == MEDIASUBTYPE_dvhd )
- i_fourcc = VLC_FOURCC( 'd', 'v', 'h', 'd' );
+ i_fourcc = VLC_CODEC_DV;
/* MJPEG format */
else if( media_type.subtype == MEDIASUBTYPE_MJPG )
- i_fourcc = VLC_FOURCC( 'M', 'J', 'P', 'G' );
+ i_fourcc = VLC_CODEC_MJPG;
}
}
if( media_type.subtype == MEDIASUBTYPE_PCM )
i_fourcc = VLC_FOURCC( 'a', 'r', 'a', 'w' );
else if( media_type.subtype == MEDIASUBTYPE_IEEE_FLOAT )
- i_fourcc = VLC_FOURCC( 'f', 'l', '3', '2' );
+ i_fourcc = VLC_CODEC_FL32;
}
}
else if( media_type.majortype == MEDIATYPE_Stream )
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;
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 );
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 */
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 );
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 );
}
/* 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;
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 )
}
}
-
static int AVCResetHandler( raw1394handle_t handle, unsigned int generation )
{
raw1394_update_generation( handle, generation );
#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_demux.h>
-#include <vlc_vout.h>
#include <vlc_codecs.h>
#include <vlc_url.h>
#include <vlc_strings.h>
p_sys->jack_sample_size = sizeof( jack_default_audio_sample_t );
/* Define output format */
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'f','l','3','2' ) );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_FL32 );
fmt.audio.i_channels = p_sys->i_channels;
fmt.audio.i_rate = p_sys->jack_sample_rate;
fmt.audio.i_bitspersample = p_sys->jack_sample_size * 8;
#include <vlc_access.h>
#include <vlc_demux.h>
#include <vlc_input.h>
-#include <vlc_vout.h>
#include <ctype.h>
#include <fcntl.h>
p_sys->i_sample_rate );
es_format_t fmt;
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC('a','r','a','w') );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_S16L );
fmt.audio.i_channels = p_sys->b_stereo ? 2 : 1;
fmt.audio.i_rate = p_sys->i_sample_rate;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_input.h>
-#include <vlc_vout.h>
#include <vlc_demux.h>
#include <vlc_interface.h>
#include <vlc_dialog.h>
} qtchroma_to_fourcc[] =
{
/* Raw data types */
- { k422YpCbCr8CodecType, VLC_FOURCC('U','Y','V','Y') },
- { kComponentVideoCodecType,VLC_FOURCC('Y','U','Y','2') },
+ { k422YpCbCr8CodecType, VLC_CODEC_UYVY },
+ { kComponentVideoCodecType,VLC_CODEC_YUYV },
{ 0, 0 }
};
int i;
{
es_format_t fmt;
- es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('u', 'l', 'a', 'w'));
+ es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_MULAW);
fmt.audio.i_rate = 8000;
fmt.audio.i_channels = 1;
return codec_init (demux, &fmt);
{
es_format_t fmt;
- es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('g', 's', 'm', ' '));
+ es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_GSM);
fmt.audio.i_rate = 8000;
fmt.audio.i_channels = 1;
return codec_init (demux, &fmt);
{
es_format_t fmt;
- es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('a', 'l', 'a', 'w'));
+ es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_ALAW);
fmt.audio.i_rate = 8000;
fmt.audio.i_channels = 1;
return codec_init (demux, &fmt);
{
es_format_t fmt;
- es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('s', '1', '6', 'b'));
+ es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_S16B);
fmt.audio.i_rate = 44100;
fmt.audio.i_channels = 2;
return codec_init (demux, &fmt);
{
es_format_t fmt;
- es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('s', '1', '6', 'b'));
+ es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_S16B);
fmt.audio.i_rate = 44100;
fmt.audio.i_channels = 1;
return codec_init (demux, &fmt);
{
es_format_t fmt;
- es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('Q', 'c', 'l', 'p'));
+ es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_QCELP);
fmt.audio.i_rate = 8000;
fmt.audio.i_channels = 1;
return codec_init (demux, &fmt);
{
es_format_t fmt;
- es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('m', 'p', 'g', 'a'));
+ es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_MPGA);
fmt.audio.i_channels = 2;
fmt.b_packetized = false;
return codec_init (demux, &fmt);
{
es_format_t fmt;
- es_format_Init (&fmt, VIDEO_ES, VLC_FOURCC ('m', 'p', 'g', 'v'));
+ es_format_Init (&fmt, VIDEO_ES, VLC_CODEC_MPGV);
fmt.b_packetized = false;
return codec_init (demux, &fmt);
}
break;
es_format_t fmt;
- es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('v','o','r','b'));
+ es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_VORBIS);
fmt.p_extra = extv;
fmt.i_extra = extc;
codec_destroy (demux, self->id);
rmff_fix_header(header);
- if( desc ) sdpplin_free( desc );
+ sdpplin_free( desc );
free( buf );
return header;
error:
- if( desc ) sdpplin_free( desc );
- if( header ) rmff_free_header( header );
+ sdpplin_free( desc );
+ rmff_free_header( header );
free( buf );
return NULL;
}
return h;
error:
- if( h ) rmff_free_header( h );
+ rmff_free_header( h );
free( challenge1 );
free( session_id );
free( description );
* sdp/sdpplin parser.
*
*/
-
+
#include "real.h"
+#include "vlc_strings.h"
#define BUFLEN 32000
-/*
- * Decodes base64 strings (based upon b64 package)
- */
-
-static char *b64_decode(const char *in, char *out, int *size) {
-
- char dtable[256]; /* Encode / decode table */
- int i,k;
- unsigned int j;
-
- for( i = 0; i < 256; i++ )
- dtable[i] = 0x80;
-
- for( i = 'A'; i <= 'Z'; i++ )
- dtable[i] = 0 + (i - 'A');
-
- for( i = 'a'; i <= 'z'; i++ )
- dtable[i] = 26 + (i - 'a');
-
- for( i = '0'; i <= '9'; i++ )
- dtable[i] = 52 + (i - '0');
-
- dtable['+'] = 62;
- dtable['/'] = 63;
- dtable['='] = 0;
-
- k=0;
- /*CONSTANTCONDITION*/
- int in_len = strlen(in);
- for (j=0; j < in_len; j+=4) {
- char a[4], b[4];
-
- for (i = 0; i < 4 && j + i < in_len; i++) {
- int c = in[i+j];
-
- if (dtable[c] & 0x80) {
- printf("Illegal character '%c' in input.\n", c);
- exit(1);
- }
- a[i] = (char) c;
- b[i] = (char) dtable[c];
- }
- //xine_buffer_ensure_size(out, k+3);
- out[k++] = (b[0] << 2) | (b[1] >> 4);
- out[k++] = (b[1] << 4) | (b[2] >> 2);
- out[k++] = (b[2] << 6) | b[3];
- i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3);
- if (i < 3) {
- out[k]=0;
- *size=k;
- return out;
- }
- }
- out[k]=0;
- *size=k;
- return out;
-}
-
-static char *nl(char *data) {
-
+static inline char *nl(char *data) {
char *nlptr = (data) ? strchr(data,'\n') : NULL;
return (nlptr) ? nlptr + 1 : NULL;
}
*data=nl(*data);
}
if(filter(*data,"a=OpaqueData:buffer;",&buf, BUFLEN)) {
- decoded = b64_decode(buf, decoded, &(desc->mlti_data_size));
- if ( decoded != NULL ) {
+ desc->mlti_data_size =
+ vlc_b64_decode_binary_to_buffer(decoded, BUFLEN, buf );
+ if ( desc->mlti_data_size ) {
desc->mlti_data = malloc(desc->mlti_data_size);
memcpy(desc->mlti_data, decoded, desc->mlti_data_size);
handled=1;
continue;
}
if(filter(data,"a=Title:buffer;",&buf, BUFLEN)) {
- decoded=b64_decode(buf, decoded, &len);
- if ( decoded != NULL ) {
- desc->title=strdup(decoded);
- handled=1;
- data=nl(data);
+ desc->title=vlc_b64_decode(buf);
+ if(desc->title) {
+ handled=1;
+ data=nl(data);
}
}
if(filter(data,"a=Author:buffer;",&buf, BUFLEN)) {
- decoded=b64_decode(buf, decoded, &len);
- if ( decoded != NULL ) {
- desc->author=strdup(decoded);
- handled=1;
- data=nl(data);
+ desc->author=vlc_b64_decode(buf);
+ if(desc->author) {
+ handled=1;
+ data=nl(data);
}
}
if(filter(data,"a=Copyright:buffer;",&buf, BUFLEN)) {
- decoded=b64_decode(buf, decoded, &len);
- if ( decoded != NULL ) {
- desc->copyright=strdup(decoded);
- handled=1;
- data=nl(data);
+ desc->copyright=vlc_b64_decode(buf);
+ if(desc->copyright) {
+ handled=1;
+ data=nl(data);
}
}
if(filter(data,"a=Abstract:buffer;",&buf, BUFLEN)) {
- decoded=b64_decode(buf, decoded, &len);
- if ( decoded != NULL ) {
- desc->abstract=strdup(decoded);
- handled=1;
- data=nl(data);
+ desc->abstract=vlc_b64_decode(buf);
+ if(desc->abstract) {
+ handled=1;
+ data=nl(data);
}
}
if(filter(data,"a=StreamCount:integer;",&buf, BUFLEN)) {
switch( p_data->p_screen->ColorSpace() )
{
case B_RGB32:
- i_chroma = VLC_FOURCC('R','V','3','2');
+ i_chroma = VLC_CODEC_RGB32;
i_bits_per_pixel = 32;
break;
case B_RGB16:
- i_chroma = VLC_FOURCC('R','V','1','6');
+ i_chroma = VLC_CODEC_RGB16;
i_bits_per_pixel = 16;
break;
default:
CGLSetOffScreen( p_data->scaled, p_data->dest_width, p_data->dest_height,
p_data->dest_width * 4, p_data->scaled_image );
- es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_FOURCC( 'R','V','3','2' ) );
+ es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_CODEC_RGB32 );
/* p_sys->fmt.video.i_* must set to screen size, not subscreen size */
p_sys->fmt.video.i_width = p_data->screen_width;
msg_Dbg( p_demux, "Using %s for the mouse pointer image", psz_mouse );
memset( &fmt_in, 0, sizeof( fmt_in ) );
memset( &fmt_out, 0, sizeof( fmt_out ) );
- fmt_out.i_chroma = VLC_FOURCC('R','G','B','A');
+ fmt_out.i_chroma = VLC_CODEC_RGBA;
p_image = image_HandlerCreate( p_demux );
if( p_image )
{
{
demux_sys_t *p_sys = p_demux->p_sys;
if( !p_sys->dst.i_planes )
- vout_InitPicture( p_demux, &p_sys->dst,
- p_sys->fmt.video.i_chroma,
- p_sys->fmt.video.i_width,
- p_sys->fmt.video.i_height,
- p_sys->fmt.video.i_aspect );
+ picture_Setup( &p_sys->dst,
+ p_sys->fmt.video.i_chroma,
+ p_sys->fmt.video.i_width,
+ p_sys->fmt.video.i_height,
+ p_sys->fmt.video.i_aspect );
if( !p_sys->p_blend )
{
p_sys->p_blend = vlc_object_create( p_demux, sizeof(filter_t) );
if( p_sys->p_blend )
{
es_format_Init( &p_sys->p_blend->fmt_in, VIDEO_ES,
- VLC_FOURCC('R','G','B','A') );
+ VLC_CODEC_RGBA );
p_sys->p_blend->fmt_in.video = p_sys->p_mouse->format;
p_sys->p_blend->fmt_out = p_sys->fmt;
p_sys->p_blend->p_module =
switch( i_bits_per_pixel )
{
case 8: /* FIXME: set the palette */
- i_chroma = VLC_FOURCC('R','G','B','2'); break;
+ i_chroma = VLC_CODEC_RGB8; break;
case 15:
case 16: /* Yes it is really 15 bits (when using BI_RGB) */
- i_chroma = VLC_FOURCC('R','V','1','5'); break;
+ i_chroma = VLC_CODEC_RGB15; break;
case 24:
- i_chroma = VLC_FOURCC('R','V','2','4'); break;
+ i_chroma = VLC_CODEC_RGB24; break;
case 32:
- i_chroma = VLC_FOURCC('R','V','3','2'); break;
+ i_chroma = VLC_CODEC_RGB32; break;
default:
msg_Err( p_demux, "unknown screen depth %i",
p_sys->fmt.video.i_bits_per_pixel );
switch( i_chroma )
{
- case VLC_FOURCC('R','V','1','5'):
+ case VLC_CODEC_RGB15:
p_sys->fmt.video.i_rmask = 0x7c00;
p_sys->fmt.video.i_gmask = 0x03e0;
p_sys->fmt.video.i_bmask = 0x001f;
break;
- case VLC_FOURCC('R','V','2','4'):
+ case VLC_CODEC_RGB24:
p_sys->fmt.video.i_rmask = 0x00ff0000;
p_sys->fmt.video.i_gmask = 0x0000ff00;
p_sys->fmt.video.i_bmask = 0x000000ff;
break;
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB32:
p_sys->fmt.video.i_rmask = 0x00ff0000;
p_sys->fmt.video.i_gmask = 0x0000ff00;
p_sys->fmt.video.i_bmask = 0x000000ff;
switch( win_info.depth )
{
case 8: /* FIXME: set the palette */
- i_chroma = VLC_FOURCC('R','G','B','2'); break;
+ i_chroma = VLC_CODEC_RGB8; break;
case 15:
- i_chroma = VLC_FOURCC('R','V','1','5'); break;
+ i_chroma = VLC_CODEC_RGB15; break;
case 16:
- i_chroma = VLC_FOURCC('R','V','1','6'); break;
+ i_chroma = VLC_CODEC_RGB16; break;
case 24:
case 32:
- i_chroma = VLC_FOURCC('R','V','3','2');
+ i_chroma = VLC_CODEC_RGB32;
win_info.depth = 32;
break;
default:
#include <vlc_input.h>
#include <vlc_demux.h>
#include <vlc_access.h>
-#include <vlc_vout.h>
+#include <vlc_picture.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
static const struct
{
int i_v4l;
- int i_fourcc;
+ vlc_fourcc_t i_fourcc;
} v4lchroma_to_fourcc[] =
{
- { VIDEO_PALETTE_GREY, VLC_FOURCC( 'G', 'R', 'E', 'Y' ) },
+ { VIDEO_PALETTE_GREY, VLC_CODEC_GREY },
{ VIDEO_PALETTE_HI240, VLC_FOURCC( 'I', '2', '4', '0' ) },
- { VIDEO_PALETTE_RGB565, VLC_FOURCC( 'R', 'V', '1', '6' ) },
- { VIDEO_PALETTE_RGB555, VLC_FOURCC( 'R', 'V', '1', '5' ) },
- { VIDEO_PALETTE_RGB24, VLC_FOURCC( 'R', 'V', '2', '4' ) },
- { VIDEO_PALETTE_RGB32, VLC_FOURCC( 'R', 'V', '3', '2' ) },
- { VIDEO_PALETTE_YUV422, VLC_FOURCC( 'Y', 'U', 'Y', '2' ) },
- { VIDEO_PALETTE_YUV422, VLC_FOURCC( 'Y', 'U', 'Y', 'V' ) },
- { VIDEO_PALETTE_YUYV, VLC_FOURCC( 'Y', 'U', 'Y', '2' ) },
- { VIDEO_PALETTE_YUYV, VLC_FOURCC( 'Y', 'U', 'Y', 'V' ) },
- { VIDEO_PALETTE_UYVY, VLC_FOURCC( 'U', 'Y', 'V', 'Y' ) },
+ { VIDEO_PALETTE_RGB565, VLC_CODEC_RGB16 },
+ { VIDEO_PALETTE_RGB555, VLC_CODEC_RGB15 },
+ { VIDEO_PALETTE_RGB24, VLC_CODEC_RGB24 },
+ { VIDEO_PALETTE_RGB32, VLC_CODEC_RGB32 },
+ { VIDEO_PALETTE_YUV422, VLC_CODEC_YUYV },
+ { VIDEO_PALETTE_YUYV, VLC_CODEC_YUYV },
+ { VIDEO_PALETTE_UYVY, VLC_CODEC_UYVY },
{ VIDEO_PALETTE_YUV420, VLC_FOURCC( 'I', '4', '2', 'N' ) },
{ VIDEO_PALETTE_YUV411, VLC_FOURCC( 'I', '4', '1', 'N' ) },
{ VIDEO_PALETTE_RAW, VLC_FOURCC( 'G', 'R', 'A', 'W' ) },
- { VIDEO_PALETTE_YUV422P, VLC_FOURCC( 'I', '4', '2', '2' ) },
- { VIDEO_PALETTE_YUV420P, VLC_FOURCC( 'I', '4', '2', '0' ) },
- { VIDEO_PALETTE_YUV411P, VLC_FOURCC( 'I', '4', '1', '1' ) },
+ { VIDEO_PALETTE_YUV422P, VLC_CODEC_I422 },
+ { VIDEO_PALETTE_YUV420P, VLC_CODEC_I420 },
+ { VIDEO_PALETTE_YUV411P, VLC_CODEC_I411 },
{ 0, 0 }
};
/* Setup rgb mask for RGB formats */
switch( p_sys->i_fourcc )
{
- case VLC_FOURCC('R','V','1','5'):
+ case VLC_CODEC_RGB15:
fmt.video.i_rmask = 0x001f;
fmt.video.i_gmask = 0x03e0;
fmt.video.i_bmask = 0x7c00;
break;
- case VLC_FOURCC('R','V','1','6'):
+ case VLC_CODEC_RGB16:
fmt.video.i_rmask = 0x001f;
fmt.video.i_gmask = 0x07e0;
fmt.video.i_bmask = 0xf800;
break;
- case VLC_FOURCC('R','V','2','4'):
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB24:
+ case VLC_CODEC_RGB32:
fmt.video.i_rmask = 0x00ff0000;
fmt.video.i_gmask = 0x0000ff00;
fmt.video.i_bmask = 0x000000ff;
p_sys->i_fourcc = 0;
psz = var_CreateGetString( p_demux, "v4l-chroma" );
- if( strlen( psz ) >= 4 )
+
+ const vlc_fourcc_t i_chroma =
+ vlc_fourcc_GetCodecFromString( VIDEO_ES, psz );
+ if( i_chroma )
{
vid_picture.palette = 0;
- int i_chroma = VLC_FOURCC( psz[0], psz[1], psz[2], psz[3] );
/* Find out v4l chroma code */
for( i = 0; v4lchroma_to_fourcc[i].i_v4l != 0; i++ )
goto vdev_failed;
}
- p_sys->i_fourcc = VLC_FOURCC( 'm','j','p','g' );
+ p_sys->i_fourcc = VLC_CODEC_MJPG;
p_sys->i_frame_pos = -1;
/* queue up all the frames */
else
{
/* Fill in picture_t fields */
- vout_InitPicture( VLC_OBJECT(p_demux), &p_sys->pic, p_sys->i_fourcc,
- p_sys->i_width, p_sys->i_height, p_sys->i_width *
- VOUT_ASPECT_FACTOR / p_sys->i_height );
- if( !p_sys->pic.i_planes )
+ if( picture_Setup( &p_sys->pic, p_sys->i_fourcc,
+ p_sys->i_width, p_sys->i_height, p_sys->i_width *
+ VOUT_ASPECT_FACTOR / p_sys->i_height ) )
{
msg_Err( p_demux, "unsupported chroma" );
goto vdev_failed;
static const struct
{
unsigned int i_v4l2;
- int i_fourcc;
+ vlc_fourcc_t i_fourcc;
int i_rmask;
int i_gmask;
int i_bmask;
} v4l2chroma_to_fourcc[] =
{
/* Raw data types */
- { V4L2_PIX_FMT_GREY, VLC_FOURCC('G','R','E','Y'), 0, 0, 0 },
+ { V4L2_PIX_FMT_GREY, VLC_CODEC_GREY, 0, 0, 0 },
{ V4L2_PIX_FMT_HI240, VLC_FOURCC('I','2','4','0'), 0, 0, 0 },
- { V4L2_PIX_FMT_RGB555, VLC_FOURCC('R','V','1','5'), 0x001f,0x03e0,0x7c00 },
- { V4L2_PIX_FMT_RGB565, VLC_FOURCC('R','V','1','6'), 0x001f,0x07e0,0xf800 },
+ { V4L2_PIX_FMT_RGB555, VLC_CODEC_RGB15, 0x001f,0x03e0,0x7c00 },
+ { V4L2_PIX_FMT_RGB565, VLC_CODEC_RGB16, 0x001f,0x07e0,0xf800 },
/* Won't work since we don't know how to handle such gmask values
* correctly
- { V4L2_PIX_FMT_RGB555X, VLC_FOURCC('R','V','1','5'), 0x007c,0xe003,0x1f00 },
- { V4L2_PIX_FMT_RGB565X, VLC_FOURCC('R','V','1','6'), 0x00f8,0xe007,0x1f00 },
+ { V4L2_PIX_FMT_RGB555X, VLC_CODEC_RGB15, 0x007c,0xe003,0x1f00 },
+ { V4L2_PIX_FMT_RGB565X, VLC_CODEC_RGB16, 0x00f8,0xe007,0x1f00 },
*/
- { V4L2_PIX_FMT_BGR24, VLC_FOURCC('R','V','2','4'), 0xff0000,0xff00,0xff },
- { V4L2_PIX_FMT_RGB24, VLC_FOURCC('R','V','2','4'), 0xff,0xff00,0xff0000 },
- { V4L2_PIX_FMT_BGR32, VLC_FOURCC('R','V','3','2'), 0xff0000,0xff00,0xff },
- { V4L2_PIX_FMT_RGB32, VLC_FOURCC('R','V','3','2'), 0xff,0xff00,0xff0000 },
- { V4L2_PIX_FMT_YUYV, VLC_FOURCC('Y','U','Y','2'), 0, 0, 0 },
- { V4L2_PIX_FMT_YUYV, VLC_FOURCC('Y','U','Y','V'), 0, 0, 0 },
- { V4L2_PIX_FMT_UYVY, VLC_FOURCC('U','Y','V','Y'), 0, 0, 0 },
+ { V4L2_PIX_FMT_BGR24, VLC_CODEC_RGB24, 0xff0000,0xff00,0xff },
+ { V4L2_PIX_FMT_RGB24, VLC_CODEC_RGB24, 0xff,0xff00,0xff0000 },
+ { V4L2_PIX_FMT_BGR32, VLC_CODEC_RGB32, 0xff0000,0xff00,0xff },
+ { V4L2_PIX_FMT_RGB32, VLC_CODEC_RGB32, 0xff,0xff00,0xff0000 },
+ { V4L2_PIX_FMT_YUYV, VLC_CODEC_YUYV, 0, 0, 0 },
+ { V4L2_PIX_FMT_UYVY, VLC_CODEC_UYVY, 0, 0, 0 },
{ V4L2_PIX_FMT_Y41P, VLC_FOURCC('I','4','1','N'), 0, 0, 0 },
- { V4L2_PIX_FMT_YUV422P, VLC_FOURCC('I','4','2','2'), 0, 0, 0 },
- { V4L2_PIX_FMT_YVU420, VLC_FOURCC('Y','V','1','2'), 0, 0, 0 },
- { V4L2_PIX_FMT_YUV411P, VLC_FOURCC('I','4','1','1'), 0, 0, 0 },
- { V4L2_PIX_FMT_YUV410, VLC_FOURCC('I','4','1','0'), 0, 0, 0 },
+ { V4L2_PIX_FMT_YUV422P, VLC_CODEC_I422, 0, 0, 0 },
+ { V4L2_PIX_FMT_YVU420, VLC_CODEC_YV12, 0, 0, 0 },
+ { V4L2_PIX_FMT_YUV411P, VLC_CODEC_I411, 0, 0, 0 },
+ { V4L2_PIX_FMT_YUV410, VLC_CODEC_I410, 0, 0, 0 },
/* Raw data types, not in V4L2 spec but still in videodev2.h and supported
* by VLC */
- { V4L2_PIX_FMT_YUV420, VLC_FOURCC('I','4','2','0'), 0, 0, 0 },
- /* FIXME { V4L2_PIX_FMT_RGB444, VLC_FOURCC('R','V','3','2') }, */
+ { V4L2_PIX_FMT_YUV420, VLC_CODEC_I420, 0, 0, 0 },
+ /* FIXME { V4L2_PIX_FMT_RGB444, VLC_CODEC_RGB32 }, */
/* Compressed data types */
- { V4L2_PIX_FMT_MJPEG, VLC_FOURCC('M','J','P','G'), 0, 0, 0 },
+ { V4L2_PIX_FMT_MJPEG, VLC_CODEC_MJPG, 0, 0, 0 },
#if 0
{ V4L2_PIX_FMT_JPEG, VLC_FOURCC('J','P','E','G') },
{ V4L2_PIX_FMT_DV, VLC_FOURCC('?','?','?','?') },
/* Test and set Chroma */
fmt.fmt.pix.pixelformat = 0;
- if( p_sys->psz_requested_chroma && strlen( p_sys->psz_requested_chroma ) > 0 )
+ if( p_sys->psz_requested_chroma && *p_sys->psz_requested_chroma )
{
/* User specified chroma */
- if( strlen( p_sys->psz_requested_chroma ) >= 4 )
+ const vlc_fourcc_t i_requested_fourcc =
+ vlc_fourcc_GetCodecFromString( VIDEO_ES, p_sys->psz_requested_chroma );
+
+ for( int i = 0; v4l2chroma_to_fourcc[i].i_v4l2 != 0; i++ )
{
- int i_requested_fourcc = VLC_FOURCC(
- p_sys->psz_requested_chroma[0], p_sys->psz_requested_chroma[1],
- p_sys->psz_requested_chroma[2], p_sys->psz_requested_chroma[3] );
- for( int i = 0; v4l2chroma_to_fourcc[i].i_v4l2 != 0; i++ )
+ if( v4l2chroma_to_fourcc[i].i_fourcc == i_requested_fourcc )
{
- if( v4l2chroma_to_fourcc[i].i_fourcc == i_requested_fourcc )
- {
- fmt.fmt.pix.pixelformat = v4l2chroma_to_fourcc[i].i_v4l2;
- break;
- }
+ fmt.fmt.pix.pixelformat = v4l2chroma_to_fourcc[i].i_v4l2;
+ break;
}
}
/* Try and set user chroma */
psz_parser = ( *psz_delim ) ? ( psz_delim + 1 ) : psz_delim;
}
}
- var_Change( p_obj, "allcontrols", VLC_VAR_FREELIST, &val, &text );
+ var_FreeList( &val, &text );
}
/*****************************************************************************
return VLC_EGENERIC;
}
- if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
- || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if ( p_filter->input.i_format != VLC_CODEC_FL32
+ || p_filter->output.i_format != VLC_CODEC_FL32 )
{
return VLC_EGENERIC;
}
p_filter->input.i_original_channels =
p_filter->output.i_original_channels;
}
- if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
- || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if( p_filter->input.i_format != VLC_CODEC_FL32
+ || p_filter->output.i_format != VLC_CODEC_FL32 )
{
b_fit = false;
- p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
- p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+ p_filter->input.i_format = VLC_CODEC_FL32;
+ p_filter->output.i_format = VLC_CODEC_FL32;
}
if( p_filter->input.i_rate != p_filter->output.i_rate )
{
p_filter->fmt_in.audio.i_original_channels =
p_filter->fmt_out.audio.i_original_channels;
}
- if( p_filter->fmt_in.audio.i_format != VLC_FOURCC('f','l','3','2')
- || p_filter->fmt_out.audio.i_format != VLC_FOURCC('f','l','3','2') )
+ if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32
+ || p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )
{
b_fit = false;
- p_filter->fmt_in.audio.i_format = VLC_FOURCC('f','l','3','2');
- p_filter->fmt_out.audio.i_format = VLC_FOURCC('f','l','3','2');
+ p_filter->fmt_in.audio.i_format = VLC_CODEC_FL32;
+ p_filter->fmt_out.audio.i_format = VLC_CODEC_FL32;
}
if( p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate )
{
return VLC_EGENERIC;
}
- if( (p_filter->fmt_in.i_codec != AOUT_FMT_S16_NE) ||
- (p_filter->fmt_out.i_codec != AOUT_FMT_S16_NE) )
+ if( (p_filter->fmt_in.i_codec != VLC_CODEC_S16N) ||
+ (p_filter->fmt_out.i_codec != VLC_CODEC_S16N) )
{
/*msg_Err( p_this, "filter discarded (invalid format)" );*/
return VLC_EGENERIC;
if( (p_filter->fmt_in.audio.i_format != p_filter->fmt_out.audio.i_format) &&
(p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate) &&
- (p_filter->fmt_in.audio.i_format != AOUT_FMT_S16_NE) &&
- (p_filter->fmt_out.audio.i_format != AOUT_FMT_S16_NE) &&
+ (p_filter->fmt_in.audio.i_format != VLC_CODEC_S16N) &&
+ (p_filter->fmt_out.audio.i_format != VLC_CODEC_S16N) &&
(p_filter->fmt_in.audio.i_bitspersample !=
p_filter->fmt_out.audio.i_bitspersample))
{
*****************************************************************************/
static bool IsSupported( const audio_format_t *p_input, const audio_format_t *p_output )
{
- if( p_input->i_format != VLC_FOURCC('f','l','3','2') ||
+ if( p_input->i_format != VLC_CODEC_FL32 ||
p_input->i_format != p_output->i_format ||
p_input->i_rate != p_output->i_rate )
return false;
== p_filter->output.i_original_channels)
|| p_filter->input.i_format != p_filter->output.i_format
|| p_filter->input.i_rate != p_filter->output.i_rate
- || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
- && p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
+ || (p_filter->input.i_format != VLC_CODEC_FL32
+ && p_filter->input.i_format != VLC_CODEC_FI32) )
{
return -1;
}
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
int i_ret;
- if ( p_filter->input.i_format != VLC_FOURCC('a','5','2',' ')
+ if ( p_filter->input.i_format != VLC_CODEC_A52
#ifdef LIBA52_FIXED
- || p_filter->output.i_format != VLC_FOURCC('f','i','3','2') )
+ || p_filter->output.i_format != VLC_CODEC_FI32 )
#else
- || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ || p_filter->output.i_format != VLC_CODEC_FL32 )
#endif
{
return -1;
filter_sys_t *p_sys;
int i_ret;
- if( p_filter->fmt_in.i_codec != VLC_FOURCC('a','5','2',' ') )
+ if( p_filter->fmt_in.i_codec != VLC_CODEC_A52 )
{
return VLC_EGENERIC;
}
p_filter->fmt_out.audio.i_format =
#ifdef LIBA52_FIXED
- p_filter->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+ p_filter->fmt_out.i_codec = VLC_CODEC_FI32;
#else
- p_filter->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+ p_filter->fmt_out.i_codec = VLC_CODEC_FL32;
#endif
p_filter->fmt_out.audio.i_bitspersample =
aout_BitsPerSample( p_filter->fmt_out.i_codec );
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( p_filter->input.i_format != VLC_FOURCC('a','5','2',' ') ||
- ( p_filter->output.i_format != VLC_FOURCC('s','p','d','b') &&
- p_filter->output.i_format != VLC_FOURCC('s','p','d','i') ) )
+ if ( p_filter->input.i_format != VLC_CODEC_A52 ||
+ ( p_filter->output.i_format != VLC_CODEC_SPDIFB &&
+ p_filter->output.i_format != VLC_CODEC_SPDIFL ) )
{
return -1;
}
uint8_t * p_out = p_out_buf->p_buffer;
/* Copy the S/PDIF headers. */
- if( p_filter->output.i_format == VLC_FOURCC('s','p','d','b') )
+ if( p_filter->output.i_format == VLC_CODEC_SPDIFB )
{
vlc_memcpy( p_out, p_sync_be, 6 );
p_out[4] = p_in[5] & 0x7; /* bsmod */
filter_sys_t *p_sys;
int i_ret;
- if ( p_filter->input.i_format != VLC_FOURCC('d','t','s',' ')
- || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if ( p_filter->input.i_format != VLC_CODEC_DTS
+ || p_filter->output.i_format != VLC_CODEC_FL32 )
{
return -1;
}
filter_sys_t *p_sys;
int i_ret;
- if( p_filter->fmt_in.i_codec != VLC_FOURCC('d','t','s',' ') )
+ if( p_filter->fmt_in.i_codec != VLC_CODEC_DTS )
{
return VLC_EGENERIC;
}
p_filter->fmt_out.audio.i_format =
- p_filter->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+ p_filter->fmt_out.i_codec = VLC_CODEC_FL32;
p_filter->fmt_out.audio.i_bitspersample =
aout_BitsPerSample( p_filter->fmt_out.i_codec );
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if( p_filter->input.i_format != VLC_FOURCC('d','t','s',' ') ||
- ( p_filter->output.i_format != VLC_FOURCC('s','p','d','i') &&
- p_filter->output.i_format != VLC_FOURCC('s','p','d','b') ) )
+ if( p_filter->input.i_format != VLC_CODEC_DTS ||
+ ( p_filter->output.i_format != VLC_CODEC_SPDIFL &&
+ p_filter->output.i_format != VLC_CODEC_SPDIFB ) )
{
return -1;
}
}
/* Copy the S/PDIF headers. */
- if( p_filter->output.i_format == VLC_FOURCC('s','p','d','b') )
+ if( p_filter->output.i_format == VLC_CODEC_SPDIFB )
{
vlc_memcpy( p_out, p_sync_be, 6 );
p_out[5] = i_ac5_spdif_type;
p_out[7] = (( i_length ) >> 5 ) & 0xFF;
}
- if( ( (p_in[0] == 0x1F || p_in[0] == 0x7F) && p_filter->output.i_format == VLC_FOURCC('s','p','d','i') ) ||
- ( (p_in[0] == 0xFF || p_in[0] == 0xFE) && p_filter->output.i_format == VLC_FOURCC('s','p','d','b') ) )
+ if( ( (p_in[0] == 0x1F || p_in[0] == 0x7F) && p_filter->output.i_format == VLC_CODEC_SPDIFL ) ||
+ ( (p_in[0] == 0xFF || p_in[0] == 0xFE) && p_filter->output.i_format == VLC_CODEC_SPDIFB ) )
{
/* We are dealing with a big endian bitstream and a little endian output
* or a little endian bitstream and a big endian output.
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( p_filter->input.i_format != VLC_FOURCC('f','i','3','2')
- || p_filter->output.i_format != AOUT_FMT_S16_NE )
+ if ( p_filter->input.i_format != VLC_CODEC_FI32
+ || p_filter->output.i_format != VLC_CODEC_S16N )
{
return -1;
}
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( p_filter->output.i_format != VLC_FOURCC('f','i','3','2')
- || p_filter->input.i_format != AOUT_FMT_S16_NE )
+ if ( p_filter->output.i_format != VLC_CODEC_FI32
+ || p_filter->input.i_format != VLC_CODEC_S16N )
{
return -1;
}
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( p_filter->input.i_format != VLC_FOURCC('u','8',' ',' ')
- || p_filter->output.i_format != VLC_FOURCC('f','i','3','2') )
+ if ( p_filter->input.i_format != VLC_CODEC_U8
+ || p_filter->output.i_format != VLC_CODEC_FI32 )
{
return -1;
}
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if( ( p_filter->input.i_format != VLC_FOURCC('f','i','3','2')
- || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
- && ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
- || p_filter->output.i_format != VLC_FOURCC('f','i','3','2') ) )
+ if( ( p_filter->input.i_format != VLC_CODEC_FI32
+ || p_filter->output.i_format != VLC_CODEC_FL32 )
+ && ( p_filter->input.i_format != VLC_CODEC_FL32
+ || p_filter->output.i_format != VLC_CODEC_FI32 ) )
{
return -1;
}
return -1;
}
- if( p_filter->input.i_format == VLC_FOURCC('f','i','3','2') )
+ if( p_filter->input.i_format == VLC_CODEC_FI32 )
{
p_filter->pf_do_work = Do_F32ToFL32;
}
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
- || p_filter->output.i_format != AOUT_FMT_S16_NE )
+ if ( p_filter->input.i_format != VLC_CODEC_FL32
+ || p_filter->output.i_format != VLC_CODEC_S16N )
{
return -1;
}
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
- || p_filter->output.i_format != VLC_FOURCC('s','8',' ',' ') )
+ if ( p_filter->input.i_format != VLC_CODEC_FL32
+ || p_filter->output.i_format != VLC_CODEC_S8 )
{
return -1;
}
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
- || p_filter->output.i_format != AOUT_FMT_U16_NE )
+ if ( p_filter->input.i_format != VLC_CODEC_FL32
+ || p_filter->output.i_format != VLC_CODEC_U16N )
{
return -1;
}
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
- || p_filter->output.i_format != VLC_FOURCC('u','8',' ',' ') )
+ if ( p_filter->input.i_format != VLC_CODEC_FL32
+ || p_filter->output.i_format != VLC_CODEC_U8 )
{
return -1;
}
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( ( p_filter->input.i_format != AOUT_FMT_S16_NE &&
- p_filter->input.i_format != AOUT_FMT_S24_NE &&
- p_filter->input.i_format != AOUT_FMT_S32_NE )
- || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if ( ( p_filter->input.i_format != VLC_CODEC_S16N &&
+ p_filter->input.i_format != VLC_CODEC_S24N &&
+ p_filter->input.i_format != VLC_CODEC_S32N )
+ || p_filter->output.i_format != VLC_CODEC_FL32 )
{
return -1;
}
return -1;
}
- if( p_filter->input.i_format == AOUT_FMT_S32_NE )
+ if( p_filter->input.i_format == VLC_CODEC_S32N )
p_filter->pf_do_work = Do_S32ToFL32;
- else if( p_filter->input.i_format == AOUT_FMT_S24_NE )
+ else if( p_filter->input.i_format == VLC_CODEC_S24N )
p_filter->pf_do_work = Do_S24ToFL32;
else
p_filter->pf_do_work = Do_S16ToFL32;
return -1;
}
- if ( (p_filter->input.i_format == VLC_FOURCC('s','1','6','l') ||
- p_filter->input.i_format == VLC_FOURCC('s','1','6','b'))
- && p_filter->output.i_format == VLC_FOURCC('f','l','3','2')
- && p_filter->input.i_format != AOUT_FMT_S16_NE )
+ if ( (p_filter->input.i_format == VLC_CODEC_S16L ||
+ p_filter->input.i_format == VLC_CODEC_S16B)
+ && p_filter->output.i_format == VLC_CODEC_FL32
+ && p_filter->input.i_format != VLC_CODEC_S16N )
{
p_filter->pf_do_work = Do_S16ToFL32_SW;
p_filter->b_in_place = true;
return 0;
}
- if ( (p_filter->input.i_format == VLC_FOURCC('s','2','4','l') ||
- p_filter->input.i_format == VLC_FOURCC('s','2','4','b'))
- && p_filter->output.i_format == VLC_FOURCC('f','l','3','2')
- && p_filter->input.i_format != AOUT_FMT_S24_NE )
+ if ( (p_filter->input.i_format == VLC_CODEC_S24L ||
+ p_filter->input.i_format == VLC_CODEC_S24B)
+ && p_filter->output.i_format == VLC_CODEC_FL32
+ && p_filter->input.i_format != VLC_CODEC_S24N )
{
p_filter->pf_do_work = Do_S24ToFL32_SW;
p_filter->b_in_place = true;
return 0;
}
- if ( (p_filter->input.i_format == VLC_FOURCC('s','3','2','l') ||
- p_filter->input.i_format == VLC_FOURCC('s','3','2','b'))
- && p_filter->output.i_format == VLC_FOURCC('f','l','3','2')
- && p_filter->input.i_format != AOUT_FMT_S32_NE )
+ if ( (p_filter->input.i_format == VLC_CODEC_S32L ||
+ p_filter->input.i_format == VLC_CODEC_S32B)
+ && p_filter->output.i_format == VLC_CODEC_FL32
+ && p_filter->input.i_format != VLC_CODEC_S32N )
{
p_filter->pf_do_work = Do_S32ToFL32_SW;
p_filter->b_in_place = true;
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( p_filter->input.i_format != VLC_FOURCC('s','8',' ',' ')
- || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if ( p_filter->input.i_format != VLC_CODEC_S8
+ || p_filter->output.i_format != VLC_CODEC_FL32 )
{
return -1;
}
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
- if ( p_filter->input.i_format != VLC_FOURCC('u','8',' ',' ')
- || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if ( p_filter->input.i_format != VLC_CODEC_U8
+ || p_filter->output.i_format != VLC_CODEC_FL32 )
{
return -1;
}
aout_filter_t *p_filter = (aout_filter_t *)p_this;
struct filter_sys_t *p_sys;
- if ( (p_filter->input.i_format != VLC_FOURCC('m','p','g','a')
+ if ( (p_filter->input.i_format != VLC_CODEC_MPGA
&& p_filter->input.i_format != VLC_FOURCC('m','p','g','3'))
- || (p_filter->output.i_format != VLC_FOURCC('f','l','3','2')
- && p_filter->output.i_format != VLC_FOURCC('f','i','3','2')) )
+ || (p_filter->output.i_format != VLC_CODEC_FL32
+ && p_filter->output.i_format != VLC_CODEC_FI32) )
{
return -1;
}
if( p_sys->i_reject_count > 0 )
{
- if( p_filter->output.i_format == VLC_FOURCC('f','l','3','2') )
+ if( p_filter->output.i_format == VLC_CODEC_FL32 )
{
int i;
int i_size = p_out_buf->i_nb_bytes / sizeof(float);
mad_synth_frame( &p_sys->mad_synth, &p_sys->mad_frame );
- if ( p_filter->output.i_format == VLC_FOURCC('f','i','3','2') )
+ if ( p_filter->output.i_format == VLC_CODEC_FI32 )
{
/* Interleave and keep buffers in mad_fixed_t format */
mad_fixed_t * p_samples = (mad_fixed_t *)p_out_buf->p_buffer;
filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys;
- if( p_filter->fmt_in.i_codec != VLC_FOURCC('m','p','g','a') &&
+ if( p_filter->fmt_in.i_codec != VLC_CODEC_MPGA &&
p_filter->fmt_in.i_codec != VLC_FOURCC('m','p','g','3') )
{
return VLC_EGENERIC;
mad_stream_options( &p_sys->mad_stream, MAD_OPTION_IGNORECRC );
if( vlc_CPU() & CPU_CAPABILITY_FPU )
- p_filter->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+ p_filter->fmt_out.i_codec = VLC_CODEC_FL32;
else
- p_filter->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+ p_filter->fmt_out.i_codec = VLC_CODEC_FI32;
p_filter->fmt_out.audio.i_format = p_filter->fmt_out.i_codec;
p_filter->fmt_out.audio.i_bitspersample =
aout_BitsPerSample( p_filter->fmt_out.i_codec );
aout_filter_sys_t *p_sys;
bool b_fit = true;
- if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
- p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+ p_filter->output.i_format != VLC_CODEC_FL32 )
{
b_fit = false;
- p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
- p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+ p_filter->input.i_format = VLC_CODEC_FL32;
+ p_filter->output.i_format = VLC_CODEC_FL32;
msg_Warn( p_filter, "bad input or output format" );
}
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
#include <vlc_block.h>
#include "vlc_filter.h"
-#ifdef WORDS_BIGENDIAN
-# define AOUT_FMT_S24_IE VLC_FOURCC('s','2','4','l')
-# define AOUT_FMT_S16_IE VLC_FOURCC('s','1','6','l')
-# define AOUT_FMT_U16_IE VLC_FOURCC('u','1','6','l')
-#else
-# define AOUT_FMT_S24_IE VLC_FOURCC('s','2','4','b')
-# define AOUT_FMT_S16_IE VLC_FOURCC('s','1','6','b')
-# define AOUT_FMT_U16_IE VLC_FOURCC('u','1','6','b')
-#endif
-
-
/*****************************************************************************
* Local prototypes
*****************************************************************************/
} ConvertTable[] =
{
/* From fl32 */
- { VLC_FOURCC('f','l','3','2'), AOUT_FMT_S24_NE, Float32toS24 },
- { VLC_FOURCC('f','l','3','2'), AOUT_FMT_S16_NE, Float32toS16 },
- { VLC_FOURCC('f','l','3','2'), AOUT_FMT_U16_NE, Float32toU16 },
- { VLC_FOURCC('f','l','3','2'), AOUT_FMT_S24_IE, Float32toS24Invert },
- { VLC_FOURCC('f','l','3','2'), AOUT_FMT_S16_IE, Float32toS16Invert },
- { VLC_FOURCC('f','l','3','2'), AOUT_FMT_U16_IE, Float32toU16Invert },
- { VLC_FOURCC('f','l','3','2'), VLC_FOURCC('s','8',' ',' '), Float32toS8 },
- { VLC_FOURCC('f','l','3','2'), VLC_FOURCC('u','8',' ',' '), Float32toU8 },
+ { VLC_CODEC_FL32, VLC_CODEC_S24N, Float32toS24 },
+ { VLC_CODEC_FL32, VLC_CODEC_S16N, Float32toS16 },
+ { VLC_CODEC_FL32, VLC_CODEC_U16N, Float32toU16 },
+ { VLC_CODEC_FL32, VLC_CODEC_S24I, Float32toS24Invert },
+ { VLC_CODEC_FL32, VLC_CODEC_S16I, Float32toS16Invert },
+ { VLC_CODEC_FL32, VLC_CODEC_U16I, Float32toU16Invert },
+ { VLC_CODEC_FL32, VLC_CODEC_S8, Float32toS8 },
+ { VLC_CODEC_FL32, VLC_CODEC_U8, Float32toU8 },
/* From s24 invert */
- { AOUT_FMT_S24_NE, VLC_FOURCC('f','l','3','2'), S24toFloat32 },
- { AOUT_FMT_S24_NE, AOUT_FMT_S24_IE, Swap24 },
- { AOUT_FMT_S24_NE, AOUT_FMT_S16_NE, S24toS16 },
- { AOUT_FMT_S24_NE, AOUT_FMT_S16_IE, S24toS16Invert },
+ { VLC_CODEC_S24N, VLC_CODEC_FL32, S24toFloat32 },
+ { VLC_CODEC_S24N, VLC_CODEC_S24I, Swap24 },
+ { VLC_CODEC_S24N, VLC_CODEC_S16N, S24toS16 },
+ { VLC_CODEC_S24N, VLC_CODEC_S16I, S24toS16Invert },
/* From s16 */
- { AOUT_FMT_S16_NE, VLC_FOURCC('f','l','3','2'), S16toFloat32 },
- { AOUT_FMT_S16_NE, AOUT_FMT_S24_NE, S16toS24 },
- { AOUT_FMT_S16_NE, AOUT_FMT_S24_IE, S16toS24Invert },
- { AOUT_FMT_S16_NE, AOUT_FMT_S16_IE, Swap16 },
- { AOUT_FMT_S16_NE, AOUT_FMT_U16_IE, S16toU16 },
- { AOUT_FMT_S16_NE, VLC_FOURCC('s','8',' ',' '), S16toS8 },
- { AOUT_FMT_S16_NE, VLC_FOURCC('u','8',' ',' '), S16toU8 },
+ { VLC_CODEC_S16N, VLC_CODEC_FL32, S16toFloat32 },
+ { VLC_CODEC_S16N, VLC_CODEC_S24N, S16toS24 },
+ { VLC_CODEC_S16N, VLC_CODEC_S24I, S16toS24Invert },
+ { VLC_CODEC_S16N, VLC_CODEC_S16I, Swap16 },
+ { VLC_CODEC_S16N, VLC_CODEC_U16I, S16toU16 },
+ { VLC_CODEC_S16N, VLC_CODEC_S8, S16toS8 },
+ { VLC_CODEC_S16N, VLC_CODEC_U8, S16toU8 },
/* From u16 */
- { AOUT_FMT_U16_NE, VLC_FOURCC('f','l','3','2'), U16toFloat32 },
- { AOUT_FMT_U16_NE, AOUT_FMT_U16_IE, Swap16 },
- { AOUT_FMT_U16_NE, AOUT_FMT_S16_IE, U16toS16 },
- { AOUT_FMT_U16_NE, VLC_FOURCC('s','8',' ',' '), U16toS8 },
- { AOUT_FMT_U16_NE, VLC_FOURCC('u','8',' ',' '), U16toU8 },
+ { VLC_CODEC_U16N, VLC_CODEC_FL32, U16toFloat32 },
+ { VLC_CODEC_U16N, VLC_CODEC_U16I, Swap16 },
+ { VLC_CODEC_U16N, VLC_CODEC_S16I, U16toS16 },
+ { VLC_CODEC_U16N, VLC_CODEC_S8, U16toS8 },
+ { VLC_CODEC_U16N, VLC_CODEC_U8, U16toU8 },
/* From s8 */
- { VLC_FOURCC('s','8',' ',' '), VLC_FOURCC('f','l','3','2'), S8toFloat32 },
- { VLC_FOURCC('s','8',' ',' '), AOUT_FMT_S16_NE, S8toS16 },
- { VLC_FOURCC('s','8',' ',' '), AOUT_FMT_S16_IE, S8toS16Invert },
- { VLC_FOURCC('s','8',' ',' '), AOUT_FMT_U16_NE, S8toU16 },
- { VLC_FOURCC('s','8',' ',' '), AOUT_FMT_U16_IE, S8toU16Invert },
- { VLC_FOURCC('s','8',' ',' '), VLC_FOURCC('u','8',' ',' '), S8toU8 },
+ { VLC_CODEC_S8, VLC_CODEC_FL32, S8toFloat32 },
+ { VLC_CODEC_S8, VLC_CODEC_S16N, S8toS16 },
+ { VLC_CODEC_S8, VLC_CODEC_S16I, S8toS16Invert },
+ { VLC_CODEC_S8, VLC_CODEC_U16N, S8toU16 },
+ { VLC_CODEC_S8, VLC_CODEC_U16I, S8toU16Invert },
+ { VLC_CODEC_S8, VLC_CODEC_U8, S8toU8 },
/* From u8 */
- { VLC_FOURCC('u','8',' ',' '), VLC_FOURCC('f','l','3','2'), U8toFloat32 },
- { VLC_FOURCC('u','8',' ',' '), AOUT_FMT_S16_NE, U8toS16 },
- { VLC_FOURCC('u','8',' ',' '), AOUT_FMT_S16_IE, U8toS16Invert },
- { VLC_FOURCC('u','8',' ',' '), AOUT_FMT_U16_NE, U8toU16 },
- { VLC_FOURCC('u','8',' ',' '), AOUT_FMT_U16_IE, U8toU16Invert },
- { VLC_FOURCC('u','8',' ',' '), VLC_FOURCC('s','8',' ',' '), U8toS8 },
+ { VLC_CODEC_U8, VLC_CODEC_FL32, U8toFloat32 },
+ { VLC_CODEC_U8, VLC_CODEC_S16N, U8toS16 },
+ { VLC_CODEC_U8, VLC_CODEC_S16I, U8toS16Invert },
+ { VLC_CODEC_U8, VLC_CODEC_U16N, U8toU16 },
+ { VLC_CODEC_U8, VLC_CODEC_U16I, U8toU16Invert },
+ { VLC_CODEC_U8, VLC_CODEC_S8, U8toS8 },
/* From s24 invert */
- { AOUT_FMT_S24_IE, VLC_FOURCC('f','l','3','2'), S24InverttoFloat32 },
- { AOUT_FMT_S24_IE, AOUT_FMT_S24_NE, Swap24 },
- { AOUT_FMT_S24_IE, AOUT_FMT_S16_NE, S24InverttoS16 },
- { AOUT_FMT_S24_IE, AOUT_FMT_S16_IE, S24InverttoS16Invert },
+ { VLC_CODEC_S24I, VLC_CODEC_FL32, S24InverttoFloat32 },
+ { VLC_CODEC_S24I, VLC_CODEC_S24N, Swap24 },
+ { VLC_CODEC_S24I, VLC_CODEC_S16N, S24InverttoS16 },
+ { VLC_CODEC_S24I, VLC_CODEC_S16I, S24InverttoS16Invert },
/* From s16 invert */
- { AOUT_FMT_S16_IE, VLC_FOURCC('f','l','3','2'), S16InverttoFloat32 },
- { AOUT_FMT_S16_IE, AOUT_FMT_S24_NE, S16InverttoS24 },
- { AOUT_FMT_S16_IE, AOUT_FMT_S24_IE, S16InverttoS24Invert },
- { AOUT_FMT_S16_IE, AOUT_FMT_S16_NE, Swap16 },
- { AOUT_FMT_S16_IE, AOUT_FMT_U16_NE, S16InverttoU16 },
- { AOUT_FMT_S16_IE, VLC_FOURCC('s','8',' ',' '), S16InverttoS8 },
- { AOUT_FMT_S16_IE, VLC_FOURCC('u','8',' ',' '), S16InverttoU8 },
+ { VLC_CODEC_S16I, VLC_CODEC_FL32, S16InverttoFloat32 },
+ { VLC_CODEC_S16I, VLC_CODEC_S24N, S16InverttoS24 },
+ { VLC_CODEC_S16I, VLC_CODEC_S24I, S16InverttoS24Invert },
+ { VLC_CODEC_S16I, VLC_CODEC_S16N, Swap16 },
+ { VLC_CODEC_S16I, VLC_CODEC_U16N, S16InverttoU16 },
+ { VLC_CODEC_S16I, VLC_CODEC_S8, S16InverttoS8 },
+ { VLC_CODEC_S16I, VLC_CODEC_U8, S16InverttoU8 },
/* From u16 invert */
- { AOUT_FMT_U16_IE, VLC_FOURCC('f','l','3','2'), U16InverttoFloat32 },
- { AOUT_FMT_U16_IE, AOUT_FMT_U16_NE, Swap16 },
- { AOUT_FMT_U16_IE, AOUT_FMT_S16_NE, U16InverttoS16 },
- { AOUT_FMT_U16_IE, VLC_FOURCC('s','8',' ',' '), U16InverttoS8 },
- { AOUT_FMT_U16_IE, VLC_FOURCC('u','8',' ',' '), U16InverttoU8 },
+ { VLC_CODEC_U16I, VLC_CODEC_FL32, U16InverttoFloat32 },
+ { VLC_CODEC_U16I, VLC_CODEC_U16N, Swap16 },
+ { VLC_CODEC_U16I, VLC_CODEC_S16N, U16InverttoS16 },
+ { VLC_CODEC_U16I, VLC_CODEC_S8, U16InverttoS8 },
+ { VLC_CODEC_U16I, VLC_CODEC_U8, U16InverttoU8 },
{ 0, 0, NULL },
};
int i_channels;
aout_filter_sys_t *p_sys;
- if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
- p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+ p_filter->output.i_format != VLC_CODEC_FL32 )
{
b_fit = false;
- p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
- p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+ p_filter->input.i_format = VLC_CODEC_FL32;
+ p_filter->output.i_format = VLC_CODEC_FL32;
msg_Warn( p_filter, "bad input or output format" );
}
bool b_fit = true;
int i_samplerate;
- if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
- p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+ p_filter->output.i_format != VLC_CODEC_FL32 )
{
b_fit = false;
- p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
- p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+ p_filter->input.i_format = VLC_CODEC_FL32;
+ p_filter->output.i_format = VLC_CODEC_FL32;
msg_Warn( p_filter, "bad input or output format" );
}
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
!= p_filter->output.i_physical_channels
|| p_filter->input.i_original_channels
!= p_filter->output.i_original_channels
- || p_filter->input.i_format != VLC_FOURCC('f','l','3','2') )
+ || p_filter->input.i_format != VLC_CODEC_FL32 )
{
return VLC_EGENERIC;
}
int i_filter_wing;
if( p_filter->fmt_in.audio.i_rate == p_filter->fmt_out.audio.i_rate ||
- p_filter->fmt_in.i_codec != VLC_FOURCC('f','l','3','2') )
+ p_filter->fmt_in.i_codec != VLC_CODEC_FL32 )
{
return VLC_EGENERIC;
}
!= p_filter->output.i_physical_channels
|| p_filter->input.i_original_channels
!= p_filter->output.i_original_channels
- || p_filter->input.i_format != VLC_FOURCC('f','l','3','2') )
+ || p_filter->input.i_format != VLC_CODEC_FL32 )
{
return VLC_EGENERIC;
}
int i_out_rate = p_filter->fmt_out.audio.i_rate;
if( p_filter->fmt_in.audio.i_rate == p_filter->fmt_out.audio.i_rate ||
- p_filter->fmt_in.i_codec != VLC_FOURCC('f','l','3','2') )
+ p_filter->fmt_in.i_codec != VLC_CODEC_FL32 )
{
return VLC_EGENERIC;
}
!= p_filter->output.i_physical_channels
|| p_filter->input.i_original_channels
!= p_filter->output.i_original_channels
- || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
- && p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
+ || (p_filter->input.i_format != VLC_CODEC_FL32
+ && p_filter->input.i_format != VLC_CODEC_FI32) )
{
return -1;
}
!= p_filter->output.i_physical_channels
|| p_filter->input.i_original_channels
!= p_filter->output.i_original_channels
- || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
- && p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
+ || (p_filter->input.i_format != VLC_CODEC_FL32
+ && p_filter->input.i_format != VLC_CODEC_FI32) )
{
return VLC_EGENERIC;
}
aout_filter_sys_t *p_sys;
bool b_fit = true;
- if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
- p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+ p_filter->output.i_format != VLC_CODEC_FL32 )
{
b_fit = false;
- p_filter->input.i_format = p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+ p_filter->input.i_format = p_filter->output.i_format = VLC_CODEC_FL32;
msg_Warn( p_filter, "bad input or output format" );
}
if( ! AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
bool b_fit = true;
msg_Dbg(p_this, "Opening filter spatializer %s %s %d", __FILE__,__func__,__LINE__);
- if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
- p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+ p_filter->output.i_format != VLC_CODEC_FL32 )
{
b_fit = false;
- p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
- p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+ p_filter->input.i_format = VLC_CODEC_FL32;
+ p_filter->output.i_format = VLC_CODEC_FL32;
msg_Warn( p_filter, "bad input or output format" );
}
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
aout_instance_t * p_aout = (aout_instance_t *)p_this;
- if ( p_aout->mixer.mixer.i_format != VLC_FOURCC('f','l','3','2') )
+ if ( p_aout->mixer.mixer.i_format != VLC_CODEC_FL32 )
{
return -1;
}
{
aout_instance_t * p_aout = (aout_instance_t *)p_this;
- if ( p_aout->mixer.mixer.i_format != VLC_FOURCC('f','l','3','2')
- && p_aout->mixer.mixer.i_format != VLC_FOURCC('f','i','3','2') )
+ if ( p_aout->mixer.mixer.i_format != VLC_CODEC_FL32
+ && p_aout->mixer.mixer.i_format != VLC_CODEC_FI32 )
{
return -1;
}
and float32) */
if( vlc_CPU() & CPU_CAPABILITY_FPU )
{
- i_vlc_pcm_format = VLC_FOURCC('f','l','3','2');
+ i_vlc_pcm_format = VLC_CODEC_FL32;
i_snd_pcm_format = SND_PCM_FORMAT_FLOAT;
}
else
{
- i_vlc_pcm_format = AOUT_FMT_S16_NE;
+ i_vlc_pcm_format = VLC_CODEC_S16N;
i_snd_pcm_format = SND_PCM_FORMAT_S16;
}
i_snd_pcm_format = SND_PCM_FORMAT_S16;
i_channels = 2;
- i_vlc_pcm_format = VLC_FOURCC('s','p','d','i');
+ i_vlc_pcm_format = VLC_CODEC_SPDIFL;
p_aout->output.i_nb_samples = i_period_size = ALSA_SPDIF_PERIOD_SIZE;
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
p_aout->output.output.i_frame_length = A52_FRAME_NB;
goto error;
}
}
- if( i_vlc_pcm_format != VLC_FOURCC('s','p','d','i') )
+ if( i_vlc_pcm_format != VLC_CODEC_SPDIFL )
switch( i_snd_pcm_format )
{
case SND_PCM_FORMAT_FLOAT:
- i_vlc_pcm_format = VLC_FOURCC('f','l','3','2');
+ i_vlc_pcm_format = VLC_CODEC_FL32;
break;
case SND_PCM_FORMAT_S16:
- i_vlc_pcm_format = AOUT_FMT_S16_NE;
+ i_vlc_pcm_format = VLC_CODEC_S16N;
break;
}
p_aout->output.output.i_format = i_vlc_pcm_format;
{
b_retry = true;
i_snd_pcm_format = SND_PCM_FORMAT_S16;
- p_aout->output.output.i_format = AOUT_FMT_S16_NE;
+ p_aout->output.output.i_format = VLC_CODEC_S16N;
msg_Warn( p_aout, "unable to commit hardware configuration "
"with fl32 samples. Retrying with s16l (%s)", snd_strerror( i_snd_rc ) );
}
}
p_buffer = aout_OutputNextBuffer( p_aout, next_date,
- (p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i')) );
+ (p_aout->output.output.i_format == VLC_CODEC_SPDIFL) );
/* Audio output buffer shortage -> stop the fill process and wait */
if( p_buffer == NULL )
DeviceFormat.mFormatID = kAudioFormatLinearPCM;
/* We use float 32. It's the best supported format by both VLC and Coreaudio */
- p_aout->output.output.i_format = VLC_FOURCC( 'f','l','3','2');
+ p_aout->output.output.i_format = VLC_CODEC_FL32;
DeviceFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
DeviceFormat.mBitsPerChannel = 32;
DeviceFormat.mChannelsPerFrame = aout_FormatNbChannels( &p_aout->output.output );
/* Set the format flags */
if( p_sys->stream_format.mFormatFlags & kAudioFormatFlagIsBigEndian )
- p_aout->output.output.i_format = VLC_FOURCC('s','p','d','b');
+ p_aout->output.output.i_format = VLC_CODEC_SPDIFB;
else
- p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
+ p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
p_aout->output.output.i_frame_length = A52_FRAME_NB;
p_aout->output.i_nb_samples = p_aout->output.output.i_frame_length;
/* Open the device */
if( val.i_int == AOUT_VAR_SPDIF )
{
- p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
+ p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
/* Calculate the frame size in bytes */
p_aout->output.i_nb_samples = A52_FRAME_NB;
p_aout->output.p_sys->i_frame_size =
p_aout->output.output.i_bytes_per_frame;
- if( CreateDSBuffer( p_aout, VLC_FOURCC('s','p','d','i'),
+ if( CreateDSBuffer( p_aout, VLC_CODEC_SPDIFL,
p_aout->output.output.i_physical_channels,
aout_FormatNbChannels( &p_aout->output.output ),
p_aout->output.output.i_rate,
/* Test for SPDIF support */
if ( AOUT_FMT_NON_LINEAR( &p_aout->output.output ) )
{
- if( CreateDSBuffer( p_aout, VLC_FOURCC('s','p','d','i'),
+ if( CreateDSBuffer( p_aout, VLC_CODEC_SPDIFL,
p_aout->output.output.i_physical_channels,
aout_FormatNbChannels( &p_aout->output.output ),
p_aout->output.output.i_rate,
switch( i_format )
{
- case VLC_FOURCC('s','p','d','i'):
+ case VLC_CODEC_SPDIFL:
i_nb_channels = 2;
/* To prevent channel re-ordering */
waveformat.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
waveformat.SubFormat = _KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF;
break;
- case VLC_FOURCC('f','l','3','2'):
+ case VLC_CODEC_FL32:
waveformat.Format.wBitsPerSample = sizeof(float) * 8;
waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample;
waveformat.SubFormat = _KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
break;
- case VLC_FOURCC('s','1','6','l'):
+ case VLC_CODEC_S16L:
waveformat.Format.wBitsPerSample = 16;
waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample;
/* Float32 audio samples are not supported for 5.1 output on the emu101k */
if( !var_GetBool( p_aout, "directx-audio-float32" ) ||
i_nb_channels > 2 ||
- CreateDSBuffer( p_aout, VLC_FOURCC('f','l','3','2'),
+ CreateDSBuffer( p_aout, VLC_CODEC_FL32,
i_channels, i_nb_channels, i_rate,
FRAME_SIZE * 4 * i_nb_channels, b_probe )
!= VLC_SUCCESS )
{
- if ( CreateDSBuffer( p_aout, VLC_FOURCC('s','1','6','l'),
+ if ( CreateDSBuffer( p_aout, VLC_CODEC_S16L,
i_channels, i_nb_channels, i_rate,
FRAME_SIZE * 2 * i_nb_channels, b_probe )
!= VLC_SUCCESS )
}
else
{
- *i_format = VLC_FOURCC('s','1','6','l');
+ *i_format = VLC_CODEC_S16L;
return VLC_SUCCESS;
}
}
else
{
- *i_format = VLC_FOURCC('f','l','3','2');
+ *i_format = VLC_CODEC_FL32;
return VLC_SUCCESS;
}
}
int canc = vlc_savecancel ();
/* We don't want any resampling when using S/PDIF output */
- b_sleek = p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i');
+ b_sleek = p_aout->output.output.i_format == VLC_CODEC_SPDIFL;
msg_Dbg( p_notif, "DirectSoundThread ready" );
static const char *const format_list[] = { "u8", "s8", "u16", "s16", "u16_le",
"s16_le", "u16_be", "s16_be", "fixed32",
"float32", "spdif" };
-static const int format_int[] = { VLC_FOURCC('u','8',' ',' '),
- VLC_FOURCC('s','8',' ',' '),
- AOUT_FMT_U16_NE, AOUT_FMT_S16_NE,
- VLC_FOURCC('u','1','6','l'),
- VLC_FOURCC('s','1','6','l'),
- VLC_FOURCC('u','1','6','b'),
- VLC_FOURCC('s','1','6','b'),
- VLC_FOURCC('f','i','3','2'),
- VLC_FOURCC('f','l','3','2'),
- VLC_FOURCC('s','p','i','f') };
+static const int format_int[] = { VLC_CODEC_U8,
+ VLC_CODEC_S8,
+ VLC_CODEC_U16N, VLC_CODEC_S16N,
+ VLC_CODEC_U16L,
+ VLC_CODEC_S16L,
+ VLC_CODEC_U16B,
+ VLC_CODEC_S16B,
+ VLC_CODEC_FI32,
+ VLC_CODEC_FL32,
+ VLC_CODEC_SPDIFL };
#define FILE_TEXT N_("Output file")
#define FILE_LONGTEXT N_("File to which the audio samples will be written to. (\"-\" for stdout")
switch( p_aout->output.output.i_format )
{
- case VLC_FOURCC('f','l','3','2'):
+ case VLC_CODEC_FL32:
wh->Format = WAVE_FORMAT_IEEE_FLOAT;
wh->BitsPerSample = sizeof(float) * 8;
break;
- case VLC_FOURCC('u','8',' ',' '):
+ case VLC_CODEC_U8:
wh->Format = WAVE_FORMAT_PCM;
wh->BitsPerSample = 8;
break;
- case VLC_FOURCC('s','1','6','l'):
+ case VLC_CODEC_S16L:
default:
wh->Format = WAVE_FORMAT_PCM;
wh->BitsPerSample = 16;
}
}
- p_aout->output.output.i_format = AOUT_FMT_S16_NE;
+ p_aout->output.output.i_format = VLC_CODEC_S16N;
p_aout->output.i_nb_samples = FRAME_SIZE;
p_aout->output.output.i_physical_channels
= AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
aout_VolumeSoftInit( p_aout );
/* JACK only supports fl32 format */
- p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2');
+ p_aout->output.output.i_format = VLC_CODEC_FL32;
// TODO add buffer size callback
p_aout->output.i_nb_samples = jack_get_buffer_size( p_sys->p_jack_client );
p_aout->output.output.i_rate = jack_get_sample_rate( p_sys->p_jack_client );
if ( val.i_int == AOUT_VAR_SPDIF )
{
- p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
+ p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
}
else if ( val.i_int == AOUT_VAR_5_1 )
{
- p_aout->output.output.i_format = AOUT_FMT_S16_NE;
+ p_aout->output.output.i_format = VLC_CODEC_S16N;
p_aout->output.output.i_physical_channels
= AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT
}
else if ( val.i_int == AOUT_VAR_2F2R )
{
- p_aout->output.output.i_format = AOUT_FMT_S16_NE;
+ p_aout->output.output.i_format = VLC_CODEC_S16N;
p_aout->output.output.i_physical_channels
= AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
}
else if ( val.i_int == AOUT_VAR_STEREO )
{
- p_aout->output.output.i_format = AOUT_FMT_S16_NE;
+ p_aout->output.output.i_format = VLC_CODEC_S16N;
p_aout->output.output.i_physical_channels
= AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
}
else if ( val.i_int == AOUT_VAR_MONO )
{
- p_aout->output.output.i_format = AOUT_FMT_S16_NE;
+ p_aout->output.output.i_format = VLC_CODEC_S16N;
p_aout->output.output.i_physical_channels = AOUT_CHAN_CENTER;
}
else
return VLC_EGENERIC;
}
- p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
+ p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
p_aout->output.i_nb_samples = A52_FRAME_NB;
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
p_aout->output.output.i_frame_length = A52_FRAME_NB;
switch ( i_format )
{
case AFMT_U8:
- p_aout->output.output.i_format = VLC_FOURCC('u','8',' ',' ');
+ p_aout->output.output.i_format = VLC_CODEC_U8;
break;
case AFMT_S8:
- p_aout->output.output.i_format = VLC_FOURCC('s','8',' ',' ');
+ p_aout->output.output.i_format = VLC_CODEC_S8;
break;
case AFMT_U16_LE:
- p_aout->output.output.i_format = VLC_FOURCC('u','1','6','l');
+ p_aout->output.output.i_format = VLC_CODEC_U16L;
break;
case AFMT_S16_LE:
- p_aout->output.output.i_format = VLC_FOURCC('s','1','6','l');
+ p_aout->output.output.i_format = VLC_CODEC_S16L;
break;
case AFMT_U16_BE:
- p_aout->output.output.i_format = VLC_FOURCC('u','1','6','b');
+ p_aout->output.output.i_format = VLC_CODEC_U16B;
break;
case AFMT_S16_BE:
- p_aout->output.output.i_format = VLC_FOURCC('s','1','6','b');
+ p_aout->output.output.i_format = VLC_CODEC_S16B;
break;
default:
msg_Err( p_aout, "OSS fell back to an unknown format (%d)",
int i_tmp, i_size;
uint8_t * p_bytes;
- if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
+ if ( p_aout->output.output.i_format != VLC_CODEC_SPDIFL )
{
mtime_t buffered = BufferDuration( p_aout );
}
/* Audio format is paFloat32 (always supported by portaudio v19) */
- p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2');
+ p_aout->output.output.i_format = VLC_CODEC_FL32;
return VLC_SUCCESS;
ss.rate = p_aout->output.output.i_rate;
ss.format = PA_SAMPLE_FLOAT32NE;
- p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2');
+ p_aout->output.output.i_format = VLC_CODEC_FL32;
if (!pa_sample_spec_valid(&ss)) {
msg_Err(p_aout,"Invalid sample spec");
switch ( obtained.format )
{
case AUDIO_S16LSB:
- p_aout->output.output.i_format = VLC_FOURCC('s','1','6','l'); break;
+ p_aout->output.output.i_format = VLC_CODEC_S16L; break;
case AUDIO_S16MSB:
- p_aout->output.output.i_format = VLC_FOURCC('s','1','6','b'); break;
+ p_aout->output.output.i_format = VLC_CODEC_S16B; break;
case AUDIO_U16LSB:
- p_aout->output.output.i_format = VLC_FOURCC('u','1','6','l'); break;
+ p_aout->output.output.i_format = VLC_CODEC_U16L; break;
case AUDIO_U16MSB:
- p_aout->output.output.i_format = VLC_FOURCC('u','1','6','b'); break;
+ p_aout->output.output.i_format = VLC_CODEC_U16B; break;
case AUDIO_S8:
- p_aout->output.output.i_format = VLC_FOURCC('s','8',' ',' '); break;
+ p_aout->output.output.i_format = VLC_CODEC_S8; break;
case AUDIO_U8:
- p_aout->output.output.i_format = VLC_FOURCC('u','8',' ',' '); break;
+ p_aout->output.output.i_format = VLC_CODEC_U8; break;
}
/* Volume is entirely done in software. */
aout_VolumeSoftInit( p_aout );
/* Open the device */
if( val.i_int == AOUT_VAR_SPDIF )
{
- p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
+ p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
if( OpenWaveOut( p_aout,
p_aout->output.p_sys->i_wave_device_id,
- VLC_FOURCC('s','p','d','i'),
+ VLC_CODEC_SPDIFL,
p_aout->output.output.i_physical_channels,
aout_FormatNbChannels( &p_aout->output.output ),
p_aout->output.output.i_rate, false )
{
if( OpenWaveOut( p_aout,
p_aout->output.p_sys->i_wave_device_id,
- VLC_FOURCC('s','p','d','i'),
+ VLC_CODEC_SPDIFL,
p_aout->output.output.i_physical_channels,
aout_FormatNbChannels( &p_aout->output.output ),
p_aout->output.output.i_rate, true )
switch( i_format )
{
- case VLC_FOURCC('s','p','d','i'):
+ case VLC_CODEC_SPDIFL:
i_nb_channels = 2;
/* To prevent channel re-ordering */
waveformat.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
waveformat.SubFormat = __KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF;
break;
- case VLC_FOURCC('f','l','3','2'):
+ case VLC_CODEC_FL32:
waveformat.Format.wBitsPerSample = sizeof(float) * 8;
waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample;
waveformat.SubFormat = __KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
break;
- case VLC_FOURCC('s','1','6','l'):
+ case VLC_CODEC_S16L:
waveformat.Format.wBitsPerSample = 16;
waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample;
{
bool b_use_float32 = var_CreateGetBool( p_aout, "waveout-float32");
- if( !b_use_float32 || OpenWaveOut( p_aout, i_device_id, VLC_FOURCC('f','l','3','2'),
+ if( !b_use_float32 || OpenWaveOut( p_aout, i_device_id, VLC_CODEC_FL32,
i_channels, i_nb_channels, i_rate, b_probe )
!= VLC_SUCCESS )
{
- if ( OpenWaveOut( p_aout, i_device_id, VLC_FOURCC('s','1','6','l'),
+ if ( OpenWaveOut( p_aout, i_device_id, VLC_CODEC_S16L,
i_channels, i_nb_channels, i_rate, b_probe )
!= VLC_SUCCESS )
{
}
else
{
- *i_format = VLC_FOURCC('s','1','6','l');
+ *i_format = VLC_CODEC_S16L;
return VLC_SUCCESS;
}
}
else
{
- *i_format = VLC_FOURCC('f','l','3','2');
+ *i_format = VLC_CODEC_FL32;
return VLC_SUCCESS;
}
}
int canc = vlc_savecancel ();
/* We don't want any resampling when using S/PDIF */
- b_sleek = p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i');
+ b_sleek = p_aout->output.output.i_format == VLC_CODEC_SPDIFL;
// wait for first call to "play()"
while( !p_sys->start_date && vlc_object_alive (p_aout) )
switch( p_dec->fmt_in.i_codec )
{
- case VLC_FOURCC('a','5','2',' '):
- case VLC_FOURCC('a','5','2','b'):
- i_codec = VLC_FOURCC('a','5','2',' ');
+ case VLC_CODEC_A52:
+ i_codec = VLC_CODEC_A52;
break;
- case VLC_FOURCC('e','a','c','3'):
+ case VLC_CODEC_EAC3:
/* XXX ugly hack, a52 does not support eac3 so no eac3 pass-through
* support */
if( !b_packetizer )
return VLC_EGENERIC;
- i_codec = VLC_FOURCC('e','a','c','3');
+ i_codec = VLC_CODEC_EAC3;
break;
default:
return VLC_EGENERIC;
p_sys->i_samplesperblock );
p_dec->fmt_out.i_cat = AUDIO_ES;
- p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
p_dec->fmt_out.audio.i_rate = p_dec->fmt_in.audio.i_rate;
p_dec->fmt_out.audio.i_channels = p_dec->fmt_in.audio.i_channels;
p_dec->fmt_out.audio.i_physical_channels =
{
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('a','e','s','3') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_302M )
return VLC_EGENERIC;
/* Allocate the memory needed to store the decoder's structure */
/* Set callback */
if( b_packetizer )
{
- p_dec->fmt_out.i_codec = VLC_FOURCC('a','e','s','3');
+ p_dec->fmt_out.i_codec = VLC_CODEC_302M;
p_dec->pf_decode_audio = NULL;
p_dec->pf_packetize = Packetize;
}
else
{
- p_dec->fmt_out.i_codec = i_bits == 16 ? VLC_FOURCC('s','1','6','l') : VLC_FOURCC('s','2','4','l');
+ p_dec->fmt_out.i_codec = i_bits == 16 ? VLC_CODEC_S16L : VLC_CODEC_S24L;
p_dec->fmt_out.audio.i_bitspersample = i_bits == 16 ? 16 : 24;
}
/* _signed_ little endian samples (mov)*/
case VLC_FOURCC('s','o','w','t'):
- case VLC_FOURCC('a','l','a','w'):
- case VLC_FOURCC('u','l','a','w'):
- case VLC_FOURCC('m','l','a','w'):
-
- case VLC_FOURCC('f','l','6','4'):
- case VLC_FOURCC('f','l','3','2'):
- case VLC_FOURCC('s','3','2','l'):
- case VLC_FOURCC('s','3','2','b'):
- case VLC_FOURCC('s','2','4','l'):
- case VLC_FOURCC('s','2','4','b'):
- case VLC_FOURCC('s','1','6','l'):
- case VLC_FOURCC('s','1','6','b'):
- case VLC_FOURCC('s','8',' ',' '):
- case VLC_FOURCC('u','8',' ',' '):
- case VLC_FOURCC('i','n','2','4'): /* Quicktime in24, bigendian int24 */
- case VLC_FOURCC('4','2','n','i'): /* Quicktime in24, little-endian int24 */
- case VLC_FOURCC('i','n','3','2'): /* Quicktime in32, bigendian int32 */
+ case VLC_CODEC_ALAW:
+ case VLC_CODEC_MULAW:
+
+ case VLC_CODEC_FL64:
+ case VLC_CODEC_FL32:
+ case VLC_CODEC_S32L:
+ case VLC_CODEC_S32B:
+ case VLC_CODEC_S24L:
+ case VLC_CODEC_S24B:
+ case VLC_CODEC_S16L:
+ case VLC_CODEC_S16B:
+ case VLC_CODEC_S8:
+ case VLC_CODEC_U8:
break;
default:
p_dec->fmt_in.audio.i_rate, p_dec->fmt_in.audio.i_channels,
p_dec->fmt_in.audio.i_bitspersample );
- if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'f', 'l', '6', '4' ) )
+ if( p_dec->fmt_in.i_codec == VLC_CODEC_FL64 )
{
p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
p_dec->fmt_in.audio.i_bitspersample = 64;
}
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'f', 'l', '3', '2' ) )
+ else if( p_dec->fmt_in.i_codec == VLC_CODEC_FL32 )
{
p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
p_dec->fmt_in.audio.i_bitspersample = 32;
}
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '3', '2', 'l' ) ||
- p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '3', '2', 'b' ) )
+ else if( p_dec->fmt_in.i_codec == VLC_CODEC_S32L ||
+ p_dec->fmt_in.i_codec == VLC_CODEC_S32B )
{
p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
p_dec->fmt_in.audio.i_bitspersample = 32;
}
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'i', 'n', '3', '2' ) )
- {
- /* FIXME: mplayer uses bigendian for in24 .... but here it works
- * with little endian ... weird */
- p_dec->fmt_out.i_codec = VLC_FOURCC( 's', '3', '2', 'l' );
- p_dec->fmt_in.audio.i_bitspersample = 32;
- }
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '2', '4', 'l' ) ||
- p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '2', '4', 'b' ) )
+ else if( p_dec->fmt_in.i_codec == VLC_CODEC_S24L ||
+ p_dec->fmt_in.i_codec == VLC_CODEC_S24B )
{
p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
p_dec->fmt_in.audio.i_bitspersample = 24;
}
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'i', 'n', '2', '4' ) )
- {
- p_dec->fmt_out.i_codec = VLC_FOURCC( 's', '2', '4', 'b' );
- p_dec->fmt_in.audio.i_bitspersample = 24;
- }
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( '4', '2', 'n', 'i' ) )
- {
- p_dec->fmt_out.i_codec = VLC_FOURCC( 's', '2', '4', 'l' );
- p_dec->fmt_in.audio.i_bitspersample = 24;
- }
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '1', '6', 'l' ) ||
- p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '1', '6', 'b' ) )
+ else if( p_dec->fmt_in.i_codec == VLC_CODEC_S16L ||
+ p_dec->fmt_in.i_codec == VLC_CODEC_S16B )
{
p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
p_dec->fmt_in.audio.i_bitspersample = 16;
}
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '8', ' ', ' ' ) ||
- p_dec->fmt_in.i_codec == VLC_FOURCC( 'u', '8', ' ', ' ' ) )
+ else if( p_dec->fmt_in.i_codec == VLC_CODEC_S8 ||
+ p_dec->fmt_in.i_codec == VLC_CODEC_U8 )
{
p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
p_dec->fmt_in.audio.i_bitspersample = 8;
}
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'f', 'l', 't' ) )
+ else if( p_dec->fmt_in.i_codec == VLC_CODEC_ALAW )
{
- switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
- {
- case 4:
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
- break;
- case 8:
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','6','4');
- break;
- default:
- msg_Err( p_dec, "bad parameters(bits/sample)" );
- return VLC_EGENERIC;
- }
- }
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'r', 'a', 'w' ) ||
- p_dec->fmt_in.i_codec == VLC_FOURCC( 'p', 'c', 'm', ' ' ) )
- {
- switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
- {
- case 1:
- p_dec->fmt_out.i_codec = VLC_FOURCC('u','8',' ',' ');
- break;
- case 2:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','l');
- break;
- case 3:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','l');
- break;
- case 4:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','3','2','l');
- break;
- default:
- msg_Err( p_dec, "bad parameters(bits/sample)" );
- return VLC_EGENERIC;
- }
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
+ p_sys->p_logtos16 = alawtos16;
+ p_dec->fmt_in.audio.i_bitspersample = 8;
}
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 't', 'w', 'o', 's' ) )
+ else if( p_dec->fmt_in.i_codec == VLC_CODEC_MULAW )
{
- switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
- {
- case 1:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','8',' ',' ');
- break;
- case 2:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','b');
- break;
- case 3:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','b');
- break;
- case 4:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','3','2','b');
- break;
- default:
- msg_Err( p_dec, "bad parameters(bits/sample)" );
- return VLC_EGENERIC;
- }
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
+ p_sys->p_logtos16 = ulawtos16;
+ p_dec->fmt_in.audio.i_bitspersample = 8;
}
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 's', 'o', 'w', 't' ) )
+ else
{
- switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
+ p_dec->fmt_out.i_codec =
+ vlc_fourcc_GetCodecAudio( p_dec->fmt_in.i_codec,
+ p_dec->fmt_in.audio.i_bitspersample );
+ if( !p_dec->fmt_out.i_codec )
{
- case 1:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','8',' ',' ');
- break;
- case 2:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','l');
- break;
- case 3:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','l');
- break;
- case 4:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','3','2','l');
- break;
- default:
msg_Err( p_dec, "bad parameters(bits/sample)" );
return VLC_EGENERIC;
}
}
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'l', 'a', 'w' ) )
- {
- p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
- p_sys->p_logtos16 = alawtos16;
- p_dec->fmt_in.audio.i_bitspersample = 8;
- }
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'u', 'l', 'a', 'w' ) ||
- p_dec->fmt_in.i_codec == VLC_FOURCC( 'm', 'l', 'a', 'w' ) )
- {
- p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
- p_sys->p_logtos16 = ulawtos16;
- p_dec->fmt_in.audio.i_bitspersample = 8;
- }
- else return VLC_EGENERIC;
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.audio.i_original_channels =
p_dec->fmt_in.audio.i_original_channels;
- if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'l', 'a', 'w' ) ||
- p_dec->fmt_in.i_codec == VLC_FOURCC( 'u', 'l', 'a', 'w' ) ||
- p_dec->fmt_in.i_codec == VLC_FOURCC( 'm', 'l', 'a', 'w' ) )
+ if( p_dec->fmt_in.i_codec == VLC_CODEC_ALAW ||
+ p_dec->fmt_in.i_codec == VLC_CODEC_MULAW )
{
p_dec->fmt_out.audio.i_bitspersample = 16;
}
encoder_t *p_enc = (encoder_t *)p_this;
encoder_sys_t *p_sys;
- if( p_enc->fmt_out.i_codec == VLC_FOURCC('u','8',' ',' ') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('s','8',' ',' ') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('a','l','a','w') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('u','l','a','w') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('m','l','a','w'))
+ if( p_enc->fmt_out.i_codec == VLC_CODEC_U8 ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_S8 ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_ALAW ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_MULAW)
{
p_enc->fmt_out.audio.i_bitspersample = 8;
}
- else if( p_enc->fmt_out.i_codec == VLC_FOURCC('u','1','6','l') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('u','1','6','b') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('s','1','6','l') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('s','1','6','b') )
+ else if( p_enc->fmt_out.i_codec == VLC_CODEC_U16L ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_U16B ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_S16L ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_S16B )
{
p_enc->fmt_out.audio.i_bitspersample = 16;
}
- else if( p_enc->fmt_out.i_codec == VLC_FOURCC('u','2','4','l') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('u','2','4','b') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('s','2','4','l') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('s','2','4','b') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('i','n','2','4') )
+ else if( p_enc->fmt_out.i_codec == VLC_CODEC_U24L ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_U24B ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_S24L ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_S24B )
{
p_enc->fmt_out.audio.i_bitspersample = 24;
}
- else if( p_enc->fmt_out.i_codec == VLC_FOURCC('u','3','2','l') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('u','3','2','b') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('s','3','2','l') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('s','3','2','b') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('i','n','3','2') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('f','i','3','2') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('f','l','3','2') )
+ else if( p_enc->fmt_out.i_codec == VLC_CODEC_U32L ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_U32B ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_S32L ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_S32B ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_FI32 ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_FL32 )
{
p_enc->fmt_out.audio.i_bitspersample = 32;
}
- else if( p_enc->fmt_out.i_codec == VLC_FOURCC('f','l','6','4') )
+ else if( p_enc->fmt_out.i_codec == VLC_CODEC_FL64 )
{
p_enc->fmt_out.audio.i_bitspersample = 64;
}
p_enc->fmt_in.i_codec = p_enc->fmt_out.i_codec;
p_sys->i_s16tolog = 0;
- if( p_enc->fmt_out.i_codec == VLC_FOURCC( 'a', 'l', 'a', 'w' ))
+ if( p_enc->fmt_out.i_codec == VLC_CODEC_ALAW)
{
p_enc->fmt_in.audio.i_bitspersample = 16;
- p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
+ p_enc->fmt_in.i_codec = VLC_CODEC_S16N;
p_sys->i_s16tolog = ALAW;
}
- else if( p_enc->fmt_out.i_codec == VLC_FOURCC( 'u', 'l', 'a', 'w' ) ||
- p_enc->fmt_out.i_codec == VLC_FOURCC( 'm', 'l', 'a', 'w' ) )
+ else if( p_enc->fmt_out.i_codec == VLC_CODEC_MULAW )
{
p_enc->fmt_in.audio.i_bitspersample = 16;
- p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
+ p_enc->fmt_in.i_codec = VLC_CODEC_S16N;
p_sys->i_s16tolog = ULAW;
}
int i_offset;
int i_size;
- if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'f', 'l', 'a', 'c' ) )
+ if( p_dec->fmt_in.i_codec == VLC_CODEC_FLAC )
{
i_offset = 8;
i_size = p_dec->fmt_in.i_extra - 8;
}
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'l', 'a', 'c' ) )
+ else if( p_dec->fmt_in.i_codec == VLC_CODEC_ALAC )
{
static const uint8_t p_pattern[] = { 0, 0, 0, 36, 'a', 'l', 'a', 'c' };
/* Find alac atom XXX it is a bit ugly */
switch( p_sys->p_context->sample_fmt )
{
case SAMPLE_FMT_U8:
- p_dec->fmt_out.i_codec = VLC_FOURCC('u','8',' ',' ');
+ p_dec->fmt_out.i_codec = VLC_CODEC_U8;
p_dec->fmt_out.audio.i_bitspersample = 8;
break;
case SAMPLE_FMT_S32:
- p_dec->fmt_out.i_codec = AOUT_FMT_S32_NE;
+ p_dec->fmt_out.i_codec = VLC_CODEC_S32N;
p_dec->fmt_out.audio.i_bitspersample = 32;
break;
case SAMPLE_FMT_FLT:
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
p_dec->fmt_out.audio.i_bitspersample = 32;
break;
case SAMPLE_FMT_DBL:
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','6','4');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FL64;
p_dec->fmt_out.audio.i_bitspersample = 64;
break;
case SAMPLE_FMT_S16:
default:
- p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
p_dec->fmt_out.audio.i_bitspersample = 16;
break;
}
#else
- p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
p_dec->fmt_out.audio.i_bitspersample = 16;
#endif
p_dec->fmt_out.audio.i_rate = p_sys->p_context->sample_rate;
} chroma_table[] =
{
/* Planar YUV formats */
- {VLC_FOURCC('I','4','4','4'), PIX_FMT_YUV444P, 0, 0, 0 },
- {VLC_FOURCC('J','4','4','4'), PIX_FMT_YUVJ444P, 0, 0, 0 },
+ {VLC_CODEC_I444, PIX_FMT_YUV444P, 0, 0, 0 },
+ {VLC_CODEC_J444, PIX_FMT_YUVJ444P, 0, 0, 0 },
#if LIBAVUTIL_VERSION_INT >= ((49<<16)+(5<<8)+0)
- {VLC_FOURCC('I','4','4','0'), PIX_FMT_YUV440P, 0, 0, 0 },
- {VLC_FOURCC('J','4','4','0'), PIX_FMT_YUVJ440P, 0, 0, 0 },
+ {VLC_CODEC_I440, PIX_FMT_YUV440P, 0, 0, 0 },
+ {VLC_CODEC_J440, PIX_FMT_YUVJ440P, 0, 0, 0 },
#endif
- {VLC_FOURCC('I','4','2','2'), PIX_FMT_YUV422P, 0, 0, 0 },
- {VLC_FOURCC('J','4','2','2'), PIX_FMT_YUVJ422P, 0, 0, 0 },
+ {VLC_CODEC_I422, PIX_FMT_YUV422P, 0, 0, 0 },
+ {VLC_CODEC_J422, PIX_FMT_YUVJ422P, 0, 0, 0 },
- {VLC_FOURCC('I','4','2','0'), PIX_FMT_YUV420P, 0, 0, 0 },
- {VLC_FOURCC('Y','V','1','2'), PIX_FMT_YUV420P, 0, 0, 0 },
+ {VLC_CODEC_I420, PIX_FMT_YUV420P, 0, 0, 0 },
+ {VLC_CODEC_YV12, PIX_FMT_YUV420P, 0, 0, 0 },
{VLC_FOURCC('I','Y','U','V'), PIX_FMT_YUV420P, 0, 0, 0 },
- {VLC_FOURCC('J','4','2','0'), PIX_FMT_YUVJ420P, 0, 0, 0 },
- {VLC_FOURCC('I','4','1','1'), PIX_FMT_YUV411P, 0, 0, 0 },
- {VLC_FOURCC('I','4','1','0'), PIX_FMT_YUV410P, 0, 0, 0 },
+ {VLC_CODEC_J420, PIX_FMT_YUVJ420P, 0, 0, 0 },
+ {VLC_CODEC_I411, PIX_FMT_YUV411P, 0, 0, 0 },
+ {VLC_CODEC_I410, PIX_FMT_YUV410P, 0, 0, 0 },
{VLC_FOURCC('Y','V','U','9'), PIX_FMT_YUV410P, 0, 0, 0 },
{VLC_FOURCC('N','V','1','2'), PIX_FMT_NV12, 0, 0, 0 },
{VLC_FOURCC('N','V','2','1'), PIX_FMT_NV21, 0, 0, 0 },
/* Packed YUV formats */
- {VLC_FOURCC('Y','U','Y','2'), PIX_FMT_YUYV422, 0, 0, 0 },
+ {VLC_CODEC_YUYV, PIX_FMT_YUYV422, 0, 0, 0 },
{VLC_FOURCC('Y','U','Y','V'), PIX_FMT_YUYV422, 0, 0, 0 },
- {VLC_FOURCC('U','Y','V','Y'), PIX_FMT_UYVY422, 0, 0, 0 },
+ {VLC_CODEC_UYVY, PIX_FMT_UYVY422, 0, 0, 0 },
{VLC_FOURCC('Y','4','1','1'), PIX_FMT_UYYVYY411, 0, 0, 0 },
/* Packed RGB formats */
VLC_RGB( VLC_FOURCC('R','G','B','4'), PIX_FMT_RGB4, PIX_FMT_BGR4, 0x10, 0x06, 0x01 )
VLC_RGB( VLC_FOURCC('R','G','B','8'), PIX_FMT_RGB8, PIX_FMT_BGR8, 0xC0, 0x38, 0x07 )
- VLC_RGB( VLC_FOURCC('R','V','1','5'), PIX_FMT_BGR555, PIX_FMT_RGB555, 0x7c00, 0x03e0, 0x001f )
- VLC_RGB( VLC_FOURCC('R','V','1','6'), PIX_FMT_BGR565, PIX_FMT_RGB565, 0xf800, 0x07e0, 0x001f )
- VLC_RGB( VLC_FOURCC('R','V','2','4'), PIX_FMT_BGR24, PIX_FMT_RGB24, 0xff0000, 0x00ff00, 0x0000ff )
+ VLC_RGB( VLC_CODEC_RGB15, PIX_FMT_BGR555, PIX_FMT_RGB555, 0x7c00, 0x03e0, 0x001f )
+ VLC_RGB( VLC_CODEC_RGB16, PIX_FMT_BGR565, PIX_FMT_RGB565, 0xf800, 0x07e0, 0x001f )
+ VLC_RGB( VLC_CODEC_RGB24, PIX_FMT_BGR24, PIX_FMT_RGB24, 0xff0000, 0x00ff00, 0x0000ff )
- VLC_RGB( VLC_FOURCC('R','V','3','2'), PIX_FMT_RGB32, PIX_FMT_BGR32, 0x00ff0000, 0x0000ff00, 0x000000ff )
- VLC_RGB( VLC_FOURCC('R','V','3','2'), PIX_FMT_RGB32_1, PIX_FMT_BGR32_1, 0xff000000, 0x00ff0000, 0x0000ff00 )
+ VLC_RGB( VLC_CODEC_RGB32, PIX_FMT_RGB32, PIX_FMT_BGR32, 0x00ff0000, 0x0000ff00, 0x000000ff )
+ VLC_RGB( VLC_CODEC_RGB32, PIX_FMT_RGB32_1, PIX_FMT_BGR32_1, 0xff000000, 0x00ff0000, 0x0000ff00 )
#if defined(PIX_FMT_RGBA)
- {VLC_FOURCC('R','G','B','A'), PIX_FMT_RGBA, 0xff000000, 0x00ff0000, 0x0000ff00},
+ {VLC_CODEC_RGBA, PIX_FMT_RGBA, 0xff000000, 0x00ff0000, 0x0000ff00},
#endif
- {VLC_FOURCC('G','R','E','Y'), PIX_FMT_GRAY8, 0, 0, 0},
+ {VLC_CODEC_GREY, PIX_FMT_GRAY8, 0, 0, 0},
/* Paletized RGB */
- {VLC_FOURCC('R','G','B','P'), PIX_FMT_PAL8, 0, 0, 0},
+ {VLC_CODEC_RGBP, PIX_FMT_PAL8, 0, 0, 0},
{ 0, 0, 0, 0, 0 }
#include <vlc_common.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#include <vlc_filter.h>
/* ffmpeg header */
#endif
#include <vlc_common.h>
-#include <vlc_vout.h>
#include <vlc_aout.h>
#include <vlc_sout.h>
#include <vlc_codec.h>
__MAX( __MIN( p_sys->i_b_frames, FF_MAX_B_FRAMES ), 0 );
p_context->b_frame_strategy = 0;
if( !p_context->max_b_frames &&
- ( p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '2', 'v') ||
- p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '1', 'v') ) )
+ ( p_enc->fmt_out.i_codec == VLC_CODEC_MPGV ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_MP2V ||
+ p_enc->fmt_out.i_codec == VLC_CODEC_MP1V ) )
p_context->flags |= CODEC_FLAG_LOW_DELAY;
av_reduce( &i_aspect_num, &i_aspect_den,
p_sys->i_buffer_out = FF_MIN_BUFFER_SIZE;
p_sys->p_buffer_out = malloc( p_sys->i_buffer_out );
- p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
+ p_enc->fmt_in.i_codec = VLC_CODEC_I420;
p_enc->fmt_in.video.i_chroma = p_enc->fmt_in.i_codec;
GetFfmpegChroma( &p_context->pix_fmt, p_enc->fmt_in.video );
if( i_codec_id == CODEC_ID_MP3 && p_enc->fmt_in.audio.i_channels > 2 )
p_enc->fmt_in.audio.i_channels = 2;
- p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
+ p_enc->fmt_in.i_codec = VLC_CODEC_S16N;
p_context->sample_rate = p_enc->fmt_out.audio.i_rate;
p_context->channels = p_enc->fmt_out.audio.i_channels;
- if ( p_enc->fmt_out.i_codec == VLC_FOURCC('m','p','4','a') )
+ if ( p_enc->fmt_out.i_codec == VLC_CODEC_MP4A )
{
/* XXX: FAAC does resample only when setting the INPUT samplerate
* to the desired value (-R option of the faac frontend)
frame.top_field_first = !!p_pict->b_top_field_first;
/* Set the pts of the frame being encoded (segfaults with mpeg4!)*/
- if( p_enc->fmt_out.i_codec != VLC_FOURCC( 'm', 'p', '4', 'v' ) )
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_MP4V )
{
frame.pts = p_pict->date ? p_pict->date : (int64_t)AV_NOPTS_VALUE;
vlc_fourcc_t i_fourcc;
int i_codec;
int i_cat;
- const char psz_name[36];
} codecs_table[] =
{
/*
* Video Codecs
*/
- /* MPEG-1 Video */
- { VLC_FOURCC('m','p','1','v'), CODEC_ID_MPEG1VIDEO,
- VIDEO_ES, "MPEG-1 Video" },
- { VLC_FOURCC('m','p','e','g'), CODEC_ID_MPEG1VIDEO,
- VIDEO_ES, "MPEG-1 Video" },
- { VLC_FOURCC('m','p','g','1'), CODEC_ID_MPEG1VIDEO,
- VIDEO_ES, "MPEG-1 Video" },
- { VLC_FOURCC('P','I','M','1'), CODEC_ID_MPEG1VIDEO,
- VIDEO_ES, "Pinnacle DC1000 (MPEG-1 Video)" },
-
- /* MPEG-2 Video */
- { VLC_FOURCC('m','p','2','v'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "MPEG-2 Video" },
- { VLC_FOURCC('M','P','E','G'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "MPEG-2 Video" },
- { VLC_FOURCC('m','p','g','v'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "MPEG-2 Video" },
- { VLC_FOURCC('m','p','g','2'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "MPEG-2 Video" },
- { VLC_FOURCC('h','d','v','1'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "HDV 720p30 (MPEG-2 Video)" },
- { VLC_FOURCC('h','d','v','2'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "Sony HDV (MPEG-2 Video)" },
- { VLC_FOURCC('h','d','v','3'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "FCP HDV (MPEG-2 Video)" },
- { VLC_FOURCC('h','d','v','5'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "HDV 720p25 (MPEG-2 Video)" },
- { VLC_FOURCC('h','d','v','6'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "HDV 1080p24 (MPEG-2 Video)" },
- { VLC_FOURCC('h','d','v','7'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "HDV 1080p25 (MPEG-2 Video)" },
- { VLC_FOURCC('h','d','v','8'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "HDV 1080p30 (MPEG-2 Video)" },
-
- { VLC_FOURCC('m','x','5','n'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "MPEG2 IMX NTSC 525/60 50mb/s (FCP)" },
- { VLC_FOURCC('m','x','5','p'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "MPEG2 IMX PAL 625/60 50mb/s (FCP)" },
- { VLC_FOURCC('m','x','4','n'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "MPEG2 IMX NTSC 525/60 40mb/s (FCP)" },
- { VLC_FOURCC('m','x','4','p'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "MPEG2 IMX PAL 625/50 40mb/s (FCP)" },
- { VLC_FOURCC('m','x','3','n'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "MPEG2 IMX NTSC 525/60 30mb/s (FCP)" },
- { VLC_FOURCC('m','x','3','p'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "MPEG2 IMX NTSC 625/50 30mb/s (FCP)" },
- { VLC_FOURCC('x','d','v','2'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "XDCAM HD 1080i60" },
- { VLC_FOURCC('A','V','m','p'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "AVID IMX PAL" },
- /* ATI VCR2 */
- { VLC_FOURCC('V','C','R','2'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "ATI VCR2 Video" },
- { VLC_FOURCC('M','M','E','S'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "Matrox MPEG-2" },
- { VLC_FOURCC('m','m','e','s'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "Matrox MPEG-2" },
- { VLC_FOURCC('P','I','M','2'), CODEC_ID_MPEG2VIDEO,
- VIDEO_ES, "Pinnacle DC1000 (MPEG-2 Video)" },
-
- /* MPEG-4 Video */
- { VLC_FOURCC('D','I','V','X'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('d','i','v','x'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('M','P','4','S'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('m','p','4','s'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('M','4','S','2'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('m','4','s','2'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- /* XVID flavours */
- { VLC_FOURCC('x','v','i','d'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('X','V','I','D'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('X','v','i','D'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('X','V','I','X'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('x','v','i','x'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- /* DX50 */
- { VLC_FOURCC('D','X','5','0'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('d','x','5','0'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('B','L','Z','0'), CODEC_ID_MPEG4,
- VIDEO_ES, "Blizzard MPEG-4 Video" },
- { VLC_FOURCC('D','X','G','M'), CODEC_ID_MPEG4,
- VIDEO_ES, "Electronic Arts Game MPEG-4 Video" },
- { VLC_FOURCC('m','p','4','v'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('M','P','4','V'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC( 4, 0, 0, 0 ), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('m','4','c','c'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('M','4','C','C'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('F','M','P','4'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('f','m','p','4'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
+ { VLC_CODEC_MPGV, CODEC_ID_MPEG2VIDEO, VIDEO_ES },
+
+ { VLC_CODEC_MP4V, CODEC_ID_MPEG4, VIDEO_ES },
/* 3ivx delta 3.5 Unsupported
* putting it here gives extreme distorted images
- { VLC_FOURCC('3','I','V','1'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('3','i','v','1'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" }, */
- /* 3ivx delta 4 */
- { VLC_FOURCC('3','I','V','2'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('3','i','v','2'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('U','M','P','4'), CODEC_ID_MPEG4,
- VIDEO_ES, "UB MPEG-4 Video" },
- { VLC_FOURCC('W','V','1','F'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('S','E','D','G'), CODEC_ID_MPEG4,
- VIDEO_ES, "Samsung MPEG-4 Video" },
- { VLC_FOURCC('R','M','P','4'), CODEC_ID_MPEG4,
- VIDEO_ES, "REALmagic MPEG-4 Video" },
- { VLC_FOURCC('H','D','X','4'), CODEC_ID_MPEG4,
- VIDEO_ES, "Jomigo HDX4 (MPEG-4 Video)" },
- { VLC_FOURCC('h','d','x','4'), CODEC_ID_MPEG4,
- VIDEO_ES, "Jomigo HDX4 (MPEG-4 Video)" },
- { VLC_FOURCC('S','M','P','4'), CODEC_ID_MPEG4,
- VIDEO_ES, "Samsung SMP4 (MPEG-4 Video)" },
- { VLC_FOURCC('s','m','p','4'), CODEC_ID_MPEG4,
- VIDEO_ES, "Samsung SMP4 (MPEG-4 Video)" },
- { VLC_FOURCC('f','v','f','w'), CODEC_ID_MPEG4,
- VIDEO_ES, "FFmpeg MPEG-4" },
- { VLC_FOURCC('F','V','F','W'), CODEC_ID_MPEG4,
- VIDEO_ES, "FFmpeg MPEG-4" },
- { VLC_FOURCC('F','F','D','S'), CODEC_ID_MPEG4,
- VIDEO_ES, "FFDShow MPEG-4" },
- { VLC_FOURCC('V','I','D','M'), CODEC_ID_MPEG4,
- VIDEO_ES, "vidm 4.01 codec" },
- { VLC_FOURCC('D','C','O','D'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('f','m','p','4'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('M','V','X','M'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('P','M','4','V'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('f','m','p','4'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('M','4','T','3'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('G','E','O','X'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('D','M','K','2'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('D','I','G','I'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('I','N','M','C'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('S','N','4','0'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
- { VLC_FOURCC('E','P','H','V'), CODEC_ID_MPEG4,
- VIDEO_ES, "MPEG-4 Video" },
-
- /* MSMPEG4 v1 */
- { VLC_FOURCC('D','I','V','1'), CODEC_ID_MSMPEG4V1,
- VIDEO_ES, "MS MPEG-4 Video v1" },
- { VLC_FOURCC('d','i','v','1'), CODEC_ID_MSMPEG4V1,
- VIDEO_ES, "MS MPEG-4 Video v1" },
- { VLC_FOURCC('M','P','G','4'), CODEC_ID_MSMPEG4V1,
- VIDEO_ES, "MS MPEG-4 Video v1" },
- { VLC_FOURCC('m','p','g','4'), CODEC_ID_MSMPEG4V1,
- VIDEO_ES, "MS MPEG-4 Video v1" },
- { VLC_FOURCC('m','p','4','1'), CODEC_ID_MSMPEG4V1,
- VIDEO_ES, "MS MPEG-4 Video v1" },
-
- /* MSMPEG4 v2 */
- { VLC_FOURCC('D','I','V','2'), CODEC_ID_MSMPEG4V2,
- VIDEO_ES, "MS MPEG-4 Video v2" },
- { VLC_FOURCC('d','i','v','2'), CODEC_ID_MSMPEG4V2,
- VIDEO_ES, "MS MPEG-4 Video v2" },
- { VLC_FOURCC('M','P','4','2'), CODEC_ID_MSMPEG4V2,
- VIDEO_ES, "MS MPEG-4 Video v2" },
- { VLC_FOURCC('m','p','4','2'), CODEC_ID_MSMPEG4V2,
- VIDEO_ES, "MS MPEG-4 Video v2" },
-
- /* MSMPEG4 v3 / M$ mpeg4 v3 */
- { VLC_FOURCC('M','P','G','3'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('m','p','g','3'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('d','i','v','3'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('M','P','4','3'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('m','p','4','3'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- /* DivX 3.20 */
- { VLC_FOURCC('D','I','V','3'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('D','I','V','4'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('d','i','v','4'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('D','I','V','5'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('d','i','v','5'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('D','I','V','6'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('d','i','v','6'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- /* Cool Codec */
- { VLC_FOURCC('C','O','L','1'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('c','o','l','1'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('C','O','L','0'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('c','o','l','0'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- /* AngelPotion stuff */
- { VLC_FOURCC('A','P','4','1'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- /* 3ivx doctered divx files */
- { VLC_FOURCC('3','I','V','D'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('3','i','v','d'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- /* who knows? */
- { VLC_FOURCC('3','V','I','D'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
- { VLC_FOURCC('3','v','i','d'), CODEC_ID_MSMPEG4V3,
- VIDEO_ES, "MS MPEG-4 Video v3" },
-
- /* Sorenson v1 */
- { VLC_FOURCC('S','V','Q','1'), CODEC_ID_SVQ1,
- VIDEO_ES, "SVQ-1 (Sorenson Video v1)" },
- { VLC_FOURCC('s','v','q','1'), CODEC_ID_SVQ1,
- VIDEO_ES, "SVQ-1 (Sorenson Video v1)" },
- { VLC_FOURCC('s','v','q','i'), CODEC_ID_SVQ1,
- VIDEO_ES, "SVQ-1 (Sorenson Video v1)" },
-
- /* Sorenson v3 */
- { VLC_FOURCC('S','V','Q','3'), CODEC_ID_SVQ3,
- VIDEO_ES, "SVQ-3 (Sorenson Video v3)" },
-
- /* h264 */
- { VLC_FOURCC('h','2','6','4'), CODEC_ID_H264,
- VIDEO_ES, "H264 - MPEG-4 AVC (part 10)" },
- { VLC_FOURCC('H','2','6','4'), CODEC_ID_H264,
- VIDEO_ES, "H264 - MPEG-4 AVC (part 10)" },
- { VLC_FOURCC('x','2','6','4'), CODEC_ID_H264,
- VIDEO_ES, "H264 - MPEG-4 AVC (part 10)" },
- { VLC_FOURCC('X','2','6','4'), CODEC_ID_H264,
- VIDEO_ES, "H264 - MPEG-4 AVC (part 10)" },
- /* avc1: special case h264 */
- { VLC_FOURCC('a','v','c','1'), CODEC_ID_H264,
- VIDEO_ES, "H264 - MPEG-4 AVC (part 10)" },
- { VLC_FOURCC('A','V','C','1'), CODEC_ID_H264,
- VIDEO_ES, "H264 - MPEG-4 AVC (part 10)" },
- { VLC_FOURCC('V','S','S','H'), CODEC_ID_H264,
- VIDEO_ES, "Vanguard VSS H264" },
- { VLC_FOURCC('V','S','S','W'), CODEC_ID_H264,
- VIDEO_ES, "Vanguard VSS H264" },
- { VLC_FOURCC('v','s','s','h'), CODEC_ID_H264,
- VIDEO_ES, "Vanguard VSS H264" },
- { VLC_FOURCC('D','A','V','C'), CODEC_ID_H264,
- VIDEO_ES, "Dicas MPEGable H.264/MPEG-4 AVC" },
- { VLC_FOURCC('d','a','v','c'), CODEC_ID_H264,
- VIDEO_ES, "Dicas MPEGable H.264/MPEG-4 AVC" },
-
-/* H263 and H263i */
-/* H263(+) is also known as Real Video 1.0 */
-
- /* H263 */
- { VLC_FOURCC('D','2','6','3'), CODEC_ID_H263,
- VIDEO_ES, "DEC H263" },
- { VLC_FOURCC('H','2','6','3'), CODEC_ID_H263,
- VIDEO_ES, "H263" },
- { VLC_FOURCC('h','2','6','3'), CODEC_ID_H263,
- VIDEO_ES, "H263" },
- { VLC_FOURCC('L','2','6','3'), CODEC_ID_H263,
- VIDEO_ES, "LEAD H263" },
- { VLC_FOURCC('s','2','6','3'), CODEC_ID_H263,
- VIDEO_ES, "H263" },
- { VLC_FOURCC('S','2','6','3'), CODEC_ID_H263,
- VIDEO_ES, "H263" },
- { VLC_FOURCC('M','2','6','3'), CODEC_ID_H263,
- VIDEO_ES, "Microsoft H263" },
- { VLC_FOURCC('X','2','6','3'), CODEC_ID_H263,
- VIDEO_ES, "Xirlink H263" },
- { VLC_FOURCC('V','X','1','K'), CODEC_ID_H263,
- VIDEO_ES, "H263" },
-
- /* Zygo (partial) */
- { VLC_FOURCC('Z','y','G','o'), CODEC_ID_H263,
- VIDEO_ES, "ITU H263+" },
-
- /* H263i */
- { VLC_FOURCC('I','2','6','3'), CODEC_ID_H263I,
- VIDEO_ES, "I263.I" },
- { VLC_FOURCC('i','2','6','3'), CODEC_ID_H263I,
- VIDEO_ES, "I263.I" },
-
- /* H263P */
- { VLC_FOURCC('v','i','v','1'), CODEC_ID_H263P,
- VIDEO_ES, "H263+" },
- { VLC_FOURCC('v','i','v','O'), CODEC_ID_H263P,
- VIDEO_ES, "H263+" },
- { VLC_FOURCC('v','i','v','2'), CODEC_ID_H263P,
- VIDEO_ES, "H263+" },
- { VLC_FOURCC('U','2','6','3'), CODEC_ID_H263P,
- VIDEO_ES, "UB H263+" },
- { VLC_FOURCC('I','L','V','R'), CODEC_ID_H263P,
- VIDEO_ES, "ITU H263+" },
-
- /* Flash (H263) variant */
- { VLC_FOURCC('F','L','V','1'), CODEC_ID_FLV1,
- VIDEO_ES, "Flash Video" },
-
- /* H261 */
- { VLC_FOURCC('H','2','6','1'), CODEC_ID_H261,
- VIDEO_ES, "H.261" },
- { VLC_FOURCC('h','2','6','1'), CODEC_ID_H261,
- VIDEO_ES, "H.261" },
-
- { VLC_FOURCC('F','L','I','C'), CODEC_ID_FLIC,
- VIDEO_ES, "Flic Video" },
-
- /* MJPEG */
- { VLC_FOURCC( 'M','J','P','G' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Motion JPEG Video" },
- { VLC_FOURCC( 'm','j','p','g' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Motion JPEG Video" },
- { VLC_FOURCC( 'm','j','p','a' ), CODEC_ID_MJPEG, /* for mov file */
- VIDEO_ES, "Motion JPEG Video" },
- { VLC_FOURCC( 'j','p','e','g' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Motion JPEG Video" },
- { VLC_FOURCC( 'J','P','E','G' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Motion JPEG Video" },
- { VLC_FOURCC( 'J','F','I','F' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Motion JPEG Video" },
- { VLC_FOURCC( 'J','P','G','L' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Motion JPEG Video" },
- { VLC_FOURCC( 'A','V','D','J' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Motion JPEG Video" },
- { VLC_FOURCC( 'm','j','p','b' ), CODEC_ID_MJPEGB, /* for mov file */
- VIDEO_ES, "Motion JPEG B Video" },
- { VLC_FOURCC( 'L','J','P','G' ), CODEC_ID_LJPEG,
- VIDEO_ES, "Lead Motion JPEG Video" },
- { VLC_FOURCC( 'L','J','P','G' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Lead Motion JPEG Video" },
- /* AVID MJPEG */
- { VLC_FOURCC( 'A','V','R','n' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Avid Motion JPEG" },
- { VLC_FOURCC( 'A','D','J','V' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Avid Motion JPEG" },
- { VLC_FOURCC( 'd','m','b','1' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Motion JPEG OpenDML Video" },
- { VLC_FOURCC( 'I','J','P','G' ), CODEC_ID_MJPEG,
- VIDEO_ES, "Intergraph JPEG Video" },
- { VLC_FOURCC( 'A','C','D','V' ), CODEC_ID_MJPEG,
- VIDEO_ES, "ACD Systems Digital" },
-
- /* SP5x */
- { VLC_FOURCC( 'S','P','5','X' ), CODEC_ID_SP5X,
- VIDEO_ES, "Sunplus Motion JPEG Video" },
- { VLC_FOURCC( 'S','P','5','3' ), CODEC_ID_SP5X,
- VIDEO_ES, "Sunplus Motion JPEG Video" },
- { VLC_FOURCC( 'S','P','5','4' ), CODEC_ID_SP5X,
- VIDEO_ES, "Sunplus Motion JPEG Video" },
- { VLC_FOURCC( 'S','P','5','5' ), CODEC_ID_SP5X,
- VIDEO_ES, "Sunplus Motion JPEG Video" },
- { VLC_FOURCC( 'S','P','5','6' ), CODEC_ID_SP5X,
- VIDEO_ES, "Sunplus Motion JPEG Video" },
- { VLC_FOURCC( 'S','P','5','7' ), CODEC_ID_SP5X,
- VIDEO_ES, "Sunplus Motion JPEG Video" },
- { VLC_FOURCC( 'S','P','5','8' ), CODEC_ID_SP5X,
- VIDEO_ES, "Sunplus Motion JPEG Video" },
-
- /* DV */
- { VLC_FOURCC('d','v','s','l'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','s','d'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('D','V','S','D'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','h','d'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','h','p'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','h','q'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','h','1'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','h','3'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','h','5'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','h','6'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','c',' '), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','2','5'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video" },
- { VLC_FOURCC('d','v','c','p'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video PAL" },
- { VLC_FOURCC('d','v','p',' '), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video Pro" },
- { VLC_FOURCC('d','v','p','p'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video Pro PAL" },
- { VLC_FOURCC('C','D','V','C'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "Canopus DV Video" },
- { VLC_FOURCC('c','d','v','c'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "Canopus DV Video" },
- { VLC_FOURCC('C','D','V','H'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "Canopus DV Video" },
- { VLC_FOURCC('d','v','5','p'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video C Pro 50 PAL" },
- { VLC_FOURCC('d','v','5','n'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "DV Video C Pro 50 NTSC" },
- { VLC_FOURCC('A','V','d','v'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "AVID DV" },
- { VLC_FOURCC('A','V','d','1'), CODEC_ID_DVVIDEO,
- VIDEO_ES, "AVID DV" },
-
-
- /* Windows Media Video */
- { VLC_FOURCC('W','M','V','1'), CODEC_ID_WMV1,
- VIDEO_ES, "Windows Media Video 1" },
- { VLC_FOURCC('w','m','v','1'), CODEC_ID_WMV1,
- VIDEO_ES, "Windows Media Video 1" },
- { VLC_FOURCC('W','M','V','2'), CODEC_ID_WMV2,
- VIDEO_ES, "Windows Media Video 2" },
- { VLC_FOURCC('w','m','v','2'), CODEC_ID_WMV2,
- VIDEO_ES, "Windows Media Video 2" },
+ { VLC_FOURCC('3','I','V','1'), CODEC_ID_MPEG4, VIDEO_ES },
+ { VLC_FOURCC('3','i','v','1'), CODEC_ID_MPEG4, VIDEO_ES }, */
+
+ { VLC_CODEC_DIV1, CODEC_ID_MSMPEG4V1, VIDEO_ES },
+ { VLC_CODEC_DIV2, CODEC_ID_MSMPEG4V2, VIDEO_ES },
+ { VLC_CODEC_DIV3, CODEC_ID_MSMPEG4V3, VIDEO_ES },
+
+ { VLC_CODEC_SVQ1, CODEC_ID_SVQ1, VIDEO_ES },
+ { VLC_CODEC_SVQ3, CODEC_ID_SVQ3, VIDEO_ES },
+
+ { VLC_CODEC_H264, CODEC_ID_H264, VIDEO_ES },
+ { VLC_CODEC_H263, CODEC_ID_H263, VIDEO_ES },
+ { VLC_CODEC_H263I,CODEC_ID_H263I,VIDEO_ES },
+ { VLC_CODEC_H263P,CODEC_ID_H263P,VIDEO_ES },
+
+ { VLC_CODEC_FLV1, CODEC_ID_FLV1, VIDEO_ES },
+
+ { VLC_CODEC_H261, CODEC_ID_H261, VIDEO_ES },
+ { VLC_CODEC_FLIC, CODEC_ID_FLIC, VIDEO_ES },
+
+ { VLC_CODEC_MJPG, CODEC_ID_MJPEG, VIDEO_ES },
+ { VLC_CODEC_MJPGB,CODEC_ID_MJPEGB,VIDEO_ES },
+ { VLC_CODEC_LJPG, CODEC_ID_LJPEG, VIDEO_ES },
+
+ { VLC_CODEC_SP5X, CODEC_ID_SP5X, VIDEO_ES },
+
+ { VLC_CODEC_DV, CODEC_ID_DVVIDEO, VIDEO_ES },
+
+ { VLC_CODEC_WMV1, CODEC_ID_WMV1, VIDEO_ES },
+ { VLC_CODEC_WMV2, CODEC_ID_WMV2, VIDEO_ES },
+ { VLC_CODEC_WMV3, CODEC_ID_WMV3, VIDEO_ES },
+
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 10, 1 )
- { VLC_FOURCC('W','M','V','3'), CODEC_ID_WMV3,
- VIDEO_ES, "Windows Media Video 3" },
- { VLC_FOURCC('w','m','v','3'), CODEC_ID_WMV3,
- VIDEO_ES, "Windows Media Video 3" },
- { VLC_FOURCC('W','V','C','1'), CODEC_ID_VC1,
- VIDEO_ES, "Windows Media Video VC1" },
- { VLC_FOURCC('w','v','c','1'), CODEC_ID_VC1,
- VIDEO_ES, "Windows Media Video VC1" },
- { VLC_FOURCC('v','c','-','1'), CODEC_ID_VC1,
- VIDEO_ES, "Windows Media Video VC1" },
- { VLC_FOURCC('V','C','-','1'), CODEC_ID_VC1,
- VIDEO_ES, "Windows Media Video VC1" },
- /* WMVA is the VC-1 codec before the standardization proces,
- it is not bitstream compatible and deprecated */
- { VLC_FOURCC('W','M','V','A'), CODEC_ID_VC1,
- VIDEO_ES, "Windows Media Video Advanced Profile" },
+ { VLC_CODEC_VC1, CODEC_ID_VC1, VIDEO_ES },
#endif
- /* Microsoft Video 1 */
- { VLC_FOURCC('M','S','V','C'), CODEC_ID_MSVIDEO1,
- VIDEO_ES, "Microsoft Video 1" },
- { VLC_FOURCC('m','s','v','c'), CODEC_ID_MSVIDEO1,
- VIDEO_ES, "Microsoft Video 1" },
- { VLC_FOURCC('C','R','A','M'), CODEC_ID_MSVIDEO1,
- VIDEO_ES, "Microsoft Video 1" },
- { VLC_FOURCC('c','r','a','m'), CODEC_ID_MSVIDEO1,
- VIDEO_ES, "Microsoft Video 1" },
- { VLC_FOURCC('W','H','A','M'), CODEC_ID_MSVIDEO1,
- VIDEO_ES, "Microsoft Video 1" },
- { VLC_FOURCC('w','h','a','m'), CODEC_ID_MSVIDEO1,
- VIDEO_ES, "Microsoft Video 1" },
-
- /* Microsoft RLE */
- { VLC_FOURCC('m','r','l','e'), CODEC_ID_MSRLE,
- VIDEO_ES, "Microsoft RLE Video" },
- { VLC_FOURCC('W','R','L','E'), CODEC_ID_MSRLE,
- VIDEO_ES, "Microsoft RLE Video" },
- { VLC_FOURCC(0x1,0x0,0x0,0x0), CODEC_ID_MSRLE,
- VIDEO_ES, "Microsoft RLE Video" },
- { VLC_FOURCC(0x2,0x0,0x0,0x0), CODEC_ID_MSRLE,
- VIDEO_ES, "Microsoft RLE Video" },
+ { VLC_CODEC_MSVIDEO1, CODEC_ID_MSVIDEO1, VIDEO_ES },
+ { VLC_CODEC_MSRLE, CODEC_ID_MSRLE, VIDEO_ES },
+ { VLC_CODEC_INDEO2, CODEC_ID_INDEO2, VIDEO_ES },
/* Indeo Video Codecs (Quality of this decoder on ppc is not good) */
- { VLC_FOURCC('I','V','3','1'), CODEC_ID_INDEO3,
- VIDEO_ES, "Indeo Video v3" },
- { VLC_FOURCC('i','v','3','1'), CODEC_ID_INDEO3,
- VIDEO_ES, "Indeo Video v3" },
- { VLC_FOURCC('I','V','3','2'), CODEC_ID_INDEO3,
- VIDEO_ES, "Indeo Video v3" },
- { VLC_FOURCC('i','v','3','2'), CODEC_ID_INDEO3,
- VIDEO_ES, "Indeo Video v3" },
-
- /* Huff YUV */
- { VLC_FOURCC('H','F','Y','U'), CODEC_ID_HUFFYUV,
- VIDEO_ES, "Huff YUV Video" },
- { VLC_FOURCC('F','F','V','H'), CODEC_ID_FFVHUFF,
- VIDEO_ES, "Huff YUV Video" },
-
- /* Creative YUV */
- { VLC_FOURCC('C','Y','U','V'), CODEC_ID_CYUV,
- VIDEO_ES, "Creative YUV Video" },
- { VLC_FOURCC('c','y','u','v'), CODEC_ID_CYUV,
- VIDEO_ES, "Creative YUV Video" },
-
- /* On2 VP3 Video Codecs */
- { VLC_FOURCC('V','P','3',' '), CODEC_ID_VP3,
- VIDEO_ES, "On2's VP3 Video" },
- { VLC_FOURCC('V','P','3','0'), CODEC_ID_VP3,
- VIDEO_ES, "On2's VP3 Video" },
- { VLC_FOURCC('V','P','3','1'), CODEC_ID_VP3,
- VIDEO_ES, "On2's VP3 Video" },
- { VLC_FOURCC('v','p','3','1'), CODEC_ID_VP3,
- VIDEO_ES, "On2's VP3 Video" },
-
- /* On2 VP5, VP6 codecs */
+ { VLC_CODEC_INDEO3, CODEC_ID_INDEO3, VIDEO_ES },
+
+ { VLC_CODEC_HUFFYUV, CODEC_ID_HUFFYUV, VIDEO_ES },
+ { VLC_CODEC_FFVHUFF, CODEC_ID_FFVHUFF, VIDEO_ES },
+ { VLC_CODEC_CYUV, CODEC_ID_CYUV, VIDEO_ES },
+
+ { VLC_CODEC_VP3, CODEC_ID_VP3, VIDEO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 14, 0 )
- { VLC_FOURCC('V','P','5',' '), CODEC_ID_VP5,
- VIDEO_ES, "On2's VP5 Video" },
- { VLC_FOURCC('V','P','5','0'), CODEC_ID_VP5,
- VIDEO_ES, "On2's VP5 Video" },
- { VLC_FOURCC('V','P','6','2'), CODEC_ID_VP6,
- VIDEO_ES, "On2's VP6.2 Video" },
- { VLC_FOURCC('v','p','6','2'), CODEC_ID_VP6,
- VIDEO_ES, "On2's VP6.2 Video" },
- { VLC_FOURCC('V','P','6','F'), CODEC_ID_VP6F,
- VIDEO_ES, "On2's VP6.2 Video (Flash)" },
+ { VLC_CODEC_VP5, CODEC_ID_VP5, VIDEO_ES },
#endif
-
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 27, 0 )
- { VLC_FOURCC('V','P','6','0'), CODEC_ID_VP6,
- VIDEO_ES, "On2's VP6.0 Video" },
- { VLC_FOURCC('V','P','6','1'), CODEC_ID_VP6,
- VIDEO_ES, "On2's VP6.1 Video" },
+ { VLC_CODEC_VP6, CODEC_ID_VP6, VIDEO_ES },
+ { VLC_CODEC_VP6F, CODEC_ID_VP6F, VIDEO_ES },
#endif
-
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 47, 0 )
- { VLC_FOURCC('V','P','6','A'), CODEC_ID_VP6A,
- VIDEO_ES, "On2's VP6 A Video" },
+ { VLC_CODEC_VP6A, CODEC_ID_VP6A, VIDEO_ES },
#endif
- /* Xiph.org theora */
- { VLC_FOURCC('t','h','e','o'), CODEC_ID_THEORA,
- VIDEO_ES, "Xiph.org's Theora Video" },
- { VLC_FOURCC('T','h','r','a'), CODEC_ID_THEORA,
- VIDEO_ES, "Xiph.org's Theora Video" },
+ { VLC_CODEC_THEORA, CODEC_ID_THEORA, VIDEO_ES },
#if ( !defined( WORDS_BIGENDIAN ) )
/* Asus Video (Another thing that doesn't work on PPC) */
- { VLC_FOURCC('A','S','V','1'), CODEC_ID_ASV1,
- VIDEO_ES, "Asus V1 Video" },
- { VLC_FOURCC('A','S','V','2'), CODEC_ID_ASV2,
- VIDEO_ES, "Asus V2 Video" },
+ { VLC_CODEC_ASV1, CODEC_ID_ASV1, VIDEO_ES },
+ { VLC_CODEC_ASV2, CODEC_ID_ASV2, VIDEO_ES },
#endif
- /* FFMPEG Video 1 (lossless codec) */
- { VLC_FOURCC('F','F','V','1'), CODEC_ID_FFV1,
- VIDEO_ES, "FFMpeg Video 1" },
+ { VLC_CODEC_FFV1, CODEC_ID_FFV1, VIDEO_ES },
- /* ATI VCR1 */
- { VLC_FOURCC('V','C','R','1'), CODEC_ID_VCR1,
- VIDEO_ES, "ATI VCR1 Video" },
+ { VLC_CODEC_VCR1, CODEC_ID_VCR1, VIDEO_ES },
- /* Cirrus Logic AccuPak */
- { VLC_FOURCC('C','L','J','R'), CODEC_ID_CLJR,
- VIDEO_ES, "Creative Logic AccuPak" },
+ { VLC_CODEC_CLJR, CODEC_ID_CLJR, VIDEO_ES },
/* Real Video */
- { VLC_FOURCC('R','V','1','0'), CODEC_ID_RV10,
- VIDEO_ES, "Real Video 1.0" },
- { VLC_FOURCC('r','v','1','0'), CODEC_ID_RV10,
- VIDEO_ES, "Real Video 1.0" },
- { VLC_FOURCC('R','V','1','3'), CODEC_ID_RV10,
- VIDEO_ES, "Real Video 1.3" },
- { VLC_FOURCC('r','v','1','3'), CODEC_ID_RV10,
- VIDEO_ES, "Real Video 1.3" },
+ { VLC_CODEC_RV10, CODEC_ID_RV10, VIDEO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 15, 1 )
- { VLC_FOURCC('R','V','2','0'), CODEC_ID_RV20,
- VIDEO_ES, "Real Video 2.0" },
- { VLC_FOURCC('r','v','2','0'), CODEC_ID_RV20,
- VIDEO_ES, "Real Video 2.0" },
+ { VLC_CODEC_RV20, CODEC_ID_RV20, VIDEO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 8, 0 )
- { VLC_FOURCC('R','V','3','0'), CODEC_ID_RV30,
- VIDEO_ES, "Real Video 3.0" },
- { VLC_FOURCC('r','v','3','0'), CODEC_ID_RV30,
- VIDEO_ES, "Real Video 3.0" },
+ { VLC_CODEC_RV30, CODEC_ID_RV30, VIDEO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 5, 0 )
- { VLC_FOURCC('R','V','4','0'), CODEC_ID_RV40,
- VIDEO_ES, "Real Video 4.0" },
- { VLC_FOURCC('r','v','4','0'), CODEC_ID_RV40,
- VIDEO_ES, "Real Video 4.0" },
+ { VLC_CODEC_RV40, CODEC_ID_RV40, VIDEO_ES },
#endif
+ { VLC_CODEC_RPZA, CODEC_ID_RPZA, VIDEO_ES },
- /* Apple Video */
- { VLC_FOURCC('r','p','z','a'), CODEC_ID_RPZA,
- VIDEO_ES, "Apple Video" },
- { VLC_FOURCC('a','z','p','r'), CODEC_ID_RPZA,
- VIDEO_ES, "Apple Video" },
-
- { VLC_FOURCC('s','m','c',' '), CODEC_ID_SMC,
- VIDEO_ES, "Apple graphics" },
+ { VLC_CODEC_SMC, CODEC_ID_SMC, VIDEO_ES },
- /* CINEPAK. We have our own decoder with an higher priority,
- but this can't harm */
- { VLC_FOURCC('C','V','I','D'), CODEC_ID_CINEPAK,
- VIDEO_ES, "Cinepak Video" },
- { VLC_FOURCC('c','v','i','d'), CODEC_ID_CINEPAK,
- VIDEO_ES, "Cinepak Video" },
+ { VLC_CODEC_CINEPAK, CODEC_ID_CINEPAK, VIDEO_ES },
- /* Screen Capture Video Codecs */
- { VLC_FOURCC('t','s','c','c'), CODEC_ID_TSCC,
- VIDEO_ES, "TechSmith Camtasia Screen Capture" },
- { VLC_FOURCC('T','S','C','C'), CODEC_ID_TSCC,
- VIDEO_ES, "TechSmith Camtasia Screen Capture" },
+ { VLC_CODEC_TSCC, CODEC_ID_TSCC, VIDEO_ES },
- { VLC_FOURCC('C','S','C','D'), CODEC_ID_CSCD,
- VIDEO_ES, "CamStudio Screen Codec" },
- { VLC_FOURCC('c','s','c','d'), CODEC_ID_CSCD,
- VIDEO_ES, "CamStudio Screen Codec" },
+ { VLC_CODEC_CSCD, CODEC_ID_CSCD, VIDEO_ES },
- { VLC_FOURCC('Z','M','B','V'), CODEC_ID_ZMBV,
- VIDEO_ES, "DosBox Capture Codec" },
+ { VLC_CODEC_ZMBV, CODEC_ID_ZMBV, VIDEO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 13, 0 )
- { VLC_FOURCC('V','M','n','c'), CODEC_ID_VMNC,
- VIDEO_ES, "VMware Video" },
+ { VLC_CODEC_VMNC, CODEC_ID_VMNC, VIDEO_ES },
#endif
- { VLC_FOURCC('F','P','S','1'), CODEC_ID_FRAPS,
- VIDEO_ES, "FRAPS: Realtime Video Capture" },
- { VLC_FOURCC('f','p','s','1'), CODEC_ID_FRAPS,
- VIDEO_ES, "FRAPS: Realtime Video Capture" },
-
- /* Duck TrueMotion */
- { VLC_FOURCC('D','U','C','K'), CODEC_ID_TRUEMOTION1,
- VIDEO_ES, "Duck TrueMotion v1 Video" },
- { VLC_FOURCC('T','M','2','0'), CODEC_ID_TRUEMOTION2,
- VIDEO_ES, "Duck TrueMotion v2.0 Video" },
-
- /* FFMPEG's SNOW wavelet codec */
- { VLC_FOURCC('S','N','O','W'), CODEC_ID_SNOW,
- VIDEO_ES, "FFMpeg SNOW wavelet Video" },
- { VLC_FOURCC('s','n','o','w'), CODEC_ID_SNOW,
- VIDEO_ES, "FFMpeg SNOW wavelet Video" },
-
- { VLC_FOURCC('r','l','e',' '), CODEC_ID_QTRLE,
- VIDEO_ES, "Apple QuickTime RLE Video" },
-
- { VLC_FOURCC('q','d','r','w'), CODEC_ID_QDRAW,
- VIDEO_ES, "Apple QuickDraw Video" },
-
- { VLC_FOURCC('Q','P','E','G'), CODEC_ID_QPEG,
- VIDEO_ES, "QPEG Video" },
- { VLC_FOURCC('Q','1','.','0'), CODEC_ID_QPEG,
- VIDEO_ES, "QPEG Video" },
- { VLC_FOURCC('Q','1','.','1'), CODEC_ID_QPEG,
- VIDEO_ES, "QPEG Video" },
-
- { VLC_FOURCC('U','L','T','I'), CODEC_ID_ULTI,
- VIDEO_ES, "IBM Ultimotion Video" },
-
- { VLC_FOURCC('V','I','X','L'), CODEC_ID_VIXL,
- VIDEO_ES, "Miro/Pinnacle VideoXL Video" },
- { VLC_FOURCC('P','I','X','L'), CODEC_ID_VIXL,
- VIDEO_ES, "Pinnacle VideoXL Video" },
-
- { VLC_FOURCC('L','O','C','O'), CODEC_ID_LOCO,
- VIDEO_ES, "LOCO Video" },
-
- { VLC_FOURCC('W','N','V','1'), CODEC_ID_WNV1,
- VIDEO_ES, "Winnov WNV1 Video" },
-
- { VLC_FOURCC('A','A','S','C'), CODEC_ID_AASC,
- VIDEO_ES, "Autodesc RLE Video" },
-
- { VLC_FOURCC('I','V','2','0'), CODEC_ID_INDEO2,
- VIDEO_ES, "Indeo Video v2" },
- { VLC_FOURCC('R','T','2','1'), CODEC_ID_INDEO2,
- VIDEO_ES, "Indeo Video v2" },
-
- /* Flash Screen Video */
+ { VLC_CODEC_FRAPS, CODEC_ID_FRAPS, VIDEO_ES },
+
+ { VLC_CODEC_TRUEMOTION1, CODEC_ID_TRUEMOTION1, VIDEO_ES },
+ { VLC_CODEC_TRUEMOTION2, CODEC_ID_TRUEMOTION2, VIDEO_ES },
+
+ { VLC_CODEC_SNOW, CODEC_ID_SNOW, VIDEO_ES },
+
+ { VLC_CODEC_QTRLE, CODEC_ID_QTRLE, VIDEO_ES },
+
+ { VLC_CODEC_QDRAW, CODEC_ID_QDRAW, VIDEO_ES },
+
+ { VLC_CODEC_QPEG, CODEC_ID_QPEG, VIDEO_ES },
+
+ { VLC_CODEC_ULTI, CODEC_ID_ULTI, VIDEO_ES },
+
+ { VLC_CODEC_VIXL, CODEC_ID_VIXL, VIDEO_ES },
+
+ { VLC_CODEC_LOCO, CODEC_ID_LOCO, VIDEO_ES },
+
+ { VLC_CODEC_WNV1, CODEC_ID_WNV1, VIDEO_ES },
+
+ { VLC_CODEC_AASC, CODEC_ID_AASC, VIDEO_ES },
+
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 11, 0 )
- { VLC_FOURCC('F','S','V','1'), CODEC_ID_FLASHSV,
- VIDEO_ES, "Flash Screen Video" },
+ { VLC_CODEC_FLASHSV, CODEC_ID_FLASHSV, VIDEO_ES },
#endif
- { VLC_FOURCC('K','M','V','C'), CODEC_ID_KMVC,
- VIDEO_ES, "Karl Morton's Video Codec (Worms)" },
+ { VLC_CODEC_KMVC, CODEC_ID_KMVC, VIDEO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 13, 0 )
- { VLC_FOURCC('N','U','V','1'), CODEC_ID_NUV,
- VIDEO_ES, "Nuppel Video" },
- { VLC_FOURCC('R','J','P','G'), CODEC_ID_NUV,
- VIDEO_ES, "Nuppel Video" },
+ { VLC_CODEC_NUV, CODEC_ID_NUV, VIDEO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 8, 0 )
- /* CODEC_ID_SMACKVIDEO */
- { VLC_FOURCC('S','M','K','2'), CODEC_ID_SMACKVIDEO,
- VIDEO_ES, "Smacker Video" },
- { VLC_FOURCC('S','M','K','4'), CODEC_ID_SMACKVIDEO,
- VIDEO_ES, "Smacker Video" },
+ { VLC_CODEC_SMACKVIDEO, CODEC_ID_SMACKVIDEO, VIDEO_ES },
#endif
/* Chinese AVS - Untested */
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 8, 0 )
- { VLC_FOURCC('C','A','V','S'), CODEC_ID_CAVS,
- VIDEO_ES, "Chinese AVS" },
- { VLC_FOURCC('A','V','s','2'), CODEC_ID_CAVS,
- VIDEO_ES, "Chinese AVS" },
+ { VLC_CODEC_CAVS, CODEC_ID_CAVS, VIDEO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 40, 0 )
/* Untested yet */
- { VLC_FOURCC('A','V','d','n'), CODEC_ID_DNXHD,
- VIDEO_ES, "DNxHD" },
+ { VLC_CODEC_DNXHD, CODEC_ID_DNXHD, VIDEO_ES },
#endif
- { VLC_FOURCC('8','B','P','S'), CODEC_ID_8BPS,
- VIDEO_ES, "8BPS" },
+ { VLC_CODEC_8BPS, CODEC_ID_8BPS, VIDEO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 52, 0 )
- { VLC_FOURCC('M','L','2','O'), CODEC_ID_MIMIC,
- VIDEO_ES, "Mimic" },
+ { VLC_CODEC_MIMIC, CODEC_ID_MIMIC, VIDEO_ES },
+#endif
+
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 29, 0 )
+ { VLC_CODEC_V210, CODEC_ID_V210, VIDEO_ES },
#endif
/* Videogames Codecs */
- /* Interplay MVE */
- { VLC_FOURCC('i','m','v','e'), CODEC_ID_INTERPLAY_VIDEO,
- VIDEO_ES, "Interplay MVE Video" },
- { VLC_FOURCC('I','N','P','V'), CODEC_ID_INTERPLAY_VIDEO,
- VIDEO_ES, "Interplay MVE Video" },
+ { VLC_CODEC_INTERPLAY, CODEC_ID_INTERPLAY_VIDEO, VIDEO_ES },
- /* Id Quake II CIN */
- { VLC_FOURCC('I','D','C','I'), CODEC_ID_IDCIN,
- VIDEO_ES, "Id Quake II CIN Video" },
+ { VLC_CODEC_IDCIN, CODEC_ID_IDCIN, VIDEO_ES },
- /* 4X Technologies */
- { VLC_FOURCC('4','x','m','v'), CODEC_ID_4XM,
- VIDEO_ES, "4X Technologies Video" },
- { VLC_FOURCC('4','X','M','V'), CODEC_ID_4XM,
- VIDEO_ES, "4X Technologies Video" },
+ { VLC_CODEC_4XM, CODEC_ID_4XM, VIDEO_ES },
- /* Id RoQ */
- { VLC_FOURCC('R','o','Q','v'), CODEC_ID_ROQ,
- VIDEO_ES, "Id RoQ Video" },
+ { VLC_CODEC_ROQ, CODEC_ID_ROQ, VIDEO_ES },
- /* Sony Playstation MDEC */
- { VLC_FOURCC('M','D','E','C'), CODEC_ID_MDEC,
- VIDEO_ES, "PSX MDEC Video" },
+ { VLC_CODEC_MDEC, CODEC_ID_MDEC, VIDEO_ES },
- /* Sierra VMD */
- { VLC_FOURCC('v','m','d','v'), CODEC_ID_VMDVIDEO,
- VIDEO_ES, "Sierra VMD Video" },
- { VLC_FOURCC('V','M','D','V'), CODEC_ID_VMDVIDEO,
- VIDEO_ES, "Sierra VMD Video" },
+ { VLC_CODEC_VMDVIDEO, CODEC_ID_VMDVIDEO, VIDEO_ES },
#if 0
/* UNTESTED VideoGames*/
/*
* Image codecs
*/
- { VLC_FOURCC('p','n','g',' '), CODEC_ID_PNG,
- VIDEO_ES, "PNG Image" },
- { VLC_FOURCC('p','p','m',' '), CODEC_ID_PPM,
- VIDEO_ES, "PPM Image" },
- { VLC_FOURCC('p','g','m',' '), CODEC_ID_PGM,
- VIDEO_ES, "PGM Image" },
- { VLC_FOURCC('p','g','m','y'), CODEC_ID_PGMYUV,
- VIDEO_ES, "PGM YUV Image" },
- { VLC_FOURCC('p','a','m',' '), CODEC_ID_PAM,
- VIDEO_ES, "PAM Image" },
- { VLC_FOURCC('M','J','L','S'), CODEC_ID_JPEGLS,
- VIDEO_ES, "PAM Image" },
+ { VLC_CODEC_PNG, CODEC_ID_PNG, VIDEO_ES },
+ { VLC_CODEC_PPM, CODEC_ID_PPM, VIDEO_ES },
+ { VLC_CODEC_PGM, CODEC_ID_PGM, VIDEO_ES },
+ { VLC_CODEC_PGMYUV, CODEC_ID_PGMYUV, VIDEO_ES },
+ { VLC_CODEC_PAM, CODEC_ID_PAM, VIDEO_ES },
+ { VLC_CODEC_JPEGLS, CODEC_ID_JPEGLS, VIDEO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 0, 0 )
- { VLC_FOURCC('b','m','p',' '), CODEC_ID_BMP,
- VIDEO_ES, "BMP Image" },
+ { VLC_CODEC_BMP, CODEC_ID_BMP, VIDEO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 40, 1 )
- { VLC_FOURCC('t','i','f','f'), CODEC_ID_TIFF,
- VIDEO_ES, "TIFF Image" },
- { VLC_FOURCC('g','i','f',' '), CODEC_ID_GIF,
- VIDEO_ES, "GIF Image" },
- { VLC_FOURCC('t','g','a',' '), CODEC_ID_TARGA,
- VIDEO_ES, "Truevision Targa Image" },
- { VLC_FOURCC('m','t','g','a'), CODEC_ID_TARGA,
- VIDEO_ES, "Truevision Targa Image" },
- { VLC_FOURCC('M','T','G','A'), CODEC_ID_TARGA,
- VIDEO_ES, "Truevision Targa Image" },
+ { VLC_CODEC_TIFF, CODEC_ID_TIFF, VIDEO_ES },
+ { VLC_CODEC_GIF, CODEC_ID_GIF, VIDEO_ES },
+ { VLC_CODEC_TARGA, CODEC_ID_TARGA, VIDEO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 40, 3 )
- { VLC_FOURCC('s','g','i',' '), CODEC_ID_SGI,
- VIDEO_ES, "SGI Image" },
+ { VLC_CODEC_SGI, CODEC_ID_SGI, VIDEO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 55, 0 )
- { VLC_FOURCC('d','r','a','c'), CODEC_ID_DIRAC,
- VIDEO_ES, "Dirac" },
+ { VLC_CODEC_DIRAC, CODEC_ID_DIRAC, VIDEO_ES },
#endif
/*
* Audio Codecs
*/
- /* Windows Media Audio 1 */
- { VLC_FOURCC('W','M','A','1'), CODEC_ID_WMAV1,
- AUDIO_ES, "Windows Media Audio 1" },
- { VLC_FOURCC('w','m','a','1'), CODEC_ID_WMAV1,
- AUDIO_ES, "Windows Media Audio 1" },
-
- /* Windows Media Audio 2 */
- { VLC_FOURCC('W','M','A','2'), CODEC_ID_WMAV2,
- AUDIO_ES, "Windows Media Audio 2" },
- { VLC_FOURCC('w','m','a','2'), CODEC_ID_WMAV2,
- AUDIO_ES, "Windows Media Audio 2" },
-
- /* DV Audio */
- { VLC_FOURCC('d','v','a','u'), CODEC_ID_DVAUDIO,
- AUDIO_ES, "DV Audio" },
- { VLC_FOURCC('v','d','v','a'), CODEC_ID_DVAUDIO,
- AUDIO_ES, "DV Audio" },
- { VLC_FOURCC('d','v','c','a'), CODEC_ID_DVAUDIO,
- AUDIO_ES, "DV Audio" },
- { VLC_FOURCC('R','A','D','V'), CODEC_ID_DVAUDIO,
- AUDIO_ES, "DV Audio" },
-
- /* MACE-3 Audio */
- { VLC_FOURCC('M','A','C','3'), CODEC_ID_MACE3,
- AUDIO_ES, "MACE-3 Audio" },
-
- /* MACE-6 Audio */
- { VLC_FOURCC('M','A','C','6'), CODEC_ID_MACE6,
- AUDIO_ES, "MACE-6 Audio" },
+ { VLC_CODEC_WMA1, CODEC_ID_WMAV1, AUDIO_ES },
+ { VLC_CODEC_WMA2, CODEC_ID_WMAV2, AUDIO_ES },
+
+ { VLC_CODEC_DVAUDIO, CODEC_ID_DVAUDIO, AUDIO_ES },
+
+ { VLC_CODEC_MACE3, CODEC_ID_MACE3, AUDIO_ES },
+ { VLC_CODEC_MACE6, CODEC_ID_MACE6, AUDIO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 41, 1 )
- /* MUSEPACK7 Audio */
- { VLC_FOURCC('M','P','C',' '), CODEC_ID_MUSEPACK7,
- AUDIO_ES, "MUSEPACK7 Audio" },
+ { VLC_CODEC_MUSEPACK7, CODEC_ID_MUSEPACK7, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 48, 0 )
- /* MUSEPACK8 Audio */
- { VLC_FOURCC('M','P','C','K'), CODEC_ID_MUSEPACK8,
- AUDIO_ES, "MUSEPACK8 Audio" },
- { VLC_FOURCC('M','P','C','8'), CODEC_ID_MUSEPACK8,
- AUDIO_ES, "MUSEPACK8 Audio" },
+ { VLC_CODEC_MUSEPACK8, CODEC_ID_MUSEPACK8, AUDIO_ES },
#endif
- /* RealAudio 1.0 */
- { VLC_FOURCC('1','4','_','4'), CODEC_ID_RA_144,
- AUDIO_ES, "RealAudio 1.0" },
- { VLC_FOURCC('l','p','c','J'), CODEC_ID_RA_144,
- AUDIO_ES, "RealAudio 1.0" },
-
- /* RealAudio 2.0 */
- { VLC_FOURCC('2','8','_','8'), CODEC_ID_RA_288,
- AUDIO_ES, "RealAudio 2.0" },
-
- /* MPEG Audio layer 1/2/3 */
- { VLC_FOURCC('m','p','g','a'), CODEC_ID_MP2,
- AUDIO_ES, "MPEG Audio layer 1/2" },
- { VLC_FOURCC('m','p','3',' '), CODEC_ID_MP3,
- AUDIO_ES, "MPEG Audio layer 1/2/3" },
- { VLC_FOURCC('.','m','p','3'), CODEC_ID_MP3,
- AUDIO_ES, "MPEG Audio layer 1/2/3" },
- { VLC_FOURCC('M','P','3',' '), CODEC_ID_MP3,
- AUDIO_ES, "MPEG Audio layer 1/2/3" },
- { VLC_FOURCC('L','A','M','E'), CODEC_ID_MP3,
- AUDIO_ES, "MPEG Audio layer 1/2/3" },
-
- /* A52 Audio (aka AC3) */
- { VLC_FOURCC('a','5','2',' '), CODEC_ID_AC3,
- AUDIO_ES, "A52 Audio (aka AC3)" },
- { VLC_FOURCC('a','5','2','b'), CODEC_ID_AC3, /* VLC specific hack */
- AUDIO_ES, "A52 Audio (aka AC3)" },
+ { VLC_CODEC_RA_144, CODEC_ID_RA_144, AUDIO_ES },
+ { VLC_CODEC_RA_288, CODEC_ID_RA_288, AUDIO_ES },
+
+ { VLC_CODEC_MPGA, CODEC_ID_MP3, AUDIO_ES },
+
+ { VLC_CODEC_A52, CODEC_ID_AC3, AUDIO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 0, 0 )
- { VLC_FOURCC('e','a','c','3'), CODEC_ID_EAC3,
- AUDIO_ES, "A/52 B Audio (aka E-AC3)" },
+ { VLC_CODEC_EAC3, CODEC_ID_EAC3, AUDIO_ES },
#endif
- /* DTS Audio */
- { VLC_FOURCC('d','t','s',' '), CODEC_ID_DTS,
- AUDIO_ES, "DTS Audio" },
-
- /* AAC audio */
- { VLC_FOURCC('m','p','4','a'), CODEC_ID_AAC,
- AUDIO_ES, "MPEG AAC Audio" },
- { VLC_FOURCC('a','a','c',' '), CODEC_ID_AAC,
- AUDIO_ES, "MPEG AAC Audio" },
+ { VLC_CODEC_DTS, CODEC_ID_DTS, AUDIO_ES },
- /* AC-3 Audio (Dolby Digital) */
- { VLC_FOURCC('a','c','-','3'), CODEC_ID_AC3,
- AUDIO_ES, "AC-3 Audio (Dolby Digital)" },
+ { VLC_CODEC_MP4A, CODEC_ID_AAC, AUDIO_ES },
- /* 4X Technologies */
- { VLC_FOURCC('4','x','m','a'), CODEC_ID_ADPCM_4XM,
- AUDIO_ES, "4X Technologies Audio" },
+ { VLC_CODEC_ADPCM_4XM, CODEC_ID_ADPCM_4XM, AUDIO_ES },
- /* EA ADPCM */
- { VLC_FOURCC('A','D','E','A'), CODEC_ID_ADPCM_EA,
- AUDIO_ES, "EA ADPCM Audio" },
+ { VLC_CODEC_ADPCM_EA, CODEC_ID_ADPCM_EA, AUDIO_ES },
- /* Interplay DPCM */
- { VLC_FOURCC('i','d','p','c'), CODEC_ID_INTERPLAY_DPCM,
- AUDIO_ES, "Interplay DPCM Audio" },
+ { VLC_CODEC_INTERPLAY_DPCM, CODEC_ID_INTERPLAY_DPCM, AUDIO_ES },
- /* Id RoQ */
- { VLC_FOURCC('R','o','Q','a'), CODEC_ID_ROQ_DPCM,
- AUDIO_ES, "Id RoQ DPCM Audio" },
+ { VLC_CODEC_ROQ_DPCM, CODEC_ID_ROQ_DPCM, AUDIO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 27, 0 )
- /* DCIN Audio */
- { VLC_FOURCC('D','C','I','A'), CODEC_ID_DSICINAUDIO,
- AUDIO_ES, "Delphine CIN Audio" },
+ { VLC_CODEC_DSICINAUDIO, CODEC_ID_DSICINAUDIO, AUDIO_ES },
#endif
- /* Sony Playstation XA ADPCM */
- { VLC_FOURCC('x','a',' ',' '), CODEC_ID_ADPCM_XA,
- AUDIO_ES, "PSX XA ADPCM Audio" },
-
- /* ADX ADPCM */
- { VLC_FOURCC('a','d','x',' '), CODEC_ID_ADPCM_ADX,
- AUDIO_ES, "ADX ADPCM Audio" },
-
- /* Westwood ADPCM */
- { VLC_FOURCC('A','I','W','S'), CODEC_ID_ADPCM_IMA_WS,
- AUDIO_ES, "Westwood IMA ADPCM audio" },
+ { VLC_CODEC_ADPCM_XA, CODEC_ID_ADPCM_XA, AUDIO_ES },
+ { VLC_CODEC_ADPCM_ADX, CODEC_ID_ADPCM_ADX, AUDIO_ES },
+ { VLC_CODEC_ADPCM_IMA_WS, CODEC_ID_ADPCM_IMA_WS, AUDIO_ES },
- /* Sierra VMD */
- { VLC_FOURCC('v','m','d','a'), CODEC_ID_VMDAUDIO,
- AUDIO_ES, "Sierra VMD Audio" },
+ { VLC_CODEC_VMDAUDIO, CODEC_ID_VMDAUDIO, AUDIO_ES },
- /* G.726 ADPCM */
- { VLC_FOURCC('g','7','2','6'), CODEC_ID_ADPCM_G726,
- AUDIO_ES, "G.726 ADPCM Audio" },
+ { VLC_CODEC_ADPCM_G726, CODEC_ID_ADPCM_G726, AUDIO_ES },
- /* AMR */
- { VLC_FOURCC('s','a','m','r'), CODEC_ID_AMR_NB,
- AUDIO_ES, "AMR narrow band" },
- { VLC_FOURCC('s','a','w','b'), CODEC_ID_AMR_WB,
- AUDIO_ES, "AMR wide band" },
+ { VLC_CODEC_AMR_NB, CODEC_ID_AMR_NB, AUDIO_ES },
+ { VLC_CODEC_AMR_WB, CODEC_ID_AMR_WB, AUDIO_ES },
- /* FLAC */
- { VLC_FOURCC('f','l','a','c'), CODEC_ID_FLAC,
- AUDIO_ES, "FLAC (Free Lossless Audio Codec)" },
+ { VLC_CODEC_FLAC, CODEC_ID_FLAC, AUDIO_ES },
- /* ALAC */
- { VLC_FOURCC('a','l','a','c'), CODEC_ID_ALAC,
- AUDIO_ES, "Apple Lossless Audio Codec" },
+ { VLC_CODEC_ALAC, CODEC_ID_ALAC, AUDIO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 50, 0, 1 )
- /* QDM2 */
- { VLC_FOURCC('Q','D','M','2'), CODEC_ID_QDM2,
- AUDIO_ES, "QDM2 Audio" },
+ { VLC_CODEC_QDM2, CODEC_ID_QDM2, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 0, 0 )
- /* COOK */
- { VLC_FOURCC('c','o','o','k'), CODEC_ID_COOK,
- AUDIO_ES, "Cook Audio" },
+ { VLC_CODEC_COOK, CODEC_ID_COOK, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 4, 0 )
- /* TTA: The Lossless True Audio */
- { VLC_FOURCC('T','T','A','1'), CODEC_ID_TTA,
- AUDIO_ES, "The Lossless True Audio" },
+ { VLC_CODEC_TTA, CODEC_ID_TTA, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 8, 0 )
- /* Shorten */
- { VLC_FOURCC('s','h','n',' '), CODEC_ID_SHORTEN,
- AUDIO_ES, "Shorten Lossless Audio" },
- { VLC_FOURCC('s','h','r','n'), CODEC_ID_SHORTEN,
- AUDIO_ES, "Shorten Lossless Audio" },
+ { VLC_CODEC_SHORTEN, CODEC_ID_SHORTEN, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 16, 0 )
- { VLC_FOURCC('w','v','p','k'), CODEC_ID_WAVPACK,
- AUDIO_ES, "WavPack" },
- { VLC_FOURCC('W','V','P','K'), CODEC_ID_WAVPACK,
- AUDIO_ES, "WavPack" },
+ { VLC_CODEC_WAVPACK, CODEC_ID_WAVPACK, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 34, 0 )
- { VLC_FOURCC('g','s','m',' '), CODEC_ID_GSM,
- AUDIO_ES, "GSM Audio" },
- { VLC_FOURCC('a','g','s','m'), CODEC_ID_GSM_MS, /* According to http://wiki.multimedia.cx/index.php?title=GSM */
- AUDIO_ES, "Microsoft GSM Audio" },
+ { VLC_CODEC_GSM, CODEC_ID_GSM, AUDIO_ES },
+ { VLC_CODEC_GSM_MS, CODEC_ID_GSM_MS, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 40, 4 )
- { VLC_FOURCC('a','t','r','c'), CODEC_ID_ATRAC3,
- AUDIO_ES, "atrac 3" },
- { VLC_FOURCC(0x70,0x2,0x0,0x0), CODEC_ID_ATRAC3,
- AUDIO_ES, "atrac 3" },
+ { VLC_CODEC_ATRAC3, CODEC_ID_ATRAC3, AUDIO_ES },
#endif
- { VLC_FOURCC('S','O','N','C'), CODEC_ID_SONIC,
- AUDIO_ES, "Sonic" },
+ { VLC_CODEC_SONIC, CODEC_ID_SONIC, AUDIO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 34, 0 )
- { VLC_FOURCC(0x1,0x4,0x0,0x0), CODEC_ID_IMC,
- AUDIO_ES, "IMC" },
+ { VLC_CODEC_IMC, CODEC_ID_IMC, AUDIO_ES },
#endif
- { VLC_FOURCC(0x22,0x0,0x0,0x0), CODEC_ID_TRUESPEECH,
- AUDIO_ES, "TrueSpeech" },
+ { VLC_CODEC_TRUESPEECH, CODEC_ID_TRUESPEECH, AUDIO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 46, 0 )
- { VLC_FOURCC('N','E','L','L'), CODEC_ID_NELLYMOSER,
- AUDIO_ES, "NellyMoser ASAO" },
+ { VLC_CODEC_NELLYMOSER, CODEC_ID_NELLYMOSER, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 44, 0 )
- { VLC_FOURCC('A','P','E',' '), CODEC_ID_APE,
- AUDIO_ES, "Monkey's Audio" },
+ { VLC_CODEC_APE, CODEC_ID_APE, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 58, 0 )
- { VLC_FOURCC('m','l','p',' '), CODEC_ID_MLP,
- AUDIO_ES, "MLP/TrueHD Audio" },
+ { VLC_CODEC_MLP, CODEC_ID_MLP, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 22, 0 )
- { VLC_FOURCC('t','r','h','d'), CODEC_ID_TRUEHD,
- AUDIO_ES, "TrueHD Audio" },
+ { VLC_CODEC_TRUEHD, CODEC_ID_TRUEHD, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 6, 0 )
- { VLC_FOURCC('Q','c','l','p'), CODEC_ID_QCELP,
- AUDIO_ES, "QCELP Audio" },
+ { VLC_CODEC_QCELP, CODEC_ID_QCELP, AUDIO_ES },
#endif
/* PCM */
- { VLC_FOURCC('s','8',' ',' '), CODEC_ID_PCM_S8,
- AUDIO_ES, "PCM S8" },
- { VLC_FOURCC('u','8',' ',' '), CODEC_ID_PCM_U8,
- AUDIO_ES, "PCM U8" },
- { VLC_FOURCC('s','1','6','l'), CODEC_ID_PCM_S16LE,
- AUDIO_ES, "PCM S16 LE" },
- { VLC_FOURCC('s','1','6','b'), CODEC_ID_PCM_S16BE,
- AUDIO_ES, "PCM S16 BE" },
- { VLC_FOURCC('u','1','6','l'), CODEC_ID_PCM_U16LE,
- AUDIO_ES, "PCM U16 LE" },
- { VLC_FOURCC('u','1','6','b'), CODEC_ID_PCM_U16BE,
- AUDIO_ES, "PCM U16 BE" },
- { VLC_FOURCC('s','2','4','l'), CODEC_ID_PCM_S24LE,
- AUDIO_ES, "PCM S24 LE" },
- { VLC_FOURCC('s','2','4','b'), CODEC_ID_PCM_S24BE,
- AUDIO_ES, "PCM S24 BE" },
- { VLC_FOURCC('u','2','4','l'), CODEC_ID_PCM_U24LE,
- AUDIO_ES, "PCM U24 LE" },
- { VLC_FOURCC('u','2','4','b'), CODEC_ID_PCM_U24BE,
- AUDIO_ES, "PCM U24 BE" },
- { VLC_FOURCC('s','3','2','l'), CODEC_ID_PCM_S32LE,
- AUDIO_ES, "PCM S32 LE" },
- { VLC_FOURCC('s','3','2','b'), CODEC_ID_PCM_S32BE,
- AUDIO_ES, "PCM S32 BE" },
- { VLC_FOURCC('u','3','2','l'), CODEC_ID_PCM_U32LE,
- AUDIO_ES, "PCM U32 LE" },
- { VLC_FOURCC('u','3','2','b'), CODEC_ID_PCM_U32BE,
- AUDIO_ES, "PCM U32 BE" },
- { VLC_FOURCC('a','l','a','w'), CODEC_ID_PCM_ALAW,
- AUDIO_ES, "PCM ALAW" },
- { VLC_FOURCC('u','l','a','w'), CODEC_ID_PCM_MULAW,
- AUDIO_ES, "PCM ULAW" },
- { VLC_FOURCC('d','a','u','d'), CODEC_ID_PCM_S24DAUD,
- AUDIO_ES, "PCM ULAW" },
+ { VLC_CODEC_S8, CODEC_ID_PCM_S8, AUDIO_ES },
+ { VLC_CODEC_U8, CODEC_ID_PCM_U8, AUDIO_ES },
+ { VLC_CODEC_S16L, CODEC_ID_PCM_S16LE, AUDIO_ES },
+ { VLC_CODEC_S16B, CODEC_ID_PCM_S16BE, AUDIO_ES },
+ { VLC_CODEC_U16L, CODEC_ID_PCM_U16LE, AUDIO_ES },
+ { VLC_CODEC_U16B, CODEC_ID_PCM_U16BE, AUDIO_ES },
+ { VLC_CODEC_S24L, CODEC_ID_PCM_S24LE, AUDIO_ES },
+ { VLC_CODEC_S24B, CODEC_ID_PCM_S24BE, AUDIO_ES },
+ { VLC_CODEC_U24L, CODEC_ID_PCM_U24LE, AUDIO_ES },
+ { VLC_CODEC_U24B, CODEC_ID_PCM_U24BE, AUDIO_ES },
+ { VLC_CODEC_S32L, CODEC_ID_PCM_S32LE, AUDIO_ES },
+ { VLC_CODEC_S32B, CODEC_ID_PCM_S32BE, AUDIO_ES },
+ { VLC_CODEC_U32L, CODEC_ID_PCM_U32LE, AUDIO_ES },
+ { VLC_CODEC_U32B, CODEC_ID_PCM_U32BE, AUDIO_ES },
+ { VLC_CODEC_ALAW, CODEC_ID_PCM_ALAW, AUDIO_ES },
+ { VLC_CODEC_MULAW, CODEC_ID_PCM_MULAW, AUDIO_ES },
+ { VLC_CODEC_S24DAUD, CODEC_ID_PCM_S24DAUD, AUDIO_ES },
/* Subtitle streams */
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 41, 0 )
/* Before this version, subs were too experimental */
- { VLC_FOURCC('s','p','u',' '), CODEC_ID_DVD_SUBTITLE,
- SPU_ES, "DVD Subtitles" },
- { VLC_FOURCC('d','v','b','s'), CODEC_ID_DVB_SUBTITLE,
- SPU_ES, "DVB Subtitles" },
- { VLC_FOURCC('s','u','b','t'), CODEC_ID_TEXT,
- SPU_ES, "Plain text subtitles" },
- { VLC_FOURCC('D','X','S','B'), CODEC_ID_XSUB,
- SPU_ES, "DivX XSUB subtitles" },
+ { VLC_CODEC_SPU, CODEC_ID_DVD_SUBTITLE, SPU_ES },
+ { VLC_CODEC_DVBS, CODEC_ID_DVB_SUBTITLE, SPU_ES },
+ { VLC_CODEC_SUBT, CODEC_ID_TEXT, SPU_ES },
+ { VLC_CODEC_XSUB, CODEC_ID_XSUB, SPU_ES },
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 50, 0 )
- { VLC_FOURCC('s','s','a',' '), CODEC_ID_SSA,
- SPU_ES, "SubStation Alpha subtitles" },
+ { VLC_CODEC_SSA, CODEC_ID_SSA, SPU_ES },
#endif
- { 0, 0, 0, "" }
+ { 0, 0, UNKNOWN_ES }
};
int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat,
int *pi_ffmpeg_codec, const char **ppsz_name )
{
+ i_fourcc = vlc_fourcc_GetCodec( UNKNOWN_ES, i_fourcc );
for( unsigned i = 0; codecs_table[i].i_fourcc != 0; i++ )
{
if( codecs_table[i].i_fourcc == i_fourcc )
{
if( pi_cat ) *pi_cat = codecs_table[i].i_cat;
if( pi_ffmpeg_codec ) *pi_ffmpeg_codec = codecs_table[i].i_codec;
- if( ppsz_name ) *ppsz_name = (char *)codecs_table[i].psz_name;
+ if( ppsz_name ) *ppsz_name = vlc_fourcc_GetDescription( UNKNOWN_ES, i_fourcc );//char *)codecs_table[i].psz_name;
return true;
}
{
if( pi_cat ) *pi_cat = codecs_table[i].i_cat;
if( pi_fourcc ) *pi_fourcc = codecs_table[i].i_fourcc;
- if( ppsz_name ) *ppsz_name = codecs_table[i].psz_name;
+ if( ppsz_name ) *ppsz_name = vlc_fourcc_GetDescription( codecs_table[i].i_cat, codecs_table[i].i_fourcc );
return true;
}
#include <vlc_common.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#include <vlc_codecs.h> /* BITMAPINFOHEADER */
#include <vlc_avcodec.h>
if( GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) != VLC_SUCCESS )
{
/* we are doomed, but not really, because most codecs set their pix_fmt much later */
- p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0');
+ p_dec->fmt_out.i_codec = VLC_CODEC_I420;
}
p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
p_sys->b_delayed_open = true;
/* ***** Fill p_context with init values ***** */
- p_sys->p_context->codec_tag = ffmpeg_CodecTag( p_dec->fmt_in.i_codec );
+ p_sys->p_context->codec_tag = ffmpeg_CodecTag( p_dec->fmt_in.i_original_fourcc ?: p_dec->fmt_in.i_codec );
/* ***** Get configuration of ffmpeg plugin ***** */
p_sys->p_context->workaround_bugs =
if( GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) != VLC_SUCCESS )
{
/* we are doomed. but not really, because most codecs set their pix_fmt later on */
- p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0');
+ p_dec->fmt_out.i_codec = VLC_CODEC_I420;
}
p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_input.h>
Eia608Init( &p_sys->eia608 );
p_dec->fmt_out.i_cat = SPU_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('T','E','X','T');
+ p_dec->fmt_out.i_codec = VLC_CODEC_TEXT;
return VLC_SUCCESS;
}
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_height = 0;
fmt.i_x_offset = fmt.i_y_offset = 0;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
/*****************************************************************************
* decoder_sys_t : decoder descriptor
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('C','D','G',' ') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_CDG )
return VLC_EGENERIC;
/* Allocate the memory needed to store the decoder's structure */
/* Set output properties
* TODO maybe it would be better to use RV16 or RV24 ? */
p_dec->fmt_out.i_cat = VIDEO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGB32;
p_dec->fmt_out.video.i_width = CDG_DISPLAY_WIDTH;
p_dec->fmt_out.video.i_height = CDG_DISPLAY_HEIGHT;
p_dec->fmt_out.video.i_aspect =
input_thread_t * p_input;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('c','m','m','l') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_CMML )
return VLC_EGENERIC;
p_dec->pf_decode_sub = DecodeBlock;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_osd.h>
#include <vlc_input.h>
csri_rend *p_render;
struct csri_stream_ext *p_stream_ext;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('s','s','a',' ') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_SSA )
return VLC_EGENERIC;
p_render = csri_renderer_default();
p_dec->fmt_in.p_extra ? strnlen( p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra ) : 0,
NULL);
p_dec->fmt_out.i_cat = SPU_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
return VLC_SUCCESS;
}
/* XXX On x86 at least our RGBA is mapped to their BGRA
* TODO confirm that is the same on big endian cpu */
fmt = *p_fmt;
- fmt.i_chroma = VLC_FOURCC('R','G','B','A');
+ fmt.i_chroma = VLC_CODEC_RGBA;
fmt.i_width = fmt.i_visible_width;
fmt.i_height = fmt.i_visible_height;
fmt.i_bits_per_pixel = 0;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include "vlc_bits.h"
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'c','v','d',' ' ) )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_CVD )
return VLC_EGENERIC;
- }
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
if( !p_sys )
p_dec->pf_packetize = Packetize;
p_dec->fmt_out.i_cat = SPU_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('Y','U','V','P');
+ p_dec->fmt_out.i_codec = VLC_CODEC_YUVP;
return VLC_SUCCESS;
}
/* Create new SPU region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+ fmt.i_chroma = VLC_CODEC_YUVP;
fmt.i_aspect = VOUT_ASPECT_FACTOR;
fmt.i_width = fmt.i_visible_width = p_sys->i_width;
fmt.i_height = fmt.i_visible_height = p_sys->i_height;
#include <vlc_plugin.h>
#include <vlc_codec.h>
#include <vlc_sout.h>
-#include <vlc_vout.h>
#include <libdirac_encoder/dirac_encoder.h>
float f_tmp;
char *psz_tmp;
- if( p_enc->fmt_out.i_codec != VLC_FOURCC('d','r','a','c') &&
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_DIRAC &&
!p_enc->b_force )
{
return VLC_EGENERIC;
p_enc->p_sys = p_sys;
p_enc->pf_encode_video = Encode;
- p_enc->fmt_out.i_codec = VLC_FOURCC('d','r','a','c');
+ p_enc->fmt_out.i_codec = VLC_CODEC_DIRAC;
p_enc->fmt_out.i_cat = VIDEO_ES;
if( ( p_sys->p_dts_fifo = block_FifoNew() ) == NULL )
if( !psz_tmp )
goto error;
else if( !strcmp( psz_tmp, "420" ) ) {
- p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
+ p_enc->fmt_in.i_codec = VLC_CODEC_I420;
p_enc->fmt_in.video.i_bits_per_pixel = 12;
p_sys->ctx.src_params.chroma = format420;
p_sys->i_buffer_in = p_enc->fmt_in.video.i_width * p_enc->fmt_in.video.i_height * 3 / 2;
}
else if( !strcmp( psz_tmp, "422" ) ) {
- p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','2');
+ p_enc->fmt_in.i_codec = VLC_CODEC_I422;
p_enc->fmt_in.video.i_bits_per_pixel = 16;
p_sys->ctx.src_params.chroma = format422;
p_sys->i_buffer_in = p_enc->fmt_in.video.i_width * p_enc->fmt_in.video.i_height * 2;
}
else if( !strcmp( psz_tmp, "444" ) ) {
- p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','4','4');
+ p_enc->fmt_in.i_codec = VLC_CODEC_I444;
p_enc->fmt_in.video.i_bits_per_pixel = 24;
p_sys->ctx.src_params.chroma = format444;
p_sys->i_buffer_in = p_enc->fmt_in.video.i_width * p_enc->fmt_in.video.i_height * 3;
#include <vlc_common.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#ifndef WIN32
# define LOADER
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#include <vlc_aout.h>
#ifndef WIN32
static const codec_dll decoders_table[] =
{
/* WVC1 */
- { VLC_FOURCC('W','V','C','1'), "wvc1dmod.dll", &guid_wvc1 },
- { VLC_FOURCC('w','v','c','1'), "wvc1dmod.dll", &guid_wvc1 },
+ { VLC_CODEC_VC1, "wvc1dmod.dll", &guid_wvc1 },
/* WMV3 */
- { VLC_FOURCC('W','M','V','3'), "wmv9dmod.dll", &guid_wmv9 },
- { VLC_FOURCC('w','m','v','3'), "wmv9dmod.dll", &guid_wmv9 },
- { VLC_FOURCC('W','M','V','P'), "wmv9dmod.dll", &guid_wmv9 },
- { VLC_FOURCC('w','m','v','p'), "wmv9dmod.dll", &guid_wmv9 },
+ { VLC_CODEC_WMV3, "wmv9dmod.dll", &guid_wmv9 },
/* WMV2 */
- { VLC_FOURCC('W','M','V','2'), "wmvdmod.dll", &guid_wmv },
- { VLC_FOURCC('w','m','v','2'), "wmvdmod.dll", &guid_wmv },
+ { VLC_CODEC_WMV2, "wmvdmod.dll", &guid_wmv },
/* WMV1 */
- { VLC_FOURCC('W','M','V','1'), "wmvdmod.dll", &guid_wmv },
- { VLC_FOURCC('w','m','v','1'), "wmvdmod.dll", &guid_wmv },
+ { VLC_CODEC_WMV1, "wmvdmod.dll", &guid_wmv },
/* Screen codecs */
{ VLC_FOURCC('M','S','S','2'), "wmsdmod.dll", &guid_wms },
{ VLC_FOURCC('m','s','s','2'), "wmsdmod.dll", &guid_wms },
{ VLC_FOURCC('M','S','S','1'), "wmsdmod.dll", &guid_wms },
{ VLC_FOURCC('m','s','s','1'), "wmsdmod.dll", &guid_wms },
/* Windows Media Video Adv */
- { VLC_FOURCC('W','M','V','A'), "wmvadvd.dll", &guid_wmva },
- { VLC_FOURCC('w','m','v','a'), "wmvadvd.dll", &guid_wmva },
- { VLC_FOURCC('W','V','P','2'), "wmvadvd.dll", &guid_wmva },
- { VLC_FOURCC('w','v','p','2'), "wmvadvd.dll", &guid_wmva },
+ { VLC_CODEC_WMVA, "wmvadvd.dll", &guid_wmva },
/* WMA 3 */
- { VLC_FOURCC('W','M','A','3'), "wma9dmod.dll", &guid_wma9 },
- { VLC_FOURCC('w','m','a','3'), "wma9dmod.dll", &guid_wma9 },
- { VLC_FOURCC('W','M','A','P'), "wma9dmod.dll", &guid_wma9 },
- { VLC_FOURCC('w','m','a','p'), "wma9dmod.dll", &guid_wma9 },
- { VLC_FOURCC('W','M','A','L'), "wma9dmod.dll", &guid_wma9 },
- { VLC_FOURCC('w','m','a','l'), "wma9dmod.dll", &guid_wma9 },
+ { VLC_CODEC_WMAP, "wma9dmod.dll", &guid_wma9 },
+ { VLC_CODEC_WMAL, "wma9dmod.dll", &guid_wma9 },
+
/* WMA 2 */
- { VLC_FOURCC('W','M','A','2'), "wma9dmod.dll", &guid_wma9 },
- { VLC_FOURCC('w','m','a','2'), "wma9dmod.dll", &guid_wma9 },
+ { VLC_CODEC_WMA2, "wma9dmod.dll", &guid_wma9 },
/* WMA Speech */
- { VLC_FOURCC('W','M','A','S'), "wmspdmod.dll", &guid_wma },
- { VLC_FOURCC('w','m','a','s'), "wmspdmod.dll", &guid_wma },
+ { VLC_CODEC_WMAS, "wmspdmod.dll", &guid_wma },
/* */
{ 0, NULL, NULL }
static const codec_dll encoders_table[] =
{
/* WMV3 */
- { VLC_FOURCC('W','M','V','3'), "wmvdmoe2.dll", &guid_wmv_enc2 },
- { VLC_FOURCC('w','m','v','3'), "wmvdmoe2.dll", &guid_wmv_enc2 },
+ { VLC_CODEC_WMV3, "wmvdmoe2.dll", &guid_wmv_enc2 },
/* WMV2 */
- { VLC_FOURCC('W','M','V','2'), "wmvdmoe2.dll", &guid_wmv_enc2 },
- { VLC_FOURCC('w','m','v','2'), "wmvdmoe2.dll", &guid_wmv_enc2 },
+ { VLC_CODEC_WMV2, "wmvdmoe2.dll", &guid_wmv_enc2 },
/* WMV1 */
- { VLC_FOURCC('W','M','V','1'), "wmvdmoe2.dll", &guid_wmv_enc2 },
- { VLC_FOURCC('w','m','v','1'), "wmvdmoe2.dll", &guid_wmv_enc2 },
+ { VLC_CODEC_WMV1, "wmvdmoe2.dll", &guid_wmv_enc2 },
/* WMA 3 */
- { VLC_FOURCC('W','M','A','3'), "wmadmoe.dll", &guid_wma_enc },
- { VLC_FOURCC('w','m','a','3'), "wmadmoe.dll", &guid_wma_enc },
+ { VLC_CODEC_WMAP, "wmadmoe.dll", &guid_wma_enc },
/* WMA 2 */
- { VLC_FOURCC('W','M','A','2'), "wmadmoe.dll", &guid_wma_enc },
- { VLC_FOURCC('w','m','a','2'), "wmadmoe.dll", &guid_wma_enc },
+ { VLC_CODEC_WMA2, "wmadmoe.dll", &guid_wma_enc },
/* */
{ 0, NULL, NULL }
dmo_input_type.majortype = MEDIATYPE_Audio;
dmo_input_type.subtype = dmo_input_type.majortype;
- dmo_input_type.subtype.Data1 = p_dec->fmt_in.i_codec;
+ dmo_input_type.subtype.Data1 = p_dec->fmt_in.i_original_fourcc ?: p_dec->fmt_in.i_codec;
fourcc_to_wf_tag( p_dec->fmt_in.i_codec, &i_tag );
if( i_tag ) dmo_input_type.subtype.Data1 = i_tag;
memcpy( &p_vih[1], p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra );
p_bih = &p_vih->bmiHeader;
- p_bih->biCompression = p_dec->fmt_in.i_codec;
+ p_bih->biCompression = p_dec->fmt_in.i_original_fourcc ?: p_dec->fmt_in.i_codec;
p_bih->biWidth = p_dec->fmt_in.video.i_width;
p_bih->biHeight = p_dec->fmt_in.video.i_height;
p_bih->biBitCount = p_dec->fmt_in.video.i_bits_per_pixel;
dmo_input_type.majortype = MEDIATYPE_Video;
dmo_input_type.subtype = dmo_input_type.majortype;
- dmo_input_type.subtype.Data1 = p_dec->fmt_in.i_codec;
+ dmo_input_type.subtype.Data1 = p_dec->fmt_in.i_original_fourcc ?: p_dec->fmt_in.i_codec;
dmo_input_type.formattype = FORMAT_VideoInfo;
dmo_input_type.bFixedSizeSamples = 0;
dmo_input_type.bTemporalCompression = 1;
if( p_dec->fmt_in.i_cat == AUDIO_ES )
{
/* Setup the format */
- p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
p_dec->fmt_out.audio.i_rate = p_dec->fmt_in.audio.i_rate;
p_dec->fmt_out.audio.i_channels = p_dec->fmt_in.audio.i_channels;
p_dec->fmt_out.audio.i_bitspersample = 16;//p_dec->fmt_in.audio.i_bitspersample; We request 16
{
BITMAPINFOHEADER *p_bih;
DMO_MEDIA_TYPE mt;
- unsigned i_chroma = VLC_FOURCC('Y','U','Y','2');
+ unsigned i_chroma = VLC_CODEC_YUYV;
int i_planes = 1, i_bpp = 16;
int i = 0;
/* Find out which chroma to use */
while( !p_dmo->vt->GetOutputType( p_dmo, 0, i++, &mt ) )
{
- if( mt.subtype.Data1 == VLC_FOURCC('Y','V','1','2') )
+ if( mt.subtype.Data1 == VLC_CODEC_YV12 )
{
i_chroma = mt.subtype.Data1;
i_planes = 3; i_bpp = 12;
DMOFreeMediaType( &mt );
}
- p_dec->fmt_out.i_codec = i_chroma == VLC_FOURCC('Y','V','1','2') ?
- VLC_FOURCC('I','4','2','0') : i_chroma;
+ p_dec->fmt_out.i_codec = i_chroma == VLC_CODEC_YV12 ?
+ VLC_CODEC_I420 : i_chroma;
p_dec->fmt_out.video.i_width = p_dec->fmt_in.video.i_width;
p_dec->fmt_out.video.i_height = p_dec->fmt_in.video.i_height;
p_dec->fmt_out.video.i_bits_per_pixel = i_bpp;
uint16_t i_tag;
dmo_partial_type.type = MEDIATYPE_Audio;
dmo_partial_type.subtype = dmo_partial_type.type;
- dmo_partial_type.subtype.Data1 = p_fmt->i_codec;
+ dmo_partial_type.subtype.Data1 = p_fmt->i_original_fourcc ?: p_fmt->i_codec;
fourcc_to_wf_tag( p_fmt->i_codec, &i_tag );
if( i_tag ) dmo_partial_type.subtype.Data1 = i_tag;
}
{
dmo_partial_type.type = MEDIATYPE_Video;
dmo_partial_type.subtype = dmo_partial_type.type;
- dmo_partial_type.subtype.Data1 = p_fmt->i_codec;
+ dmo_partial_type.subtype.Data1 = p_fmt->i_original_fourcc ?: p_fmt->i_codec;
}
#ifndef LOADER
memset( &vih, 0, sizeof(VIDEOINFOHEADER) );
p_bih = &vih.bmiHeader;
- p_bih->biCompression = VLC_FOURCC('I','4','2','0');
+ p_bih->biCompression = VLC_CODEC_I420;
p_bih->biWidth = p_enc->fmt_in.video.i_width;
p_bih->biHeight = p_enc->fmt_in.video.i_height;
p_bih->biBitCount = p_enc->fmt_in.video.i_bits_per_pixel;
i_err = p_dmo->vt->SetOutputType( p_dmo, 0, &dmo_type, 0 );
p_vih = (VIDEOINFOHEADER *)dmo_type.pbFormat;
- p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
+ p_enc->fmt_in.i_codec = VLC_CODEC_I420;
DMOFreeMediaType( &dmo_type );
if( i_err )
fourcc_to_wf_tag( p_enc->fmt_out.i_codec, &i_tag );
if( i_tag == 0 ) return VLC_EGENERIC;
- p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
+ p_enc->fmt_in.i_codec = VLC_CODEC_S16N;
p_enc->fmt_in.audio.i_bitspersample = 16;
/* We first need to choose an output type from the predefined
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('d','t','s',' ') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC('d','t','s','b') )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_DTS )
return VLC_EGENERIC;
- }
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys = malloc(sizeof(*p_sys)) ) == NULL )
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('d','t','s',' ');
+ p_dec->fmt_out.i_codec = VLC_CODEC_DTS;
p_dec->fmt_out.audio.i_rate = 0; /* So end_date gets initialized */
/* Set callback */
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_sout.h>
vlc_value_t val;
int i_posx, i_posy;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('d','v','b','s') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_DVBS )
{
return VLC_EGENERIC;
}
continue;
}
- /* FIXME: don't create a subpicture region with VLC_FOURCC YUVP
+ /* FIXME: don't create a subpicture region with VLC CODEC YUVP
* when it actually is a TEXT region */
/* Create new SPU region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+ fmt.i_chroma = VLC_CODEC_YUVP;
fmt.i_aspect = 0; /* 0 means use aspect ratio of background video */
fmt.i_width = fmt.i_visible_width = p_region->i_width;
fmt.i_height = fmt.i_visible_height = p_region->i_height;
/* Create new SPU region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = VOUT_ASPECT_FACTOR;
fmt.i_width = fmt.i_visible_width = p_region->i_width;
fmt.i_height = fmt.i_visible_height = p_region->i_height;
encoder_sys_t *p_sys;
vlc_value_t val;
- if( ( p_enc->fmt_out.i_codec != VLC_FOURCC('d','v','b','s') ) &&
+ if( ( p_enc->fmt_out.i_codec != VLC_CODEC_DVBS ) &&
!p_enc->b_force )
{
return VLC_EGENERIC;
p_enc->p_sys = p_sys;
p_enc->pf_encode_sub = Encode;
- p_enc->fmt_out.i_codec = VLC_FOURCC('d','v','b','s');
+ p_enc->fmt_out.i_codec = VLC_CODEC_DVBS;
p_enc->fmt_out.subs.dvb.i_id = 1 << 16 | 1;
config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
return VLC_SUCCESS;
}
-/* FIXME: this routine is a hack to convert VLC_FOURCC('Y','U','V','A')
- * into VLC_FOURCC('Y','U','V','P')
+/* FIXME: this routine is a hack to convert VLC_CODEC_YUVA
+ * into VLC_CODEC_YUVP
*/
static subpicture_t *YuvaYuvp( subpicture_t *p_subpic )
{
#ifdef DEBUG_DVBSUB
msg_Dbg( p_enc, "YuvaYuvp: i_pixels=%d, i_iterator=%d", i_pixels, i_iterator );
#endif
- p_fmt->i_chroma = VLC_FOURCC('Y','U','V','P');
+ p_fmt->i_chroma = VLC_CODEC_YUVP;
p_fmt->p_palette = (video_palette_t *) malloc( sizeof( video_palette_t ) );
if( !p_fmt->p_palette ) break;
p_fmt->p_palette->i_entries = 0;
if( !p_subpic || !p_subpic->p_region ) return NULL;
- /* FIXME: this is a hack to convert VLC_FOURCC('Y','U','V','A') into
- * VLC_FOURCC('Y','U','V','P')
+ /* FIXME: this is a hack to convert VLC_CODEC_YUVA into
+ * VLC_CODEC_YUVP
*/
p_region = p_subpic->p_region;
- if( p_region->fmt.i_chroma == VLC_FOURCC('Y','U','V','A') )
+ if( p_region->fmt.i_chroma == VLC_CODEC_YUVA )
{
p_temp = YuvaYuvp( p_subpic );
if( !p_temp )
/* Sanity check */
if( !p_region ) return NULL;
- if( ( p_region->fmt.i_chroma != VLC_FOURCC('T','E','X','T') ) &&
- ( p_region->fmt.i_chroma != VLC_FOURCC('Y','U','V','P') ) )
+ if( ( p_region->fmt.i_chroma != VLC_CODEC_TEXT ) &&
+ ( p_region->fmt.i_chroma != VLC_CODEC_YUVP ) )
{
char psz_fourcc[5];
memset( &psz_fourcc, 0, sizeof( psz_fourcc ) );
/* Sanity check */
if( !p_region ) return;
- if( p_region->fmt.i_chroma == VLC_FOURCC('Y','U','V','P') )
+ if( p_region->fmt.i_chroma == VLC_CODEC_YUVP )
{
p_pal = p_region->fmt.p_palette;
}
{
int i_entries = 4, i_depth = 0x1, i_bg = 0;
bool b_text =
- ( p_region->fmt.i_chroma == VLC_FOURCC('T','E','X','T') );
+ ( p_region->fmt.i_chroma == VLC_CODEC_TEXT );
if( !b_text )
{
/* object coding method */
switch( p_region->fmt.i_chroma )
{
- case VLC_FOURCC( 'Y','U','V','P' ):
+ case VLC_CODEC_YUVP:
bs_write( s, 2, 0 );
break;
- case VLC_FOURCC( 'T','E','X','T' ):
+ case VLC_CODEC_TEXT:
bs_write( s, 2, 1 );
break;
default:
bs_write( s, 1, 0 ); /* non modifying color flag */
bs_write( s, 1, 0 ); /* Reserved */
- if( p_region->fmt.i_chroma == VLC_FOURCC( 'T','E','X','T' ) )
+ if( p_region->fmt.i_chroma == VLC_CODEC_TEXT )
{
int i_size, i;
unsigned int i_line;
/* Sanity check */
- if( p_region->fmt.i_chroma != VLC_FOURCC('Y','U','V','P') ) return;
+ if( p_region->fmt.i_chroma != VLC_CODEC_YUVP ) return;
/* Encode line by line */
for( i_line = !b_top; i_line < p_region->fmt.i_visible_height;
decoder_sys_t *p_sys = p_dec->p_sys;
faacDecConfiguration *cfg;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','4','a') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_MP4A )
{
return VLC_EGENERIC;
}
p_dec->fmt_out.i_cat = AUDIO_ES;
if (vlc_CPU() & CPU_CAPABILITY_FPU)
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
else
- p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
p_dec->pf_decode_audio = DecodeBlock;
p_dec->fmt_out.audio.i_physical_channels =
var_AddCallback( p_dec, "fake-file-reload", FakeCallback , p_dec );
psz_chroma = var_CreateGetString( p_dec, "fake-chroma" );
- if( strlen( psz_chroma ) != 4 )
+ fmt_out.i_chroma = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_chroma );
+ if( !fmt_out.i_chroma )
{
msg_Warn( p_dec, "Invalid chroma (%s). Using I420.", psz_chroma );
- fmt_out.i_chroma = VLC_FOURCC('I','4','2','0');
- }
- else
- {
- fmt_out.i_chroma = VLC_FOURCC( psz_chroma[0],
- psz_chroma[1],
- psz_chroma[2],
- psz_chroma[3] );
+ fmt_out.i_chroma = VLC_CODEC_I420;
}
free( psz_chroma );
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('f','l','a','c') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_FLAC )
{
return VLC_EGENERIC;
}
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
/* Set callbacks */
#ifdef USE_LIBFLAC
p_dec->pf_packetize = PacketizeBlock;
/* Set output properties */
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','a','c');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FLAC;
if( i_ret != VLC_SUCCESS )
{
if( !p_sys->b_stream_info ) return;
- if( p_dec->fmt_out.i_codec == VLC_FOURCC('f','l','a','c') )
+ if( p_dec->fmt_out.i_codec == VLC_CODEC_FLAC )
{
p_dec->fmt_out.i_extra = p_dec->fmt_in.i_extra;
p_dec->fmt_out.p_extra =
switch( metadata->data.stream_info.bits_per_sample )
{
case 8:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','8',' ',' ');
+ p_dec->fmt_out.i_codec = VLC_CODEC_S8;
break;
case 16:
- p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
break;
case 24:
- p_dec->fmt_out.i_codec = AOUT_FMT_S24_NE;
+ p_dec->fmt_out.i_codec = VLC_CODEC_S24N;
break;
default:
msg_Dbg( p_dec, "strange bit/sample value: %d",
metadata->data.stream_info.bits_per_sample );
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FI32;
break;
}
}
encoder_t *p_enc = (encoder_t *)p_this;
encoder_sys_t *p_sys;
- if( p_enc->fmt_out.i_codec != VLC_FOURCC('f','l','a','c') &&
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_FLAC &&
!p_enc->b_force )
{
return VLC_EGENERIC;
return VLC_ENOMEM;
p_enc->p_sys = p_sys;
p_enc->pf_encode_audio = Encode;
- p_enc->fmt_out.i_codec = VLC_FOURCC('f','l','a','c');
+ p_enc->fmt_out.i_codec = VLC_CODEC_FLAC;
p_sys->i_headers = 0;
p_sys->p_buffer = 0;
FLAC__stream_encoder_set_sample_rate( p_sys->p_flac,
p_enc->fmt_in.audio.i_rate );
FLAC__stream_encoder_set_bits_per_sample( p_sys->p_flac, 16 );
- p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
+ p_enc->fmt_in.i_codec = VLC_CODEC_S16N;
/* Get and store the STREAMINFO metadata block as a p_extra */
p_sys->p_chain = 0;
decoder_t *p_dec = (decoder_t *)p_this;
decoder_sys_t *p_sys;
- if (p_dec->fmt_in.i_codec != VLC_FOURCC ('M', 'I', 'D', 'I'))
+ if (p_dec->fmt_in.i_codec != VLC_CODEC_MIDI)
return VLC_EGENERIC;
char *font_path = var_CreateGetNonEmptyString (p_this, "soundfont");
p_dec->fmt_out.audio.i_original_channels =
p_dec->fmt_out.audio.i_physical_channels =
AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
- p_dec->fmt_out.i_codec = VLC_FOURCC('f', 'l', '3', '2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
p_dec->fmt_out.audio.i_bitspersample = 32;
p_dec->pf_decode_audio = DecodeBlock;
}
/* Set output properties */
- //p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','2','4');
+ //p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGB24;
p_dec->fmt_out.video.i_width = p_dec->p_sys->i_width;
p_dec->fmt_out.video.i_height = p_dec->p_sys->i_height;
p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * p_dec->p_sys->i_width / p_dec->p_sys->i_height;
if( p_sys->p_pic != NULL )
picture_Release( p_sys->p_pic );
p_sys->p_pic = decoder_NewPicture( p_dec );
- p_sys->p_pic = p_dec->pf_vout_buffer_new( p_dec );
p_sys->p_pic->b_force = true;
p_sys->p_pic->p->i_pitch = p_dec->p_sys->i_pitch;
p_sys->p_pic->date = p_block->i_pts > 0 ? p_block->i_pts : p_block->i_dts;
decoder_sys_t *p_sys;
int i_ret;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('k','a','t','e') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_KATE )
{
return VLC_EGENERIC;
}
if( i_ret == VLC_SUCCESS )
{
p_dec->p_sys->b_packetizer = true;
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'k', 'a', 't', 'e' );
+ p_dec->fmt_out.i_codec = VLC_CODEC_KATE;
}
return i_ret;
/* create a full frame region - this will also tell Tiger the size of the frame */
fmt = *p_fmt;
- fmt.i_chroma = VLC_FOURCC('R','G','B','A');
+ fmt.i_chroma = VLC_CODEC_RGBA;
fmt.i_width = fmt.i_visible_width;
fmt.i_height = fmt.i_visible_height;
fmt.i_bits_per_pixel = 0;
/* create a separate region for the bitmap */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+ fmt.i_chroma = VLC_CODEC_YUVP;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_visible_width = ev->bitmap->width;
fmt.i_height = fmt.i_visible_height = ev->bitmap->height;
}
/* text region */
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_height = 0;
fmt.i_x_offset = fmt.i_y_offset = 0;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_osd.h>
#include <vlc_input.h>
decoder_sys_t *p_sys;
ass_track_t *p_track;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('s','s','a',' ') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_SSA )
return VLC_EGENERIC;
p_dec->pf_decode_sub = DecodeBlock;
vlc_mutex_unlock( &libass_lock );
p_dec->fmt_out.i_cat = SPU_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
return VLC_SUCCESS;
}
/* */
fmt = *p_fmt;
- fmt.i_chroma = VLC_FOURCC('R','G','B','A');
+ fmt.i_chroma = VLC_CODEC_RGBA;
fmt.i_width = fmt.i_visible_width;
fmt.i_height = fmt.i_visible_height;
fmt.i_bits_per_pixel = 0;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_block_helper.h>
#include "../codec/cc.h"
decoder_sys_t *p_sys;
uint32_t i_accel = 0;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','v') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','1') &&
- /* Pinnacle hardware-mpeg1 */
- p_dec->fmt_in.i_codec != VLC_FOURCC('P','I','M','1') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','2','v') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','2') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC('h','d','v','2') )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV )
return VLC_EGENERIC;
+
+ /* Select onl recognized original format (standard mpeg video) */
+ switch( p_dec->fmt_in.i_original_fourcc )
+ {
+ case VLC_FOURCC('m','p','g','1'):
+ case VLC_FOURCC('m','p','g','2'):
+ case VLC_FOURCC('m','p','g','v'):
+ case VLC_FOURCC('P','I','M','1'):
+ case VLC_FOURCC('h','d','v','2'):
+ break;
+ default:
+ if( p_dec->fmt_in.i_original_fourcc )
+ return VLC_EGENERIC;
+ break;
}
/* Allocate the memory needed to store the decoder's structure */
p_dec->fmt_out.i_codec =
( p_sys->p_info->sequence->chroma_height <
p_sys->p_info->sequence->height ) ?
- VLC_FOURCC('I','4','2','0') : VLC_FOURCC('I','4','2','2');
+ VLC_CODEC_I420 : VLC_CODEC_I422;
/* Get a new picture */
p_pic = decoder_NewPicture( p_dec );
switch( p_dec->fmt_in.i_codec )
{
/* DVD LPCM */
- case VLC_FOURCC('l','p','c','m'):
- case VLC_FOURCC('l','p','c','b'):
+ case VLC_CODEC_DVD_LPCM:
b_dvd = true;
break;
/* BD LPCM */
- case VLC_FOURCC('b','p','c','m'):
+ case VLC_CODEC_BD_LPCM:
b_dvd = false;
break;
default:
if( b_packetizer )
{
- p_dec->fmt_out.i_codec = b_dvd ? VLC_FOURCC('l','p','c','m') : VLC_FOURCC('b','p','c','m');
+ p_dec->fmt_out.i_codec = b_dvd ? VLC_CODEC_DVD_LPCM : VLC_CODEC_BD_LPCM;
}
else
{
{
case 24:
case 20:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','b');
+ p_dec->fmt_out.i_codec = VLC_CODEC_S24B;
p_dec->fmt_out.audio.i_bitspersample = 24;
break;
default:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','b');
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16B;
p_dec->fmt_out.audio.i_bitspersample = 16;
break;
}
/* */
if( i_bits == 16 )
{
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','b');
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16B;
p_dec->fmt_out.audio.i_bitspersample = 16;
}
else
{
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','b');
+ p_dec->fmt_out.i_codec = VLC_CODEC_S24B;
p_dec->fmt_out.audio.i_bitspersample = 24;
}
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#include <vlc_block.h>
#include <p64/p64.h>
switch( p_dec->fmt_in.i_codec )
{
/* Planar YUV */
- case VLC_FOURCC('h','2','6','1'):
- case VLC_FOURCC('H','2','6','1'):
+ case VLC_CODEC_H261:
break;
default:
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0');
+ p_dec->fmt_out.i_codec = VLC_CODEC_I420;
/* Set callbacks */
p_dec->pf_decode_video = (picture_t *(*)(decoder_t *, block_t **))
{
msg_Dbg( p_dec, "video size is perhaps %dx%d", i_width,
i_height);
- vout_InitFormat( &p_dec->fmt_out.video, VLC_FOURCC('I','4','2','0'),
- i_width, i_height,
- VOUT_ASPECT_FACTOR * i_width / i_height );
+ video_format_Setup( &p_dec->fmt_out.video, VLC_CODEC_I420,
+ i_width, i_height,
+ VOUT_ASPECT_FACTOR * i_width / i_height );
p_sys->b_inited = true;
}
p_pic = NULL;
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','a') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGA )
{
return VLC_EGENERIC;
}
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('m','p','g','a');
+ p_dec->fmt_out.i_codec = VLC_CODEC_MPGA;
p_dec->fmt_out.audio.i_rate = 0; /* So end_date gets initialized */
/* Set callback */
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#include <png.h>
/*****************************************************************************
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('p','n','g',' ') &&
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_PNG &&
p_dec->fmt_in.i_codec != VLC_FOURCC('M','P','N','G') )
{
return VLC_EGENERIC;
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
/* Set callbacks */
p_dec->pf_decode_video = DecodeBlock;
if( p_sys->b_error ) goto error;
/* Set output properties */
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
p_dec->fmt_out.video.i_width = i_width;
p_dec->fmt_out.video.i_height = i_height;
p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * i_width / i_height;
}
else if( !(i_color_type & PNG_COLOR_MASK_ALPHA) )
{
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','2','4');
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGB24;
}
/* Get a new picture */
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#if !defined (__APPLE__) && !defined(WIN32)
switch( p_dec->fmt_in.i_codec )
{
- case VLC_FOURCC('h','2','6','4'): /* H.264 */
- case VLC_FOURCC('c','v','i','d'): /* Cinepak */
+ case VLC_CODEC_H264:
+ case VLC_CODEC_CINEPAK:
case VLC_FOURCC('I','V','4','1'): /* Indeo Video IV */
case VLC_FOURCC('i','v','4','1'): /* dto. */
#ifdef __APPLE__
case VLC_FOURCC('p','x','l','t'): /* Pixlet */
#endif
- case VLC_FOURCC('d','v','1','n'): /* DVC Pro 100 NTSC */
- case VLC_FOURCC('d','v','1','p'): /* DVC Pro 100 PAL */
- case VLC_FOURCC('d','v','h','p'): /* DVC PRO HD 720p */
- case VLC_FOURCC('d','v','h','6'): /* DVC PRO HD 1080i 60 */
- case VLC_FOURCC('d','v','h','5'): /* DVC PRO HD 1080i 50 */
-
- case VLC_FOURCC('S','V','Q','3'): /* Sorenson v3 */
- /* case VLC_FOURCC('S','V','Q','1'): Sorenson v1
+ case VLC_CODEC_DV:
+ case VLC_CODEC_SVQ3: /* Sorenson v3 */
+ /* case VLC_CODEC_SVQ1: Sorenson v1
case VLC_FOURCC('Z','y','G','o'):
case VLC_FOURCC('V','P','3','1'):
case VLC_FOURCC('3','I','V','1'): */
- case VLC_FOURCC('r','l','e',' '): /* QuickTime animation (RLE) */
- case VLC_FOURCC('r','p','z','a'): /* QuickTime Apple Video */
- case VLC_FOURCC('a','z','p','r'): /* QuickTime animation (RLE) */
+ case VLC_CODEC_QTRLE:
+ case VLC_CODEC_RPZA:
#ifdef LOADER
p_dec->p_sys = NULL;
p_dec->pf_decode_video = DecodeVideo;
if ((err != noErr) || (qtVersion < 0x07500000))
return VLC_EGENERIC;
#endif
- case VLC_FOURCC('s','a','m','r'): /* 3GPP AMR audio */
+ case VLC_CODEC_AMR_NB: /* 3GPP AMR audio */
case VLC_FOURCC('s','a','m','b'): /* 3GPP AMR-WB audio */
- case VLC_FOURCC('m','p','4','a'): /* MPEG-4 audio */
+ case VLC_CODEC_MP4A: /* MPEG-4 audio */
case VLC_FOURCC('Q','D','M','C'): /* QDesign */
- case VLC_FOURCC('Q','D','M','2'): /* QDesign* 2 */
- case VLC_FOURCC('Q','c','l','p'): /* Qualcomm Purevoice Codec */
+ case VLC_CODEC_QDM2: /* QDesign* 2 */
+ case VLC_CODEC_QCELP: /* Qualcomm Purevoice Codec */
case VLC_FOURCC('Q','C','L','P'): /* Qualcomm Purevoice Codec */
- case VLC_FOURCC('M','A','C','3'): /* MACE3 audio decoder */
- case VLC_FOURCC('M','A','C','6'): /* MACE6 audio decoder */
+ case VLC_CODEC_MACE3: /* MACE3 audio decoder */
+ case VLC_CODEC_MACE6: /* MACE6 audio decoder */
case VLC_FOURCC('d','v','c','a'): /* DV Audio */
case VLC_FOURCC('s','o','w','t'): /* 16-bit Little Endian */
case VLC_FOURCC('t','w','o','s'): /* 16-bit Big Endian */
- case VLC_FOURCC('a','l','a','w'): /* ALaw 2:1 */
+ case VLC_CODEC_ALAW: /* ALaw 2:1 */
case VLC_FOURCC('u','l','a','w'): /* mu-Law 2:1 */
case VLC_FOURCC('r','a','w',' '): /* 8-bit offset binaries */
- case VLC_FOURCC('f','l','3','2'): /* 32-bit Floating Point */
- case VLC_FOURCC('f','l','6','4'): /* 64-bit Floating Point */
+ case VLC_CODEC_FL32: /* 32-bit Floating Point */
+ case VLC_CODEC_FL64: /* 64-bit Floating Point */
case VLC_FOURCC('i','n','2','4'): /* 24-bit Interger */
case VLC_FOURCC('i','n','3','2'): /* 32-bit Integer */
case 0x0011: /* DVI IMA */
p_dec->p_sys = p_sys;
p_dec->pf_decode_audio = DecodeAudio;
- memcpy( fcc, &p_dec->fmt_in.i_codec, 4 );
+ if( p_dec->fmt_in.i_original_fourcc )
+ memcpy( fcc, &p_dec->fmt_in.i_original_fourcc, 4 );
+ else
+ memcpy( fcc, &p_dec->fmt_in.i_codec, 4 );
#ifdef __APPLE__
EnterMovies();
}
- es_format_Init( &p_dec->fmt_out, AUDIO_ES, AOUT_FMT_S16_NE );
+ es_format_Init( &p_dec->fmt_out, AUDIO_ES, VLC_CODEC_S16N );
p_dec->fmt_out.audio.i_rate = p_sys->OutputFormatInfo.sampleRate;
p_dec->fmt_out.audio.i_channels = p_sys->OutputFormatInfo.numChannels;
p_dec->fmt_out.audio.i_physical_channels =
return VLC_EGENERIC;
}
- memcpy( fcc, &p_dec->fmt_in.i_codec, 4 );
+ if( p_dec->fmt_in.i_original_fourcc )
+ memcpy( fcc, &p_dec->fmt_in.i_original_fourcc, 4 );
+ else
+ memcpy( fcc, &p_dec->fmt_in.i_codec, 4 );
+
msg_Dbg( p_dec, "quicktime_video %4.4s %dx%d",
fcc, p_dec->fmt_in.video.i_width, p_dec->fmt_in.video.i_height );
msg_Dbg( p_dec, "quicktime_video: ImageCodecPreDecompress cres=0x%X",
(int)cres );
- es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC( 'Y', 'U', 'Y', '2' ));
+ es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_YUYV);
p_dec->fmt_out.video.i_width = p_dec->fmt_in.video.i_width;
p_dec->fmt_out.video.i_height= p_dec->fmt_in.video.i_height;
p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * p_dec->fmt_in.video.i_width / p_dec->fmt_in.video.i_height;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
/*****************************************************************************
* decoder_sys_t : raw video decoder descriptor
switch( p_dec->fmt_in.i_codec )
{
/* Planar YUV */
- case VLC_FOURCC('I','4','4','4'):
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('I','4','1','1'):
- case VLC_FOURCC('I','4','1','0'):
- case VLC_FOURCC('Y','V','U','9'):
- case VLC_FOURCC('Y','4','2','B'):
- case VLC_FOURCC('Y','4','1','B'):
+ case VLC_CODEC_I444:
+ case VLC_CODEC_I422:
+ case VLC_CODEC_I420:
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I411:
+ case VLC_CODEC_I410:
+ case VLC_CODEC_GREY:
+ case VLC_CODEC_YUVP:
/* Packed YUV */
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('Y','8','0','0'):
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('H','D','Y','C'):
+ case VLC_CODEC_YUYV:
+ case VLC_CODEC_YVYU:
+ case VLC_CODEC_UYVY:
+ case VLC_CODEC_VYUY:
/* RGB */
- case VLC_FOURCC('R','V','3','2'):
- case VLC_FOURCC('R','V','2','4'):
- case VLC_FOURCC('R','V','1','6'):
- case VLC_FOURCC('R','V','1','5'):
- break;
- case VLC_FOURCC('2','V','u','y'):
- case VLC_FOURCC('2','v','u','y'):
- case VLC_FOURCC('A','V','U','I'):
- p_dec->fmt_in.i_codec = VLC_FOURCC('U','Y','V','Y');
- break;
- case VLC_FOURCC('y','v','1','2'):
- p_dec->fmt_in.i_codec = VLC_FOURCC('Y','V','1','2');
+ case VLC_CODEC_RGB32:
+ case VLC_CODEC_RGB24:
+ case VLC_CODEC_RGB16:
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB8:
+ case VLC_CODEC_RGBP:
break;
default:
}
/* Find out p_vdec->i_raw_size */
- vout_InitFormat( &p_dec->fmt_out.video, p_dec->fmt_in.i_codec,
- p_dec->fmt_in.video.i_width,
- p_dec->fmt_in.video.i_height,
- p_dec->fmt_in.video.i_aspect );
+ video_format_Setup( &p_dec->fmt_out.video, p_dec->fmt_in.i_codec,
+ p_dec->fmt_in.video.i_width,
+ p_dec->fmt_in.video.i_height,
+ p_dec->fmt_in.video.i_aspect );
p_sys->i_raw_size = p_dec->fmt_out.video.i_bits_per_pixel *
p_dec->fmt_out.video.i_width * p_dec->fmt_out.video.i_height / 8;
int i, j;
/* Fill in picture_t fields */
- vout_InitPicture( VLC_OBJECT(p_dec), &pic, p_dec->fmt_out.i_codec,
- p_dec->fmt_out.video.i_width,
- p_dec->fmt_out.video.i_height, VOUT_ASPECT_FACTOR );
+ picture_Setup( &pic, p_dec->fmt_out.i_codec,
+ p_dec->fmt_out.video.i_width,
+ p_dec->fmt_out.video.i_height, VOUT_ASPECT_FACTOR );
if( !pic.i_planes )
{
switch( p_dec->fmt_in.i_codec )
{
- case VLC_FOURCC('c','o','o','k'):
- case VLC_FOURCC('a','t','r','c'):
+ case VLC_CODEC_COOK:
+ case VLC_CODEC_ATRAC3:
case VLC_FOURCC('s','i','p','r'):
break;
if( p_sys->win32_dll ) Close( p_this );
#endif
- es_format_Init( &p_dec->fmt_out, AUDIO_ES, AOUT_FMT_S16_NE );
+ es_format_Init( &p_dec->fmt_out, AUDIO_ES, VLC_CODEC_S16N );
p_dec->fmt_out.audio.i_rate = p_dec->fmt_in.audio.i_rate;
p_dec->fmt_out.audio.i_channels = p_dec->fmt_in.audio.i_channels;
p_dec->fmt_out.audio.i_bitspersample =
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#ifdef LOADER
}
/* setup rv30 codec (codec sub-type and image dimensions): */
- /*if ( p_dec->fmt_in.i_codec == VLC_FOURCC('R','V','3','0') )*/
+ /*if ( p_dec->fmt_in.i_codec == VLC_CODEC_RV30 )*/
if (p_vide[1]>=0x20200002)
{
int i, cmsg_cnt;
(*rvyuv_custom_message)(&cmsg_data,p_sys->handle);
}
/*
- es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC( 'Y','V','1','2' ));
- es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC( 'Y','U','Y','2' ));
+ es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_YV12);
+ es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_YUYV);
*/
- es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC( 'I', '4', '2', '0'));
+ es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_I420);
p_dec->fmt_out.video.i_width = p_dec->fmt_in.video.i_width;
p_dec->fmt_out.video.i_height= p_dec->fmt_in.video.i_height;
switch ( p_dec->fmt_in.i_codec )
{
- case VLC_FOURCC('R','V','1','0'):
- case VLC_FOURCC('R','V','2','0'):
- case VLC_FOURCC('R','V','3','0'):
- case VLC_FOURCC('R','V','4','0'):
+ case VLC_CODEC_RV10:
+ case VLC_CODEC_RV20:
+ case VLC_CODEC_RV30:
+ case VLC_CODEC_RV40:
p_dec->p_sys = NULL;
p_dec->pf_decode_video = DecodeVideo;
return InitVideo(p_dec);
#include <vlc_plugin.h>
#include <vlc_codec.h>
#include <vlc_sout.h>
-#include <vlc_vout.h>
#include <schroedinger/schro.h>
decoder_sys_t *p_sys;
SchroDecoder *p_schro;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('d','r','a','c') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_DIRAC )
{
return VLC_EGENERIC;
}
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0');
+ p_dec->fmt_out.i_codec = VLC_CODEC_I420;
/* Set callbacks */
p_dec->pf_decode_video = DecodeBlock;
switch( p_sys->p_format->chroma_format )
{
- case SCHRO_CHROMA_420: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0'); break;
- case SCHRO_CHROMA_422: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','2'); break;
- case SCHRO_CHROMA_444: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','4','4'); break;
+ case SCHRO_CHROMA_420: p_dec->fmt_out.i_codec = VLC_CODEC_I420; break;
+ case SCHRO_CHROMA_422: p_dec->fmt_out.i_codec = VLC_CODEC_I422; break;
+ case SCHRO_CHROMA_444: p_dec->fmt_out.i_codec = VLC_CODEC_I444; break;
default:
p_dec->fmt_out.i_codec = 0;
break;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#include SDL_IMAGE_INCLUDE_FILE
const char *psz_sdl_type;
} p_supported_fmt[] =
{
- { VLC_FOURCC('t','g','a',' '), "TGA" },
- { VLC_FOURCC('b','m','p',' '), "BMP" },
- { VLC_FOURCC('p','n','m',' '), "PNM" },
+ { VLC_CODEC_TARGA, "TGA" },
+ { VLC_CODEC_BMP, "BMP" },
+ { VLC_CODEC_PNM, "PNM" },
{ VLC_FOURCC('x','p','m',' '), "XPM" },
{ VLC_FOURCC('x','c','f',' '), "XCF" },
- { VLC_FOURCC('p','c','x',' '), "PCX" },
- { VLC_FOURCC('g','i','f',' '), "GIF" },
- { VLC_FOURCC('j','p','e','g'), "JPG" },
- { VLC_FOURCC('t','i','f','f'), "TIF" },
+ { VLC_CODEC_PCX, "PCX" },
+ { VLC_CODEC_GIF, "GIF" },
+ { VLC_CODEC_JPEG, "JPG" },
+ { VLC_CODEC_TIFF, "TIF" },
{ VLC_FOURCC('l','b','m',' '), "LBM" },
- { VLC_FOURCC('p','n','g',' '), "PNG" }
+ { VLC_CODEC_PNG, "PNG" }
};
/*****************************************************************************
/* Set output properties - this is a decoy and isn't used anywhere */
p_dec->fmt_out.i_cat = VIDEO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGB32;
/* Set callbacks */
p_dec->pf_decode_video = DecodeBlock;
switch ( p_surface->format->BitsPerPixel )
{
case 16:
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','1','6');
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGB16;
break;
case 8:
case 24:
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','2','4');
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGB24;
break;
case 32:
- p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_RGB32;
break;
default:
msg_Warn( p_dec, "unknown bits/pixel format (%d)",
encoder_sys_t *p_sys;
/* FIXME: what about layers 1 and 2 ? shine is an 'MP3' encoder */
- if( p_enc->fmt_out.i_codec != VLC_FOURCC('m','p','3',' ') ||
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_MP3 ||
p_enc->fmt_out.audio.i_channels > 2 )
return VLC_EGENERIC;
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys = p_dec->p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('s','p','x',' ')
- && p_dec->fmt_in.i_codec != VLC_FOURCC('s', 'p', 'x', 'r') )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_SPEEX )
return VLC_EGENERIC;
- }
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
- p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
+ p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
/*
Set callbacks
being invoked on a Speex stream arriving via RTP.
A special decoder callback is used.
*/
- if (p_dec->fmt_in.i_codec == VLC_FOURCC('s', 'p', 'x', 'r'))
+ if (p_dec->fmt_in.i_original_fourcc == VLC_FOURCC('s', 'p', 'x', 'r'))
{
msg_Dbg( p_dec, "Using RTP version of Speex decoder @ rate %d.",
p_dec->fmt_in.audio.i_rate );
if( i_ret == VLC_SUCCESS )
{
p_dec->p_sys->b_packetizer = true;
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','p','x',' ');
+ p_dec->fmt_out.i_codec = VLC_CODEC_SPEEX;
}
return i_ret;
int pi_header[2];
uint8_t *p_extra;
- if( p_enc->fmt_out.i_codec != VLC_FOURCC('s','p','x',' ') &&
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_SPEEX &&
!p_enc->b_force )
{
return VLC_EGENERIC;
return VLC_ENOMEM;
p_enc->p_sys = p_sys;
p_enc->pf_encode_audio = Encode;
- p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
- p_enc->fmt_out.i_codec = VLC_FOURCC('s','p','x',' ');
+ p_enc->fmt_in.i_codec = VLC_CODEC_S16N;
+ p_enc->fmt_out.i_codec = VLC_CODEC_SPEEX;
speex_init_header( &p_sys->header, p_enc->fmt_in.audio.i_rate,
1, p_speex_mode );
#endif
#include <vlc_common.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_input.h>
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+ fmt.i_chroma = VLC_CODEC_YUVP;
fmt.i_aspect = 0; /* 0 means use aspect ratio of background video */
fmt.i_width = fmt.i_visible_width = p_spu_properties->i_width;
fmt.i_height = fmt.i_visible_height = p_spu_properties->i_height -
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 's','p','u',' ' ) &&
- p_dec->fmt_in.i_codec != VLC_FOURCC( 's','p','u','b' ) )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_SPU )
return VLC_EGENERIC;
- }
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
p_sys->i_spu = 0;
p_sys->p_block = NULL;
- es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) );
+ es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_CODEC_SPU );
p_dec->pf_decode_sub = Decode;
p_dec->pf_packetize = NULL;
p_dec->pf_packetize = Packetize;
p_dec->p_sys->b_packetizer = true;
es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
- p_dec->fmt_out.i_codec = VLC_FOURCC( 's','p','u',' ' );
+ p_dec->fmt_out.i_codec = VLC_CODEC_SPU;
return VLC_SUCCESS;
}
* 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;
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;
}
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;
}
}
&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" );
}
&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" );
}
switch( p_dec->fmt_in.i_codec )
{
- case VLC_FOURCC('s','u','b','t'):
- case VLC_FOURCC('s','s','a',' '):
- case VLC_FOURCC('t','1','4','0'):
+ case VLC_CODEC_SUBT:
+ case VLC_CODEC_SSA:
+ case VLC_CODEC_ITU_T140:
break;
default:
return VLC_EGENERIC;
char *psz_charset = NULL;
/* First try demux-specified encoding */
- if( p_dec->fmt_in.i_codec == VLC_FOURCC('t','1','4','0') )
+ if( p_dec->fmt_in.i_codec == VLC_CODEC_ITU_T140 )
psz_charset = strdup( "UTF-8" ); /* IUT T.140 is always using UTF-8 */
else
if( p_dec->fmt_in.subs.psz_encoding && *p_dec->fmt_in.subs.psz_encoding )
var_Get( p_dec, "subsdec-align", &val );
p_sys->i_align = val.i_int;
- if( p_dec->fmt_in.i_codec == VLC_FOURCC('s','s','a',' ')
+ if( p_dec->fmt_in.i_codec == VLC_CODEC_SSA
&& var_CreateGetBool( p_dec, "subsdec-formatted" ) )
{
if( p_dec->fmt_in.i_extra > 0 )
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_height = 0;
fmt.i_x_offset = fmt.i_y_offset = 0;
}
/* Decode and format the subpicture unit */
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('s','s','a',' ') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_SSA )
{
/* Normal text subs, easy markup */
p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
#define SUBSDEC_HEADER_H
#include <vlc_common.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_input.h>
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('u','s','f',' ') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_USF )
return VLC_EGENERIC;
/* Allocate the memory needed to store the decoder's structure */
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] );
}
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 )
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,
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_height = 0;
fmt.i_x_offset = fmt.i_y_offset = 0;
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 );
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
memset( &fmt_out, 0, sizeof( video_format_t));
fmt_in.i_chroma = type;
- fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt_out.i_chroma = VLC_CODEC_YUVA;
/* Find a suitable decoder module */
if( module_exists( "sdl_image" ) )
{
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;
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;
{
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;
{
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;
}
}
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 );
{
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 ) )
{
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 ) )
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 );
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;
}
}
}
break;
}
}
- free( p_style );
+ free( p_ssa_style );
}
/* Display the feed's image */
memset( &fmt_out, 0, sizeof( video_format_t));
- fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt_out.i_chroma = VLC_CODEC_YUVA;
fmt_out.i_aspect = VOUT_ASPECT_FACTOR;
fmt_out.i_sar_num = fmt_out.i_sar_den = 1;
fmt_out.i_width =
msg_Err( p_dec, "cannot allocate SPU region" );
return NULL;
}
- assert( p_pic->format.i_chroma == VLC_FOURCC('Y','U','V','A') );
+ assert( p_pic->format.i_chroma == VLC_CODEC_YUVA );
/* FIXME the copy is probably not needed anymore */
picture_CopyPixels( p_region->p_picture, p_pic );
int i_u = ( ( -38 * i_r - 74 * i_g + 112 * i_b + 128 ) >> 8 ) + 128 ;
int i_v = ( ( 112 * i_r - 94 * i_g - 18 * i_b + 128 ) >> 8 ) + 128 ;
- assert( p_region->fmt.i_chroma == VLC_FOURCC('Y','U','V','A') );
+ assert( p_region->fmt.i_chroma == VLC_CODEC_YUVA );
for( unsigned int y = 0; y < p_region->fmt.i_height; y++ )
{
for( unsigned int x = 0; x < p_region->fmt.i_width; x++ )
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_sout.h>
switch( p_enc->fmt_out.i_codec )
{
- case VLC_FOURCC('s','u','b','t'):
+ case VLC_CODEC_SUBT:
if( ( p_enc->fmt_out.subs.psz_encoding != NULL )
&& strcasecmp( p_enc->fmt_out.subs.psz_encoding, "utf8" )
&& strcasecmp( p_enc->fmt_out.subs.psz_encoding, "UTF-8" ) )
msg_Err( p_this, "Only UTF-8 encoding supported" );
return VLC_EGENERIC;
}
- case VLC_FOURCC('t','1','4','0'):
+ case VLC_CODEC_ITU_T140:
break;
default:
if( !p_enc->b_force )
return VLC_EGENERIC;
- p_enc->fmt_out.i_codec = VLC_FOURCC('t','1','4','0');
+ p_enc->fmt_out.i_codec = VLC_CODEC_ITU_T140;
}
p_enc->p_sys = NULL;
p_region = p_spu->p_region;
if( ( p_region == NULL )
- || ( p_region->fmt.i_chroma != VLC_FOURCC('T','E','X','T') )
+ || ( p_region->fmt.i_chroma != VLC_CODEC_TEXT )
|| ( p_region->psz_text == NULL ) )
return NULL;
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'o','g','t',' ' ) )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_OGT )
return VLC_EGENERIC;
- }
p_dec->p_sys = p_sys = calloc( 1, sizeof( decoder_sys_t ) );
if( p_sys == NULL )
p_sys->i_state = SUBTITLE_BLOCK_EMPTY;
p_sys->p_spu = NULL;
- es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 'o','g','t',' ' ) );
+ es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_CODEC_OGT );
p_dec->pf_decode_sub = Decode;
p_dec->pf_packetize = Packetize;
/* Create new subtitle region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+ fmt.i_chroma = VLC_CODEC_YUVP;
/**
The video on which the subtitle sits, is scaled, probably
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#include <ogg/ogg.h>
/* FIXME */
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('t','a','r','k') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_TARKIN )
{
return VLC_EGENERIC;
}
switch( p_sys->tarkin_stream->layer->desc.format )
{
case TARKIN_RGB24:
- i_chroma = VLC_FOURCC('R','V','2','4');
+ i_chroma = VLC_CODEC_RGB24;
i_stride = i_width * 3;
break;
case TARKIN_RGB32:
- i_chroma = VLC_FOURCC('R','V','3','2');
+ i_chroma = VLC_CODEC_RGB32;
i_stride = i_width * 4;
break;
case TARKIN_RGBA:
- i_chroma = VLC_FOURCC('R','G','B','A');
+ i_chroma = VLC_CODEC_RGBA;
i_stride = i_width * 4;
break;
default:
- i_chroma = VLC_FOURCC('I','4','2','0');
+ i_chroma = VLC_CODEC_I420;
i_stride = i_width;
break;
}
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include "vlc_vout.h"
#include "vlc_bits.h"
#include "vlc_codec.h"
vlc_value_t val;
int i;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('t','e','l','x'))
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_TELETEXT)
{
return VLC_EGENERIC;
}
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_height = 0;
fmt.i_x_offset = fmt.i_y_offset = 0;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#include <vlc_sout.h>
#include <vlc_input.h>
#include <ogg/ogg.h>
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('t','h','e','o') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_THEORA )
{
return VLC_EGENERIC;
}
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0');
+ p_dec->fmt_out.i_codec = VLC_CODEC_I420;
/* Set callbacks */
p_dec->pf_decode_video = (picture_t *(*)(decoder_t *, block_t **))
if( i_ret == VLC_SUCCESS )
{
p_dec->p_sys->b_packetizer = true;
- p_dec->fmt_out.i_codec = VLC_FOURCC( 't', 'h', 'e', 'o' );
+ p_dec->fmt_out.i_codec = VLC_CODEC_THEORA;
}
return i_ret;
switch( p_sys->ti.pixelformat )
{
case OC_PF_420:
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'I','4','2','0' );
+ p_dec->fmt_out.i_codec = VLC_CODEC_I420;
break;
case OC_PF_422:
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'I','4','2','2' );
+ p_dec->fmt_out.i_codec = VLC_CODEC_I422;
break;
case OC_PF_444:
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'I','4','4','4' );
+ p_dec->fmt_out.i_codec = VLC_CODEC_I444;
break;
case OC_PF_RSVD:
default:
vlc_value_t val;
int i_quality, i;
- if( p_enc->fmt_out.i_codec != VLC_FOURCC('t','h','e','o') &&
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_THEORA &&
!p_enc->b_force )
{
return VLC_EGENERIC;
p_enc->p_sys = p_sys;
p_enc->pf_encode_video = Encode;
- p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
- p_enc->fmt_out.i_codec = VLC_FOURCC('t','h','e','o');
+ p_enc->fmt_in.i_codec = VLC_CODEC_I420;
+ p_enc->fmt_out.i_codec = VLC_CODEC_THEORA;
config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
vlc_value_t val;
int i_frequency;
- if( p_enc->fmt_out.i_codec != VLC_FOURCC('m','p','g','a') &&
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_MPGA &&
p_enc->fmt_out.i_codec != VLC_FOURCC('m','p','2','a') &&
p_enc->fmt_out.i_codec != VLC_FOURCC('m','p','2',' ') &&
!p_enc->b_force )
p_enc->p_sys = p_sys;
p_enc->pf_encode_audio = Encode;
- p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
+ p_enc->fmt_in.i_codec = VLC_CODEC_S16N;
p_enc->fmt_out.i_cat = AUDIO_ES;
- p_enc->fmt_out.i_codec = VLC_FOURCC('m','p','g','a');
+ p_enc->fmt_out.i_codec = VLC_CODEC_MPGA;
config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('v','o','r','b') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_VORBIS )
{
return VLC_EGENERIC;
}
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
#ifdef MODULE_NAME_IS_tremor
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FI32;
#else
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
#endif
/* Set callbacks */
if( i_ret == VLC_SUCCESS )
{
p_dec->p_sys->b_packetizer = true;
- p_dec->fmt_out.i_codec = VLC_FOURCC('v','o','r','b');
+ p_dec->fmt_out.i_codec = VLC_CODEC_VORBIS;
}
return i_ret;
vlc_value_t val;
uint8_t *p_extra;
- if( p_enc->fmt_out.i_codec != VLC_FOURCC('v','o','r','b') &&
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_VORBIS &&
!p_enc->b_force )
{
return VLC_EGENERIC;
p_enc->p_sys = p_sys;
p_enc->pf_encode_audio = Encode;
- p_enc->fmt_in.i_codec = VLC_FOURCC('f','l','3','2');
- p_enc->fmt_out.i_codec = VLC_FOURCC('v','o','r','b');
+ p_enc->fmt_in.i_codec = VLC_CODEC_FL32;
+ p_enc->fmt_out.i_codec = VLC_CODEC_VORBIS;
config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('w','m','a','1') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC('W','M','A','1') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC('w','m','a','2') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC('W','M','A','2') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_WMA1 &&
+ p_dec->fmt_in.i_codec != VLC_CODEC_WMA2 )
{
return VLC_EGENERIC;
}
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FI32;
p_dec->fmt_out.audio.i_bitspersample = p_dec->fmt_in.audio.i_bitspersample;
p_dec->fmt_out.audio.i_rate = p_dec->fmt_in.audio.i_rate;
wfx.rate, wfx.bitrate, wfx.channels, wfx.blockalign,
wfx.bitspersample );
- if( p_dec->fmt_in.i_codec == VLC_FOURCC('w','m','a','1')
- || p_dec->fmt_in.i_codec == VLC_FOURCC('W','M','A','1') )
+ if( p_dec->fmt_in.i_codec == VLC_CODEC_WMA1 )
wfx.codec_id = ASF_CODEC_ID_WMAV1;
- else if( p_dec->fmt_in.i_codec == VLC_FOURCC('W','M','A','2')
- || p_dec->fmt_in.i_codec == VLC_FOURCC('w','m','a','2') )
+ else if( p_dec->fmt_in.i_codec == VLC_CODEC_WMA2 )
wfx.codec_id = ASF_CODEC_ID_WMAV2;
wfx.datalen = p_dec->fmt_in.i_extra;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_sout.h>
#include <vlc_codec.h>
x264_nal_t *nal;
int i, i_nal;
- if( p_enc->fmt_out.i_codec != VLC_FOURCC( 'h', '2', '6', '4' ) &&
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_H264 &&
!p_enc->b_force )
{
return VLC_EGENERIC;
config_ChainParse( p_enc, SOUT_CFG_PREFIX, ppsz_sout_options, p_enc->p_cfg );
p_enc->fmt_out.i_cat = VIDEO_ES;
- p_enc->fmt_out.i_codec = VLC_FOURCC( 'h', '2', '6', '4' );
- p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
+ p_enc->fmt_out.i_codec = VLC_CODEC_H264;
+ p_enc->fmt_in.i_codec = VLC_CODEC_I420;
p_enc->pf_encode_video = Encode;
p_enc->pf_encode_audio = NULL;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_codec_synchro.h>
#ifdef __GLIBC__
mtrace();
#endif
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','v') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','1') &&
- /* Pinnacle hardware-mpeg1 */
- p_dec->fmt_in.i_codec != VLC_FOURCC('P','I','M','1') &&
- /* VIA hardware-mpeg2 */
- p_dec->fmt_in.i_codec != VLC_FOURCC('X','x','M','C') &&
- /* ATI Video */
- p_dec->fmt_in.i_codec != VLC_FOURCC('V','C','R','2') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','2') )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV )
return VLC_EGENERIC;
+ /* Select onl recognized original format (standard mpeg video) */
+ switch( p_dec->fmt_in.i_original_fourcc )
+ {
+ case VLC_FOURCC('m','p','g','1'):
+ case VLC_FOURCC('m','p','g','2'):
+ case VLC_FOURCC('m','p','g','v'):
+ /* Pinnacle hardware-mpeg1 */
+ case VLC_FOURCC('P','I','M','1'):
+ /* VIA hardware-mpeg2 */
+ case VLC_FOURCC('X','x','M','C'):
+ /* ATI Video */
+ case VLC_FOURCC('V','C','R','2'):
+ break;
+ default:
+ if( p_dec->fmt_in.i_original_fourcc )
+ return VLC_EGENERIC;
+ break;
}
msg_Dbg(p_dec, "OpenDecoder Entering");
p_dec->fmt_out.i_codec =
( p_sys->p_info->sequence->chroma_height <
p_sys->p_info->sequence->height ) ?
- VLC_FOURCC('I','4','2','0') : VLC_FOURCC('I','4','2','2');
+ VLC_CODEC_I420 : VLC_CODEC_I422;
#if 0
p_sys->f_wd_nb = fopen("/vlc/dec_nb", "w");
#include <assert.h>
#include <libzvbi.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_osd.h>
decoder_t *p_dec = (decoder_t *) p_this;
decoder_sys_t *p_sys = NULL;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('t','e','l','x') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_TELETEXT )
return VLC_EGENERIC;
p_dec->pf_decode_sub = Decode;
/* Listen for keys */
var_AddCallback( p_dec->p_libvlc, "key-pressed", EventKey, p_dec );
- es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) );
+ es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_CODEC_SPU );
if( p_sys->b_text )
- p_dec->fmt_out.video.i_chroma = VLC_FOURCC('T','E','X','T');
+ p_dec->fmt_out.video.i_chroma = VLC_CODEC_TEXT;
else
- p_dec->fmt_out.video.i_chroma = VLC_FOURCC('R','G','B','A');
+ p_dec->fmt_out.video.i_chroma = VLC_CODEC_RGBA;
return VLC_SUCCESS;
}
}
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = b_text ? VLC_FOURCC('T','E','X','T') :
- VLC_FOURCC('R','G','B','A');
+ fmt.i_chroma = b_text ? VLC_CODEC_TEXT :
+ VLC_CODEC_RGBA;
fmt.i_aspect = b_text ? 0 : VOUT_ASPECT_FACTOR;
if( b_text )
{
{
unsigned int x, y;
- assert( fmt.i_chroma == VLC_FOURCC('R','G','B','A' ) );
+ assert( fmt.i_chroma == VLC_CODEC_RGBA );
/* Kludge since zvbi doesn't provide an option to specify opacity. */
for( y = 0; y < fmt.i_height; y++ )
if( i_position < p_playlist->current.i_size )
{
playlist_DeleteFromInput( p_playlist,
- p_playlist->current.p_elems[i_position]->p_input->i_id,
+ p_playlist->current.p_elems[i_position]->p_input,
pl_Locked );
}
PL_UNLOCK;
_("Aspect ratio: %s"),
text_list.p_list->p_values[i].psz_string );
- var_Change( p_vout, "aspect-ratio", VLC_VAR_FREELIST, &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
}
free( val.psz_string );
}
_("Crop: %s"),
text_list.p_list->p_values[i].psz_string );
- var_Change( p_vout, "crop", VLC_VAR_FREELIST, &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
}
free( val.psz_string );
}
_("Deinterlace mode: %s"),
text_list.p_list->p_values[i].psz_string );
- var_Change( p_vout, "deinterlace", VLC_VAR_FREELIST, &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
}
free( val.psz_string );
}
_("Zoom mode: %s"),
text_list.p_list->p_values[i].var.psz_name );
- var_Change( p_vout, "zoom", VLC_VAR_FREELIST, &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
}
}
else if( i_action == ACTIONID_CROP_TOP && p_vout )
/* Special action for mouse event */
/* FIXME: rework hotkeys handling to allow more than 1 event
* to trigger one same action */
- switch (newval.i_int & KEY_SPECIAL)
+ switch (newval.i_int & ~KEY_MODIFIER)
{
case KEY_MOUSEWHEELUP:
i_action = (i_mode == MOUSEWHEEL_VOLUME ) ? ACTIONID_VOL_UP
case KEY_MENU:
var_SetBool( libvlc, "intf-popupmenu", true );
break;
- default:
- return VLC_SUCCESS;
}
if( i_mode == NO_MOUSEWHEEL ) return VLC_SUCCESS;
}
case MVLC_DEL:
{
- int i_item, *p_items = NULL, i_nb_items = 0;
+ int *p_items = NULL;
+ size_t i_nb_items = 0;
char item[512];
const char *p_parser = p_request;
{
if( !*item ) continue;
- i_item = atoi( item );
+ int i_item = atoi( item );
p_items = realloc( p_items, (i_nb_items + 1) *
- sizeof(int) );
+ sizeof(*p_items) );
p_items[i_nb_items] = i_item;
i_nb_items++;
}
- if( i_nb_items )
+ for( size_t i = 0; i < i_nb_items; i++ )
{
- int i;
- for( i = 0; i < i_nb_items; i++ )
- {
+ playlist_item_t *p_item;
+
+ msg_Dbg( p_intf, "requested playlist delete: %d",
+ p_items[i] );
+ p_item = playlist_ItemGetById( p_sys->p_playlist,
+ p_items[i] );
+ if( p_item )
playlist_DeleteFromInput( p_sys->p_playlist,
- p_items[i], false );
- msg_Dbg( p_intf, "requested playlist delete: %d",
- p_items[i] );
- p_items[i] = -1;
- }
+ p_item->p_input,
+ false );
}
free( p_items );
}
case MVLC_KEEP:
{
- int i_item, *p_items = NULL, i_nb_items = 0;
+ int *p_items = NULL;
+ size_t i_nb_items = 0, i;
char item[512];
const char *p_parser = p_request;
- int i,j;
/* Get the list of items to keep */
while( (p_parser =
{
if( !*item ) continue;
- i_item = atoi( item );
+ int i_item = atoi( item );
p_items = realloc( p_items, (i_nb_items + 1) *
- sizeof(int) );
+ sizeof(*p_items) );
p_items[i_nb_items] = i_item;
i_nb_items++;
}
- for( i = p_sys->p_playlist->items.i_size - 1 ; i >= 0; i-- )
+ for( i = 0; i < p_sys->p_playlist->items.i_size; i++ )
{
+ size_t j;
+
/* Check if the item is in the keep list */
for( j = 0 ; j < i_nb_items ; j++ )
{
if( p_items[j] ==
- ARRAY_VAL(p_sys->p_playlist->items,i)
- ->i_id)
+ ARRAY_VAL(p_sys->p_playlist->items,i)->i_id)
break;
}
if( j == i_nb_items )
{
+ msg_Dbg( p_intf, "requested playlist delete: %d",
+ p_sys->p_playlist->items.p_elems[i]->i_id );
playlist_DeleteFromInput( p_sys->p_playlist,
- p_sys->p_playlist->items.p_elems[i]->i_id,
+ p_sys->p_playlist->items.p_elems[i]->p_input,
false );
- msg_Dbg( p_intf, "requested playlist delete: %d",
- i );
}
}
}
/* clean up everything */
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
- var_Change( p_sys->p_input, psz_variable, VLC_VAR_FREELIST, &val_list,
- &text_list );
+ var_FreeList( &val_list, &text_list );
return s;
}
if( p_item )
{
playlist_DeleteFromInput( p_sys->p_playlist,
- p_item->p_input->i_id, pl_Locked );
+ p_item->p_input, pl_Locked );
msg_Dbg( p_intf, "requested playlist delete: %d", i_id );
}
else
return;
mvar_t *itm = mvar_New( name, "set" );
- if( p_item->p_input->i_id == p_node->p_input->i_id )
+ if( p_item->p_input == p_node->p_input )
mvar_AppendNewVar( itm, "current", "1" );
else
mvar_AppendNewVar( itm, "current", "0" );
}
else
{
- vlc_value_t val_list;
-
/* Get. */
var_Get( p_input, "chapter", &val );
- var_Change( p_input, "chapter", VLC_VAR_GETCHOICES,
- &val_list, NULL );
- msg_rc( "Currently playing chapter %d/%d.",
- val.i_int, val_list.p_list->i_count );
- var_Change( p_this, "chapter", VLC_VAR_FREELIST,
- &val_list, NULL );
+ int i_chapter_count = var_CountChoices( p_input, "chapter" );
+ msg_rc( "Currently playing chapter %d/%d.", val.i_int,
+ i_chapter_count );
}
}
else if( !strcmp( psz_cmd, "chapter_n" ) )
}
else
{
- vlc_value_t val_list;
-
/* Get. */
var_Get( p_input, "title", &val );
- var_Change( p_input, "title", VLC_VAR_GETCHOICES,
- &val_list, NULL );
- msg_rc( "Currently playing title %d/%d.",
- val.i_int, val_list.p_list->i_count );
- var_Change( p_this, "title", VLC_VAR_FREELIST,
- &val_list, NULL );
+ int i_title_count = var_CountChoices( p_input, "title" );
+ msg_rc( "Currently playing title %d/%d.", val.i_int,
+ i_title_count );
}
}
else if( !strcmp( psz_cmd, "title_n" ) )
msg_rc( "| %i - %s", val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string );
}
- var_Change( p_input, psz_variable, VLC_VAR_FREELIST,
- &val, &text );
+ var_FreeList( &val, &text );
msg_rc( "+----[ end of %s ]", val_name.psz_string );
free( val_name.psz_string );
}
free( psz_value );
}
- var_Change( p_vout, psz_variable, VLC_VAR_FREELIST,
- &val, &text );
+ var_FreeList( &val, &text );
msg_rc( "+----[ end of %s ]", val_name.psz_string );
free( val_name.psz_string );
msg_rc( "| %i - %s", val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string );
}
- var_Change( (vlc_object_t *)p_aout, psz_variable, VLC_VAR_FREELIST,
- &val, &text );
+ var_FreeList( &val, &text );
msg_rc( "+----[ end of %s ]", val_name.psz_string );
free( val_name.psz_string );
SOURCES_subtitle = subtitle.c
SOURCES_asademux = subtitle_asa.c asademux.c asademux_defs.h asademux.h
SOURCES_ty = ty.c ../codec/cc.h
-SOURCES_vobsub = vobsub.c
+SOURCES_vobsub = vobsub.c vobsub.h
SOURCES_voc = voc.c
SOURCES_xa = xa.c
SOURCES_nuv = nuv.c
es_format_Init( &fmt, AUDIO_ES, 0 );
i_format = GetWLE( &p_data[0] );
if( i_format == 0 )
- fmt.i_codec = VLC_FOURCC( 'a','5','2',' ');
+ fmt.i_codec = VLC_CODEC_A52;
else
wf_tag_to_fourcc( i_format, &fmt.i_codec, NULL );
fmt.audio.i_channels = GetWLE( &p_data[2] );
switch( GetDWBE( &hdr[8] ) )
{
case AU_ALAW_8: /* 8-bit ISDN A-law */
- p_sys->fmt.i_codec = VLC_FOURCC( 'a','l','a','w' );
+ p_sys->fmt.i_codec = VLC_CODEC_ALAW;
p_sys->fmt.audio.i_bitspersample = 8;
p_sys->fmt.audio.i_blockalign = 1 * p_sys->fmt.audio.i_channels;
i_cat = AU_CAT_PCM;
break;
case AU_MULAW_8: /* 8-bit ISDN u-law */
- p_sys->fmt.i_codec = VLC_FOURCC( 'u','l','a','w' );
+ p_sys->fmt.i_codec = VLC_CODEC_MULAW;
p_sys->fmt.audio.i_bitspersample = 8;
p_sys->fmt.audio.i_blockalign = 1 * p_sys->fmt.audio.i_channels;
i_cat = AU_CAT_PCM;
demux.c \
../../codec/avcodec/fourcc.c \
../../codec/avcodec/chroma.c \
+ ../vobsub.h \
$(NULL)
if ENABLE_SOUT
SOURCES_avformat += mux.c
#include "../../codec/avcodec/avcodec.h"
#include "avformat.h"
+#include "../vobsub.h"
//#define AVFORMAT_DEBUG 1
case CODEC_TYPE_SUBTITLE:
es_format_Init( &fmt, SPU_ES, fcc );
+ if( strncmp( p_sys->ic->iformat->name, "matroska", 8 ) == 0 &&
+ cc->codec_id == CODEC_ID_DVD_SUBTITLE &&
+ cc->extradata != NULL &&
+ cc->extradata_size > 0 )
+ {
+ char *psz_start;
+ char *psz_buf = malloc( cc->extradata_size + 1);
+ if( psz_buf != NULL )
+ {
+ memcpy( psz_buf, cc->extradata , cc->extradata_size );
+ psz_buf[cc->extradata_size] = '\0';
+
+ psz_start = strstr( psz_buf, "size:" );
+ if( psz_start &&
+ vobsub_size_parse( psz_start,
+ &fmt.subs.spu.i_original_frame_width,
+ &fmt.subs.spu.i_original_frame_height ) == VLC_SUCCESS )
+ {
+ msg_Dbg( p_demux, "original frame size: %dx%d",
+ fmt.subs.spu.i_original_frame_width,
+ fmt.subs.spu.i_original_frame_height );
+ }
+ else
+ {
+ msg_Warn( p_demux, "reading original frame size failed" );
+ }
+
+ psz_start = strstr( psz_buf, "palette:" );
+ if( psz_start &&
+ vobsub_palette_parse( psz_start, &fmt.subs.spu.palette[1] ) == VLC_SUCCESS )
+ {
+ fmt.subs.spu.palette[0] = 0xBeef;
+ msg_Dbg( p_demux, "vobsub palette read" );
+ }
+ else
+ {
+ msg_Warn( p_demux, "reading original palette failed" );
+ }
+ free( psz_buf );
+ }
+ }
+
psz_type = "subtitle";
break;
/* This is a hack */
if( i_codec_id == CODEC_ID_MP2 )
i_codec_id = CODEC_ID_MP3;
- codec->codec_tag = p_input->p_fmt->i_codec;
+ codec->codec_tag = p_input->p_fmt->i_original_fourcc ?: p_input->p_fmt->i_codec;
#endif
codec->codec_id = i_codec_id;
tk->i_samplesize = tk->i_blocksize;
}
- if( tk->i_codec == VLC_FOURCC( 'v', 'o', 'r', 'b' ) )
+ if( tk->i_codec == VLC_CODEC_VORBIS )
{
tk->i_blocksize = 0; /* fix vorbis VBR decoding */
}
* - Size of the next packet, and so on ...
*/
- if( tk->i_codec == VLC_FOURCC( 'v', 'o', 'r', 'b' ) )
+ if( tk->i_codec == VLC_CODEC_VORBIS )
{
uint8_t *p_extra = fmt.p_extra;
size_t i_extra = fmt.i_extra;
switch( p_vids->p_bih->biBitCount )
{
case 32:
- tk->i_codec = VLC_FOURCC('R','V','3','2');
+ tk->i_codec = VLC_CODEC_RGB32;
break;
case 24:
- tk->i_codec = VLC_FOURCC('R','V','2','4');
+ tk->i_codec = VLC_CODEC_RGB24;
break;
case 16: /* Yes it is RV15 */
case 15:
- tk->i_codec = VLC_FOURCC('R','V','1','5');
+ tk->i_codec = VLC_CODEC_RGB15;
break;
case 9: /* <- TODO check that */
- tk->i_codec = VLC_FOURCC( 'Y', 'V', 'U', '9' );
+ tk->i_codec = VLC_CODEC_I410;
break;
case 8: /* <- TODO check that */
- tk->i_codec = VLC_FOURCC('Y','8','0','0');
+ tk->i_codec = VLC_CODEC_GREY;
break;
}
es_format_Init( &fmt, VIDEO_ES, tk->i_codec );
switch( tk->i_codec )
{
- case VLC_FOURCC('R','V','2','4'):
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB24:
+ case VLC_CODEC_RGB32:
fmt.video.i_rmask = 0x00ff0000;
fmt.video.i_gmask = 0x0000ff00;
fmt.video.i_bmask = 0x000000ff;
break;
- case VLC_FOURCC('R','V','1','5'):
+ case VLC_CODEC_RGB15:
fmt.video.i_rmask = 0x7c00;
fmt.video.i_gmask = 0x03e0;
fmt.video.i_bmask = 0x001f;
else
{
es_format_Init( &fmt, VIDEO_ES, p_vids->p_bih->biCompression );
- if( tk->i_codec == FOURCC_mp4v &&
+ if( tk->i_codec == VLC_CODEC_MP4V &&
!strncasecmp( (char*)&p_strh->i_handler, "XVID", 4 ) )
{
- fmt.i_codec = VLC_FOURCC( 'X', 'V', 'I', 'D' );
+ fmt.i_codec =
+ fmt.i_original_fourcc = VLC_FOURCC( 'X', 'V', 'I', 'D' );
}
}
tk->i_samplesize = 0;
case( AVIFOURCC_txts):
tk->i_cat = SPU_ES;
- tk->i_codec = VLC_FOURCC( 's', 'u', 'b', 't' );
+ tk->i_codec = VLC_CODEC_SUBT;
msg_Dbg( p_demux, "stream[%d] subtitles", i );
es_format_Init( &fmt, SPU_ES, tk->i_codec );
break;
{
switch( i_fourcc )
{
- case FOURCC_DIV1:
+ case VLC_CODEC_DIV1:
/* we have:
* startcode: 0x00000100 32bits
* framenumber ? 5bits
}
return p_byte[4] & 0x06 ? 0 : AVIIF_KEYFRAME;
- case FOURCC_DIV2:
- case FOURCC_DIV3: /* wmv1 also */
+ case VLC_CODEC_DIV2:
+ case VLC_CODEC_DIV3:
+ case VLC_CODEC_WMV1:
/* we have
* picture type 0(I),1(P) 2bits
*/
return p_byte[0] & 0xC0 ? 0 : AVIIF_KEYFRAME;
- case FOURCC_mp4v:
+ case VLC_CODEC_MP4V:
/* we should find first occurrence of 0x000001b6 (32bits)
* startcode: 0x000001b6 32bits
* piture type 0(I),1(P) 2bits
case AUDIO_ES:
wf_tag_to_fourcc( i_codec, &i_codec, NULL );
return i_codec;
-
case VIDEO_ES:
- /* XXX DIV1 <- msmpeg4v1, DIV2 <- msmpeg4v2, DIV3 <- msmpeg4v3, mp4v for mpeg4 */
- switch( i_codec )
- {
- case FOURCC_1:
- return VLC_FOURCC('m','r','l','e');
- case FOURCC_DIV1:
- case FOURCC_div1:
- case FOURCC_MPG4:
- case FOURCC_mpg4:
- return FOURCC_DIV1;
- case FOURCC_DIV2:
- case FOURCC_div2:
- case FOURCC_MP42:
- case FOURCC_mp42:
- case FOURCC_MPG3:
- case FOURCC_mpg3:
- return FOURCC_DIV2;
- case FOURCC_div3:
- case FOURCC_MP43:
- case FOURCC_mp43:
- case FOURCC_DIV3:
- case FOURCC_DIV4:
- case FOURCC_div4:
- case FOURCC_DIV5:
- case FOURCC_div5:
- case FOURCC_DIV6:
- case FOURCC_div6:
- case FOURCC_AP41:
- case FOURCC_3IV1:
- case FOURCC_3iv1:
- case FOURCC_3IVD:
- case FOURCC_3ivd:
- case FOURCC_3VID:
- case FOURCC_3vid:
- return FOURCC_DIV3;
- case FOURCC_DIVX:
- case FOURCC_divx:
- case FOURCC_MP4S:
- case FOURCC_mp4s:
- case FOURCC_M4S2:
- case FOURCC_m4s2:
- case FOURCC_xvid:
- case FOURCC_XVID:
- case FOURCC_XviD:
- case FOURCC_DX50:
- case FOURCC_dx50:
- case FOURCC_mp4v:
- case FOURCC_4:
- case FOURCC_3IV2:
- case FOURCC_3iv2:
- return FOURCC_mp4v;
- }
+ return vlc_fourcc_GetCodec( i_cat, i_codec );
default:
return VLC_FOURCC( 'u', 'n', 'd', 'f' );
}
#define AVITWOCC_AC VLC_TWOCC('A','C')
/* *** codex stuff *** */
- /* Microsoft RLE video */
-#define FOURCC_1 VLC_FOURCC( 1, 0, 0, 0 )
-
- /* MPEG4 video */
-#define FOURCC_DIVX VLC_FOURCC('D','I','V','X')
-#define FOURCC_divx VLC_FOURCC('d','i','v','x')
-#define FOURCC_DIV1 VLC_FOURCC('D','I','V','1')
-#define FOURCC_div1 VLC_FOURCC('d','i','v','1')
-#define FOURCC_MP4S VLC_FOURCC('M','P','4','S')
-#define FOURCC_mp4s VLC_FOURCC('m','p','4','s')
-#define FOURCC_M4S2 VLC_FOURCC('M','4','S','2')
-#define FOURCC_m4s2 VLC_FOURCC('m','4','s','2')
-#define FOURCC_xvid VLC_FOURCC('x','v','i','d')
-#define FOURCC_XVID VLC_FOURCC('X','V','I','D')
-#define FOURCC_XviD VLC_FOURCC('X','v','i','D')
-#define FOURCC_DX50 VLC_FOURCC('D','X','5','0')
-#define FOURCC_dx50 VLC_FOURCC('d','x','5','0')
-#define FOURCC_mp4v VLC_FOURCC('m','p','4','v')
-#define FOURCC_4 VLC_FOURCC( 4, 0, 0, 0 )
-
- /* MSMPEG4 v2 */
-#define FOURCC_MPG4 VLC_FOURCC('M','P','G','4')
-#define FOURCC_mpg4 VLC_FOURCC('m','p','g','4')
-#define FOURCC_DIV2 VLC_FOURCC('D','I','V','2')
-#define FOURCC_div2 VLC_FOURCC('d','i','v','2')
-#define FOURCC_MP42 VLC_FOURCC('M','P','4','2')
-#define FOURCC_mp42 VLC_FOURCC('m','p','4','2')
-
- /* MSMPEG4 v3 / M$ mpeg4 v3 */
-#define FOURCC_MPG3 VLC_FOURCC('M','P','G','3')
-#define FOURCC_mpg3 VLC_FOURCC('m','p','g','3')
-#define FOURCC_div3 VLC_FOURCC('d','i','v','3')
-#define FOURCC_MP43 VLC_FOURCC('M','P','4','3')
-#define FOURCC_mp43 VLC_FOURCC('m','p','4','3')
-
- /* DivX 3.20 */
-#define FOURCC_DIV3 VLC_FOURCC('D','I','V','3')
-#define FOURCC_DIV4 VLC_FOURCC('D','I','V','4')
-#define FOURCC_div4 VLC_FOURCC('d','i','v','4')
-#define FOURCC_DIV5 VLC_FOURCC('D','I','V','5')
-#define FOURCC_div5 VLC_FOURCC('d','i','v','5')
-#define FOURCC_DIV6 VLC_FOURCC('D','I','V','6')
-#define FOURCC_div6 VLC_FOURCC('d','i','v','6')
-
- /* AngelPotion stuff */
-#define FOURCC_AP41 VLC_FOURCC('A','P','4','1')
-
- /* 3IVX */
-#define FOURCC_3IV1 VLC_FOURCC('3','I','V','1')
-#define FOURCC_3iv1 VLC_FOURCC('2','i','v','1')
-#define FOURCC_3IV2 VLC_FOURCC('3','I','V','2')
-#define FOURCC_3iv2 VLC_FOURCC('3','i','v','2')
-#define FOURCC_3IVD VLC_FOURCC('3','I','V','D')
-#define FOURCC_3ivd VLC_FOURCC('3','i','v','d')
-#define FOURCC_3VID VLC_FOURCC('3','V','I','D')
-#define FOURCC_3vid VLC_FOURCC('3','v','i','d')
-
- /* H263 and H263i */
-#define FOURCC_H263 VLC_FOURCC('H','2','6','3')
-#define FOURCC_h263 VLC_FOURCC('h','2','6','3')
-#define FOURCC_U263 VLC_FOURCC('U','2','6','3')
-#define FOURCC_I263 VLC_FOURCC('I','2','6','3')
-#define FOURCC_i263 VLC_FOURCC('i','2','6','3')
-
- /* H264 */
-#define FOURCC_H264 VLC_FOURCC('H','2','6','4')
-#define FOURCC_h264 VLC_FOURCC('h','2','6','4')
-#define FOURCC_VSSH VLC_FOURCC('V','S','S','H')
-
/* DV */
#define FOURCC_dvsd VLC_FOURCC('d','v','s','d')
#define FOURCC_dvhd VLC_FOURCC('d','v','h','d')
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
/* */
- es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_FOURCC('C','D','G', ' ' ) );
+ es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_CODEC_CDG );
p_sys->fmt.video.i_width = 300-2*6;
p_sys->fmt.video.i_height = 216-2*12 ;
p_sys->i_dtsoffset = var_CreateGetInteger( p_demux, DEMUX_CFG_PREFIX DEMUX_DTSOFFSET );
/* Load the packetizer */
- es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'd','r','a','c' ) );
+ es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_DIRAC );
p_sys->p_packetizer = demux_PacketizerNew( p_demux, &fmt, "dirac" );
if( !p_sys->p_packetizer )
{
/* Load the FLAC packetizer */
/* Store STREAMINFO for the decoder and packetizer */
p_streaminfo[4] |= 0x80; /* Fake this as the last metadata block */
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'f', 'l', 'a', 'c' ) );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_FLAC );
fmt.i_extra = i_streaminfo;
fmt.p_extra = p_streaminfo;
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
#include <vlc_dialog.h>
#include <vlc_network.h>
#include <vlc_url.h>
+#include <vlc_strings.h>
#include <iostream>
#include <limits.h>
"value should be set in millisecond units." )
#define KASENNA_TEXT N_( "Kasenna RTSP dialect")
-#define KASENNA_LONGTEXT N_( "Kasenna servers use an old and unstandard " \
- "dialect of RTSP. When you set this parameter, VLC will try this dialect "\
- "for communication. In this mode you cannot connect to normal RTSP servers." )
+#define KASENNA_LONGTEXT N_( "Kasenna servers use an old and nonstandard " \
+ "dialect of RTSP. With this parameter VLC will try this dialect, but "\
+ "then it cannot connect to normal RTSP servers." )
#define USER_TEXT N_("RTSP user name")
-#define USER_LONGTEXT N_("Allows you to modify the user name that will " \
- "be used for authenticating the connection.")
+#define USER_LONGTEXT N_("Sets the username for the connection, " \
+ "if no username or password are set in the url.")
#define PASS_TEXT N_("RTSP password")
-#define PASS_LONGTEXT N_("Allows you to modify the password that will be " \
- "used for the connection.")
+#define PASS_LONGTEXT N_("Sets the password for the connection, " \
+ "if no username or password are set in the url.")
vlc_module_begin ()
set_description( N_("RTP/RTSP/SDP demuxer (using Live555)" ) )
!strcmp( sub->codecName(), "MPA-ROBUST" ) ||
!strcmp( sub->codecName(), "X-MP3-DRAFT-00" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'a' );
+ tk->fmt.i_codec = VLC_CODEC_MPGA;
tk->fmt.audio.i_rate = 0;
}
else if( !strcmp( sub->codecName(), "AC3" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 'a', '5', '2', ' ' );
+ tk->fmt.i_codec = VLC_CODEC_A52;
tk->fmt.audio.i_rate = 0;
}
else if( !strcmp( sub->codecName(), "L16" ) )
}
else if( !strcmp( sub->codecName(), "PCMU" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 'u', 'l', 'a', 'w' );
+ tk->fmt.i_codec = VLC_CODEC_MULAW;
}
else if( !strcmp( sub->codecName(), "PCMA" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 'a', 'l', 'a', 'w' );
+ tk->fmt.i_codec = VLC_CODEC_ALAW;
}
else if( !strncmp( sub->codecName(), "G726", 4 ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 'g', '7', '2', '6' );
+ tk->fmt.i_codec = VLC_CODEC_ADPCM_G726;
tk->fmt.audio.i_rate = 8000;
tk->fmt.audio.i_channels = 1;
if( !strcmp( sub->codecName()+5, "40" ) )
}
else if( !strcmp( sub->codecName(), "AMR" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 's', 'a', 'm', 'r' );
+ tk->fmt.i_codec = VLC_CODEC_AMR_NB;
}
else if( !strcmp( sub->codecName(), "AMR-WB" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 's', 'a', 'w', 'b' );
+ tk->fmt.i_codec = VLC_CODEC_AMR_WB;
}
else if( !strcmp( sub->codecName(), "MP4A-LATM" ) )
{
unsigned int i_extra;
uint8_t *p_extra;
- tk->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'a' );
+ tk->fmt.i_codec = VLC_CODEC_MP4A;
if( ( p_extra = parseStreamMuxConfigStr( sub->fmtp_config(),
i_extra ) ) )
unsigned int i_extra;
uint8_t *p_extra;
- tk->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'a' );
+ tk->fmt.i_codec = VLC_CODEC_MP4A;
if( ( p_extra = parseGeneralConfigStr( sub->fmtp_config(),
i_extra ) ) )
es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('u','n','d','f') );
if( !strcmp( sub->codecName(), "MPV" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'v' );
+ tk->fmt.i_codec = VLC_CODEC_MPGV;
}
else if( !strcmp( sub->codecName(), "H263" ) ||
!strcmp( sub->codecName(), "H263-1998" ) ||
!strcmp( sub->codecName(), "H263-2000" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 'H', '2', '6', '3' );
+ tk->fmt.i_codec = VLC_CODEC_H263;
}
else if( !strcmp( sub->codecName(), "H261" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 'H', '2', '6', '1' );
+ tk->fmt.i_codec = VLC_CODEC_H261;
}
else if( !strcmp( sub->codecName(), "H264" ) )
{
unsigned int i_extra = 0;
uint8_t *p_extra = NULL;
- tk->fmt.i_codec = VLC_FOURCC( 'h', '2', '6', '4' );
+ tk->fmt.i_codec = VLC_CODEC_H264;
tk->fmt.b_packetized = false;
if((p_extra=parseH264ConfigStr( sub->fmtp_spropparametersets(),
}
else if( !strcmp( sub->codecName(), "JPEG" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 'M', 'J', 'P', 'G' );
+ tk->fmt.i_codec = VLC_CODEC_MJPG;
}
else if( !strcmp( sub->codecName(), "MP4V-ES" ) )
{
unsigned int i_extra;
uint8_t *p_extra;
- tk->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' );
+ tk->fmt.i_codec = VLC_CODEC_MP4V;
if( ( p_extra = parseGeneralConfigStr( sub->fmtp_config(),
i_extra ) ) )
return VLC_EGENERIC;
/* According to RFC 2326 p56 chapter 12.35 a RTSP server that
- * supports Scale should:
+ * supports Scale:
*
- * "The server should try to approximate the viewing rate, but may
- * restrict the range of scale values that it supports. The response
- * MUST contain the actual scale value chosen by the server."
+ * "[...] should try to approximate the viewing rate, but
+ * may restrict the range of scale values that it supports.
+ * The response MUST contain the actual scale value chosen
+ * by the server."
*
* Scale = 1 indicates normal play
* Scale > 1 indicates fast forward
msg_Warn( p_demux, "buffer overflow" );
}
/* FIXME could i_size be > buffer size ? */
- if( tk->fmt.i_codec == VLC_FOURCC('s','a','m','r') ||
- tk->fmt.i_codec == VLC_FOURCC('s','a','w','b') )
+ if( tk->fmt.i_codec == VLC_CODEC_AMR_NB ||
+ tk->fmt.i_codec == VLC_CODEC_AMR_WB )
{
AMRAudioSource *amrSource = (AMRAudioSource*)tk->sub->readSource();
p_block->p_buffer[0] = amrSource->lastFrameHeader();
memcpy( p_block->p_buffer + 1, tk->p_buffer, i_size );
}
- else if( tk->fmt.i_codec == VLC_FOURCC('H','2','6','1') )
+ else if( tk->fmt.i_codec == VLC_CODEC_H261 )
{
H261VideoRTPSource *h261Source = (H261VideoRTPSource*)tk->sub->rtpSource();
uint32_t header = h261Source->lastSpecialHeader();
if( tk->sub->rtpSource()->curPacketMarkerBit() )
p_block->i_flags |= BLOCK_FLAG_END_OF_FRAME;
}
- else if( tk->fmt.i_codec == VLC_FOURCC('h','2','6','4') )
+ else if( tk->fmt.i_codec == VLC_CODEC_H264 )
{
if( (tk->p_buffer[0] & 0x1f) >= 24 )
msg_Warn( p_demux, "unsupported NAL type for H264" );
if( !tk->b_muxed )
{
/*FIXME: for h264 you should check that packetization-mode=1 in sdp-file */
- p_block->i_dts = ( tk->fmt.i_codec == VLC_FOURCC( 'm', 'p', 'g', 'v' ) ) ? 0 : i_pts;
+ p_block->i_dts = ( tk->fmt.i_codec == VLC_CODEC_MPGV ) ? 0 : i_pts;
}
if( tk->b_muxed )
/*****************************************************************************
*
*****************************************************************************/
-static int b64_decode( char *dest, char *src );
-
static int ParseASF( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
/* Always smaller */
p_header = block_New( p_demux, psz_end - psz_asf );
- p_header->i_buffer = b64_decode( (char*)p_header->p_buffer, psz_asf );
+ p_header->i_buffer = vlc_b64_decode_binary_to_buffer( p_header->p_buffer,
+ p_header->i_buffer, psz_asf );
//msg_Dbg( p_demux, "Size=%d Hdrb64=%s", p_header->i_buffer, psz_asf );
if( p_header->i_buffer <= 0 )
{
unsigned int& configSize )
{
char *dup, *psz;
- int i, i_records = 1;
+ size_t i_records = 1;
- if( configSize )
configSize = 0;
if( configStr == NULL || *configStr == '\0' )
psz = dup = strdup( configStr );
- /* Count the number of comma's */
+ /* Count the number of commas */
for( psz = dup; *psz != '\0'; ++psz )
{
if( *psz == ',')
}
}
- unsigned char *cfg = new unsigned char[5 * strlen(dup)];
+ size_t configMax = 5*strlen(dup);
+ unsigned char *cfg = new unsigned char[configMax];
psz = dup;
- for( i = 0; i < i_records; i++ )
+ for( size_t i = 0; i < i_records; ++i )
{
cfg[configSize++] = 0x00;
cfg[configSize++] = 0x00;
cfg[configSize++] = 0x00;
cfg[configSize++] = 0x01;
- configSize += b64_decode( (char*)&cfg[configSize], psz );
+ configSize += vlc_b64_decode_binary_to_buffer( cfg+configSize,
+ configMax-configSize, psz );
psz += strlen(psz)+1;
}
free( dup );
return cfg;
}
-
-/*char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";*/
-static int b64_decode( char *dest, char *src )
-{
- const char *dest_start = dest;
- int i_level;
- int last = 0;
- int b64[256] = {
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 00-0F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 10-1F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63, /* 20-2F */
- 52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1, /* 30-3F */
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, /* 40-4F */
- 15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1, /* 50-5F */
- -1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, /* 60-6F */
- 41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1, /* 70-7F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 80-8F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 90-9F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* A0-AF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* B0-BF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* C0-CF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* D0-DF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* E0-EF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 /* F0-FF */
- };
-
- for( i_level = 0; *src != '\0'; src++ )
- {
- int c;
-
- c = b64[(unsigned int)*src];
- if( c == -1 )
- {
- continue;
- }
-
- switch( i_level )
- {
- case 0:
- i_level++;
- break;
- case 1:
- *dest++ = ( last << 2 ) | ( ( c >> 4)&0x03 );
- i_level++;
- break;
- case 2:
- *dest++ = ( ( last << 4 )&0xf0 ) | ( ( c >> 2 )&0x0f );
- i_level++;
- break;
- case 3:
- *dest++ = ( ( last &0x03 ) << 6 ) | c;
- i_level = 0;
- }
- last = c;
- }
-
- *dest = '\0';
-
- return dest - dest_start;
-}
}
es_format_Init( &p_sys->fmt, VIDEO_ES, 0 );
- p_sys->fmt.i_codec = VLC_FOURCC('m','j','p','g');
+ p_sys->fmt.i_codec = VLC_CODEC_MJPG;
p_sys->p_es = es_out_Add( p_demux->out, &p_sys->fmt );
return VLC_SUCCESS;
chapters.hpp chapters.cpp \
chapter_command.hpp chapter_command.cpp \
stream_io_callback.hpp stream_io_callback.cpp \
- ../mp4/libmp4.c ../mp4/drms.c
+ ../mp4/libmp4.c ../mp4/drms.c \
+ ../vobsub.h
#include "demux.hpp"
+extern "C" {
+#include "../vobsub.h"
+}
+
/* GetFourCC helper */
#define GetFOURCC( p ) __GetFOURCC( (uint8_t*)p )
static vlc_fourcc_t __GetFOURCC( uint8_t *p )
else if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG1" ) ||
!strcmp( tracks[i_track]->psz_codec, "V_MPEG2" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'v' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_MPGV;
}
else if( !strncmp( tracks[i_track]->psz_codec, "V_THEORA", 8 ) )
{
uint8_t *p_data = tracks[i_track]->p_extra_data;
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 't', 'h', 'e', 'o' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_THEORA;
if( tracks[i_track]->i_extra_data >= 4 ) {
if( p_data[0] == 2 ) {
int i = 1;
else if( !strncmp( tracks[i_track]->psz_codec, "V_REAL/RV", 9 ) )
{
if( !strcmp( p_tk->psz_codec, "V_REAL/RV10" ) )
- p_fmt->i_codec = VLC_FOURCC( 'R', 'V', '1', '0' );
+ p_fmt->i_codec = VLC_CODEC_RV10;
else if( !strcmp( p_tk->psz_codec, "V_REAL/RV20" ) )
- p_fmt->i_codec = VLC_FOURCC( 'R', 'V', '2', '0' );
+ p_fmt->i_codec = VLC_CODEC_RV20;
else if( !strcmp( p_tk->psz_codec, "V_REAL/RV30" ) )
- p_fmt->i_codec = VLC_FOURCC( 'R', 'V', '3', '0' );
+ p_fmt->i_codec = VLC_CODEC_RV30;
else if( !strcmp( p_tk->psz_codec, "V_REAL/RV40" ) )
- p_fmt->i_codec = VLC_FOURCC( 'R', 'V', '4', '0' );
+ p_fmt->i_codec = VLC_CODEC_RV40;
if( p_tk->i_extra_data > 26 )
{
}
else if( !strncmp( tracks[i_track]->psz_codec, "V_DIRAC", 7 ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC('d', 'r', 'a', 'c' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_DIRAC;
}
else if( !strncmp( tracks[i_track]->psz_codec, "V_MPEG4", 7 ) )
{
if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG4/MS/V3" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'D', 'I', 'V', '3' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_DIV3;
}
else if( !strncmp( tracks[i_track]->psz_codec, "V_MPEG4/ISO", 11 ) )
{
if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG4/ISO/AVC" ) )
tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'a', 'v', 'c', '1' );
else
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_MP4V;
tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
memcpy( tracks[i_track]->fmt.p_extra,tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
!strcmp( tracks[i_track]->psz_codec, "A_MPEG/L2" ) ||
!strcmp( tracks[i_track]->psz_codec, "A_MPEG/L1" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'a' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_MPGA;
}
else if( !strcmp( tracks[i_track]->psz_codec, "A_AC3" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'a', '5', '2', ' ' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_A52;
}
else if( !strcmp( tracks[i_track]->psz_codec, "A_EAC3" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'e', 'a', 'c', '3' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_EAC3;
}
else if( !strcmp( tracks[i_track]->psz_codec, "A_DTS" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'd', 't', 's', ' ' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_DTS;
}
else if( !strcmp( tracks[i_track]->psz_codec, "A_MLP" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC('m', 'l', 'p', ' ' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_MLP;
}
else if( !strcmp( tracks[i_track]->psz_codec, "A_TRUEHD" ) )
{
/* FIXME when more samples arrive */
- tracks[i_track]->fmt.i_codec = VLC_FOURCC('t', 'r', 'h', 'd' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_TRUEHD;
p_fmt->b_packetized = false;
}
else if( !strcmp( tracks[i_track]->psz_codec, "A_FLAC" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'f', 'l', 'a', 'c' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_FLAC;
tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
memcpy( tracks[i_track]->fmt.p_extra,tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
int i, i_offset = 1, i_size[3], i_extra;
uint8_t *p_extra;
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'v', 'o', 'r', 'b' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_VORBIS;
/* Split the 3 headers */
if( tracks[i_track]->p_extra_data[0] != 0x02 )
16000, 12000, 11025, 8000, 7350, 0, 0, 0
};
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'a' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_MP4A;
/* create data for faad (MP4DecSpecificDescrTag)*/
if( !strcmp( &tracks[i_track]->psz_codec[12], "MAIN" ) )
}
else if( !strcmp( tracks[i_track]->psz_codec, "A_AAC" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'a' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_MP4A;
tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
memcpy( tracks[i_track]->fmt.p_extra, tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
}
else if( !strcmp( tracks[i_track]->psz_codec, "A_WAVPACK4" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'W', 'V', 'P', 'K' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_WAVPACK;
tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
memcpy( tracks[i_track]->fmt.p_extra, tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
}
else if( !strcmp( tracks[i_track]->psz_codec, "A_TTA1" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'T', 'T', 'A', '1' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_TTA;
tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
memcpy( tracks[i_track]->fmt.p_extra, tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
int i, i_offset = 1, i_extra, num_headers, size_so_far;
uint8_t *p_extra;
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'k', 'a', 't', 'e' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_KATE;
tracks[i_track]->fmt.subs.psz_encoding = strdup( "UTF-8" );
/* Recover the number of headers to expect */
}
else if( !strcmp( tracks[i_track]->psz_codec, "S_TEXT/ASCII" ) )
{
- p_fmt->i_codec = VLC_FOURCC( 's', 'u', 'b', 't' );
+ p_fmt->i_codec = VLC_CODEC_SUBT;
p_fmt->subs.psz_encoding = NULL; /* Is there a place where it is stored ? */
}
else if( !strcmp( tracks[i_track]->psz_codec, "S_TEXT/UTF8" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's', 'u', 'b', 't' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_SUBT;
tracks[i_track]->fmt.subs.psz_encoding = strdup( "UTF-8" );
}
else if( !strcmp( tracks[i_track]->psz_codec, "S_TEXT/USF" ) )
!strcmp( tracks[i_track]->psz_codec, "S_SSA" ) ||
!strcmp( tracks[i_track]->psz_codec, "S_ASS" ))
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's', 's', 'a', ' ' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_SSA;
tracks[i_track]->fmt.subs.psz_encoding = strdup( "UTF-8" );
if( tracks[i_track]->i_extra_data )
{
}
else if( !strcmp( tracks[i_track]->psz_codec, "S_VOBSUB" ) )
{
- tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's','p','u',' ' );
+ tracks[i_track]->fmt.i_codec = VLC_CODEC_SPU;
if( tracks[i_track]->i_extra_data )
{
- char *p_start;
- char *p_buf = (char *)malloc( tracks[i_track]->i_extra_data + 1);
- memcpy( p_buf, tracks[i_track]->p_extra_data , tracks[i_track]->i_extra_data );
- p_buf[tracks[i_track]->i_extra_data] = '\0';
-
- p_start = strstr( p_buf, "size:" );
- if( sscanf( p_start, "size: %dx%d",
- &tracks[i_track]->fmt.subs.spu.i_original_frame_width, &tracks[i_track]->fmt.subs.spu.i_original_frame_height ) == 2 )
+ char *psz_start;
+ char *psz_buf = (char *)malloc( tracks[i_track]->i_extra_data + 1);
+ if( psz_buf != NULL )
{
- msg_Dbg( &sys.demuxer, "original frame size vobsubs: %dx%d", tracks[i_track]->fmt.subs.spu.i_original_frame_width, tracks[i_track]->fmt.subs.spu.i_original_frame_height );
- }
- else
- {
- msg_Warn( &sys.demuxer, "reading original frame size for vobsub failed" );
+ memcpy( psz_buf, tracks[i_track]->p_extra_data , tracks[i_track]->i_extra_data );
+ psz_buf[tracks[i_track]->i_extra_data] = '\0';
+
+ psz_start = strstr( psz_buf, "size:" );
+ if( psz_start &&
+ vobsub_size_parse( psz_start,
+ &tracks[i_track]->fmt.subs.spu.i_original_frame_width,
+ &tracks[i_track]->fmt.subs.spu.i_original_frame_height ) == VLC_SUCCESS )
+ {
+ msg_Dbg( &sys.demuxer, "original frame size vobsubs: %dx%d",
+ tracks[i_track]->fmt.subs.spu.i_original_frame_width,
+ tracks[i_track]->fmt.subs.spu.i_original_frame_height );
+ }
+ else
+ {
+ msg_Warn( &sys.demuxer, "reading original frame size for vobsub failed" );
+ }
+
+ psz_start = strstr( psz_buf, "palette:" );
+ if( psz_start &&
+ vobsub_palette_parse( psz_start, &tracks[i_track]->fmt.subs.spu.palette[1] ) == VLC_SUCCESS )
+ {
+ tracks[i_track]->fmt.subs.spu.palette[0] = 0xBeef;
+ msg_Dbg( &sys.demuxer, "vobsub palette read" );
+ }
+ else
+ {
+ msg_Warn( &sys.demuxer, "reading original palette failed" );
+ }
+ free( psz_buf );
}
- free( p_buf );
}
}
else if( !strcmp( tracks[i_track]->psz_codec, "B_VOBBTN" ) )
}
else if( !strcmp( p_tk->psz_codec, "A_REAL/14_4" ) )
{
- p_fmt->i_codec = VLC_FOURCC( '1', '4', '_', '4');
+ p_fmt->i_codec = VLC_CODEC_RA_144;
p_fmt->audio.i_channels = 1;
p_fmt->audio.i_rate = 8000;
p_fmt->audio.i_blockalign = 0x14;
/* */
#ifndef MPC_FIXED_POINT
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'f', 'l', '3', '2' ) );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_FL32 );
#else
# ifdef WORDS_BIGENDIAN
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 's', '3', '2', 'b' ) );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_S32B );
# else
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 's', '3', '2', 'l' ) );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_S32L );
# endif
#endif
fmt.audio.i_channels = p_sys->info.channels;
static int MlpInit( demux_t *p_demux );
static const codec_t p_codec[] = {
- { VLC_FOURCC( 'm', 'p', '4', 'a' ), false, "mp4 audio", AacProbe, AacInit },
- { VLC_FOURCC( 'm', 'p', 'g', 'a' ), false, "mpeg audio", MpgaProbe, MpgaInit },
- { VLC_FOURCC( 'a', '5', '2', ' ' ), true, "a52 audio", A52Probe, A52Init },
- { VLC_FOURCC( 'e', 'a', 'c', '3' ), true, "eac3 audio", EA52Probe, A52Init },
- { VLC_FOURCC( 'd', 't', 's', ' ' ), false, "dts audio", DtsProbe, DtsInit },
- { VLC_FOURCC( 'm', 'l', 'p', ' ' ), false, "mlp audio", MlpProbe, MlpInit },
+ { VLC_CODEC_MP4A, false, "mp4 audio", AacProbe, AacInit },
+ { VLC_CODEC_MPGA, false, "mpeg audio", MpgaProbe, MpgaInit },
+ { VLC_CODEC_A52, true, "a52 audio", A52Probe, A52Init },
+ { VLC_CODEC_EAC3, true, "eac3 audio", EA52Probe, A52Init },
+ { VLC_CODEC_DTS, false, "dts audio", DtsProbe, DtsInit },
+ { VLC_CODEC_MLP, false, "mlp audio", MlpProbe, MlpInit },
{ 0, false, NULL, NULL, NULL }
};
msg_Dbg( p_demux, "using %.2f fps", p_sys->f_fps );
/* Load the mpegvideo packetizer */
- es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'h', '2', '6', '4' ) );
+ es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_H264 );
p_sys->p_packetizer = demux_PacketizerNew( p_demux, &fmt, "h264" );
if( !p_sys->p_packetizer )
{
p_sys->p_es = NULL;
/* Load the mpegvideo packetizer */
- es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
+ es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_MPGV );
p_sys->p_packetizer = demux_PacketizerNew( p_demux, &fmt, "mpeg video" );
if( !p_sys->p_packetizer )
{
}
/* create the output */
- es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
+ es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_MPGV );
p_sys->p_es = es_out_Add( p_demux->out, &fmt );
return VLC_SUCCESS;
{
es_format_t fmt;
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC('m','p','g','a') );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_MPGA );
fmt.audio.i_rate = p_sys->exh.i_audio_sample_rate;
fmt.audio.i_bitspersample = p_sys->exh.i_audio_bits_per_sample;
/* Read info from any secondary header packets, if there are any */
if( p_stream->i_secondary_header_packets > 0 )
{
- if( p_stream->fmt.i_codec == VLC_FOURCC('t','h','e','o') &&
+ if( p_stream->fmt.i_codec == VLC_CODEC_THEORA &&
oggpacket.bytes >= 7 &&
! memcmp( oggpacket.packet, "\x80theora", 7 ) )
{
Ogg_ReadTheoraHeader( p_stream, &oggpacket );
p_stream->i_secondary_header_packets = 0;
}
- else if( p_stream->fmt.i_codec == VLC_FOURCC('v','o','r','b') &&
+ else if( p_stream->fmt.i_codec == VLC_CODEC_VORBIS &&
oggpacket.bytes >= 7 &&
! memcmp( oggpacket.packet, "\x01vorbis", 7 ) )
{
Ogg_ReadVorbisHeader( p_stream, &oggpacket );
p_stream->i_secondary_header_packets = 0;
}
- else if( p_stream->fmt.i_codec == VLC_FOURCC('c','m','m','l') )
+ else if( p_stream->fmt.i_codec == VLC_CODEC_CMML )
{
p_stream->i_secondary_header_packets = 0;
}
}
/* An Ogg/vorbis packet contains an end date granulepos */
- if( p_stream->fmt.i_codec == VLC_FOURCC( 'v','o','r','b' ) ||
- p_stream->fmt.i_codec == VLC_FOURCC( 's','p','x',' ' ) ||
- p_stream->fmt.i_codec == VLC_FOURCC( 'f','l','a','c' ) )
+ if( p_stream->fmt.i_codec == VLC_CODEC_VORBIS ||
+ p_stream->fmt.i_codec == VLC_CODEC_SPEEX ||
+ p_stream->fmt.i_codec == VLC_CODEC_FLAC )
{
if( ogg_stream_packetout( &p_stream->os, &oggpacket ) > 0 )
{
/* Convert the granulepos into a pcr */
if( p_oggpacket->granulepos >= 0 )
{
- if( p_stream->fmt.i_codec == VLC_FOURCC( 't','h','e','o' ) ||
- p_stream->fmt.i_codec == VLC_FOURCC( 'k','a','t','e' ) )
+ if( p_stream->fmt.i_codec == VLC_CODEC_THEORA ||
+ p_stream->fmt.i_codec == VLC_CODEC_KATE )
{
ogg_int64_t iframe = p_oggpacket->granulepos >>
p_stream->i_granule_shift;
p_stream->i_pcr = ( iframe + pframe ) * INT64_C(1000000)
/ p_stream->f_rate;
}
- else if( p_stream->fmt.i_codec == VLC_FOURCC( 'd','r','a','c' ) )
+ else if( p_stream->fmt.i_codec == VLC_CODEC_DIRAC )
{
ogg_int64_t i_dts = p_oggpacket->granulepos >> 31;
/* NB, OggDirac granulepos values are in units of 2*picturerate */
return;
}
- if( p_stream->fmt.i_codec == VLC_FOURCC( 's','u','b','t' ) &&
+ if( p_stream->fmt.i_codec == VLC_CODEC_SUBT &&
p_oggpacket->packet[0] & PACKET_TYPE_BITS ) return;
/* Check the ES is selected */
p_stream->i_packets_backup++;
switch( p_stream->fmt.i_codec )
{
- case VLC_FOURCC( 'v','o','r','b' ):
- case VLC_FOURCC( 's','p','x',' ' ):
- case VLC_FOURCC( 't','h','e','o' ):
+ case VLC_CODEC_VORBIS:
+ case VLC_CODEC_SPEEX:
+ case VLC_CODEC_THEORA:
if( p_stream->i_packets_backup == 3 ) p_stream->b_force_backup = 0;
break;
- case VLC_FOURCC( 'f','l','a','c' ):
+ case VLC_CODEC_FLAC:
if( !p_stream->fmt.audio.i_rate && p_stream->i_packets_backup == 2 )
{
Ogg_ReadFlacHeader( p_demux, p_stream, p_oggpacket );
b_store_size = false;
break;
- case VLC_FOURCC( 'k','a','t','e' ):
+ case VLC_CODEC_KATE:
if( p_stream->i_packets_backup == 1)
b_store_num_headers = true;
if( p_stream->i_packets_backup == p_stream->i_kate_num_headers ) p_stream->b_force_backup = 0;
}
/* Convert the pcr into a pts */
- if( p_stream->fmt.i_codec == VLC_FOURCC( 'v','o','r','b' ) ||
- p_stream->fmt.i_codec == VLC_FOURCC( 's','p','x',' ' ) ||
- p_stream->fmt.i_codec == VLC_FOURCC( 'f','l','a','c' ) )
+ if( p_stream->fmt.i_codec == VLC_CODEC_VORBIS ||
+ p_stream->fmt.i_codec == VLC_CODEC_SPEEX ||
+ p_stream->fmt.i_codec == VLC_CODEC_FLAC )
{
if( p_stream->i_pcr >= 0 )
{
}
}
- if( p_stream->fmt.i_codec != VLC_FOURCC( 'v','o','r','b' ) &&
- p_stream->fmt.i_codec != VLC_FOURCC( 's','p','x',' ' ) &&
- p_stream->fmt.i_codec != VLC_FOURCC( 'f','l','a','c' ) &&
+ if( p_stream->fmt.i_codec != VLC_CODEC_VORBIS &&
+ p_stream->fmt.i_codec != VLC_CODEC_SPEEX &&
+ p_stream->fmt.i_codec != VLC_CODEC_FLAC &&
p_stream->i_pcr >= 0 )
{
p_stream->i_previous_pcr = p_stream->i_pcr;
p_block->i_dts = p_block->i_pts = i_pts;
p_block->i_length = 0;
}
- else if( p_stream->fmt.i_codec == VLC_FOURCC( 't','h','e','o' ) )
+ else if( p_stream->fmt.i_codec == VLC_CODEC_THEORA )
p_block->i_dts = p_block->i_pts = i_pts;
- else if( p_stream->fmt.i_codec == VLC_FOURCC( 'd','r','a','c' ) )
+ else if( p_stream->fmt.i_codec == VLC_CODEC_DIRAC )
{
ogg_int64_t dts = p_oggpacket->granulepos >> 31;
ogg_int64_t delay = (p_oggpacket->granulepos >> 9) & 0x1fff;
p_block->i_pts = 0;
}
- if( p_stream->fmt.i_codec != VLC_FOURCC( 'v','o','r','b' ) &&
- p_stream->fmt.i_codec != VLC_FOURCC( 's','p','x',' ' ) &&
- p_stream->fmt.i_codec != VLC_FOURCC( 'f','l','a','c' ) &&
- p_stream->fmt.i_codec != VLC_FOURCC( 't','a','r','k' ) &&
- p_stream->fmt.i_codec != VLC_FOURCC( 't','h','e','o' ) &&
- p_stream->fmt.i_codec != VLC_FOURCC( 'c','m','m','l' ) &&
- p_stream->fmt.i_codec != VLC_FOURCC( 'd','r','a','c' ) &&
- p_stream->fmt.i_codec != VLC_FOURCC( 'k','a','t','e' ) )
+ if( p_stream->fmt.i_codec != VLC_CODEC_VORBIS &&
+ p_stream->fmt.i_codec != VLC_CODEC_SPEEX &&
+ p_stream->fmt.i_codec != VLC_CODEC_FLAC &&
+ p_stream->fmt.i_codec != VLC_CODEC_TARKIN &&
+ p_stream->fmt.i_codec != VLC_CODEC_THEORA &&
+ p_stream->fmt.i_codec != VLC_CODEC_CMML &&
+ p_stream->fmt.i_codec != VLC_CODEC_DIRAC &&
+ p_stream->fmt.i_codec != VLC_CODEC_KATE )
{
/* We remove the header from the packet */
i_header_len = (*p_oggpacket->packet & PACKET_LEN_BITS01) >> 6;
i_header_len |= (*p_oggpacket->packet & PACKET_LEN_BITS2) << 1;
- if( p_stream->fmt.i_codec == VLC_FOURCC( 's','u','b','t' ))
+ if( p_stream->fmt.i_codec == VLC_CODEC_SUBT)
{
/* But with subtitles we need to retrieve the duration first */
int i, lenbytes = 0;
p_block->i_buffer = 0;
}
- if( p_stream->fmt.i_codec == VLC_FOURCC( 't','a','r','k' ) )
+ if( p_stream->fmt.i_codec == VLC_CODEC_TARKIN )
{
/* FIXME: the biggest hack I've ever done */
msg_Warn( p_demux, "tarkin pts: %"PRId64", granule: %"PRId64,
p_stream->b_force_backup = 1;
p_stream->fmt.i_cat = AUDIO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 'f','l','a','c' );
+ p_stream->fmt.i_codec = VLC_CODEC_FLAC;
}
/* Check for Flac header (>= version 1.1.1) */
else if( oggpacket.bytes >= 13 && oggpacket.packet[0] ==0x7F &&
p_stream->b_force_backup = 1;
p_stream->fmt.i_cat = AUDIO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 'f','l','a','c' );
+ p_stream->fmt.i_codec = VLC_CODEC_FLAC;
oggpacket.packet += 13; oggpacket.bytes -= 13;
Ogg_ReadFlacHeader( p_demux, p_stream, &oggpacket );
}
msg_Dbg( p_demux, "found tarkin header" );
p_stream->fmt.i_cat = VIDEO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 't','a','r','k' );
+ p_stream->fmt.i_codec = VLC_CODEC_TARKIN;
/* Cheat and get additionnal info ;) */
oggpack_readinit( &opb, oggpacket.packet, oggpacket.bytes);
msg_Dbg( p_demux, "found text subtitles header" );
p_stream->fmt.i_cat = SPU_ES;
- p_stream->fmt.i_codec = VLC_FOURCC('s','u','b','t');
+ p_stream->fmt.i_codec = VLC_CODEC_SUBT;
p_stream->f_rate = 1000; /* granulepos is in millisec */
}
else
if( !p_stream->p_es )
{
/* Better be safe than sorry when possible with ogm */
- if( p_stream->fmt.i_codec == VLC_FOURCC( 'm', 'p', 'g', 'a' ) ||
- p_stream->fmt.i_codec == VLC_FOURCC( 'a', '5', '2', ' ' ) )
+ if( p_stream->fmt.i_codec == VLC_CODEC_MPGA ||
+ p_stream->fmt.i_codec == VLC_CODEC_A52 )
p_stream->fmt.b_packetized = false;
p_stream->p_es = es_out_Add( p_demux->out, &p_stream->fmt );
}
// TODO: something to do here ?
- if( p_stream->fmt.i_codec == VLC_FOURCC('c','m','m','l') )
+ if( p_stream->fmt.i_codec == VLC_CODEC_CMML )
{
/* Set the CMML stream active */
es_out_Control( p_demux->out, ES_OUT_SET_ES, p_stream->p_es );
return true;
/* Only vorbis is supported */
- if( p_stream->fmt.i_codec == VLC_FOURCC( 'v','o','r','b' ) )
+ if( p_stream->fmt.i_codec == VLC_CODEC_VORBIS )
b_compatible = Ogg_IsVorbisFormatCompatible( &p_stream->fmt, &p_stream->fmt_old );
if( !b_compatible )
switch( i_codec )
{
/* 3 headers with the 2° one being the comments */
- case VLC_FOURCC( 'v','o','r','b' ):
+ case VLC_CODEC_VORBIS:
Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+6, false );
break;
- case VLC_FOURCC( 't','h','e','o' ):
+ case VLC_CODEC_THEORA:
Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+6, false );
break;
- case VLC_FOURCC( 's','p','x',' ' ):
+ case VLC_CODEC_SPEEX:
Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 0, false );
break;
/* N headers with the 2° one being the comments */
- case VLC_FOURCC( 'k','a','t','e' ):
+ case VLC_CODEC_KATE:
/* 1 byte for header type, 7 bit for magic, 1 reserved zero byte */
Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+7+1, true );
break;
/* TODO */
- case VLC_FOURCC( 'f','l','a','c' ):
+ case VLC_CODEC_FLAC:
msg_Warn( p_demux, "Ogg_ExtractMeta does not support %4.4s", (const char*)&i_codec );
break;
/* No meta data */
- case VLC_FOURCC( 'c','m','m','l' ): /* CMML is XML text, doesn't have Vorbis comments */
- case VLC_FOURCC( 'd','r','a','c' ):
+ case VLC_CODEC_CMML: /* CMML is XML text, doesn't have Vorbis comments */
+ case VLC_CODEC_DIRAC:
default:
break;
}
int i_keyframe_frequency_force;
p_stream->fmt.i_cat = VIDEO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 't','h','e','o' );
+ p_stream->fmt.i_codec = VLC_CODEC_THEORA;
/* Signal that we want to keep a backup of the theora
* stream headers. They will be used when switching between
oggpack_buffer opb;
p_stream->fmt.i_cat = AUDIO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 'v','o','r','b' );
+ p_stream->fmt.i_codec = VLC_CODEC_VORBIS;
/* Signal that we want to keep a backup of the vorbis
* stream headers. They will be used when switching between
oggpack_buffer opb;
p_stream->fmt.i_cat = AUDIO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 's','p','x',' ' );
+ p_stream->fmt.i_codec = VLC_CODEC_SPEEX;
/* Signal that we want to keep a backup of the speex
* stream headers. They will be used when switching between
char *psz_desc;
p_stream->fmt.i_cat = SPU_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 'k','a','t','e' );
+ p_stream->fmt.i_codec = VLC_CODEC_KATE;
/* Signal that we want to keep a backup of the kate
* stream headers. They will be used when switching between
else if( !strncmp(content_type_string, "audio/x-vorbis", 14) )
{
p_stream->fmt.i_cat = AUDIO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 'v','o','r','b' );
+ p_stream->fmt.i_codec = VLC_CODEC_VORBIS;
p_stream->b_force_backup = 1;
}
else if( !strncmp(content_type_string, "audio/x-speex", 14) )
{
p_stream->fmt.i_cat = AUDIO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 's','p','x',' ' );
+ p_stream->fmt.i_codec = VLC_CODEC_SPEEX;
p_stream->b_force_backup = 1;
}
else if( !strncmp(content_type_string, "video/x-theora", 14) )
{
p_stream->fmt.i_cat = VIDEO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 't','h','e','o' );
+ p_stream->fmt.i_codec = VLC_CODEC_THEORA;
p_stream->b_force_backup = 1;
}
{
/* n.b. MPEG streams are unsupported right now */
p_stream->fmt.i_cat = VIDEO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 'm','p','g','v' );
+ p_stream->fmt.i_codec = VLC_CODEC_MPGV;
}
else if( !strncmp(content_type_string, "text/x-cmml", 11) )
{
ogg_stream_packetout( &p_stream->os, p_oggpacket );
p_stream->fmt.i_cat = SPU_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 'c','m','m','l' );
+ p_stream->fmt.i_codec = VLC_CODEC_CMML;
}
}
}
/* probably is an ogg dirac es */
p_stream->fmt.i_cat = VIDEO_ES;
- p_stream->fmt.i_codec = VLC_FOURCC( 'd','r','a','c' );
+ p_stream->fmt.i_codec = VLC_CODEC_DIRAC;
return true;
}
if( tk->b_seen && tk->es &&
(
#ifdef ZVBI_COMPILED /* FIXME!! */
- tk->fmt.i_codec == VLC_FOURCC('t','e','l','x') ||
+ tk->fmt.i_codec == VLC_CODEC_TELETEXT ||
#endif
!ps_pkt_parse_pes( p_pkt, tk->i_skip ) ) )
{
{
if( ( i_id&0xf8 ) == 0x88 || (i_id&0xf8) == 0x98 )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('d','t','s',' ') );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_DTS );
tk->i_skip = 4;
}
else if( ( i_id&0xf0 ) == 0x80
|| (i_id&0xf0) == 0xc0 ) /* AC-3, Can also be used for DD+/E-AC-3 */
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('a','5','2',' ') );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_A52 );
tk->i_skip = 4;
}
else if( (i_id&0xf0) == 0xb0 )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','l','p',' ') );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_MLP );
/* FIXME / untested ... no known decoder (at least not in VLC/ffmpeg) */
}
else if( ( i_id&0xe0 ) == 0x20 )
{
- es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('s','p','u',' ') );
+ es_format_Init( &tk->fmt, SPU_ES, VLC_CODEC_SPU );
tk->i_skip = 1;
}
else if( ( i_id&0xf0 ) == 0xa0 )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('l','p','c','m') );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_DVD_LPCM );
tk->i_skip = 1;
}
else if( ( i_id&0xff ) == 0x70 )
}
else if( ( i_id&0xff ) == 0x10 )
{
- es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('t','e','l','x') );
+ es_format_Init( &tk->fmt, SPU_ES, VLC_CODEC_TELETEXT );
}
else
{
uint8_t i_sub_id = i_id & 0xff;
if( i_sub_id >= 0x55 && i_sub_id <= 0x5f )
{
- es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('W','V','C','1') );
+ es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_VC1 );
}
else
{
if( (i_id&0xf0) == 0xe0 && i_type == 0x1b )
{
- es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('h','2','6','4') );
+ es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_H264 );
}
else if( (i_id&0xf0) == 0xe0 && i_type == 0x10 )
{
- es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('m','p','4','v') );
+ es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_MP4V );
}
else if( (i_id&0xf0) == 0xe0 && i_type == 0x02 )
{
- es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('m','p','g','v') );
+ es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_MPGV );
}
else if( ( i_id&0xe0 ) == 0xc0 && i_type == 0x0f )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','p','4','a') );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_MP4A );
}
else if( ( i_id&0xe0 ) == 0xc0 && i_type == 0x11 )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','p','4','a') );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_MP4A );
}
else if( ( i_id&0xe0 ) == 0xc0 && i_type == 0x03 )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','p','g','a') );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_MPGA );
}
if( tk->fmt.i_cat == UNKNOWN_ES && ( i_id&0xf0 ) == 0xe0 )
{
- es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('m','p','g','v') );
+ es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_MPGV );
}
else if( tk->fmt.i_cat == UNKNOWN_ES && ( i_id&0xe0 ) == 0xc0 )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','p','g','a') );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_MPGA );
}
else if( tk->fmt.i_cat == UNKNOWN_ES ) return VLC_EGENERIC;
}
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
/* Register one audio and one video stream */
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'm', 'p', 'g', 'a' ) );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_MPGA );
p_sys->p_audio = es_out_Add( p_demux->out, &fmt );
- es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
+ es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_MPGV );
p_sys->p_video = es_out_Add( p_demux->out, &fmt );
p_sys->i_vc = -1;
es_format_Init( &p_sys->fmt, AUDIO_ES, 0 );
char *psz_fourcc = var_CreateGetString( p_demux, "rawaud-fourcc" );
+ p_sys->fmt.i_codec = vlc_fourcc_GetCodecFromString( AUDIO_ES, psz_fourcc );
+ free( psz_fourcc );
- if( ( psz_fourcc == NULL ? 0 : strlen( psz_fourcc ) ) != 4 )
+ if( !p_sys->fmt.i_codec )
{
msg_Err( p_demux, "rawaud-fourcc must be a 4 character string");
- free( psz_fourcc );
es_format_Clean( &p_sys->fmt );
free( p_sys );
return VLC_EGENERIC;
}
- p_sys->fmt.i_codec = VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
- psz_fourcc[2], psz_fourcc[3] );
-
- free( psz_fourcc );
// get the bits per sample ratio based on codec
switch( p_sys->fmt.i_codec )
{
- case VLC_FOURCC( 'f', 'l', '6', '4' ):
+ case VLC_CODEC_FL64:
p_sys->fmt.audio.i_bitspersample = 64;
break;
- case VLC_FOURCC( 'f', 'l', '3', '2' ):
- case VLC_FOURCC( 's', '3', '2', 'l' ):
- case VLC_FOURCC( 's', '3', '2', 'b' ):
- case VLC_FOURCC( 'i', 'n', '3', '2' ):
+ case VLC_CODEC_FL32:
+ case VLC_CODEC_S32L:
+ case VLC_CODEC_S32B:
p_sys->fmt.audio.i_bitspersample = 32;
break;
- case VLC_FOURCC( 's', '2', '4', 'l' ):
- case VLC_FOURCC( 's', '2', '4', 'b' ):
- case VLC_FOURCC( 'i', 'n', '2', '4' ):
- case VLC_FOURCC( '4', '2', 'n', 'i' ):
+ case VLC_CODEC_S24L:
+ case VLC_CODEC_S24B:
p_sys->fmt.audio.i_bitspersample = 24;
break;
- case VLC_FOURCC( 's', '1', '6', 'l' ):
- case VLC_FOURCC( 's', '1', '6', 'b' ):
+ case VLC_CODEC_S16L:
+ case VLC_CODEC_S16B:
p_sys->fmt.audio.i_bitspersample = 16;
break;
- case VLC_FOURCC( 's', '8', ' ', ' ' ):
- case VLC_FOURCC( 'u', '8', ' ', ' ' ):
+ case VLC_CODEC_S8:
+ case VLC_CODEC_U8:
p_sys->fmt.audio.i_bitspersample = 8;
break;
p_sys->i_bitrate = 0;
- es_format_Init( &p_sys->fmt_video, VIDEO_ES, VLC_FOURCC('d','v','s','d') );
+ es_format_Init( &p_sys->fmt_video, VIDEO_ES, VLC_CODEC_DV );
p_sys->fmt_video.video.i_width = 720;
p_sys->fmt_video.video.i_height= dv_header.dsf ? 576 : 480;;
p_peek = p_peek_backup + 80*6+80*16*3 + 3; /* beginning of AAUX pack */
if( *p_peek == 0x50 )
{
- es_format_Init( &p_sys->fmt_audio, AUDIO_ES,
- VLC_FOURCC('a','r','a','w') );
+ /* 12 bits non-linear will be converted to 16 bits linear */
+ es_format_Init( &p_sys->fmt_audio, AUDIO_ES, VLC_CODEC_S16L );
+ p_sys->fmt_audio.audio.i_bitspersample = 16;
p_sys->fmt_audio.audio.i_channels = 2;
switch( (p_peek[4] >> 3) & 0x07 )
{
break;
}
- /* 12 bits non-linear will be converted to 16 bits linear */
- p_sys->fmt_audio.audio.i_bitspersample = 16;
-
p_sys->p_es_audio = es_out_Add( p_demux->out, &p_sys->fmt_audio );
}
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_demux.h>
-#include <vlc_vout.h> /* vout_InitFormat */
#include <assert.h>
/*****************************************************************************
static const struct preset_t p_presets[] =
{
- { "sqcif", 128, 96, 30000, 1001, 4,3, VLC_FOURCC('Y','V','1','2') },
- { "qcif", 176, 144, 30000, 1001, 4,3, VLC_FOURCC('Y','V','1','2') },
- { "cif", 352, 288, 30000, 1001, 4,3, VLC_FOURCC('Y','V','1','2') },
- { "4cif", 704, 576, 30000, 1001, 4,3, VLC_FOURCC('Y','V','1','2') },
- { "16cif", 1408, 1152, 30000, 1001, 4,3, VLC_FOURCC('Y','V','1','2') },
- { "yuv", 176, 144, 25, 1, 4,3, VLC_FOURCC('Y','V','1','2') },
+ { "sqcif", 128, 96, 30000, 1001, 4,3, VLC_CODEC_YV12 },
+ { "qcif", 176, 144, 30000, 1001, 4,3, VLC_CODEC_YV12 },
+ { "cif", 352, 288, 30000, 1001, 4,3, VLC_CODEC_YV12 },
+ { "4cif", 704, 576, 30000, 1001, 4,3, VLC_CODEC_YV12 },
+ { "16cif", 1408, 1152, 30000, 1001, 4,3, VLC_CODEC_YV12 },
+ { "yuv", 176, 144, 25, 1, 4,3, VLC_CODEC_YV12 },
{ NULL, 0, 0, 0, 0, 0,0, 0 }
};
{
static const struct { const char *psz_name; vlc_fourcc_t i_fcc; } formats[] =
{
- { "420jpeg", VLC_FOURCC('I','4','2','0') },
- { "420paldv", VLC_FOURCC('I','4','2','0') },
- { "420", VLC_FOURCC('I','4','2','0') },
- { "422", VLC_FOURCC('I','4','2','2') },
- { "444", VLC_FOURCC('I','4','4','4') },
- { "mono", VLC_FOURCC('G','R','E','Y') },
+ { "420jpeg", VLC_CODEC_I420 },
+ { "420paldv", VLC_CODEC_I420 },
+ { "420", VLC_CODEC_I420 },
+ { "422", VLC_CODEC_I422 },
+ { "444", VLC_CODEC_I444 },
+ { "mono", VLC_CODEC_GREY },
{ NULL, 0 }
};
bool b_found = false;
}
es_format_Init( &p_sys->fmt_video, VIDEO_ES, i_chroma );
- vout_InitFormat( &p_sys->fmt_video.video, i_chroma, i_width, i_height,
- i_aspect );
+ video_format_Setup( &p_sys->fmt_video.video,
+ i_chroma, i_width, i_height, i_aspect );
vlc_ureduce( &p_sys->fmt_video.video.i_frame_rate,
&p_sys->fmt_video.video.i_frame_rate_base,
}
es_format_t fmt;
- es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC('M', 'I', 'D', 'I'));
+ es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_MIDI);
fmt.audio.i_channels = 2;
fmt.audio.i_original_channels = fmt.audio.i_physical_channels =
AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
p_sys->i_type == SUB_TYPE_SSA2_4 ||
p_sys->i_type == SUB_TYPE_ASS )
{
- es_format_Init( &fmt, SPU_ES, VLC_FOURCC( 's','s','a',' ' ) );
+ es_format_Init( &fmt, SPU_ES, VLC_CODEC_SSA );
}
else
{
- es_format_Init( &fmt, SPU_ES, VLC_FOURCC( 's','u','b','t' ) );
+ es_format_Init( &fmt, SPU_ES, VLC_CODEC_SUBT );
}
if( p_sys->psz_header != NULL )
{
/* *** add subtitle ES *** */
if( p_detect->fmt->target == ASAI_TARGET_SSA )
{
- es_format_Init( &fmt, SPU_ES, VLC_FOURCC( 's','s','a',' ' ) );
+ es_format_Init( &fmt, SPU_ES, VLC_CODEC_SSA );
}
else
{
- es_format_Init( &fmt, SPU_ES, VLC_FOURCC( 's','u','b','t' ) );
+ es_format_Init( &fmt, SPU_ES, VLC_CODEC_SUBT );
}
p_sys->es = es_out_Add( p_demux->out, &fmt );
{
vlc_value_t val;
val.p_list = p_sys->p_programs_list;
- var_Change( p_demux, "programs", VLC_VAR_FREELIST, &val, NULL );
+ var_FreeList( &val, NULL );
}
/* If in dump mode, then close the file */
{
i_skip += 1;
}
- else if( pid->es->fmt.i_codec == VLC_FOURCC( 's', 'u', 'b', 't' ) &&
+ else if( pid->es->fmt.i_codec == VLC_CODEC_SUBT &&
pid->es->p_mpeg4desc )
{
decoder_config_descriptor_t *dcd = &pid->es->p_mpeg4desc->dec_descr;
i_skip += 2;
}
#ifdef ZVBI_COMPILED
- else if( pid->es->fmt.i_codec == VLC_FOURCC( 't', 'e', 'l', 'x' ) )
+ else if( pid->es->fmt.i_codec == VLC_CODEC_TELETEXT )
i_skip = 0; /*hack for zvbi support */
#endif
/* skip header */
p_pes->i_length = i_length * 100 / 9;
p_block = block_ChainGather( p_pes );
- if( pid->es->fmt.i_codec == VLC_FOURCC( 's', 'u', 'b', 't' ) )
+ if( pid->es->fmt.i_codec == VLC_CODEC_SUBT )
{
if( i_pes_size > 0 && p_block->i_buffer > i_pes_size )
{
case 0x01: /* MPEG-1 video */
case 0x02: /* MPEG-2 video */
case 0x80: /* MPEG-2 MOTO video */
- es_format_Init( fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
+ es_format_Init( fmt, VIDEO_ES, VLC_CODEC_MPGV );
break;
case 0x03: /* MPEG-1 audio */
case 0x04: /* MPEG-2 audio */
- es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 'm', 'p', 'g', 'a' ) );
+ es_format_Init( fmt, AUDIO_ES, VLC_CODEC_MPGA );
break;
case 0x11: /* MPEG4 (audio) */
case 0x0f: /* ISO/IEC 13818-7 Audio with ADTS transport syntax */
- es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 'm', 'p', '4', 'a' ) );
+ es_format_Init( fmt, AUDIO_ES, VLC_CODEC_MP4A );
break;
case 0x10: /* MPEG4 (video) */
- es_format_Init( fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', '4', 'v' ) );
+ es_format_Init( fmt, VIDEO_ES, VLC_CODEC_MP4V );
pid->es->b_gather = true;
break;
case 0x1B: /* H264 <- check transport syntax/needed descriptor */
- es_format_Init( fmt, VIDEO_ES, VLC_FOURCC( 'h', '2', '6', '4' ) );
+ es_format_Init( fmt, VIDEO_ES, VLC_CODEC_H264 );
break;
case 0x81: /* A52 (audio) */
- es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 'a', '5', '2', ' ' ) );
+ es_format_Init( fmt, AUDIO_ES, VLC_CODEC_A52 );
break;
case 0x82: /* DVD_SPU (sub) */
- es_format_Init( fmt, SPU_ES, VLC_FOURCC( 's', 'p', 'u', ' ' ) );
+ es_format_Init( fmt, SPU_ES, VLC_CODEC_SPU );
break;
case 0x83: /* LPCM (audio) */
- es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 'l', 'p', 'c', 'm' ) );
+ es_format_Init( fmt, AUDIO_ES, VLC_CODEC_DVD_LPCM );
break;
case 0x84: /* SDDS (audio) */
- es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 's', 'd', 'd', 's' ) );
+ es_format_Init( fmt, AUDIO_ES, VLC_CODEC_SDDS );
break;
case 0x85: /* DTS (audio) */
- es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 'd', 't', 's', ' ' ) );
+ es_format_Init( fmt, AUDIO_ES, VLC_CODEC_DTS );
break;
case 0x91: /* A52 vls (audio) */
{
case 0x0B: /* mpeg4 sub */
p_fmt->i_cat = SPU_ES;
- p_fmt->i_codec = VLC_FOURCC('s','u','b','t');
+ p_fmt->i_codec = VLC_CODEC_SUBT;
break;
case 0x20: /* mpeg4 */
- p_fmt->i_codec = VLC_FOURCC('m','p','4','v');
+ p_fmt->i_codec = VLC_CODEC_MP4V;
break;
case 0x21: /* h264 */
- p_fmt->i_codec = VLC_FOURCC('h','2','6','4');
+ p_fmt->i_codec = VLC_CODEC_H264;
break;
case 0x60:
case 0x61:
case 0x63:
case 0x64:
case 0x65: /* mpeg2 */
- p_fmt->i_codec = VLC_FOURCC( 'm','p','g','v' );
+ p_fmt->i_codec = VLC_CODEC_MPGV;
break;
case 0x6a: /* mpeg1 */
- p_fmt->i_codec = VLC_FOURCC( 'm','p','g','v' );
+ p_fmt->i_codec = VLC_CODEC_MPGV;
break;
case 0x6c: /* mpeg1 */
- p_fmt->i_codec = VLC_FOURCC( 'j','p','e','g' );
+ p_fmt->i_codec = VLC_CODEC_JPEG;
break;
default:
p_fmt->i_cat = UNKNOWN_ES;
switch( dcd->i_objectTypeIndication )
{
case 0x40: /* mpeg4 */
- p_fmt->i_codec = VLC_FOURCC('m','p','4','a');
+ p_fmt->i_codec = VLC_CODEC_MP4A;
break;
case 0x66:
case 0x67:
case 0x68: /* mpeg2 aac */
- p_fmt->i_codec = VLC_FOURCC('m','p','4','a');
+ p_fmt->i_codec = VLC_CODEC_MP4A;
break;
case 0x69: /* mpeg2 */
- p_fmt->i_codec = VLC_FOURCC('m','p','g','a');
+ p_fmt->i_codec = VLC_CODEC_MPGA;
break;
case 0x6b: /* mpeg1 */
- p_fmt->i_codec = VLC_FOURCC('m','p','g','a');
+ p_fmt->i_codec = VLC_CODEC_MPGA;
break;
default:
p_fmt->i_cat = UNKNOWN_ES;
#endif
/* */
- es_format_Init( p_fmt, SPU_ES, VLC_FOURCC( 't', 'e', 'l', 'x' ) );
+ es_format_Init( p_fmt, SPU_ES, VLC_CODEC_TELETEXT );
/* In stream output mode, do not separate the stream by page */
if( p_demux->out->b_sout || i_page <= 0 )
{
es_format_t *p_fmt = &pid->es->fmt;
- es_format_Init( p_fmt, SPU_ES, VLC_FOURCC( 'd', 'v', 'b', 's' ) );
+ es_format_Init( p_fmt, SPU_ES, VLC_CODEC_DVBS );
dvbpsi_descriptor_t *p_dr = PMTEsFindDescriptor( p_es, 0x59 );
int i_page = 0;
PMTEsFindDescriptor( p_es, 0x81 ) )
{
p_fmt->i_cat = AUDIO_ES;
- p_fmt->i_codec = VLC_FOURCC('a','5','2',' ');
+ p_fmt->i_codec = VLC_CODEC_A52;
}
else if( PMTEsFindDescriptor( p_es, 0x7a ) )
{
/* DVB with stream_type 0x06 (ETS EN 300 468) */
p_fmt->i_cat = AUDIO_ES;
- p_fmt->i_codec = VLC_FOURCC( 'e', 'a', 'c', '3' );
+ p_fmt->i_codec = VLC_CODEC_EAC3;
}
else if( PMTEsHasRegistration( p_demux, p_es, "DTS1" ) ||
PMTEsHasRegistration( p_demux, p_es, "DTS2" ) ||
{
/*registration descriptor(ETSI TS 101 154 Annex F)*/
p_fmt->i_cat = AUDIO_ES;
- p_fmt->i_codec = VLC_FOURCC('d','t','s',' ');
+ p_fmt->i_codec = VLC_CODEC_DTS;
}
else if( PMTEsHasRegistration( p_demux, p_es, "BSSD" ) )
{
p_fmt->i_cat = AUDIO_ES;
p_fmt->b_packetized = true;
- p_fmt->i_codec = VLC_FOURCC('a','e','s','3');
+ p_fmt->i_codec = VLC_CODEC_302M;
}
else
{
/* registration descriptor for VC-1 (SMPTE rp227) */
p_fmt->i_cat = VIDEO_ES;
- p_fmt->i_codec = VLC_FOURCC('W','V','C','1');
+ p_fmt->i_codec = VLC_CODEC_VC1;
/* XXX With Simple and Main profile the SEQUENCE
* header is modified: video width and height are
/* registration descriptor for Dirac
* (backwards compatable with VC-2 (SMPTE Sxxxx:2008)) */
p_fmt->i_cat = VIDEO_ES;
- p_fmt->i_codec = VLC_FOURCC('d','r','a','c');
+ p_fmt->i_codec = VLC_CODEC_DIRAC;
}
static void PMTSetupEs0xA0( demux_t *p_demux, ts_pid_t *pid,
{
case 0x80:
p_fmt->i_cat = AUDIO_ES;
- p_fmt->i_codec = VLC_FOURCC( 'b', 'p', 'c', 'm' );
+ p_fmt->i_codec = VLC_CODEC_BD_LPCM;
break;
case 0x82:
case 0x85: /* DTS-HD High resolution audio */
case 0x86: /* DTS-HD Master audio */
case 0xA2: /* Secondary DTS audio */
p_fmt->i_cat = AUDIO_ES;
- p_fmt->i_codec = VLC_FOURCC( 'd', 't', 's', ' ' );
+ p_fmt->i_codec = VLC_CODEC_DTS;
break;
case 0x83: /* TrueHD AC3 */
p_fmt->i_cat = AUDIO_ES;
- p_fmt->i_codec = VLC_FOURCC( 'm', 'l', 'p', ' ' );
+ p_fmt->i_codec = VLC_CODEC_MLP;
break;
case 0x84: /* E-AC3 */
case 0x87: /* E-AC3 */
case 0xA1: /* Secondary E-AC3 */
p_fmt->i_cat = AUDIO_ES;
- p_fmt->i_codec = VLC_FOURCC( 'e', 'a', 'c', '3' );
+ p_fmt->i_codec = VLC_CODEC_EAC3;
break;
case 0x90: /* Presentation graphics */
case 0x91: /* Interactive graphics */
if( pid->es->fmt.i_cat == AUDIO_ES ||
( pid->es->fmt.i_cat == SPU_ES &&
- pid->es->fmt.i_codec != VLC_FOURCC('d','v','b','s') &&
- pid->es->fmt.i_codec != VLC_FOURCC('t','e','l','x') ) )
+ pid->es->fmt.i_codec != VLC_CODEC_DVBS &&
+ pid->es->fmt.i_codec != VLC_CODEC_TELETEXT ) )
{
PMTParseEsIso639( p_demux, pid, p_es );
}
p_sys->pi_seektable = NULL;
/* Read the metadata */
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'T', 'T', 'A', '1' ) );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_TTA );
fmt.audio.i_channels = GetWLE( &p_header[6] );
fmt.audio.i_bitspersample = GetWLE( &p_header[8] );
fmt.audio.i_rate = GetDWLE( &p_header[10] );
/* register the proper audio codec */
if (p_sys->audio_type == TIVO_AUDIO_MPEG) {
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'm', 'p', 'g', 'a' ) );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_MPGA );
} else {
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'a', '5', '2', ' ' ) );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_A52 );
}
fmt.i_group = TY_ES_GROUP;
p_sys->p_audio = es_out_Add( p_demux->out, &fmt );
/* register the video stream */
- es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
+ es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_MPGV );
fmt.i_group = TY_ES_GROUP;
p_sys->p_video = es_out_Add( p_demux->out, &fmt );
p_sys->f_fps = 0.0;
/* Load the packetizer */
- es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'W', 'V', 'C', '1' ) );
+ es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_VC1 );
p_sys->p_packetizer = demux_PacketizerNew( p_demux, &fmt, "VC-1" );
if( !p_sys->p_packetizer )
{
#include <vlc_charset.h>
#include "ps.h"
+#include "vobsub.h"
#define MAX_LINE 8192
else if( !strncmp( "size:", line, 5 ) )
{
/* Store the original size of the video */
- if( sscanf( line, "size: %dx%d",
- &p_sys->i_original_frame_width, &p_sys->i_original_frame_height ) == 2 )
+ if( vobsub_size_parse( line, &p_sys->i_original_frame_width,
+ &p_sys->i_original_frame_height ) == VLC_SUCCESS )
{
msg_Dbg( p_demux, "original frame size: %dx%d", p_sys->i_original_frame_width, p_sys->i_original_frame_height );
}
}
else if( !strncmp( "palette:", line, 8 ) )
{
- int i;
-
- /* Store the palette of the subs */
- if( sscanf( line, "palette: %x, %x, %x, %x, %x, %x, %x, %x, %x, %x, %x, %x, %x, %x, %x, %x",
- &p_sys->palette[0], &p_sys->palette[1], &p_sys->palette[2], &p_sys->palette[3],
- &p_sys->palette[4], &p_sys->palette[5], &p_sys->palette[6], &p_sys->palette[7],
- &p_sys->palette[8], &p_sys->palette[9], &p_sys->palette[10], &p_sys->palette[11],
- &p_sys->palette[12], &p_sys->palette[13], &p_sys->palette[14], &p_sys->palette[15] ) == 16 )
+ if( vobsub_palette_parse( line, p_sys->palette ) == VLC_SUCCESS )
{
- for( i = 0; i < 16; i++ )
- {
- uint8_t r = 0, g = 0, b = 0;
- uint8_t y = 0, u = 0, v = 0;
- r = (p_sys->palette[i] >> 16) & 0xff;
- g = (p_sys->palette[i] >> 8) & 0xff;
- b = (p_sys->palette[i] >> 0) & 0xff;
- /* msg_Dbg( p_demux, "palette %d: R=%x, G=%x, B=%x", i, r, g, b ); */
- y = (uint8_t) __MIN(abs(r * 2104 + g * 4130 + b * 802 + 4096 + 131072) >> 13, 235);
- u = (uint8_t) __MIN(abs(r * -1214 + g * -2384 + b * 3598 + 4096 + 1048576) >> 13, 240);
- v = (uint8_t) __MIN(abs(r * 3598 + g * -3013 + b * -585 + 4096 + 1048576) >> 13, 240);
- p_sys->palette[i] = 0;
- p_sys->palette[i] |= (y&0xff)<<16;
- p_sys->palette[i] |= (u&0xff);
- p_sys->palette[i] |= (v&0xff)<<8;
- /* msg_Dbg( p_demux, "palette %d: y=%x, u=%x, v=%x", i, y, u, v ); */
-
- }
p_sys->b_palette = true;
msg_Dbg( p_demux, "vobsub palette read" );
}
current_tk->i_track_id = i_track_id;
current_tk->i_delay = (int64_t)0;
- es_format_Init( &fmt, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) );
+ es_format_Init( &fmt, SPU_ES, VLC_CODEC_SPU );
fmt.subs.spu.i_original_frame_width = p_sys->i_original_frame_width;
fmt.subs.spu.i_original_frame_height = p_sys->i_original_frame_height;
fmt.psz_language = strdup( language );
--- /dev/null
+/*****************************************************************************
+ * vobsub.h: Vobsub support
+ *****************************************************************************
+ * Copyright (C) 2009 the VideoLAN team
+ * $Id$
+ *
+ * Authors: John Stebbins
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+static inline void vobsub_palette_rgb2yuv( uint32_t *pu_palette )
+{
+ int i;
+ for( i = 0; i < 16; i++ )
+ {
+ uint8_t r, g, b, y, u, v;
+ r = (pu_palette[i] >> 16) & 0xff;
+ g = (pu_palette[i] >> 8) & 0xff;
+ b = (pu_palette[i] >> 0) & 0xff;
+ y = (uint8_t) __MIN(abs(r * 2104 + g * 4130 + b * 802 + 4096 + 131072) >> 13, 235);
+ u = (uint8_t) __MIN(abs(r * -1214 + g * -2384 + b * 3598 + 4096 + 1048576) >> 13, 240);
+ v = (uint8_t) __MIN(abs(r * 3598 + g * -3013 + b * -585 + 4096 + 1048576) >> 13, 240);
+ pu_palette[i] = (y&0xff)<<16 | (v&0xff)<<8 | (u&0xff);
+ }
+}
+
+static inline int vobsub_palette_parse( const char *psz_buf, uint32_t *pu_palette )
+{
+ if( sscanf( psz_buf, "palette: "
+ "%"PRIx32", %"PRIx32", %"PRIx32", %"PRIx32", "
+ "%"PRIx32", %"PRIx32", %"PRIx32", %"PRIx32", "
+ "%"PRIx32", %"PRIx32", %"PRIx32", %"PRIx32", "
+ "%"PRIx32", %"PRIx32", %"PRIx32", %"PRIx32"",
+ &pu_palette[0], &pu_palette[1], &pu_palette[2], &pu_palette[3],
+ &pu_palette[4], &pu_palette[5], &pu_palette[6], &pu_palette[7],
+ &pu_palette[8], &pu_palette[9], &pu_palette[10], &pu_palette[11],
+ &pu_palette[12], &pu_palette[13], &pu_palette[14], &pu_palette[15] ) == 16 )
+ {
+ vobsub_palette_rgb2yuv( pu_palette );
+ return VLC_SUCCESS;
+ }
+ else
+ {
+ return VLC_EGENERIC;
+ }
+}
+
+static inline int vobsub_size_parse( const char *psz_buf,
+ int *pi_original_frame_width,
+ int *pi_original_frame_height )
+{
+ if( sscanf( psz_buf, "size: %dx%d",
+ pi_original_frame_width, pi_original_frame_height ) == 2 )
+ {
+ return VLC_SUCCESS;
+ }
+ else
+ {
+ return VLC_EGENERIC;
+ }
+}
+
return VLC_EGENERIC;
}
- new_fmt.i_codec = VLC_FOURCC('u','8',' ',' ');
+ new_fmt.i_codec = VLC_CODEC_U8;
new_fmt.audio.i_rate = fix_voc_sr( 1000000L / (256L - buf[0]) );
new_fmt.audio.i_bytes_per_frame = 1;
new_fmt.audio.i_frame_length = 1;
i_block_size = 0;
p_sys->i_silence_countdown = GetWLE( buf );
- new_fmt.i_codec = VLC_FOURCC('u','8',' ',' ');
+ new_fmt.i_codec = VLC_CODEC_U8;
new_fmt.audio.i_rate = fix_voc_sr( 1000000L / (256L - buf[0]) );
new_fmt.audio.i_bytes_per_frame = 1;
new_fmt.audio.i_frame_length = 1;
return VLC_EGENERIC;
}
- new_fmt.i_codec = VLC_FOURCC('u','8',' ',' ');
+ new_fmt.i_codec = VLC_CODEC_U8;
new_fmt.audio.i_channels = buf[3] + 1; /* can't be nul */
new_fmt.audio.i_rate = 256000000L /
((65536L - GetWLE(buf)) * new_fmt.audio.i_channels);
switch( new_fmt.audio.i_bitspersample )
{
case 8:
- new_fmt.i_codec = VLC_FOURCC('u','8',' ',' ');
+ new_fmt.i_codec = VLC_CODEC_U8;
break;
case 16:
- new_fmt.i_codec = VLC_FOURCC('u','1','6','l');
+ new_fmt.i_codec = VLC_CODEC_U16L;
break;
default:
switch( new_fmt.audio.i_bitspersample )
{
case 8:
- new_fmt.i_codec = VLC_FOURCC('s','8',' ',' ');
+ new_fmt.i_codec = VLC_CODEC_S8;
break;
case 16:
- new_fmt.i_codec = VLC_FOURCC('s','1','6','l');
+ new_fmt.i_codec = VLC_CODEC_S16L;
break;
default:
case VLC_FOURCC( 'a', 'r', 'a', 'w' ):
case VLC_FOURCC( 'a', 'f', 'l', 't' ):
case VLC_FOURCC( 'u', 'l', 'a', 'w' ):
- case VLC_FOURCC( 'a', 'l', 'a', 'w' ):
- case VLC_FOURCC( 'm', 'l', 'a', 'w' ):
+ case VLC_CODEC_ALAW:
+ case VLC_CODEC_MULAW:
case VLC_FOURCC( 'p', 'c', 'm', ' ' ):
if( FrameInfo_PCM( &p_sys->i_frame_size, &p_sys->i_frame_samples,
&p_sys->fmt ) )
&p_sys->fmt ) )
goto error;
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
- case VLC_FOURCC( 'a', '5', '2', ' ' ):
+ case VLC_CODEC_MPGA:
+ case VLC_CODEC_A52:
/* FIXME set end of area FIXME */
goto error;
- case VLC_FOURCC( 'a', 'g', 's', 'm' ):
+ case VLC_CODEC_GSM_MS:
if( FrameInfo_MSGSM( &p_sys->i_frame_size, &p_sys->i_frame_samples,
&p_sys->fmt ) )
goto error;
#endif
p_format->buffer_size = 8192;
- p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2');
+ p_aout->output.output.i_format = VLC_CODEC_FL32;
p_aout->output.i_nb_samples = 2048 / i_nb_channels;
p_aout->output.pf_play = DoNothing;
case NAVIGATE_NEXT:
if( p_input )
{
- vlc_value_t val, val_list;
-
/* First try to go to next chapter */
if( !var_Get( p_input, "chapter", &val ) )
{
- var_Change( p_input, "chapter", VLC_VAR_GETCHOICES,
- &val_list, NULL );
- if( val_list.p_list->i_count > val.i_int )
+ int i_chapter_count = var_CountChoices( p_input, "chapter" );
+ if( i_chapter_count > val.i_int )
{
- var_Change( p_input, "chapter", VLC_VAR_FREELIST,
- &val_list, NULL );
var_SetVoid( p_input, "next-chapter" );
break;
}
- var_Change( p_input, "chapter", VLC_VAR_FREELIST,
- &val_list, NULL );
}
/* Try to go to next title */
if( !var_Get( p_input, "title", &val ) )
{
- var_Change( p_input, "title", VLC_VAR_GETCHOICES,
- &val_list, NULL );
- if( val_list.p_list->i_count > val.i_int )
+ int i_title_count = var_CountChoices( p_input, "title" );
+ if( i_title_count > val.i_int )
{
- var_Change( p_input, "title", VLC_VAR_FREELIST,
- &val_list, NULL );
var_SetVoid( p_input, "next-title" );
break;
}
- var_Change( p_input, "title", VLC_VAR_FREELIST,
- &val_list, NULL );
}
/* Try to go to next file */
}
AddItem( item );
}
- var_Change( p_input, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
vlc_object_release( p_input );
AddItem( item );
}
- var_Change( p_input, "title", VLC_VAR_FREELIST,
- &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
}
vlc_object_release( p_input );
BMenu::AttachedToWindow();
AddItem( item );
}
- var_Change( p_input, "chapter", VLC_VAR_FREELIST,
- &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
}
vlc_object_release( p_input );
BMenu::AttachedToWindow();
colorcombo colspace[]=
{
- {B_YCbCr420, "B_YCbCr420", VLC_FOURCC('I','4','2','0'), 3, 2},
+ {B_YCbCr420, "B_YCbCr420", VLC_CODEC_I420, 3, 2},
{B_YUV422, "B_YUV422", VLC_FOURCC('Y','4','2','2'), 3, 2},
- {B_YCbCr422, "B_YCbCr422", VLC_FOURCC('Y','U','Y','2'), 3, 2},
- {B_RGB32, "B_RGB32", VLC_FOURCC('R','V','3','2'), 1, 4},
- {B_RGB16, "B_RGB16", VLC_FOURCC('R','V','1','6'), 1, 2}
+ {B_YCbCr422, "B_YCbCr422", VLC_CODEC_YUYV, 3, 2},
+ {B_RGB32, "B_RGB32", VLC_CODEC_RGB32, 1, 4},
+ {B_RGB16, "B_RGB16", VLC_CODEC_RGB16, 1, 2}
};
#define COLOR_COUNT 5
int i_state;
/* Font style */
- text_style_t text_style; /* font control */
+ text_style_t* p_text_style; /* font control */
char *psz_string;
/* Position */
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;
}
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" );
{
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)
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 );
}
p_intf->p_sys->fmt_out.i_chroma;
if( config_GetInt( p_intf, "freetype-yuvp" ) )
p_intf->p_sys->p_blend->fmt_in.video.i_chroma =
- VLC_FOURCC('Y','U','V','P');
+ VLC_CODEC_YUVP;
else
p_intf->p_sys->p_blend->fmt_in.video.i_chroma =
- VLC_FOURCC('Y','U','V','A');
+ VLC_CODEC_YUVA;
p_intf->p_sys->p_blend->p_module =
module_need( p_intf->p_sys->p_blend, "video blending", NULL, false );
return NULL;
if( !p_fmt->p_palette &&
- ( p_fmt->i_chroma == VLC_FOURCC('Y','U','V','P') ) )
+ ( p_fmt->i_chroma == VLC_CODEC_YUVP ) )
{
p_fmt->p_palette = malloc( sizeof(video_palette_t) );
if( !p_fmt->p_palette )
switch( fmt.i_chroma )
{
- case VLC_FOURCC('R','V','2','4'):
+ case VLC_CODEC_RGB24:
p_begin = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels;
p_end = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels +
( fmt.i_height * (*p_pic)->p[Y_PLANE].i_pitch );
i_skip = 3;
break;
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB32:
p_begin = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels;
p_end = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels +
( fmt.i_height * (*p_pic)->p[Y_PLANE].i_pitch );
video_format_t fmt;
memset( &fmt, 0, sizeof(fmt) );
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_visible_width = 0;
fmt.i_height = fmt.i_visible_height = 0;
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 )
switch( p_sys->var_info.bits_per_pixel )
{
case 8: /* FIXME: set the palette */
- p_sys->fmt_out.i_chroma = VLC_FOURCC('R','G','B','2'); break;
+ p_sys->fmt_out.i_chroma = VLC_CODEC_RGB8; break;
case 15:
- p_sys->fmt_out.i_chroma = VLC_FOURCC('R','V','1','5'); break;
+ p_sys->fmt_out.i_chroma = VLC_CODEC_RGB15; break;
case 16:
- p_sys->fmt_out.i_chroma = VLC_FOURCC('R','V','1','6'); break;
+ p_sys->fmt_out.i_chroma = VLC_CODEC_RGB16; break;
case 24:
- p_sys->fmt_out.i_chroma = VLC_FOURCC('R','V','2','4'); break;
+ p_sys->fmt_out.i_chroma = VLC_CODEC_RGB24; break;
case 32:
- p_sys->fmt_out.i_chroma = VLC_FOURCC('R','V','3','2'); break;
+ p_sys->fmt_out.i_chroma = VLC_CODEC_RGB32; break;
default:
msg_Err( p_intf, "unknown screen depth %i",
p_sys->var_info.bits_per_pixel );
#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 )
{
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 )
{
{
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;
}
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 ) )
{
/* clean up everything */
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
- var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
}
- (IBAction)toggleVar:(id)sender
playlist_NodeDelete( p_playlist, p_item, true, false );
}
else
- playlist_DeleteFromInput( p_playlist, p_item->p_input->i_id, pl_Locked );
+ playlist_DeleteFromInput( p_playlist, p_item->p_input, pl_Locked );
}
PL_UNLOCK;
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 )
if( p_item->i_children == -1 )
{
playlist_DeleteFromInput( p_playlist,
- p_item->p_input->i_id, pl_Locked );
+ p_item->p_input, pl_Locked );
}
else
{
char buf1[MSTRTIME_MAX_SIZE];
char buf2[MSTRTIME_MAX_SIZE];
vlc_value_t val;
- vlc_value_t val_list;
/* Source */
char *psz_uri = input_item_GetURI( input_GetItem( p_input ) );
/* Title */
if( !var_Get( p_input, "title", &val ) )
{
- var_Change( p_input, "title", VLC_VAR_GETCHOICES, &val_list, NULL );
- if( val_list.p_list->i_count > 0 )
- {
- mvnprintw( y++, 0, COLS, _(" Title : %d/%d"), val.i_int, val_list.p_list->i_count );
- }
- var_Change( p_input, "title", VLC_VAR_FREELIST, &val_list, NULL );
+ int i_title_count = var_CountChoices( p_input, "title" );
+ if( i_title_count > 0 )
+ mvnprintw( y++, 0, COLS, _(" Title : %d/%d"), val.i_int, i_title_count );
}
/* Chapter */
if( !var_Get( p_input, "chapter", &val ) )
{
- var_Change( p_input, "chapter", VLC_VAR_GETCHOICES, &val_list, NULL );
- if( val_list.p_list->i_count > 0 )
- {
- mvnprintw( y++, 0, COLS, _(" Chapter : %d/%d"), val.i_int, val_list.p_list->i_count );
- }
- var_Change( p_input, "chapter", VLC_VAR_FREELIST, &val_list, NULL );
+ int i_chapter_count = var_CountChoices( p_input, "chapter" );
+ if( i_chapter_count > 0 )
+ mvnprintw( y++, 0, COLS, _(" Chapter : %d/%d"), val.i_int, i_chapter_count );
}
}
else
{
intf_thread_t *p_intf = GtkGetIntf( widget );
playlist_t *p_playlist;
- int i_id , i_pos=0;
+ int i_pos=0;
GtkTreeView *p_tvplaylist = NULL;
p_playlist = pl_Hold( p_intf );
else
#endif
{
- i_id = playlist_AddExt( p_playlist, (const char*)name,
+ playlist_AddExt( p_playlist, (const char*)name,
(const char*)name,
PLAYLIST_APPEND, PLAYLIST_END,
(mtime_t) 0,
}
pp.format.voices = i_nb_channels;
- p_aout->output.output.i_format = AOUT_FMT_S16_NE;
+ p_aout->output.output.i_format = VLC_CODEC_S16N;
p_aout->output.i_nb_samples = DEFAULT_FRAME_SIZE;
pp.format.format = SND_PCM_SFMT_S16;
i_bytes_per_sample = 2;
int i_tmp, i_size;
uint8_t * p_bytes;
- if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
+ if ( p_aout->output.output.i_format != VLC_CODEC_SPDIFL )
{
mtime_t next_date = 0;
switch( p_vout->p_sys->i_screen_depth )
{
case 8:
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->p_sys->i_bytes_per_pixel = 1;
p_vout->output.pf_setpalette = SetPalette;
break;
case 15:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+ p_vout->output.i_chroma = VLC_CODEC_RGB15;
p_vout->p_sys->i_bytes_per_pixel = 2;
p_vout->output.i_rmask = 0x7c00;
p_vout->output.i_gmask = 0x03e0;
break;
case 16:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+ p_vout->output.i_chroma = VLC_CODEC_RGB16;
p_vout->p_sys->i_bytes_per_pixel = 2;
p_vout->output.i_rmask = 0xf800;
p_vout->output.i_gmask = 0x07e0;
break;
case 24:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
+ p_vout->output.i_chroma = VLC_CODEC_RGB24;
p_vout->p_sys->i_bytes_per_pixel = 3;
p_vout->output.i_rmask = 0xff0000;
p_vout->output.i_gmask = 0x00ff00;
case 32:
default:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
p_vout->p_sys->i_bytes_per_pixel = 4;
p_vout->output.i_rmask = 0xff0000;
p_vout->output.i_gmask = 0x00ff00;
switch (p_vout->p_sys->i_vc_format)
{
case Pg_VIDEO_FORMAT_YUV420:
- p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0');
+ p_vout->output.i_chroma = VLC_CODEC_I420;
p_pic->p_sys->p_buf[U_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[U_PLANE] );
p_pic->p_sys->p_buf[V_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[V_PLANE] );
break;
case Pg_VIDEO_FORMAT_YV12:
- p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2');
+ p_vout->output.i_chroma = VLC_CODEC_YV12;
p_pic->p_sys->p_buf[U_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[U_PLANE] );
p_pic->p_sys->p_buf[V_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[V_PLANE] );
case Pg_VIDEO_FORMAT_YUY2:
if (p_vout->p_sys->i_vc_format == Pg_VIDEO_FORMAT_UYVY)
{
- p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y');
+ p_vout->output.i_chroma = VLC_CODEC_UYVY;
}
else
{
- p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
+ p_vout->output.i_chroma = VLC_CODEC_YUYV;
}
p_pic->p->p_pixels = p_pic->p_sys->p_buf[Y_PLANE];
break;
case Pg_VIDEO_FORMAT_RGB555:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+ p_vout->output.i_chroma = VLC_CODEC_RGB15;
p_vout->output.i_rmask = 0x001f;
p_vout->output.i_gmask = 0x03e0;
p_vout->output.i_bmask = 0x7c00;
break;
case Pg_VIDEO_FORMAT_RGB565:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+ p_vout->output.i_chroma = VLC_CODEC_RGB16;
p_vout->output.i_rmask = 0x001f;
p_vout->output.i_gmask = 0x07e0;
p_vout->output.i_bmask = 0xf800;
break;
case Pg_VIDEO_FORMAT_RGB8888:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
p_vout->output.i_rmask = 0x000000ff;
p_vout->output.i_gmask = 0x0000ff00;
p_vout->output.i_bmask = 0x00ff0000;
switch( p_vout->output.i_chroma )
{
#ifdef MODULE_NAME_IS_xvideo
- case VLC_FOURCC('Y','2','1','1'):
+ case VLC_CODEC_Y211:
p_pic->p->p_pixels = p_pic->p_sys->p_image->data
+ p_pic->p_sys->p_image->offsets[0];
input_manager.moc.cpp \
actions_manager.moc.cpp \
recents.moc.cpp \
+ variables.moc.cpp \
dialogs/playlist.moc.cpp \
dialogs/bookmarks.moc.cpp \
dialogs/mediainfo.moc.cpp \
input_manager.cpp \
actions_manager.cpp \
recents.cpp \
+ variables.cpp \
dialogs/playlist.cpp \
dialogs/bookmarks.cpp \
dialogs/preferences.cpp \
input_manager.hpp \
actions_manager.hpp \
recents.hpp \
+ variables.hpp \
dialogs/playlist.hpp \
dialogs/bookmarks.hpp \
dialogs/mediainfo.hpp \
if( i_val == val2.p_list->p_values[j].i_int )
combobox->setCurrentIndex( j );
}
- var_Change( p_obj, psz_var, VLC_VAR_FREELIST,
- &val2, &text2 );
+ var_FreeList( &val2, &text2 );
CONNECT( combobox, currentIndexChanged( int ), this,
ValueChange( int ) );
}
free( name.psz_string );
}
- var_Change( p_obj, "controls", VLC_VAR_FREELIST, &val, &text );
+ var_FreeList( &val, &text );
vlc_object_release( p_obj );
}
else
/* 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 );
}
CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i )
- : QLabel( parent ), p_intf( _p_i )
+ : QLabel( parent ), p_intf( _p_i )
{
setContextMenuPolicy( Qt::ActionsContextMenu );
- CONNECT( this, updateRequested(), this, doUpdate() );
+ CONNECT( this, updateRequested(), this, askForUpdate() );
CONNECT( THEMIM->getIM(), artChanged( QString ),
- this, doUpdate( const QString& ) );
+ this, showArtUpdate( const QString& ) );
setMinimumHeight( 128 );
setMinimumWidth( 128 );
setMaximumHeight( 128 );
setMaximumWidth( 128 );
setScaledContents( true );
+
QList< QAction* > artActions = actions();
QAction *action = new QAction( qtr( "Download cover art" ), this );
+ CONNECT( action, triggered(), this, askForUpdate() );
addAction( action );
- CONNECT( action, triggered(), this, doUpdate() );
- doUpdate( "" );
+ showArtUpdate( "" );
}
CoverArtLabel::~CoverArtLabel()
removeAction( act );
}
-void CoverArtLabel::doUpdate( const QString& url )
+void CoverArtLabel::showArtUpdate( const QString& url )
{
QPixmap pix;
if( !url.isEmpty() && pix.load( url ) )
}
}
-void CoverArtLabel::doUpdate()
+void CoverArtLabel::askForUpdate()
{
THEMIM->getIM()->requestArtUpdate();
}
}
private slots:
- void doUpdate();
- void doUpdate( const QString& );
+ void askForUpdate();
+ void showArtUpdate( const QString& );
signals:
void updateRequested();
vlc_value_t, vlc_value_t, void * );
static int PlaylistNext( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
-static int ItemChanged( vlc_object_t *, const char *,
- vlc_value_t, vlc_value_t, void * );
static int ItemAppended( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t oval, vlc_value_t nval, void *param );
static int ItemDeleted( vlc_object_t *p_this, const char *psz_variable,
void PLModel::delCallbacks()
{
- var_DelCallback( p_playlist, "item-change", ItemChanged, this );
/*
var_DelCallback( p_playlist, "item-current", PlaylistNext, this );
*/
return;
}
if( p_item->i_children == -1 )
- playlist_DeleteFromInput( p_playlist, item->i_input_id, pl_Locked );
+ playlist_DeleteFromInput( p_playlist, p_item->p_input, pl_Locked );
else
playlist_NodeDelete( p_playlist, p_item, true, false );
/* And finally, remove it from the tree */
return VLC_SUCCESS;
}
-static int ItemChanged( vlc_object_t *p_this, const char *psz_variable,
- vlc_value_t oval, vlc_value_t nval, void *param )
-{
- PLModel *p_model = (PLModel *) param;
- PLEvent *event = new PLEvent( ItemUpdate_Type, nval.i_int );
- QApplication::postEvent( p_model, event );
- return VLC_SUCCESS;
-}
-
static int ItemDeleted( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t oval, vlc_value_t nval, void *param )
{
/*****************************************************************************
- * external.hpp : Dialogs from other LibVLC core and other plugins
+ * external.cpp : Dialogs from other LibVLC core and other plugins
****************************************************************************
* Copyright (C) 2009 Rémi Denis-Courmont
* Copyright (C) 2006 the VideoLAN team
#include <QProgressDialog>
#include <QMutex>
-QVLCVariable::QVLCVariable (vlc_object_t *obj, const char *varname, int type)
- : object (obj), name (qfu(varname))
-{
- var_Create (object, qtu(name), type);
- var_AddCallback (object, qtu(name), callback, this);
-}
-
-QVLCVariable::~QVLCVariable (void)
-{
- var_DelCallback (object, qtu(name), callback, this);
- var_Destroy (object, qtu(name));
-}
-
-int QVLCVariable::callback (vlc_object_t *object, const char *,
- vlc_value_t, vlc_value_t cur, void *data)
-{
- QVLCVariable *self = (QVLCVariable *)data;
-
- emit self->pointerChanged (object, cur.p_address);
- return VLC_SUCCESS;
-}
-
-
DialogHandler::DialogHandler (intf_thread_t *intf)
: intf (intf),
message (VLC_OBJECT(intf), "dialog-fatal", VLC_VAR_ADDRESS),
#include <QObject>
#include <vlc_common.h>
-
-class QVLCVariable : public QObject
-{
- Q_OBJECT
-private:
- static int callback (vlc_object_t *, const char *,
- vlc_value_t, vlc_value_t, void *);
- vlc_object_t *object;
- QString name;
-
-public:
- QVLCVariable (vlc_object_t *, const char *, int);
- virtual ~QVLCVariable (void);
-
-signals:
- void pointerChanged (vlc_object_t *, void *);
-};
+#include "variables.hpp"
struct intf_thread_t;
class QProgressDialog;
private:
intf_thread_t *intf;
- QVLCVariable message;
- QVLCVariable login;
- QVLCVariable question;
- QVLCVariable progressBar;
+ QVLCPointer message;
+ QVLCPointer login;
+ QVLCPointer question;
+ QVLCPointer progressBar;
signals:
void progressBarDestroyed (QWidget *);
**/
CONNECT( THEMIM->getIM(), infoChanged( input_item_t* ),
IP, update( input_item_t* ) );
- CONNECT( THEMIM->getIM(), metaChanged( input_item_t* ),
+ CONNECT( THEMIM->getIM(), currentMetaChanged( input_item_t* ),
MP, update( input_item_t* ) );
- CONNECT( THEMIM->getIM(), metaChanged( input_item_t* ),
+ CONNECT( THEMIM->getIM(), currentMetaChanged( input_item_t* ),
EMP, update( input_item_t* ) );
CONNECT( THEMIM->getIM(), statisticsUpdated( input_item_t* ),
ISP, update( input_item_t* ) );
artUrl = "";
p_input = NULL;
i_rate = 0;
- i_input_id = 0;
+ p_item = NULL;
b_video = false;
timeA = 0;
timeB = 0;
UpdateNavigation();
UpdateVout();
addCallbacks();
- i_input_id = input_GetItem( p_input )->i_id;
+ p_item = input_GetItem( p_input );
}
else
{
p_input = NULL;
- i_input_id = 0;
+ p_item = NULL;
emit rateChanged( INPUT_RATE_DEFAULT );
}
}
delCallbacks();
i_old_playing_status = END_S;
- i_input_id = 0;
+ p_item = NULL;
oldName = "";
artUrl = "";
b_video = false;
/* Reset all InfoPanels but stats */
emit artChanged( NULL );
emit infoChanged( NULL );
- emit metaChanged( (input_item_t *)NULL );
+ emit currentMetaChanged( (input_item_t *)NULL );
emit encryptionChanged( false );
emit recordingStateChanged( false );
break;
case ItemChanged_Type:
/* Ignore ItemChanged_Type event that does not apply to our input */
- if( i_input_id == ple->i_id )
+ if( p_item == ple->p_item )
{
UpdateStatus();
// UpdateName();
UpdateArt();
/* Update duration of file */
}
- UpdateMeta( ple->i_id );
+ UpdateMeta( ple->p_item->i_id );
break;
case ItemStateChanged_Type:
// TODO: Fusion with above state
vlc_value_t oldval, vlc_value_t newval, void *param )
{
InputManager *im = (InputManager*)param;
+ input_item_t *p_item = static_cast<input_item_t *>(newval.p_address);
- IMEvent *event = new IMEvent( ItemChanged_Type, newval.i_int );
+ IMEvent *event = new IMEvent( ItemChanged_Type, p_item );
QApplication::postEvent( im, event );
return VLC_SUCCESS;
}
switch( newval.i_int )
{
case INPUT_EVENT_STATE:
- event = new IMEvent( ItemStateChanged_Type, 0 );
+ event = new IMEvent( ItemStateChanged_Type );
break;
case INPUT_EVENT_RATE:
- event = new IMEvent( ItemRateChanged_Type, 0 );
+ event = new IMEvent( ItemRateChanged_Type );
break;
- case INPUT_EVENT_TIMES:
- event = new IMEvent( PositionUpdate_Type, 0 );
+ case INPUT_EVENT_POSITION:
+ //case INPUT_EVENT_LENGTH:
+ event = new IMEvent( PositionUpdate_Type );
break;
case INPUT_EVENT_TITLE:
case INPUT_EVENT_CHAPTER:
- event = new IMEvent( ItemTitleChanged_Type, 0 );
+ event = new IMEvent( ItemTitleChanged_Type );
break;
case INPUT_EVENT_ES:
- event = new IMEvent( ItemEsChanged_Type, 0 );
+ event = new IMEvent( ItemEsChanged_Type );
break;
case INPUT_EVENT_TELETEXT:
- event = new IMEvent( ItemTeletextChanged_Type, 0 );
+ event = new IMEvent( ItemTeletextChanged_Type );
break;
case INPUT_EVENT_STATISTICS:
- event = new IMEvent( StatisticsUpdate_Type, 0 );
+ event = new IMEvent( StatisticsUpdate_Type );
break;
case INPUT_EVENT_VOUT:
- event = new IMEvent( InterfaceVoutUpdate_Type, 0 );
+ event = new IMEvent( InterfaceVoutUpdate_Type );
break;
case INPUT_EVENT_AOUT:
- event = new IMEvent( InterfaceAoutUpdate_Type, 0 );
+ event = new IMEvent( InterfaceAoutUpdate_Type );
break;
case INPUT_EVENT_ITEM_META: /* Codec MetaData + Art */
- event = new IMEvent( MetaChanged_Type, 0 );
+ event = new IMEvent( MetaChanged_Type );
break;
case INPUT_EVENT_ITEM_INFO: /* Codec Info */
- event = new IMEvent( InfoChanged_Type, 0 );
+ event = new IMEvent( InfoChanged_Type );
break;
case INPUT_EVENT_ITEM_NAME:
- event = new IMEvent( NameChanged_Type, 0 );
+ event = new IMEvent( NameChanged_Type );
break;
case INPUT_EVENT_AUDIO_DELAY:
case INPUT_EVENT_SUBTITLE_DELAY:
- event = new IMEvent( SynchroChanged_Type, 0 );
+ event = new IMEvent( SynchroChanged_Type );
break;
case INPUT_EVENT_CACHE:
- event = new IMEvent( CachingEvent_Type, 0 );
+ event = new IMEvent( CachingEvent_Type );
break;
case INPUT_EVENT_BOOKMARK:
- event = new IMEvent( BookmarksChanged_Type, 0 );
+ event = new IMEvent( BookmarksChanged_Type );
break;
case INPUT_EVENT_RECORD:
- event = new IMEvent( RecordingEvent_Type, 0 );
+ event = new IMEvent( RecordingEvent_Type );
break;
case INPUT_EVENT_PROGRAM:
/* This is for PID changes */
- event = new IMEvent( ProgramChanged_Type, 0 );
+ event = new IMEvent( ProgramChanged_Type );
break;
case INPUT_EVENT_SIGNAL:
/* This is for capture-card signals */
- /* event = new IMEvent( SignalChanged_Type, 0 );
+ /* event = new IMEvent( SignalChanged_Type );
break; */
default:
event = NULL;
vlc_value_t, vlc_value_t, void *param )
{
InputManager *im = (InputManager*)param;
- IMEvent *event = new IMEvent( ItemTeletextChanged_Type, 0 );
+ IMEvent *event = new IMEvent( ItemTeletextChanged_Type );
QApplication::postEvent( im, event );
return VLC_SUCCESS;
void InputManager::UpdateStatus()
{
/* Update playing status */
- vlc_value_t val; val.i_int = 0;
- var_Get( p_input, "state", &val );
- if( i_old_playing_status != val.i_int )
+ int state = var_GetInteger( p_input, "state" );
+ if( i_old_playing_status != state )
{
- i_old_playing_status = val.i_int;
- emit statusChanged( val.i_int );
+ i_old_playing_status = state;
+ emit statusChanged( state );
}
}
inline void InputManager::UpdateMeta()
{
- emit metaChanged( input_GetItem( p_input ) );
+ emit currentMetaChanged( input_GetItem( p_input ) );
}
inline void InputManager::UpdateInfo()
if( !strcmp( text.p_list->p_values[i].psz_string, "Title" ) )
root = i;
}
- var_Change( p_input, "title 0", VLC_VAR_FREELIST, &val, &text );
+ var_FreeList( &val, &text );
var_SetInteger( p_input, "title 0", root );
}
i = 0;
var_SetInteger( p_input, "spu-es", b_enable ? list.p_list->p_values[i].i_int : -1 );
}
- var_Change( p_input, "teletext-es", VLC_VAR_FREELIST, &list, &text );
+ var_FreeList( &list, &text );
}
}
im, setInput( input_thread_t * ) );
/* emit check if playlist has already started playing */
- IMEvent *event = new IMEvent( ItemChanged_Type,
- var_GetInteger( THEPL, "item-current" ) );
- customEvent( event );
- delete event;
+ input_thread_t *p_input = playlist_CurrentInput( THEPL );
+ if( p_input )
+ {
+ input_item_t *p_item = input_GetItem( p_input );
+ if( p_item )
+ {
+ IMEvent *event = new IMEvent( ItemChanged_Type, p_item );
+ customEvent( event );
+ delete event;
+ }
+ vlc_object_release( p_input );
+ }
}
MainInputManager::~MainInputManager()
/* Static callbacks for MIM */
static int PLItemChanged( vlc_object_t *p_this, const char *psz_var,
- vlc_value_t oldval, vlc_value_t newval, void *param )
+ vlc_value_t oldval, vlc_value_t, void *param )
{
MainInputManager *mim = (MainInputManager*)param;
- IMEvent *event = new IMEvent( ItemChanged_Type, newval.i_int );
+ IMEvent *event = new IMEvent( ItemChanged_Type );
QApplication::postEvent( mim, event );
return VLC_SUCCESS;
}
{
MainInputManager *mim = (MainInputManager*)param;
- IMEvent *event = new IMEvent( VolumeChanged_Type, newval.i_int );
+ IMEvent *event = new IMEvent( VolumeChanged_Type );
QApplication::postEvent( mim, event );
return VLC_SUCCESS;
}
{
friend class InputManager;
public:
- IMEvent( int type, int id ) : QEvent( (QEvent::Type)(type) )
- { i_id = id ; }
- virtual ~IMEvent() {}
+ IMEvent( int type, input_item_t *p_input = NULL )
+ : QEvent( (QEvent::Type)(type) )
+ {
+ if( (p_item = p_input) != NULL )
+ vlc_gc_incref( p_item );
+ }
+ virtual ~IMEvent()
+ {
+ if( p_item )
+ vlc_gc_decref( p_item );
+ }
private:
- int i_id;
+ input_item_t *p_item;
};
class InputManager : public QObject
private:
intf_thread_t *p_intf;
input_thread_t *p_input;
- int i_input_id;
+ input_item_t *p_item;
int i_old_playing_status;
QString oldName;
QString artUrl;
/// Statistics are updated
void statisticsUpdated( input_item_t* );
void infoChanged( input_item_t* );
- void metaChanged( input_item_t* );
+ void currentMetaChanged( input_item_t* );
void metaChanged( int );
void artChanged( QString );
/// Play/pause status
videoIsActive = false;
/* Try to resize, except when you are in Fullscreen mode */
- if( !isFullScreen() ) doComponentsUpdate();
+ doComponentsUpdate();
}
/* Call from WindowControl function */
void askReleaseVideo( );
void askVideoToResize( unsigned int, unsigned int );
void askVideoToShow( unsigned int, unsigned int );
- void askVideoToToggle();
void askBgWidgetToToggle();
void askUpdate();
void minimalViewToggled( bool );
}
/* clean up everything */
- var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, NULL );
+ var_FreeList( &val_list, NULL );
return i_result;
}
currentGroup = NULL;
/* clean up everything */
- var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
#undef CURVAL
#undef CURTEXT
Q_INIT_RESOURCE( vlc );
-#if !defined(WIN32) && !defined(__APPLE__)
- /* KLUDGE:
- * disables icon theme use because that makes Cleanlooks style bug
- * because it asks gconf for some settings that timeout because of threads
- * see commits 21610 21622 21654 for reference */
-
- /* If you don't have a gconftool-2 binary, you should comment this line */
- if( strcmp( qVersion(), "4.4.0" ) < 0 ) /* fixed in Qt 4.4.0 */
- QApplication::setDesktopSettingsAware( false );
-#endif
-
/* Start the QApplication here */
#ifdef Q_WS_X11
char *display = var_CreateGetNonEmptyString( p_intf, "x11-display" );
#include <QEvent>
#include <QString>
-#if ( QT_VERSION < 0x040300 )
+#if ( QT_VERSION < 0x040400 )
# error Update your Qt version
#endif
#if QT_VERSION == 0x040500
#include <QRegExp>
#include <QSignalMapper>
+#ifdef WIN32
+#include <shlobj.h>
+#endif
+
RecentsMRL* RecentsMRL::instance = NULL;
RecentsMRL::RecentsMRL( intf_thread_t *_p_intf ) : p_intf( _p_intf )
{
if ( !isActive || ( filter && filter->indexIn( mrl ) >= 0 ) )
return;
-
+#ifdef WIN32
+ SHAddToRecentDocs( 0x00000002 , qtu( mrl ) );
+#endif
msg_Dbg( p_intf, "Adding a new MRL to recent ones: %s", qtu( mrl ) );
int i_index = stack->indexOf( mrl );
if( 0 <= i_index )
}
QVLCMenu::updateRecents( p_intf );
save();
+
}
void RecentsMRL::clear()
--- /dev/null
+/*****************************************************************************
+ * variables.cpp : VLC variable class
+ ****************************************************************************
+ * Copyright (C) 2009 Rémi Denis-Courmont
+ * Copyright (C) 2006 the VideoLAN team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "qt4.hpp"
+#include "variables.hpp"
+
+QVLCVariable::QVLCVariable (vlc_object_t *obj, const char *varname, int type,
+ bool inherit)
+ : object (obj), name (qfu(varname))
+{
+ vlc_object_hold (object);
+
+ if (inherit)
+ type |= VLC_VAR_DOINHERIT;
+ var_Create (object, qtu(name), type);
+ var_AddCallback (object, qtu(name), callback, this);
+}
+
+QVLCVariable::~QVLCVariable (void)
+{
+ var_DelCallback (object, qtu(name), callback, this);
+ var_Destroy (object, qtu(name));
+ vlc_object_release (object);
+}
+
+int QVLCVariable::callback (vlc_object_t *object, const char *,
+ vlc_value_t old, vlc_value_t cur, void *data)
+{
+ QVLCVariable *self = static_cast<QVLCVariable *>(data);
+
+ self->trigger (self->object, old, cur);
+ return VLC_SUCCESS;
+}
+
+
+QVLCPointer::QVLCPointer (vlc_object_t *obj, const char *varname, bool inherit)
+ : QVLCVariable (obj, varname, VLC_VAR_ADDRESS, inherit)
+{
+}
+
+void QVLCPointer::trigger (vlc_object_t *obj, vlc_value_t old, vlc_value_t cur)
+{
+ emit pointerChanged (obj, old.p_address, cur.p_address);
+ emit pointerChanged (obj, cur.p_address);
+}
+
+
+QVLCInteger::QVLCInteger (vlc_object_t *obj, const char *varname, bool inherit)
+ : QVLCVariable (obj, varname, VLC_VAR_INTEGER, inherit)
+{
+}
+
+void QVLCInteger::trigger (vlc_object_t *obj, vlc_value_t old, vlc_value_t cur)
+{
+ emit integerChanged (obj, old.i_int, cur.i_int);
+ emit integerChanged (obj, cur.i_int);
+}
--- /dev/null
+/*****************************************************************************
+ * external.hpp : Dialogs from other LibVLC core and other plugins
+ ****************************************************************************
+ * Copyright (C) 2009 Rémi Denis-Courmont
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef QVLC_VARIABLES_H_
+#define QVLC_VARIABLES_H_ 1
+
+#include <QObject>
+#include <vlc_common.h>
+
+class QVLCVariable : public QObject
+{
+ Q_OBJECT
+private:
+ static int callback (vlc_object_t *, const char *,
+ vlc_value_t, vlc_value_t, void *);
+ vlc_object_t *object;
+ QString name;
+ virtual void trigger (vlc_object_t *, vlc_value_t, vlc_value_t) = 0;
+
+public:
+ QVLCVariable (vlc_object_t *, const char *, int, bool);
+ virtual ~QVLCVariable (void);
+};
+
+class QVLCPointer : public QVLCVariable
+{
+ Q_OBJECT
+private:
+ virtual void trigger (vlc_object_t *, vlc_value_t, vlc_value_t);
+
+public:
+ QVLCPointer (vlc_object_t *, const char *, bool inherit = false);
+
+signals:
+ void pointerChanged (vlc_object_t *, void *, void *);
+ void pointerChanged (vlc_object_t *, void *);
+};
+
+class QVLCInteger : public QVLCVariable
+{
+ Q_OBJECT
+private:
+ virtual void trigger (vlc_object_t *, vlc_value_t, vlc_value_t);
+
+public:
+ QVLCInteger (vlc_object_t *, const char *, bool inherit = false);
+
+signals:
+ void integerChanged (vlc_object_t *, int, int);
+ void integerChanged (vlc_object_t *, int);
+};
+
+#endif
video_format_t fmt_in = {0}, fmt_out = {0};
picture_t *pPic;
- fmt_out.i_chroma = VLC_FOURCC('R','G','B','A');
+ fmt_out.i_chroma = VLC_CODEC_RGBA;
pPic = image_ReadUrl( pImageHandler, fileName.c_str(), &fmt_in, &fmt_out );
if( !pPic ) return;
int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
+ vlc_value_t oldval, vlc_value_t newval,
void *pParam )
{
VlcProc *pThis = (VlcProc*)pParam;
+ input_item_t *p_item = static_cast<input_item_t*>(newval.p_address);
// Update the stream variable
pThis->updateStreamName();
// Create a playtree notify command
CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
- newVal.i_int );
+ p_item->i_id );
// Push the command in the asynchronous command queue
AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
+ vlc_value_t oldval, vlc_value_t newval,
void *pParam )
{
VlcProc *pThis = (VlcProc*)pParam;
+ input_item_t *p_item = static_cast<input_item_t*>(newval.p_address);
AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
pThis->updateStreamName();
// Create two playtree notify commands: one for old item, one for new
+#if 0 /* FIXME: Heck, no! You cannot do that.
+ There is no warranty that the old item is still valid. */
CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
oldVal.i_int );
pQueue->push( CmdGenericPtr( pCmdTree ) , true );
- pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), newVal.i_int );
+#endif
+ CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), p_item->i_id );
pQueue->push( CmdGenericPtr( pCmdTree ) , true );
return VLC_SUCCESS;
if( p_item->i_children == -1 )
{
playlist_DeleteFromInput( getIntf()->p_sys->p_playlist,
- p_item->p_input->i_id, pl_Locked );
+ p_item->p_input, pl_Locked );
it2 = getNextVisibleItem( it ) ;
it->parent()->removeChild( it );
it = it2;
/* Clean up everything */
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
- var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
return hSubMenu;
}
/**********************************************************************
* Private functions
**********************************************************************/
-void Playlist::DeleteItem( int item )
+void Playlist::DeleteItem( input_item_t *item )
{
playlist_t *p_playlist = pl_Hold( p_intf );
if( p_playlist == NULL ) return;
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
{
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
{
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
{
int * py_pos )
: ConfigControl( p_this, p_item, parent, hInst )
{
- // Number of keys descriptions
- unsigned int i_keys = sizeof(vlc_keys)/sizeof(key_descriptor_t);
-
// Init the keys decriptions array
if( m_keysList == NULL )
{
- m_keysList = new string[i_keys];
- for( unsigned int i = 0; i < i_keys; i++ )
+ m_keysList = new string[vlc_num_keys];
+ for( size_t i = 0; i < vlc_num_keys; ++i )
{
m_keysList[i] = vlc_keys[i].psz_key_string;
}
*py_pos += 15 + 10;
- for( unsigned int i = 0; i < i_keys ; i++ )
+ for( size_t i = 0; i < vlc_num_keys ; ++i )
{
ComboBox_AddString( combo, _FROMMB(m_keysList[i].c_str()) );
ComboBox_SetItemData( combo, i, (void*)vlc_keys[i].i_key_code );
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
- if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
+ if ( p_aout->output.output.i_format == VLC_CODEC_SPDIFL )
{
p_aout->output.i_nb_samples = A52_FRAME_NB;
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
bool b_chroma = 0;
psz_chroma = config_GetPsz( p_vout, "dummy-chroma" );
- if( psz_chroma )
- {
- if( strlen( psz_chroma ) >= 4 )
- {
- i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1],
- psz_chroma[2], psz_chroma[3] );
- b_chroma = 1;
- }
-
- free( psz_chroma );
- }
+ i_chroma = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_chroma );
+ b_chroma = i_chroma != 0;
+ free( psz_chroma );
I_OUTPUTPICTURES = 0;
msg_Dbg( p_vout, "forcing chroma 0x%.8x (%4.4s)",
i_chroma, (char*)&i_chroma );
p_vout->output.i_chroma = i_chroma;
- if ( i_chroma == VLC_FOURCC( 'R', 'G', 'B', '2' ) )
+ if ( i_chroma == VLC_CODEC_RGB8 )
{
p_vout->output.pf_setpalette = SetPalette;
}
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+ fmt.i_chroma = VLC_CODEC_YUVP;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_visible_width = i_width + 4;
fmt.i_height = fmt.i_visible_height = i_height + 4;
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt.i_chroma = VLC_CODEC_YUVA;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_visible_width = i_width + 6;
fmt.i_height = fmt.i_visible_height = i_height + 6;
static int vlclua_playlist_current( lua_State *L )
{
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
- lua_pushinteger( L, var_GetInteger( p_playlist, "item-current" ) );
+ input_thread_t *p_input = playlist_CurrentInput( p_playlist );
+ int id = -1;
+
+ if( p_input )
+ {
+ input_item_t *p_item = input_GetItem( p_input );
+ if( p_item )
+ id = p_item->i_id;
+ vlc_object_release( p_input );
+ }
+
+#warning Indexing input items by ID is unsafe,
+ lua_pushinteger( L, id );
vlclua_release_playlist_internal( p_playlist );
return 1;
}
if( i_ret < 0 ) return vlclua_push_ret( L, i_ret );
vlclua_pushvalue( L, VLC_VAR_LIST, val );
vlclua_pushvalue( L, VLC_VAR_LIST, text );
- var_Change( *pp_obj, psz_var, VLC_VAR_FREELIST, &val, &text );
+ var_FreeList( &val, &text );
return 2;
}
playlist_t* p_playlist = (playlist_t*) p_this;
char *psz_buf = NULL;
input_thread_t *p_input;
+ input_item_t *p_item = newval.p_address;
bool b_is_item_current = !strcmp( "item-current", psz_var );
/* Don't update Telepathy presence each time an item has been preparsed */
if( b_is_item_current )
{ /* stores the current input item id */
- p_intf->p_sys->i_id = newval.i_int;
+ p_intf->p_sys->i_id = p_item->i_id;
p_intf->p_sys->i_item_changes = 0;
}
else
{
- if( newval.i_int != p_intf->p_sys->i_id ) /* "item-change" */
+
+ if( p_item->i_id != p_intf->p_sys->i_id ) /* "item-change" */
return VLC_SUCCESS;
/* Some variable bitrate inputs call "item-change callbacks each time
* their length is updated, that is several times per second.
memset( &fmt_in, 0, sizeof(video_format_t) );
memset( &fmt_out, 0, sizeof(video_format_t) );
- fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt_out.i_chroma = VLC_CODEC_YUVA;
if( p_menu->p_image )
{
p_state->p_pic = image_ReadUrl( p_menu->p_image, psz_file,
// Create a new subpicture region
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt.i_chroma = VLC_CODEC_YUVA;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_visible_width = i_width;
fmt.i_height = fmt.i_visible_height = i_textblock_height + VERTICAL_MARGIN * 2;
switch( p_fmt->i_codec )
{
- case VLC_FOURCC( 's', '1', '6', 'b' ):
+ case VLC_CODEC_S16B:
if( p_fmt->audio.i_channels == 1 && p_fmt->audio.i_rate == 44100 )
{
p_es->i_payload_type = 11;
p_fmt->audio.i_channels ) == -1 )
p_es->psz_rtpmap = NULL;
break;
- case VLC_FOURCC( 'u', '8', ' ', ' ' ):
+ case VLC_CODEC_U8:
p_es->i_payload_type = p_media->i_payload_type++;
if( asprintf( &p_es->psz_rtpmap, "L8/%d/%d", p_fmt->audio.i_rate,
p_fmt->audio.i_channels ) == -1 )
p_es->psz_rtpmap = NULL;
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
- case VLC_FOURCC( 'm', 'p', '3', ' ' ):
+ case VLC_CODEC_MPGA:
p_es->i_payload_type = 14;
p_es->psz_rtpmap = strdup( "MPA/90000" );
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'v' ):
+ case VLC_CODEC_MPGV:
p_es->i_payload_type = 32;
p_es->psz_rtpmap = strdup( "MPV/90000" );
break;
- case VLC_FOURCC( 'a', '5', '2', ' ' ):
+ case VLC_CODEC_A52:
p_es->i_payload_type = p_media->i_payload_type++;
if( asprintf( &p_es->psz_rtpmap, "ac3/%d", p_fmt->audio.i_rate ) == -1 )
p_es->psz_rtpmap = NULL;
break;
- case VLC_FOURCC( 'H', '2', '6', '3' ):
+ case VLC_CODEC_H263:
p_es->i_payload_type = p_media->i_payload_type++;
p_es->psz_rtpmap = strdup( "H263-1998/90000" );
break;
- case VLC_FOURCC( 'h', '2', '6', '4' ):
+ case VLC_CODEC_H264:
p_es->i_payload_type = p_media->i_payload_type++;
p_es->psz_rtpmap = strdup( "H264/90000" );
p_es->psz_fmtp = NULL;
if( !p_es->psz_fmtp )
p_es->psz_fmtp = strdup( "packetization-mode=1" );
break;
- case VLC_FOURCC( 'm', 'p', '4', 'v' ):
+ case VLC_CODEC_MP4V:
p_es->i_payload_type = p_media->i_payload_type++;
p_es->psz_rtpmap = strdup( "MP4V-ES/90000" );
if( p_fmt->i_extra > 0 )
free( p_hexa );
}
break;
- case VLC_FOURCC( 'm', 'p', '4', 'a' ):
+ case VLC_CODEC_MP4A:
p_es->i_payload_type = p_media->i_payload_type++;
if( asprintf( &p_es->psz_rtpmap, "mpeg4-generic/%d", p_fmt->audio.i_rate ) == -1 )
p_es->psz_rtpmap = NULL;
p_es->i_payload_type = p_media->i_payload_type++;
p_es->psz_rtpmap = strdup( "MP2P/90000" );
break;
- case VLC_FOURCC( 's', 'a', 'm', 'r' ):
+ case VLC_CODEC_AMR_NB:
p_es->i_payload_type = p_media->i_payload_type++;
p_es->psz_rtpmap = strdup( p_fmt->audio.i_channels == 2 ?
"AMR/8000/2" : "AMR/8000" );
p_es->psz_fmtp = strdup( "octet-align=1" );
break;
- case VLC_FOURCC( 's', 'a', 'w', 'b' ):
+ case VLC_CODEC_AMR_WB:
p_es->i_payload_type = p_media->i_payload_type++;
p_es->psz_rtpmap = strdup( p_fmt->audio.i_channels == 2 ?
"AMR-WB/16000/2" : "AMR-WB/16000" );
#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_interface.h>
-#include <vlc_aout.h>
-#include <vlc_vout.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <vlc_common.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#include "stats.h"
p_dec->pf_decode_sub = NULL;
/* */
- es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC('I','4','2','0') );
+ es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_I420 );
p_dec->fmt_out.video.i_width = 100;
p_dec->fmt_out.video.i_height = 100;
p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR;
#include <vlc_common.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
#include "stats.h"
msg_Dbg( p_vout, "forcing chroma 0x%.8x (%4.4s)",
i_chroma, (char*)&i_chroma );
p_vout->output.i_chroma = i_chroma;
- if ( i_chroma == VLC_FOURCC( 'R', 'G', 'B', '2' ) )
+ if ( i_chroma == VLC_CODEC_RGB8 )
{
p_vout->output.pf_setpalette = SetPalette;
}
/* Create a new subpicture region */
memset( &fmt, 0, sizeof( video_format_t ) );
- fmt.i_chroma = VLC_FOURCC( 'Y','U','V','A' );
+ fmt.i_chroma = VLC_CODEC_YUVA;
fmt.i_aspect = VOUT_ASPECT_FACTOR;
fmt.i_width = fmt.i_visible_width = i_width;
fmt.i_height = fmt.i_visible_height = i_height;
}
p_svg->i_width = p_sys->i_width;
p_svg->i_height = p_sys->i_height;
- p_svg->i_chroma = VLC_FOURCC( 'Y','U','V','A' );
+ p_svg->i_chroma = VLC_CODEC_YUVA;
/* Render the SVG.
The input data is stored in the p_string structure,
{
printf( "value %i: %s\n", i, val.p_list->p_values[i].psz_string );
}
- var_Change( p_this, "honk", VLC_VAR_FREELIST, &val, NULL );
+ var_FreeList( &val, NULL );
var_Destroy( p_this, "honk" );
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+ fmt.i_chroma = VLC_CODEC_YUVP;
fmt.i_width = fmt.i_visible_width = i_width + (b_outline ? 4 : 0);
fmt.i_height = fmt.i_visible_height = i_height + (b_outline ? 4 : 0);
fmt.i_x_offset = fmt.i_y_offset = 0;
switch( p_input->p_fmt->i_codec )
{
- case VLC_FOURCC( 'a', '5', '2', ' ' ):
+ case VLC_CODEC_A52:
tk->i_tag = WAVE_FORMAT_A52;
tk->psz_name = "A/52";
i_bitspersample = 0;
break;
- case VLC_FOURCC( 'm', 'p', '4', 'a' ):
+ case VLC_CODEC_MP4A:
tk->i_tag = WAVE_FORMAT_AAC;
tk->psz_name = "MPEG-4 Audio";
i_bitspersample = 0;
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
+ case VLC_CODEC_MPGA:
#if 1
tk->psz_name = "MPEG Audio Layer 3";
tk->i_tag = WAVE_FORMAT_MPEGLAYER3;
i_extra = 22;
break;
#endif
- case VLC_FOURCC( 'w', 'm', 'a', '1' ):
+ case VLC_CODEC_WMA1:
tk->psz_name = "Windows Media Audio v1";
tk->i_tag = WAVE_FORMAT_WMA1;
tk->b_audio_correction = true;
break;
- case VLC_FOURCC( 'w', 'm', 'a', ' ' ):
- case VLC_FOURCC( 'w', 'm', 'a', '2' ):
+ case VLC_CODEC_WMA2:
tk->psz_name= "Windows Media Audio (v2) 7, 8 and 9 Series";
tk->i_tag = WAVE_FORMAT_WMA2;
tk->b_audio_correction = true;
break;
- case VLC_FOURCC( 'w', 'm', 'a', 'p' ):
+ case VLC_CODEC_WMAP:
tk->psz_name = "Windows Media Audio 9 Professional";
tk->i_tag = WAVE_FORMAT_WMAP;
tk->b_audio_correction = true;
break;
- case VLC_FOURCC( 'w', 'm', 'a', 'l' ):
+ case VLC_CODEC_WMAL:
tk->psz_name = "Windows Media Audio 9 Lossless";
tk->i_tag = WAVE_FORMAT_WMAL;
tk->b_audio_correction = true;
break;
/* raw codec */
- case VLC_FOURCC( 'u', '8', ' ', ' ' ):
+ case VLC_CODEC_U8:
tk->psz_name = "Raw audio 8bits";
tk->i_tag = WAVE_FORMAT_PCM;
i_blockalign= p_input->p_fmt->audio.i_channels;
i_bitspersample = 8;
break;
- case VLC_FOURCC( 's', '1', '6', 'l' ):
+ case VLC_CODEC_S16L:
tk->psz_name = "Raw audio 16bits";
tk->i_tag = WAVE_FORMAT_PCM;
i_blockalign= 2 * p_input->p_fmt->audio.i_channels;
i_bitspersample = 16;
break;
- case VLC_FOURCC( 's', '2', '4', 'l' ):
+ case VLC_CODEC_S24L:
tk->psz_name = "Raw audio 24bits";
tk->i_tag = WAVE_FORMAT_PCM;
i_blockalign= 3 * p_input->p_fmt->audio.i_channels;
i_bitspersample = 24;
break;
- case VLC_FOURCC( 's', '3', '2', 'l' ):
+ case VLC_CODEC_S32L:
tk->psz_name = "Raw audio 32bits";
tk->i_tag = WAVE_FORMAT_PCM;
i_blockalign= 4 * p_input->p_fmt->audio.i_channels;
uint8_t *p_codec_extra = NULL;
int i_codec_extra = 0;
- if( p_input->p_fmt->i_codec == VLC_FOURCC('m','p','4','v') )
+ if( p_input->p_fmt->i_codec == VLC_CODEC_MP4V )
{
tk->psz_name = "MPEG-4 Video";
tk->i_fourcc = VLC_FOURCC( 'M', 'P', '4', 'S' );
}
- else if( p_input->p_fmt->i_codec == VLC_FOURCC('D','I','V','3') )
+ else if( p_input->p_fmt->i_codec == VLC_CODEC_DIV3 )
{
tk->psz_name = "MSMPEG-4 V3 Video";
tk->i_fourcc = VLC_FOURCC( 'M', 'P', '4', '3' );
}
- else if( p_input->p_fmt->i_codec == VLC_FOURCC('D','I','V','2') )
+ else if( p_input->p_fmt->i_codec == VLC_CODEC_DIV2 )
{
tk->psz_name = "MSMPEG-4 V2 Video";
tk->i_fourcc = VLC_FOURCC( 'M', 'P', '4', '2' );
}
- else if( p_input->p_fmt->i_codec == VLC_FOURCC('D','I','V','1') )
+ else if( p_input->p_fmt->i_codec == VLC_CODEC_DIV2 )
{
tk->psz_name = "MSMPEG-4 V1 Video";
tk->i_fourcc = VLC_FOURCC( 'M', 'P', 'G', '4' );
}
- else if( p_input->p_fmt->i_codec == VLC_FOURCC('W','M','V','1') )
+ else if( p_input->p_fmt->i_codec == VLC_CODEC_WMV1 )
{
tk->psz_name = "Windows Media Video 7";
tk->i_fourcc = VLC_FOURCC( 'W', 'M', 'V', '1' );
}
- else if( p_input->p_fmt->i_codec == VLC_FOURCC('W','M','V','2') )
+ else if( p_input->p_fmt->i_codec == VLC_CODEC_WMV2 )
{
tk->psz_name = "Windows Media Video 8";
tk->i_fourcc = VLC_FOURCC( 'W', 'M', 'V', '2' );
}
- else if( p_input->p_fmt->i_codec == VLC_FOURCC('W','M','V','3') )
+ else if( p_input->p_fmt->i_codec == VLC_CODEC_WMV3 )
{
tk->psz_name = "Windows Media Video 9";
tk->i_fourcc = VLC_FOURCC( 'W', 'M', 'V', '3' );
}
- else if( p_input->p_fmt->i_codec == VLC_FOURCC('W','V','C','1') )
+ else if( p_input->p_fmt->i_codec == VLC_CODEC_VC1 )
{
tk->psz_name = "Windows Media Video 9 Advanced Profile";
tk->i_fourcc = VLC_FOURCC( 'W', 'V', 'C', '1' );
}
}
}
- else if( p_input->p_fmt->i_codec == VLC_FOURCC('h','2','6','4') )
+ else if( p_input->p_fmt->i_codec == VLC_CODEC_H264 )
{
tk->psz_name = "H.264/MPEG-4 AVC";
tk->i_fourcc = VLC_FOURCC('h','2','6','4');
else
{
tk->psz_name = _("Unknown Video");
- tk->i_fourcc = p_input->p_fmt->i_codec;
+ tk->i_fourcc = p_input->p_fmt->i_original_fourcc ?: p_input->p_fmt->i_codec;
}
if( !i_codec_extra && p_fmt->i_extra > 0 )
{
switch( p_input->p_fmt->i_codec )
{
- case VLC_FOURCC( 'a', '5', '2', ' ' ):
+ case VLC_CODEC_A52:
p_wf->wFormatTag = WAVE_FORMAT_A52;
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
+ case VLC_CODEC_MPGA:
p_wf->wFormatTag = WAVE_FORMAT_MPEGLAYER3;
break;
- case VLC_FOURCC( 'w', 'm', 'a', '1' ):
+ case VLC_CODEC_WMA1:
p_wf->wFormatTag = WAVE_FORMAT_WMA1;
break;
- case VLC_FOURCC( 'w', 'm', 'a', ' ' ):
- case VLC_FOURCC( 'w', 'm', 'a', '2' ):
+ case VLC_CODEC_WMA2:
p_wf->wFormatTag = WAVE_FORMAT_WMA2;
break;
- case VLC_FOURCC( 'w', 'm', 'a', 'p' ):
+ case VLC_CODEC_WMAP:
p_wf->wFormatTag = WAVE_FORMAT_WMAP;
break;
- case VLC_FOURCC( 'w', 'm', 'a', 'l' ):
+ case VLC_CODEC_WMAL:
p_wf->wFormatTag = WAVE_FORMAT_WMAL;
break;
/* raw codec */
- case VLC_FOURCC( 'u', '8', ' ', ' ' ):
+ case VLC_CODEC_U8:
p_wf->wFormatTag = WAVE_FORMAT_PCM;
p_wf->nBlockAlign= p_wf->nChannels;
p_wf->wBitsPerSample = 8;
break;
- case VLC_FOURCC( 's', '1', '6', 'l' ):
+ case VLC_CODEC_S16L:
p_wf->wFormatTag = WAVE_FORMAT_PCM;
p_wf->nBlockAlign= 2 * p_wf->nChannels;
p_wf->wBitsPerSample = 16;
break;
- case VLC_FOURCC( 's', '2', '4', 'l' ):
+ case VLC_CODEC_S24L:
p_wf->wFormatTag = WAVE_FORMAT_PCM;
p_wf->nBlockAlign= 3 * p_wf->nChannels;
p_wf->wBitsPerSample = 24;
break;
- case VLC_FOURCC( 's', '3', '2', 'l' ):
+ case VLC_CODEC_S32L:
p_wf->wFormatTag = WAVE_FORMAT_PCM;
p_wf->nBlockAlign= 4 * p_wf->nChannels;
p_wf->wBitsPerSample = 32;
p_bih->biClrImportant = 0;
switch( p_input->p_fmt->i_codec )
{
- case VLC_FOURCC( 'm', 'p', '4', 'v' ):
+ case VLC_CODEC_MP4V:
p_bih->biCompression = VLC_FOURCC( 'X', 'V', 'I', 'D' );
break;
default:
- p_bih->biCompression = p_input->p_fmt->i_codec;
+ p_bih->biCompression = p_input->p_fmt->i_original_fourcc ?: p_input->p_fmt->i_codec;
break;
}
#undef p_bih
switch( p_input->p_fmt->i_codec )
{
- case VLC_FOURCC( 'm', 'p', '4', 'a' ):
- case VLC_FOURCC( 'm', 'p', '4', 'v' ):
- case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
- case VLC_FOURCC( 'm', 'p', 'g', 'v' ):
- case VLC_FOURCC( 'M', 'J', 'P', 'G' ):
- case VLC_FOURCC( 'm', 'j', 'p', 'b' ):
- case VLC_FOURCC( 'S', 'V', 'Q', '1' ):
- case VLC_FOURCC( 'S', 'V', 'Q', '3' ):
- case VLC_FOURCC( 'H', '2', '6', '3' ):
- case VLC_FOURCC( 'h', '2', '6', '4' ):
- case VLC_FOURCC( 's', 'a', 'm', 'r' ):
- case VLC_FOURCC( 's', 'a', 'w', 'b' ):
- case VLC_FOURCC( 'Y', 'V', '1', '2' ):
- case VLC_FOURCC( 'Y', 'U', 'Y', '2' ):
+ case VLC_CODEC_MP4A:
+ case VLC_CODEC_MP4V:
+ case VLC_CODEC_MPGA:
+ case VLC_CODEC_MPGV:
+ case VLC_CODEC_MJPG:
+ case VLC_CODEC_MJPGB:
+ case VLC_CODEC_SVQ1:
+ case VLC_CODEC_SVQ3:
+ case VLC_CODEC_H263:
+ case VLC_CODEC_H264:
+ case VLC_CODEC_AMR_NB:
+ case VLC_CODEC_AMR_WB:
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_YUYV:
break;
- case VLC_FOURCC( 's', 'u', 'b', 't' ):
+ case VLC_CODEC_SUBT:
msg_Warn( p_mux, "subtitle track added like in .mov (even when creating .mp4)" );
break;
default:
again:
p_data = block_FifoGet( p_input->p_fifo );
- if( p_stream->fmt.i_codec == VLC_FOURCC( 'h', '2', '6', '4' ) )
+ if( p_stream->fmt.i_codec == VLC_CODEC_H264 )
{
p_data = ConvertAVC1( p_data );
}
- else if( p_stream->fmt.i_codec == VLC_FOURCC( 's', 'u', 'b', 't' ) )
+ else if( p_stream->fmt.i_codec == VLC_CODEC_SUBT )
{
p_data = ConvertSUBT( p_data );
}
switch( p_stream->fmt.i_codec )
{
- case VLC_FOURCC( 'm', 'p', '4', 'v' ):
+ case VLC_CODEC_MP4V:
i_object_type_indication = 0x20;
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'v' ):
+ case VLC_CODEC_MPGV:
/* FIXME MPEG-I=0x6b, MPEG-II = 0x60 -> 0x65 */
i_object_type_indication = 0x60;
break;
- case VLC_FOURCC( 'm', 'p', '4', 'a' ):
+ case VLC_CODEC_MP4A:
/* FIXME for mpeg2-aac == 0x66->0x68 */
i_object_type_indication = 0x40;
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
+ case VLC_CODEC_MPGA:
i_object_type_indication =
p_stream->fmt.audio.i_rate < 32000 ? 0x69 : 0x6b;
break;
bo_add_fourcc( damr, "REFC" );
bo_add_8( damr, 0 );
- if( p_stream->fmt.i_codec == VLC_FOURCC( 's', 'a', 'm', 'r' ) )
+ if( p_stream->fmt.i_codec == VLC_CODEC_AMR_NB )
bo_add_16be( damr, 0x81ff ); /* Mode set (all modes for AMR_NB) */
else
bo_add_16be( damr, 0x83ff ); /* Mode set (all modes for AMR_WB) */
{
mp4_stream_t *p_stream = p_sys->pp_streams[i_track];
- if( p_stream->fmt.i_codec == VLC_FOURCC('m','p','4','v') ||
- p_stream->fmt.i_codec == VLC_FOURCC('m','p','4','a') )
+ if( p_stream->fmt.i_codec == VLC_CODEC_MP4V ||
+ p_stream->fmt.i_codec == VLC_CODEC_MP4A )
{
bo_t *box = box_new( "\251req" );
/* String length */
switch( p_stream->fmt.i_codec )
{
- case VLC_FOURCC('m','p','4','a'):
+ case VLC_CODEC_MP4A:
memcpy( fcc, "mp4a", 4 );
b_descr = true;
break;
- case VLC_FOURCC('s','a','m','r'):
- case VLC_FOURCC('s','a','w','b'):
+ case VLC_CODEC_AMR_NB:
+ case VLC_CODEC_AMR_WB:
memcpy( fcc, (char*)&p_stream->fmt.i_codec, 4 );
b_descr = true;
break;
- case VLC_FOURCC('m','p','g','a'):
+ case VLC_CODEC_MPGA:
if( p_sys->b_mov )
memcpy( fcc, ".mp3", 4 );
else
/* SoundDescription */
if( p_sys->b_mov &&
- p_stream->fmt.i_codec == VLC_FOURCC('m','p','4','a') )
+ p_stream->fmt.i_codec == VLC_CODEC_MP4A )
{
bo_add_16be( soun, 1 ); // version 1;
}
/* Extended data for SoundDescription V1 */
if( p_sys->b_mov &&
- p_stream->fmt.i_codec == VLC_FOURCC('m','p','4','a') )
+ p_stream->fmt.i_codec == VLC_CODEC_MP4A )
{
/* samples per packet */
bo_add_32be( soun, p_stream->fmt.audio.i_frame_length );
bo_t *box;
if( p_sys->b_mov &&
- p_stream->fmt.i_codec == VLC_FOURCC('m','p','4','a') )
+ p_stream->fmt.i_codec == VLC_CODEC_MP4A )
{
box = GetWaveTag( p_stream );
}
- else if( p_stream->fmt.i_codec == VLC_FOURCC('s','a','m','r') )
+ else if( p_stream->fmt.i_codec == VLC_CODEC_AMR_NB )
{
box = GetDamrTag( p_stream );
}
switch( p_stream->fmt.i_codec )
{
- case VLC_FOURCC('m','p','4','v'):
- case VLC_FOURCC('m','p','g','v'):
+ case VLC_CODEC_MP4V:
+ case VLC_CODEC_MPGV:
memcpy( fcc, "mp4v", 4 );
break;
- case VLC_FOURCC('M','J','P','G'):
+ case VLC_CODEC_MJPG:
memcpy( fcc, "mjpa", 4 );
break;
- case VLC_FOURCC('S','V','Q','1'):
+ case VLC_CODEC_SVQ1:
memcpy( fcc, "SVQ1", 4 );
break;
- case VLC_FOURCC('S','V','Q','3'):
+ case VLC_CODEC_SVQ3:
memcpy( fcc, "SVQ3", 4 );
break;
- case VLC_FOURCC('H','2','6','3'):
+ case VLC_CODEC_H263:
memcpy( fcc, "s263", 4 );
break;
- case VLC_FOURCC('h','2','6','4'):
+ case VLC_CODEC_H264:
memcpy( fcc, "avc1", 4 );
break;
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_YV12:
memcpy( fcc, "yv12", 4 );
break;
- case VLC_FOURCC('Y','U','Y','2'):
+ case VLC_CODEC_YUYV:
memcpy( fcc, "yuy2", 4 );
break;
/* add an ES Descriptor */
switch( p_stream->fmt.i_codec )
{
- case VLC_FOURCC('m','p','4','v'):
- case VLC_FOURCC('m','p','g','v'):
+ case VLC_CODEC_MP4V:
+ case VLC_CODEC_MPGV:
{
bo_t *esds = GetESDS( p_stream );
}
break;
- case VLC_FOURCC('H','2','6','3'):
+ case VLC_CODEC_H263:
{
bo_t *d263 = GetD263Tag();
}
break;
- case VLC_FOURCC('S','V','Q','3'):
+ case VLC_CODEC_SVQ3:
{
bo_t *esds = GetSVQ3Tag( p_stream );
}
break;
- case VLC_FOURCC('h','2','6','4'):
+ case VLC_CODEC_H264:
box_gather( vide, GetAvcCTag( p_stream ) );
break;
if( i_pts > 0 && i_dts > 0 &&
( i_pts != i_dts || ( p_fmt->i_cat == VIDEO_ES &&
- p_fmt->i_codec != VLC_FOURCC('m','p','g','v') ) ) )
+ p_fmt->i_codec != VLC_CODEC_MPGV ) ) )
{
i_pts_dts = 0x03;
if ( !i_header_size ) i_header_size = 0xa;
i_max_pes_size = PES_PAYLOAD_SIZE_MAX;
}
- if( p_fmt->i_codec == VLC_FOURCC( 'm', 'p','4', 'v' ) &&
+ if( p_fmt->i_codec == VLC_CODEC_MP4V &&
p_es->i_flags & BLOCK_FLAG_TYPE_I )
{
/* For MPEG4 video, add VOL before I-frames */
/* Init this new stream */
switch( p_input->p_fmt->i_codec )
{
- case VLC_FOURCC( 'm', 'p', '1', 'v' ):
- p_stream->i_stream_id =
- StreamIdGet( p_sys->stream_id_mpgv, 0xe0, 0xef );
- p_stream->i_stream_type = 0x01; /* ISO/IEC 11172 Video */
- break;
- case VLC_FOURCC( 'm', 'p', '2', 'v' ):
- case VLC_FOURCC( 'm', 'p', 'g', 'v' ):
+ case VLC_CODEC_MPGV:
p_stream->i_stream_id =
StreamIdGet( p_sys->stream_id_mpgv, 0xe0, 0xef );
p_stream->i_stream_type = 0x02; /* ISO/IEC 13818 Video */
break;
- case VLC_FOURCC( 'm', 'p', '4', 'v' ):
+ case VLC_CODEC_MP4V:
p_stream->i_stream_id =
StreamIdGet( p_sys->stream_id_mpgv, 0xe0, 0xef );
p_stream->i_stream_type = 0x10;
break;
- case VLC_FOURCC( 'h', '2', '6', '4' ):
+ case VLC_CODEC_H264:
p_stream->i_stream_id =
StreamIdGet( p_sys->stream_id_mpgv, 0xe0, 0xef );
p_stream->i_stream_type = 0x1b;
break;
- case VLC_FOURCC( 'l', 'p', 'c', 'm' ):
+ case VLC_CODEC_DVD_LPCM:
p_stream->i_stream_id =
0xbd00 | StreamIdGet( p_sys->stream_id_lpcm, 0xa0, 0xaf );
break;
- case VLC_FOURCC( 'd', 't', 's', ' ' ):
+ case VLC_CODEC_DTS:
p_stream->i_stream_id =
0xbd00 | StreamIdGet( p_sys->stream_id_dts, 0x88, 0x8f );
break;
- case VLC_FOURCC( 'a', '5', '2', ' ' ):
+ case VLC_CODEC_A52:
p_stream->i_stream_id =
0xbd00 | StreamIdGet( p_sys->stream_id_a52, 0x80, 0x87 );
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
+ case VLC_CODEC_MPGA:
p_stream->i_stream_id =
StreamIdGet( p_sys->stream_id_mpga, 0xc0, 0xcf );
p_stream->i_stream_type = 0x03; /* ISO/IEC 11172 Audio */
break;
- case VLC_FOURCC( 'm', 'p', '4', 'a' ):
+ case VLC_CODEC_MP4A:
p_stream->i_stream_id =
StreamIdGet( p_sys->stream_id_mpga, 0xc0, 0xcf );
p_stream->i_stream_type = 0x0f;
break;
- case VLC_FOURCC( 's', 'p', 'u', ' ' ):
+ case VLC_CODEC_SPU:
p_stream->i_stream_id =
0xbd00 | StreamIdGet( p_sys->stream_id_spu, 0x20, 0x3f );
break;
msg_Dbg( p_mux, "removing input" );
switch( p_input->p_fmt->i_codec )
{
- case VLC_FOURCC( 'm', 'p', 'g', 'v' ):
+ case VLC_CODEC_MPGV:
StreamIdRelease( p_sys->stream_id_mpgv, 0xe0,
p_stream->i_stream_id );
break;
- case VLC_FOURCC( 'l', 'p', 'c', 'm' ):
+ case VLC_CODEC_DVD_LPCM:
StreamIdRelease( p_sys->stream_id_lpcm, 0xa0,
p_stream->i_stream_id&0xff );
break;
- case VLC_FOURCC( 'd', 't', 's', ' ' ):
+ case VLC_CODEC_DTS:
StreamIdRelease( p_sys->stream_id_dts, 0x88,
p_stream->i_stream_id&0xff );
break;
- case VLC_FOURCC( 'a', '5', '2', ' ' ):
+ case VLC_CODEC_A52:
StreamIdRelease( p_sys->stream_id_a52, 0x80,
p_stream->i_stream_id&0xff );
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
+ case VLC_CODEC_MPGA:
StreamIdRelease( p_sys->stream_id_mpga, 0xc0,
p_stream->i_stream_id );
break;
- case VLC_FOURCC( 's', 'p', 'u', ' ' ):
+ case VLC_CODEC_SPU:
StreamIdRelease( p_sys->stream_id_spu, 0x20,
p_stream->i_stream_id&0xff );
break;
case VIDEO_ES:
switch( p_input->p_fmt->i_codec )
{
- case VLC_FOURCC( 'm', 'p','g', 'v' ):
+ case VLC_CODEC_MPGV:
/* TODO: do we need to check MPEG-I/II ? */
p_stream->i_stream_type = 0x02;
p_stream->i_stream_id = 0xe0;
break;
- case VLC_FOURCC( 'm', 'p','4', 'v' ):
+ case VLC_CODEC_MP4V:
p_stream->i_stream_type = 0x10;
p_stream->i_stream_id = 0xe0;
p_stream->i_es_id = p_stream->i_pid;
break;
- case VLC_FOURCC( 'h', '2','6', '4' ):
+ case VLC_CODEC_H264:
p_stream->i_stream_type = 0x1b;
p_stream->i_stream_id = 0xe0;
break;
/* XXX dirty dirty but somebody want that:
* using crapy MS-codec XXX */
/* I didn't want to do that :P */
- case VLC_FOURCC( 'H', '2', '6', '3' ):
- case VLC_FOURCC( 'I', '2', '6', '3' ):
- case VLC_FOURCC( 'W', 'M', 'V', '3' ):
- case VLC_FOURCC( 'W', 'M', 'V', '2' ):
- case VLC_FOURCC( 'W', 'M', 'V', '1' ):
- case VLC_FOURCC( 'D', 'I', 'V', '3' ):
- case VLC_FOURCC( 'D', 'I', 'V', '2' ):
- case VLC_FOURCC( 'D', 'I', 'V', '1' ):
- case VLC_FOURCC( 'M', 'J', 'P', 'G' ):
+ case VLC_CODEC_H263I:
+ case VLC_CODEC_H263:
+ case VLC_CODEC_WMV3:
+ case VLC_CODEC_WMV2:
+ case VLC_CODEC_WMV1:
+ case VLC_CODEC_DIV3:
+ case VLC_CODEC_DIV2:
+ case VLC_CODEC_DIV1:
+ case VLC_CODEC_MJPG:
p_stream->i_stream_type = 0xa0; /* private */
p_stream->i_stream_id = 0xa0; /* beurk */
p_stream->i_bih_codec = p_input->p_fmt->i_codec;
p_stream->i_bih_width = p_input->p_fmt->video.i_width;
p_stream->i_bih_height = p_input->p_fmt->video.i_height;
break;
- case VLC_FOURCC( 'd', 'r', 'a', 'c' ):
+ case VLC_CODEC_DIRAC:
/* stream_id makes use of stream_id_extension */
p_stream->i_stream_id = (PES_EXTENDED_STREAM_ID << 8) | 0x60;
p_stream->i_stream_type = 0xd1;
case AUDIO_ES:
switch( p_input->p_fmt->i_codec )
{
- case VLC_FOURCC( 'm', 'p','g', 'a' ):
- case VLC_FOURCC( 'm', 'p', '3', ' ' ):
+ case VLC_CODEC_MPGA:
p_stream->i_stream_type =
p_input->p_fmt->audio.i_rate >= 32000 ? 0x03 : 0x04;
p_stream->i_stream_id = 0xc0;
break;
- case VLC_FOURCC( 'a', '5','2', ' ' ):
+ case VLC_CODEC_A52:
p_stream->i_stream_type = 0x81;
p_stream->i_stream_id = 0xbd;
break;
- case VLC_FOURCC( 'l', 'p','c', 'm' ):
+ case VLC_CODEC_DVD_LPCM:
p_stream->i_stream_type = 0x83;
p_stream->i_stream_id = 0xbd;
break;
- case VLC_FOURCC( 'd', 't','s', ' ' ):
+ case VLC_CODEC_DTS:
p_stream->i_stream_type = 0x06;
p_stream->i_stream_id = 0xbd;
break;
- case VLC_FOURCC( 'm', 'p','4', 'a' ):
+ case VLC_CODEC_MP4A:
/* XXX: make that configurable in some way when LOAS
* is implemented for AAC in TS */
//p_stream->i_stream_type = 0x11; /* LOAS/LATM */
case SPU_ES:
switch( p_input->p_fmt->i_codec )
{
- case VLC_FOURCC( 's', 'p','u', ' ' ):
+ case VLC_CODEC_SPU:
p_stream->i_stream_type = 0x82;
p_stream->i_stream_id = 0xbd;
break;
- case VLC_FOURCC( 's', 'u','b', 't' ):
+ case VLC_CODEC_SUBT:
p_stream->i_stream_type = 0x12;
p_stream->i_stream_id = 0xfa;
p_sys->i_mpeg4_streams++;
p_stream->i_es_id = p_stream->i_pid;
break;
- case VLC_FOURCC('d','v','b','s'):
+ case VLC_CODEC_DVBS:
p_stream->i_stream_type = 0x06;
p_stream->i_es_id = p_input->p_fmt->subs.dvb.i_id;
p_stream->i_stream_id = 0xbd;
break;
- case VLC_FOURCC('t','e','l','x'):
+ case VLC_CODEC_TELETEXT:
p_stream->i_stream_type = 0x06;
p_stream->i_stream_id = 0xbd; /* FIXME */
break;
}
/* Create decoder specific info for subt */
- if( p_stream->i_codec == VLC_FOURCC( 's', 'u','b', 't' ) )
+ if( p_stream->i_codec == VLC_CODEC_SUBT )
{
uint8_t *p;
if( p_stream == p_pcr_stream || p_sys->b_data_alignment
|| p_input->p_fmt->i_codec !=
- VLC_FOURCC('m', 'p', 'g', 'a') )
+ VLC_CODEC_MPGA )
{
p_data = block_FifoGet( p_input->p_fifo );
if( p_input->p_fmt->i_codec ==
- VLC_FOURCC('m', 'p', '4', 'a' ) )
+ VLC_CODEC_MP4A )
p_data = Add_ADTS( p_data, p_input->p_fmt );
}
else
p_data->i_length = p_next->i_dts - p_data->i_dts;
}
else if( p_input->p_fmt->i_codec !=
- VLC_FOURCC('s', 'u', 'b', 't' ) )
+ VLC_CODEC_SUBT )
p_data->i_length = 1000;
if( ( p_pcr_stream->i_pes_dts > 0 &&
if( p_input->p_fmt->i_cat == SPU_ES )
{
if( p_input->p_fmt->i_codec ==
- VLC_FOURCC('s','u','b','t') )
+ VLC_CODEC_SUBT )
{
/* Prepend header */
p_data = block_Realloc( p_data, 2,
}
}
else if( p_input->p_fmt->i_codec ==
- VLC_FOURCC('t','e','l','x') )
+ VLC_CODEC_TELETEXT )
{
/* EN 300 472 */
i_header_size = 0x24;
b_data_alignment = 1;
}
else if( p_input->p_fmt->i_codec ==
- VLC_FOURCC('d','v','b','s') )
+ VLC_CODEC_DVBS )
{
/* EN 300 743 */
b_data_alignment = 1;
}
if( p_input->p_fmt->i_codec ==
- VLC_FOURCC('d','r','a','c') )
+ VLC_CODEC_DIRAC )
{
b_data_alignment = 1;
/* dirac pes packets should be unbounded in
bits_write( &bits, 6, 0x05 ); /* AudioStream */
}
else if( p_stream->i_stream_type == 0x12 &&
- p_stream->i_codec == VLC_FOURCC('s','u','b','t') )
+ p_stream->i_codec == VLC_CODEC_SUBT )
{
bits_write( &bits, 8, 0x0B ); /* Text Stream */
bits_write( &bits, 6, 0x04 ); /* VisualStream */
/* "registration" descriptor : "AC-3" */
dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, format );
}
- else if( p_stream->i_codec == VLC_FOURCC('d','r','a','c') )
+ else if( p_stream->i_codec == VLC_CODEC_DIRAC )
{
/* Dirac registration descriptor */
uint8_t data[4] = { 'd', 'r', 'a', 'c' };
dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, data );
}
- else if( p_stream->i_codec == VLC_FOURCC('d','t','s',' ') )
+ else if( p_stream->i_codec == VLC_CODEC_DTS )
{
/* DTS registration descriptor (ETSI TS 101 154 Annex F) */
uint8_t data[4] = { 0x44, 0x54, 0x53, 0x32 };
dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, data );
}
- else if( p_stream->i_codec == VLC_FOURCC('t','e','l','x') )
+ else if( p_stream->i_codec == VLC_CODEC_TELETEXT )
{
if( p_stream->i_decoder_specific_info )
{
}
continue;
}
- else if( p_stream->i_codec == VLC_FOURCC('d','v','b','s') )
+ else if( p_stream->i_codec == VLC_CODEC_DVBS )
{
/* DVB subtitles */
if( p_stream->i_decoder_specific_info )
}
msg_Dbg( p_mux, "adding input" );
- if( p_input->p_fmt->i_codec != VLC_FOURCC('M','J','P','G') &&
- p_input->p_fmt->i_codec != VLC_FOURCC('m','j','p','g') &&
- p_input->p_fmt->i_codec != VLC_FOURCC('j','p','e','g') &&
- p_input->p_fmt->i_codec != VLC_FOURCC('J','P','E','G') &&
- p_input->p_fmt->i_codec != VLC_FOURCC('J','F','I','F') &&
- p_input->p_fmt->i_codec != VLC_FOURCC('J','P','G','L') &&
- p_input->p_fmt->i_codec != VLC_FOURCC('m','j','p','a') )
- {
+ if( p_input->p_fmt->i_codec != VLC_CODEC_MJPG )
return VLC_EGENERIC;
- }
return VLC_SUCCESS;
}
switch( p_stream->i_fourcc )
{
- case VLC_FOURCC( 'm', 'p', 'g', 'v' ):
- case VLC_FOURCC( 'm', 'p', '4', 'v' ):
- case VLC_FOURCC( 'D', 'I', 'V', '3' ):
- case VLC_FOURCC( 'M', 'J', 'P', 'G' ):
- case VLC_FOURCC( 'W', 'M', 'V', '1' ):
- case VLC_FOURCC( 'W', 'M', 'V', '2' ):
- case VLC_FOURCC( 'W', 'M', 'V', '3' ):
- case VLC_FOURCC( 'S', 'N', 'O', 'W' ):
+ case VLC_CODEC_MP4V:
+ case VLC_CODEC_MPGV:
+ case VLC_CODEC_DIV3:
+ case VLC_CODEC_MJPG:
+ case VLC_CODEC_WMV1:
+ case VLC_CODEC_WMV2:
+ case VLC_CODEC_WMV3:
+ case VLC_CODEC_SNOW:
p_stream->p_oggds_header = calloc( 1, sizeof(oggds_header_t) );
if( !p_stream->p_oggds_header )
{
p_stream->p_oggds_header->i_packet_type = PACKET_TYPE_HEADER;
memcpy( p_stream->p_oggds_header->stream_type, "video", 5 );
- if( p_stream->i_fourcc == VLC_FOURCC( 'm', 'p', '4', 'v' ) )
+ if( p_stream->i_fourcc == VLC_CODEC_MP4V )
{
memcpy( p_stream->p_oggds_header->sub_type, "XVID", 4 );
}
- else if( p_stream->i_fourcc == VLC_FOURCC( 'D', 'I', 'V', '3' ) )
+ else if( p_stream->i_fourcc == VLC_CODEC_DIV3 )
{
memcpy( p_stream->p_oggds_header->sub_type, "DIV3", 4 );
}
msg_Dbg( p_mux, "%4.4s stream", (char *)&p_stream->i_fourcc );
break;
- case VLC_FOURCC( 'd', 'r', 'a', 'c' ):
+ case VLC_CODEC_DIRAC:
msg_Dbg( p_mux, "dirac stream" );
break;
- case VLC_FOURCC( 't', 'h', 'e', 'o' ):
+ case VLC_CODEC_THEORA:
msg_Dbg( p_mux, "theora stream" );
break;
case AUDIO_ES:
switch( p_stream->i_fourcc )
{
- case VLC_FOURCC( 'v', 'o', 'r', 'b' ):
+ case VLC_CODEC_VORBIS:
msg_Dbg( p_mux, "vorbis stream" );
break;
- case VLC_FOURCC( 's', 'p', 'x', ' ' ):
+ case VLC_CODEC_SPEEX:
msg_Dbg( p_mux, "speex stream" );
break;
- case VLC_FOURCC( 'f', 'l', 'a', 'c' ):
+ case VLC_CODEC_FLAC:
msg_Dbg( p_mux, "flac stream" );
break;
case SPU_ES:
switch( p_stream->i_fourcc )
{
- case VLC_FOURCC( 's', 'u','b', 't' ):
+ case VLC_CODEC_SUBT:
p_stream->p_oggds_header = calloc( 1, sizeof(oggds_header_t) );
if( !p_stream->p_oggds_header )
{
ogg_stream_init( &p_stream->os, p_stream->i_serial_no );
p_stream->i_packet_no = 0;
- if( p_stream->i_fourcc == VLC_FOURCC( 'v', 'o', 'r', 'b' ) ||
- p_stream->i_fourcc == VLC_FOURCC( 's', 'p', 'x', ' ' ) ||
- p_stream->i_fourcc == VLC_FOURCC( 't', 'h', 'e', 'o' ) )
+ if( p_stream->i_fourcc == VLC_CODEC_VORBIS ||
+ p_stream->i_fourcc == VLC_CODEC_SPEEX ||
+ p_stream->i_fourcc == VLC_CODEC_THEORA )
{
/* First packet in order: vorbis/speex/theora info */
p_extra = p_input->p_fmt->p_extra;
p_og = OggStreamFlush( p_mux, &p_stream->os, 0 );
/* Get keyframe_granule_shift for theora granulepos calculation */
- if( p_stream->i_fourcc == VLC_FOURCC( 't', 'h', 'e', 'o' ) )
+ if( p_stream->i_fourcc == VLC_CODEC_THEORA )
{
int i_keyframe_frequency_force =
1 << ((op.packet[40] << 6 >> 3) | (op.packet[41] >> 5));
}
}
}
- else if( p_stream->i_fourcc == VLC_FOURCC( 'd', 'r', 'a', 'c' ) )
+ else if( p_stream->i_fourcc == VLC_CODEC_DIRAC )
{
op.packet = p_input->p_fmt->p_extra;
op.bytes = p_input->p_fmt->i_extra;
ogg_stream_packetin( &p_stream->os, &op );
p_og = OggStreamFlush( p_mux, &p_stream->os, 0 );
}
- else if( p_stream->i_fourcc == VLC_FOURCC( 'f', 'l', 'a', 'c' ) )
+ else if( p_stream->i_fourcc == VLC_CODEC_FLAC )
{
/* flac stream marker (yeah, only that in the 1st packet) */
op.packet = (unsigned char *)"fLaC";
sout_input_t *p_input = p_mux->pp_inputs[i];
ogg_stream_t *p_stream = (ogg_stream_t*)p_input->p_sys;
- if( p_stream->i_fourcc == VLC_FOURCC( 'v', 'o', 'r', 'b' ) ||
- p_stream->i_fourcc == VLC_FOURCC( 's', 'p', 'x', ' ' ) ||
- p_stream->i_fourcc == VLC_FOURCC( 't', 'h', 'e', 'o' ) )
+ if( p_stream->i_fourcc == VLC_CODEC_VORBIS ||
+ p_stream->i_fourcc == VLC_CODEC_SPEEX ||
+ p_stream->i_fourcc == VLC_CODEC_THEORA )
{
/* Special case, headers are already there in the incoming stream.
* We need to gather them an mark them as headers. */
int j = 2;
- if( p_stream->i_fourcc == VLC_FOURCC( 's', 'p', 'x', ' ' ) ) j = 1;
+ if( p_stream->i_fourcc == VLC_CODEC_SPEEX ) j = 1;
p_extra = p_input->p_fmt->p_extra;
i_extra = p_input->p_fmt->i_extra;
block_ChainAppend( &p_hdr, p_og );
}
}
- else if( p_stream->i_fourcc != VLC_FOURCC( 'f', 'l', 'a', 'c' ) &&
- p_stream->i_fourcc != VLC_FOURCC( 'd', 'r', 'a', 'c' ) )
+ else if( p_stream->i_fourcc != VLC_CODEC_FLAC &&
+ p_stream->i_fourcc != VLC_CODEC_DIRAC )
{
uint8_t com[128];
int i_com;
}
/* Special case for mp4v and flac */
- if( ( p_stream->i_fourcc == VLC_FOURCC( 'm', 'p', '4', 'v' ) ||
- p_stream->i_fourcc == VLC_FOURCC( 'f', 'l', 'a', 'c' ) ) &&
+ if( ( p_stream->i_fourcc == VLC_CODEC_MP4V ||
+ p_stream->i_fourcc == VLC_CODEC_FLAC ) &&
p_input->p_fmt->i_extra )
{
/* Send a packet with the VOL data for mp4v
msg_Dbg( p_mux, "writing extra data" );
op.bytes = p_input->p_fmt->i_extra;
op.packet = p_input->p_fmt->p_extra;
- if( p_stream->i_fourcc == VLC_FOURCC( 'f', 'l', 'a', 'c' ) )
+ if( p_stream->i_fourcc == VLC_CODEC_FLAC )
{
/* Skip the flac stream marker */
op.bytes -= 4;
block_t *p_og = NULL;
ogg_packet op;
- if( p_stream->i_fourcc != VLC_FOURCC( 'v', 'o', 'r', 'b' ) &&
- p_stream->i_fourcc != VLC_FOURCC( 'f', 'l', 'a', 'c' ) &&
- p_stream->i_fourcc != VLC_FOURCC( 's', 'p', 'x', ' ' ) &&
- p_stream->i_fourcc != VLC_FOURCC( 't', 'h', 'e', 'o' ) &&
- p_stream->i_fourcc != VLC_FOURCC( 'd', 'r', 'a', 'c' ) )
+ if( p_stream->i_fourcc != VLC_CODEC_VORBIS &&
+ p_stream->i_fourcc != VLC_CODEC_FLAC &&
+ p_stream->i_fourcc != VLC_CODEC_SPEEX &&
+ p_stream->i_fourcc != VLC_CODEC_THEORA &&
+ p_stream->i_fourcc != VLC_CODEC_DIRAC )
{
p_data = block_Realloc( p_data, 1, p_data->i_buffer );
p_data->p_buffer[0] = PACKET_IS_SYNCPOINT; // FIXME
if( p_stream->i_cat == AUDIO_ES )
{
- if( p_stream->i_fourcc == VLC_FOURCC( 'v', 'o', 'r', 'b' ) ||
- p_stream->i_fourcc == VLC_FOURCC( 'f', 'l', 'a', 'c' ) ||
- p_stream->i_fourcc == VLC_FOURCC( 's', 'p', 'x', ' ' ) )
+ if( p_stream->i_fourcc == VLC_CODEC_VORBIS ||
+ p_stream->i_fourcc == VLC_CODEC_FLAC ||
+ p_stream->i_fourcc == VLC_CODEC_SPEEX )
{
/* number of sample from begining + current packet */
op.granulepos =
}
else if( p_stream->i_cat == VIDEO_ES )
{
- if( p_stream->i_fourcc == VLC_FOURCC( 't', 'h', 'e', 'o' ) )
+ if( p_stream->i_fourcc == VLC_CODEC_THEORA )
{
/* FIXME, we assume only keyframes */
op.granulepos = ( ( p_data->i_dts - p_sys->i_start_dts ) *
p_input->p_fmt->video.i_frame_rate_base /
INT64_C(1000000) ) << p_stream->i_keyframe_granule_shift;
}
- else if( p_stream->i_fourcc == VLC_FOURCC( 'd', 'r', 'a', 'c' ) )
+ else if( p_stream->i_fourcc == VLC_CODEC_DIRAC )
{
mtime_t dt = (p_data->i_dts - p_sys->i_start_dts + 1)
* p_input->p_fmt->video.i_frame_rate *2
ogg_stream_packetin( &p_stream->os, &op );
if( p_stream->i_cat == SPU_ES ||
- p_stream->i_fourcc == VLC_FOURCC( 's', 'p', 'x', ' ' ) ||
- p_stream->i_fourcc == VLC_FOURCC( 'd', 'r', 'a', 'c' ) )
+ p_stream->i_fourcc == VLC_CODEC_SPEEX ||
+ p_stream->i_fourcc == VLC_CODEC_DIRAC )
{
/* Subtitles or Speex packets are quite small so they
* need to be flushed to be sent on time */
p_sys->i_channel_mask, (int)p_sys->b_chan_reorder );
}
- i_format = p_input->p_fmt->i_codec == VLC_FOURCC('f', 'l', '3', '2') ?
+ i_format = p_input->p_fmt->i_codec == VLC_CODEC_FL32 ?
WAVE_FORMAT_IEEE_FLOAT : WAVE_FORMAT_PCM;
b_ext = p_sys->b_ext = p_input->p_fmt->audio.i_channels > 2;
/* Create the output format */
es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
- /* Fix the value of the fourcc */
- switch( p_dec->fmt_in.i_codec )
+ /* Fix the value of the fourcc for audio */
+ if( p_dec->fmt_in.i_cat == AUDIO_ES )
{
- /* video */
- case VLC_FOURCC( 'm', '4', 's', '2'):
- case VLC_FOURCC( 'M', '4', 'S', '2'):
- case VLC_FOURCC( 'm', 'p', '4', 's'):
- case VLC_FOURCC( 'M', 'P', '4', 'S'):
- case VLC_FOURCC( 'D', 'I', 'V', 'X'):
- case VLC_FOURCC( 'd', 'i', 'v', 'x'):
- case VLC_FOURCC( 'X', 'V', 'I', 'D'):
- case VLC_FOURCC( 'X', 'v', 'i', 'D'):
- case VLC_FOURCC( 'x', 'v', 'i', 'd'):
- case VLC_FOURCC( 'D', 'X', '5', '0'):
- case VLC_FOURCC( 0x04, 0, 0, 0):
- case VLC_FOURCC( '3', 'I', 'V', '2'):
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v');
- break;
-
- case VLC_FOURCC( 'm', 'p', 'g', '1' ):
- case VLC_FOURCC( 'm', 'p', 'g', '2' ):
- case VLC_FOURCC( 'm', 'p', '1', 'v' ):
- case VLC_FOURCC( 'm', 'p', '2', 'v' ):
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'v' );
- break;
-
- case VLC_FOURCC( 'd', 'i', 'v', '1' ):
- case VLC_FOURCC( 'M', 'P', 'G', '4' ):
- case VLC_FOURCC( 'm', 'p', 'g', '4' ):
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'D', 'I', 'V', '1' );
- break;
-
- case VLC_FOURCC( 'd', 'i', 'v', '2' ):
- case VLC_FOURCC( 'M', 'P', '4', '2' ):
- case VLC_FOURCC( 'm', 'p', '4', '2' ):
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'D', 'I', 'V', '2' );
- break;
-
- case VLC_FOURCC( 'd', 'i', 'v', '3' ):
- case VLC_FOURCC( 'd', 'i', 'v', '4' ):
- case VLC_FOURCC( 'D', 'I', 'V', '4' ):
- case VLC_FOURCC( 'd', 'i', 'v', '5' ):
- case VLC_FOURCC( 'D', 'I', 'V', '5' ):
- case VLC_FOURCC( 'd', 'i', 'v', '6' ):
- case VLC_FOURCC( 'D', 'I', 'V', '6' ):
- case VLC_FOURCC( 'M', 'P', '4', '3' ):
- case VLC_FOURCC( 'm', 'p', '4', '3' ):
- case VLC_FOURCC( 'm', 'p', 'g', '3' ):
- case VLC_FOURCC( 'M', 'P', 'G', '3' ):
- case VLC_FOURCC( 'A', 'P', '4', '1' ):
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'D', 'I', 'V', '3' );
- break;
-
- case VLC_FOURCC( 'h', '2', '6', '3' ):
- case VLC_FOURCC( 'U', '2', '6', '3' ):
- case VLC_FOURCC( 'u', '2', '6', '3' ):
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'H', '2', '6', '3' );
- break;
-
- case VLC_FOURCC( 'i', '2', '6', '3' ):
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'I', '2', '6', '3' );
- break;
-
- case VLC_FOURCC( 'm', 'j', 'p', 'g' ):
- case VLC_FOURCC( 'm', 'j', 'p', 'a' ):
- case VLC_FOURCC( 'j', 'p', 'e', 'g' ):
- case VLC_FOURCC( 'J', 'P', 'E', 'G' ):
- case VLC_FOURCC( 'J', 'F', 'I', 'F' ):
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'M', 'J', 'P', 'G' );
- break;
-
- case VLC_FOURCC( 'd', 'v', 's', 'd' ):
- case VLC_FOURCC( 'D', 'V', 'S', 'D' ):
- case VLC_FOURCC( 'd', 'v', 'h', 'd' ):
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'd', 'v', 's', 'l' );
- break;
-
- /* audio */
- case VLC_FOURCC( 'a', 'r', 'a', 'w' ):
- switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
- {
- case 1:
- p_dec->fmt_out.i_codec = VLC_FOURCC('u','8',' ',' ');
- break;
- case 2:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','l');
- break;
- case 3:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','l');
- break;
- case 4:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','3','2','l');
- break;
- default:
- msg_Err( p_dec, "unknown raw audio sample size" );
- return VLC_EGENERIC;
- }
- break;
-
- case VLC_FOURCC( 't', 'w', 'o', 's' ):
- switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
- {
- case 1:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','8',' ',' ');
- break;
- case 2:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','b');
- break;
- case 3:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','b');
- break;
- case 4:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','3','2','b');
- break;
- default:
- msg_Err( p_dec, "unknown raw audio sample size" );
- return VLC_EGENERIC;
- }
- break;
-
- case VLC_FOURCC( 's', 'o', 'w', 't' ):
- switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
- {
- case 1:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','8',' ',' ');
- break;
- case 2:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','l');
- break;
- case 3:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','l');
- break;
- case 4:
- p_dec->fmt_out.i_codec = VLC_FOURCC('s','3','2','l');
- break;
- default:
- msg_Err( p_dec, "unknown raw audio sample size" );
- return VLC_EGENERIC;
- }
- break;
+ p_dec->fmt_out.i_codec = vlc_fourcc_GetCodecAudio( p_dec->fmt_in.i_codec,
+ p_dec->fmt_in.audio.i_bitspersample );
+ if( !p_dec->fmt_out.i_codec )
+ {
+ msg_Err( p_dec, "unknown raw audio sample size" );
+ return VLC_EGENERIC;
+ }
}
- p_dec->p_sys = p_sys = malloc( sizeof( block_t ) );
+ p_dec->p_sys = p_sys = malloc( sizeof(*p_sys) );
p_sys->p_block = NULL;
return VLC_SUCCESS;
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'd','r','a','c' ) )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_DIRAC )
return VLC_EGENERIC;
p_dec->pf_packetize = Packetize;
decoder_sys_t *p_sys;
int i;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'h', '2', '6', '4') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC( 'H', '2', '6', '4') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC( 'V', 'S', 'S', 'H') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC( 'v', 's', 's', 'h') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC( 'D', 'A', 'V', 'C') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC( 'x', '2', '6', '4') &&
- p_dec->fmt_in.i_codec != VLC_FOURCC( 'X', '2', '6', '4') &&
- ( p_dec->fmt_in.i_codec != VLC_FOURCC( 'a', 'v', 'c', '1') ||
- p_dec->fmt_in.i_extra < 7 ) )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_H264 )
+ return VLC_EGENERIC;
+ if( p_dec->fmt_in.i_original_fourcc == VLC_FOURCC( 'a', 'v', 'c', '1') &&
+ p_dec->fmt_in.i_extra < 7 )
return VLC_EGENERIC;
- }
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys = malloc( sizeof(decoder_sys_t) ) ) == NULL )
/* Setup properties */
es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'h', '2', '6', '4' );
+ p_dec->fmt_out.i_codec = VLC_CODEC_H264;
- if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'v', 'c', '1' ) )
+ if( p_dec->fmt_in.i_original_fourcc == VLC_FOURCC( 'a', 'v', 'c', '1' ) )
{
/* This type of stream is produced by mp4 and matroska
* when we want to store it in another streamformat, you need to convert
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('m','l','p',' ') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_MLP )
return VLC_EGENERIC;
/* */
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('m','l','p',' ');
+ p_dec->fmt_out.i_codec = VLC_CODEC_MLP;
p_dec->fmt_out.audio.i_rate = 0;
/* Set callback */
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'm', 'p', '4', 'a' ) )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_MP4A )
{
return VLC_EGENERIC;
}
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('m','p','4','a');
+ p_dec->fmt_out.i_codec = VLC_CODEC_MP4A;
msg_Dbg( p_dec, "running MPEG4 audio packetizer" );
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- switch( p_dec->fmt_in.i_codec )
- {
- case VLC_FOURCC( 'm', '4', 's', '2'):
- case VLC_FOURCC( 'M', '4', 'S', '2'):
- case VLC_FOURCC( 'm', 'p', '4', 's'):
- case VLC_FOURCC( 'M', 'P', '4', 'S'):
- case VLC_FOURCC( 'm', 'p', '4', 'v'):
- case VLC_FOURCC( 'M', 'P', '4', 'V'):
- case VLC_FOURCC( 'D', 'I', 'V', 'X'):
- case VLC_FOURCC( 'd', 'i', 'v', 'x'):
- case VLC_FOURCC( 'X', 'V', 'I', 'D'):
- case VLC_FOURCC( 'X', 'v', 'i', 'D'):
- case VLC_FOURCC( 'x', 'v', 'i', 'd'):
- case VLC_FOURCC( 'D', 'X', '5', '0'):
- case VLC_FOURCC( 'd', 'x', '5', '0'):
- case VLC_FOURCC( 0x04, 0, 0, 0):
- case VLC_FOURCC( '3', 'I', 'V', '2'):
- case VLC_FOURCC( 'm', '4', 'c', 'c'):
- case VLC_FOURCC( 'M', '4', 'C', 'C'):
- break;
-
- default:
- return VLC_EGENERIC;
- }
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_MP4V )
+ return VLC_EGENERIC;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys = malloc( sizeof(decoder_sys_t) ) ) == NULL )
/* Setup properties */
es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
- p_dec->fmt_out.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' );
+ p_dec->fmt_out.i_codec = VLC_CODEC_MP4V;
if( p_dec->fmt_in.i_extra )
{
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'm', 'p', 'g', '1' ) &&
- p_dec->fmt_in.i_codec != VLC_FOURCC( 'm', 'p', 'g', '2' ) &&
- p_dec->fmt_in.i_codec != VLC_FOURCC( 'm', 'p', 'g', 'v' ) )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV )
return VLC_EGENERIC;
- }
- es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC('m','p','g','v') );
+ es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_MPGV );
+ p_dec->fmt_out.i_original_fourcc = p_dec->fmt_in.i_original_fourcc;
+
p_dec->pf_packetize = Packetize;
p_dec->pf_get_cc = GetCc;
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'W', 'V', 'C', '1' ) )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_VC1 )
return VLC_EGENERIC;
p_dec->pf_packetize = Packetize;
filter_chain_t *p_vf2;
};
-#define PICTURE_RING_SIZE 4
struct decoder_owner_sys_t
{
- picture_t *pp_pics[PICTURE_RING_SIZE];
-
/* Current format in use by the output */
video_format_t video;
};
-typedef void (* pf_release_t)( picture_t * );
-static void ReleasePicture( picture_t *p_pic )
-{
- assert( p_pic );
-
-
- if( p_pic->p_sys )
- {
- pf_release_t pf_release = (pf_release_t)p_pic->p_sys;
- p_pic->p_sys = NULL;
- pf_release( p_pic );
- }
- else
- {
- if( --p_pic->i_refcount == 0 )
- {
- free( p_pic->p_q );
- free( p_pic->p_data_orig );
- free( p_pic );
- }
- }
-}
-
/*****************************************************************************
* Local prototypes
*****************************************************************************/
inline static void video_del_buffer_decoder( decoder_t *, picture_t * );
inline static void video_del_buffer_filter( filter_t *, picture_t * );
-static void video_del_buffer( picture_t * );
inline static picture_t *video_new_buffer_decoder( decoder_t * );
inline static picture_t *video_new_buffer_filter( filter_t * );
static picture_t *video_new_buffer( vlc_object_t *, decoder_owner_sys_t *,
- es_format_t *, void (*)( picture_t * ) );
+ es_format_t * );
static void video_link_picture_decoder( decoder_t *, picture_t * );
static void video_unlink_picture_decoder( decoder_t *, picture_t * );
return NULL;
}
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- p_sys->p_decoder->p_owner->pp_pics[i] = NULL;
p_sys->p_decoder->p_owner->video = p_fmt->video;
//p_sys->p_decoder->p_cfg = p_sys->p_video_cfg;
vlc_object_detach( p_sys->p_decoder );
vlc_object_release( p_sys->p_decoder );
- picture_t **pp_ring = p_owner->pp_pics;
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- if ( pp_ring[i] != NULL )
- {
- free( pp_ring[i]->p_data_orig );
- free( pp_ring[i]->p_sys );
- free( pp_ring[i] );
- }
- }
free( p_owner );
}
while ( p_es->p_picture )
{
picture_t *p_next = p_es->p_picture->p_next;
- p_es->p_picture->pf_release( p_es->p_picture );
+ picture_Release( p_es->p_picture );
p_es->p_picture = p_next;
}
if( p_sys->i_chroma )
fmt_out.i_chroma = p_sys->i_chroma;
else
- fmt_out.i_chroma = VLC_FOURCC('I','4','2','0');
+ fmt_out.i_chroma = VLC_CODEC_I420;
if ( !p_sys->i_height )
{
p_new_pic = image_Convert( p_sys->p_image,
p_pic, &fmt_in, &fmt_out );
- if ( p_new_pic == NULL )
+ if( p_new_pic == NULL )
{
msg_Err( p_stream, "image conversion failed" );
picture_Release( p_pic );
{
/* TODO: chroma conversion if needed */
- p_new_pic = (picture_t*)malloc( sizeof(picture_t) );
- if( p_new_pic == NULL )
- {
- msg_Err( p_stream, "image conversion failed" );
- continue;
- }
-
- if( vout_AllocatePicture(
- p_stream, p_new_pic, p_pic->format.i_chroma,
- p_pic->format.i_width, p_pic->format.i_height,
- p_sys->p_decoder->fmt_out.video.i_aspect )
- != VLC_SUCCESS )
+ p_new_pic = picture_New( p_pic->format.i_chroma,
+ p_pic->format.i_width, p_pic->format.i_height,
+ p_sys->p_decoder->fmt_out.video.i_aspect );
+ if( !p_new_pic )
{
picture_Release( p_pic );
- free( p_new_pic );
msg_Err( p_stream, "image allocation failed" );
continue;
}
picture_Copy( p_new_pic, p_pic );
}
-
- p_new_pic->i_refcount = 1;
- p_new_pic->i_status = DESTROYED_PICTURE;
- p_new_pic->i_type = DIRECT_PICTURE;
- p_new_pic->p_sys = (picture_sys_t *)p_new_pic->pf_release;
- p_new_pic->pf_release = ReleasePicture;
- p_new_pic->date = p_pic->date;
picture_Release( p_pic );
if( p_sys->p_vf2 )
return VLC_SUCCESS;
}
-struct picture_sys_t
-{
- vlc_object_t *p_owner;
- bool b_dead;
-};
-
-static void video_release_buffer_decoder( picture_t *p_pic )
-{
- assert( p_pic && p_pic->p_sys );
-
- if( --p_pic->i_refcount > 0 )
- return;
-
- video_del_buffer_decoder( (decoder_t *)p_pic->p_sys->p_owner, p_pic );
-}
-
-static void video_release_buffer_filter( picture_t *p_pic )
-{
- assert( p_pic );
-
- if( --p_pic->i_refcount > 0 )
- return;
-
- assert( p_pic->p_sys );
-
- video_del_buffer_filter( (filter_t *)p_pic->p_sys->p_owner, p_pic );
-}
-
inline static picture_t *video_new_buffer_decoder( decoder_t *p_dec )
{
return video_new_buffer( VLC_OBJECT( p_dec ),
(decoder_owner_sys_t *)p_dec->p_owner,
- &p_dec->fmt_out,
- video_release_buffer_decoder );
+ &p_dec->fmt_out );
}
inline static picture_t *video_new_buffer_filter( filter_t *p_filter )
{
return video_new_buffer( VLC_OBJECT( p_filter ),
(decoder_owner_sys_t *)p_filter->p_owner,
- &p_filter->fmt_out,
- video_release_buffer_filter );
+ &p_filter->fmt_out );
}
static picture_t *video_new_buffer( vlc_object_t *p_this,
decoder_owner_sys_t *p_sys,
- es_format_t *fmt_out,
- void ( *pf_release )( picture_t * ) )
+ es_format_t *fmt_out )
{
- picture_t **pp_ring = p_sys->pp_pics;
- picture_t *p_pic;
- int i;
-
if( fmt_out->video.i_width != p_sys->video.i_width ||
fmt_out->video.i_height != p_sys->video.i_height ||
fmt_out->video.i_chroma != p_sys->video.i_chroma ||
fmt_out->video.i_chroma = fmt_out->i_codec;
p_sys->video = fmt_out->video;
-
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- if ( pp_ring[i] != NULL )
- {
- if ( pp_ring[i]->i_status == DESTROYED_PICTURE )
- {
- free( pp_ring[i]->p_data_orig );
- free( pp_ring[i]->p_sys );
- free( pp_ring[i] );
- }
- else
- {
- pp_ring[i]->p_sys->b_dead = true;
- }
- pp_ring[i] = NULL;
- }
- }
}
- /* Find an empty space in the picture ring buffer */
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- if( pp_ring[i] != NULL && pp_ring[i]->i_status == DESTROYED_PICTURE )
- {
- pp_ring[i]->i_status = RESERVED_PICTURE;
- pp_ring[i]->i_refcount = 1;
- return pp_ring[i];
- }
- }
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- if( pp_ring[i] == NULL ) break;
- }
-
- if( i == PICTURE_RING_SIZE )
- {
- msg_Err( p_this, "decoder/filter is leaking pictures, "
- "resetting its ring buffer" );
-
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- pp_ring[i]->p_sys->b_dead = true;
- pp_ring[i]->pf_release( pp_ring[i] );
- pp_ring[i] = NULL;
- }
-
- i = 0;
- }
-
- p_pic = malloc( sizeof(picture_t) );
- if( !p_pic ) return NULL;
+ /* */
fmt_out->video.i_chroma = fmt_out->i_codec;
- if( vout_AllocatePicture( p_this, p_pic,
- fmt_out->video.i_chroma,
- fmt_out->video.i_width,
- fmt_out->video.i_height,
- fmt_out->video.i_aspect ) != VLC_SUCCESS )
- {
- free( p_pic );
- return NULL;
- }
-
- if( !p_pic->i_planes )
- {
- free( p_pic );
- return NULL;
- }
-
- p_pic->pf_release = pf_release;
- p_pic->i_refcount = 1;
- p_pic->p_sys = malloc( sizeof(picture_sys_t) );
- p_pic->p_sys->p_owner = p_this;
- p_pic->p_sys->b_dead = false;
- p_pic->i_status = RESERVED_PICTURE;
- pp_ring[i] = p_pic;
-
- return p_pic;
+ return picture_New( fmt_out->video.i_chroma,
+ fmt_out->video.i_width,
+ fmt_out->video.i_height,
+ fmt_out->video.i_aspect );
}
inline static void video_del_buffer_decoder( decoder_t *p_this,
picture_t *p_pic )
{
VLC_UNUSED(p_this);
- video_del_buffer( p_pic );
+ picture_Release( p_pic );
}
inline static void video_del_buffer_filter( filter_t *p_this,
picture_t *p_pic )
{
VLC_UNUSED(p_this);
- video_del_buffer( p_pic );
-}
-
-static void video_del_buffer( picture_t *p_pic )
-{
- p_pic->i_refcount = 0;
- p_pic->i_status = DESTROYED_PICTURE;
- if ( p_pic->p_sys->b_dead )
- {
- free( p_pic->p_data_orig );
- free( p_pic->p_sys );
- free( p_pic );
- }
+ picture_Release( p_pic );
}
static void video_link_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
{
VLC_UNUSED(p_dec);
- p_pic->i_refcount++;
+ picture_Hold( p_pic );
}
static void video_unlink_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
{
VLC_UNUSED(p_dec);
- video_release_buffer_decoder( p_pic );
+ picture_Release( p_pic );
}
switch ( id->fmt.i_cat )
{
case AUDIO_ES:
- if ( id->fmt.i_codec == VLC_FOURCC('a', 'l', 'a', 'c') )
+ if ( id->fmt.i_codec == VLC_CODEC_ALAC )
{
if ( p_sys->p_audio_stream )
{
* Do not do non native and non standard association !
* Muxer will be probe if no entry found */
static const muxer_properties_t p_muxers[] = {
- M( "raw", "mp3", 1, VLC_FOURCC('m','p','g','a') ),
- M( "raw", "a52", 1, VLC_FOURCC('a','5','2',' ') ),
- M( "raw", "dts", 1, VLC_FOURCC('d','t','s',' ') ),
- M( "raw", "mpc", 1, VLC_FOURCC('m','p','c',' ') ),
- M( "raw", "ape", 1, VLC_FOURCC('A','P','E',' ') ),
-
- M( "wav", "wav", 1, VLC_FOURCC('a','r','a','w'), VLC_FOURCC('u','8',' ',' '), VLC_FOURCC('s','1','6','l'),
- VLC_FOURCC('s','2','4','l'), VLC_FOURCC('s','3','2','l'), VLC_FOURCC('f','l','3','2') ),
-
- //M( "ffmpeg{mux=flac}", "flac", 1, VLC_FOURCC('f','l','a','c') ), BROKEN
-
- M( "ogg", "ogg", INT_MAX, VLC_FOURCC('v','o','r','b'), VLC_FOURCC('s','p','x',' '), VLC_FOURCC('f','l','a','c'),
- VLC_FOURCC('s','u','b','t'), VLC_FOURCC('t','h','e','o'), VLC_FOURCC('d','r','a','c') ),
-
- M( "asf", "asf", 127, VLC_FOURCC('w','m','a','1'), VLC_FOURCC('w','m','a','2'), VLC_FOURCC('w','m','a',' '),
- VLC_FOURCC('w','m','a','p'), VLC_FOURCC('w','m','a','l'),
- VLC_FOURCC('W','M','V','1'), VLC_FOURCC('W','M','V','2'), VLC_FOURCC('W','M','V','3'),
- VLC_FOURCC('W','V','C','1')),
-
- M( "mp4", "mp4", INT_MAX, VLC_FOURCC('m','p','4','a'), VLC_FOURCC('h','2','6','4'), VLC_FOURCC('m','p','4','v'),
- VLC_FOURCC('s','u','b','t') ),
-
- M( "ps", "mpg", 16/* FIXME*/,VLC_FOURCC('m','p','g','v'), VLC_FOURCC('m','p','1','v'), VLC_FOURCC('m','p','2','v'),
- VLC_FOURCC('m','p','g','a'), VLC_FOURCC('l','p','c','m'), VLC_FOURCC('a','5','2',' '),
- VLC_FOURCC('d','t','s',' '),
- VLC_FOURCC('s','p','u',' ') ),
-
- M( "ts", "ts", 8000, VLC_FOURCC('m','p','g','v'), VLC_FOURCC('m','p','1','v'), VLC_FOURCC('m','p','2','v'),
- VLC_FOURCC('h','2','6','4'),
- VLC_FOURCC('m','p','g','a'), VLC_FOURCC('l','p','c','m'), VLC_FOURCC('a','5','2',' '),
- VLC_FOURCC('d','t','s',' '), VLC_FOURCC('m','p','4','a'),
- VLC_FOURCC('d','v','b','s'), VLC_FOURCC('t','e','l','x') ),
+ M( "raw", "mp3", 1, VLC_CODEC_MPGA ),
+ M( "raw", "a52", 1, VLC_CODEC_A52 ),
+ M( "raw", "dts", 1, VLC_CODEC_DTS ),
+ M( "raw", "mpc", 1, VLC_CODEC_MUSEPACK7, VLC_CODEC_MUSEPACK8 ),
+ M( "raw", "ape", 1, VLC_CODEC_APE ),
+
+ M( "wav", "wav", 1, VLC_CODEC_U8, VLC_CODEC_S16L,
+ VLC_CODEC_S24L, VLC_CODEC_S32L, VLC_CODEC_FL32 ),
+
+ //M( "ffmpeg{mux=flac}", "flac", 1, VLC_CODEC_FLAC ), BROKEN
+
+ M( "ogg", "ogg", INT_MAX, VLC_CODEC_VORBIS, VLC_CODEC_SPEEX, VLC_CODEC_FLAC,
+ VLC_CODEC_SUBT, VLC_CODEC_THEORA, VLC_CODEC_DIRAC ),
+
+ M( "asf", "asf", 127, VLC_CODEC_WMA1, VLC_CODEC_WMA2, VLC_CODEC_WMAP, VLC_CODEC_WMAL, VLC_CODEC_WMAS,
+ VLC_CODEC_WMV1, VLC_CODEC_WMV2, VLC_CODEC_WMV3, VLC_CODEC_VC1 ),
+
+ M( "mp4", "mp4", INT_MAX, VLC_CODEC_MP4A, VLC_CODEC_H264, VLC_CODEC_MP4V,
+ VLC_CODEC_SUBT ),
+
+ M( "ps", "mpg", 16/* FIXME*/,VLC_CODEC_MPGV,
+ VLC_CODEC_MPGA, VLC_CODEC_DVD_LPCM, VLC_CODEC_A52,
+ VLC_CODEC_DTS,
+ VLC_CODEC_SPU ),
+
+ M( "ts", "ts", 8000, VLC_CODEC_MPGV,
+ VLC_CODEC_H264,
+ VLC_CODEC_MPGA, VLC_CODEC_DVD_LPCM, VLC_CODEC_A52,
+ VLC_CODEC_DTS, VLC_CODEC_MP4A,
+ VLC_CODEC_DVBS, VLC_CODEC_TELETEXT ),
M( NULL, NULL, 0, 0 )
};
else
switch( p_fmt->i_codec )
{
- case VLC_FOURCC( 'u', 'l', 'a', 'w' ):
+ case VLC_CODEC_MULAW:
if( p_fmt->audio.i_channels == 1 && p_fmt->audio.i_rate == 8000 )
id->i_payload_type = 0;
id->psz_enc = "PCMU";
id->pf_packetize = rtp_packetize_split;
rtp_set_ptime (id, 20, 1);
break;
- case VLC_FOURCC( 'a', 'l', 'a', 'w' ):
+ case VLC_CODEC_ALAW:
if( p_fmt->audio.i_channels == 1 && p_fmt->audio.i_rate == 8000 )
id->i_payload_type = 8;
id->psz_enc = "PCMA";
id->pf_packetize = rtp_packetize_split;
rtp_set_ptime (id, 20, 1);
break;
- case VLC_FOURCC( 's', '1', '6', 'b' ):
+ case VLC_CODEC_S16B:
if( p_fmt->audio.i_channels == 1 && p_fmt->audio.i_rate == 44100 )
{
id->i_payload_type = 11;
id->pf_packetize = rtp_packetize_split;
rtp_set_ptime (id, 20, 2);
break;
- case VLC_FOURCC( 'u', '8', ' ', ' ' ):
+ case VLC_CODEC_U8:
id->psz_enc = "L8";
id->pf_packetize = rtp_packetize_split;
rtp_set_ptime (id, 20, 1);
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
- case VLC_FOURCC( 'm', 'p', '3', ' ' ):
+ case VLC_CODEC_MPGA:
id->i_payload_type = 14;
id->psz_enc = "MPA";
id->i_clock_rate = 90000; /* not 44100 */
id->pf_packetize = rtp_packetize_mpa;
break;
- case VLC_FOURCC( 'm', 'p', 'g', 'v' ):
+ case VLC_CODEC_MPGV:
id->i_payload_type = 32;
id->psz_enc = "MPV";
id->pf_packetize = rtp_packetize_mpv;
break;
- case VLC_FOURCC( 'G', '7', '2', '6' ):
- case VLC_FOURCC( 'g', '7', '2', '6' ):
+ case VLC_CODEC_ADPCM_G726:
switch( p_fmt->i_bitrate / 1000 )
{
case 16:
break;
}
break;
- case VLC_FOURCC( 'a', '5', '2', ' ' ):
+ case VLC_CODEC_A52:
id->psz_enc = "ac3";
id->pf_packetize = rtp_packetize_ac3;
break;
- case VLC_FOURCC( 'H', '2', '6', '3' ):
+ case VLC_CODEC_H263:
id->psz_enc = "H263-1998";
id->pf_packetize = rtp_packetize_h263;
break;
- case VLC_FOURCC( 'h', '2', '6', '4' ):
+ case VLC_CODEC_H264:
id->psz_enc = "H264";
id->pf_packetize = rtp_packetize_h264;
id->psz_fmtp = NULL;
id->psz_fmtp = strdup( "packetization-mode=1" );
break;
- case VLC_FOURCC( 'm', 'p', '4', 'v' ):
+ case VLC_CODEC_MP4V:
{
char hexa[2*p_fmt->i_extra +1];
}
break;
}
- case VLC_FOURCC( 'm', 'p', '4', 'a' ):
+ case VLC_CODEC_MP4A:
{
if(!p_sys->b_latm)
{
}
break;
}
- case VLC_FOURCC( 's', 'a', 'm', 'r' ):
+ case VLC_CODEC_AMR_NB:
id->psz_enc = "AMR";
id->psz_fmtp = strdup( "octet-align=1" );
id->pf_packetize = rtp_packetize_amr;
break;
- case VLC_FOURCC( 's', 'a', 'w', 'b' ):
+ case VLC_CODEC_AMR_WB:
id->psz_enc = "AMR-WB";
id->psz_fmtp = strdup( "octet-align=1" );
id->pf_packetize = rtp_packetize_amr;
break;
- case VLC_FOURCC( 's', 'p', 'x', ' ' ):
+ case VLC_CODEC_SPEEX:
id->psz_enc = "SPEEX";
id->pf_packetize = rtp_packetize_spx;
break;
- case VLC_FOURCC( 't', '1', '4', '0' ):
+ case VLC_CODEC_ITU_T140:
id->psz_enc = "t140" ;
id->i_clock_rate = 1000;
id->pf_packetize = rtp_packetize_t140;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_sout.h>
-#include <vlc_vout.h>
#include <vlc_avcodec.h>
#include <vlc_block.h>
return NULL;
if( p_fmt->i_cat == VIDEO_ES &&
- ( p_fmt->i_codec == VLC_FOURCC('m', 'p', 'g', 'v') ||
+ ( p_fmt->i_codec == VLC_CODEC_MPGV ||
p_fmt->i_codec == VLC_FOURCC('f', 'a', 'k', 'e') ) )
{
id->b_switcher_video = true;
- p_fmt->i_codec = VLC_FOURCC('m', 'p', 'g', 'v');
+ p_fmt->i_codec = VLC_CODEC_MPGV;
msg_Dbg( p_stream, "creating video switcher for fcc=`%4.4s' cmd:%d",
(char*)&p_fmt->i_codec, p_sys->i_cmd );
}
else if ( p_fmt->i_cat == AUDIO_ES &&
- p_fmt->i_codec == VLC_FOURCC('m', 'p', 'g', 'a') &&
+ p_fmt->i_codec == VLC_CODEC_MPGA &&
p_sys->b_audio )
{
int i_ff_codec = CODEC_ID_MP2;
return -1;
}
- vout_InitPicture( VLC_OBJECT(p_stream), p_pic, VLC_FOURCC('I','4','2','0'),
- i_width, i_height,
- i_width * VOUT_ASPECT_FACTOR / i_height );
+ if( picture_Setup( p_pic, VLC_CODEC_I420,
+ i_width, i_height,
+ i_width * VOUT_ASPECT_FACTOR / i_height ) )
+ {
+ msg_Err( p_stream, "unknown chroma" );
+ return -1;
+ }
for ( i = 0; i < p_pic->i_planes; i++ )
{
p_pic->p[i].p_pixels = malloc( p_pic->p[i].i_lines *
static int transcode_video_process( sout_stream_t *, sout_stream_id_t *,
block_t *, block_t ** );
-static void video_del_buffer( vlc_object_t *, picture_t * );
static picture_t *video_new_buffer_decoder( decoder_t * );
static void video_del_buffer_decoder( decoder_t *, picture_t * );
static void video_link_picture_decoder( decoder_t *, picture_t * );
static void video_unlink_picture_decoder( decoder_t *, picture_t * );
-static picture_t *video_new_buffer_filter( filter_t * );
-static void video_del_buffer_filter( filter_t *, picture_t * );
static int transcode_spu_new ( sout_stream_t *, sout_stream_id_t * );
static void transcode_spu_close ( sout_stream_id_t * );
struct decoder_owner_sys_t
{
- picture_t *pp_pics[PICTURE_RING_SIZE];
- sout_stream_sys_t *p_sys;
-};
-struct filter_owner_sys_t
-{
- picture_t *pp_pics[PICTURE_RING_SIZE];
sout_stream_sys_t *p_sys;
};
if( p_sys->i_acodec )
{
- if( p_sys->i_acodec == VLC_FOURCC('m','p','3',0) &&
- p_sys->i_channels > 2 )
+ if( ( p_sys->i_acodec == VLC_CODEC_MP3 ||
+ p_sys->i_acodec == VLC_CODEC_MPGA ) && p_sys->i_channels > 2 )
{
msg_Warn( p_stream, "%d channels invalid for mp3, forcing to 2",
p_sys->i_channels );
&p_sys->p_osd_cfg, strdup( "dvbsub") );
free( psz_next );
- p_sys->i_osdcodec = VLC_FOURCC('Y','U','V','P' );
+ p_sys->i_osdcodec = VLC_CODEC_YUVP;
msg_Dbg( p_stream, "codec osd=%4.4s", (char *)&p_sys->i_osdcodec );
p_dst->audio.i_rate );
/* If any filter is needed, convert to fl32 */
- if( current.i_codec != VLC_FOURCC('f','l','3','2') )
+ if( current.i_codec != VLC_CODEC_FL32 )
{
/* First step, convert to fl32 */
current.i_codec =
- current.audio.i_format = VLC_FOURCC('f','l','3','2');
+ current.audio.i_format = VLC_CODEC_FL32;
if( !filter_chain_AppendFilter( p_chain, NULL, NULL, NULL, ¤t ) )
{
aout_BitsPerSample( id->p_decoder->fmt_out.i_codec );
fmt_last = id->p_decoder->fmt_out;
/* Fix AAC SBR changing number of channels and sampling rate */
- if( !(id->p_decoder->fmt_in.i_codec == VLC_FOURCC('m','p','4','a') &&
+ if( !(id->p_decoder->fmt_in.i_codec == VLC_CODEC_MP4A &&
fmt_last.audio.i_rate != id->p_encoder->fmt_in.audio.i_rate &&
fmt_last.audio.i_channels != id->p_encoder->fmt_in.audio.i_channels) )
fmt_last.audio.i_rate = id->p_decoder->fmt_in.audio.i_rate;
{
es_format_t fmt_fl32 = fmt_last;
fmt_fl32.i_codec =
- fmt_fl32.audio.i_format = VLC_FOURCC('f','l','3','2');
+ fmt_fl32.audio.i_format = VLC_CODEC_FL32;
if( transcode_audio_filter_chain_build( p_stream, id->p_uf_chain,
&fmt_fl32, &fmt_last ) )
{
}
fmt_last = id->p_encoder->fmt_in;
- /* FIXME: Hack for mp3 transcoding support */
- if( id->p_encoder->fmt_out.i_codec == VLC_FOURCC( 'm','p','3',' ' ) )
- id->p_encoder->fmt_out.i_codec = VLC_FOURCC( 'm','p','g','a' );
+ /* */
+ id->p_encoder->fmt_out.i_codec =
+ vlc_fourcc_GetCodec( AUDIO_ES, id->p_encoder->fmt_out.i_codec );
return VLC_SUCCESS;
}
* video
*/
+static picture_t *transcode_video_filter_buffer_new( filter_t *p_filter )
+{
+ p_filter->fmt_out.video.i_chroma = p_filter->fmt_out.i_codec;
+ return picture_New( p_filter->fmt_out.video.i_chroma,
+ p_filter->fmt_out.video.i_width,
+ p_filter->fmt_out.video.i_height,
+ p_filter->fmt_out.video.i_aspect );
+}
+static void transcode_video_filter_buffer_del( filter_t *p_filter, picture_t *p_pic )
+{
+ VLC_UNUSED(p_filter);
+ picture_Release( p_pic );
+}
+
static int transcode_video_filter_allocation_init( filter_t *p_filter,
void *p_data )
{
- sout_stream_sys_t *p_sys = (sout_stream_sys_t*)p_data;
- int i;
-
- p_filter->pf_vout_buffer_new = video_new_buffer_filter;
- p_filter->pf_vout_buffer_del = video_del_buffer_filter;
-
- p_filter->p_owner = malloc( sizeof(filter_owner_sys_t) );
- if( !p_filter->p_owner )
- return VLC_EGENERIC;
-
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- p_filter->p_owner->pp_pics[i] = 0;
- p_filter->p_owner->p_sys = p_sys;
-
+ p_filter->pf_vout_buffer_new = transcode_video_filter_buffer_new;
+ p_filter->pf_vout_buffer_del = transcode_video_filter_buffer_del;
return VLC_SUCCESS;
}
static void transcode_video_filter_allocation_clear( filter_t *p_filter )
{
- int j;
-
- /* Clean-up pictures ring buffer */
- for( j = 0; j < PICTURE_RING_SIZE; j++ )
- {
- if( p_filter->p_owner->pp_pics[j] )
- video_del_buffer( VLC_OBJECT(p_filter),
- p_filter->p_owner->pp_pics[j] );
- }
- free( p_filter->p_owner );
}
static int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_t *id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
- int i;
/* Open decoder
* Initialization of decoder structures
if( !id->p_decoder->p_owner )
return VLC_EGENERIC;
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- id->p_decoder->p_owner->pp_pics[i] = 0;
id->p_decoder->p_owner->p_sys = p_sys;
/* id->p_decoder->p_cfg = p_sys->p_video_cfg; */
id->p_encoder->fmt_in.video.i_chroma = id->p_encoder->fmt_in.i_codec;
- /* Hack for mp2v/mp1v transcoding support */
- if( id->p_encoder->fmt_out.i_codec == VLC_FOURCC('m','p','1','v') ||
- id->p_encoder->fmt_out.i_codec == VLC_FOURCC('m','p','2','v') )
- {
- id->p_encoder->fmt_out.i_codec = VLC_FOURCC('m','p','g','v');
- }
+ /* */
+ id->p_encoder->fmt_out.i_codec =
+ vlc_fourcc_GetCodec( VIDEO_ES, id->p_encoder->fmt_out.i_codec );
id->id = sout_StreamIdAdd( p_stream->p_sys->p_out,
&id->p_encoder->fmt_out );
static void transcode_video_close( sout_stream_t *p_stream,
sout_stream_id_t *id )
{
- int i;
-
if( p_stream->p_sys->i_threads >= 1 )
{
vlc_mutex_lock( &p_stream->p_sys->lock_out );
if( id->p_decoder->p_description )
vlc_meta_Delete( id->p_decoder->p_description );
- if( id->p_decoder->p_owner )
- {
- /* Clean-up pictures ring buffer */
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- if( id->p_decoder->p_owner->pp_pics[i] )
- video_del_buffer( VLC_OBJECT(id->p_decoder),
- id->p_decoder->p_owner->pp_pics[i] );
- }
- free( id->p_decoder->p_owner );
- }
+ free( id->p_decoder->p_owner );
/* Close encoder */
if( id->p_encoder->p_module )
{
msg_Dbg( p_stream, "late picture skipped (%"PRId64")",
current_date + 50000 - p_pic->date );
- p_pic->pf_release( p_pic );
+ picture_Release( p_pic );
continue;
}
}
msg_Dbg( p_stream, "dropping frame (%i)",
(int)(i_video_drift - i_master_drift) );
#endif
- p_pic->pf_release( p_pic );
+ picture_Release( p_pic );
continue;
}
else if( i_video_drift > (i_master_drift + 50000) )
if( transcode_video_encoder_open( p_stream, id ) != VLC_SUCCESS )
{
- p_pic->pf_release( p_pic );
+ picture_Release( p_pic );
transcode_video_close( p_stream, id );
id->b_transcode = false;
return VLC_EGENERIC;
{
video_format_t fmt;
- if( p_pic->i_refcount && !filter_chain_GetLength( id->p_f_chain ) )
+ if( picture_IsReferenced( p_pic ) && !filter_chain_GetLength( id->p_f_chain ) )
{
/* We can't modify the picture, we need to duplicate it */
picture_t *p_tmp = video_new_buffer_decoder( id->p_decoder );
if( p_tmp )
{
picture_Copy( p_tmp, p_pic );
- p_pic->pf_release( p_pic );
+ picture_Release( p_pic );
p_pic = p_tmp;
}
}
if( p_sys->i_threads == 0 )
{
- p_pic->pf_release( p_pic );
+ picture_Release( p_pic );
}
else
{
block_ChainAppend( &p_sys->p_buffers, p_block );
vlc_mutex_unlock( &p_sys->lock_out );
- p_pic->pf_release( p_pic );
+ picture_Release( p_pic );
}
while( p_sys->i_last_pic != p_sys->i_first_pic )
{
p_pic = p_sys->pp_pics[p_sys->i_first_pic++];
p_sys->i_first_pic %= PICTURE_RING_SIZE;
- p_pic->pf_release( p_pic );
+ picture_Release( p_pic );
}
block_ChainRelease( p_sys->p_buffers );
return NULL;
}
-struct picture_sys_t
-{
- vlc_object_t *p_owner;
-};
-
-static void video_release_buffer( picture_t *p_pic )
+static picture_t *video_new_buffer_decoder( decoder_t *p_dec )
{
- if( p_pic && !p_pic->i_refcount && p_pic->pf_release && p_pic->p_sys )
+ sout_stream_sys_t *p_ssys = p_dec->p_owner->p_sys;
+ if( p_ssys->i_threads >= 1 )
{
- video_del_buffer_decoder( (decoder_t *)p_pic->p_sys->p_owner, p_pic );
- }
- else if( p_pic && p_pic->i_refcount > 0 ) p_pic->i_refcount--;
-}
-
-static picture_t *video_new_buffer( vlc_object_t *p_this, picture_t **pp_ring,
- sout_stream_sys_t *p_sys )
-{
- decoder_t *p_dec = (decoder_t *)p_this;
- picture_t *p_pic;
- int i;
+ int i_first_pic = p_ssys->i_first_pic;
- /* Find an empty space in the picture ring buffer */
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- if( pp_ring[i] != NULL && pp_ring[i]->i_status == DESTROYED_PICTURE )
- {
- pp_ring[i]->i_status = RESERVED_PICTURE;
- return pp_ring[i];
- }
- }
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- if( pp_ring[i] == NULL ) break;
- }
-
- if( i == PICTURE_RING_SIZE && p_sys->i_threads >= 1 )
- {
- int i_first_pic = p_sys->i_first_pic;
-
- if( p_sys->i_first_pic != p_sys->i_last_pic )
+ if( p_ssys->i_first_pic != p_ssys->i_last_pic )
{
/* Encoder still has stuff to encode, wait to clear-up the list */
- while( p_sys->i_first_pic == i_first_pic )
+ while( p_ssys->i_first_pic == i_first_pic )
msleep( 100000 );
}
-
- /* Find an empty space in the picture ring buffer */
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- if( pp_ring[i] != NULL && pp_ring[i]->i_status == DESTROYED_PICTURE )
- {
- pp_ring[i]->i_status = RESERVED_PICTURE;
- return pp_ring[i];
- }
- }
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- if( pp_ring[i] == NULL ) break;
- }
- }
-
- if( i == PICTURE_RING_SIZE )
- {
- msg_Err( p_this, "decoder/filter is leaking pictures, "
- "resetting its ring buffer" );
-
- for( i = 0; i < PICTURE_RING_SIZE; i++ )
- {
- pp_ring[i]->pf_release( pp_ring[i] );
- }
-
- i = 0;
}
p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
- p_pic = picture_New( p_dec->fmt_out.video.i_chroma,
- p_dec->fmt_out.video.i_width,
- p_dec->fmt_out.video.i_height,
- p_dec->fmt_out.video.i_aspect );
- if( !p_pic ) return NULL;
- p_pic->p_sys = calloc( 1, sizeof(picture_sys_t) );
- if( !p_pic->p_sys )
- {
- picture_Release( p_pic );
- return NULL;
- }
- p_pic->pf_release = video_release_buffer;
- p_pic->i_refcount = 0;
-
- pp_ring[i] = p_pic;
- return p_pic;
-}
-
-static picture_t *video_new_buffer_decoder( decoder_t *p_dec )
-{
- return video_new_buffer( VLC_OBJECT(p_dec),
- p_dec->p_owner->pp_pics, p_dec->p_owner->p_sys );
-}
-
-static picture_t *video_new_buffer_filter( filter_t *p_filter )
-{
- return video_new_buffer( VLC_OBJECT(p_filter),
- p_filter->p_owner->pp_pics,
- p_filter->p_owner->p_sys );
-}
-
-static void video_del_buffer( vlc_object_t *p_this, picture_t *p_pic )
-{
- VLC_UNUSED(p_this);
- if( p_pic )
- {
- free( p_pic->p_q );
- free( p_pic->p_data_orig );
- free( p_pic->p_sys );
- free( p_pic );
- }
+ return picture_New( p_dec->fmt_out.video.i_chroma,
+ p_dec->fmt_out.video.i_width,
+ p_dec->fmt_out.video.i_height,
+ p_dec->fmt_out.video.i_aspect );
}
static void video_del_buffer_decoder( decoder_t *p_decoder, picture_t *p_pic )
{
VLC_UNUSED(p_decoder);
- p_pic->i_refcount = 0;
- p_pic->i_status = DESTROYED_PICTURE;
- picture_CleanupQuant( p_pic );
-}
-
-static void video_del_buffer_filter( filter_t *p_filter, picture_t *p_pic )
-{
- VLC_UNUSED(p_filter);
- p_pic->i_refcount = 0;
- p_pic->i_status = DESTROYED_PICTURE;
- picture_CleanupQuant( p_pic );
+ picture_Release( p_pic );
}
static void video_link_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
{
VLC_UNUSED(p_dec);
- p_pic->i_refcount++;
+ picture_Hold( p_pic );
}
static void video_unlink_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
{
VLC_UNUSED(p_dec);
- video_release_buffer( p_pic );
+ picture_Release( p_pic );
}
/*
/* Open encoder */
es_format_Init( &id->p_encoder->fmt_in, id->p_decoder->fmt_in.i_cat,
- VLC_FOURCC('Y','U','V','A') );
+ VLC_CODEC_YUVA );
id->p_encoder->fmt_in.psz_language = strdup( "osd" );
id->p_encoder->p_cfg = p_sys->p_osd_cfg;
id->id = NULL;
if( p_fmt->i_cat == VIDEO_ES
- && p_fmt->i_codec == VLC_FOURCC('m', 'p', 'g', 'v') )
+ && p_fmt->i_codec == VLC_CODEC_MPGV )
{
msg_Dbg( p_stream,
"creating video transrating for fcc=`%4.4s'",
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
#define SRC_FOURCC "GREY"
#define DEST_FOURCC "I420,YUY2"
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('Y','8','0','0'):
- p_filter->fmt_in.video.i_chroma = VLC_FOURCC('G','R','E','Y');
- case VLC_FOURCC('G','R','E','Y'):
+ case VLC_CODEC_GREY:
switch( p_filter->fmt_out.video.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
+ case VLC_CODEC_I420:
p_filter->pf_video_filter = GREY_I420_Filter;
break;
- case VLC_FOURCC('Y','U','Y','2'):
+ case VLC_CODEC_YUYV:
p_filter->pf_video_filter = GREY_YUY2_Filter;
break;
default:
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
#include "i420_rgb.h"
#if defined (MODULE_NAME_IS_i420_rgb)
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I420:
switch( p_filter->fmt_out.video.i_chroma )
{
#if defined (MODULE_NAME_IS_i420_rgb)
- case VLC_FOURCC('R','G','B','2'):
+ case VLC_CODEC_RGB8:
p_filter->pf_video_filter = I420_RGB8_Filter;
break;
#endif
- case VLC_FOURCC('R','V','1','5'):
- case VLC_FOURCC('R','V','1','6'):
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB16:
#if ! defined (MODULE_NAME_IS_i420_rgb)
/* If we don't have support for the bitmasks, bail out */
if( ( p_filter->fmt_out.video.i_rmask == 0x7c00
#if 0
/* Hmmm, is there only X11 using 32bits per pixel for RV24 ? */
- case VLC_FOURCC('R','V','2','4'):
+ case VLC_CODEC_RGB24:
#endif
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB32:
#if ! defined (MODULE_NAME_IS_i420_rgb)
/* If we don't have support for the bitmasks, bail out */
if( p_filter->fmt_out.video.i_rmask == 0x00ff0000
switch( p_filter->fmt_out.video.i_chroma )
{
#if defined (MODULE_NAME_IS_i420_rgb)
- case VLC_FOURCC('R','G','B','2'):
+ case VLC_CODEC_RGB8:
p_filter->p_sys->p_buffer = malloc( VOUT_MAX_WIDTH );
break;
#endif
- case VLC_FOURCC('R','V','1','5'):
- case VLC_FOURCC('R','V','1','6'):
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB16:
p_filter->p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 2 );
break;
- case VLC_FOURCC('R','V','2','4'):
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB24:
+ case VLC_CODEC_RGB32:
p_filter->p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 4 );
break;
p_filter->p_sys->p_offset = malloc( p_filter->fmt_out.video.i_width
* ( ( p_filter->fmt_out.video.i_chroma
- == VLC_FOURCC('R','G','B','2') ) ? 2 : 1 )
+ == VLC_CODEC_RGB8 ) ? 2 : 1 )
* sizeof( int ) );
if( p_filter->p_sys->p_offset == NULL )
{
#if defined (MODULE_NAME_IS_i420_rgb)
switch( p_filter->fmt_out.video.i_chroma )
{
- case VLC_FOURCC('R','G','B','2'):
+ case VLC_CODEC_RGB8:
i_tables_size = sizeof( uint8_t ) * PALETTE_TABLE_SIZE;
break;
- case VLC_FOURCC('R','V','1','5'):
- case VLC_FOURCC('R','V','1','6'):
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB16:
i_tables_size = sizeof( uint16_t ) * RGB_TABLE_SIZE;
break;
default: /* RV24, RV32 */
/* Color: build red, green and blue tables */
switch( p_filter->fmt_out.video.i_chroma )
{
- case VLC_FOURCC('R','G','B','2'):
+ case VLC_CODEC_RGB8:
p_filter->p_sys->p_rgb8 = (uint8_t *)p_filter->p_sys->p_base;
Set8bppPalette( p_filter, p_filter->p_sys->p_rgb8 );
break;
- case VLC_FOURCC('R','V','1','5'):
- case VLC_FOURCC('R','V','1','6'):
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB16:
p_filter->p_sys->p_rgb16 = (uint16_t *)p_filter->p_sys->p_base;
for( i_index = 0; i_index < RED_MARGIN; i_index++ )
{
}
break;
- case VLC_FOURCC('R','V','2','4'):
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB24:
+ case VLC_CODEC_RGB32:
p_filter->p_sys->p_rgb32 = (uint32_t *)p_filter->p_sys->p_base;
for( i_index = 0; i_index < RED_MARGIN; i_index++ )
{
#include <vlc/vlc.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
#include "i420_rgb.h"
#if defined (MODULE_NAME_IS_i420_rgb)
#include <vlc/vlc.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
#include "i420_rgb.h"
#include "i420_rgb_c.h"
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
#define SRC_FOURCC "I420,IYUV,YV12"
#define DEST_FOURCC "YMGA"
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I420:
switch( p_filter->fmt_out.video.i_chroma )
{
- case VLC_FOURCC('Y','M','G','A'):
+ case VLC_CODEC_YMGA:
p_filter->pf_video_filter = I420_YMGA_Filter;
break;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
#if defined (MODULE_NAME_IS_i420_yuy2_altivec) && defined(HAVE_ALTIVEC_H)
# include <altivec.h>
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I420:
switch( p_filter->fmt_out.video.i_chroma )
{
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('Y','U','N','V'):
+ case VLC_CODEC_YUYV:
p_filter->pf_video_filter = I420_YUY2_Filter;
break;
- case VLC_FOURCC('Y','V','Y','U'):
+ case VLC_CODEC_YVYU:
p_filter->pf_video_filter = I420_YVYU_Filter;
break;
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('U','Y','N','V'):
- case VLC_FOURCC('Y','4','2','2'):
+ case VLC_CODEC_UYVY:
p_filter->pf_video_filter = I420_UYVY_Filter;
break;
#if !defined (MODULE_NAME_IS_i420_yuy2_altivec)
p_filter->pf_video_filter = I420_IUYV_Filter;
break;
- case VLC_FOURCC('c','y','u','v'):
+ case VLC_CODEC_CYUV:
p_filter->pf_video_filter = I420_cyuv_Filter;
break;
#endif
#if defined (MODULE_NAME_IS_i420_yuy2)
- case VLC_FOURCC('Y','2','1','1'):
+ case VLC_CODEC_Y211:
p_filter->pf_video_filter = I420_Y211_Filter;
break;
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
#define SRC_FOURCC "I422,J422"
#define DEST_FOURCC "I420,IYUV,J420,YV12,YUVA"
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('J','4','2','2'):
+ case VLC_CODEC_I422:
+ case VLC_CODEC_J422:
switch( p_filter->fmt_out.video.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('J','4','2','0'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_J420:
p_filter->pf_video_filter = I422_I420_Filter;
break;
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_YV12:
p_filter->pf_video_filter = I422_YV12_Filter;
break;
- case VLC_FOURCC('Y','U','V','A'):
+ case VLC_CODEC_YUVA:
p_filter->pf_video_filter = I422_YUVA_Filter;
break;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
#include "i422_yuy2.h"
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('I','4','2','2'):
+ case VLC_CODEC_I422:
switch( p_filter->fmt_out.video.i_chroma )
{
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('Y','U','N','V'):
+ case VLC_CODEC_YUYV:
p_filter->pf_video_filter = I422_YUY2_Filter;
break;
- case VLC_FOURCC('Y','V','Y','U'):
+ case VLC_CODEC_YVYU:
p_filter->pf_video_filter = I422_YVYU_Filter;
break;
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('U','Y','N','V'):
- case VLC_FOURCC('Y','4','2','2'):
+ case VLC_CODEC_UYVY:
p_filter->pf_video_filter = I422_UYVY_Filter;
break;
- case VLC_FOURCC('I','U','Y','V'):
p_filter->pf_video_filter = I422_IUYV_Filter;
break;
- case VLC_FOURCC('c','y','u','v'):
+ case VLC_CODEC_CYUV:
p_filter->pf_video_filter = I422_cyuv_Filter;
break;
#if defined (MODULE_NAME_IS_i422_yuy2)
- case VLC_FOURCC('Y','2','1','1'):
+ case VLC_CODEC_Y211:
p_filter->pf_video_filter = I422_Y211_Filter;
break;
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
#define SRC_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,cyuv"
#define DEST_FOURCC "I420"
switch( p_filter->fmt_out.video.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
+ case VLC_CODEC_I420:
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('Y','U','N','V'):
+ case VLC_CODEC_YUYV:
p_filter->pf_video_filter = YUY2_I420_Filter;
break;
- case VLC_FOURCC('Y','V','Y','U'):
+ case VLC_CODEC_YVYU:
p_filter->pf_video_filter = YVYU_I420_Filter;
break;
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('U','Y','N','V'):
- case VLC_FOURCC('Y','4','2','2'):
+ case VLC_CODEC_UYVY:
p_filter->pf_video_filter = UYVY_I420_Filter;
break;
- case VLC_FOURCC('c','y','u','v'):
+ case VLC_CODEC_CYUV:
p_filter->pf_video_filter = cyuv_I420_Filter;
break;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
#define SRC_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,cyuv"
#define DEST_FOURCC "I422"
switch( p_filter->fmt_out.video.i_chroma )
{
- case VLC_FOURCC('I','4','2','2'):
+ case VLC_CODEC_I422:
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('Y','U','N','V'):
+ case VLC_CODEC_YUYV:
p_filter->pf_video_filter = YUY2_I422_Filter;
break;
- case VLC_FOURCC('Y','V','Y','U'):
+ case VLC_CODEC_YVYU:
p_filter->pf_video_filter = YVYU_I422_Filter;
break;
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('U','Y','N','V'):
- case VLC_FOURCC('Y','4','2','2'):
+ case VLC_CODEC_UYVY:
p_filter->pf_video_filter = UYVY_I422_Filter;
break;
- case VLC_FOURCC('c','y','u','v'):
+ case VLC_CODEC_CYUV:
p_filter->pf_video_filter = cyuv_I422_Filter;
break;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_sout.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
return NULL;
}
- p_outpic = p_filter->pf_vout_buffer_new( p_filter );
+ p_outpic = filter_NewPicture( p_filter );
if( !p_outpic )
{
msg_Warn( p_filter, "can't get output picture" );
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_image.h>
#include <vlc_filter.h>
filter_sys_t *p_sys;
char *psz_string;
- if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','U','V','A') )
+ if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVA )
{
msg_Err( p_filter,
"Unsupported input chroma \"%4s\". "
video_format_t fmt_in, fmt_out;
memset( &fmt_in, 0, sizeof( video_format_t ) );
memset( &fmt_out, 0, sizeof( video_format_t ) );
- fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt_out.i_chroma = VLC_CODEC_YUVA;
if( p_filter->p_sys->p_mask )
picture_Release( p_filter->p_sys->p_mask );
p_image = image_HandlerCreate( p_filter );
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('Y','V','1','6'):
- case VLC_FOURCC('Y','V','U','9'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_YV12:
// simple enough? Dionoea?
p_sys->pf_extract_mini_image = ExtractMiniImage_YUV;
break;
#include <assert.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
/*****************************************************************************
int i_dummy;
};
-#define FCC_YUVA VLC_FOURCC('Y','U','V','A')
-#define FCC_YUVP VLC_FOURCC('Y','U','V','P')
-#define FCC_RGBA VLC_FOURCC('R','G','B','A')
-
-#define FCC_I420 VLC_FOURCC('I','4','2','0')
-#define FCC_YV12 VLC_FOURCC('Y','V','1','2')
-#define FCC_YUY2 VLC_FOURCC('Y','U','Y','2')
-#define FCC_UYVY VLC_FOURCC('U','Y','V','Y')
-#define FCC_YVYU VLC_FOURCC('Y','V','Y','U')
-#define FCC_RV15 VLC_FOURCC('R','V','1','5')
-#define FCC_RV16 VLC_FOURCC('R','V','1','6')
-#define FCC_RV24 VLC_FOURCC('R','V','2','4')
-#define FCC_RV32 VLC_FOURCC('R','V','3','2')
+#define FCC_YUVA VLC_CODEC_YUVA
+#define FCC_YUVP VLC_CODEC_YUVP
+#define FCC_RGBA VLC_CODEC_RGBA
+
+#define FCC_I420 VLC_CODEC_I420
+#define FCC_YV12 VLC_CODEC_YV12
+#define FCC_YUY2 VLC_CODEC_YUYV
+#define FCC_UYVY VLC_CODEC_UYVY
+#define FCC_YVYU VLC_CODEC_YVYU
+#define FCC_RV15 VLC_CODEC_RGB15
+#define FCC_RV16 VLC_CODEC_RGB16
+#define FCC_RV24 VLC_CODEC_RGB24
+#define FCC_RV32 VLC_CODEC_RGB32
/****************************************************************************
* Local prototypes
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_sout.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "vlc_image.h"
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys;
- if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','U','V','A') )
+ if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVA )
{
msg_Err( p_filter,
"Unsupported input chroma \"%4s\". "
uint8_t *p_v = p_pic->p[ V_PLANE ].p_pixels;
uint8_t umin, umax, vmin, vmax;
- if( p_pic->format.i_chroma != VLC_FOURCC('Y','U','V','A') )
+ if( p_pic->format.i_chroma != VLC_CODEC_YUVA )
{
msg_Err( p_filter,
"Unsupported input chroma \"%4s\". "
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
-#include <vlc_vout.h>
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
static picture_t *video_new( filter_t *p_filter )
{
- return ((filter_t*)p_filter->p_owner)->pf_vout_buffer_new( (filter_t*)p_filter->p_owner );
+ return filter_NewPicture( (filter_t*)p_filter->p_owner );
}
static void video_del( filter_t *p_filter, picture_t *p_pic )
{
- if( ((filter_t*)p_filter->p_owner)->pf_vout_buffer_del )
- ((filter_t*)p_filter->p_owner)->pf_vout_buffer_del( (filter_t*)p_filter->p_owner, p_pic );
+ return filter_DeletePicture( (filter_t*)p_filter->p_owner, p_pic );
}
static int alloc_init( filter_t *p_filter, void *p_data )
const es_format_t *p_size );
static const vlc_fourcc_t pi_allowed_chromas[] = {
- VLC_FOURCC('I','4','2','0'),
- VLC_FOURCC('I','4','2','2'),
- VLC_FOURCC('R','V','3','2'),
- VLC_FOURCC('R','V','2','4'),
+ VLC_CODEC_I420,
+ VLC_CODEC_I422,
+ VLC_CODEC_RGB32,
+ VLC_CODEC_RGB24,
0
};
{
filter_t *p_parent = (filter_t*)p_filter->p_owner;
- return p_parent->pf_vout_buffer_new( p_parent );
+ return filter_NewPicture( p_parent );
}
static void BufferDel( filter_t *p_filter, picture_t *p_pic )
{
filter_t *p_parent = (filter_t*)p_filter->p_owner;
- p_parent->pf_vout_buffer_del( p_parent, p_pic );
+ return filter_DeletePicture( p_parent, p_pic );
}
static int BufferAllocationInit ( filter_t *p_filter, void *p_data )
{
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_sout.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
switch(i_chroma)
{
// planar YUV
- case VLC_FOURCC('I','4','4','4'):
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('I','4','1','1'):
- case VLC_FOURCC('I','4','1','0'):
- case VLC_FOURCC('Y','V','U','9'):
- case VLC_FOURCC('Y','U','V','A'):
+ case VLC_CODEC_I444:
+ case VLC_CODEC_I422:
+ case VLC_CODEC_I420:
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I411:
+ case VLC_CODEC_I410:
+ case VLC_CODEC_YUVA:
i_skipCount = (i_pitch * i_skipCountPercent) / 100;
for (i_index = i_col/2 + i_skipCount/2;
i_index <= i_visible_pitch/2 + i_col/2 - i_skipCount/2;
}
break;
// packed RGB
- case VLC_FOURCC('R','G','B','2'): // packed by 1
+ case VLC_CODEC_RGB8: // packed by 1
i_skipCount = (i_pitch * i_skipCountPercent) / 100;
for (i_index = i_col/2 + i_skipCount/2;
i_index <= i_visible_pitch/2 + i_col/2 - i_skipCount/2;
if (i_count > i_nonBlackPixel) break;
}
break;
- case VLC_FOURCC('R','V','1','5'): // packed by 2
- case VLC_FOURCC('R','V','1','6'): // packed by 2
+ case VLC_CODEC_RGB15: // packed by 2
+ case VLC_CODEC_RGB16: // packed by 2
i_skipCount = (i_pitch * i_skipCountPercent) / 100;
for (i_index = i_col/2 + i_skipCount/2 -
(i_col/2 + i_skipCount/2) % 2;
if (i_count > i_nonBlackPixel) break;
}
break;
- case VLC_FOURCC('R','V','2','4'): // packed by 3
+ case VLC_CODEC_RGB24: // packed by 3
i_skipCount = (i_pitch * i_skipCountPercent) / 100;
for (i_index = i_col/2 + i_skipCount/2 - (i_col/2 + i_skipCount/2) % 3; i_index <= i_visible_pitch/2 + i_col/2 - i_skipCount/2; i_index+=3)
{
if (i_count > i_nonBlackPixel) break;
}
break;
- case VLC_FOURCC('R','V','3','2'): // packed by 4
+ case VLC_CODEC_RGB32: // packed by 4
i_skipCount = (i_pitch * i_skipCountPercent) / 100;
for (i_index = i_col/2 + i_skipCount/2 - (i_col/2 + i_skipCount/2) % 4; i_index <= i_visible_pitch/2 + i_col/2 - i_skipCount/2; i_index+=4)
{
}
break;
// packed YUV
- case VLC_FOURCC('Y','U','Y','2'): // packed by 2
- case VLC_FOURCC('Y','U','N','V'): // packed by 2
- case VLC_FOURCC('U','Y','V','Y'): // packed by 2
- case VLC_FOURCC('U','Y','N','V'): // packed by 2
- case VLC_FOURCC('Y','4','2','2'): // packed by 2
+ case VLC_CODEC_YUYV: // packed by 2
+ case VLC_CODEC_UYVY: // packed by 2
i_skipCount = (i_pitch * i_skipCountPercent) / 100;
for (i_index = (i_col/2 + i_skipCount/2) -
(i_col/2 + i_skipCount/2) % 2;
/* Determine where black borders are */
switch( p_vout->output.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
+ case VLC_CODEC_I420:
/* XXX: Do not laugh ! I know this is very naive. But it's just a
* proof of concept code snippet... */
for( i = i_lines ; i-- ; )
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
}
else
{
- const bool b_i422 = p_vout->render.i_chroma == VLC_FOURCC('I','4','2','2');
+ const bool b_i422 = p_vout->render.i_chroma == VLC_CODEC_I422;
if( strcmp( psz_method, "discard" ) )
msg_Err( p_vout, "no valid deinterlace mode provided, "
"using \"discard\"" );
p_dst->i_sar_den *= 2;
}
- if( p_src->i_chroma == VLC_FOURCC('I','4','2','2') )
+ if( p_src->i_chroma == VLC_CODEC_I422 )
{
switch( p_vout->p_sys->i_mode )
{
case DEINTERLACE_MEAN:
case DEINTERLACE_LINEAR:
case DEINTERLACE_X:
- p_dst->i_chroma = VLC_FOURCC('I','4','2','2');
+ p_dst->i_chroma = VLC_CODEC_I422;
break;
default:
- p_dst->i_chroma = VLC_FOURCC('I','4','2','0');
+ p_dst->i_chroma = VLC_CODEC_I420;
break;
}
}
static bool IsChromaSupported( vlc_fourcc_t i_chroma )
{
- return i_chroma == VLC_FOURCC('I','4','2','0') ||
- i_chroma == VLC_FOURCC('I','Y','U','V') ||
- i_chroma == VLC_FOURCC('Y','V','1','2') ||
- i_chroma == VLC_FOURCC('I','4','2','2');
+ return i_chroma == VLC_CODEC_I420 ||
+ i_chroma == VLC_CODEC_YV12 ||
+ i_chroma == VLC_CODEC_I422;
}
/*****************************************************************************
switch( p_vout->render.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_YV12:
for( ; p_out < p_out_end ; )
{
}
break;
- case VLC_FOURCC('I','4','2','2'):
+ case VLC_CODEC_I422:
i_increment = 2 * p_pic->p[i_plane].i_pitch;
switch( p_vout->render.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_YV12:
/* For BOTTOM field we need to add the first line */
if( i_field == 1 )
{
}
break;
- case VLC_FOURCC('I','4','2','2'):
+ case VLC_CODEC_I422:
/* For BOTTOM field we need to add the first line */
if( i_field == 1 )
{
switch( p_vout->render.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_YV12:
/* First line: simple copy */
vlc_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch );
p_out += p_outpic->p[i_plane].i_pitch;
}
break;
- case VLC_FOURCC('I','4','2','2'):
+ case VLC_CODEC_I422:
/* First line: simple copy */
vlc_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch );
p_out += p_outpic->p[i_plane].i_pitch;
(char*)&p_overlay->format.i_chroma, p_overlay->i_x, p_overlay->i_y,
p_overlay->i_alpha );
- if( p_overlay->format.i_chroma == VLC_FOURCC('T','E','X','T') )
+ if( p_overlay->format.i_chroma == VLC_CODEC_TEXT )
{
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
{
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;
p_ovl->i_x = p_ovl->i_y = 0;
p_ovl->i_alpha = 0xFF;
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) );
+ video_format_Setup( &p_ovl->format, VLC_FOURCC( '\0','\0','\0','\0') , 0, 0,
+ VOUT_ASPECT_FACTOR );
+ p_ovl->p_fontstyle = text_style_New();
p_ovl->data.p_text = NULL;
return 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;
}
}
i_size = shminfo.shm_segsz;
- if( p_params->fourcc == VLC_FOURCC('T','E','X','T') )
+ if( p_params->fourcc == VLC_CODEC_TEXT )
{
char *p_data;
return VLC_ENOMEM;
}
- vout_InitFormat( &p_ovl->format, VLC_FOURCC('T','E','X','T'),
- 0, 0, 0 );
+ video_format_Setup( &p_ovl->format, VLC_CODEC_TEXT,
+ 0, 0, 0 );
p_data = shmat( p_params->i_shmid, NULL, SHM_RDONLY );
if( p_data == NULL )
if( p_ovl->data.p_pic == NULL )
return VLC_ENOMEM;
- vout_InitFormat( &p_ovl->format, p_params->fourcc,
- p_params->i_width, p_params->i_height,
- VOUT_ASPECT_FACTOR );
+ video_format_Setup( &p_ovl->format, p_params->fourcc,
+ p_params->i_width, p_params->i_height,
+ VOUT_ASPECT_FACTOR );
if( vout_AllocatePicture( p_filter, p_ovl->data.p_pic,
p_ovl->format.i_chroma, p_params->i_width,
p_params->i_height, p_ovl->format.i_aspect ) )
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_sout.h>
-#include <vlc_vout.h>
#include "vlc_image.h"
#include "vlc_filter.h"
picture_t *p_old_mask = p_filter->p_sys->p_mask;
memset( &fmt_in, 0, sizeof( video_format_t ) );
memset( &fmt_out, 0, sizeof( video_format_t ) );
- fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt_out.i_chroma = VLC_CODEC_YUVA;
p_image = image_HandlerCreate( p_filter );
p_filter->p_sys->p_mask =
image_ReadUrl( p_image, psz_filename, &fmt_in, &fmt_out );
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('J','4','2','0'):
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_J420:
+ case VLC_CODEC_YV12:
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('J','4','2','2'):
+ case VLC_CODEC_I422:
+ case VLC_CODEC_J422:
break;
default:
int i_width = i_mask_visible_pitch;
const bool b_line_factor = ( i_plane /* U_PLANE or V_PLANE */ &&
- !( p_inpic->format.i_chroma == VLC_FOURCC('I','4','2','2')
- || p_inpic->format.i_chroma == VLC_FOURCC('J','4','2','2') ) );
+ !( p_inpic->format.i_chroma == VLC_CODEC_I422
+ || p_inpic->format.i_chroma == VLC_CODEC_J422 ) );
if( i_plane ) /* U_PLANE or V_PLANE */
{
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('J','4','2','0'):
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_J420:
+ case VLC_CODEC_YV12:
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('J','4','2','2'):
+ case VLC_CODEC_I422:
+ case VLC_CODEC_J422:
CASE_PACKED_YUV_422
break;
vlc_mutex_lock( &p_sys->lock );
switch( p_pic->format.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('J','4','2','0'):
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_J420:
+ case VLC_CODEC_YV12:
switch( p_sys->i_color )
{
case RED:
}
break;
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('J','4','2','2'):
+ case VLC_CODEC_I422:
+ case VLC_CODEC_J422:
switch( p_filter->p_sys->i_color )
{
case RED:
/* FIXME: do all of these really have square pixels? */
#define CASE_PLANAR_YUV_SQUARE \
- case VLC_FOURCC('I','4','2','0'): \
- case VLC_FOURCC('I','Y','U','V'): \
- case VLC_FOURCC('J','4','2','0'): \
- case VLC_FOURCC('Y','V','1','2'): \
- case VLC_FOURCC('I','4','1','1'): \
- case VLC_FOURCC('I','4','1','0'): \
- case VLC_FOURCC('Y','V','U','9'): \
- case VLC_FOURCC('I','4','4','4'): \
- case VLC_FOURCC('J','4','4','4'): \
- case VLC_FOURCC('Y','U','V','A'):
+ case VLC_CODEC_I420: \
+ case VLC_CODEC_J420: \
+ case VLC_CODEC_YV12: \
+ case VLC_CODEC_I411: \
+ case VLC_CODEC_I410: \
+ case VLC_CODEC_I444: \
+ case VLC_CODEC_J444: \
+ case VLC_CODEC_YUVA:
#define CASE_PLANAR_YUV_NONSQUARE \
- case VLC_FOURCC('I','4','2','2'): \
- case VLC_FOURCC('J','4','2','2'):
+ case VLC_CODEC_I422: \
+ case VLC_CODEC_J422:
#define CASE_PLANAR_YUV \
CASE_PLANAR_YUV_SQUARE \
CASE_PLANAR_YUV_NONSQUARE \
#define CASE_PACKED_YUV_422 \
- case VLC_FOURCC('U','Y','V','Y'): \
- case VLC_FOURCC('U','Y','N','V'): \
- case VLC_FOURCC('Y','4','2','2'): \
- case VLC_FOURCC('c','y','u','v'): \
- case VLC_FOURCC('Y','U','Y','2'): \
- case VLC_FOURCC('Y','U','N','V'): \
- case VLC_FOURCC('Y','V','Y','U'):
+ case VLC_CODEC_UYVY: \
+ case VLC_CODEC_CYUV: \
+ case VLC_CODEC_YUYV: \
+ case VLC_CODEC_YVYU:
static inline int GetPackedYuvOffsets( vlc_fourcc_t i_chroma,
int *i_y_offset, int *i_u_offset, int *i_v_offset )
{
switch( i_chroma )
{
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('U','Y','N','V'):
- case VLC_FOURCC('Y','4','2','2'):
- case VLC_FOURCC('c','y','u','v'): /* <-- FIXME: reverted, whatever that means */
+ case VLC_CODEC_UYVY:
+ case VLC_CODEC_CYUV: /* <-- FIXME: reverted, whatever that means */
/* UYVY */
*i_y_offset = 1;
*i_u_offset = 0;
*i_v_offset = 2;
return VLC_SUCCESS;
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('Y','U','N','V'):
+ case VLC_CODEC_YUYV:
/* YUYV */
*i_y_offset = 0;
*i_u_offset = 1;
*i_v_offset = 3;
return VLC_SUCCESS;
- case VLC_FOURCC('Y','V','Y','U'):
+ case VLC_CODEC_YVYU:
/* YVYU */
*i_y_offset = 0;
*i_u_offset = 3;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
{
filter_t *p_filter = (filter_t *)p_this;
- if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','4','2','0')
- && p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','Y','U','V')
- && p_filter->fmt_in.video.i_chroma != VLC_FOURCC('J','4','2','0')
- && p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','V','1','2')
+ if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_I420
+ && p_filter->fmt_in.video.i_chroma != VLC_CODEC_J420
+ && p_filter->fmt_in.video.i_chroma != VLC_CODEC_YV12
- && p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','4','2','2')
- && p_filter->fmt_in.video.i_chroma != VLC_FOURCC('J','4','2','2')
+ && p_filter->fmt_in.video.i_chroma != VLC_CODEC_I422
+ && p_filter->fmt_in.video.i_chroma != VLC_CODEC_J422
)
{
/* We only want planar YUV 4:2:0 or 4:2:2 */
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_sout.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
vlc_module_end ()
/*****************************************************************************
- * vout_sys_t: Invert video output method descriptor
+ * filter_sys_t: Invert video output method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the Invert specific properties of an output thread.
return NULL;
}
- if( p_pic->format.i_chroma == VLC_FOURCC('Y','U','V','A') )
+ if( p_pic->format.i_chroma == VLC_CODEC_YUVA )
{
/* We don't want to invert the alpha plane */
i_planes = p_pic->i_planes - 1;
memset( &fmt_in, 0, sizeof(video_format_t) );
memset( &fmt_out, 0, sizeof(video_format_t) );
- fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt_out.i_chroma = VLC_CODEC_YUVA;
p_image = image_HandlerCreate( p_this );
p_pic = image_ReadUrl( p_image, psz_filename, &fmt_in, &fmt_out );
image_HandlerDelete( p_image );
p_sys->p_blend->fmt_in.video.i_y_offset = 0;
p_sys->p_blend->fmt_out.video.i_aspect = p_vout->render.i_aspect;
p_sys->p_blend->fmt_out.video.i_chroma = p_vout->output.i_chroma;
- p_sys->p_blend->fmt_in.video.i_chroma = VLC_FOURCC('Y','U','V','A');
+ p_sys->p_blend->fmt_in.video.i_chroma = VLC_CODEC_YUVA;
p_sys->p_blend->fmt_in.video.i_aspect = VOUT_ASPECT_FACTOR;
p_sys->i_width =
p_sys->p_blend->fmt_in.video.i_width =
/* Create new SPU region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt.i_chroma = VLC_CODEC_YUVA;
fmt.i_aspect = VOUT_ASPECT_FACTOR;
fmt.i_sar_num = fmt.i_sar_den = 1;
fmt.i_width = fmt.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch;
switch( p_vout->fmt_in.i_chroma )
{
CASE_PLANAR_YUV
- case VLC_FOURCC('G','R','E','Y'):
+ case VLC_CODEC_GREY:
break;
default:
msg_Err( p_vout, "Unsupported chroma" );
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "vlc_block.h"
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 );
DEL_VAR( "marq-size" );
vlc_mutex_destroy( &p_sys->lock );
- free( p_sys->p_style );
+ text_style_Delete( p_sys->p_style );
free( p_sys->psz_marquee );
free( p_sys );
}
goto out;
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_height = 0;
fmt.i_x_offset = 0;
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 );
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <math.h>
#include <limits.h> /* INT_MAX */
fmt_in.i_height = p_es->p_picture->format.i_height;
fmt_in.i_width = p_es->p_picture->format.i_width;
- if( fmt_in.i_chroma == VLC_FOURCC('Y','U','V','A') ||
- fmt_in.i_chroma == VLC_FOURCC('R','G','B','A') )
- fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+ if( fmt_in.i_chroma == VLC_CODEC_YUVA ||
+ fmt_in.i_chroma == VLC_CODEC_RGBA )
+ fmt_out.i_chroma = VLC_CODEC_YUVA;
else
- fmt_out.i_chroma = VLC_FOURCC('I','4','2','0');
+ fmt_out.i_chroma = VLC_CODEC_I420;
fmt_out.i_width = col_inner_width;
fmt_out.i_height = row_inner_height;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_sout.h>
-#include <vlc_vout.h>
#include <vlc_filter.h>
#include "filter_picture.h"
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_sout.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
int i_chroma_dy;
switch( p_inpic->format.i_chroma )
{
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('J','4','2','0'):
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_J420:
+ case VLC_CODEC_YV12:
i_chroma_dx = 2;
i_chroma_dy = 2;
break;
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('J','4','2','2'):
+ case VLC_CODEC_I422:
+ case VLC_CODEC_J422:
i_chroma_dx = 2;
i_chroma_dy = 1;
break;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
vlc_module_end ()
/*****************************************************************************
- * vout_sys_t: Distort video output method descriptor
+ * filter_sys_t: Distort video output method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the Distort specific properties of an output thread.
msg_Err( p_filter, "no image" );
return NULL;
}
- if ((p_pic->format.i_chroma != VLC_FOURCC('I','4','2','0')))
+ if ((p_pic->format.i_chroma != VLC_CODEC_I420))
{
msg_Err( p_filter, "wrong chroma - use I420" );
return NULL;
fmt.i_y_offset = fmt.i_y_offset * p_sys->f_scale;
if (p_sys->i_internal_chroma == GREY)
- fmt.i_chroma = VLC_FOURCC('I','4','2','0');
+ fmt.i_chroma = VLC_CODEC_I420;
else if (p_sys->i_internal_chroma == RGB)
- fmt.i_chroma = VLC_FOURCC('R','V','3','2');
+ fmt.i_chroma = VLC_CODEC_RGB32;
}
/* Load the internal opencv filter */
//rgb2 gives 3 separate planes, this gives 1 interleaved plane
//rv24 gives is about 20% faster but gives r&b the wrong way round
//and I cant think of an easy way to fix this
- fmt_out.i_chroma = VLC_FOURCC('R','V','3','2');
+ fmt_out.i_chroma = VLC_CODEC_RGB32;
}
else if (p_sys->i_internal_chroma == GREY)
{
//take the I (gray) plane (video seems to commonly be in this fmt so usually the
//conversion does nothing)
- fmt_out.i_chroma = VLC_FOURCC('I','4','2','0');
+ fmt_out.i_chroma = VLC_CODEC_I420;
}
//convert from the input image
MouseEvent, p_sys );
}
- es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) );
+ es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_CODEC_SPU );
p_filter->fmt_out.i_priority = 0;
return VLC_SUCCESS;
/* Create new SPU region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC( 'T','E','X','T' );
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = VOUT_ASPECT_FACTOR;
fmt.i_sar_num = fmt.i_sar_den = 1;
fmt.i_width = fmt.i_visible_width = i_width;
/* Create new SPU region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = (p_pic == NULL) ? VLC_FOURCC('Y','U','V','P') : VLC_FOURCC('Y','U','V','A');
+ fmt.i_chroma = (p_pic == NULL) ? VLC_CODEC_YUVP : VLC_CODEC_YUVA;
fmt.i_aspect = VOUT_ASPECT_FACTOR;
fmt.i_sar_num = fmt.i_sar_den = 1;
fmt.i_width = fmt.i_visible_width = i_width;
fmt.i_height = fmt.i_visible_height = i_height;
fmt.i_x_offset = fmt.i_y_offset = 0;
- if( fmt.i_chroma == VLC_FOURCC('Y','U','V','P') )
+ if( fmt.i_chroma == VLC_CODEC_YUVP )
{
fmt.p_palette = &palette;
fmt.p_palette->i_entries = 0;
p_vout->pf_manage = NULL;
/* Color Format not supported
// Planar Y, packed UV
-case VLC_FOURCC('Y','M','G','A'):
+case VLC_CODEC_YMGA:
// Packed YUV 4:2:2, U:Y:V:Y, interlaced
case VLC_FOURCC('I','U','Y','V'): // packed by 2
// Packed YUV 2:1:1, Y:U:Y:V
-case VLC_FOURCC('Y','2','1','1'): // packed by 4
+case VLC_CODEC_Y211: // packed by 4
// Packed YUV Reverted
-case VLC_FOURCC('c','y','u','v'): // packed by 2
+case VLC_CODEC_CYUV: // packed by 2
*/
switch (p_vout->render.i_chroma)
{
// planar YUV
- case VLC_FOURCC('I','4','4','4'):
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('I','4','1','1'):
- case VLC_FOURCC('I','4','1','0'):
- case VLC_FOURCC('Y','V','U','9'):
- case VLC_FOURCC('Y','U','V','A'):
+ case VLC_CODEC_I444:
+ case VLC_CODEC_I422:
+ case VLC_CODEC_I420:
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I411:
+ case VLC_CODEC_I410:
+ case VLC_CODEC_YUVA:
p_vout->pf_render = RenderPlanarYUV;
break;
// packed RGB
- case VLC_FOURCC('R','G','B','2'): // packed by 1
- case VLC_FOURCC('R','V','1','5'): // packed by 2
- case VLC_FOURCC('R','V','1','6'): // packed by 2
- case VLC_FOURCC('R','V','2','4'): // packed by 3
- case VLC_FOURCC('R','V','3','2'): // packed by 4
+ case VLC_CODEC_RGB8: // packed by 1
+ case VLC_CODEC_RGB15: // packed by 2
+ case VLC_CODEC_RGB16: // packed by 2
+ case VLC_CODEC_RGB24: // packed by 3
+ case VLC_CODEC_RGB32: // packed by 4
p_vout->pf_render = RenderPackedRGB;
break;
#ifdef PACKED_YUV
// packed YUV
- case VLC_FOURCC('Y','U','Y','2'): // packed by 2
- case VLC_FOURCC('Y','U','N','V'): // packed by 2
- case VLC_FOURCC('U','Y','V','Y'): // packed by 2
- case VLC_FOURCC('U','Y','N','V'): // packed by 2
- case VLC_FOURCC('Y','4','2','2'): // packed by 2
+ case VLC_CODEC_YUYV: // packed by 2
+ case VLC_CODEC_UYVY: // packed by 2
p_vout->pf_render = RenderPackedYUV;
break;
#endif
switch (p_vout->render.i_chroma)
{
// planar YVU
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('Y','V','U','9'):
+ case VLC_CODEC_YV12:
// packed UYV
- case VLC_FOURCC('U','Y','V','Y'): // packed by 2
- case VLC_FOURCC('U','Y','N','V'): // packed by 2
- case VLC_FOURCC('Y','4','2','2'): // packed by 2
- // case VLC_FOURCC('c','y','u','v'): // packed by 2
+ case VLC_CODEC_UYVY: // packed by 2
+ // case VLC_CODEC_CYUV: // packed by 2
VLC_XCHG( float, p_vout->p_sys->f_gamma[1], p_vout->p_sys->f_gamma[2] );
VLC_XCHG( float, f_BlackCrush[1], f_BlackCrush[2] );
VLC_XCHG( float, f_WhiteCrush[1], f_WhiteCrush[2] );
VLC_XCHG( float, f_BlackLevel[1], f_BlackLevel[2] );
VLC_XCHG( float, f_WhiteLevel[1], f_WhiteLevel[2] );
// planar YUV
- case VLC_FOURCC('I','4','4','4'):
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','4','1','1'):
- case VLC_FOURCC('I','4','1','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('Y','U','V','A'):
+ case VLC_CODEC_I444:
+ case VLC_CODEC_I422:
+ case VLC_CODEC_I420:
+ case VLC_CODEC_I411:
+ case VLC_CODEC_I410:
+ case VLC_CODEC_YUVA:
// packed YUV
- case VLC_FOURCC('Y','U','Y','2'): // packed by 2
- case VLC_FOURCC('Y','U','N','V'): // packed by 2
+ case VLC_CODEC_YUYV: // packed by 2
for (i_index = 0; i_index < 256; i_index++)
for (i_index2 = 0; i_index2 <= ACCURACY; i_index2++)
for (i_plane = 0; i_plane < VOUT_MAX_PLANES; i_plane++)
}
break;
// packed RGB
- case VLC_FOURCC('R','G','B','2'): // packed by 1
- case VLC_FOURCC('R','V','1','5'): // packed by 2
- case VLC_FOURCC('R','V','1','6'): // packed by 2
- case VLC_FOURCC('R','V','2','4'): // packed by 3
- case VLC_FOURCC('R','V','3','2'): // packed by 4
+ case VLC_CODEC_RGB8: // packed by 1
+ case VLC_CODEC_RGB15: // packed by 2
+ case VLC_CODEC_RGB16: // packed by 2
+ case VLC_CODEC_RGB24: // packed by 3
+ case VLC_CODEC_RGB32: // packed by 4
for (i_index = 0; i_index < 256; i_index++)
for (i_index2 = 0; i_index2 <= ACCURACY; i_index2++)
for (i_plane = 0; i_plane < VOUT_MAX_PLANES; i_plane++)
#endif
switch (p_vout->output.i_chroma)
{
- case VLC_FOURCC('Y','U','Y','2'): // packed by 2
- case VLC_FOURCC('Y','U','N','V'): // packed by 2
+ case VLC_CODEC_YUYV: // packed by 2
Denom = F2(length / p_pic->p->i_pixel_pitch);
a_2 = p_vout->p_sys->a_2 * (ACCURACY / 100);
a_1 = p_vout->p_sys->a_1 * 2 * p_vout->p_sys->i_halfLength * (ACCURACY / 100);
p_vout->p_sys->cstYUV[i_col][1][i_index + 1] = p_vout->p_sys->cstYUV[i_col][1][i_index];
}
break;
- case VLC_FOURCC('U','Y','V','Y'): // packed by 2
- case VLC_FOURCC('U','Y','N','V'): // packed by 2
- case VLC_FOURCC('Y','4','2','2'): // packed by 2
+ case VLC_CODEC_UYVY: // packed by 2
Denom = F2(length / p_pic->p->i_pixel_pitch);
a_2 = p_vout->p_sys->a_2 * (ACCURACY / 100);
a_1 = p_vout->p_sys->a_1 * 2 * p_vout->p_sys->i_halfLength * (ACCURACY / 100);
#endif
switch (p_vout->output.i_chroma)
{
- case VLC_FOURCC('Y','U','Y','2'): // packed by 2
- case VLC_FOURCC('Y','U','N','V'): // packed by 2
+ case VLC_CODEC_YUYV: // packed by 2
Denom = F2(length / p_pic->p->i_pixel_pitch);
a_2 = p_vout->p_sys->a_2 * (ACCURACY / 100);
a_1 = p_vout->p_sys->a_1 * 2 * p_vout->p_sys->i_halfHeight * (ACCURACY / 100);
p_vout->p_sys->cstYUV2[i_row][1][i_index + 1] = p_vout->p_sys->cstYUV2[i_row][1][i_index];
}
break;
- case VLC_FOURCC('U','Y','V','Y'): // packed by 2
- case VLC_FOURCC('U','Y','N','V'): // packed by 2
- case VLC_FOURCC('Y','4','2','2'): // packed by 2
+ case VLC_CODEC_UYVY: // packed by 2
Denom = F2(length / p_pic->p->i_pixel_pitch);
a_2 = p_vout->p_sys->a_2 * (ACCURACY / 100);
a_1 = p_vout->p_sys->a_1 * 2 * p_vout->p_sys->i_halfHeight * (ACCURACY / 100);
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
+#include <vlc_filter.h>
#include "filter_picture.h"
switch( p_filter->fmt_in.video.i_chroma )
{
- case VLC_FOURCC('I','4','4','4'):
- case VLC_FOURCC('J','4','4','4'):
- /* case VLC_FOURCC('Y','U','V','A'): FIXME Should work but alpha plane needs to be copied manually and I'm kind of feeling too lazy to write the code to do that ATM (i_pitch vs i_visible_pitch...). */
+ case VLC_CODEC_I444:
+ case VLC_CODEC_J444:
+ /* case VLC_CODEC_YUVA: FIXME Should work but alpha plane needs to be copied manually and I'm kind of feeling too lazy to write the code to do that ATM (i_pitch vs i_visible_pitch...). */
i_flags |= PP_FORMAT_444;
break;
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('J','4','2','2'):
+ case VLC_CODEC_I422:
+ case VLC_CODEC_J422:
i_flags |= PP_FORMAT_422;
break;
- case VLC_FOURCC('I','4','1','1'):
+ case VLC_CODEC_I411:
i_flags |= PP_FORMAT_411;
break;
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('J','4','2','0'):
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_J420:
+ case VLC_CODEC_YV12:
i_flags |= PP_FORMAT_420;
break;
default:
vlc_module_end ()
/*****************************************************************************
- * vout_sys_t: Distort video output method descriptor
+ * filter_sys_t: Distort video output method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the Distort specific properties of an output thread.
KeyEvent, p_this );
}
- es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) );
+ es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_CODEC_SPU );
p_filter->fmt_out.i_priority = 0;
vlc_gcrypt_init();
/* Create an empty picture for VNC the data */
vlc_mutex_lock( &p_sys->lock );
- p_sys->p_pic = picture_New( VLC_FOURCC('Y','U','V','A'),
+ p_sys->p_pic = picture_New( VLC_CODEC_YUVA,
p_sys->i_vnc_width, p_sys->i_vnc_height, VOUT_ASPECT_FACTOR );
if( !p_sys->p_pic )
{
/* Create new SPU region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt.i_chroma = VLC_CODEC_YUVA;
fmt.i_aspect = VOUT_ASPECT_FACTOR;
fmt.i_sar_num = fmt.i_sar_den = 1;
fmt.i_width = fmt.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_filter.h>
#include "filter_picture.h"
vlc_module_end ()
/*****************************************************************************
- * vout_sys_t: Distort video output method descriptor
+ * filter_sys_t: Distort video output method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the Distort specific properties of an output thread.
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "vlc_block.h"
}
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 );
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" );
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 );
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 );
{
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 );
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 );
return NULL;
}
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
p_spu->p_region = subpicture_region_New( &fmt );
if( !p_spu->p_region )
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 )
{
memset( &fmt_out, 0, sizeof(video_format_t) );
- fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt_out.i_chroma = VLC_CODEC_YUVA;
fmt_out.i_aspect = VOUT_ASPECT_FACTOR;
fmt_out.i_sar_num = fmt_out.i_sar_den = 1;
fmt_out.i_width =
memset( &fmt_in, 0, sizeof(video_format_t) );
memset( &fmt_out, 0, sizeof(video_format_t) );
- fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt_out.i_chroma = VLC_CODEC_YUVA;
p_orig = image_ReadUrl( p_handler, psz_url, &fmt_in, &fmt_out );
if( !p_orig )
else if( p_sys->p_style->i_font_size > 0 )
{
- fmt_in.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt_in.i_chroma = VLC_CODEC_YUVA;
fmt_in.i_height = p_orig->p[Y_PLANE].i_visible_lines;
fmt_in.i_width = p_orig->p[Y_PLANE].i_visible_pitch;
fmt_out.i_width = p_orig->p[Y_PLANE].i_visible_pitch
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
/*****************************************************************************
filter_sys_t *p_sys;
/* XXX Only support RV24 -> RV32 conversion */
- if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('R','V','2','4') ||
- (p_filter->fmt_out.video.i_chroma != VLC_FOURCC('R', 'V', '3', '2') &&
- p_filter->fmt_out.video.i_chroma != VLC_FOURCC('R', 'G', 'B', 'A')) )
+ if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGB24 ||
+ (p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGB32 &&
+ p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGBA) )
{
return VLC_EGENERIC;
}
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
/*****************************************************************************
filter_t *p_filter = (filter_t*)p_this;
filter_sys_t *p_sys;
- if( ( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','U','V','P') &&
- p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','U','V','A') &&
- p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','4','2','0') &&
- p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','V','1','2') &&
- p_filter->fmt_in.video.i_chroma != VLC_FOURCC('R','V','3','2') &&
- p_filter->fmt_in.video.i_chroma != VLC_FOURCC('R','G','B','A') ) ||
+ if( ( p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVP &&
+ p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVA &&
+ p_filter->fmt_in.video.i_chroma != VLC_CODEC_I420 &&
+ p_filter->fmt_in.video.i_chroma != VLC_CODEC_YV12 &&
+ p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGB32 &&
+ p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGBA ) ||
p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma )
{
return VLC_EGENERIC;
return NULL;
}
- if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('R','G','B','A') &&
- p_filter->fmt_in.video.i_chroma != VLC_FOURCC('R','V','3','2') )
+ if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGBA &&
+ p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGB32 )
{
for( i_plane = 0; i_plane < p_pic_dst->i_planes; i_plane++ )
{
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_block.h>
#include "vlc_filter.h"
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_filter.h>
#ifdef HAVE_LIBSWSCALE_SWSCALE_H
if( p_fmti->i_chroma == p_fmto->i_chroma )
{
- if( p_fmti->i_chroma == VLC_FOURCC( 'Y', 'U', 'V', 'P' ) && ALLOW_YUVP )
+ if( p_fmti->i_chroma == VLC_CODEC_YUVP && ALLOW_YUVP )
{
i_fmti = i_fmto = PIX_FMT_GRAY8;
i_sws_flags = SWS_POINT;
}
}
- if( p_fmti->i_chroma == VLC_FOURCC( 'Y', 'U', 'V', 'A' ) )
+ if( p_fmti->i_chroma == VLC_CODEC_YUVA )
{
i_fmti = PIX_FMT_YUV444P;
b_has_ai = true;
}
- else if( p_fmti->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )
+ else if( p_fmti->i_chroma == VLC_CODEC_RGBA )
{
i_fmti = PIX_FMT_BGR32;
b_has_ai = true;
}
- if( p_fmto->i_chroma == VLC_FOURCC( 'Y', 'U', 'V', 'A' ) )
+ if( p_fmto->i_chroma == VLC_CODEC_YUVA )
{
i_fmto = PIX_FMT_YUV444P;
b_has_ao = true;
}
- else if( p_fmto->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )
+ else if( p_fmto->i_chroma == VLC_CODEC_RGBA )
{
i_fmto = PIX_FMT_BGR32;
b_has_ao = true;
}
if( p_sys->ctxA )
{
- p_sys->p_src_a = picture_New( VLC_FOURCC( 'G', 'R', 'E', 'Y' ), i_fmti_width, p_fmti->i_height, 0 );
- p_sys->p_dst_a = picture_New( VLC_FOURCC( 'G', 'R', 'E', 'Y' ), i_fmto_width, p_fmto->i_height, 0 );
+ p_sys->p_src_a = picture_New( VLC_CODEC_GREY, i_fmti_width, p_fmti->i_height, 0 );
+ p_sys->p_dst_a = picture_New( VLC_CODEC_GREY, i_fmto_width, p_fmto->i_height, 0 );
}
if( p_sys->i_extend_factor != 1 )
{
uint8_t *dst[3]; int dst_stride[3];
GetPixels( src, src_stride, p_src, i_plane_start, i_plane_count );
- if( p_filter->fmt_in.video.i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'P' ) )
+ if( p_filter->fmt_in.video.i_chroma == VLC_CODEC_RGBP )
{
memset( palette, 0, sizeof(palette) );
if( p_filter->fmt_in.video.p_palette )
if( p_sys->ctxA )
{
/* We extract the A plane to rescale it, and then we reinject it. */
- if( p_fmti->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )
+ if( p_fmti->i_chroma == VLC_CODEC_RGBA )
ExtractA( p_sys->p_src_a, p_src, p_fmti->i_width * p_sys->i_extend_factor, p_fmti->i_height );
else
plane_CopyPixels( p_sys->p_src_a->p, p_src->p+A_PLANE );
Convert( p_filter, p_sys->ctxA, p_sys->p_dst_a, p_sys->p_src_a, p_fmti->i_height, 0, 1 );
- if( p_fmto->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )
+ if( p_fmto->i_chroma == VLC_CODEC_RGBA )
InjectA( p_dst, p_sys->p_dst_a, p_fmto->i_width * p_sys->i_extend_factor, p_fmto->i_height );
else
plane_CopyPixels( p_dst->p+A_PLANE, p_sys->p_dst_a->p );
else if( p_sys->b_add_a )
{
/* We inject a complete opaque alpha plane */
- if( p_fmto->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )
+ if( p_fmto->i_chroma == VLC_CODEC_RGBA )
FillA( &p_dst->p[0], OFFSET_A );
else
FillA( &p_dst->p[A_PLANE], 0 );
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_filter.h>
#include "libswscale_nokia770/arm_jit_swscale.h"
return VLC_SUCCESS;
}
- if( ( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','4','2','0') &&
- p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','Y','U','V') &&
- p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','V','1','2') ) ||
+ if( ( p_filter->fmt_in.video.i_chroma != VLC_CODEC_I420 &&
+ p_filter->fmt_in.video.i_chroma != VLC_CODEC_YV12 ) ||
p_filter->fmt_out.video.i_chroma != VLC_FOURCC('Y','4','2','0') )
{
msg_Err( p_filter, "format not supported" );
return NULL;
/* Request output picture */
- p_pic_dst = p_filter->pf_vout_buffer_new( p_filter );
+ p_pic_dst = filter_NewPicture( p_filter );
if( !p_pic_dst )
{
msg_Warn( p_filter, "can't get output picture" );
switch( p_vout->fmt_in.i_chroma )
{
CASE_PLANAR_YUV_SQUARE
- case VLC_FOURCC('G','R','E','Y'):
+ case VLC_CODEC_GREY:
p_vout->p_sys->pf_filter = FilterPlanar;
break;
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('J','4','2','2'):
+ case VLC_CODEC_I422:
+ case VLC_CODEC_J422:
p_vout->p_sys->pf_filter = FilterI422;
break;
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include "filter_picture.h"
vlc_module_end ()
/*****************************************************************************
- * vout_sys_t: Distort video output method descriptor
+ * filter_sys_t: Distort video output method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the Distort specific properties of an output thread.
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include "vlc_filter.h"
#include <assert.h>
/* It only supports YUVP to YUVA/RGBA without scaling
* (if scaling is required another filter can do it) */
- if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','U','V','P') ||
- ( p_filter->fmt_out.video.i_chroma != VLC_FOURCC('Y','U','V','A') &&
- p_filter->fmt_out.video.i_chroma != VLC_FOURCC('R','G','B','A') ) ||
+ if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVP ||
+ ( p_filter->fmt_out.video.i_chroma != VLC_CODEC_YUVA &&
+ p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGBA ) ||
p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width ||
p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height )
{
const video_palette_t *p_yuvp = p_filter->fmt_in.video.p_palette;
assert( p_yuvp != NULL );
- assert( p_filter->fmt_in.video.i_chroma == VLC_FOURCC('Y','U','V','P') );
+ assert( p_filter->fmt_in.video.i_chroma == VLC_CODEC_YUVP );
assert( p_filter->fmt_in.video.i_width == p_filter->fmt_out.video.i_width );
assert( p_filter->fmt_in.video.i_height == p_filter->fmt_out.video.i_height );
return NULL;
}
- if( p_filter->fmt_out.video.i_chroma == VLC_FOURCC('Y','U','V','A') )
+ if( p_filter->fmt_out.video.i_chroma == VLC_CODEC_YUVA )
{
for( unsigned int y = 0; y < p_filter->fmt_in.video.i_height; y++ )
{
}
else
{
- assert( p_filter->fmt_out.video.i_chroma == VLC_FOURCC('R','G','B','A') );
+ assert( p_filter->fmt_out.video.i_chroma == VLC_CODEC_RGBA );
/* Create a RGBA palette */
video_palette_t rgbp;
I_OUTPUTPICTURES = 0;
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->output.i_width = p_vout->p_sys->i_width;
p_vout->output.i_height = p_vout->p_sys->i_height;
p_vout->output.i_aspect = p_vout->p_sys->i_width
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 );
I_OUTPUTPICTURES = 0;
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height;
p_vout->output.i_aspect = p_vout->render.i_aspect;
i_goffset = 2;
i_blength = 2;
i_boffset = 0;
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
break;
case DSPF_RGB16:
i_goffset = 5;
i_blength = 5;
i_boffset = 0;
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+ p_vout->output.i_chroma = VLC_CODEC_RGB16;
break;
case DSPF_RGB24:
i_goffset = 8;
i_blength = 8;
i_boffset = 0;
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
+ p_vout->output.i_chroma = VLC_CODEC_RGB24;
break;
case DSPF_RGB32:
i_goffset = 8;
i_blength = 8;
i_boffset = 0;
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
break;
default:
*/
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;
*/
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;
}
psz_chroma = var_CreateGetNonEmptyString( p_vout, "fb-chroma" );
if( psz_chroma )
{
- if( strlen( psz_chroma ) == 4 )
+ const vlc_fourcc_t i_chroma =
+ vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_chroma );
+
+ if( i_chroma )
{
- p_sys->i_chroma = VLC_FOURCC( psz_chroma[0],
- psz_chroma[1],
- psz_chroma[2],
- psz_chroma[3] );
+ p_sys->i_chroma = i_chroma;
msg_Dbg( p_vout, "forcing chroma '%s'", psz_chroma );
}
else
}
/* Fill in picture_t fields */
- vout_InitPicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
- p_vout->output.i_width, p_vout->output.i_height,
- p_vout->output.i_aspect );
+ if( picture_Setup( p_pic, p_vout->output.i_chroma,
+ p_vout->output.i_width, p_vout->output.i_height,
+ p_vout->output.i_aspect ) )
+ {
+ free( p_pic );
+ return VLC_EGENERIC;
+ }
p_pic->p_sys->p_data = malloc( p_vout->p_sys->i_page_size );
if( !p_pic->p_sys->p_data )
switch( p_sys->var_info.bits_per_pixel )
{
case 8: /* FIXME: set the palette */
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB8; break;
case 15:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB15; break;
case 16:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB16; break;
case 24:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB24; break;
case 32:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB32; break;
default:
msg_Err( p_vout, "unknown screen depth %i",
p_vout->p_sys->var_info.bits_per_pixel );
switch( p_vout->p_sys->i_bits_per_pixel )
{
case 8:
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->output.pf_setpalette = SetPalette;
break;
case 15:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB15; break;
case 16:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB16; break;
case 24:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB24; break;
case 32:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB32; break;
default:
msg_Err( p_vout, "unknown screen depth %i",
p_vout->p_sys->i_bits_per_pixel );
I_OUTPUTPICTURES = 0;
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->output.i_width = p_vout->p_sys->i_width;
p_vout->output.i_height = p_vout->p_sys->i_height;
p_vout->output.i_aspect = p_vout->p_sys->i_width
switch( p_vout->p_sys->i_screen_depth )
{
case 8: /* FIXME: set the palette */
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB8; break;
case 15:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB15; break;
case 16:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB16; break;
case 24:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB24; break;
case 32:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB32; break;
default:
msg_Err( p_vout, "unknown screen depth %i",
p_vout->p_sys->i_screen_depth );
}
/* Fill in picture_t fields */
- vout_InitPicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
- p_vout->output.i_width, p_vout->output.i_height,
- p_vout->output.i_aspect );
+ picture_Setup( p_pic, p_vout->output.i_chroma,
+ p_vout->output.i_width, p_vout->output.i_height,
+ p_vout->output.i_aspect );
p_pic->p_sys->p_image = new CascadeSharedMemZone();
if( p_pic->p_sys->p_image == NULL )
/* Assume we only do YMGA for the moment. XXX: mga_vid calls this
* YV12, but it's actually some strange format with packed UV. */
- p_vout->output.i_chroma = VLC_FOURCC('Y','M','G','A');
+ p_vout->output.i_chroma = VLC_CODEC_YMGA;
p_vout->p_sys->mga.format = MGA_VID_FORMAT_YV12;
if( ioctl(p_vout->p_sys->i_fd, MGA_VID_CONFIG, &p_vout->p_sys->mga) )
p_vout->p_sys->i_window_width = p_vout->i_window_width;
p_vout->p_sys->i_window_height = p_vout->i_window_height;
- /* Create the Vout EventThread, this thread is created by us to isolate
- * the Win32 PeekMessage function calls. We want to do this because
- * Windows can stay blocked inside this call for a long time, and when
- * this happens it thus blocks vlc's video_output thread.
- * Vout EventThread will take care of the creation of the video
- * window (because PeekMessage has to be called from the same thread which
- * created the window). */
- msg_Dbg( p_vout, "creating Vout EventThread" );
- p_vout->p_sys->p_event =
- vlc_object_create( p_vout, sizeof(event_thread_t) );
- p_vout->p_sys->p_event->p_vout = p_vout;
- p_vout->p_sys->p_event->window_ready = CreateEvent( NULL, TRUE, FALSE, NULL );
- if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
- EventThread, 0 ) )
+ if ( CreateEventThread( p_vout ) )
{
- msg_Err( p_vout, "cannot create Vout EventThread" );
- CloseHandle( p_vout->p_sys->p_event->window_ready );
- vlc_object_release( p_vout->p_sys->p_event );
- p_vout->p_sys->p_event = NULL;
- goto error;
- }
- WaitForSingleObject( p_vout->p_sys->p_event->window_ready, INFINITE );
- CloseHandle( p_vout->p_sys->p_event->window_ready );
-
- if( p_vout->p_sys->p_event->b_error )
- {
- msg_Err( p_vout, "Vout EventThread failed" );
- goto error;
- }
+ /* Variable to indicate if the window should be on top of others */
+ /* Trigger a callback right now */
+ var_TriggerCallback( p_vout, "video-on-top" );
- vlc_object_attach( p_vout->p_sys->p_event, p_vout );
+ DisableScreensaver ( p_vout );
- msg_Dbg( p_vout, "Vout EventThread running" );
-
- /* Variable to indicate if the window should be on top of others */
- /* Trigger a callback right now */
- var_TriggerCallback( p_vout, "video-on-top" );
-
- /* disable screensaver by temporarily changing system settings */
- p_vout->p_sys->i_spi_lowpowertimeout = 0;
- p_vout->p_sys->i_spi_powerofftimeout = 0;
- p_vout->p_sys->i_spi_screensavetimeout = 0;
- if( var_GetBool( p_vout, "disable-screensaver" ) ) {
- msg_Dbg(p_vout, "disabling screen saver");
- SystemParametersInfo(SPI_GETLOWPOWERTIMEOUT,
- 0, &(p_vout->p_sys->i_spi_lowpowertimeout), 0);
- if( 0 != p_vout->p_sys->i_spi_lowpowertimeout ) {
- SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT, 0, NULL, 0);
- }
- SystemParametersInfo(SPI_GETPOWEROFFTIMEOUT, 0,
- &(p_vout->p_sys->i_spi_powerofftimeout), 0);
- if( 0 != p_vout->p_sys->i_spi_powerofftimeout ) {
- SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT, 0, NULL, 0);
- }
- SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT, 0,
- &(p_vout->p_sys->i_spi_screensavetimeout), 0);
- if( 0 != p_vout->p_sys->i_spi_screensavetimeout ) {
- SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, 0, NULL, 0);
- }
+ return VLC_SUCCESS;
+ }
+ else
+ {
+ CloseVideo( VLC_OBJECT(p_vout) );
+ return VLC_EGENERIC;
}
- return VLC_SUCCESS;
-
-error:
- CloseVideo( VLC_OBJECT(p_vout) );
- return VLC_EGENERIC;
}
/*****************************************************************************
Direct3DVoutRelease( p_vout );
- if( p_vout->b_fullscreen )
- {
- msg_Dbg( p_vout, "Quitting fullscreen" );
- Win32ToggleFullscreen( p_vout );
- /* Force fullscreen in the core for the next video */
- var_SetBool( p_vout, "fullscreen", true );
- }
-
- if( p_vout->p_sys->p_event )
- {
- vlc_object_detach( p_vout->p_sys->p_event );
-
- /* Kill Vout EventThread */
- vlc_object_kill( p_vout->p_sys->p_event );
+ StopEventThread( p_vout );
- /* we need to be sure Vout EventThread won't stay stuck in
- * GetMessage, so we send a fake message */
- if( p_vout->p_sys->hwnd )
- {
- PostMessage( p_vout->p_sys->hwnd, WM_NULL, 0, 0);
- }
-
- vlc_thread_join( p_vout->p_sys->p_event );
- vlc_object_release( p_vout->p_sys->p_event );
- }
-
- vlc_mutex_destroy( &p_vout->p_sys->lock );
-
- /* restore screensaver system settings */
- if( 0 != p_vout->p_sys->i_spi_lowpowertimeout ) {
- SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT,
- p_vout->p_sys->i_spi_lowpowertimeout, NULL, 0);
- }
- if( 0 != p_vout->p_sys->i_spi_powerofftimeout ) {
- SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT,
- p_vout->p_sys->i_spi_powerofftimeout, NULL, 0);
- }
- if( 0 != p_vout->p_sys->i_spi_screensavetimeout ) {
- SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,
- p_vout->p_sys->i_spi_screensavetimeout, NULL, 0);
- }
+ RestoreScreensaver( p_vout );
free( p_vout->p_sys );
p_vout->p_sys = NULL;
/* it sounds like vista does not support YUV surfaces at all */
switch( i_chroma )
{
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('U','Y','N','V'):
- case VLC_FOURCC('Y','4','2','2'):
+ case VLC_CODEC_UYVY:
{
static const D3DFORMAT formats[] =
{ D3DFMT_UYVY, D3DFMT_YUY2, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','4','2','2'):
- case VLC_FOURCC('Y','V','1','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_I422:
+ case VLC_CODEC_YV12:
{
/* typically 3D textures don't support planar format
** fallback to packed version and use CPU for the conversion
{ D3DFMT_YUY2, D3DFMT_UYVY, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('Y','U','N','V'):
+ case VLC_CODEC_YUYV:
{
static const D3DFORMAT formats[] =
{ D3DFMT_YUY2, D3DFMT_UYVY, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 };
switch( i_chroma )
{
- case VLC_FOURCC('R', 'V', '1', '5'):
+ case VLC_CODEC_RGB15:
{
static const D3DFORMAT formats[] =
{ D3DFMT_X1R5G5B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
- case VLC_FOURCC('R', 'V', '1', '6'):
+ case VLC_CODEC_RGB16:
{
static const D3DFORMAT formats[] =
{ D3DFMT_R5G6B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
- case VLC_FOURCC('R', 'V', '2', '4'):
+ case VLC_CODEC_RGB24:
{
static const D3DFORMAT formats[] =
{ D3DFMT_R8G8B8, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
- case VLC_FOURCC('R', 'V', '3', '2'):
+ case VLC_CODEC_RGB32:
{
static const D3DFORMAT formats[] =
{ D3DFMT_A8R8G8B8, D3DFMT_X8R8G8B8 };
switch( format )
{
case D3DFMT_YUY2:
- p_vout->output.i_chroma = VLC_FOURCC('Y', 'U', 'Y', '2');
+ p_vout->output.i_chroma = VLC_CODEC_YUYV;
break;
case D3DFMT_UYVY:
- p_vout->output.i_chroma = VLC_FOURCC('U', 'Y', 'V', 'Y');
+ p_vout->output.i_chroma = VLC_CODEC_UYVY;
break;
case D3DFMT_R8G8B8:
- p_vout->output.i_chroma = VLC_FOURCC('R', 'V', '2', '4');
+ p_vout->output.i_chroma = VLC_CODEC_RGB24;
p_vout->output.i_rmask = 0xff0000;
p_vout->output.i_gmask = 0x00ff00;
p_vout->output.i_bmask = 0x0000ff;
break;
case D3DFMT_X8R8G8B8:
case D3DFMT_A8R8G8B8:
- p_vout->output.i_chroma = VLC_FOURCC('R', 'V', '3', '2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
p_vout->output.i_rmask = 0x00ff0000;
p_vout->output.i_gmask = 0x0000ff00;
p_vout->output.i_bmask = 0x000000ff;
break;
case D3DFMT_R5G6B5:
- p_vout->output.i_chroma = VLC_FOURCC('R', 'V', '1', '6');
+ p_vout->output.i_chroma = VLC_CODEC_RGB16;
p_vout->output.i_rmask = (0x1fL)<<11;
p_vout->output.i_gmask = (0x3fL)<<5;
p_vout->output.i_bmask = (0x1fL)<<0;
break;
case D3DFMT_X1R5G5B5:
- p_vout->output.i_chroma = VLC_FOURCC('R', 'V', '1', '5');
+ p_vout->output.i_chroma = VLC_CODEC_RGB15;
p_vout->output.i_rmask = (0x1fL)<<10;
p_vout->output.i_gmask = (0x1fL)<<5;
p_vout->output.i_bmask = (0x1fL)<<0;
* picture_t structures */
switch( p_vout->output.i_chroma )
{
- case VLC_FOURCC('R','G','B','2'):
+ case VLC_CODEC_RGB8:
p_pic->p->i_lines = p_vout->output.i_height;
p_pic->p->i_visible_lines = p_vout->output.i_height;
p_pic->p->i_pixel_pitch = 1;
p_pic->p->i_pixel_pitch;
p_pic->i_planes = 1;
break;
- case VLC_FOURCC('R','V','1','5'):
- case VLC_FOURCC('R','V','1','6'):
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB16:
p_pic->p->i_lines = p_vout->output.i_height;
p_pic->p->i_visible_lines = p_vout->output.i_height;
p_pic->p->i_pixel_pitch = 2;
p_pic->p->i_pixel_pitch;
p_pic->i_planes = 1;
break;
- case VLC_FOURCC('R','V','2','4'):
+ case VLC_CODEC_RGB24:
p_pic->p->i_lines = p_vout->output.i_height;
p_pic->p->i_visible_lines = p_vout->output.i_height;
p_pic->p->i_pixel_pitch = 3;
p_pic->p->i_pixel_pitch;
p_pic->i_planes = 1;
break;
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB32:
p_pic->p->i_lines = p_vout->output.i_height;
p_pic->p->i_visible_lines = p_vout->output.i_height;
p_pic->p->i_pixel_pitch = 4;
p_pic->p->i_pixel_pitch;
p_pic->i_planes = 1;
break;
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('Y','U','Y','2'):
+ case VLC_CODEC_UYVY:
+ case VLC_CODEC_YUYV:
p_pic->p->i_lines = p_vout->output.i_height;
p_pic->p->i_visible_lines = p_vout->output.i_height;
p_pic->p->i_pixel_pitch = 2;
p_vout->p_sys->i_window_width = p_vout->i_window_width;
p_vout->p_sys->i_window_height = p_vout->i_window_height;
- /* Create the Vout EventThread, this thread is created by us to isolate
- * the Win32 PeekMessage function calls. We want to do this because
- * Windows can stay blocked inside this call for a long time, and when
- * this happens it thus blocks vlc's video_output thread.
- * DirectXEventThread will take care of the creation of the video
- * window (because PeekMessage has to be called from the same thread which
- * created the window). */
- msg_Dbg( p_vout, "creating DirectXEventThread" );
- p_vout->p_sys->p_event =
- vlc_object_create( p_vout, sizeof(event_thread_t) );
- p_vout->p_sys->p_event->p_vout = p_vout;
- p_vout->p_sys->p_event->window_ready = CreateEvent( NULL, TRUE, FALSE, NULL );
- if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
- EventThread, 0 ) )
- {
- msg_Err( p_vout, "cannot create Vout EventThread" );
- CloseHandle( p_vout->p_sys->p_event->window_ready );
- vlc_object_release( p_vout->p_sys->p_event );
- p_vout->p_sys->p_event = NULL;
+ if ( !CreateEventThread( p_vout ) )
goto error;
- }
- WaitForSingleObject( p_vout->p_sys->p_event->window_ready, INFINITE );
- CloseHandle( p_vout->p_sys->p_event->window_ready );
-
- if( p_vout->p_sys->p_event->b_error )
- {
- msg_Err( p_vout, "Vout EventThread failed" );
- goto error;
- }
-
- vlc_object_attach( p_vout->p_sys->p_event, p_vout );
-
- msg_Dbg( p_vout, "Vout EventThread running" );
/* Initialise DirectDraw */
if( DirectXInitDDraw( p_vout ) )
var_AddCallback( p_vout, "directx-wallpaper", WallpaperCallback, NULL );
var_TriggerCallback( p_vout, "directx-wallpaper" );
- /* disable screensaver by temporarily changing system settings */
- p_vout->p_sys->i_spi_lowpowertimeout = 0;
- p_vout->p_sys->i_spi_powerofftimeout = 0;
- p_vout->p_sys->i_spi_screensavetimeout = 0;
- if( var_GetBool( p_vout, "disable-screensaver" ) ) {
- msg_Dbg(p_vout, "disabling screen saver");
- SystemParametersInfo(SPI_GETLOWPOWERTIMEOUT,
- 0, &(p_vout->p_sys->i_spi_lowpowertimeout), 0);
- if( 0 != p_vout->p_sys->i_spi_lowpowertimeout ) {
- SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT, 0, NULL, 0);
- }
- SystemParametersInfo(SPI_GETPOWEROFFTIMEOUT, 0,
- &(p_vout->p_sys->i_spi_powerofftimeout), 0);
- if( 0 != p_vout->p_sys->i_spi_powerofftimeout ) {
- SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT, 0, NULL, 0);
- }
- SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT, 0,
- &(p_vout->p_sys->i_spi_screensavetimeout), 0);
- if( 0 != p_vout->p_sys->i_spi_screensavetimeout ) {
- SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, 0, NULL, 0);
- }
- }
+ DisableScreensaver ( p_vout );
return VLC_SUCCESS;
/* Choose the chroma we will try first. */
switch( p_vout->render.i_chroma )
{
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('Y','U','N','V'):
- p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
+ case VLC_CODEC_YUYV:
+ p_vout->output.i_chroma = VLC_CODEC_YUYV;
break;
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('U','Y','N','V'):
- case VLC_FOURCC('Y','4','2','2'):
- p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y');
+ case VLC_CODEC_UYVY:
+ p_vout->output.i_chroma = VLC_CODEC_UYVY;
break;
- case VLC_FOURCC('Y','V','Y','U'):
- p_vout->output.i_chroma = VLC_FOURCC('Y','V','Y','U');
+ case VLC_CODEC_YVYU:
+ p_vout->output.i_chroma = VLC_CODEC_YVYU;
break;
default:
- p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2');
+ p_vout->output.i_chroma = VLC_CODEC_YV12;
break;
}
if( !I_OUTPUTPICTURES )
{
/* hmmm, it didn't work! Let's try commonly supported chromas */
- if( p_vout->output.i_chroma != VLC_FOURCC('I','4','2','0') )
+ if( p_vout->output.i_chroma != VLC_CODEC_I420 )
{
- p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2');
+ p_vout->output.i_chroma = VLC_CODEC_YV12;
NewPictureVec( p_vout, p_vout->p_picture, MAX_DIRECTBUFFERS );
}
if( !I_OUTPUTPICTURES )
{
/* hmmm, it still didn't work! Let's try another one */
- p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
+ p_vout->output.i_chroma = VLC_CODEC_YUYV;
NewPictureVec( p_vout, p_vout->p_picture, MAX_DIRECTBUFFERS );
}
}
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
- if( p_vout->b_fullscreen )
- {
- msg_Dbg( p_vout, "Quitting fullscreen" );
- Win32ToggleFullscreen( p_vout );
- /* Force fullscreen in the core for the next video */
- var_SetBool( p_vout, "fullscreen", true );
- }
-
- if( p_vout->p_sys->p_event )
- {
- vlc_object_detach( p_vout->p_sys->p_event );
-
- /* Kill Vout EventThread */
- vlc_object_kill( p_vout->p_sys->p_event );
-
- /* we need to be sure Vout EventThread won't stay stuck in
- * GetMessage, so we send a fake message */
- if( p_vout->p_sys->hwnd )
- {
- PostMessage( p_vout->p_sys->hwnd, WM_NULL, 0, 0);
- }
-
- vlc_thread_join( p_vout->p_sys->p_event );
- vlc_object_release( p_vout->p_sys->p_event );
- }
-
- vlc_mutex_destroy( &p_vout->p_sys->lock );
+ StopEventThread( p_vout );
/* Make sure the wallpaper is restored */
SwitchWallpaperMode( p_vout, false );
- /* restore screensaver system settings */
- if( 0 != p_vout->p_sys->i_spi_lowpowertimeout ) {
- SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT,
- p_vout->p_sys->i_spi_lowpowertimeout, NULL, 0);
- }
- if( 0 != p_vout->p_sys->i_spi_powerofftimeout ) {
- SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT,
- p_vout->p_sys->i_spi_powerofftimeout, NULL, 0);
- }
- if( 0 != p_vout->p_sys->i_spi_screensavetimeout ) {
- SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,
- p_vout->p_sys->i_spi_screensavetimeout, NULL, 0);
- }
+ RestoreScreensaver( p_vout );
free( p_vout->p_sys );
p_vout->p_sys = NULL;
if( !b_overlay )
{
bool b_rgb_surface =
- ( i_chroma == VLC_FOURCC('R','G','B','2') )
- || ( i_chroma == VLC_FOURCC('R','V','1','5') )
- || ( i_chroma == VLC_FOURCC('R','V','1','6') )
- || ( i_chroma == VLC_FOURCC('R','V','2','4') )
- || ( i_chroma == VLC_FOURCC('R','V','3','2') );
+ ( i_chroma == VLC_CODEC_RGB8 )
+ || ( i_chroma == VLC_CODEC_RGB15 )
+ || ( i_chroma == VLC_CODEC_RGB16 )
+ || ( i_chroma == VLC_CODEC_RGB24 )
+ || ( i_chroma == VLC_CODEC_RGB32 );
memset( &ddsd, 0, sizeof( DDSURFACEDESC ) );
ddsd.dwSize = sizeof(DDSURFACEDESC);
switch( ddpfPixelFormat.dwRGBBitCount )
{
case 8:
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->output.pf_setpalette = SetPalette;
break;
case 15:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+ p_vout->output.i_chroma = VLC_CODEC_RGB15;
break;
case 16:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+ p_vout->output.i_chroma = VLC_CODEC_RGB16;
break;
case 24:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
+ p_vout->output.i_chroma = VLC_CODEC_RGB24;
break;
case 32:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
break;
default:
msg_Err( p_vout, "unknown screen depth" );
{
switch( p_vout->output.i_chroma )
{
- case VLC_FOURCC('R','G','B','2'):
- case VLC_FOURCC('R','V','1','5'):
- case VLC_FOURCC('R','V','1','6'):
- case VLC_FOURCC('R','V','2','4'):
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB8:
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB16:
+ case VLC_CODEC_RGB24:
+ case VLC_CODEC_RGB32:
p_pic->p->p_pixels = p_pic->p_sys->ddsd.lpSurface;
p_pic->p->i_lines = p_vout->output.i_height;
p_pic->p->i_visible_lines = p_vout->output.i_height;
p_pic->p->i_pitch = p_pic->p_sys->ddsd.lPitch;
switch( p_vout->output.i_chroma )
{
- case VLC_FOURCC('R','G','B','2'):
+ case VLC_CODEC_RGB8:
p_pic->p->i_pixel_pitch = 1;
break;
- case VLC_FOURCC('R','V','1','5'):
- case VLC_FOURCC('R','V','1','6'):
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB16:
p_pic->p->i_pixel_pitch = 2;
break;
- case VLC_FOURCC('R','V','2','4'):
+ case VLC_CODEC_RGB24:
p_pic->p->i_pixel_pitch = 3;
break;
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB32:
p_pic->p->i_pixel_pitch = 4;
break;
default:
p_pic->i_planes = 1;
break;
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('I','4','2','0'):
+ case VLC_CODEC_YV12:
/* U and V inverted compared to I420
* Fixme: this should be handled by the vout core */
- p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0');
+ p_vout->output.i_chroma = VLC_CODEC_I420;
p_pic->Y_PIXELS = p_pic->p_sys->ddsd.lpSurface;
p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height;
p_pic->i_planes = 3;
break;
- case VLC_FOURCC('I','Y','U','V'):
+ case VLC_CODEC_I420:
p_pic->Y_PIXELS = p_pic->p_sys->ddsd.lpSurface;
p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height;
p_pic->i_planes = 3;
break;
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('Y','U','Y','2'):
+ case VLC_CODEC_UYVY:
+ case VLC_CODEC_YUYV:
p_pic->p->p_pixels = p_pic->p_sys->ddsd.lpSurface;
p_pic->p->i_lines = p_vout->output.i_height;
/* Update the object variable and trigger callback */
var_SetBool( p_vout, "fullscreen", p_vout->b_fullscreen );
}
+
+void DisableScreensaver( vout_thread_t *p_vout )
+{
+ /* disable screensaver by temporarily changing system settings */
+ p_vout->p_sys->i_spi_lowpowertimeout = 0;
+ p_vout->p_sys->i_spi_powerofftimeout = 0;
+ p_vout->p_sys->i_spi_screensavetimeout = 0;
+ if( var_GetBool( p_vout, "disable-screensaver" ) )
+ {
+ msg_Dbg(p_vout, "disabling screen saver");
+ SystemParametersInfo(SPI_GETLOWPOWERTIMEOUT,
+ 0, &(p_vout->p_sys->i_spi_lowpowertimeout), 0);
+ if( 0 != p_vout->p_sys->i_spi_lowpowertimeout ) {
+ SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT, 0, NULL, 0);
+ }
+ SystemParametersInfo(SPI_GETPOWEROFFTIMEOUT, 0,
+ &(p_vout->p_sys->i_spi_powerofftimeout), 0);
+ if( 0 != p_vout->p_sys->i_spi_powerofftimeout ) {
+ SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT, 0, NULL, 0);
+ }
+ SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT, 0,
+ &(p_vout->p_sys->i_spi_screensavetimeout), 0);
+ if( 0 != p_vout->p_sys->i_spi_screensavetimeout ) {
+ SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, 0, NULL, 0);
+ }
+ }
+}
+
+void RestoreScreensaver( vout_thread_t *p_vout )
+{
+ /* restore screensaver system settings */
+ if( 0 != p_vout->p_sys->i_spi_lowpowertimeout ) {
+ SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT,
+ p_vout->p_sys->i_spi_lowpowertimeout, NULL, 0);
+ }
+ if( 0 != p_vout->p_sys->i_spi_powerofftimeout ) {
+ SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT,
+ p_vout->p_sys->i_spi_powerofftimeout, NULL, 0);
+ }
+ if( 0 != p_vout->p_sys->i_spi_screensavetimeout ) {
+ SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,
+ p_vout->p_sys->i_spi_screensavetimeout, NULL, 0);
+ }
+}
+
+int CreateEventThread( vout_thread_t *p_vout )
+{
+ /* Create the Vout EventThread, this thread is created by us to isolate
+ * the Win32 PeekMessage function calls. We want to do this because
+ * Windows can stay blocked inside this call for a long time, and when
+ * this happens it thus blocks vlc's video_output thread.
+ * Vout EventThread will take care of the creation of the video
+ * window (because PeekMessage has to be called from the same thread which
+ * created the window). */
+ msg_Dbg( p_vout, "creating Vout EventThread" );
+ p_vout->p_sys->p_event =
+ vlc_object_create( p_vout, sizeof(event_thread_t) );
+ p_vout->p_sys->p_event->p_vout = p_vout;
+ p_vout->p_sys->p_event->window_ready = CreateEvent( NULL, TRUE, FALSE, NULL );
+ if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
+ EventThread, 0 ) )
+ {
+ msg_Err( p_vout, "cannot create Vout EventThread" );
+ CloseHandle( p_vout->p_sys->p_event->window_ready );
+ vlc_object_release( p_vout->p_sys->p_event );
+ p_vout->p_sys->p_event = NULL;
+ return 0;
+ }
+ WaitForSingleObject( p_vout->p_sys->p_event->window_ready, INFINITE );
+ CloseHandle( p_vout->p_sys->p_event->window_ready );
+
+ if( p_vout->p_sys->p_event->b_error )
+ {
+ msg_Err( p_vout, "Vout EventThread failed" );
+ return 0;
+ }
+
+ vlc_object_attach( p_vout->p_sys->p_event, p_vout );
+
+ msg_Dbg( p_vout, "Vout EventThread running" );
+ return 1;
+}
+
+void StopEventThread( vout_thread_t *p_vout )
+{
+ if( p_vout->b_fullscreen )
+ {
+ msg_Dbg( p_vout, "Quitting fullscreen" );
+ Win32ToggleFullscreen( p_vout );
+ /* Force fullscreen in the core for the next video */
+ var_SetBool( p_vout, "fullscreen", true );
+ }
+
+ if( p_vout->p_sys->p_event )
+ {
+ vlc_object_detach( p_vout->p_sys->p_event );
+
+ /* Kill Vout EventThread */
+ vlc_object_kill( p_vout->p_sys->p_event );
+
+ /* we need to be sure Vout EventThread won't stay stuck in
+ * GetMessage, so we send a fake message */
+ if( p_vout->p_sys->hwnd )
+ {
+ PostMessage( p_vout->p_sys->hwnd, WM_NULL, 0, 0);
+ }
+
+ vlc_thread_join( p_vout->p_sys->p_event );
+ vlc_object_release( p_vout->p_sys->p_event );
+ }
+
+ vlc_mutex_destroy( &p_vout->p_sys->lock );
+}
p_vout->p_sys->i_window_width = p_vout->i_window_width;
p_vout->p_sys->i_window_height = p_vout->i_window_height;
- /* Create the Vout EventThread, this thread is created by us to isolate
- * the Win32 PeekMessage function calls. We want to do this because
- * Windows can stay blocked inside this call for a long time, and when
- * this happens it thus blocks vlc's video_output thread.
- * Vout EventThread will take care of the creation of the video
- * window (because PeekMessage has to be called from the same thread which
- * created the window). */
- msg_Dbg( p_vout, "creating Vout EventThread" );
- p_vout->p_sys->p_event =
- vlc_object_create( p_vout, sizeof(event_thread_t) );
- p_vout->p_sys->p_event->p_vout = p_vout;
- p_vout->p_sys->p_event->window_ready = CreateEvent( NULL, TRUE, FALSE, NULL );
- if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
- EventThread, 0 ) )
+ if ( CreateEventThread( p_vout ) )
{
- msg_Err( p_vout, "cannot create Vout EventThread" );
- CloseHandle( p_vout->p_sys->p_event->window_ready );
- vlc_object_release( p_vout->p_sys->p_event );
- p_vout->p_sys->p_event = NULL;
- goto error;
- }
- WaitForSingleObject( p_vout->p_sys->p_event->window_ready, INFINITE );
- CloseHandle( p_vout->p_sys->p_event->window_ready );
+ /* Variable to indicate if the window should be on top of others */
+ /* Trigger a callback right now */
+ var_TriggerCallback( p_vout, "video-on-top" );
- if( p_vout->p_sys->p_event->b_error )
+ return VLC_SUCCESS;
+ }
+ else
{
- msg_Err( p_vout, "Vout EventThread failed" );
- goto error;
+ CloseVideo( VLC_OBJECT(p_vout) );
+ return VLC_EGENERIC;
}
-
- vlc_object_attach( p_vout->p_sys->p_event, p_vout );
-
- msg_Dbg( p_vout, "Vout EventThread running" );
-
- /* Variable to indicate if the window should be on top of others */
- /* Trigger a callback right now */
- var_TriggerCallback( p_vout, "video-on-top" );
-
- return VLC_SUCCESS;
-
- error:
- CloseVideo( VLC_OBJECT(p_vout) );
- return VLC_EGENERIC;
}
/*****************************************************************************
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
- if( p_vout->b_fullscreen )
- {
- msg_Dbg( p_vout, "Quitting fullscreen" );
- Win32ToggleFullscreen( p_vout );
- /* Force fullscreen in the core for the next video */
- var_SetBool( p_vout, "fullscreen", true );
- }
-
- if( p_vout->p_sys->p_event )
- {
- vlc_object_detach( p_vout->p_sys->p_event );
-
- /* Kill Vout EventThread */
- vlc_object_kill( p_vout->p_sys->p_event );
-
- /* we need to be sure Vout EventThread won't stay stuck in
- * GetMessage, so we send a fake message */
- if( p_vout->p_sys->hwnd )
- {
- PostMessage( p_vout->p_sys->hwnd, WM_NULL, 0, 0);
- }
-
- vlc_thread_join( p_vout->p_sys->p_event );
- vlc_object_release( p_vout->p_sys->p_event );
- }
-
- vlc_mutex_destroy( &p_vout->p_sys->lock );
+ StopEventThread( p_vout );
free( p_vout->p_sys );
p_vout->p_sys = NULL;
void* EventThread ( vlc_object_t *p_this );
void UpdateRects ( vout_thread_t *p_vout, bool b_force );
void Win32ToggleFullscreen ( vout_thread_t *p_vout );
+void DisableScreensaver ( vout_thread_t *p_vout );
+void RestoreScreensaver ( vout_thread_t *p_vout );
+int CreateEventThread( vout_thread_t *p_vout );
+void StopEventThread ( vout_thread_t *p_vout );
/*****************************************************************************
* Constants
p_vout->p_sys->i_window_width = p_vout->i_window_width;
p_vout->p_sys->i_window_height = p_vout->i_window_height;
- /* Create the EventThread, this thread is created by us to isolate
- * the Win32 PeekMessage function calls. We want to do this because
- * Windows can stay blocked inside this call for a long time, and when
- * this happens it thus blocks vlc's video_output thread.
- * Vout EventThread will take care of the creation of the video
- * window (because PeekMessage has to be called from the same thread which
- * created the window). */
- msg_Dbg( p_vout, "creating Vout EventThread" );
- p_vout->p_sys->p_event =
- vlc_object_create( p_vout, sizeof(event_thread_t) );
- p_vout->p_sys->p_event->p_vout = p_vout;
- p_vout->p_sys->p_event->window_ready = CreateEvent( NULL, TRUE, FALSE, NULL );
- if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
- EventThread, 0 ) )
+ if ( CreateEventThread( p_vout ) )
{
- msg_Err( p_vout, "cannot create Vout EventThread" );
- CloseHandle( p_vout->p_sys->p_event->window_ready );
- vlc_object_release( p_vout->p_sys->p_event );
- p_vout->p_sys->p_event = NULL;
- goto error;
- }
- WaitForSingleObject( p_vout->p_sys->p_event->window_ready, INFINITE );
- CloseHandle( p_vout->p_sys->p_event->window_ready );
-
- if( p_vout->p_sys->p_event->b_error )
- {
- msg_Err( p_vout, "Vout EventThread failed" );
- goto error;
- }
-
- vlc_object_attach( p_vout->p_sys->p_event, p_vout );
-
- msg_Dbg( p_vout, "Vout EventThread running" );
#ifndef UNDER_CE
- /* Variable to indicate if the window should be on top of others */
- /* Trigger a callback right now */
- var_TriggerCallback( p_vout, "video-on-top" );
-
- /* disable screensaver by temporarily changing system settings */
- p_vout->p_sys->i_spi_lowpowertimeout = 0;
- p_vout->p_sys->i_spi_powerofftimeout = 0;
- p_vout->p_sys->i_spi_screensavetimeout = 0;
- if( var_GetBool( p_vout, "disable-screensaver" ) ) {
- msg_Dbg(p_vout, "disabling screen saver");
- SystemParametersInfo(SPI_GETLOWPOWERTIMEOUT,
- 0, &(p_vout->p_sys->i_spi_lowpowertimeout), 0);
- if( 0 != p_vout->p_sys->i_spi_lowpowertimeout ) {
- SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT, 0, NULL, 0);
- }
- SystemParametersInfo(SPI_GETPOWEROFFTIMEOUT, 0,
- &(p_vout->p_sys->i_spi_powerofftimeout), 0);
- if( 0 != p_vout->p_sys->i_spi_powerofftimeout ) {
- SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT, 0, NULL, 0);
- }
- SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT, 0,
- &(p_vout->p_sys->i_spi_screensavetimeout), 0);
- if( 0 != p_vout->p_sys->i_spi_screensavetimeout ) {
- SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, 0, NULL, 0);
- }
- }
-#endif
- return VLC_SUCCESS;
+ /* Variable to indicate if the window should be on top of others */
+ /* Trigger a callback right now */
+ var_TriggerCallback( p_vout, "video-on-top" );
-error:
- CloseVideo( VLC_OBJECT(p_vout) );
- return VLC_EGENERIC;
+ DisableScreensaver ( p_vout );
+#endif
+ return VLC_SUCCESS;
+ }
+ else
+ {
+ CloseVideo( VLC_OBJECT(p_vout) );
+ return VLC_EGENERIC;
+ }
}
/*****************************************************************************
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
- if( p_vout->b_fullscreen )
- {
- msg_Dbg( p_vout, "Quitting fullscreen" );
- Win32ToggleFullscreen( p_vout );
- /* Force fullscreen in the core for the next video */
- var_SetBool( p_vout, "fullscreen", true );
- }
-
- if( p_vout->p_sys->p_event )
- {
- vlc_object_detach( p_vout->p_sys->p_event );
-
- /* Kill Vout EventThread */
- vlc_object_kill( p_vout->p_sys->p_event );
-
- /* we need to be sure Vout EventThread won't stay stuck in
- * GetMessage, so we send a fake message */
- if( p_vout->p_sys->hwnd )
- {
- PostMessage( p_vout->p_sys->hwnd, WM_NULL, 0, 0);
- }
-
- vlc_thread_join( p_vout->p_sys->p_event );
- vlc_object_release( p_vout->p_sys->p_event );
- }
- vlc_mutex_destroy( &p_vout->p_sys->lock );
+ StopEventThread( p_vout );
#ifndef UNDER_CE
- /* restore screensaver system settings */
- if( 0 != p_vout->p_sys->i_spi_lowpowertimeout ) {
- SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT,
- p_vout->p_sys->i_spi_lowpowertimeout, NULL, 0);
- }
- if( 0 != p_vout->p_sys->i_spi_powerofftimeout ) {
- SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT,
- p_vout->p_sys->i_spi_powerofftimeout, NULL, 0);
- }
- if( 0 != p_vout->p_sys->i_spi_screensavetimeout ) {
- SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,
- p_vout->p_sys->i_spi_screensavetimeout, NULL, 0);
- }
+ RestoreScreensaver( p_vout );
#endif
#ifdef MODULE_NAME_IS_wingapi
switch( p_vout->p_sys->i_depth )
{
case 8:
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->output.pf_setpalette = SetPalette;
break;
case 15:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+ p_vout->output.i_chroma = VLC_CODEC_RGB15;
p_vout->output.i_rmask = 0x7c00;
p_vout->output.i_gmask = 0x03e0;
p_vout->output.i_bmask = 0x001f;
break;
case 16:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+ p_vout->output.i_chroma = VLC_CODEC_RGB16;
p_vout->output.i_rmask = 0xf800;
p_vout->output.i_gmask = 0x07e0;
p_vout->output.i_bmask = 0x001f;
break;
case 24:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
+ p_vout->output.i_chroma = VLC_CODEC_RGB24;
p_vout->output.i_rmask = 0x00ff0000;
p_vout->output.i_gmask = 0x0000ff00;
p_vout->output.i_bmask = 0x000000ff;
break;
case 32:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
p_vout->output.i_rmask = 0x00ff0000;
p_vout->output.i_gmask = 0x0000ff00;
p_vout->output.i_bmask = 0x000000ff;
vout_thread_t *p_vout = (vout_thread_t *)p_this;
vout_sys_t *p_sys;
- if( p_vout->fmt_in.i_chroma != VLC_FOURCC('I','4','2','0') &&
- p_vout->fmt_in.i_chroma != VLC_FOURCC('I','Y','U','V') &&
- p_vout->fmt_in.i_chroma != VLC_FOURCC('Y','V','1','2') )
+ if( p_vout->fmt_in.i_chroma != VLC_CODEC_I420 &&
+ p_vout->fmt_in.i_chroma != VLC_CODEC_YV12 )
return VLC_EGENERIC;
/* Allocate instance and initialize some members */
}
p_vout->output.i_chroma =
- p_vout->fmt_out.i_chroma = VLC_FOURCC( 'Y','4','2','0' );
+ p_vout->fmt_out.i_chroma = VLC_CODEC_I420;
p_sys->i_color_format = OMAPFB_COLOR_YUV420;
// place in the framebuffer where we have to write
/* TODO: We use YCbCr on Mac which is Y422, but on OSX it seems to == YUY2. Verify */
#if ( defined( WORDS_BIGENDIAN ) && VLCGL_FORMAT == GL_YCBCR_422_APPLE ) || (VLCGL_FORMAT == YCBCR_MESA)
- p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
+ p_vout->output.i_chroma = VLC_CODEC_YUYV;
i_pixel_pitch = 2;
#elif (VLCGL_FORMAT == GL_YCBCR_422_APPLE)
- p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y');
+ p_vout->output.i_chroma = VLC_CODEC_UYVY;
i_pixel_pitch = 2;
#elif VLCGL_FORMAT == GL_RGB
# if VLCGL_TYPE == GL_UNSIGNED_BYTE
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
+ p_vout->output.i_chroma = VLC_CODEC_RGB24;
# if defined( WORDS_BIGENDIAN )
p_vout->output.i_rmask = 0x00ff0000;
p_vout->output.i_gmask = 0x0000ff00;
# endif
i_pixel_pitch = 3;
# else
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+ p_vout->output.i_chroma = VLC_CODEC_RGB16;
# if defined( WORDS_BIGENDIAN )
p_vout->output.i_rmask = 0x001f;
p_vout->output.i_gmask = 0x07e0;
i_pixel_pitch = 2;
# endif
#else
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
# if defined( WORDS_BIGENDIAN )
p_vout->output.i_rmask = 0xff000000;
p_vout->output.i_gmask = 0x00ff0000;
vlc_value_t val;
#if ( defined( WORDS_BIGENDIAN ) && VLCGL_FORMAT == GL_YCBCR_422_APPLE ) || (VLCGL_FORMAT == YCBCR_MESA)
- p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
+ p_vout->output.i_chroma = VLC_CODEC_YUYV;
i_pixel_pitch = 2;
#elif (VLCGL_FORMAT == GL_YCBCR_422_APPLE)
- p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y');
+ p_vout->output.i_chroma = VLC_CODEC_UYVY;
i_pixel_pitch = 2;
#endif
I_OUTPUTPICTURES = 0;
- p_vout->output.i_chroma = (dd == 16) ? VLC_FOURCC('R','V','1','6'): VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = (dd == 16) ? VLC_CODEC_RGB16 : VLC_CODEC_RGB32;
p_vout->output.i_rmask = 0xf800;
p_vout->output.i_gmask = 0x07e0;
p_vout->output.i_bmask = 0x001f;
/* SDL fucked up fourcc definitions on bigendian machines */
uint32_t i_sdl_chroma;
char *psz_chroma = NULL;
- uint32_t i_chroma = 0;
+ vlc_fourcc_t i_chroma = 0;
bool b_overlay = config_GetInt( p_vout, "overlay" );
if( ( psz_chroma = config_GetPsz( p_vout, "sdl-chroma" ) ) )
{
- if( strlen( psz_chroma ) >= 4 )
+ i_chroma = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_chroma );
+ if( i_chroma )
{
- memcpy(&i_chroma, psz_chroma, 4);
msg_Dbg( p_vout, "Forcing chroma to 0x%.8x (%4.4s)", i_chroma, (char*)&i_chroma );
}
else
if( !psz_chroma ) i_chroma = 0;
switch( i_chroma ? i_chroma : p_vout->render.i_chroma )
{
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('Y','U','N','V'):
- p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
+ case VLC_CODEC_YUYV:
+ p_vout->output.i_chroma = VLC_CODEC_YUYV;
i_sdl_chroma = SDL_YUY2_OVERLAY;
break;
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('U','Y','N','V'):
- case VLC_FOURCC('Y','4','2','2'):
- p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y');
+ case VLC_CODEC_UYVY:
+ p_vout->output.i_chroma = VLC_CODEC_UYVY;
i_sdl_chroma = SDL_UYVY_OVERLAY;
break;
- case VLC_FOURCC('Y','V','Y','U'):
- p_vout->output.i_chroma = VLC_FOURCC('Y','V','Y','U');
+ case VLC_CODEC_YVYU:
+ p_vout->output.i_chroma = VLC_CODEC_YVYU;
i_sdl_chroma = SDL_YVYU_OVERLAY;
break;
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I420:
default:
- p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2');
+ p_vout->output.i_chroma = VLC_CODEC_YV12;
i_sdl_chroma = SDL_YV12_OVERLAY;
break;
}
/* If this best choice failed, fall back to other chromas */
if( p_vout->p_sys->p_overlay == NULL )
{
- p_vout->output.i_chroma = VLC_FOURCC('I','Y','U','V');
+ p_vout->output.i_chroma = VLC_CODEC_I420;
p_vout->p_sys->p_overlay =
SDL_CreateYUVOverlay( 32, 32, SDL_IYUV_OVERLAY,
p_vout->p_sys->p_display );
if( p_vout->p_sys->p_overlay == NULL )
{
- p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2');
+ p_vout->output.i_chroma = VLC_CODEC_YV12;
p_vout->p_sys->p_overlay =
SDL_CreateYUVOverlay( 32, 32, SDL_YV12_OVERLAY,
p_vout->p_sys->p_display );
if( p_vout->p_sys->p_overlay == NULL )
{
- p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
+ p_vout->output.i_chroma = VLC_CODEC_YUYV;
p_vout->p_sys->p_overlay =
SDL_CreateYUVOverlay( 32, 32, SDL_YUY2_OVERLAY,
p_vout->p_sys->p_display );
switch( p_vout->p_sys->p_display->format->BitsPerPixel )
{
case 8:
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->output.pf_setpalette = SetPalette;
break;
case 15:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+ p_vout->output.i_chroma = VLC_CODEC_RGB15;
break;
case 16:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+ p_vout->output.i_chroma = VLC_CODEC_RGB16;
break;
case 24:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
+ p_vout->output.i_chroma = VLC_CODEC_RGB24;
break;
case 32:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
break;
default:
msg_Err( p_vout, "unknown screen depth %i",
picture_t *p_pic;
vlc_value_t val;
char* psz_chroma;
- int i_chroma;
+ vlc_fourcc_t i_chroma;
int i_width;
int i_height;
int i_datasize;
i_height = config_GetInt( p_vout, "snapshot-height" );
psz_chroma = config_GetPsz( p_vout, "snapshot-chroma" );
- if( psz_chroma )
+ if( !psz_chroma )
{
- if( strlen( psz_chroma ) < 4 )
- {
- msg_Err( p_vout, "snapshot-chroma should be 4 characters long" );
- return VLC_EGENERIC;
- }
- i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1],
- psz_chroma[2], psz_chroma[3] );
- free( psz_chroma );
+ msg_Err( p_vout, "Cannot find chroma information." );
+ return VLC_EGENERIC;
}
- else
+
+ i_chroma = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_chroma );
+ free( psz_chroma );
+
+ if( !i_chroma )
{
- msg_Err( p_vout, "Cannot find chroma information." );
+ msg_Err( p_vout, "snapshot-chroma should be 4 characters long" );
return VLC_EGENERIC;
}
/* Define the bitmasks */
switch( i_chroma )
{
- case VLC_FOURCC( 'R','V','1','5' ):
+ case VLC_CODEC_RGB15:
p_vout->output.i_rmask = 0x001f;
p_vout->output.i_gmask = 0x03e0;
p_vout->output.i_bmask = 0x7c00;
break;
- case VLC_FOURCC( 'R','V','1','6' ):
+ case VLC_CODEC_RGB16:
p_vout->output.i_rmask = 0x001f;
p_vout->output.i_gmask = 0x07e0;
p_vout->output.i_bmask = 0xf800;
break;
- case VLC_FOURCC( 'R','V','2','4' ):
+ case VLC_CODEC_RGB24:
p_vout->output.i_rmask = 0xff0000;
p_vout->output.i_gmask = 0x00ff00;
p_vout->output.i_bmask = 0x0000ff;
break;
- case VLC_FOURCC( 'R','V','3','2' ):
+ case VLC_CODEC_RGB32:
p_vout->output.i_rmask = 0xff0000;
p_vout->output.i_gmask = 0x00ff00;
p_vout->output.i_bmask = 0x0000ff;
/* Initialize the output structure: RGB with square pixels, whatever
* the input format is, since it's the only format we know */
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->output.pf_setpalette = SetPalette;
p_vout->output.i_width = vga_getxdim();
p_vout->output.i_height = vga_getydim();
int i_index;
picture_t *p_pic;
char *psz_chroma, *psz_tmp;
- int i_width, i_height, i_pitch, i_chroma;
+ int i_width, i_height, i_pitch;
+ vlc_fourcc_t i_chroma;
i_width = var_CreateGetInteger( p_vout, "vmem-width" );
i_height = var_CreateGetInteger( p_vout, "vmem-height" );
i_pitch = var_CreateGetInteger( p_vout, "vmem-pitch" );
psz_chroma = var_CreateGetString( p_vout, "vmem-chroma" );
- if( psz_chroma )
+ if( !psz_chroma )
{
- if( strlen( psz_chroma ) < 4 )
- {
- msg_Err( p_vout, "vmem-chroma should be 4 characters long" );
- free( psz_chroma );
- return VLC_EGENERIC;
- }
- i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1],
- psz_chroma[2], psz_chroma[3] );
- free( psz_chroma );
+ msg_Err( p_vout, "Cannot find chroma information." );
+ return VLC_EGENERIC;
}
- else
+
+ i_chroma = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_chroma );
+ free( psz_chroma );
+
+ if( !i_chroma )
{
- msg_Err( p_vout, "Cannot find chroma information." );
+ msg_Err( p_vout, "vmem-chroma should be 4 characters long" );
return VLC_EGENERIC;
}
/* Define the bitmasks */
switch( i_chroma )
{
- case VLC_FOURCC( 'R','V','1','5' ):
+ case VLC_CODEC_RGB15:
p_vout->output.i_rmask = 0x001f;
p_vout->output.i_gmask = 0x03e0;
p_vout->output.i_bmask = 0x7c00;
break;
- case VLC_FOURCC( 'R','V','1','6' ):
+ case VLC_CODEC_RGB16:
p_vout->output.i_rmask = 0x001f;
p_vout->output.i_gmask = 0x07e0;
p_vout->output.i_bmask = 0xf800;
break;
- case VLC_FOURCC( 'R','V','2','4' ):
+ case VLC_CODEC_RGB24:
p_vout->output.i_rmask = 0xff0000;
p_vout->output.i_gmask = 0x00ff00;
p_vout->output.i_bmask = 0x0000ff;
break;
- case VLC_FOURCC( 'R','V','3','2' ):
+ case VLC_CODEC_RGB32:
p_vout->output.i_rmask = 0xff0000;
p_vout->output.i_gmask = 0x00ff00;
p_vout->output.i_bmask = 0x0000ff;
return VLC_SUCCESS;
}
- vout_InitPicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
- p_vout->output.i_width, p_vout->output.i_height,
- p_vout->output.i_aspect );
+ if( picture_Setup( p_pic, p_vout->output.i_chroma,
+ p_vout->output.i_width, p_vout->output.i_height,
+ p_vout->output.i_aspect ) )
+ {
+ free( p_pic );
+ return VLC_EGENERIC;
+ }
p_pic->p->i_pitch = i_pitch;
}
}
}
- p_vout->output.i_chroma = X112VLC_FOURCC(p_vout->output.i_chroma);
+ p_vout->output.i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, X112VLC_FOURCC(p_vout->output.i_chroma) );
#elif defined(MODULE_NAME_IS_glx)
{
int i_opcode, i_evt, i_err = 0;
#if XvVersion < 2 || ( XvVersion == 2 && XvRevision < 2 )
switch( p_vout->output.i_chroma )
{
- case VLC_FOURCC('R','V','1','6'):
+ case VLC_CODEC_RGB16:
#if defined( WORDS_BIGENDIAN )
p_vout->output.i_rmask = 0xf800;
p_vout->output.i_gmask = 0x07e0;
p_vout->output.i_bmask = 0xf800;
#endif
break;
- case VLC_FOURCC('R','V','1','5'):
+ case VLC_CODEC_RGB15:
#if defined( WORDS_BIGENDIAN )
p_vout->output.i_rmask = 0x7c00;
p_vout->output.i_gmask = 0x03e0;
switch( p_vout->p_sys->i_screen_depth )
{
case 8: /* FIXME: set the palette */
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB8; break;
case 15:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB15; break;
case 16:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB16; break;
case 24:
case 32:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB32; break;
default:
msg_Err( p_vout, "unknown screen depth %i",
p_vout->p_sys->i_screen_depth );
I_OUTPUTPICTURES++;
}
- if( p_vout->output.i_chroma == VLC_FOURCC('Y','V','1','2') )
+ if( p_vout->output.i_chroma == VLC_CODEC_YV12 )
{
/* U and V inverted compared to I420
* Fixme: this should be handled by the vout core */
- p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0');
- p_vout->fmt_out.i_chroma = VLC_FOURCC('I','4','2','0');
+ p_vout->output.i_chroma = VLC_CODEC_I420;
+ p_vout->fmt_out.i_chroma = VLC_CODEC_I420;
}
return VLC_SUCCESS;
{
p_win->owner_window = vout_RequestXWindow( p_vout, &p_win->i_x,
&p_win->i_y, &p_win->i_width, &p_win->i_height );
+ if( !p_win->owner_window )
+ return VLC_EGENERIC;
xsize_hints.base_width = xsize_hints.width = p_win->i_width;
xsize_hints.base_height = xsize_hints.height = p_win->i_height;
xsize_hints.flags = PSize | PMinSize;
xsize_hints.y = p_win->i_y;
xsize_hints.flags |= PPosition;
}
+
+ /* Select events we are interested in. */
+ XSelectInput( p_vout->p_sys->p_display,
+ p_win->owner_window->handle.xid, StructureNotifyMask );
+
+ /* Get the parent window's geometry information */
+ XGetGeometry( p_vout->p_sys->p_display,
+ p_win->owner_window->handle.xid,
+ &(Window){ 0 }, &(int){ 0 }, &(int){ 0 },
+ &p_win->i_width,
+ &p_win->i_height,
+ &(unsigned){ 0 }, &(unsigned){ 0 } );
+
+ /* From man XSelectInput: only one client at a time can select a
+ * ButtonPress event, so we need to open a new window anyway. */
+ p_win->base_window =
+ XCreateWindow( p_vout->p_sys->p_display,
+ p_win->owner_window->handle.xid,
+ 0, 0,
+ p_win->i_width, p_win->i_height,
+ 0,
+ 0, CopyFromParent, 0,
+ CWBackingStore | CWBackPixel | CWEventMask,
+ &xwindow_attributes );
}
else
{
DisplayWidth( p_vout->p_sys->p_display, p_vout->p_sys->i_screen );
p_win->i_height =
DisplayHeight( p_vout->p_sys->p_display, p_vout->p_sys->i_screen );
- }
- if( !p_win->owner_window )
- {
/* Create the window and set hints - the window must receive
* ConfigureNotify events, and until it is displayed, Expose and
* MapNotify events. */
p_win->base_window, val.psz_string );
}
free( val.psz_string );
-
- if( !p_vout->b_fullscreen )
- {
- const char *argv[] = { "vlc", NULL };
-
- /* Set window manager hints and properties: size hints, command,
- * window's name, and accepted protocols */
- XSetWMNormalHints( p_vout->p_sys->p_display,
- p_win->base_window, &xsize_hints );
- XSetCommand( p_vout->p_sys->p_display, p_win->base_window,
- (char**)argv, 1 );
-
- if( !var_GetBool( p_vout, "video-deco") )
- {
- Atom prop;
- mwmhints_t mwmhints;
-
- mwmhints.flags = MWM_HINTS_DECORATIONS;
- mwmhints.decorations = False;
-
- prop = XInternAtom( p_vout->p_sys->p_display, "_MOTIF_WM_HINTS",
- False );
-
- XChangeProperty( p_vout->p_sys->p_display,
- p_win->base_window,
- prop, prop, 32, PropModeReplace,
- (unsigned char *)&mwmhints,
- PROP_MWM_HINTS_ELEMENTS );
- }
- }
- }
- else
- {
- Window dummy1;
- int dummy2, dummy3;
- unsigned int dummy4, dummy5;
-
- /* Select events we are interested in. */
- XSelectInput( p_vout->p_sys->p_display,
- p_win->owner_window->handle.xid, StructureNotifyMask );
-
- /* Get the parent window's geometry information */
- XGetGeometry( p_vout->p_sys->p_display,
- p_win->owner_window->handle.xid,
- &dummy1, &dummy2, &dummy3,
- &p_win->i_width,
- &p_win->i_height,
- &dummy4, &dummy5 );
-
- /* From man XSelectInput: only one client at a time can select a
- * ButtonPress event, so we need to open a new window anyway. */
- p_win->base_window =
- XCreateWindow( p_vout->p_sys->p_display,
- p_win->owner_window->handle.xid,
- 0, 0,
- p_win->i_width, p_win->i_height,
- 0,
- 0, CopyFromParent, 0,
- CWBackingStore | CWBackPixel | CWEventMask,
- &xwindow_attributes );
}
if( (p_win->wm_protocols == None) /* use WM_DELETE_WINDOW */
#endif
/* Fill in picture_t fields */
- vout_InitPicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
- p_vout->output.i_width, p_vout->output.i_height,
- p_vout->output.i_aspect );
+ if( picture_Setup( p_pic, p_vout->output.i_chroma,
+ p_vout->output.i_width, p_vout->output.i_height,
+ p_vout->output.i_aspect ) )
+ return -1;
#ifdef HAVE_SYS_SHM_H
if( p_vout->p_sys->i_shm_opcode )
switch( p_vout->output.i_chroma )
{
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc)
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('Y','2','1','1'):
- case VLC_FOURCC('Y','U','Y','2'):
- case VLC_FOURCC('U','Y','V','Y'):
- case VLC_FOURCC('R','V','1','5'):
- case VLC_FOURCC('R','V','1','6'):
- case VLC_FOURCC('R','V','2','4'): /* Fixme: pixel pitch == 4 ? */
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_I420:
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_Y211:
+ case VLC_CODEC_YUYV:
+ case VLC_CODEC_UYVY:
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB16:
+ case VLC_CODEC_RGB24: /* Fixme: pixel pitch == 4 ? */
+ case VLC_CODEC_RGB32:
for( i_plane = 0; i_plane < p_pic->p_sys->p_image->num_planes;
i_plane++ )
p_pic->p[i_plane].i_pitch =
p_pic->p_sys->p_image->pitches[i_plane];
}
- if( p_vout->output.i_chroma == VLC_FOURCC('Y','V','1','2') )
+ if( p_vout->output.i_chroma == VLC_CODEC_YV12 )
{
/* U and V inverted compared to I420
* Fixme: this should be handled by the vout core */
break;
#else
- case VLC_FOURCC('R','G','B','2'):
- case VLC_FOURCC('R','V','1','6'):
- case VLC_FOURCC('R','V','1','5'):
- case VLC_FOURCC('R','V','2','4'):
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB8:
+ case VLC_CODEC_RGB16:
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB24:
+ case VLC_CODEC_RGB32:
p_pic->p->i_lines = p_pic->p_sys->p_image->height;
p_pic->p->i_visible_lines = p_pic->p_sys->p_image->height;
p_pic->p->i_pitch = p_pic->p_sys->p_image->bytes_per_line;
/* p_pic->p->i_pixel_pitch = 4 for RV24 but this should be set
- * properly by vout_InitPicture() */
+ * properly by picture_Setup() */
p_pic->p->i_visible_pitch = p_pic->p->i_pixel_pitch
* p_pic->p_sys->p_image->width;
break;
{
case 24:
if (fmt->bits_per_pixel == 32)
- chroma = VLC_FOURCC ('R', 'V', '3', '2');
+ chroma = VLC_CODEC_RGB32;
else if (fmt->bits_per_pixel == 24)
- chroma = VLC_FOURCC ('R', 'V', '2', '4');
+ chroma = VLC_CODEC_RGB24;
else
continue;
break;
case 16:
if (fmt->bits_per_pixel != 16)
continue;
- chroma = VLC_FOURCC ('R', 'V', '1', '6');
+ chroma = VLC_CODEC_RGB16;
break;
case 15:
if (fmt->bits_per_pixel != 16)
continue;
- chroma = VLC_FOURCC ('R', 'V', '1', '5');
+ chroma = VLC_CODEC_RGB15;
break;
case 8:
if (fmt->bits_per_pixel != 8)
continue;
- chroma = VLC_FOURCC ('R', 'G', 'B', '2');
+ chroma = VLC_CODEC_RGB8;
break;
default:
continue;
if (!gray)
continue; /* Prefer color over gray scale */
vid = vt->visual_id;
- chroma = VLC_FOURCC ('G', 'R', 'E', 'Y');
+ chroma = VLC_CODEC_GREY;
}
}
if (pic->i_status != FREE_PICTURE)
continue;
- vout_InitPicture (vout, pic, vout->output.i_chroma,
- vout->output.i_width, vout->output.i_height,
- vout->output.i_aspect);
+ picture_Setup (pic, vout->output.i_chroma,
+ vout->output.i_width, vout->output.i_height,
+ vout->output.i_aspect);
if (PictureAlloc (vout, pic, pic->p->i_pitch * pic->p->i_lines,
p_sys->shm ? p_sys->conn : NULL))
break;
{
case 32:
if (f->depth == 24)
- return VLC_FOURCC ('R', 'V', '3', '2');
+ return VLC_CODEC_RGB32;
break;
case 24:
if (f->depth == 24)
- return VLC_FOURCC ('R', 'V', '2', '4');
+ return VLC_CODEC_RGB24;
break;
case 16:
if (f->depth == 16)
- return VLC_FOURCC ('R', 'V', '1', '6');
+ return VLC_CODEC_RGB16;
if (f->depth == 15)
- return VLC_FOURCC ('R', 'V', '1', '5');
+ return VLC_CODEC_RGB15;
break;
case 8:
if (f->depth == 8)
- return VLC_FOURCC ('R', 'G', 'B', '2');
+ return VLC_CODEC_RGB8;
break;
}
break;
{
/*untested: case 24:
if (f->vhorz_u_period == 1 && f->vvert_u_period == 1)
- return VLC_FOURCC ('I', '4', '4', '4');
+ return VLC_CODEC_I444;
break;*/
case 16:
if (f->vhorz_u_period == 2 && f->vvert_u_period == 1)
{
if (!strcmp ((const char *)f->vcomp_order, "YUYV"))
- return VLC_FOURCC ('Y', 'U', 'Y', '2');
+ return VLC_CODEC_YUYV;
if (!strcmp ((const char *)f->vcomp_order, "UYVY"))
- return VLC_FOURCC ('U', 'Y', 'V', 'Y');
+ return VLC_CODEC_UYVY;
}
break;
}
if (f->vhorz_u_period == 2 && f->vvert_u_period == 2)
{
if (!strcmp ((const char *)f->vcomp_order, "YVU"))
- return VLC_FOURCC ('Y', 'V', '1', '2');
+ return VLC_CODEC_YV12;
if (!strcmp ((const char *)f->vcomp_order, "YUV"))
- return VLC_FOURCC ('I', '4', '2', '0');
+ return VLC_CODEC_I420;
}
}
break;
/* Video chroma in preference order */
const vlc_fourcc_t chromas[] = {
vout->fmt_in.i_chroma,
- VLC_FOURCC ('Y', 'U', 'Y', '2'),
- VLC_FOURCC ('R', 'V', '2', '4'),
- VLC_FOURCC ('R', 'V', '1', '5'),
+ VLC_CODEC_YUYV,
+ VLC_CODEC_RGB24,
+ VLC_CODEC_RGB15,
};
for (size_t i = 0; i < sizeof (chromas) / sizeof (chromas[0]); i++)
{
if (pic->i_status != FREE_PICTURE)
continue;
- vout_InitPicture (vout, pic, vout->output.i_chroma,
- att->width, att->height,
- vout->fmt_in.i_aspect);
+ picture_Setup (pic, vout->output.i_chroma,
+ att->width, att->height,
+ vout->fmt_in.i_aspect);
if (PictureAlloc (vout, pic, att->data_size,
p_sys->shm ? p_sys->conn : NULL))
break;
p_sys->p_fd = NULL;
p_sys->b_yuv4mpeg2 = var_CreateGetBool( p_this, CFG_PREFIX "yuv4mpeg2" );
- p_sys->i_chroma = VLC_FOURCC('I','4','2','0');
+ p_sys->i_chroma = VLC_CODEC_I420;
p_sys->psz_file =
var_CreateGetString( p_this, CFG_PREFIX "file" );
}
psz_fcc = var_CreateGetNonEmptyString( p_this, CFG_PREFIX "chroma" );
- if( psz_fcc && (strlen( psz_fcc ) == 4) )
- {
- p_sys->i_chroma = VLC_FOURCC( psz_fcc[0], psz_fcc[1],
- psz_fcc[2], psz_fcc[3] );
- }
+ const vlc_fourcc_t i_requested_chroma =
+ vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_fcc );
+ if( i_requested_chroma )
+ p_sys->i_chroma = i_requested_chroma;
free( psz_fcc );
if( p_sys->b_yuv4mpeg2 )
{
switch( p_sys->i_chroma )
{
- case VLC_FOURCC('Y','V','1','2'):
- case VLC_FOURCC('I','4','2','0'):
- case VLC_FOURCC('I','Y','U','V'):
- case VLC_FOURCC('J','4','2','0'):
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I420:
+ case VLC_CODEC_J420:
break;
default:
msg_Err( p_this,
aout_filter_sys_t *p_sys;
galaktos_thread_t *p_thread;
- if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' )
- || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+ p_filter->output.i_format != VLC_CODEC_FL32 )
{
msg_Warn( p_filter, "bad input or output format" );
return VLC_EGENERIC;
vlc_object_attach( p_thread->p_opengl, p_this );
/* Initialize vout parameters */
- vout_InitFormat( &p_thread->p_opengl->fmt_in,
- VLC_FOURCC('R','V','3','2'),
- p_thread->i_width, p_thread->i_height, 1 );
+ video_format_Setup( &p_thread->p_opengl->fmt_in,
+ VLC_CODEC_RGB32, p_thread->i_width, p_thread->i_height, 1 );
p_thread->p_opengl->i_window_width = p_thread->i_width;
p_thread->p_opengl->i_window_height = p_thread->i_height;
p_thread->p_opengl->render.i_width = p_thread->i_width;
video_format_t fmt;
- if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' )
- || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+ if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+ p_filter->output.i_format != VLC_CODEC_FL32 )
{
msg_Warn( p_filter, "bad input or output format" );
return VLC_EGENERIC;
}
- if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
+ if( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
msg_Warn( p_filter, "input and output formats are not similar" );
return VLC_EGENERIC;
fmt.i_width = fmt.i_visible_width = width;
fmt.i_height = fmt.i_visible_height = height;
- fmt.i_chroma = VLC_FOURCC('R','V','3','2');
+ fmt.i_chroma = VLC_CODEC_RGB32;
fmt.i_aspect = VOUT_ASPECT_FACTOR * width/height;
fmt.i_sar_num = fmt.i_sar_den = 1;
char *psz_effects, *psz_parser;
video_format_t fmt;
- if( ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2') &&
- p_filter->input.i_format != VLC_FOURCC('f','i','3','2') ) )
+ if( ( p_filter->input.i_format != VLC_CODEC_FL32 &&
+ p_filter->input.i_format != VLC_CODEC_FI32 ) )
{
return VLC_EGENERIC;
}
fmt.i_width = fmt.i_visible_width = p_sys->i_width;
fmt.i_height = fmt.i_visible_height = p_sys->i_height;
- fmt.i_chroma = VLC_FOURCC('I','4','2','0');
+ fmt.i_chroma = VLC_CODEC_I420;
fmt.i_aspect = VOUT_ASPECT_FACTOR * p_sys->i_width/p_sys->i_height;
fmt.i_sar_num = fmt.i_sar_den = 1;
if( FAILED(result) )
return result;
- /* set internal video width and height */
- libvlc_video_set_size(p_libvlc,
- lprcPosRect->right-lprcPosRect->left,
- lprcPosRect->bottom-lprcPosRect->top,
- NULL );
-
- /* set internal video parent window */
- libvlc_video_set_parent(p_libvlc,
- reinterpret_cast<libvlc_drawable_t>(_inplacewnd), NULL);
-
if( _b_autoplay && playlist_select(0,NULL) )
{
libvlc_media_player_play(_p_mplayer,NULL);
SetWindowRgn(_inplacewnd, clipRgn, FALSE);
//RedrawWindow(_videownd, &posRect, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN);
- if( isRunning() )
- {
- libvlc_video_set_size(_p_libvlc,
- lprcPosRect->right-lprcPosRect->left,
- lprcPosRect->bottom-lprcPosRect->top,
- NULL );
- }
};
void VLCPlugin::freezeEvents(BOOL freeze)
return item;
}
-
-
* Copyright (C) 2002-2009 the VideoLAN team
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
- * Jan Paul Dinger <jpd@m2x.nl>
+ * JP Dinger <jpd@m2x.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
OBJECT_TO_NPVARIANT(NPN_RetainObject(videoObj), result);
return INVOKERESULT_NO_ERROR;
case ID_root_VersionInfo:
- {
- const char *s = libvlc_get_version();
- int len = strlen(s);
- NPUTF8 *retval =(NPUTF8*)NPN_MemAlloc(len);
- if( !retval )
- return INVOKERESULT_OUT_OF_MEMORY;
-
- memcpy(retval, s, len);
- STRINGN_TO_NPVARIANT(retval, len, result);
- return INVOKERESULT_NO_ERROR;
- }
+ return invokeResultString(libvlc_get_version(),result);
default:
;
}
switch( index )
{
case ID_root_versionInfo:
- if( argCount == 0 )
- {
- const char *s = libvlc_get_version();
- int len = strlen(s);
- NPUTF8 *retval =(NPUTF8*)NPN_MemAlloc(len);
- if( !retval )
- return INVOKERESULT_OUT_OF_MEMORY;
- memcpy(retval, s, len);
- STRINGN_TO_NPVARIANT(retval, len, result);
- return INVOKERESULT_NO_ERROR;
- }
- return INVOKERESULT_NO_SUCH_METHOD;
+ if( 0 != argCount )
+ return INVOKERESULT_NO_SUCH_METHOD;
+ return invokeResultString(libvlc_get_version(),result);
default:
;
}
LibvlcPlaylistNPObject::~LibvlcPlaylistNPObject()
{
- if( isValid() )
- {
- if( playlistItemsObj ) NPN_ReleaseObject(playlistItemsObj);
- }
+ // Why the isValid()?
+ if( isValid() && playlistItemsObj )
+ NPN_ReleaseObject(playlistItemsObj);
};
const NPUTF8 * const LibvlcPlaylistNPObject::propertyNames[] =
}
}
- int item = p_plugin->playlist_add_extended_untrusted(url, name, i_options,
- const_cast<const char **>(ppsz_options), &ex);
+ int item = p_plugin->playlist_add_extended_untrusted(url, name,
+ i_options, const_cast<const char **>(ppsz_options), &ex);
free(url);
free(name);
for( int i=0; i< i_options; ++i )
}
return false;
}
+
+RuntimeNPObject::InvokeResult
+RuntimeNPObject::invokeResultString(const char *psz, NPVariant &result)
+{
+ if( !psz )
+ NULL_TO_NPVARIANT(result);
+ else
+ {
+ size_t len = strlen(psz);
+ NPUTF8* retval = (NPUTF8*)NPN_MemAlloc(len);
+ if( !retval )
+ return INVOKERESULT_OUT_OF_MEMORY;
+ else
+ {
+ memcpy(retval, psz, len);
+ STRINGN_TO_NPVARIANT(retval, len, result);
+ }
+ }
+ return INVOKERESULT_NO_ERROR;
+}
+
bool returnInvokeResult(InvokeResult result);
+ static InvokeResult invokeResultString(const char *,NPVariant &);
+
bool isPluginRunning()
{
return _instance->pdata;
function onEnd()\r
{\r
document.getElementById("state").innerHTML = "End...";\r
+ doStop();\r
}\r
\r
var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))");\r
/* 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")
}
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]);
libvlc_exception_init(&ex);
libvlc_instance = libvlc_new(ppsz_argc, ppsz_argv, &ex);
-
if( libvlc_exception_raised(&ex) )
{
libvlc_exception_clear(&ex);
if( href )
{
/* prepend base URL */
- strcpy(href, psz_baseURL);
+ memcpy(href, psz_baseURL, baseLen+1);
/*
** relative url could be empty,
/* skip over protocol part */
char *pathstart = strchr(href, ':');
- char *pathend;
+ char *pathend = href+baseLen;
if( pathstart )
{
if( '/' == *(++pathstart) )
}
/* skip over host part */
pathstart = strchr(pathstart, '/');
- pathend = href+baseLen;
if( ! pathstart )
{
// no path, add a / past end of url (over '\0')
return NULL;
}
pathstart = href;
- pathend = href+baseLen;
}
/* relative URL made of an absolute path ? */
return false;
}
- VlcPlugin *p_plugin = (VlcPlugin*)instance->pdata;
-
+ VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
if( p_plugin == NULL )
{
return false;
{
/* 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;
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 */
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 */
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);
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 */
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 );
}
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 */
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;
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;
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;
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;
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;
( ((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 );
}
}
../include/vlc_es_out.h \
../include/vlc_events.h \
../include/vlc_filter.h \
+ ../include/vlc_fourcc.h \
../include/vlc_gcrypt.h \
../include/vlc_httpd.h \
../include/vlc_image.h \
../include/vlc_modules.h \
../include/vlc_mtime.h \
../include/vlc_objects.h \
+ ../include/vlc_picture.h \
../include/vlc_playlist.h \
../include/vlc_plugin.h \
../include/vlc_rand.h \
../include/vlc_sout.h \
../include/vlc_stream.h \
../include/vlc_strings.h \
+ ../include/vlc_subpicture.h \
../include/vlc_threads.h \
../include/vlc_url.h \
../include/vlc_variables.h \
libvlccore_la_LDFLAGS = `$(VLC_CONFIG) --ldflags libvlccore` $(AM_LDFLAGS) \
-no-undefined \
-export-symbols $(srcdir)/libvlccore.sym \
- -version-info 2:0:0
+ -version-info 3:0:0
libvlccore_la_LIBADD = `$(VLC_CONFIG) -libs libvlccore` $(AM_LIBADD) \
$(LTLIBINTL) ../compat/libcompat.la
libvlccore_la_DEPENDENCIES = libvlccore.sym
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
endif
SOURCES_libvlc_beos = \
+ misc/pthread.c \
$(NULL)
SOURCES_libvlc_darwin = \
+ misc/pthread.c \
misc/darwin_specific.c \
$(NULL)
SOURCES_libvlc_linux = \
+ misc/pthread.c \
misc/linux_specific.c \
$(NULL)
SOURCES_libvlc_win32 = \
+ misc/w32thread.c \
misc/win32_specific.c \
network/winsock.c \
$(NULL)
-SOURCES_libvlc_other = misc/not_specific.c
+SOURCES_libvlc_other = \
+ misc/pthread.c \
+ misc/not_specific.c
SOURCES_libvlc_dirent = \
extras/dirent.c \
misc/rand.c \
misc/mtime.c \
misc/block.c \
+ misc/fourcc.c \
misc/es_format.c \
modules/modules.h \
modules/modules.c \
{
switch( i_format )
{
- case VLC_FOURCC('u','8',' ',' '):
- case VLC_FOURCC('s','8',' ',' '):
+ case VLC_CODEC_U8:
+ case VLC_CODEC_S8:
return 8;
- case VLC_FOURCC('u','1','6','l'):
- case VLC_FOURCC('s','1','6','l'):
- case VLC_FOURCC('u','1','6','b'):
- case VLC_FOURCC('s','1','6','b'):
+ case VLC_CODEC_U16L:
+ case VLC_CODEC_S16L:
+ case VLC_CODEC_U16B:
+ case VLC_CODEC_S16B:
return 16;
- case VLC_FOURCC('u','2','4','l'):
- case VLC_FOURCC('s','2','4','l'):
- case VLC_FOURCC('u','2','4','b'):
- case VLC_FOURCC('s','2','4','b'):
+ case VLC_CODEC_U24L:
+ case VLC_CODEC_S24L:
+ case VLC_CODEC_U24B:
+ case VLC_CODEC_S24B:
return 24;
- case VLC_FOURCC('s','3','2','l'):
- case VLC_FOURCC('s','3','2','b'):
- case VLC_FOURCC('f','l','3','2'):
- case VLC_FOURCC('f','i','3','2'):
+ case VLC_CODEC_S32L:
+ case VLC_CODEC_S32B:
+ case VLC_CODEC_FL32:
+ case VLC_CODEC_FI32:
return 32;
- case VLC_FOURCC('f','l','6','4'):
+ case VLC_CODEC_FL64:
return 64;
default:
/* Non-S/PDIF mixer only deals with float32 or fixed32. */
p_aout->mixer.mixer.i_format
= (vlc_CPU() & CPU_CAPABILITY_FPU) ?
- VLC_FOURCC('f','l','3','2') :
- VLC_FOURCC('f','i','3','2');
+ VLC_CODEC_FL32 : VLC_CODEC_FI32;
aout_FormatPrepare( &p_aout->mixer.mixer );
}
else
int ConfigStringToKey( const char *psz_key )
{
int i_key = 0;
- unsigned int i;
+ size_t i;
const char *psz_parser = strchr( psz_key, '-' );
while( psz_parser && psz_parser != psz_key )
{
- for( i = 0; i < sizeof(vlc_modifiers) / sizeof(key_descriptor_t); i++ )
+ for( i = 0; i < vlc_num_modifiers; ++i )
{
if( !strncasecmp( vlc_modifiers[i].psz_key_string, psz_key,
strlen( vlc_modifiers[i].psz_key_string ) ) )
psz_key = psz_parser + 1;
psz_parser = strchr( psz_key, '-' );
}
- for( i = 0; i < sizeof(vlc_keys) / sizeof( key_descriptor_t ); i++ )
+ for( i = 0; i < vlc_num_keys; ++i )
{
if( !strcasecmp( vlc_keys[i].psz_key_string, psz_key ) )
{
char *ConfigKeyToString( int i_key )
{
- char *psz_key = malloc( 100 );
+ // Worst case appears to be 45 characters:
+ // "Command-Meta-Ctrl-Shift-Alt-Browser Favorites"
+ enum { keylen=64 };
+ char *psz_key = malloc( keylen );
char *p;
size_t index;
*psz_key = '\0';
p = psz_key;
- for( index = 0; index < (sizeof(vlc_modifiers) / sizeof(key_descriptor_t));
- index++ )
+ for( index = 0; index < vlc_num_modifiers; ++index )
{
if( i_key & vlc_modifiers[index].i_key_code )
{
- p += sprintf( p, "%s-", vlc_modifiers[index].psz_key_string );
+ p += snprintf( p, keylen-(psz_key-p), "%s-",
+ vlc_modifiers[index].psz_key_string );
}
}
- for( index = 0; index < (sizeof(vlc_keys) / sizeof( key_descriptor_t));
- index++)
+ for( index = 0; index < vlc_num_keys; ++index )
{
if( (int)( i_key & ~KEY_MODIFIER ) == vlc_keys[index].i_key_code )
{
- p += sprintf( p, "%s", vlc_keys[index].psz_key_string );
+ p += snprintf( p, keylen-(psz_key-p), "%s",
+ vlc_keys[index].psz_key_string );
break;
}
}
aout_instance_t *p_aout = GetAOut( p_instance, p_e );
if( p_aout )
{
- vlc_value_t val;
- int i_ret = -1;
-
- val.i_int = (int) device_type;
- i_ret = var_Set( p_aout, "audio-device", val );
- if( i_ret < 0 )
- {
+ if( var_SetInteger( p_aout, "audio-device", device_type ) < 0 )
libvlc_exception_raise( p_e, "Failed setting audio device" );
- vlc_object_release( p_aout );
- return;
- }
-
vlc_object_release( p_aout );
}
}
int libvlc_audio_get_mute( libvlc_instance_t *p_instance,
libvlc_exception_t *p_e )
{
- /*
- * If the volume level is 0, then the channel is muted
- */
- audio_volume_t i_volume;
-
- i_volume = libvlc_audio_get_volume(p_instance, p_e);
- if ( i_volume == 0 )
- return true;
- return false;
+ return (libvlc_audio_get_volume(p_instance, p_e) == 0);
}
void libvlc_audio_set_mute( libvlc_instance_t *p_instance, int mute,
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
- vlc_value_t val_list;
int i_track_count;
if( !p_input_thread )
return -1;
- var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES, &val_list, NULL );
- i_track_count = val_list.p_list->i_count;
- var_Change( p_input_thread, "audio-es", VLC_VAR_FREELIST, &val_list, NULL );
+ i_track_count = var_CountChoices( p_input_thread, "audio-es" );
vlc_object_release( p_input_thread );
return i_track_count;
break;
}
}
- var_Change( p_input_thread, "audio-es", VLC_VAR_FREELIST, &val_list, NULL );
+ var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread );
return i_track;
}
libvlc_exception_raise( p_e, "Setting audio track failed" );
end:
- var_Change( p_input_thread, "audio-es", VLC_VAR_FREELIST, &val_list, NULL );
+ var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread );
}
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++)
{
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 );
}
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;
}
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 );
}
if( !array_listeners_cached )
{
fprintf(stderr, "Can't alloc memory in libvlc_event_send" );
+ vlc_mutex_unlock( &p_em->object_lock );
return;
}
if( !listeners_group )
{
+ vlc_mutex_unlock( &p_em->object_lock );
free( array_listeners_cached );
return;
}
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 );
}
/*
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;
}
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);
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));
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);
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",
libvlc_instance_t * p_libvlc_instance;
int i_refcount;
vlc_mutex_t object_lock;
+ vlc_mutex_t refcount_lock;
libvlc_media_t * p_md; /* The media from which the
* mlist comes, if any. */
vlc_array_t items;
uint32_t xid;
uint32_t agl;
} drawable;
-
- bool b_own_its_input_thread;
};
struct libvlc_media_list_player_t
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 *,
}
vlc_mutex_init( &p_mlist->object_lock );
+ vlc_mutex_init( &p_mlist->refcount_lock ); // FIXME: spinlock?
vlc_array_init( &p_mlist->items );
p_mlist->i_refcount = 1;
libvlc_media_t * p_md;
int i;
- vlc_mutex_lock( &p_mlist->object_lock );
+ vlc_mutex_lock( &p_mlist->refcount_lock );
p_mlist->i_refcount--;
if( p_mlist->i_refcount > 0 )
{
- vlc_mutex_unlock( &p_mlist->object_lock );
+ vlc_mutex_unlock( &p_mlist->refcount_lock );
return;
}
- vlc_mutex_unlock( &p_mlist->object_lock );
+ vlc_mutex_unlock( &p_mlist->refcount_lock );
/* Refcount null, time to free */
libvlc_event_manager_release( p_mlist->p_event_manager );
- if( p_mlist->p_md )
- libvlc_media_release( p_mlist->p_md );
+ libvlc_media_release( p_mlist->p_md );
for ( i = 0; i < vlc_array_count( &p_mlist->items ); i++ )
{
**************************************************************************/
void libvlc_media_list_retain( libvlc_media_list_t * p_mlist )
{
- vlc_mutex_lock( &p_mlist->object_lock );
+ vlc_mutex_lock( &p_mlist->refcount_lock );
p_mlist->i_refcount++;
- vlc_mutex_unlock( &p_mlist->object_lock );
+ vlc_mutex_unlock( &p_mlist->refcount_lock );
}
{
VLC_UNUSED(p_e);
vlc_mutex_lock( &p_mlist->object_lock );
- if( p_mlist->p_md )
- libvlc_media_release( p_mlist->p_md );
+ libvlc_media_release( p_mlist->p_md );
libvlc_media_retain( p_md );
p_mlist->p_md = p_md;
vlc_mutex_unlock( &p_mlist->object_lock );
}
/**************************************************************************
- * 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++ );
**************************************************************************/
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;
}
/**************************************************************************
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;
}
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;
}
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 );
**************************************************************************/
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 );
}
/**************************************************************************
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 );
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 */
var_GetTime( p_input, "time" );
libvlc_event_send( p_mi->p_event_manager, &event );
}
+ else if( newval.i_int == INPUT_EVENT_LENGTH )
+ {
+ event.type = libvlc_MediaPlayerLengthChanged;
+ event.u.media_player_length_changed.new_length =
+ var_GetTime( p_input, "length" );
+ libvlc_event_send( p_mi->p_event_manager, &event );
+ }
return VLC_SUCCESS;
}
+static void libvlc_media_player_destroy( libvlc_media_player_t * );
+
/**************************************************************************
* Create a Media Instance object.
*
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 );
libvlc_MediaPlayerPositionChanged, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerTimeChanged, p_e );
+ libvlc_event_manager_register_event_type( p_mi->p_event_manager,
+ libvlc_MediaPlayerLengthChanged, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaPlayerTitleChanged, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager,
/* 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
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;
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 );
+ else
+ release_input_thread( p_mi, true );
+ libvlc_event_manager_release( p_mi->p_event_manager );
libvlc_media_release( p_mi->p_md );
-
+ vlc_mutex_destroy( &p_mi->object_lock );
free( 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 );
}
/**************************************************************************
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;
libvlc_exception_t *p_e )
{
input_thread_t *p_input = libvlc_get_input_thread( p_mi, p_e );
+ libvlc_track_description_t *p_track_description = NULL,
+ *p_actual, *p_previous;
if( !p_input )
return NULL;
vlc_value_t val_list, text_list;
var_Change( p_input, psz_variable, VLC_VAR_GETLIST, &val_list, &text_list);
- if( val_list.p_list->i_count <= 0 ) /* no tracks */
- {
- var_Change( p_input, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list);
- vlc_object_release( p_input );
- return NULL;
- }
+ /* no tracks */
+ if( val_list.p_list->i_count <= 0 )
+ goto end;
- libvlc_track_description_t *p_track_description, *p_actual, *p_previous;
p_track_description = ( libvlc_track_description_t * )
malloc( sizeof( libvlc_track_description_t ) );
if ( !p_track_description )
{
- var_Change( p_input, psz_variable, VLC_VAR_FREELIST,
- &val_list, &text_list);
- vlc_object_release( p_input );
libvlc_exception_raise( p_e, "no enough memory" );
- return NULL;
+ goto end;
}
p_actual = p_track_description;
p_previous = NULL;
if ( !p_actual )
{
libvlc_track_description_release( p_track_description );
- var_Change( p_input, psz_variable, VLC_VAR_FREELIST,
- &val_list, &text_list);
- vlc_object_release( p_input );
libvlc_exception_raise( p_e, "no enough memory" );
- return NULL;
+ goto end;
}
}
p_actual->i_id = val_list.p_list->p_values[i].i_int;
p_previous = p_actual;
p_actual = NULL;
}
- var_Change( p_input, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list);
+
+end:
+ var_FreeList( &val_list, &text_list );
vlc_object_release( p_input );
return p_track_description;
#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;
-}
-
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) p_mi; (void) view; (void) clip; (void) p_e;
-#endif
-}
-
float libvlc_video_get_scale( libvlc_media_player_t *p_mp,
libvlc_exception_t *p_e )
{
break;
}
}
- var_Change( p_input_thread, "spu-es", VLC_VAR_FREELIST, &val_list, NULL );
+ var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread );
return i_spu;
}
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
- vlc_value_t val_list;
int i_spu_count;
if( !p_input_thread )
return -1;
- var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL );
- i_spu_count = val_list.p_list->i_count;
- var_Change( p_input_thread, "spu-es", VLC_VAR_FREELIST, &val_list, NULL );
+ i_spu_count = var_CountChoices( p_input_thread, "spu-es" );
vlc_object_release( p_input_thread );
return i_spu_count;
}
end:
- var_Change( p_input_thread, "spu-es", VLC_VAR_FREELIST, &val_list, NULL );
+ var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread );
}
if( list.p_list->i_count > 0 )
var_SetInteger( p_input_thread, "spu-es", list.p_list->p_values[0].i_int );
- var_Change( p_input_thread, "teletext-es", VLC_VAR_FREELIST, &list, NULL );
+ var_FreeList( &list, NULL );
}
}
vlc_object_release( p_input_thread );
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
- vlc_value_t val_list;
int i_track_count;
if( !p_input_thread )
return -1;
- var_Change( p_input_thread, "video-es", VLC_VAR_GETCHOICES, &val_list, NULL );
- i_track_count = val_list.p_list->i_count;
- var_Change( p_input_thread, "video-es", VLC_VAR_FREELIST, &val_list, NULL );
+ i_track_count = var_CountChoices( p_input_thread, "video-es" );
vlc_object_release( p_input_thread );
return i_track_count;
break;
}
}
- var_Change( p_input_thread, "video-es", VLC_VAR_FREELIST, &val_list, NULL );
+ var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread );
return i_track;
}
libvlc_exception_raise( p_e, "Video track out of range" );
end:
- var_Change( p_input_thread, "video-es", VLC_VAR_FREELIST, &val_list, NULL );
+ var_FreeList( &val_list, NULL );
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;
-}
char *psz_format = (char *)va_arg( args, char * );
char *psz_value;
-
+
if( vasprintf( &psz_value, psz_format, args ) == -1 )
return VLC_EGENERIC;
static void DecoderProcessSout( decoder_t *p_dec, block_t *p_block )
{
decoder_owner_sys_t *p_owner = (decoder_owner_sys_t *)p_dec->p_owner;
- const bool b_telx = p_dec->fmt_in.i_codec == VLC_FOURCC('t','e','l','x');
+ const bool b_telx = p_dec->fmt_in.i_codec == VLC_CODEC_TELETEXT;
block_t *p_sout_block;
while( ( p_sout_block =
static void DecoderProcessSpu( decoder_t *p_dec, block_t *p_block, bool b_flush )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
- const bool b_telx = p_dec->fmt_in.i_codec == VLC_FOURCC('t','e','l','x');
+ const bool b_telx = p_dec->fmt_in.i_codec == VLC_CODEC_TELETEXT;
input_thread_t *p_input = p_owner->p_input;
vout_thread_t *p_vout;
#include <vlc_es_out.h>
#include <vlc_block.h>
#include <vlc_aout.h>
+#include <vlc_fourcc.h>
#include "input_internal.h"
#include "clock.h"
}
static inline bool EsFmtIsTeletext( const es_format_t *p_fmt )
{
- return p_fmt->i_cat == SPU_ES && p_fmt->i_codec == VLC_FOURCC( 't', 'e', 'l', 'x' );
+ return p_fmt->i_cat == SPU_ES && p_fmt->i_codec == VLC_CODEC_TELETEXT;
}
/*****************************************************************************
es_format_Copy( &es->fmt, fmt );
if( es->fmt.i_id < 0 )
es->fmt.i_id = out->p_sys->i_id;
+ if( !es->fmt.i_original_fourcc )
+ es->fmt.i_original_fourcc = es->fmt.i_codec;
+ es->fmt.i_codec = vlc_fourcc_GetCodec( es->fmt.i_cat, es->fmt.i_codec );
+
es->i_id = es->fmt.i_id;
es->i_meta_id = out->p_sys->i_id;
es->b_scrambled = false;
break;
}
}
- var_Change( p_sys->p_input, "programs", VLC_VAR_FREELIST, &val, NULL );
+ var_FreeList( &val, NULL );
}
else if( p_sys->i_mode == ES_OUT_MODE_AUTO )
{
input_DecoderIsCcPresent( es->p_dec, pb_cc );
for( int i = 0; i < 4; i++ )
{
- static const vlc_fourcc_t fcc[4] = {
- VLC_FOURCC('c', 'c', '1', ' '),
- VLC_FOURCC('c', 'c', '2', ' '),
- VLC_FOURCC('c', 'c', '3', ' '),
- VLC_FOURCC('c', 'c', '4', ' '),
- };
es_format_t fmt;
if( es->pb_cc_present[i] || !pb_cc[i] )
continue;
msg_Dbg( p_input, "Adding CC track %d for es[%d]", 1+i, es->i_id );
- es_format_Init( &fmt, SPU_ES, fcc[i] );
+ es_format_Init( &fmt, SPU_ES, EsOutFourccClosedCaptions[i] );
fmt.i_group = es->fmt.i_group;
if( asprintf( &fmt.psz_description,
_("Closed captions %u"), 1 + i ) == -1 )
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:
input_Control( p_input, INPUT_ADD_INFO, psz_cat, _("Original ID"),
"%d", es->i_id );
- input_Control( p_input, INPUT_ADD_INFO, psz_cat, _("Codec"),
- "%.4s", (char*)&p_fmt_es->i_codec );
+ const char *psz_codec_description =
+ vlc_fourcc_GetDescription( p_fmt_es->i_cat, p_fmt_es->i_codec );
+ const vlc_fourcc_t i_codec_fourcc = p_fmt_es->i_original_fourcc ?: p_fmt_es->i_codec;
+ if( psz_codec_description )
+ input_Control( p_input, INPUT_ADD_INFO, psz_cat, _("Codec"),
+ "%s (%.4s)", psz_codec_description, (char*)&i_codec_fourcc );
+ else
+ input_Control( p_input, INPUT_ADD_INFO, psz_cat, _("Codec"),
+ "%.4s", (char*)&i_codec_fourcc );
if( es->psz_language && *es->psz_language )
input_Control( p_input, INPUT_ADD_INFO, psz_cat, _("Language"),
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;
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 )
{
*****************************************************************************/
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 );
}
else
{
- var_Change( p_input, "programs", VLC_VAR_FREELIST, &val, NULL );
+ var_FreeList( &val, NULL );
}
}
}
{
demux_Control( p_input->p->input.p_demux, DEMUX_SET_GROUP, -1,
val.p_list );
- var_Change( p_input, "programs", VLC_VAR_FREELIST, &val, NULL );
+ var_FreeList( &val, NULL );
}
else
{
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 )
{
es_out_Control( p_input->p->p_es_out_display, ES_OUT_SET_ES_DEFAULT_BY_ID, i_id );
es_out_Control( p_input->p->p_es_out_display, ES_OUT_SET_ES_BY_ID, i_id );
}
- var_Change( p_input, "spu-es", VLC_VAR_FREELIST, &list, NULL );
+ var_FreeList( &list, NULL );
}
}
}
#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 );
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
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
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
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
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
picture_Delete
picture_Export
picture_New
+picture_Setup
plane_CopyPixels
playlist_Add
playlist_AddExt
playlist_IsServicesDiscoveryLoaded
playlist_ItemGetById
playlist_ItemGetByInput
-playlist_ItemGetByInputId
playlist_LiveSearchUpdate
playlist_Lock
playlist_NodeAppend
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
__var_Create
__var_DelCallback
__var_Destroy
+var_FreeList
__var_Get
var_GetChecked
__var_Set
__var_TriggerCallback
__var_Type
video_format_FixRgb
+video_format_Setup
vlc_avcodec_mutex
vlc_b64_decode
vlc_b64_decode_binary
vlc_event_send
__vlc_execve
vlc_fastmem_register
+vlc_fourcc_GetCodec
+vlc_fourcc_GetCodecAudio
+vlc_fourcc_GetCodecFromString
+vlc_fourcc_GetDescription
vlc_freeaddrinfo
vlc_gai_strerror
vlc_gc_init
vout_DisplayPicture
vout_EnableFilter
vout_GetSnapshot
-vout_InitFormat
-__vout_InitPicture
vout_LinkPicture
vout_OSDIcon
__vout_OSDMessage
{
switch( p_fmt->i_chroma )
{
- case VLC_FOURCC('R','V','1','5'):
+ case VLC_CODEC_RGB15:
p_fmt->i_rmask = 0x7c00;
p_fmt->i_gmask = 0x03e0;
p_fmt->i_bmask = 0x001f;
break;
- case VLC_FOURCC('R','V','1','6'):
+ case VLC_CODEC_RGB16:
p_fmt->i_rmask = 0xf800;
p_fmt->i_gmask = 0x07e0;
p_fmt->i_bmask = 0x001f;
break;
- case VLC_FOURCC('R','V','2','4'):
+ case VLC_CODEC_RGB24:
p_fmt->i_rmask = 0xff0000;
p_fmt->i_gmask = 0x00ff00;
p_fmt->i_bmask = 0x0000ff;
break;
- case VLC_FOURCC('R','V','3','2'):
+ case VLC_CODEC_RGB32:
p_fmt->i_rmask = 0x00ff0000;
p_fmt->i_gmask = 0x0000ff00;
p_fmt->i_bmask = 0x000000ff;
p_fmt->i_bmask );
}
+void video_format_Setup( video_format_t *p_fmt, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect )
+{
+ p_fmt->i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, i_chroma );
+ p_fmt->i_width =
+ p_fmt->i_visible_width = i_width;
+ p_fmt->i_height =
+ p_fmt->i_visible_height = i_height;
+ p_fmt->i_x_offset =
+ p_fmt->i_y_offset = 0;
+ p_fmt->i_aspect = i_aspect;
+
+ switch( p_fmt->i_chroma )
+ {
+ case VLC_CODEC_YUVA:
+ p_fmt->i_bits_per_pixel = 32;
+ break;
+ case VLC_CODEC_I444:
+ case VLC_CODEC_J444:
+ p_fmt->i_bits_per_pixel = 24;
+ break;
+ case VLC_CODEC_I422:
+ case VLC_CODEC_YUYV:
+ case VLC_CODEC_YVYU:
+ case VLC_CODEC_UYVY:
+ case VLC_CODEC_VYUY:
+ case VLC_CODEC_J422:
+ p_fmt->i_bits_per_pixel = 16;
+ break;
+ case VLC_CODEC_I440:
+ case VLC_CODEC_J440:
+ p_fmt->i_bits_per_pixel = 16;
+ break;
+ case VLC_CODEC_I411:
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I420:
+ case VLC_CODEC_J420:
+ p_fmt->i_bits_per_pixel = 12;
+ break;
+ case VLC_CODEC_I410:
+ p_fmt->i_bits_per_pixel = 9;
+ break;
+ case VLC_CODEC_Y211:
+ p_fmt->i_bits_per_pixel = 8;
+ break;
+ case VLC_CODEC_YUVP:
+ p_fmt->i_bits_per_pixel = 8;
+ break;
+
+ case VLC_CODEC_RGB32:
+ case VLC_CODEC_RGBA:
+ p_fmt->i_bits_per_pixel = 32;
+ break;
+ case VLC_CODEC_RGB24:
+ p_fmt->i_bits_per_pixel = 24;
+ break;
+ case VLC_CODEC_RGB15:
+ case VLC_CODEC_RGB16:
+ p_fmt->i_bits_per_pixel = 16;
+ break;
+ case VLC_CODEC_RGB8:
+ p_fmt->i_bits_per_pixel = 8;
+ break;
+
+ case VLC_CODEC_GREY:
+ case VLC_CODEC_RGBP:
+ p_fmt->i_bits_per_pixel = 8;
+ break;
+
+ default:
+ p_fmt->i_bits_per_pixel = 0;
+ break;
+ }
+}
+
void es_format_Init( es_format_t *fmt,
int i_cat, vlc_fourcc_t i_codec )
{
fmt->i_cat = i_cat;
fmt->i_codec = i_codec;
+ fmt->i_original_fourcc = 0;
fmt->i_id = -1;
fmt->i_group = 0;
fmt->i_priority = 0;
--- /dev/null
+/*****************************************************************************
+ * fourcc.c: fourcc helpers functions
+ *****************************************************************************
+ * Copyright (C) 2009 Laurent Aimar
+ * $Id$
+ *
+ * Authors: Laurent Aimar <fenrir@videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_fourcc.h>
+#include <assert.h>
+
+typedef struct
+{
+ char p_class[4];
+ char p_fourcc[4];
+ const char *psz_description;
+} entry_t;
+
+#define NULL4 "\x00\x00\x00\x00"
+
+/* XXX You don't want to see the preprocessor generated code ;) */
+#ifdef WORDS_BIGENDIAN
+# define FCC2STR(f) { ((f)>>24)&0xff, ((f)>>16)&0xff, ((f)>>8)&0xff, ((f)>>0)&0xff }
+#else
+# define FCC2STR(f) { ((f)>>0)&0xff, ((f)>>8)&0xff, ((f)>>16)&0xff, ((f)>>24)&0xff }
+#endif
+/* Begin a new class */
+#define B(a, c) { .p_class = FCC2STR(a), .p_fourcc = FCC2STR(a), .psz_description = c }
+/* Create a sub-class entry with description */
+#define E(b, c) { .p_class = NULL4, .p_fourcc = b, .psz_description = c }
+/* Create a sub-class entry without description (alias) */
+#define A(b) E(b, NULL4)
+
+
+/* */
+static const entry_t p_list_video[] = {
+
+ B(VLC_CODEC_MPGV, "MPEG-1/2 Video"),
+ A("mpgv"),
+ A("mp1v"),
+ A("mpeg"),
+ A("mpg1"),
+ A("mp2v"),
+ A("MPEG"),
+ A("mpg2"),
+
+ E("PIM1", "Pinnacle DC1000 (MPEG-1 Video)"),
+
+ E("hdv1", "HDV 720p30 (MPEG-2 Video)"),
+ E("hdv2", "Sony HDV (MPEG-2 Video)"),
+ E("hdv3", "FCP HDV (MPEG-2 Video)"),
+ E("hdv5", "HDV 720p25 (MPEG-2 Video)"),
+ E("hdv6", "HDV 1080p24 (MPEG-2 Video)"),
+ E("hdv7", "HDV 1080p25 (MPEG-2 Video)"),
+ E("hdv8", "HDV 1080p30 (MPEG-2 Video)"),
+
+ E("mx5n", "MPEG2 IMX NTSC 525/60 50mb/s (FCP)"),
+ E("mx5p", "MPEG2 IMX PAL 625/60 50mb/s (FCP)"),
+ E("mx4n", "MPEG2 IMX NTSC 525/60 40mb/s (FCP)"),
+ E("mx4p", "MPEG2 IMX PAL 625/50 40mb/s (FCP)"),
+ E("mx3n", "MPEG2 IMX NTSC 525/60 30mb/s (FCP)"),
+ E("mx3p", "MPEG2 IMX NTSC 625/50 30mb/s (FCP)"),
+
+ E("xdv1", "XDCAM HD"),
+ E("xdv2", "XDCAM HD 1080i60 35mb/s"),
+ E("xdv3", "XDCAM HD 1080i50 35mb/s"),
+ E("xdv4", "XDCAM HD"),
+ E("xdv5", "XDCAM HD"),
+ E("xdv6", "XDCAM HD 1080p24 35mb/s"),
+ E("xdv7", "XDCAM HD 1080p25 35mb/s"),
+ E("xdv8", "XDCAM HD 1080p30 35mb/s"),
+ E("xdv9", "XDCAM HD"),
+
+ E("xdva", "XDCAM"),
+ E("xdvb", "XDCAM"),
+ E("xdvc", "XDCAM"),
+ E("xdvd", "XDCAM"),
+ E("xdve", "XDCAM"),
+ E("xdvf", "XDCAM"),
+
+ E("xd5a", "XDCAM"),
+ E("xd5b", "XDCAM"),
+ E("xd5c", "XDCAM"),
+ E("xd5d", "XDCAM"),
+ E("xd5e", "XDCAM"),
+ E("xd5f", "XDCAM"),
+ E("xd59", "XDCAM"),
+
+ E("AVmp", "AVID IMX PAL"),
+ E("MMES", "Matrox MPEG-2"),
+ E("mmes", "Matrox MPEG-2"),
+ E("PIM2", "Pinnacle MPEG-2"),
+ E("LMP2", "Lead MPEG-2"),
+
+ E("VCR2", "ATI VCR-2"),
+
+ B(VLC_CODEC_MP4V, "MPEG-4 Video"),
+ A("mp4v"),
+ A("DIVX"),
+ A("divx"),
+ A("MP4S"),
+ A("mp4s"),
+ A("M4S2"),
+ A("m4s2"),
+ A("MP4V"),
+ A("\x04\x00\x00\x00"),
+ A("m4cc"),
+ A("M4CC"),
+ A("FMP4"),
+ A("fmp4"),
+ A("DCOD"),
+ A("MVXM"),
+ A("PM4V"),
+ A("M4T3"),
+ A("GEOX"),
+ A("DMK2"),
+ A("WV1F"),
+ A("DIGI"),
+ A("INMC"),
+ A("SN40"),
+ A("EPHV"),
+ /* XVID flavours */
+ E("xvid", "Xvid MPEG-4 Video"),
+ E("XVID", "Xvid MPEG-4 Video"),
+ E("XviD", "Xvid MPEG-4 Video"),
+ E("XVIX", "Xvid MPEG-4 Video"),
+ E("xvix", "Xvid MPEG-4 Video"),
+ /* DX50 */
+ E("DX50", "DivX MPEG-4 Video"),
+ E("dx50", "DivX MPEG-4 Video"),
+ E("BLZ0", "Blizzard MPEG-4 Video"),
+ E("DXGM", "Electronic Arts Game MPEG-4 Video"),
+ /* 3ivx delta 4 */
+ E("3IV2", "3ivx MPEG-4 Video"),
+ E("3iv2", "3ivx MPEG-4 Video"),
+ /* Various */
+ E("UMP4", "UB MPEG-4 Video"),
+ E("SEDG", "Samsung MPEG-4 Video"),
+ E("RMP4", "REALmagic MPEG-4 Video"),
+ E("HDX4", "Jomigo HDX4 (MPEG-4 Video)"),
+ E("hdx4", "Jomigo HDX4 (MPEG-4 Video)"),
+ E("SMP4", "Samsung SMP4 (MPEG-4 Video)"),
+ E("smp4", "Samsung SMP4 (MPEG-4 Video)"),
+ E("fvfw", "FFmpeg MPEG-4"),
+ E("FVFW", "FFmpeg MPEG-4"),
+ E("FFDS", "FFDShow MPEG-4"),
+ E("VIDM", "vidm 4.01 codec"),
+ /* 3ivx delta 3.5 Unsupported
+ * putting it here gives extreme distorted images */
+ //E("3IV1", "3ivx delta 3.5 MPEG-4 Video"),
+ //E("3iv1", "3ivx delta 3.5 MPEG-4 Video"),
+
+ /* MSMPEG4 v1 */
+ B(VLC_CODEC_DIV1, "MS MPEG-4 Video v1"),
+ A("DIV1"),
+ A("div1"),
+ A("MPG4"),
+ A("mpg4"),
+ A("mp41"),
+
+ /* MSMPEG4 v2 */
+ B(VLC_CODEC_DIV2, "MS MPEG-4 Video v2"),
+ A("DIV2"),
+ A("div2"),
+ A("MP42"),
+ A("mp42"),
+
+ /* MSMPEG4 v3 / M$ mpeg4 v3 */
+ B(VLC_CODEC_DIV3, "MS MPEG-4 Video v3"),
+ A("DIV3"),
+ A("MPG3"),
+ A("mpg3"),
+ A("div3"),
+ A("MP43"),
+ A("mp43"),
+ /* DivX 3.20 */
+ A("DIV4"),
+ A("div4"),
+ A("DIV5"),
+ A("div5"),
+ A("DIV6"),
+ A("div6"),
+ E("divf", "DivX 4.12"),
+ E("DIVF", "DivX 4.12"),
+ /* Cool Codec */
+ A("COL1"),
+ A("col1"),
+ A("COL0"),
+ A("col0"),
+ /* AngelPotion stuff */
+ A("AP41"),
+ /* 3ivx doctered divx files */
+ A("3IVD"),
+ A("3ivd"),
+ /* who knows? */
+ A("3VID"),
+ A("3vid"),
+ A("DVX3"),
+
+ /* Sorenson v1 */
+ B(VLC_CODEC_SVQ1, "SVQ-1 (Sorenson Video v1)"),
+ A("SVQ1"),
+ A("svq1"),
+ A("svqi"),
+
+ /* Sorenson v3 */
+ B(VLC_CODEC_SVQ3, "SVQ-3 (Sorenson Video v3)"),
+ A("SVQ3"),
+
+ /* h264 */
+ B(VLC_CODEC_H264, "H264 - MPEG-4 AVC (part 10)"),
+ A("H264"),
+ A("h264"),
+ A("x264"),
+ A("X264"),
+ /* avc1: special case h264 */
+ A("avc1"),
+ A("AVC1"),
+ E("VSSH", "Vanguard VSS H264"),
+ E("VSSW", "Vanguard VSS H264"),
+ E("vssh", "Vanguard VSS H264"),
+ E("DAVC", "Dicas MPEGable H.264/MPEG-4 AVC"),
+ E("davc", "Dicas MPEGable H.264/MPEG-4 AVC"),
+
+ /* H263 and H263i */
+ /* H263(+) is also known as Real Video 1.0 */
+
+ /* H263 */
+ B(VLC_CODEC_H263, "H263"),
+ A("H263"),
+ A("h263"),
+ A("VX1K"),
+ A("s263"),
+ A("S263"),
+ A("U263"),
+ A("u263"),
+ E("D263", "DEC H263"),
+ E("L263", "LEAD H263"),
+ E("M263", "Microsoft H263"),
+ E("X263", "Xirlink H263"),
+ /* Zygo (partial) */
+ E("ZyGo", "ITU H263+"),
+
+ /* H263i */
+ B(VLC_CODEC_H263I, "I263.I"),
+ A("I263"),
+ A("i263"),
+
+ /* H263P */
+ B(VLC_CODEC_H263P, "ITU H263+"),
+ E("ILVR", "ITU H263+"),
+ E("viv1", "H263+"),
+ E("vivO", "H263+"),
+ E("viv2", "H263+"),
+ E("U263", "UB H263+"),
+
+ /* Flash (H263) variant */
+ B(VLC_CODEC_FLV1, "Flash Video"),
+ A("FLV1"),
+ A("flv "),
+
+ /* H261 */
+ B(VLC_CODEC_H261, "H.261"),
+ A("H261"),
+ A("h261"),
+
+ B(VLC_CODEC_FLIC, "Flic Video"),
+ A("FLIC"),
+
+ /* MJPEG */
+ B(VLC_CODEC_MJPG, "Motion JPEG Video"),
+ A("MJPG"),
+ A("mjpg"),
+ A("mjpa"),
+ A("jpeg"),
+ A("JPEG"),
+ A("JFIF"),
+ A("JPGL"),
+ A("AVDJ"),
+ A("MMJP"),
+ A("QIVG"),
+ /* AVID MJPEG */
+ E("AVRn", "Avid Motion JPEG"),
+ E("AVDJ", "Avid Motion JPEG"),
+ E("ADJV", "Avid Motion JPEG"),
+ E("dmb1", "Motion JPEG OpenDML Video"),
+ E("ijpg", "Intergraph JPEG Video"),
+ E("IJPG", "Intergraph JPEG Video"),
+ E("ACDV", "ACD Systems Digital"),
+ E("SLMJ", "SL M-JPEG"),
+
+ B(VLC_CODEC_MJPGB, "Motion JPEG B Video"),
+ A("mjpb"),
+
+ B(VLC_CODEC_LJPG, "Lead Motion JPEG Video"),
+ A("LJPG"),
+
+ // ? from avcodec/fourcc.c but makes not sense.
+ //{ VLC_FOURCC( 'L','J','P','G' ), CODEC_ID_MJPEG, VIDEO_ES, "Lead Motion JPEG Video" },
+
+ /* SP5x */
+ B(VLC_CODEC_SP5X, "Sunplus Motion JPEG Video"),
+ A("SP5X"),
+ A("SP53"),
+ A("SP54"),
+ A("SP55"),
+ A("SP56"),
+ A("SP57"),
+ A("SP58"),
+
+ /* DV */
+ B(VLC_CODEC_DV, "DV Video"),
+ A("dv "),
+ A("dvsl"),
+ A("DVSD"),
+ A("dvsd"),
+ A("DVCS"),
+ A("dvcs"),
+ A("dvhd"),
+ A("dvhp"),
+ A("dvhq"),
+ A("dvh3"),
+ A("dvh5"),
+ A("dvh6"),
+ A("dv1n"),
+ A("dv1p"),
+ A("dvc "),
+ A("dv25"),
+ A("dvh1"),
+ A("dvs1"),
+ E("dvcp", "DV Video PAL"),
+ E("dvp ", "DV Video Pro"),
+ E("dvpp", "DV Video Pro PAL"),
+ E("dv50", "DV Video C Pro 50"),
+ E("dv5p", "DV Video C Pro 50 PAL"),
+ E("dv5n", "DV Video C Pro 50 NTSC"),
+ E("AVdv", "AVID DV"),
+ E("AVd1", "AVID DV"),
+ E("CDVC", "Canopus DV Video"),
+ E("cdvc", "Canopus DV Video"),
+ E("CDVH", "Canopus DV Video"),
+ E("cdvh", "Canopus DV Video"),
+
+ /* Windows Media Video */
+ B(VLC_CODEC_WMV1, "Windows Media Video 7"),
+ A("WMV1"),
+ A("wmv1"),
+
+ B(VLC_CODEC_WMV2, "Windows Media Video 8"),
+ A("WMV2"),
+ A("wmv2"),
+
+ B(VLC_CODEC_WMV3, "Windows Media Video 9"),
+ A("WMV3"),
+ A("wmv3"),
+
+ B(VLC_CODEC_WMVA, "Windows Media Video Advanced"),
+ A("WMVA"),
+ A("wmva"),
+ A("WVP2"),
+ A("wvp2"),
+
+ B(VLC_CODEC_VC1, "Windows Media Video VC1"),
+ A("WVC1"),
+ A("wvc1"),
+ A("vc-1"),
+ A("VC-1"),
+ /* WMVA is the VC-1 codec before the standardization proces,
+ * it is not bitstream compatible and deprecated */
+ E("WMVA", "Windows Media Video Advanced Profile"),
+
+ /* Microsoft Video 1 */
+ B(VLC_CODEC_MSVIDEO1, "Microsoft Video 1"),
+ A("MSVC"),
+ A("msvc"),
+ A("CRAM"),
+ A("cram"),
+ A("WHAM"),
+ A("wham"),
+
+ /* Microsoft RLE */
+ B(VLC_CODEC_MSRLE, "Microsoft RLE Video"),
+ A("mrle"),
+ A("WRLE"),
+ A("\x01\x00\x00\x00"),
+ A("\x02\x00\x00\x00"),
+
+ /* Indeo Video Codecs (Quality of this decoder on ppc is not good) */
+ B(VLC_CODEC_INDEO3, "Indeo Video v3"),
+ A("IV31"),
+ A("iv31"),
+ A("IV32"),
+ A("iv32"),
+
+ /* Huff YUV */
+ B(VLC_CODEC_HUFFYUV, "Huff YUV Video"),
+ A("HFYU"),
+
+ B(VLC_CODEC_FFVHUFF, "Huff YUV Video"),
+ A("FFVH"),
+
+ /* On2 VP3 Video Codecs */
+ B(VLC_CODEC_VP3, "On2's VP3 Video"),
+ A("VP3 "),
+ A("VP30"),
+ A("vp30"),
+ A("VP31"),
+ A("vp31"),
+
+ /* On2 VP5, VP6 codecs */
+ B(VLC_CODEC_VP5, "On2's VP5 Video"),
+ A("VP5 "),
+ A("VP50"),
+
+ B(VLC_CODEC_VP6, "On2's VP6.2 Video"),
+ A("VP62"),
+ A("vp62"),
+ E("VP60", "On2's VP6.0 Video"),
+ E("VP61", "On2's VP6.1 Video"),
+
+ B(VLC_CODEC_VP6F, "On2's VP6.2 Video (Flash)"),
+ A("VP6F"),
+
+ B(VLC_CODEC_VP6A, "On2's VP6 A Video"),
+ A("VP6A"),
+
+ /* Xiph.org theora */
+ B(VLC_CODEC_THEORA, "Xiph.org's Theora Video"),
+ A("theo"),
+ A("Thra"),
+
+ /* Xiph.org tarkin */
+ B(VLC_CODEC_TARKIN, "Xiph.org's Tarkin Video"),
+ A("tark"),
+
+ /* Asus Video (Another thing that doesn't work on PPC) */
+ B(VLC_CODEC_ASV1, "Asus V1 Video"),
+ A("ASV1"),
+ B(VLC_CODEC_ASV2, "Asus V2 Video"),
+ A("ASV2"),
+
+ /* FFMPEG Video 1 (lossless codec) */
+ B(VLC_CODEC_FFV1, "FFMpeg Video 1"),
+ A("FFV1"),
+
+ /* ATI VCR1 */
+ B(VLC_CODEC_VCR1, "ATI VCR1 Video"),
+ A("VCR1"),
+
+ /* Cirrus Logic AccuPak */
+ B(VLC_CODEC_CLJR, "Creative Logic AccuPak"),
+ A("CLJR"),
+
+ /* Real Video */
+ B(VLC_CODEC_RV10, "Real Video 1.0"),
+ A("RV10"),
+ A("rv10"),
+
+ B(VLC_CODEC_RV13, "Real Video 1.3"),
+ A("RV13"),
+ A("rv13"),
+
+ B(VLC_CODEC_RV20, "Real Video 2.0"),
+ A("RV20"),
+ A("rv20"),
+
+ B(VLC_CODEC_RV30, "Real Video 3.0"),
+ A("RV30"),
+ A("rv30"),
+
+ B(VLC_CODEC_RV40, "Real Video 4.0"),
+ A("RV40"),
+ A("rv40"),
+
+ /* Apple Video */
+ B(VLC_CODEC_RPZA, "Apple Video"),
+ A("rpza"),
+ A("azpr"),
+ A("RPZA"),
+ A("AZPR"),
+
+ B(VLC_CODEC_SMC, "Apple graphics"),
+ A("smc "),
+
+ B(VLC_CODEC_CINEPAK, "Cinepak Video"),
+ A("CVID"),
+ A("cvid"),
+
+ /* Screen Capture Video Codecs */
+ B(VLC_CODEC_TSCC, "TechSmith Camtasia Screen Capture"),
+ A("TSCC"),
+ A("tscc"),
+
+ B(VLC_CODEC_CSCD, "CamStudio Screen Codec"),
+ A("CSCD"),
+ A("cscd"),
+
+ B(VLC_CODEC_ZMBV, "DosBox Capture Codec"),
+ A("ZMBV"),
+
+ B(VLC_CODEC_VMNC, "VMware Video"),
+ A("VMnc"),
+ B(VLC_CODEC_FRAPS, "FRAPS: Realtime Video Capture"),
+ A("FPS1"),
+ A("fps1"),
+
+ /* Duck TrueMotion */
+ B(VLC_CODEC_TRUEMOTION1, "Duck TrueMotion v1 Video"),
+ A("DUCK"),
+ A("PVEZ"),
+ B(VLC_CODEC_TRUEMOTION2, "Duck TrueMotion v2.0 Video"),
+ A("TM20"),
+
+ /* FFMPEG's SNOW wavelet codec */
+ B(VLC_CODEC_SNOW, "FFMpeg SNOW wavelet Video"),
+ A("SNOW"),
+ A("snow"),
+
+ B(VLC_CODEC_QTRLE, "Apple QuickTime RLE Video"),
+ A("rle "),
+
+ B(VLC_CODEC_QDRAW, "Apple QuickDraw Video"),
+ A("qdrw"),
+
+ B(VLC_CODEC_QPEG, "QPEG Video"),
+ A("QPEG"),
+ A("Q1.0"),
+ A("Q1.1"),
+
+ B(VLC_CODEC_ULTI, "IBM Ultimotion Video"),
+ A("ULTI"),
+
+ B(VLC_CODEC_VIXL, "Miro/Pinnacle VideoXL Video"),
+ A("VIXL"),
+ A("XIXL"),
+ E("PIXL", "Pinnacle VideoXL Video"),
+
+ B(VLC_CODEC_LOCO, "LOCO Video"),
+ A("LOCO"),
+
+ B(VLC_CODEC_WNV1, "Winnov WNV1 Video"),
+ A("WNV1"),
+
+ B(VLC_CODEC_AASC, "Autodesc RLE Video"),
+ A("AASC"),
+
+ B(VLC_CODEC_INDEO2, "Indeo Video v2"),
+ A("IV20"),
+ A("RT21"),
+
+ /* Flash Screen Video */
+ B(VLC_CODEC_FLASHSV, "Flash Screen Video"),
+ A("FSV1"),
+ B(VLC_CODEC_KMVC, "Karl Morton's Video Codec (Worms)"),
+ A("KMVC"),
+
+ B(VLC_CODEC_NUV, "Nuppel Video"),
+ A("RJPG"),
+ A("NUV1"),
+
+ /* CODEC_ID_SMACKVIDEO */
+ B(VLC_CODEC_SMACKVIDEO, "Smacker Video"),
+ A("SMK2"),
+ A("SMK4"),
+
+ /* Chinese AVS - Untested */
+ B(VLC_CODEC_CAVS, "Chinese AVS"),
+ A("CAVS"),
+ A("AVs2"),
+ A("avs2"),
+
+ /* */
+ B(VLC_CODEC_DNXHD, "DNxHD"),
+ A("AVdn"),
+ B(VLC_CODEC_8BPS, "8BPS"),
+ A("8BPS"),
+ B(VLC_CODEC_MIMIC, "Mimic"),
+ A("ML2O"),
+
+ B(VLC_CODEC_CDG, "CD-G Video"),
+ A("CDG "),
+
+ /* */
+ B(VLC_CODEC_YV12, "Planar 4:2:0 YVU"),
+ A("YV12"),
+ A("yv12"),
+ B(VLC_CODEC_I420, "Planar 4:1:0 YUV"),
+ A("I410"),
+ A("YVU9"),
+ B(VLC_CODEC_I420, "Planar 4:1:1 YUV"),
+ A("I411"),
+ B(VLC_CODEC_I420, "Planar 4:2:0 YUV"),
+ A("I420"),
+ A("IYUV"),
+ B(VLC_CODEC_I422, "Planar 4:2:2 YUV"),
+ A("I422"),
+ B(VLC_CODEC_I444, "Planar 4:4:0 YUV"),
+ A("I440"),
+ B(VLC_CODEC_I444, "Planar 4:4:4 YUV"),
+ A("I444"),
+
+ B(VLC_CODEC_I420, "Planar 4:1:0 YUV full scale"),
+ A("J410"),
+ B(VLC_CODEC_I420, "Planar 4:1:1 YUV full scale"),
+ A("J411"),
+ B(VLC_CODEC_I420, "Planar 4:2:0 YUV full scale"),
+ A("J420"),
+ B(VLC_CODEC_I422, "Planar 4:2:2 YUV full scale"),
+ A("J422"),
+ B(VLC_CODEC_I444, "Planar 4:4:0 YUV full scale"),
+ A("J440"),
+ B(VLC_CODEC_I444, "Planar 4:4:4 YUV full scale"),
+ A("J444"),
+
+ B(VLC_CODEC_YUVP, "Palettized YUV with palette element Y:U:V:A"),
+ A("YUVP"),
+
+ B(VLC_CODEC_YUVA, "Planar YUV 4:4:4 Y:U:V:A"),
+ A("YUVA"),
+
+ B(VLC_CODEC_RGBP, "Palettized RGB with palette element R:G:B"),
+ A("RGBP"),
+
+ B(VLC_CODEC_RGB8, "8 bits RGB"),
+ A("RGB2"),
+ B(VLC_CODEC_RGB15, "15 bits RGB"),
+ A("RV15"),
+ B(VLC_CODEC_RGB16, "16 bits RGB"),
+ A("RV16"),
+ B(VLC_CODEC_RGB24, "24 bits RGB"),
+ A("RV24"),
+ B(VLC_CODEC_RGB32, "32 bits RGB"),
+ A("RV32"),
+ B(VLC_CODEC_RGBA, "32 bits RGBA"),
+ A("RGBA"),
+
+ B(VLC_CODEC_GREY, "8 bits greyscale"),
+ A("GREY"),
+ A("Y800"),
+ A("Y8 "),
+
+ B(VLC_CODEC_UYVY, "Packed YUV 4:2:2, U:Y:V:Y"),
+ A("UYVY"),
+ A("UYNV"),
+ A("Y422"),
+ A("2vuy"),
+ A("2Vuy"),
+ A("AVUI"),
+ B(VLC_CODEC_VYUY, "Packed YUV 4:2:2, V:Y:U:Y"),
+ A("VYUY"),
+ B(VLC_CODEC_YUYV, "Packed YUV 4:2:2, Y:U:Y:V"),
+ A("YUY2"),
+ A("YUYV"),
+ A("YUNV"),
+ B(VLC_CODEC_YVYU, "Packed YUV 4:2:2, Y:V:Y:U"),
+ A("YVYU"),
+
+ B(VLC_CODEC_Y211, "Packed YUV 2:1:1, Y:U:Y:V "),
+ A("Y211"),
+ B(VLC_CODEC_YMGA, "Planar Y, packed UV, from Matrox"),
+ A("YMGA"),
+ B(VLC_CODEC_CYUV, "Creative Packed YUV 4:2:2, U:Y:V:Y, reverted"),
+ A("cyuv"),
+ A("CYUV"),
+
+ B(VLC_CODEC_V210, "10-bit 4:2:2 Component YCbCr"),
+ A("v210"),
+
+ /* Videogames Codecs */
+
+ /* Interplay MVE */
+ B(VLC_CODEC_INTERPLAY, "Interplay MVE Video"),
+ A("imve"),
+ A("INPV"),
+
+ /* Id Quake II CIN */
+ B(VLC_CODEC_IDCIN, "Id Quake II CIN Video"),
+ A("IDCI"),
+
+ /* 4X Technologies */
+ B(VLC_CODEC_4XM, "4X Technologies Video"),
+ A("4XMV"),
+ A("4xmv"),
+
+ /* Id RoQ */
+ B(VLC_CODEC_ROQ, "Id RoQ Video"),
+ A("RoQv"),
+
+ /* Sony Playstation MDEC */
+ B(VLC_CODEC_MDEC, "PSX MDEC Video"),
+ A("MDEC"),
+
+ /* Sierra VMD */
+ B(VLC_CODEC_VMDVIDEO, "Sierra VMD Video"),
+ A("VMDV"),
+ A("vmdv"),
+
+ B(VLC_CODEC_DIRAC, "Dirac" ),
+ A("drac"),
+
+ /* Image */
+ B(VLC_CODEC_PNG, "PNG Image"),
+ A("png "),
+
+ B(VLC_CODEC_PPM, "PPM Image"),
+ A("ppm "),
+
+ B(VLC_CODEC_PGM, "PGM Image"),
+ A("pgm "),
+
+ B(VLC_CODEC_PGMYUV, "PGM YUV Image"),
+ A("pgmy"),
+
+ B(VLC_CODEC_PAM, "PAM Image"),
+ A("pam "),
+
+ B(VLC_CODEC_JPEGLS, "Lossless JPEG"),
+ A("MJLS"),
+
+ B(VLC_CODEC_JPEG, "JPEG"),
+ A("jpeg"),
+ A("JPEG"),
+
+ B(VLC_CODEC_BMP, "BMP Image"),
+ A("bmp "),
+
+ B(VLC_CODEC_TIFF, "TIFF Image"),
+ A("tiff"),
+
+ B(VLC_CODEC_GIF, "GIF Image"),
+ A("gif "),
+
+
+ B(VLC_CODEC_TARGA, "Truevision Targa Image"),
+ A("tga "),
+ A("mtga"),
+ A("MTGA"),
+
+ B(VLC_CODEC_SGI, "SGI Image"),
+ A("sgi "),
+
+ B(VLC_CODEC_PNM, "Portable Anymap Image"),
+ A("pnm "),
+
+ B(VLC_CODEC_PCX, "Personal Computer Exchange Image"),
+ A("pcx "),
+
+ B(0, "")
+};
+static const entry_t p_list_audio[] = {
+
+ /* Windows Media Audio 1 */
+ B(VLC_CODEC_WMA1, "Windows Media Audio 1"),
+ A("WMA1"),
+ A("wma1"),
+
+ /* Windows Media Audio 2 */
+ B(VLC_CODEC_WMA2, "Windows Media Audio 2"),
+ A("WMA2"),
+ A("wma2"),
+ A("wma "),
+
+ /* Windows Media Audio Professional */
+ B(VLC_CODEC_WMAP, "Windows Media Audio Professional"),
+ A("WMAP"),
+ A("wmap"),
+
+ /* Windows Media Audio Lossless */
+ B(VLC_CODEC_WMAL, "Windows Media Audio Lossless"),
+ A("WMAL"),
+ A("wmal"),
+
+ /* Windows Media Audio Speech */
+ B(VLC_CODEC_WMAS, "Windows Media Audio Speech"),
+ A("WMAS"),
+ A("wmas"),
+
+ /* DV Audio */
+ B(VLC_CODEC_DVAUDIO, "DV Audio"),
+ A("dvau"),
+ A("vdva"),
+ A("dvca"),
+ A("RADV"),
+
+ /* MACE-3 Audio */
+ B(VLC_CODEC_MACE3, "MACE-3 Audio"),
+ A("MAC3"),
+
+ /* MACE-6 Audio */
+ B(VLC_CODEC_MACE6, "MACE-6 Audio"),
+ A("MAC6"),
+
+ /* MUSEPACK7 Audio */
+ B(VLC_CODEC_MUSEPACK7, "MUSEPACK7 Audio"),
+ A("MPC "),
+
+ /* MUSEPACK8 Audio */
+ B(VLC_CODEC_MUSEPACK8, "MUSEPACK8 Audio"),
+ A("MPCK"),
+ A("MPC8"),
+
+ /* RealAudio 1.0 */
+ B(VLC_CODEC_RA_144, "RealAudio 1.0"),
+ A("14_4"),
+ A("lpcJ"),
+
+ /* RealAudio 2.0 */
+ B(VLC_CODEC_RA_288, "RealAudio 2.0"),
+ A("28_8"),
+
+ /* MPEG Audio layer 1/2/3 */
+ B(VLC_CODEC_MPGA, "MPEG Audio layer 1/2/3"),
+ A("mpga"),
+ A("mp3 "),
+ A(".mp3"),
+ A("MP3 "),
+ A("LAME"),
+ A("ms\x00\x50"),
+ A("ms\x00\x55"),
+
+ /* A52 Audio (aka AC3) */
+ B(VLC_CODEC_A52, "A52 Audio (aka AC3)"),
+ A("a52 "),
+ A("a52b"),
+ A("ac-3"),
+ A("ms\x20\x00"),
+
+ B(VLC_CODEC_EAC3, "A/52 B Audio (aka E-AC3)"),
+ A("eac3"),
+
+ /* DTS Audio */
+ B(VLC_CODEC_DTS, "DTS Audio"),
+ A("dts "),
+ A("dtsb"),
+ A("ms\x20\x01"),
+
+ /* AAC audio */
+ B(VLC_CODEC_MP4A, "MPEG AAC Audio"),
+ A("mp4a"),
+ A("aac "),
+
+ /* 4X Technologies */
+ B(VLC_CODEC_ADPCM_4XM, "4X Technologies Audio"),
+ A("4xma"),
+
+ /* EA ADPCM */
+ B(VLC_CODEC_ADPCM_EA, "EA ADPCM Audio"),
+ A("ADEA"),
+
+ /* Interplay DPCM */
+ B(VLC_CODEC_INTERPLAY_DPCM, "Interplay DPCM Audio"),
+ A("idpc"),
+
+ /* Id RoQ */
+ B(VLC_CODEC_ROQ_DPCM, "Id RoQ DPCM Audio"),
+ A("RoQa"),
+
+ /* DCIN Audio */
+ B(VLC_CODEC_DSICINAUDIO, "Delphine CIN Audio"),
+ A("DCIA"),
+
+ /* Sony Playstation XA ADPCM */
+ B(VLC_CODEC_ADPCM_XA, "PSX XA ADPCM Audio"),
+ A("xa "),
+
+ /* ADX ADPCM */
+ B(VLC_CODEC_ADPCM_ADX, "ADX ADPCM Audio"),
+ A("adx "),
+
+ /* Westwood ADPCM */
+ B(VLC_CODEC_ADPCM_IMA_WS, "Westwood IMA ADPCM audio"),
+ A("AIWS"),
+
+ /* Sierra VMD */
+ B(VLC_CODEC_VMDAUDIO, "Sierra VMD Audio"),
+ A("vmda"),
+
+ /* G.726 ADPCM */
+ B(VLC_CODEC_ADPCM_G726, "G.726 ADPCM Audio"),
+ A("g726"),
+
+ /* AMR */
+ B(VLC_CODEC_AMR_NB, "AMR narrow band"),
+ A("samr"),
+
+ B(VLC_CODEC_AMR_WB, "AMR wide band"),
+ A("sawb"),
+
+ /* FLAC */
+ B(VLC_CODEC_FLAC, "FLAC (Free Lossless Audio Codec)"),
+ A("flac"),
+
+ /* ALAC */
+ B(VLC_CODEC_ALAC, "Apple Lossless Audio Codec"),
+ A("alac"),
+
+ /* QDM2 */
+ B(VLC_CODEC_QDM2, "QDM2 Audio"),
+ A("QDM2"),
+
+ /* COOK */
+ B(VLC_CODEC_COOK, "Cook Audio"),
+ A("cook"),
+
+ /* TTA: The Lossless True Audio */
+ B(VLC_CODEC_TTA, "The Lossless True Audio"),
+ A("TTA1"),
+
+ /* Shorten */
+ B(VLC_CODEC_SHORTEN, "Shorten Lossless Audio"),
+ A("shn "),
+ A("shrn"),
+
+ B(VLC_CODEC_WAVPACK, "WavPack"),
+ A("WVPK"),
+ A("wvpk"),
+
+ B(VLC_CODEC_GSM, "GSM Audio"),
+ A("gsm "),
+
+ B(VLC_CODEC_GSM_MS, "Microsoft GSM Audio"),
+ A("agsm"),
+
+ B(VLC_CODEC_ATRAC3, "atrac 3"),
+ A("atrc"),
+ A("\x70\x02\x00\x00"),
+
+ B(VLC_CODEC_SONIC, "Sonic"),
+ A("SONC"),
+
+ B(VLC_CODEC_IMC, "IMC" ),
+ A("\x01\x04\x00\x00"),
+
+ B(VLC_CODEC_TRUESPEECH,"TrueSpeech"),
+ A("\x22\x00\x00\x00"),
+
+ B(VLC_CODEC_NELLYMOSER, "NellyMoser ASAO"),
+ A("NELL"),
+
+ B(VLC_CODEC_APE, "Monkey's Audio"),
+ A("APE "),
+
+ B(VLC_CODEC_MLP, "MLP/TrueHD Audio"),
+ A("mlp "),
+
+ B(VLC_CODEC_QCELP, "QCELP Audio"),
+ A("Qclp"),
+
+ B(VLC_CODEC_SPEEX, "Speex Audio"),
+ A("spx "),
+ A("spxr"),
+
+ B(VLC_CODEC_VORBIS, "Vorbis Audio"),
+ A("vorb"),
+
+ B(VLC_CODEC_302M, "302M Audio"),
+ A("302m"),
+
+ B(VLC_CODEC_DVD_LPCM, "DVD LPCM Audio"),
+ A("lpcm"),
+
+ B(VLC_CODEC_BD_LPCM, "BD LPCM Audio"),
+ A("bpcm"),
+
+ B(VLC_CODEC_SDDS, "SDDS Audio"),
+ A("sdds"),
+ A("sddb"),
+
+ B(VLC_CODEC_MIDI, "MIDI Audio"),
+ A("MIDI"),
+
+ /* PCM */
+ B(VLC_CODEC_S8, "PCM S8"),
+ A("s8 "),
+
+ B(VLC_CODEC_U8, "PCM U8"),
+ A("u8 "),
+
+ B(VLC_CODEC_S16L, "PCM S16 LE"),
+ A("s16l"),
+
+ B(VLC_CODEC_S16B, "PCM S16 BE"),
+ A("s16b"),
+
+ B(VLC_CODEC_U16L, "PCM U16 LE"),
+ A("u16l"),
+
+ B(VLC_CODEC_U16B, "PCM U16 BE"),
+ A("u16b"),
+
+ B(VLC_CODEC_S24L, "PCM S24 LE"),
+ A("s24l"),
+ A("42ni"), /* Quicktime */
+
+ B(VLC_CODEC_S24B, "PCM S24 BE"),
+ A("s24b"),
+ A("in24"), /* Quicktime */
+
+ B(VLC_CODEC_U24L, "PCM U24 LE"),
+ A("u24l"),
+
+ B(VLC_CODEC_U24B, "PCM U24 BE"),
+ A("u24b"),
+
+ B(VLC_CODEC_S32L, "PCM S32 LE"),
+ A("s32l"),
+ A("23ni"), /* Quicktime */
+
+ B(VLC_CODEC_S32B, "PCM S32 BE"),
+ A("s32b"),
+ A("in32"), /* Quicktime */
+
+ B(VLC_CODEC_U32L, "PCM U32 LE"),
+ A("u32l"),
+
+ B(VLC_CODEC_U32B, "PCM U32 BE"),
+ A("u32b"),
+
+ B(VLC_CODEC_ALAW, "PCM ALAW"),
+ A("alaw"),
+
+ B(VLC_CODEC_MULAW, "PCM MU-LAW"),
+ A("mlaw"),
+ A("ulaw"),
+
+ B(VLC_CODEC_S24DAUD, "PCM DAUD"),
+ A("daud"),
+
+ B(VLC_CODEC_FI32, "32 bits fixed float"),
+ A("fi32"),
+
+ B(VLC_CODEC_FL32, "32 bits float"),
+ A("fl32"),
+
+ B(VLC_CODEC_FL32, "64 bits float"),
+ A("fl64"),
+
+ B(0, "")
+};
+static const entry_t p_list_spu[] = {
+
+ B(VLC_CODEC_SPU, "DVD Subtitles"),
+ A("spu "),
+ A("spub"),
+
+ B(VLC_CODEC_DVBS, "DVB Subtitles"),
+ A("dvbs"),
+
+ B(VLC_CODEC_SUBT, "Text subtitles with various tags"),
+ A("subt"),
+
+ B(VLC_CODEC_XSUB, "DivX XSUB subtitles"),
+ A("XSUB"),
+ A("xsub"),
+
+ B(VLC_CODEC_SSA, "SubStation Alpha subtitles"),
+ A("ssa "),
+
+ B(VLC_CODEC_TEXT, "Plain text subtitles"),
+ A("TEXT"),
+
+ B(VLC_CODEC_TELETEXT, "Teletext"),
+ A("telx"),
+
+ B(VLC_CODEC_TELETEXT, "Kate subtiles"),
+ A("kate"),
+
+ B(VLC_CODEC_CMML, "CMML annotations/metadata"),
+ A("cmml"),
+
+ B(VLC_CODEC_ITU_T140, "ITU T.140 subtitles"),
+ A("t140"),
+
+ B(VLC_CODEC_ITU_T140, "ITU T.140 subtitles"),
+ A("t140"),
+
+ B(VLC_CODEC_USF, "USF subtitles"),
+ A("usf "),
+
+ B(VLC_CODEC_OGT, "OGT subtitles"),
+ A("ogt "),
+
+ B(VLC_CODEC_CVD, "CVD subtitles"),
+ A("cvd "),
+
+ B(0, "")
+};
+
+/* Create a fourcc from a string.
+ * XXX it assumes that the string is at least four bytes */
+static inline vlc_fourcc_t CreateFourcc( const char *psz_fourcc )
+{
+ return VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
+ psz_fourcc[2], psz_fourcc[3] );
+}
+
+/* */
+static entry_t Lookup( const entry_t p_list[], vlc_fourcc_t i_fourcc )
+{
+ const char *p_class = NULL;
+ const char *psz_description = NULL;
+
+ entry_t e = B(0, "");
+
+ for( int i = 0; ; i++ )
+ {
+ const entry_t *p = &p_list[i];
+ const vlc_fourcc_t i_entry_fourcc = CreateFourcc( p->p_fourcc );
+ const vlc_fourcc_t i_entry_class = CreateFourcc( p->p_class );
+
+ if( i_entry_fourcc == 0 )
+ break;
+
+ if( i_entry_class != 0 )
+ {
+ p_class = p->p_class;
+ psz_description = p->psz_description;
+ }
+
+ if( i_entry_fourcc == i_fourcc )
+ {
+ assert( p_class != NULL );
+
+ memcpy( e.p_class, p_class, 4 );
+ memcpy( e.p_fourcc, p->p_fourcc, 4 );
+ e.psz_description = p->psz_description ?: psz_description;
+ break;
+ }
+ }
+ return e;
+}
+
+/* */
+static entry_t Find( int i_cat, vlc_fourcc_t i_fourcc )
+{
+ entry_t e;
+
+ switch( i_cat )
+ {
+ case VIDEO_ES:
+ return Lookup( p_list_video, i_fourcc );
+ case AUDIO_ES:
+ return Lookup( p_list_audio, i_fourcc );
+ case SPU_ES:
+ return Lookup( p_list_spu, i_fourcc );
+
+ default:
+ e = Find( VIDEO_ES, i_fourcc );
+ if( CreateFourcc( e.p_class ) == 0 )
+ e = Find( AUDIO_ES, i_fourcc );
+ if( CreateFourcc( e.p_class ) == 0 )
+ e = Find( SPU_ES, i_fourcc );
+ return e;
+ }
+}
+
+/* */
+vlc_fourcc_t vlc_fourcc_GetCodec( int i_cat, vlc_fourcc_t i_fourcc )
+{
+ entry_t e = Find( i_cat, i_fourcc );
+
+ if( CreateFourcc( e.p_class ) == 0 )
+ return i_fourcc;
+ return CreateFourcc( e.p_class );
+}
+
+vlc_fourcc_t vlc_fourcc_GetCodecFromString( int i_cat, const char *psz_fourcc )
+{
+ if( !psz_fourcc || strlen(psz_fourcc) != 4 )
+ return 0;
+ return vlc_fourcc_GetCodec( i_cat,
+ VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
+ psz_fourcc[2], psz_fourcc[3] ) );
+}
+
+vlc_fourcc_t vlc_fourcc_GetCodecAudio( vlc_fourcc_t i_fourcc, int i_bits )
+{
+ const int i_bytes = ( i_bits + 7 ) / 8;
+
+ if( i_fourcc == VLC_FOURCC( 'a', 'f', 'l', 't' ) )
+ {
+ switch( i_bytes )
+ {
+ case 4:
+ return VLC_CODEC_FL32;
+ case 8:
+ return VLC_CODEC_FL64;
+ default:
+ return 0;
+ }
+ }
+ else if( i_fourcc == VLC_FOURCC( 'a', 'r', 'a', 'w' ) ||
+ i_fourcc == VLC_FOURCC( 'p', 'c', 'm', ' ' ) )
+ {
+ switch( i_bytes )
+ {
+ case 1:
+ return VLC_CODEC_U8;
+ case 2:
+ return VLC_CODEC_S16L;
+ case 3:
+ return VLC_CODEC_S24L;
+ break;
+ case 4:
+ return VLC_CODEC_S32L;
+ default:
+ return 0;
+ }
+ }
+ else if( i_fourcc == VLC_FOURCC( 't', 'w', 'o', 's' ) )
+ {
+ switch( i_bytes )
+ {
+ case 1:
+ return VLC_CODEC_S8;
+ case 2:
+ return VLC_CODEC_S16B;
+ case 3:
+ return VLC_CODEC_S24B;
+ case 4:
+ return VLC_CODEC_S32B;
+ default:
+ return 0;
+ }
+ }
+ else if( i_fourcc == VLC_FOURCC( 's', 'o', 'w', 't' ) )
+ {
+ switch( i_bytes )
+ {
+ case 1:
+ return VLC_CODEC_S8;
+ case 2:
+ return VLC_CODEC_S16L;
+ case 3:
+ return VLC_CODEC_S24L;
+ case 4:
+ return VLC_CODEC_S32L;
+ default:
+ return 0;
+ }
+ }
+ else
+ {
+ return vlc_fourcc_GetCodec( AUDIO_ES, i_fourcc );
+ }
+}
+
+/* */
+const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc )
+{
+ entry_t e = Find( i_cat, i_fourcc );
+
+ return e.psz_description;
+}
+
} ext_table[] =
{
- { VLC_FOURCC('j','p','e','g'), "jpeg" },
- { VLC_FOURCC('j','p','e','g'), "jpg" },
- { VLC_FOURCC('l','j','p','g'), "ljpg" },
- { VLC_FOURCC('p','n','g',' '), "png" },
- { VLC_FOURCC('p','g','m',' '), "pgm" },
- { VLC_FOURCC('p','g','m','y'), "pgmyuv" },
+ { VLC_CODEC_JPEG, "jpeg" },
+ { VLC_CODEC_JPEG, "jpg" },
+ { VLC_CODEC_JPEGLS, "ljpg" },
+ { VLC_CODEC_PNG, "png" },
+ { VLC_CODEC_PGM, "pgm" },
+ { VLC_CODEC_PGMYUV, "pgmyuv" },
{ VLC_FOURCC('p','b','m',' '), "pbm" },
{ VLC_FOURCC('p','a','m',' '), "pam" },
- { VLC_FOURCC('t','g','a',' '), "tga" },
- { VLC_FOURCC('b','m','p',' '), "bmp" },
- { VLC_FOURCC('p','n','m',' '), "pnm" },
+ { VLC_CODEC_TARGA, "tga" },
+ { VLC_CODEC_BMP, "bmp" },
+ { VLC_CODEC_PNM, "pnm" },
{ VLC_FOURCC('x','p','m',' '), "xpm" },
{ VLC_FOURCC('x','c','f',' '), "xcf" },
- { VLC_FOURCC('p','c','x',' '), "pcx" },
- { VLC_FOURCC('g','i','f',' '), "gif" },
- { VLC_FOURCC('t','i','f','f'), "tif" },
- { VLC_FOURCC('t','i','f','f'), "tiff" },
+ { VLC_CODEC_PCX, "pcx" },
+ { VLC_CODEC_GIF, "gif" },
+ { VLC_CODEC_TIFF, "tif" },
+ { VLC_CODEC_TIFF, "tiff" },
{ VLC_FOURCC('l','b','m',' '), "lbm" },
{ 0, NULL }
};
const char *psz_mime;
} mime_table[] =
{
- { VLC_FOURCC('b','m','p',' '), "image/bmp" },
- { VLC_FOURCC('b','m','p',' '), "image/x-bmp" },
- { VLC_FOURCC('b','m','p',' '), "image/x-bitmap" },
- { VLC_FOURCC('b','m','p',' '), "image/x-ms-bmp" },
- { VLC_FOURCC('p','n','m',' '), "image/x-portable-anymap" },
- { VLC_FOURCC('p','n','m',' '), "image/x-portable-bitmap" },
- { VLC_FOURCC('p','n','m',' '), "image/x-portable-graymap" },
- { VLC_FOURCC('p','n','m',' '), "image/x-portable-pixmap" },
- { VLC_FOURCC('g','i','f',' '), "image/gif" },
- { VLC_FOURCC('j','p','e','g'), "image/jpeg" },
- { VLC_FOURCC('p','c','x',' '), "image/pcx" },
- { VLC_FOURCC('p','n','g',' '), "image/png" },
- { VLC_FOURCC('t','i','f','f'), "image/tiff" },
- { VLC_FOURCC('t','g','a',' '), "iamge/x-tga" },
+ { VLC_CODEC_BMP, "image/bmp" },
+ { VLC_CODEC_BMP, "image/x-bmp" },
+ { VLC_CODEC_BMP, "image/x-bitmap" },
+ { VLC_CODEC_BMP, "image/x-ms-bmp" },
+ { VLC_CODEC_PNM, "image/x-portable-anymap" },
+ { VLC_CODEC_PNM, "image/x-portable-bitmap" },
+ { VLC_CODEC_PNM, "image/x-portable-graymap" },
+ { VLC_CODEC_PNM, "image/x-portable-pixmap" },
+ { VLC_CODEC_GIF, "image/gif" },
+ { VLC_CODEC_JPEG, "image/jpeg" },
+ { VLC_CODEC_PCX, "image/pcx" },
+ { VLC_CODEC_PNG, "image/png" },
+ { VLC_CODEC_TIFF, "image/tiff" },
+ { VLC_CODEC_TARGA, "iamge/x-tga" },
{ VLC_FOURCC('x','p','m',' '), "image/x-xpixmap" },
{ 0, NULL }
};
--- /dev/null
+/*****************************************************************************
+ * pthread.c : pthread back-end for LibVLC
+ *****************************************************************************
+ * Copyright (C) 1999-2009 the VideoLAN team
+ *
+ * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
+ * Samuel Hocevar <sam@zoy.org>
+ * Gildas Bazin <gbazin@netcourrier.com>
+ * Clément Sténac
+ * Rémi Denis-Courmont
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+
+#include "libvlc.h"
+#include <stdarg.h>
+#include <assert.h>
+#include <unistd.h> /* fsync() */
+#include <signal.h>
+
+#include <sched.h>
+#ifdef __linux__
+# include <sys/syscall.h> /* SYS_gettid */
+#endif
+
+#ifdef HAVE_EXECINFO_H
+# include <execinfo.h>
+#endif
+
+#ifdef __APPLE__
+# include <sys/time.h> /* gettimeofday in vlc_cond_timedwait */
+#endif
+
+/**
+ * Print a backtrace to the standard error for debugging purpose.
+ */
+void vlc_trace (const char *fn, const char *file, unsigned line)
+{
+ fprintf (stderr, "at %s:%u in %s\n", file, line, fn);
+ fflush (stderr); /* needed before switch to low-level I/O */
+#ifdef HAVE_BACKTRACE
+ void *stack[20];
+ int len = backtrace (stack, sizeof (stack) / sizeof (stack[0]));
+ backtrace_symbols_fd (stack, len, 2);
+#endif
+ fsync (2);
+}
+
+static inline unsigned long vlc_threadid (void)
+{
+#if defined (__linux__)
+ /* glibc does not provide a call for this */
+ return syscall (SYS_gettid);
+
+#else
+ union { pthread_t th; unsigned long int i; } v = { };
+ v.th = pthread_self ();
+ return v.i;
+
+#endif
+}
+
+#ifndef NDEBUG
+/*****************************************************************************
+ * vlc_thread_fatal: Report an error from the threading layer
+ *****************************************************************************
+ * This is mostly meant for debugging.
+ *****************************************************************************/
+static void
+vlc_thread_fatal (const char *action, int error,
+ const char *function, const char *file, unsigned line)
+{
+ fprintf (stderr, "LibVLC fatal error %s (%d) in thread %lu ",
+ action, error, vlc_threadid ());
+ vlc_trace (function, file, line);
+
+ /* Sometimes strerror_r() crashes too, so make sure we print an error
+ * message before we invoke it */
+#ifdef __GLIBC__
+ /* Avoid the strerror_r() prototype brain damage in glibc */
+ errno = error;
+ fprintf (stderr, " Error message: %m\n");
+#else
+ char buf[1000];
+ const char *msg;
+
+ switch (strerror_r (error, buf, sizeof (buf)))
+ {
+ case 0:
+ msg = buf;
+ break;
+ case ERANGE: /* should never happen */
+ msg = "unknwon (too big to display)";
+ break;
+ default:
+ msg = "unknown (invalid error number)";
+ break;
+ }
+ fprintf (stderr, " Error message: %s\n", msg);
+#endif
+ fflush (stderr);
+
+ abort ();
+}
+
+# define VLC_THREAD_ASSERT( action ) \
+ if (val) vlc_thread_fatal (action, val, __func__, __FILE__, __LINE__)
+#else
+# define VLC_THREAD_ASSERT( action ) ((void)val)
+#endif
+
+#if defined (__GLIBC__) && (__GLIBC_MINOR__ < 6)
+/* This is not prototyped under glibc, though it exists. */
+int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
+#endif
+
+/*****************************************************************************
+ * vlc_mutex_init: initialize a mutex
+ *****************************************************************************/
+int vlc_mutex_init( vlc_mutex_t *p_mutex )
+{
+ pthread_mutexattr_t attr;
+ int i_result;
+
+ pthread_mutexattr_init( &attr );
+
+#ifndef NDEBUG
+ /* Create error-checking mutex to detect problems more easily. */
+# if defined (__GLIBC__) && (__GLIBC_MINOR__ < 6)
+ pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_ERRORCHECK_NP );
+# else
+ pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK );
+# endif
+#endif
+ i_result = pthread_mutex_init( p_mutex, &attr );
+ pthread_mutexattr_destroy( &attr );
+ return i_result;
+}
+
+/*****************************************************************************
+ * vlc_mutex_init: initialize a recursive mutex (Do not use)
+ *****************************************************************************/
+int vlc_mutex_init_recursive( vlc_mutex_t *p_mutex )
+{
+ pthread_mutexattr_t attr;
+ int i_result;
+
+ pthread_mutexattr_init( &attr );
+#if defined (__GLIBC__) && (__GLIBC_MINOR__ < 6)
+ pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_RECURSIVE_NP );
+#else
+ pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE );
+#endif
+ i_result = pthread_mutex_init( p_mutex, &attr );
+ pthread_mutexattr_destroy( &attr );
+ return( i_result );
+}
+
+
+/**
+ * Destroys a mutex. The mutex must not be locked.
+ *
+ * @param p_mutex mutex to destroy
+ * @return always succeeds
+ */
+void vlc_mutex_destroy (vlc_mutex_t *p_mutex)
+{
+ int val = pthread_mutex_destroy( p_mutex );
+ VLC_THREAD_ASSERT ("destroying mutex");
+}
+
+#ifndef NDEBUG
+# ifdef HAVE_VALGRIND_VALGRIND_H
+# include <valgrind/valgrind.h>
+# else
+# define RUNNING_ON_VALGRIND (0)
+# endif
+
+void vlc_assert_locked (vlc_mutex_t *p_mutex)
+{
+ if (RUNNING_ON_VALGRIND > 0)
+ return;
+ assert (pthread_mutex_lock (p_mutex) == EDEADLK);
+}
+#endif
+
+/**
+ * Acquires a mutex. If needed, waits for any other thread to release it.
+ * Beware of deadlocks when locking multiple mutexes at the same time,
+ * or when using mutexes from callbacks.
+ * This function is not a cancellation-point.
+ *
+ * @param p_mutex mutex initialized with vlc_mutex_init() or
+ * vlc_mutex_init_recursive()
+ */
+void vlc_mutex_lock (vlc_mutex_t *p_mutex)
+{
+ int val = pthread_mutex_lock( p_mutex );
+ VLC_THREAD_ASSERT ("locking mutex");
+}
+
+/**
+ * Acquires a mutex if and only if it is not currently held by another thread.
+ * This function never sleeps and can be used in delay-critical code paths.
+ * This function is not a cancellation-point.
+ *
+ * <b>Beware</b>: If this function fails, then the mutex is held... by another
+ * thread. The calling thread must deal with the error appropriately. That
+ * typically implies postponing the operations that would have required the
+ * mutex. If the thread cannot defer those operations, then it must use
+ * vlc_mutex_lock(). If in doubt, use vlc_mutex_lock() instead.
+ *
+ * @param p_mutex mutex initialized with vlc_mutex_init() or
+ * vlc_mutex_init_recursive()
+ * @return 0 if the mutex could be acquired, an error code otherwise.
+ */
+int vlc_mutex_trylock (vlc_mutex_t *p_mutex)
+{
+ int val = pthread_mutex_trylock( p_mutex );
+
+ if (val != EBUSY)
+ VLC_THREAD_ASSERT ("locking mutex");
+ return val;
+}
+
+/**
+ * Releases a mutex (or crashes if the mutex is not locked by the caller).
+ * @param p_mutex mutex locked with vlc_mutex_lock().
+ */
+void vlc_mutex_unlock (vlc_mutex_t *p_mutex)
+{
+ int val = pthread_mutex_unlock( p_mutex );
+ VLC_THREAD_ASSERT ("unlocking mutex");
+}
+
+/*****************************************************************************
+ * vlc_cond_init: initialize a condition variable
+ *****************************************************************************/
+int vlc_cond_init( vlc_cond_t *p_condvar )
+{
+ pthread_condattr_t attr;
+ int ret;
+
+ ret = pthread_condattr_init (&attr);
+ if (ret)
+ return ret;
+
+#if !defined (_POSIX_CLOCK_SELECTION)
+ /* Fairly outdated POSIX support (that was defined in 2001) */
+# define _POSIX_CLOCK_SELECTION (-1)
+#endif
+#if (_POSIX_CLOCK_SELECTION >= 0)
+ /* NOTE: This must be the same clock as the one in mtime.c */
+ pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
+#endif
+
+ ret = pthread_cond_init (p_condvar, &attr);
+ pthread_condattr_destroy (&attr);
+ return ret;
+}
+
+/**
+ * Destroys a condition variable. No threads shall be waiting or signaling the
+ * condition.
+ * @param p_condvar condition variable to destroy
+ */
+void vlc_cond_destroy (vlc_cond_t *p_condvar)
+{
+ int val = pthread_cond_destroy( p_condvar );
+ VLC_THREAD_ASSERT ("destroying condition");
+}
+
+/**
+ * Wakes up one thread waiting on a condition variable, if any.
+ * @param p_condvar condition variable
+ */
+void vlc_cond_signal (vlc_cond_t *p_condvar)
+{
+ int val = pthread_cond_signal( p_condvar );
+ VLC_THREAD_ASSERT ("signaling condition variable");
+}
+
+/**
+ * Wakes up all threads (if any) waiting on a condition variable.
+ * @param p_cond condition variable
+ */
+void vlc_cond_broadcast (vlc_cond_t *p_condvar)
+{
+ pthread_cond_broadcast (p_condvar);
+}
+
+/**
+ * Waits for a condition variable. The calling thread will be suspended until
+ * another thread calls vlc_cond_signal() or vlc_cond_broadcast() on the same
+ * condition variable, the thread is cancelled with vlc_cancel(), or the
+ * system causes a "spurious" unsolicited wake-up.
+ *
+ * A mutex is needed to wait on a condition variable. It must <b>not</b> be
+ * a recursive mutex. Although it is possible to use the same mutex for
+ * multiple condition, it is not valid to use different mutexes for the same
+ * condition variable at the same time from different threads.
+ *
+ * In case of thread cancellation, the mutex is always locked before
+ * cancellation proceeds.
+ *
+ * The canonical way to use a condition variable to wait for event foobar is:
+ @code
+ vlc_mutex_lock (&lock);
+ mutex_cleanup_push (&lock); // release the mutex in case of cancellation
+
+ while (!foobar)
+ vlc_cond_wait (&wait, &lock);
+
+ --- foobar is now true, do something about it here --
+
+ vlc_cleanup_run (); // release the mutex
+ @endcode
+ *
+ * @param p_condvar condition variable to wait on
+ * @param p_mutex mutex which is unlocked while waiting,
+ * then locked again when waking up.
+ * @param deadline <b>absolute</b> timeout
+ *
+ * @return 0 if the condition was signaled, an error code in case of timeout.
+ */
+void vlc_cond_wait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
+{
+ int val = pthread_cond_wait( p_condvar, p_mutex );
+ VLC_THREAD_ASSERT ("waiting on condition");
+}
+
+/**
+ * Waits for a condition variable up to a certain date.
+ * This works like vlc_cond_wait(), except for the additional timeout.
+ *
+ * @param p_condvar condition variable to wait on
+ * @param p_mutex mutex which is unlocked while waiting,
+ * then locked again when waking up.
+ * @param deadline <b>absolute</b> timeout
+ *
+ * @return 0 if the condition was signaled, an error code in case of timeout.
+ */
+int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
+ mtime_t deadline)
+{
+#ifdef __APPLE__
+ /* mdate() is mac_absolute_time on OSX, which we must convert to do
+ * the same base than gettimeofday() which pthread_cond_timedwait
+ * relies on. */
+ mtime_t oldbase = mdate();
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ mtime_t newbase = (mtime_t)tv.tv_sec * 1000000 + (mtime_t) tv.tv_usec;
+ deadline = deadline - oldbase + newbase;
+#endif
+ lldiv_t d = lldiv( deadline, CLOCK_FREQ );
+ struct timespec ts = { d.quot, d.rem * (1000000000 / CLOCK_FREQ) };
+
+ int val = pthread_cond_timedwait (p_condvar, p_mutex, &ts);
+ if (val != ETIMEDOUT)
+ VLC_THREAD_ASSERT ("timed-waiting on condition");
+ return val;
+}
+
+/**
+ * Allocates a thread-specific variable.
+ * @param key where to store the thread-specific variable handle
+ * @param destr a destruction callback. It is called whenever a thread exits
+ * and the thread-specific variable has a non-NULL value.
+ * @return 0 on success, a system error code otherwise. This function can
+ * actually fail because there is a fixed limit on the number of
+ * thread-specific variable in a process on most systems.
+ */
+int vlc_threadvar_create (vlc_threadvar_t *key, void (*destr) (void *))
+{
+ return pthread_key_create (key, destr);
+}
+
+void vlc_threadvar_delete (vlc_threadvar_t *p_tls)
+{
+ pthread_key_delete (*p_tls);
+}
+
+/**
+ * Sets a thread-specific variable.
+ * @param key thread-local variable key (created with vlc_threadvar_create())
+ * @param value new value for the variable for the calling thread
+ * @return 0 on success, a system error code otherwise.
+ */
+int vlc_threadvar_set (vlc_threadvar_t key, void *value)
+{
+ return pthread_setspecific (key, value);
+}
+
+/**
+ * Gets the value of a thread-local variable for the calling thread.
+ * This function cannot fail.
+ * @return the value associated with the given variable for the calling
+ * or NULL if there is no value.
+ */
+void *vlc_threadvar_get (vlc_threadvar_t key)
+{
+ return pthread_getspecific (key);
+}
+
+/**
+ * Creates and starts new thread.
+ *
+ * @param p_handle [OUT] pointer to write the handle of the created thread to
+ * @param entry entry point for the thread
+ * @param data data parameter given to the entry point
+ * @param priority thread priority value
+ * @return 0 on success, a standard error code on error.
+ */
+int vlc_clone (vlc_thread_t *p_handle, void * (*entry) (void *), void *data,
+ int priority)
+{
+ int ret;
+
+ pthread_attr_t attr;
+ pthread_attr_init (&attr);
+
+ /* Block the signals that signals interface plugin handles.
+ * If the LibVLC caller wants to handle some signals by itself, it should
+ * block these before whenever invoking LibVLC. And it must obviously not
+ * start the VLC signals interface plugin.
+ *
+ * LibVLC will normally ignore any interruption caused by an asynchronous
+ * signal during a system call. But there may well be some buggy cases
+ * where it fails to handle EINTR (bug reports welcome). Some underlying
+ * libraries might also not handle EINTR properly.
+ */
+ sigset_t oldset;
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ sigdelset (&set, SIGHUP);
+ sigaddset (&set, SIGINT);
+ sigaddset (&set, SIGQUIT);
+ sigaddset (&set, SIGTERM);
+
+ sigaddset (&set, SIGPIPE); /* We don't want this one, really! */
+ pthread_sigmask (SIG_BLOCK, &set, &oldset);
+ }
+
+#if defined (_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING >= 0) \
+ && defined (_POSIX_THREAD_PRIORITY_SCHEDULING) \
+ && (_POSIX_THREAD_PRIORITY_SCHEDULING >= 0)
+ {
+ struct sched_param sp = { .sched_priority = priority, };
+ int policy;
+
+ if (sp.sched_priority <= 0)
+ sp.sched_priority += sched_get_priority_max (policy = SCHED_OTHER);
+ else
+ sp.sched_priority += sched_get_priority_min (policy = SCHED_RR);
+
+ pthread_attr_setschedpolicy (&attr, policy);
+ pthread_attr_setschedparam (&attr, &sp);
+ }
+#else
+ (void) priority;
+#endif
+
+ /* The thread stack size.
+ * The lower the value, the less address space per thread, the highest
+ * maximum simultaneous threads per process. Too low values will cause
+ * stack overflows and weird crashes. Set with caution. Also keep in mind
+ * that 64-bits platforms consume more stack than 32-bits one.
+ *
+ * Thanks to on-demand paging, thread stack size only affects address space
+ * consumption. In terms of memory, threads only use what they need
+ * (rounded up to the page boundary).
+ *
+ * For example, on Linux i386, the default is 2 mega-bytes, which supports
+ * about 320 threads per processes. */
+#define VLC_STACKSIZE (128 * sizeof (void *) * 1024)
+
+#ifdef VLC_STACKSIZE
+ ret = pthread_attr_setstacksize (&attr, VLC_STACKSIZE);
+ assert (ret == 0); /* fails iif VLC_STACKSIZE is invalid */
+#endif
+
+ ret = pthread_create (p_handle, &attr, entry, data);
+ pthread_sigmask (SIG_SETMASK, &oldset, NULL);
+ pthread_attr_destroy (&attr);
+ return ret;
+}
+
+/**
+ * Marks a thread as cancelled. Next time the target thread reaches a
+ * cancellation point (while not having disabled cancellation), it will
+ * run its cancellation cleanup handler, the thread variable destructors, and
+ * terminate. vlc_join() must be used afterward regardless of a thread being
+ * cancelled or not.
+ */
+void vlc_cancel (vlc_thread_t thread_id)
+{
+ pthread_cancel (thread_id);
+}
+
+/**
+ * Waits for a thread to complete (if needed), and destroys it.
+ * This is a cancellation point; in case of cancellation, the join does _not_
+ * occur.
+ *
+ * @param handle thread handle
+ * @param p_result [OUT] pointer to write the thread return value or NULL
+ * @return 0 on success, a standard error code otherwise.
+ */
+void vlc_join (vlc_thread_t handle, void **result)
+{
+ int val = pthread_join (handle, result);
+ VLC_THREAD_ASSERT ("joining thread");
+}
+
+/**
+ * Save the current cancellation state (enabled or disabled), then disable
+ * cancellation for the calling thread.
+ * This function must be called before entering a piece of code that is not
+ * cancellation-safe, unless it can be proven that the calling thread will not
+ * be cancelled.
+ * @return Previous cancellation state (opaque value for vlc_restorecancel()).
+ */
+int vlc_savecancel (void)
+{
+ int state;
+ int val = pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
+
+ VLC_THREAD_ASSERT ("saving cancellation");
+ return state;
+}
+
+/**
+ * Restore the cancellation state for the calling thread.
+ * @param state previous state as returned by vlc_savecancel().
+ * @return Nothing, always succeeds.
+ */
+void vlc_restorecancel (int state)
+{
+#ifndef NDEBUG
+ int oldstate, val;
+
+ val = pthread_setcancelstate (state, &oldstate);
+ /* This should fail if an invalid value for given for state */
+ VLC_THREAD_ASSERT ("restoring cancellation");
+
+ if (oldstate != PTHREAD_CANCEL_DISABLE)
+ vlc_thread_fatal ("restoring cancellation while not disabled", EINVAL,
+ __func__, __FILE__, __LINE__);
+#else
+ pthread_setcancelstate (state, NULL);
+#endif
+}
+
+/**
+ * Issues an explicit deferred cancellation point.
+ * This has no effect if thread cancellation is disabled.
+ * This can be called when there is a rather slow non-sleeping operation.
+ * This is also used to force a cancellation point in a function that would
+ * otherwise "not always" be a one (block_FifoGet() is an example).
+ */
+void vlc_testcancel (void)
+{
+ pthread_testcancel ();
+}
+
+void vlc_control_cancel (int cmd, ...)
+{
+ (void) cmd;
+ assert (0);
+}
#include <vlc_common.h>
#include "libvlc.h"
-#include <stdarg.h>
#include <assert.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
-#include <signal.h>
#if defined( LIBVLC_USE_PTHREAD )
# include <sched.h>
-# ifdef __linux__
-# include <sys/syscall.h> /* SYS_gettid */
-# endif
-#else
-static vlc_threadvar_t cancel_key;
-#endif
-
-#ifdef HAVE_EXECINFO_H
-# include <execinfo.h>
-#endif
-
-#ifdef __APPLE__
-# include <sys/time.h> /* gettimeofday in vlc_cond_timedwait */
-#endif
-
-/**
- * Print a backtrace to the standard error for debugging purpose.
- */
-void vlc_trace (const char *fn, const char *file, unsigned line)
-{
- fprintf (stderr, "at %s:%u in %s\n", file, line, fn);
- fflush (stderr); /* needed before switch to low-level I/O */
-#ifdef HAVE_BACKTRACE
- void *stack[20];
- int len = backtrace (stack, sizeof (stack) / sizeof (stack[0]));
- backtrace_symbols_fd (stack, len, 2);
-#endif
-#ifndef WIN32
- fsync (2);
-#endif
-}
-
-static inline unsigned long vlc_threadid (void)
-{
-#if defined (LIBVLC_USE_PTHREAD)
-# if defined (__linux__)
- return syscall (SYS_gettid);
-
-# else
- union { pthread_t th; unsigned long int i; } v = { };
- v.th = pthread_self ();
- return v.i;
-
-#endif
-#elif defined (WIN32)
- return GetCurrentThreadId ();
-
-#else
- return 0;
-
-#endif
-}
-
-#ifndef NDEBUG
-/*****************************************************************************
- * vlc_thread_fatal: Report an error from the threading layer
- *****************************************************************************
- * This is mostly meant for debugging.
- *****************************************************************************/
-static void
-vlc_thread_fatal (const char *action, int error,
- const char *function, const char *file, unsigned line)
-{
- fprintf (stderr, "LibVLC fatal error %s (%d) in thread %lu ",
- action, error, vlc_threadid ());
- vlc_trace (function, file, line);
-
- /* Sometimes strerror_r() crashes too, so make sure we print an error
- * message before we invoke it */
-#ifdef __GLIBC__
- /* Avoid the strerror_r() prototype brain damage in glibc */
- errno = error;
- fprintf (stderr, " Error message: %m\n");
-#elif !defined (WIN32)
- char buf[1000];
- const char *msg;
-
- switch (strerror_r (error, buf, sizeof (buf)))
- {
- case 0:
- msg = buf;
- break;
- case ERANGE: /* should never happen */
- msg = "unknwon (too big to display)";
- break;
- default:
- msg = "unknown (invalid error number)";
- break;
- }
- fprintf (stderr, " Error message: %s\n", msg);
-#endif
- fflush (stderr);
-
- abort ();
-}
-
-# define VLC_THREAD_ASSERT( action ) \
- if (val) vlc_thread_fatal (action, val, __func__, __FILE__, __LINE__)
-#else
-# define VLC_THREAD_ASSERT( action ) ((void)val)
-#endif
-
-/**
- * Per-thread cancellation data
- */
-#ifndef LIBVLC_USE_PTHREAD_CANCEL
-typedef struct vlc_cancel_t
-{
- vlc_cleanup_t *cleaners;
- bool killable;
- bool killed;
-# ifdef UNDER_CE
- HANDLE cancel_event;
-# endif
-} vlc_cancel_t;
-
-# ifndef UNDER_CE
-# define VLC_CANCEL_INIT { NULL, true, false }
-# else
-# define VLC_CANCEL_INIT { NULL, true, false, NULL }
-# endif
-#endif
-
-#ifdef UNDER_CE
-static void CALLBACK vlc_cancel_self (ULONG_PTR dummy);
-
-static DWORD vlc_cancelable_wait (DWORD count, const HANDLE *handles,
- DWORD delay)
-{
- vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
- if (nfo == NULL)
- {
- /* Main thread - cannot be cancelled anyway */
- return WaitForMultipleObjects (count, handles, FALSE, delay);
- }
- HANDLE new_handles[count + 1];
- memcpy(new_handles, handles, count * sizeof(HANDLE));
- new_handles[count] = nfo->cancel_event;
- DWORD result = WaitForMultipleObjects (count + 1, new_handles, FALSE,
- delay);
- if (result == WAIT_OBJECT_0 + count)
- {
- vlc_cancel_self (NULL);
- return WAIT_IO_COMPLETION;
- }
- else
- {
- return result;
- }
-}
-
-DWORD SleepEx (DWORD dwMilliseconds, BOOL bAlertable)
-{
- if (bAlertable)
- {
- DWORD result = vlc_cancelable_wait (0, NULL, dwMilliseconds);
- return (result == WAIT_TIMEOUT) ? 0 : WAIT_IO_COMPLETION;
- }
- else
- {
- Sleep(dwMilliseconds);
- return 0;
- }
-}
-
-DWORD WaitForSingleObjectEx (HANDLE hHandle, DWORD dwMilliseconds,
- BOOL bAlertable)
-{
- if (bAlertable)
- {
- /* The MSDN documentation specifies different return codes,
- * but in practice they are the same. We just check that it
- * remains so. */
-#if WAIT_ABANDONED != WAIT_ABANDONED_0
-# error Windows headers changed, code needs to be rewritten!
-#endif
- return vlc_cancelable_wait (1, &hHandle, dwMilliseconds);
- }
- else
- {
- return WaitForSingleObject (hHandle, dwMilliseconds);
- }
-}
-
-DWORD WaitForMultipleObjectsEx (DWORD nCount, const HANDLE *lpHandles,
- BOOL bWaitAll, DWORD dwMilliseconds,
- BOOL bAlertable)
-{
- if (bAlertable)
- {
- /* We do not support the bWaitAll case */
- assert (! bWaitAll);
- return vlc_cancelable_wait (nCount, lpHandles, dwMilliseconds);
- }
- else
- {
- return WaitForMultipleObjects (nCount, lpHandles, bWaitAll,
- dwMilliseconds);
- }
-}
-#endif
-
-#ifdef WIN32
-static vlc_mutex_t super_mutex;
-
-BOOL WINAPI DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
-{
- (void) hinstDll;
- (void) lpvReserved;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- vlc_mutex_init (&super_mutex);
- vlc_threadvar_create (&cancel_key, free);
- break;
-
- case DLL_PROCESS_DETACH:
- vlc_threadvar_delete( &cancel_key );
- vlc_mutex_destroy (&super_mutex);
- break;
- }
- return TRUE;
-}
-#endif
-
-#if defined (__GLIBC__) && (__GLIBC_MINOR__ < 6)
-/* This is not prototyped under glibc, though it exists. */
-int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
-#endif
-
-/*****************************************************************************
- * vlc_mutex_init: initialize a mutex
- *****************************************************************************/
-int vlc_mutex_init( vlc_mutex_t *p_mutex )
-{
-#if defined( LIBVLC_USE_PTHREAD )
- pthread_mutexattr_t attr;
- int i_result;
-
- pthread_mutexattr_init( &attr );
-
-# ifndef NDEBUG
- /* Create error-checking mutex to detect problems more easily. */
-# if defined (__GLIBC__) && (__GLIBC_MINOR__ < 6)
- pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_ERRORCHECK_NP );
-# else
- pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK );
-# endif
-# endif
- i_result = pthread_mutex_init( p_mutex, &attr );
- pthread_mutexattr_destroy( &attr );
- return i_result;
-
-#elif defined( WIN32 )
- /* This creates a recursive mutex. This is OK as fast mutexes have
- * no defined behavior in case of recursive locking. */
- InitializeCriticalSection (&p_mutex->mutex);
- p_mutex->initialized = 1;
- return 0;
-
-#endif
-}
-
-/*****************************************************************************
- * vlc_mutex_init: initialize a recursive mutex (Do not use)
- *****************************************************************************/
-int vlc_mutex_init_recursive( vlc_mutex_t *p_mutex )
-{
-#if defined( LIBVLC_USE_PTHREAD )
- pthread_mutexattr_t attr;
- int i_result;
-
- pthread_mutexattr_init( &attr );
-# if defined (__GLIBC__) && (__GLIBC_MINOR__ < 6)
- pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_RECURSIVE_NP );
-# else
- pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE );
-# endif
- i_result = pthread_mutex_init( p_mutex, &attr );
- pthread_mutexattr_destroy( &attr );
- return( i_result );
-
-#elif defined( WIN32 )
- InitializeCriticalSection( &p_mutex->mutex );
- p_mutex->initialized = 1;
- return 0;
-
-#endif
-}
-
-
-/**
- * Destroys a mutex. The mutex must not be locked.
- *
- * @param p_mutex mutex to destroy
- * @return always succeeds
- */
-void vlc_mutex_destroy (vlc_mutex_t *p_mutex)
-{
-#if defined( LIBVLC_USE_PTHREAD )
- int val = pthread_mutex_destroy( p_mutex );
- VLC_THREAD_ASSERT ("destroying mutex");
-
-#elif defined( WIN32 )
- assert (InterlockedExchange (&p_mutex->initialized, -1) == 1);
- DeleteCriticalSection (&p_mutex->mutex);
-
-#endif
-}
-
-#if defined(LIBVLC_USE_PTHREAD) && !defined(NDEBUG)
-# ifdef HAVE_VALGRIND_VALGRIND_H
-# include <valgrind/valgrind.h>
-# else
-# define RUNNING_ON_VALGRIND (0)
-# endif
-
-void vlc_assert_locked (vlc_mutex_t *p_mutex)
-{
- if (RUNNING_ON_VALGRIND > 0)
- return;
- assert (pthread_mutex_lock (p_mutex) == EDEADLK);
-}
-#endif
-
-/**
- * Acquires a mutex. If needed, waits for any other thread to release it.
- * Beware of deadlocks when locking multiple mutexes at the same time,
- * or when using mutexes from callbacks.
- * This function is not a cancellation-point.
- *
- * @param p_mutex mutex initialized with vlc_mutex_init() or
- * vlc_mutex_init_recursive()
- */
-void vlc_mutex_lock (vlc_mutex_t *p_mutex)
-{
-#if defined(LIBVLC_USE_PTHREAD)
- int val = pthread_mutex_lock( p_mutex );
- VLC_THREAD_ASSERT ("locking mutex");
-
-#elif defined( WIN32 )
- if (InterlockedCompareExchange (&p_mutex->initialized, 0, 0) == 0)
- { /* ^^ We could also lock super_mutex all the time... sluggish */
- assert (p_mutex != &super_mutex); /* this one cannot be static */
-
- vlc_mutex_lock (&super_mutex);
- if (InterlockedCompareExchange (&p_mutex->initialized, 0, 0) == 0)
- vlc_mutex_init (p_mutex);
- /* FIXME: destroy the mutex some time... */
- vlc_mutex_unlock (&super_mutex);
- }
- assert (InterlockedExchange (&p_mutex->initialized, 1) == 1);
- EnterCriticalSection (&p_mutex->mutex);
-
-#endif
-}
-
-/**
- * Acquires a mutex if and only if it is not currently held by another thread.
- * This function never sleeps and can be used in delay-critical code paths.
- * This function is not a cancellation-point.
- *
- * <b>Beware</b>: If this function fails, then the mutex is held... by another
- * thread. The calling thread must deal with the error appropriately. That
- * typically implies postponing the operations that would have required the
- * mutex. If the thread cannot defer those operations, then it must use
- * vlc_mutex_lock(). If in doubt, use vlc_mutex_lock() instead.
- *
- * @param p_mutex mutex initialized with vlc_mutex_init() or
- * vlc_mutex_init_recursive()
- * @return 0 if the mutex could be acquired, an error code otherwise.
- */
-int vlc_mutex_trylock (vlc_mutex_t *p_mutex)
-{
-#if defined(LIBVLC_USE_PTHREAD)
- int val = pthread_mutex_trylock( p_mutex );
-
- if (val != EBUSY)
- VLC_THREAD_ASSERT ("locking mutex");
- return val;
-
-#elif defined( WIN32 )
- if (InterlockedCompareExchange (&p_mutex->initialized, 0, 0) == 0)
- { /* ^^ We could also lock super_mutex all the time... sluggish */
- assert (p_mutex != &super_mutex); /* this one cannot be static */
-
- vlc_mutex_lock (&super_mutex);
- if (InterlockedCompareExchange (&p_mutex->initialized, 0, 0) == 0)
- vlc_mutex_init (p_mutex);
- /* FIXME: destroy the mutex some time... */
- vlc_mutex_unlock (&super_mutex);
- }
- assert (InterlockedExchange (&p_mutex->initialized, 1) == 1);
- return TryEnterCriticalSection (&p_mutex->mutex) ? 0 : EBUSY;
-
-#endif
-}
-
-/**
- * Releases a mutex (or crashes if the mutex is not locked by the caller).
- * @param p_mutex mutex locked with vlc_mutex_lock().
- */
-void vlc_mutex_unlock (vlc_mutex_t *p_mutex)
-{
-#if defined(LIBVLC_USE_PTHREAD)
- int val = pthread_mutex_unlock( p_mutex );
- VLC_THREAD_ASSERT ("unlocking mutex");
-
-#elif defined( WIN32 )
- assert (InterlockedExchange (&p_mutex->initialized, 1) == 1);
- LeaveCriticalSection (&p_mutex->mutex);
-
-#endif
-}
-
-/*****************************************************************************
- * vlc_cond_init: initialize a condition variable
- *****************************************************************************/
-int vlc_cond_init( vlc_cond_t *p_condvar )
-{
-#if defined( LIBVLC_USE_PTHREAD )
- pthread_condattr_t attr;
- int ret;
-
- ret = pthread_condattr_init (&attr);
- if (ret)
- return ret;
-
-# if !defined (_POSIX_CLOCK_SELECTION)
- /* Fairly outdated POSIX support (that was defined in 2001) */
-# define _POSIX_CLOCK_SELECTION (-1)
-# endif
-# if (_POSIX_CLOCK_SELECTION >= 0)
- /* NOTE: This must be the same clock as the one in mtime.c */
- pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
-# endif
-
- ret = pthread_cond_init (p_condvar, &attr);
- pthread_condattr_destroy (&attr);
- return ret;
-
-#elif defined( WIN32 )
- /* Create a manual-reset event (manual reset is needed for broadcast). */
- *p_condvar = CreateEvent( NULL, TRUE, FALSE, NULL );
- return *p_condvar ? 0 : ENOMEM;
-
-#endif
-}
-
-/**
- * Destroys a condition variable. No threads shall be waiting or signaling the
- * condition.
- * @param p_condvar condition variable to destroy
- */
-void vlc_cond_destroy (vlc_cond_t *p_condvar)
-{
-#if defined( LIBVLC_USE_PTHREAD )
- int val = pthread_cond_destroy( p_condvar );
- VLC_THREAD_ASSERT ("destroying condition");
-
-#elif defined( WIN32 )
- CloseHandle( *p_condvar );
-
-#endif
-}
-
-/**
- * Wakes up one thread waiting on a condition variable, if any.
- * @param p_condvar condition variable
- */
-void vlc_cond_signal (vlc_cond_t *p_condvar)
-{
-#if defined(LIBVLC_USE_PTHREAD)
- int val = pthread_cond_signal( p_condvar );
- VLC_THREAD_ASSERT ("signaling condition variable");
-
-#elif defined( WIN32 )
- /* NOTE: This will cause a broadcast, that is wrong.
- * This will also wake up the next waiting thread if no thread are yet
- * waiting, which is also wrong. However both of these issues are allowed
- * by the provision for spurious wakeups. Better have too many wakeups
- * than too few (= deadlocks). */
- SetEvent (*p_condvar);
-
-#endif
-}
-
-/**
- * Wakes up all threads (if any) waiting on a condition variable.
- * @param p_cond condition variable
- */
-void vlc_cond_broadcast (vlc_cond_t *p_condvar)
-{
-#if defined (LIBVLC_USE_PTHREAD)
- pthread_cond_broadcast (p_condvar);
-
-#elif defined (WIN32)
- SetEvent (*p_condvar);
-
-#endif
-}
-
-/**
- * Waits for a condition variable. The calling thread will be suspended until
- * another thread calls vlc_cond_signal() or vlc_cond_broadcast() on the same
- * condition variable, the thread is cancelled with vlc_cancel(), or the
- * system causes a "spurious" unsolicited wake-up.
- *
- * A mutex is needed to wait on a condition variable. It must <b>not</b> be
- * a recursive mutex. Although it is possible to use the same mutex for
- * multiple condition, it is not valid to use different mutexes for the same
- * condition variable at the same time from different threads.
- *
- * In case of thread cancellation, the mutex is always locked before
- * cancellation proceeds.
- *
- * The canonical way to use a condition variable to wait for event foobar is:
- @code
- vlc_mutex_lock (&lock);
- mutex_cleanup_push (&lock); // release the mutex in case of cancellation
-
- while (!foobar)
- vlc_cond_wait (&wait, &lock);
-
- --- foobar is now true, do something about it here --
-
- vlc_cleanup_run (); // release the mutex
- @endcode
- *
- * @param p_condvar condition variable to wait on
- * @param p_mutex mutex which is unlocked while waiting,
- * then locked again when waking up.
- * @param deadline <b>absolute</b> timeout
- *
- * @return 0 if the condition was signaled, an error code in case of timeout.
- */
-void vlc_cond_wait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
-{
-#if defined(LIBVLC_USE_PTHREAD)
- int val = pthread_cond_wait( p_condvar, p_mutex );
- VLC_THREAD_ASSERT ("waiting on condition");
-
-#elif defined( WIN32 )
- DWORD result;
-
- do
- {
- vlc_testcancel ();
- LeaveCriticalSection (&p_mutex->mutex);
- result = WaitForSingleObjectEx (*p_condvar, INFINITE, TRUE);
- EnterCriticalSection (&p_mutex->mutex);
- }
- while (result == WAIT_IO_COMPLETION);
-
- assert (result != WAIT_ABANDONED); /* another thread failed to cleanup! */
- assert (result != WAIT_FAILED);
- ResetEvent (*p_condvar);
-
-#endif
-}
-
-/**
- * Waits for a condition variable up to a certain date.
- * This works like vlc_cond_wait(), except for the additional timeout.
- *
- * @param p_condvar condition variable to wait on
- * @param p_mutex mutex which is unlocked while waiting,
- * then locked again when waking up.
- * @param deadline <b>absolute</b> timeout
- *
- * @return 0 if the condition was signaled, an error code in case of timeout.
- */
-int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
- mtime_t deadline)
-{
-#if defined(LIBVLC_USE_PTHREAD)
-#ifdef __APPLE__
- /* mdate() is mac_absolute_time on osx, which we must convert to do
- * the same base than gettimeofday() on which pthread_cond_timedwait
- * counts on. */
- mtime_t oldbase = mdate();
- struct timeval tv;
- gettimeofday(&tv, NULL);
- mtime_t newbase = (mtime_t)tv.tv_sec * 1000000 + (mtime_t) tv.tv_usec;
- deadline = deadline - oldbase + newbase;
-#endif
- lldiv_t d = lldiv( deadline, CLOCK_FREQ );
- struct timespec ts = { d.quot, d.rem * (1000000000 / CLOCK_FREQ) };
-
- int val = pthread_cond_timedwait (p_condvar, p_mutex, &ts);
- if (val != ETIMEDOUT)
- VLC_THREAD_ASSERT ("timed-waiting on condition");
- return val;
-
-#elif defined( WIN32 )
- DWORD result;
-
- do
- {
- vlc_testcancel ();
-
- mtime_t total = (deadline - mdate ())/1000;
- if( total < 0 )
- total = 0;
-
- DWORD delay = (total > 0x7fffffff) ? 0x7fffffff : total;
- LeaveCriticalSection (&p_mutex->mutex);
- result = WaitForSingleObjectEx (*p_condvar, delay, TRUE);
- EnterCriticalSection (&p_mutex->mutex);
- }
- while (result == WAIT_IO_COMPLETION);
-
- assert (result != WAIT_ABANDONED);
- assert (result != WAIT_FAILED);
- ResetEvent (*p_condvar);
-
- return (result == WAIT_OBJECT_0) ? 0 : ETIMEDOUT;
-
-#endif
-}
-
-/*****************************************************************************
- * vlc_tls_create: create a thread-local variable
- *****************************************************************************/
-int vlc_threadvar_create( vlc_threadvar_t *p_tls, void (*destr) (void *) )
-{
- int i_ret;
-
-#if defined( LIBVLC_USE_PTHREAD )
- i_ret = pthread_key_create( p_tls, destr );
-#elif defined( WIN32 )
- /* FIXME: remember/use the destr() callback and stop leaking whatever */
- *p_tls = TlsAlloc();
- i_ret = (*p_tls == TLS_OUT_OF_INDEXES) ? EAGAIN : 0;
-#else
-# error Unimplemented!
-#endif
- return i_ret;
-}
-
-void vlc_threadvar_delete (vlc_threadvar_t *p_tls)
-{
-#if defined( LIBVLC_USE_PTHREAD )
- pthread_key_delete (*p_tls);
-#elif defined( WIN32 )
- TlsFree (*p_tls);
-#else
-# error Unimplemented!
-#endif
-}
-
-/**
- * Sets a thread-local variable.
- * @param key thread-local variable key (created with vlc_threadvar_create())
- * @param value new value for the variable for the calling thread
- * @return 0 on success, a system error code otherwise.
- */
-int vlc_threadvar_set (vlc_threadvar_t key, void *value)
-{
-#if defined(LIBVLC_USE_PTHREAD)
- return pthread_setspecific (key, value);
-#elif defined( UNDER_CE ) || defined( WIN32 )
- return TlsSetValue (key, value) ? ENOMEM : 0;
-#else
-# error Unimplemented!
-#endif
-}
-
-/**
- * Gets the value of a thread-local variable for the calling thread.
- * This function cannot fail.
- * @return the value associated with the given variable for the calling
- * or NULL if there is no value.
- */
-void *vlc_threadvar_get (vlc_threadvar_t key)
-{
-#if defined(LIBVLC_USE_PTHREAD)
- return pthread_getspecific (key);
-#elif defined( UNDER_CE ) || defined( WIN32 )
- return TlsGetValue (key);
-#else
-# error Unimplemented!
-#endif
-}
-
-#if defined (LIBVLC_USE_PTHREAD)
-#elif defined (WIN32)
-static unsigned __stdcall vlc_entry (void *data)
-{
- vlc_cancel_t cancel_data = VLC_CANCEL_INIT;
- vlc_thread_t self = data;
-#ifdef UNDER_CE
- cancel_data.cancel_event = self->cancel_event;
-#endif
-
- vlc_threadvar_set (cancel_key, &cancel_data);
- self->data = self->entry (self->data);
- return 0;
-}
-#endif
-
-/**
- * Creates and starts new thread.
- *
- * @param p_handle [OUT] pointer to write the handle of the created thread to
- * @param entry entry point for the thread
- * @param data data parameter given to the entry point
- * @param priority thread priority value
- * @return 0 on success, a standard error code on error.
- */
-int vlc_clone (vlc_thread_t *p_handle, void * (*entry) (void *), void *data,
- int priority)
-{
- int ret;
-
-#if defined( LIBVLC_USE_PTHREAD )
- pthread_attr_t attr;
- pthread_attr_init (&attr);
-
- /* Block the signals that signals interface plugin handles.
- * If the LibVLC caller wants to handle some signals by itself, it should
- * block these before whenever invoking LibVLC. And it must obviously not
- * start the VLC signals interface plugin.
- *
- * LibVLC will normally ignore any interruption caused by an asynchronous
- * signal during a system call. But there may well be some buggy cases
- * where it fails to handle EINTR (bug reports welcome). Some underlying
- * libraries might also not handle EINTR properly.
- */
- sigset_t oldset;
- {
- sigset_t set;
- sigemptyset (&set);
- sigdelset (&set, SIGHUP);
- sigaddset (&set, SIGINT);
- sigaddset (&set, SIGQUIT);
- sigaddset (&set, SIGTERM);
-
- sigaddset (&set, SIGPIPE); /* We don't want this one, really! */
- pthread_sigmask (SIG_BLOCK, &set, &oldset);
- }
-
-#if defined (_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING >= 0) \
- && defined (_POSIX_THREAD_PRIORITY_SCHEDULING) \
- && (_POSIX_THREAD_PRIORITY_SCHEDULING >= 0)
- {
- struct sched_param sp = { .sched_priority = priority, };
- int policy;
-
- if (sp.sched_priority <= 0)
- sp.sched_priority += sched_get_priority_max (policy = SCHED_OTHER);
- else
- sp.sched_priority += sched_get_priority_min (policy = SCHED_RR);
-
- pthread_attr_setschedpolicy (&attr, policy);
- pthread_attr_setschedparam (&attr, &sp);
- }
-#else
- (void) priority;
-#endif
-
- /* The thread stack size.
- * The lower the value, the less address space per thread, the highest
- * maximum simultaneous threads per process. Too low values will cause
- * stack overflows and weird crashes. Set with caution. Also keep in mind
- * that 64-bits platforms consume more stack than 32-bits one.
- *
- * Thanks to on-demand paging, thread stack size only affects address space
- * consumption. In terms of memory, threads only use what they need
- * (rounded up to the page boundary).
- *
- * For example, on Linux i386, the default is 2 mega-bytes, which supports
- * about 320 threads per processes. */
-#define VLC_STACKSIZE (128 * sizeof (void *) * 1024)
-
-#ifdef VLC_STACKSIZE
- ret = pthread_attr_setstacksize (&attr, VLC_STACKSIZE);
- assert (ret == 0); /* fails iif VLC_STACKSIZE is invalid */
-#endif
-
- ret = pthread_create (p_handle, &attr, entry, data);
- pthread_sigmask (SIG_SETMASK, &oldset, NULL);
- pthread_attr_destroy (&attr);
-
-#elif defined( WIN32 ) || defined( UNDER_CE )
- /* When using the MSVCRT C library you have to use the _beginthreadex
- * function instead of CreateThread, otherwise you'll end up with
- * memory leaks and the signal functions not working (see Microsoft
- * Knowledge Base, article 104641) */
- HANDLE hThread;
- vlc_thread_t th = malloc (sizeof (*th));
-
- if (th == NULL)
- return ENOMEM;
-
- th->data = data;
- th->entry = entry;
-#if defined( UNDER_CE )
- th->cancel_event = CreateEvent (NULL, FALSE, FALSE, NULL);
- if (th->cancel_event == NULL)
- {
- free(th);
- return errno;
- }
- hThread = CreateThread (NULL, 128*1024, vlc_entry, th, CREATE_SUSPENDED, NULL);
-#else
- hThread = (HANDLE)(uintptr_t)
- _beginthreadex (NULL, 0, vlc_entry, th, CREATE_SUSPENDED, NULL);
-#endif
-
- if (hThread)
- {
-#ifndef UNDER_CE
- /* Thread closes the handle when exiting, duplicate it here
- * to be on the safe side when joining. */
- if (!DuplicateHandle (GetCurrentProcess (), hThread,
- GetCurrentProcess (), &th->handle, 0, FALSE,
- DUPLICATE_SAME_ACCESS))
- {
- CloseHandle (hThread);
- free (th);
- return ENOMEM;
- }
-#else
- th->handle = hThread;
-#endif
-
- ResumeThread (hThread);
- if (priority)
- SetThreadPriority (hThread, priority);
-
- ret = 0;
- *p_handle = th;
- }
- else
- {
- ret = errno;
- free (th);
- }
-
-#endif
- return ret;
-}
-
-#if defined (WIN32)
-/* APC procedure for thread cancellation */
-static void CALLBACK vlc_cancel_self (ULONG_PTR dummy)
-{
- (void)dummy;
- vlc_control_cancel (VLC_DO_CANCEL);
-}
-#endif
-
-/**
- * Marks a thread as cancelled. Next time the target thread reaches a
- * cancellation point (while not having disabled cancellation), it will
- * run its cancellation cleanup handler, the thread variable destructors, and
- * terminate. vlc_join() must be used afterward regardless of a thread being
- * cancelled or not.
- */
-void vlc_cancel (vlc_thread_t thread_id)
-{
-#if defined (LIBVLC_USE_PTHREAD_CANCEL)
- pthread_cancel (thread_id);
-#elif defined (UNDER_CE)
- SetEvent (thread_id->cancel_event);
-#elif defined (WIN32)
- QueueUserAPC (vlc_cancel_self, thread_id->handle, 0);
-#else
-# warning vlc_cancel is not implemented!
-#endif
-}
-
-/**
- * Waits for a thread to complete (if needed), and destroys it.
- * This is a cancellation point; in case of cancellation, the join does _not_
- * occur.
- *
- * @param handle thread handle
- * @param p_result [OUT] pointer to write the thread return value or NULL
- * @return 0 on success, a standard error code otherwise.
- */
-void vlc_join (vlc_thread_t handle, void **result)
-{
-#if defined( LIBVLC_USE_PTHREAD )
- int val = pthread_join (handle, result);
- VLC_THREAD_ASSERT ("joining thread");
-
-#elif defined( UNDER_CE ) || defined( WIN32 )
- do
- vlc_testcancel ();
- while (WaitForSingleObjectEx (handle->handle, INFINITE, TRUE)
- == WAIT_IO_COMPLETION);
-
- CloseHandle (handle->handle);
- if (result)
- *result = handle->data;
-#if defined( UNDER_CE )
- CloseHandle (handle->cancel_event);
-#endif
- free (handle);
-
-#endif
-}
-
-/**
- * Save the current cancellation state (enabled or disabled), then disable
- * cancellation for the calling thread.
- * This function must be called before entering a piece of code that is not
- * cancellation-safe, unless it can be proven that the calling thread will not
- * be cancelled.
- * @return Previous cancellation state (opaque value for vlc_restorecancel()).
- */
-int vlc_savecancel (void)
-{
- int state;
-
-#if defined (LIBVLC_USE_PTHREAD_CANCEL)
- int val = pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
- VLC_THREAD_ASSERT ("saving cancellation");
-
-#else
- vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
- if (nfo == NULL)
- return false; /* Main thread - cannot be cancelled anyway */
-
- state = nfo->killable;
- nfo->killable = false;
-
-#endif
- return state;
-}
-
-/**
- * Restore the cancellation state for the calling thread.
- * @param state previous state as returned by vlc_savecancel().
- * @return Nothing, always succeeds.
- */
-void vlc_restorecancel (int state)
-{
-#if defined (LIBVLC_USE_PTHREAD_CANCEL)
-# ifndef NDEBUG
- int oldstate, val;
-
- val = pthread_setcancelstate (state, &oldstate);
- /* This should fail if an invalid value for given for state */
- VLC_THREAD_ASSERT ("restoring cancellation");
-
- if (oldstate != PTHREAD_CANCEL_DISABLE)
- vlc_thread_fatal ("restoring cancellation while not disabled", EINVAL,
- __func__, __FILE__, __LINE__);
-# else
- pthread_setcancelstate (state, NULL);
-# endif
-
-#else
- vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
- assert (state == false || state == true);
-
- if (nfo == NULL)
- return; /* Main thread - cannot be cancelled anyway */
-
- assert (!nfo->killable);
- nfo->killable = state != 0;
-
#endif
-}
-
-/**
- * Issues an explicit deferred cancellation point.
- * This has no effect if thread cancellation is disabled.
- * This can be called when there is a rather slow non-sleeping operation.
- * This is also used to force a cancellation point in a function that would
- * otherwise "not always" be a one (block_FifoGet() is an example).
- */
-void vlc_testcancel (void)
-{
-#if defined (LIBVLC_USE_PTHREAD_CANCEL)
- pthread_testcancel ();
-
-#else
- vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
- if (nfo == NULL)
- return; /* Main thread - cannot be cancelled anyway */
-
- if (nfo->killable && nfo->killed)
- {
- for (vlc_cleanup_t *p = nfo->cleaners; p != NULL; p = p->next)
- p->proc (p->data);
-# if defined (LIBVLC_USE_PTHREAD)
- pthread_exit (PTHREAD_CANCELLED);
-# elif defined (UNDER_CE)
- ExitThread(0);
-# elif defined (WIN32)
- _endthread ();
-# else
-# error Not implemented!
-# endif
- }
-#endif
-}
struct vlc_thread_boot
if (priv->b_thread)
vlc_cancel (priv->thread_id);
}
-
-void vlc_control_cancel (int cmd, ...)
-{
- /* NOTE: This function only modifies thread-specific data, so there is no
- * need to lock anything. */
-#ifdef LIBVLC_USE_PTHREAD_CANCEL
- (void) cmd;
- assert (0);
-#else
- va_list ap;
-
- vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
- if (nfo == NULL)
- {
-#ifdef WIN32
- /* Main thread - cannot be cancelled anyway */
- return;
-#else
- nfo = malloc (sizeof (*nfo));
- if (nfo == NULL)
- return; /* Uho! Expect problems! */
- *nfo = VLC_CANCEL_INIT;
- vlc_threadvar_set (cancel_key, nfo);
-#endif
- }
-
- va_start (ap, cmd);
- switch (cmd)
- {
- case VLC_DO_CANCEL:
- nfo->killed = true;
- break;
-
- case VLC_CLEANUP_PUSH:
- {
- /* cleaner is a pointer to the caller stack, no need to allocate
- * and copy anything. As a nice side effect, this cannot fail. */
- vlc_cleanup_t *cleaner = va_arg (ap, vlc_cleanup_t *);
- cleaner->next = nfo->cleaners;
- nfo->cleaners = cleaner;
- break;
- }
-
- case VLC_CLEANUP_POP:
- {
- nfo->cleaners = nfo->cleaners->next;
- break;
- }
- }
- va_end (ap);
-#endif
-}
}
}
break;
- case VLC_VAR_FREELIST:
- FreeList( p_val );
- if( p_val2 && p_val2->p_list )
- {
- for( i = 0; i < p_val2->p_list->i_count; i++ )
- free( p_val2->p_list->p_values[i].psz_string );
- if( p_val2->p_list->i_count )
- {
- free( p_val2->p_list->p_values );
- free( p_val2->p_list->pi_types );
- }
- free( p_val2->p_list );
- }
- break;
case VLC_VAR_SETTEXT:
free( p_var->psz_text );
if( p_val && p_val->psz_string )
return i_ret;
}
+
+
+/**
+ * Free a list and the associated strings
+ * @param p_val: the list variable
+ * @param p_val2: the variable associated or NULL
+ */
+void var_FreeList( vlc_value_t *p_val, vlc_value_t *p_val2 )
+{
+ FreeList( p_val );
+ if( p_val2 && p_val2->p_list )
+ {
+ for( int i = 0; i < p_val2->p_list->i_count; i++ )
+ free( p_val2->p_list->p_values[i].psz_string );
+ if( p_val2->p_list->i_count )
+ {
+ free( p_val2->p_list->p_values );
+ free( p_val2->p_list->pi_types );
+ }
+ free( p_val2->p_list );
+ }
+}
--- /dev/null
+/*****************************************************************************
+ * w32thread.c : Win32 back-end for LibVLC
+ *****************************************************************************
+ * Copyright (C) 1999-2009 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
+ * Samuel Hocevar <sam@zoy.org>
+ * Gildas Bazin <gbazin@netcourrier.com>
+ * Clément Sténac
+ * Rémi Denis-Courmont
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+
+#include "libvlc.h"
+#include <stdarg.h>
+#include <assert.h>
+
+static vlc_threadvar_t cancel_key;
+
+/**
+ * Per-thread cancellation data
+ */
+typedef struct vlc_cancel_t
+{
+ vlc_cleanup_t *cleaners;
+#ifdef UNDER_CE
+ HANDLE cancel_event;
+#endif
+ bool killable;
+ bool killed;
+} vlc_cancel_t;
+
+#ifndef UNDER_CE
+# define VLC_CANCEL_INIT { NULL, true, false }
+#else
+# define VLC_CANCEL_INIT { NULL, NULL; true, false }
+#endif
+
+#ifdef UNDER_CE
+static void CALLBACK vlc_cancel_self (ULONG_PTR dummy);
+
+static DWORD vlc_cancelable_wait (DWORD count, const HANDLE *handles,
+ DWORD delay)
+{
+ vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
+ if (nfo == NULL)
+ {
+ /* Main thread - cannot be cancelled anyway */
+ return WaitForMultipleObjects (count, handles, FALSE, delay);
+ }
+ HANDLE new_handles[count + 1];
+ memcpy(new_handles, handles, count * sizeof(HANDLE));
+ new_handles[count] = nfo->cancel_event;
+ DWORD result = WaitForMultipleObjects (count + 1, new_handles, FALSE,
+ delay);
+ if (result == WAIT_OBJECT_0 + count)
+ {
+ vlc_cancel_self (NULL);
+ return WAIT_IO_COMPLETION;
+ }
+ else
+ {
+ return result;
+ }
+}
+
+DWORD SleepEx (DWORD dwMilliseconds, BOOL bAlertable)
+{
+ if (bAlertable)
+ {
+ DWORD result = vlc_cancelable_wait (0, NULL, dwMilliseconds);
+ return (result == WAIT_TIMEOUT) ? 0 : WAIT_IO_COMPLETION;
+ }
+ else
+ {
+ Sleep(dwMilliseconds);
+ return 0;
+ }
+}
+
+DWORD WaitForSingleObjectEx (HANDLE hHandle, DWORD dwMilliseconds,
+ BOOL bAlertable)
+{
+ if (bAlertable)
+ {
+ /* The MSDN documentation specifies different return codes,
+ * but in practice they are the same. We just check that it
+ * remains so. */
+#if WAIT_ABANDONED != WAIT_ABANDONED_0
+# error Windows headers changed, code needs to be rewritten!
+#endif
+ return vlc_cancelable_wait (1, &hHandle, dwMilliseconds);
+ }
+ else
+ {
+ return WaitForSingleObject (hHandle, dwMilliseconds);
+ }
+}
+
+DWORD WaitForMultipleObjectsEx (DWORD nCount, const HANDLE *lpHandles,
+ BOOL bWaitAll, DWORD dwMilliseconds,
+ BOOL bAlertable)
+{
+ if (bAlertable)
+ {
+ /* We do not support the bWaitAll case */
+ assert (! bWaitAll);
+ return vlc_cancelable_wait (nCount, lpHandles, dwMilliseconds);
+ }
+ else
+ {
+ return WaitForMultipleObjects (nCount, lpHandles, bWaitAll,
+ dwMilliseconds);
+ }
+}
+#endif
+
+static vlc_mutex_t super_mutex;
+
+BOOL WINAPI DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
+{
+ (void) hinstDll;
+ (void) lpvReserved;
+
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ vlc_mutex_init (&super_mutex);
+ vlc_threadvar_create (&cancel_key, free);
+ break;
+
+ case DLL_PROCESS_DETACH:
+ vlc_threadvar_delete( &cancel_key );
+ vlc_mutex_destroy (&super_mutex);
+ break;
+ }
+ return TRUE;
+}
+
+/*** Mutexes ***/
+int vlc_mutex_init( vlc_mutex_t *p_mutex )
+{
+ /* This creates a recursive mutex. This is OK as fast mutexes have
+ * no defined behavior in case of recursive locking. */
+ InitializeCriticalSection (&p_mutex->mutex);
+ p_mutex->initialized = 1;
+ return 0;
+}
+
+int vlc_mutex_init_recursive( vlc_mutex_t *p_mutex )
+{
+ InitializeCriticalSection( &p_mutex->mutex );
+ p_mutex->initialized = 1;
+ return 0;
+}
+
+
+void vlc_mutex_destroy (vlc_mutex_t *p_mutex)
+{
+ assert (InterlockedExchange (&p_mutex->initialized, -1) == 1);
+ DeleteCriticalSection (&p_mutex->mutex);
+}
+
+void vlc_mutex_lock (vlc_mutex_t *p_mutex)
+{
+ if (InterlockedCompareExchange (&p_mutex->initialized, 0, 0) == 0)
+ { /* ^^ We could also lock super_mutex all the time... sluggish */
+ assert (p_mutex != &super_mutex); /* this one cannot be static */
+
+ vlc_mutex_lock (&super_mutex);
+ if (InterlockedCompareExchange (&p_mutex->initialized, 0, 0) == 0)
+ vlc_mutex_init (p_mutex);
+ /* FIXME: destroy the mutex some time... */
+ vlc_mutex_unlock (&super_mutex);
+ }
+ assert (InterlockedExchange (&p_mutex->initialized, 1) == 1);
+ EnterCriticalSection (&p_mutex->mutex);
+}
+
+int vlc_mutex_trylock (vlc_mutex_t *p_mutex)
+{
+ if (InterlockedCompareExchange (&p_mutex->initialized, 0, 0) == 0)
+ { /* ^^ We could also lock super_mutex all the time... sluggish */
+ assert (p_mutex != &super_mutex); /* this one cannot be static */
+
+ vlc_mutex_lock (&super_mutex);
+ if (InterlockedCompareExchange (&p_mutex->initialized, 0, 0) == 0)
+ vlc_mutex_init (p_mutex);
+ /* FIXME: destroy the mutex some time... */
+ vlc_mutex_unlock (&super_mutex);
+ }
+ assert (InterlockedExchange (&p_mutex->initialized, 1) == 1);
+ return TryEnterCriticalSection (&p_mutex->mutex) ? 0 : EBUSY;
+}
+
+void vlc_mutex_unlock (vlc_mutex_t *p_mutex)
+{
+ assert (InterlockedExchange (&p_mutex->initialized, 1) == 1);
+ LeaveCriticalSection (&p_mutex->mutex);
+}
+
+/*** Condition variables ***/
+int vlc_cond_init( vlc_cond_t *p_condvar )
+{
+ /* Create a manual-reset event (manual reset is needed for broadcast). */
+ *p_condvar = CreateEvent (NULL, TRUE, FALSE, NULL);
+ return *p_condvar ? 0 : ENOMEM;
+}
+
+void vlc_cond_destroy (vlc_cond_t *p_condvar)
+{
+ CloseHandle (*p_condvar);
+}
+
+void vlc_cond_signal (vlc_cond_t *p_condvar)
+{
+ /* NOTE: This will cause a broadcast, that is wrong.
+ * This will also wake up the next waiting thread if no threads are yet
+ * waiting, which is also wrong. However both of these issues are allowed
+ * by the provision for spurious wakeups. Better have too many wakeups
+ * than too few (= deadlocks). */
+ SetEvent (*p_condvar);
+}
+
+void vlc_cond_broadcast (vlc_cond_t *p_condvar)
+{
+ SetEvent (*p_condvar);
+}
+
+void vlc_cond_wait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
+{
+ DWORD result;
+
+ do
+ {
+ vlc_testcancel ();
+ LeaveCriticalSection (&p_mutex->mutex);
+ result = WaitForSingleObjectEx (*p_condvar, INFINITE, TRUE);
+ EnterCriticalSection (&p_mutex->mutex);
+ }
+ while (result == WAIT_IO_COMPLETION);
+
+ assert (result != WAIT_ABANDONED); /* another thread failed to cleanup! */
+ assert (result != WAIT_FAILED);
+ ResetEvent (*p_condvar);
+}
+
+int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
+ mtime_t deadline)
+{
+ DWORD result;
+
+ do
+ {
+ vlc_testcancel ();
+
+ mtime_t total = (deadline - mdate ())/1000;
+ if( total < 0 )
+ total = 0;
+
+ DWORD delay = (total > 0x7fffffff) ? 0x7fffffff : total;
+ LeaveCriticalSection (&p_mutex->mutex);
+ result = WaitForSingleObjectEx (*p_condvar, delay, TRUE);
+ EnterCriticalSection (&p_mutex->mutex);
+ }
+ while (result == WAIT_IO_COMPLETION);
+
+ assert (result != WAIT_ABANDONED);
+ assert (result != WAIT_FAILED);
+ ResetEvent (*p_condvar);
+
+ return (result == WAIT_OBJECT_0) ? 0 : ETIMEDOUT;
+}
+
+/*** Thread-specific variables (TLS) ***/
+int vlc_threadvar_create (vlc_threadvar_t *p_tls, void (*destr) (void *))
+{
+#warning FIXME: use destr() callback and stop leaking!
+ *p_tls = TlsAlloc();
+ return (*p_tls == TLS_OUT_OF_INDEXES) ? EAGAIN : 0;
+}
+
+void vlc_threadvar_delete (vlc_threadvar_t *p_tls)
+{
+ TlsFree (*p_tls);
+}
+
+/**
+ * Sets a thread-local variable.
+ * @param key thread-local variable key (created with vlc_threadvar_create())
+ * @param value new value for the variable for the calling thread
+ * @return 0 on success, a system error code otherwise.
+ */
+int vlc_threadvar_set (vlc_threadvar_t key, void *value)
+{
+ return TlsSetValue (key, value) ? ENOMEM : 0;
+}
+
+/**
+ * Gets the value of a thread-local variable for the calling thread.
+ * This function cannot fail.
+ * @return the value associated with the given variable for the calling
+ * or NULL if there is no value.
+ */
+void *vlc_threadvar_get (vlc_threadvar_t key)
+{
+ return TlsGetValue (key);
+}
+
+
+/*** Threads ***/
+static unsigned __stdcall vlc_entry (void *data)
+{
+ vlc_cancel_t cancel_data = VLC_CANCEL_INIT;
+ vlc_thread_t self = data;
+#ifdef UNDER_CE
+ cancel_data.cancel_event = self->cancel_event;
+#endif
+
+ vlc_threadvar_set (cancel_key, &cancel_data);
+ self->data = self->entry (self->data);
+ return 0;
+}
+
+int vlc_clone (vlc_thread_t *p_handle, void * (*entry) (void *), void *data,
+ int priority)
+{
+ /* When using the MSVCRT C library you have to use the _beginthreadex
+ * function instead of CreateThread, otherwise you'll end up with
+ * memory leaks and the signal functions not working (see Microsoft
+ * Knowledge Base, article 104641) */
+ HANDLE hThread;
+ vlc_thread_t th = malloc (sizeof (*th));
+
+ if (th == NULL)
+ return ENOMEM;
+
+ th->data = data;
+ th->entry = entry;
+#if defined( UNDER_CE )
+ th->cancel_event = CreateEvent (NULL, FALSE, FALSE, NULL);
+ if (th->cancel_event == NULL)
+ {
+ free(th);
+ return errno;
+ }
+ hThread = CreateThread (NULL, 128*1024, vlc_entry, th, CREATE_SUSPENDED, NULL);
+#else
+ hThread = (HANDLE)(uintptr_t)
+ _beginthreadex (NULL, 0, vlc_entry, th, CREATE_SUSPENDED, NULL);
+#endif
+
+ if (hThread)
+ {
+#ifndef UNDER_CE
+ /* Thread closes the handle when exiting, duplicate it here
+ * to be on the safe side when joining. */
+ if (!DuplicateHandle (GetCurrentProcess (), hThread,
+ GetCurrentProcess (), &th->handle, 0, FALSE,
+ DUPLICATE_SAME_ACCESS))
+ {
+ CloseHandle (hThread);
+ free (th);
+ return ENOMEM;
+ }
+#else
+ th->handle = hThread;
+#endif
+
+ ResumeThread (hThread);
+ if (priority)
+ SetThreadPriority (hThread, priority);
+
+ *p_handle = th;
+ return 0;
+ }
+ free (th);
+ return errno;
+}
+
+void vlc_join (vlc_thread_t handle, void **result)
+{
+ do
+ vlc_testcancel ();
+ while (WaitForSingleObjectEx (handle->handle, INFINITE, TRUE)
+ == WAIT_IO_COMPLETION);
+
+ CloseHandle (handle->handle);
+ if (result)
+ *result = handle->data;
+#ifdef UNDER_CE
+ CloseHandle (handle->cancel_event);
+#endif
+ free (handle);
+}
+
+
+/*** Thread cancellation ***/
+
+/* APC procedure for thread cancellation */
+static void CALLBACK vlc_cancel_self (ULONG_PTR dummy)
+{
+ (void)dummy;
+ vlc_control_cancel (VLC_DO_CANCEL);
+}
+
+void vlc_cancel (vlc_thread_t thread_id)
+{
+#ifndef UNDER_CE
+ QueueUserAPC (vlc_cancel_self, thread_id->handle, 0);
+#else
+ SetEvent (thread_id->cancel_event);
+#endif
+}
+
+int vlc_savecancel (void)
+{
+ int state;
+
+ vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
+ if (nfo == NULL)
+ return false; /* Main thread - cannot be cancelled anyway */
+
+ state = nfo->killable;
+ nfo->killable = false;
+ return state;
+}
+
+void vlc_restorecancel (int state)
+{
+ vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
+ assert (state == false || state == true);
+
+ if (nfo == NULL)
+ return; /* Main thread - cannot be cancelled anyway */
+
+ assert (!nfo->killable);
+ nfo->killable = state != 0;
+}
+
+void vlc_testcancel (void)
+{
+ vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
+ if (nfo == NULL)
+ return; /* Main thread - cannot be cancelled anyway */
+
+ if (nfo->killable && nfo->killed)
+ {
+ for (vlc_cleanup_t *p = nfo->cleaners; p != NULL; p = p->next)
+ p->proc (p->data);
+#ifndef UNDER_CE
+ _endthread ();
+#else
+ ExitThread(0);
+#endif
+ }
+}
+
+void vlc_control_cancel (int cmd, ...)
+{
+ /* NOTE: This function only modifies thread-specific data, so there is no
+ * need to lock anything. */
+ va_list ap;
+
+ vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
+ if (nfo == NULL)
+ return; /* Main thread - cannot be cancelled anyway */
+
+ va_start (ap, cmd);
+ switch (cmd)
+ {
+ case VLC_DO_CANCEL:
+ nfo->killed = true;
+ break;
+
+ case VLC_CLEANUP_PUSH:
+ {
+ /* cleaner is a pointer to the caller stack, no need to allocate
+ * and copy anything. As a nice side effect, this cannot fail. */
+ vlc_cleanup_t *cleaner = va_arg (ap, vlc_cleanup_t *);
+ cleaner->next = nfo->cleaners;
+ nfo->cleaners = cleaner;
+ break;
+ }
+
+ case VLC_CLEANUP_POP:
+ {
+ nfo->cleaners = nfo->cleaners->next;
+ break;
+ }
+ }
+ va_end (ap);
+}
* \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 )
{
* \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
* 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 )
{
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_height = 0;
fmt.i_x_offset = fmt.i_y_offset = 0;
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt.i_chroma = VLC_CODEC_YUVA;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_visible_width = i_width;
fmt.i_height = fmt.i_visible_height = i_height;
var_Create( p_playlist, "intf-change", VLC_VAR_BOOL );
var_SetBool( p_playlist, "intf-change", true );
- var_Create( p_playlist, "item-change", VLC_VAR_INTEGER );
- var_SetInteger( p_playlist, "item-change", -1 );
+ var_Create( p_playlist, "item-change", VLC_VAR_ADDRESS );
var_Create( p_playlist, "playlist-item-deleted", VLC_VAR_INTEGER );
var_SetInteger( p_playlist, "playlist-item-deleted", -1 );
var_Create( p_playlist, "playlist-item-append", VLC_VAR_ADDRESS );
- var_Create( p_playlist, "item-current", VLC_VAR_INTEGER );
- var_SetInteger( p_playlist, "item-current", -1 );
+ var_Create( p_playlist, "item-current", VLC_VAR_ADDRESS );
var_Create( p_playlist, "activity", VLC_VAR_INTEGER );
var_SetInteger( p_playlist, "activity", 0 );
{
PL_DEBUG( "found art for %s in cache", psz_name );
input_item_SetArtFetched( p_item, true );
- var_SetInteger( p_playlist, "item-change", p_item->i_id );
+ var_SetAddress( p_playlist, "item-change", p_item );
}
else
{
* listening using the onelevel and the category representent
* (Because of the playlist design) */
p_child_in_category = playlist_ItemFindFromInputAndRoot(
- p_playlist, p_child->i_id,
+ p_playlist, p_child,
p_playlist->p_root_category,
false /* Only non-node */ );
{
/* Then, transform to a node if needed */
p_item_in_category = playlist_ItemFindFromInputAndRoot(
- p_playlist, p_parent->i_id,
+ p_playlist, p_parent,
p_playlist->p_root_category,
false /* Only non-node */ );
if( !p_item_in_category )
{
playlist_item_t *p_item = user_data;
VLC_UNUSED( p_event );
- var_SetInteger( p_item->p_playlist, "item-change", p_item->p_input->i_id );
+ var_SetAddress( p_item->p_playlist, "item-change", p_item->p_input );
}
/*****************************************************************************
*
* Remove an input item when it appears from a root playlist item
* \param p_playlist playlist object
- * \param i_input_id id of the input to delete
+ * \param p_input the input to delete
* \param p_root root playlist item
* \param b_do_stop must stop or not the playlist
* \return VLC_SUCCESS or VLC_EGENERIC
*/
-static int DeleteFromInput( playlist_t *p_playlist, int i_input_id,
+static int DeleteFromInput( playlist_t *p_playlist, input_item_t *p_input,
playlist_item_t *p_root, bool b_do_stop )
{
int i;
for( i = 0 ; i< p_root->i_children ; i++ )
{
if( p_root->pp_children[i]->i_children == -1 &&
- p_root->pp_children[i]->p_input->i_id == i_input_id )
+ p_root->pp_children[i]->p_input == p_input )
{
DeleteInner( p_playlist, p_root->pp_children[i], b_do_stop );
return VLC_SUCCESS;
}
else if( p_root->pp_children[i]->i_children >= 0 )
{
- int i_ret = DeleteFromInput( p_playlist, i_input_id,
+ int i_ret = DeleteFromInput( p_playlist, p_input,
p_root->pp_children[i], b_do_stop );
if( i_ret == VLC_SUCCESS ) return VLC_SUCCESS;
}
*
* Remove an input item when it appears from a root playlist item
* \param p_playlist playlist object
- * \param i_input_id id of the input to delete
+ * \param p_input the input to delete
* \param p_root root playlist item
* \param b_locked TRUE if the playlist is locked
* \return VLC_SUCCESS or VLC_EGENERIC
*/
-int playlist_DeleteFromInputInParent( playlist_t *p_playlist, int i_input_id,
+int playlist_DeleteFromInputInParent( playlist_t *p_playlist,
+ input_item_t *p_item,
playlist_item_t *p_root, bool b_locked )
{
int i_ret;
PL_LOCK_IF( !b_locked );
- i_ret = DeleteFromInput( p_playlist, i_input_id,
- p_root, true );
+ i_ret = DeleteFromInput( p_playlist, p_item, p_root, true );
PL_UNLOCK_IF( !b_locked );
return i_ret;
}
*
* Remove an input item from ONELEVEL and CATEGORY
* \param p_playlist playlist object
- * \param i_input_id id of the input to delete
+ * \param p_input the input to delete
* \param b_locked TRUE if the playlist is locked
* \return VLC_SUCCESS or VLC_ENOITEM
*/
-int playlist_DeleteFromInput( playlist_t *p_playlist, int i_input_id,
+int playlist_DeleteFromInput( playlist_t *p_playlist, input_item_t *p_input,
bool b_locked )
{
int i_ret1, i_ret2;
PL_LOCK_IF( !b_locked );
- i_ret1 = DeleteFromInput( p_playlist, i_input_id,
+ i_ret1 = DeleteFromInput( p_playlist, p_input,
p_playlist->p_root_category, true );
- i_ret2 = DeleteFromInput( p_playlist, i_input_id,
+ i_ret2 = DeleteFromInput( p_playlist, p_input,
p_playlist->p_root_onelevel, true );
PL_UNLOCK_IF( !b_locked );
return ( i_ret1 == VLC_SUCCESS || i_ret2 == VLC_SUCCESS ) ?
* regardless of its size
* \param b_playlist TRUE for playlist, FALSE for media library
* \param b_locked TRUE if the playlist is locked
- * \return The id of the playlist item
+ * \return VLC_SUCCESS or a VLC error code
*/
int playlist_Add( playlist_t *p_playlist, const char *psz_uri,
const char *psz_name, int i_mode, int i_pos,
* \param i_option_flags options flags
* \param b_playlist TRUE for playlist, FALSE for media library
* \param b_locked TRUE if the playlist is locked
- * \return The id of the playlist item
+ * \return VLC_SUCCESS or a VLC error code
*/
int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,
const char *psz_name, int i_mode, int i_pos,
mtime_t i_duration,
- int i_options, const char *const *ppsz_options, unsigned i_option_flags,
+ int i_options, const char *const *ppsz_options,
+ unsigned i_option_flags,
bool b_playlist, bool b_locked )
{
int i_ret;
- input_item_t *p_input = input_item_NewExt( p_playlist, psz_uri, psz_name,
- i_options, ppsz_options, i_option_flags,
- i_duration );
+ input_item_t *p_input;
+ p_input = input_item_NewExt( p_playlist, psz_uri, psz_name,
+ i_options, ppsz_options, i_option_flags,
+ i_duration );
+ if( p_input == NULL )
+ return VLC_ENOMEM;
i_ret = playlist_AddInput( p_playlist, p_input, i_mode, i_pos, b_playlist,
b_locked );
- int i_id = (i_ret == VLC_SUCCESS) ? p_input->i_id : -1;
-
vlc_gc_decref( p_input );
-
- return i_id;
+ return i_ret;
}
/**
}
for( i_top = 0 ; i_top < p_playlist->p_root_onelevel->i_children; i_top++ )
{
- if( p_playlist->p_root_onelevel->pp_children[i_top]->p_input->i_id ==
- p_up->p_input->i_id )
+ if( p_playlist->p_root_onelevel->pp_children[i_top]->p_input ==
+ p_up->p_input )
{
AddItem( p_playlist, p_item_one,
p_playlist->p_root_onelevel->pp_children[i_top],
/** \todo First look if we don't already have it */
p_item_in_category = playlist_ItemFindFromInputAndRoot(
- p_playlist, p_item->p_input->i_id,
+ p_playlist, p_item->p_input,
p_playlist->p_root_category,
true );
if( p_item_in_category )
{
playlist_item_t *p_item_in_one = playlist_ItemFindFromInputAndRoot(
- p_playlist, p_item->p_input->i_id,
+ p_playlist, p_item->p_input,
p_playlist->p_root_onelevel,
true );
assert( p_item_in_one );
if( p_prev_status_item )
set_current_status_item( p_playlist, p_prev_status_item );
}
- DeleteFromInput( p_playlist, p_item_in_one->p_input->i_id,
+ DeleteFromInput( p_playlist, p_item_in_one->p_input,
p_playlist->p_root_onelevel, false );
}
pl_priv(p_playlist)->b_reset_currently_playing = true;
vlc_cond_signal( &pl_priv(p_playlist)->signal );
- var_SetInteger( p_playlist, "item-change", p_item_in_category->p_input->i_id );
+ var_SetAddress( p_playlist, "item-change", p_item_in_category->p_input );
PL_UNLOCK_IF( !b_locked );
return p_item_in_category;
}
* Find an item within a root, given its input id.
*
* \param p_playlist the playlist object
- * \param i_input_id id of the input
+ * \param p_item the input item
* \param p_root root playlist item
* \param b_items_only TRUE if we want the item himself
* \return the first found item, or NULL if not found
*/
playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
- int i_input_id,
+ input_item_t *p_item,
playlist_item_t *p_root,
bool b_items_only )
{
for( i = 0 ; i< p_root->i_children ; i++ )
{
if( ( b_items_only ? p_root->pp_children[i]->i_children == -1 : 1 ) &&
- p_root->pp_children[i]->p_input->i_id == i_input_id )
+ p_root->pp_children[i]->p_input == p_item )
{
return p_root->pp_children[i];
}
else if( p_root->pp_children[i]->i_children >= 0 )
{
playlist_item_t *p_search =
- playlist_ItemFindFromInputAndRoot( p_playlist, i_input_id,
+ playlist_ItemFindFromInputAndRoot( p_playlist, p_item,
p_root->pp_children[i],
b_items_only );
if( p_search ) return p_search;
playlist_item_t *p_node_onelevel;
playlist_item_t *p_item_onelevel;
p_node_onelevel = playlist_ItemFindFromInputAndRoot( p_playlist,
- p_node->p_input->i_id,
+ p_node->p_input,
p_playlist->p_root_onelevel,
false );
p_item_onelevel = playlist_ItemFindFromInputAndRoot( p_playlist,
- p_item->p_input->i_id,
+ p_item->p_input,
p_playlist->p_root_onelevel,
false );
if( p_node_onelevel && p_item_onelevel )
playlist_item_t *p_node_category;
playlist_item_t *p_item_category;
p_node_category = playlist_ItemFindFromInputAndRoot( p_playlist,
- p_node->p_input->i_id,
+ p_node->p_input,
p_playlist->p_root_category,
false );
p_item_category = playlist_ItemFindFromInputAndRoot( p_playlist,
- p_item->p_input->i_id,
+ p_item->p_input,
p_playlist->p_root_category,
false );
if( p_node_category && p_item_category )
/* Tree walking */
playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
- int i_input_id, playlist_item_t *p_root,
- bool );
+ input_item_t *p_input, playlist_item_t *p_root,
+ bool );
-int playlist_DeleteFromInputInParent( playlist_t *, int, playlist_item_t *, bool );
+int playlist_DeleteFromInputInParent( playlist_t *, input_item_t *,
+ playlist_item_t *, bool );
int playlist_DeleteFromItemId( playlist_t*, int );
int playlist_ItemRelease( playlist_item_t * );
input_Preparse( VLC_OBJECT(p_playlist), p_item );
input_item_SetPreparsed( p_item, true );
- var_SetInteger( p_playlist, "item-change", p_item->i_id );
+ var_SetAddress( p_playlist, "item-change", p_item );
}
stats_TimerStop( p_playlist, STATS_TIMER_PREPARSE );
/** \todo Check if this is always incremental and whether we can bsearch */
for( i = 0 ; i < p_playlist->all_items.i_size; i++ )
{
- if( ARRAY_VAL(p_playlist->all_items, i)->p_input->i_id == p_item->i_id )
+ if( ARRAY_VAL(p_playlist->all_items, i)->p_input == p_item )
{
return ARRAY_VAL(p_playlist->all_items, i);
}
}
-/**
- * Get input by item id
- *
- * Find the playlist item matching the input id under the given node
- * \param p_playlist the playlist
- * \param i_input_id the id of the input to find
- * \param p_root the root node of the search
- * \return the playlist item or NULL on failure
- */
-playlist_item_t * playlist_ItemGetByInputId( playlist_t *p_playlist,
- int i_input_id,
- playlist_item_t *p_root )
-{
- int i;
- PL_ASSERT_LOCKED;
- assert( p_root != NULL );
- for( i = 0 ; i< p_root->i_children ; i++ )
- {
- if( p_root->pp_children[i]->p_input &&
- p_root->pp_children[i]->p_input->i_id == i_input_id )
- {
- return p_root->pp_children[i];
- }
- else if( p_root->pp_children[i]->i_children >= 0 )
- {
- return playlist_ItemGetByInputId( p_playlist, i_input_id,
- p_root->pp_children[i] );
- }
- }
- return NULL;
-}
-
/***************************************************************************
* Live search handling
***************************************************************************/
* XXX: Why don't we have a function to ensure that in the playlist code ? */
playlist_Lock( p_parent->p_playlist );
p_pl_item = playlist_ItemFindFromInputAndRoot( p_parent->p_playlist,
- p_input->i_id, p_parent, false );
+ p_input, p_parent, false );
if( p_pl_item && p_pl_item->i_children > -1 )
playlist_NodeDelete( p_parent->p_playlist, p_pl_item, true, false );
else
/* Delete the non-node item normally */
- playlist_DeleteFromInputInParent( p_parent->p_playlist, p_input->i_id,
+ playlist_DeleteFromInputInParent( p_parent->p_playlist, p_input,
p_parent, pl_Locked );
playlist_Unlock( p_parent->p_playlist );
}
PL_UNLOCK;
- var_SetInteger( p_playlist, "item-current", p_input->i_id );
+ var_SetAddress( p_playlist, "item-current", p_input );
PL_LOCK;
return VLC_SUCCESS;
return p_node;
for( i = 0 ; i< p_playlist->p_root_onelevel->i_children; i++ )
{
- if( p_playlist->p_root_onelevel->pp_children[i]->p_input->i_id ==
- p_node->p_input->i_id )
+ if( p_playlist->p_root_onelevel->pp_children[i]->p_input ==
+ p_node->p_input )
return p_playlist->p_root_onelevel->pp_children[i];
}
}
return p_node;
for( i = 0 ; i< p_playlist->p_root_category->i_children; i++ )
{
- if( p_playlist->p_root_category->pp_children[i]->p_input->i_id ==
- p_node->p_input->i_id )
+ if( p_playlist->p_root_category->pp_children[i]->p_input ==
+ p_node->p_input )
return p_playlist->p_root_category->pp_children[i];
}
}
#include "input/input_interface.h"
+#define VLC_CODEC_NULL VLC_FOURCC( 'n', 'u', 'l', 'l' )
+
#undef DEBUG_BUFFER
/*****************************************************************************
* Local prototypes
msg_Dbg( p_sout, "adding a new sout input (sout_input:%p)", p_input );
- if( p_fmt->i_codec == VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
+ if( p_fmt->i_codec == VLC_CODEC_NULL )
{
vlc_object_release( p_sout );
return p_input;
msg_Dbg( p_sout, "removing a sout input (sout_input:%p)", p_input );
- if( p_input->p_fmt->i_codec != VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
+ if( p_input->p_fmt->i_codec != VLC_CODEC_NULL )
{
vlc_mutex_lock( &p_sout->lock );
p_sout->p_stream->pf_del( p_sout->p_stream, p_input->id );
sout_instance_t *p_sout = p_input->p_sout;
int i_ret;
- if( p_input->p_fmt->i_codec == VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
+ if( p_input->p_fmt->i_codec == VLC_CODEC_NULL )
{
block_Release( p_buffer );
return VLC_SUCCESS;
test_block \
test_dictionary \
test_i18n_atof \
+ test_keys \
test_url \
test_utf8 \
test_xmlent \
test_block_SOURCES = test_block.c ../misc/block.c
test_dictionary_SOURCES = dictionary.c
test_i18n_atof_SOURCES = i18n_atof.c
+test_keys_SOURCES = keys.c
test_url_SOURCES = url.c
test_utf8_SOURCES = utf8.c
test_xmlent_SOURCES = xmlent.c
--- /dev/null
+/*****************************************************************************
+ * keys.c: test for key support
+ *****************************************************************************
+ * Copyright (C) 2009 Rémi Denis-Courmont
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_keys.h>
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdbool.h>
+
+int main (void)
+{
+ bool ok = true;
+
+ /* Make sure keys are sorted properly, so that bsearch() works */
+ for (size_t i = 1; i < vlc_num_keys; i++)
+ if (vlc_keys[i].i_key_code < vlc_keys[i - 1].i_key_code)
+ {
+ fprintf (stderr,
+ "%s (%06"PRIx32") should be before %s (%06"PRIx32")\n",
+ vlc_keys[i].psz_key_string, vlc_keys[i].i_key_code,
+ vlc_keys[i - 1].psz_key_string,
+ vlc_keys[i - 1].i_key_code);
+ ok = false;
+ }
+
+ return !ok;
+}
test (make_URI, in, out);
}
+static inline void test_current_directory_path (const char *in, const char *cwd, const char *out)
+{
+ char * expected_result = NULL;
+ int val = asprintf(&expected_result, "file://%s/%s", cwd, out);
+ assert (val != -1);
+
+ test (make_URI, in, expected_result);
+}
+
int main (void)
{
int val;
assert (fd != -1);*/
val = chdir ("/tmp");
assert (val != -1);
- test_path ("movie.ogg", "file:///tmp/movie.ogg");
- test_path (".", "file:///tmp/.");
- test_path ("", "file:///tmp/");
+
+ char buf[256];
+ char * tmpdir;
+ tmpdir = getcwd(buf, sizeof(buf)/sizeof(*buf));
+ assert (tmpdir);
+
+ test_current_directory_path ("movie.ogg", tmpdir, "movie.ogg");
+ test_current_directory_path (".", tmpdir, ".");
+ test_current_directory_path ("", tmpdir, "");
+
/*val = fchdir (fd);
assert (val != -1);*/
free( psz_filter_chain );
}
- if( p_vout->fmt_render.i_chroma != p_fmt->i_chroma ||
+ if( p_vout->fmt_render.i_chroma != vlc_fourcc_GetCodec( VIDEO_ES, p_fmt->i_chroma ) ||
p_vout->fmt_render.i_width != p_fmt->i_width ||
p_vout->fmt_render.i_height != p_fmt->i_height ||
p_vout->p->b_filter_change )
unsigned int i_width = p_fmt->i_width;
unsigned int i_height = p_fmt->i_height;
- vlc_fourcc_t i_chroma = p_fmt->i_chroma;
+ vlc_fourcc_t i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, p_fmt->i_chroma );
unsigned int i_aspect = p_fmt->i_aspect;
config_chain_t *p_cfg;
if( !vout_ChromaCmp( p_output->i_chroma, p_render->i_chroma ) )
return false;
- if( p_output->i_chroma != FOURCC_RV15 &&
- p_output->i_chroma != FOURCC_RV16 &&
- p_output->i_chroma != FOURCC_RV24 &&
- p_output->i_chroma != FOURCC_RV32 )
+ if( p_output->i_chroma != VLC_CODEC_RGB15 &&
+ p_output->i_chroma != VLC_CODEC_RGB16 &&
+ p_output->i_chroma != VLC_CODEC_RGB24 &&
+ p_output->i_chroma != VLC_CODEC_RGB32 )
return true;
return p_output->i_rmask == p_render->i_rmask &&
}
}
- /* Link pictures back to their heap */
- for( i = 0 ; i < I_RENDERPICTURES ; i++ )
- {
- PP_RENDERPICTURE[ i ]->p_heap = &p_vout->render;
- }
-
- for( i = 0 ; i < I_OUTPUTPICTURES ; i++ )
- {
- PP_OUTPUTPICTURE[ i ]->p_heap = &p_vout->output;
- }
-
return VLC_SUCCESS;
}
* \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 )
{
* \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
* 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;
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = 0;
fmt.i_width = fmt.i_height = 0;
fmt.i_x_offset = fmt.i_y_offset = 0;
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 );
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 );
+}
+
/* */
memset( &fmt_out, 0, sizeof(fmt_out) );
fmt_out = fmt_in;
- fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+ fmt_out.i_chroma = VLC_CODEC_YUVA;
/* */
image_handler_t *p_image = image_HandlerCreate( p_vout );
if( pp_image )
{
- vlc_fourcc_t i_format = VLC_FOURCC('p','n','g',' ');
+ vlc_fourcc_t i_format = VLC_CODEC_PNG;
if( psz_format && image_Type2Fourcc( psz_format ) )
i_format = image_Type2Fourcc( psz_format );
p_vout->fmt_out.i_aspect );
p_tmp_pic->i_type = MEMORY_PICTURE;
p_tmp_pic->i_status = RESERVED_PICTURE;
- /* some modules (such as blend) needs to know the extra information in picture heap */
- p_tmp_pic->p_heap = &p_vout->output;
}
/* Convert image to the first direct buffer */
i_width_aligned = (i_width + 15) >> 4 << 4;
i_height_aligned = (i_height + 15) >> 4 << 4;
- if( vout_InitPicture( p_this, p_pic, i_chroma,
- i_width, i_height, i_aspect ) != VLC_SUCCESS )
+ if( picture_Setup( p_pic, i_chroma,
+ i_width, i_height, i_aspect ) != VLC_SUCCESS )
{
p_pic->i_planes = 0;
return VLC_EGENERIC;
return VLC_SUCCESS;
}
-/**
- * Initialise the video format fields given chroma/size.
- *
- * This function initializes all the video_frame_format_t fields given the
- * static properties of a picture (chroma and size).
- * \param p_format Pointer to the format structure to initialize
- * \param i_chroma Chroma to set
- * \param i_width Width to set
- * \param i_height Height to set
- * \param i_aspect Aspect ratio
- */
-void vout_InitFormat( video_frame_format_t *p_format, vlc_fourcc_t i_chroma,
- int i_width, int i_height, int i_aspect )
-{
- p_format->i_chroma = i_chroma;
- p_format->i_width = p_format->i_visible_width = i_width;
- p_format->i_height = p_format->i_visible_height = i_height;
- p_format->i_x_offset = p_format->i_y_offset = 0;
- p_format->i_aspect = i_aspect;
-
-#if 0
- /* Assume we have square pixels */
- if( i_width && i_height )
- p_format->i_aspect = i_width * VOUT_ASPECT_FACTOR / i_height;
- else
- p_format->i_aspect = 0;
-#endif
-
- switch( i_chroma )
- {
- case FOURCC_YUVA:
- p_format->i_bits_per_pixel = 32;
- break;
- case FOURCC_I444:
- case FOURCC_J444:
- p_format->i_bits_per_pixel = 24;
- break;
- case FOURCC_I422:
- case FOURCC_YUY2:
- case FOURCC_UYVY:
- case FOURCC_J422:
- p_format->i_bits_per_pixel = 16;
- break;
- case FOURCC_I440:
- case FOURCC_J440:
- p_format->i_bits_per_pixel = 16;
- break;
- case FOURCC_I411:
- case FOURCC_YV12:
- case FOURCC_I420:
- case FOURCC_J420:
- case FOURCC_IYUV:
- p_format->i_bits_per_pixel = 12;
- break;
- case FOURCC_I410:
- case FOURCC_YVU9:
- p_format->i_bits_per_pixel = 9;
- break;
- case FOURCC_Y211:
- p_format->i_bits_per_pixel = 8;
- break;
- case FOURCC_YUVP:
- p_format->i_bits_per_pixel = 8;
- break;
-
- case FOURCC_RV32:
- case FOURCC_RGBA:
- p_format->i_bits_per_pixel = 32;
- break;
- case FOURCC_RV24:
- p_format->i_bits_per_pixel = 24;
- break;
- case FOURCC_RV15:
- case FOURCC_RV16:
- p_format->i_bits_per_pixel = 16;
- break;
- case FOURCC_RGB2:
- p_format->i_bits_per_pixel = 8;
- break;
-
- case FOURCC_GREY:
- case FOURCC_Y800:
- case FOURCC_Y8:
- case FOURCC_RGBP:
- p_format->i_bits_per_pixel = 8;
- break;
-
- default:
- p_format->i_bits_per_pixel = 0;
- break;
- }
-}
-
-/**
- * Initialise the picture_t fields given chroma/size.
- *
- * This function initializes most of the picture_t fields given a chroma and
- * size. It makes the assumption that stride == width.
- * \param p_this The calling object
- * \param p_pic Pointer to the picture to initialize
- * \param i_chroma The chroma fourcc to set
- * \param i_width The width of the picture
- * \param i_height The height of the picture
- * \param i_aspect The aspect ratio of the picture
- */
-int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic,
- vlc_fourcc_t i_chroma,
- int i_width, int i_height, int i_aspect )
-{
- int i_index, i_width_aligned, i_height_aligned;
-
- /* Store default values */
- for( i_index = 0; i_index < VOUT_MAX_PLANES; i_index++ )
- {
- p_pic->p[i_index].p_pixels = NULL;
- p_pic->p[i_index].i_pixel_pitch = 1;
- }
-
- p_pic->pf_release = NULL;
- p_pic->pf_lock = NULL;
- p_pic->pf_unlock = NULL;
- p_pic->i_refcount = 0;
-
- p_pic->i_qtype = QTYPE_NONE;
- p_pic->i_qstride = 0;
- p_pic->p_q = NULL;
-
- vout_InitFormat( &p_pic->format, i_chroma, i_width, i_height, i_aspect );
-
- /* Make sure the real dimensions are a multiple of 16 */
- i_width_aligned = (i_width + 15) >> 4 << 4;
- i_height_aligned = (i_height + 15) >> 4 << 4;
-
- /* Calculate coordinates */
- switch( i_chroma )
- {
- case FOURCC_I411:
- p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
- p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ U_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ U_PLANE ].i_visible_lines = i_height;
- p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 4;
- p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 4;
- p_pic->p[ V_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ V_PLANE ].i_visible_lines = i_height;
- p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 4;
- p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 4;
- p_pic->i_planes = 3;
- break;
-
- case FOURCC_I410:
- case FOURCC_YVU9:
- p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
- p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ U_PLANE ].i_lines = i_height_aligned / 4;
- p_pic->p[ U_PLANE ].i_visible_lines = i_height / 4;
- p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 4;
- p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 4;
- p_pic->p[ V_PLANE ].i_lines = i_height_aligned / 4;
- p_pic->p[ V_PLANE ].i_visible_lines = i_height / 4;
- p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 4;
- p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 4;
- p_pic->i_planes = 3;
- break;
-
- case FOURCC_YV12:
- case FOURCC_I420:
- case FOURCC_IYUV:
- case FOURCC_J420:
- p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
- p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ U_PLANE ].i_lines = i_height_aligned / 2;
- p_pic->p[ U_PLANE ].i_visible_lines = i_height / 2;
- p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 2;
- p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 2;
- p_pic->p[ V_PLANE ].i_lines = i_height_aligned / 2;
- p_pic->p[ V_PLANE ].i_visible_lines = i_height / 2;
- p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 2;
- p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 2;
- p_pic->i_planes = 3;
- break;
-
- case FOURCC_I422:
- case FOURCC_J422:
- p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
- p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ U_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ U_PLANE ].i_visible_lines = i_height;
- p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 2;
- p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 2;
- p_pic->p[ V_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ V_PLANE ].i_visible_lines = i_height;
- p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 2;
- p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 2;
- p_pic->i_planes = 3;
- break;
-
- case FOURCC_I440:
- case FOURCC_J440:
- p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
- p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ U_PLANE ].i_lines = i_height_aligned / 2;
- p_pic->p[ U_PLANE ].i_visible_lines = i_height / 2;
- p_pic->p[ U_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ U_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ V_PLANE ].i_lines = i_height_aligned / 2;
- p_pic->p[ V_PLANE ].i_visible_lines = i_height / 2;
- p_pic->p[ V_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ V_PLANE ].i_visible_pitch = i_width;
- p_pic->i_planes = 3;
- break;
-
- case FOURCC_I444:
- case FOURCC_J444:
- p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
- p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ U_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ U_PLANE ].i_visible_lines = i_height;
- p_pic->p[ U_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ U_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ V_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ V_PLANE ].i_visible_lines = i_height;
- p_pic->p[ V_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ V_PLANE ].i_visible_pitch = i_width;
- p_pic->i_planes = 3;
- break;
-
- case FOURCC_YUVA:
- p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
- p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ U_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ U_PLANE ].i_visible_lines = i_height;
- p_pic->p[ U_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ U_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ V_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ V_PLANE ].i_visible_lines = i_height;
- p_pic->p[ V_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ V_PLANE ].i_visible_pitch = i_width;
- p_pic->p[ A_PLANE ].i_lines = i_height_aligned;
- p_pic->p[ A_PLANE ].i_visible_lines = i_height;
- p_pic->p[ A_PLANE ].i_pitch = i_width_aligned;
- p_pic->p[ A_PLANE ].i_visible_pitch = i_width;
- p_pic->i_planes = 4;
- break;
-
- case FOURCC_YUVP:
- p_pic->p->i_lines = i_height_aligned;
- p_pic->p->i_visible_lines = i_height;
- p_pic->p->i_pitch = i_width_aligned;
- p_pic->p->i_visible_pitch = i_width;
- p_pic->p->i_pixel_pitch = 8;
- p_pic->i_planes = 1;
- break;
-
- case FOURCC_Y211:
- p_pic->p->i_lines = i_height_aligned;
- p_pic->p->i_visible_lines = i_height;
- p_pic->p->i_pitch = i_width_aligned;
- p_pic->p->i_visible_pitch = i_width;
- p_pic->p->i_pixel_pitch = 4;
- p_pic->i_planes = 1;
- break;
-
- case FOURCC_UYVY:
- case FOURCC_YUY2:
- p_pic->p->i_lines = i_height_aligned;
- p_pic->p->i_visible_lines = i_height;
- p_pic->p->i_pitch = i_width_aligned * 2;
- p_pic->p->i_visible_pitch = i_width * 2;
- p_pic->p->i_pixel_pitch = 4;
- p_pic->i_planes = 1;
- break;
-
- case FOURCC_RGB2:
- p_pic->p->i_lines = i_height_aligned;
- p_pic->p->i_visible_lines = i_height;
- p_pic->p->i_pitch = i_width_aligned;
- p_pic->p->i_visible_pitch = i_width;
- p_pic->p->i_pixel_pitch = 1;
- p_pic->i_planes = 1;
- break;
-
- case FOURCC_RV15:
- p_pic->p->i_lines = i_height_aligned;
- p_pic->p->i_visible_lines = i_height;
- p_pic->p->i_pitch = i_width_aligned * 2;
- p_pic->p->i_visible_pitch = i_width * 2;
- p_pic->p->i_pixel_pitch = 2;
- p_pic->i_planes = 1;
- break;
-
- case FOURCC_RV16:
- p_pic->p->i_lines = i_height_aligned;
- p_pic->p->i_visible_lines = i_height;
- p_pic->p->i_pitch = i_width_aligned * 2;
- p_pic->p->i_visible_pitch = i_width * 2;
- p_pic->p->i_pixel_pitch = 2;
- p_pic->i_planes = 1;
- break;
-
- case FOURCC_RV24:
- p_pic->p->i_lines = i_height_aligned;
- p_pic->p->i_visible_lines = i_height;
- p_pic->p->i_pitch = i_width_aligned * 3;
- p_pic->p->i_visible_pitch = i_width * 3;
- p_pic->p->i_pixel_pitch = 3;
- p_pic->i_planes = 1;
- break;
-
- case FOURCC_RV32:
- case FOURCC_RGBA:
- p_pic->p->i_lines = i_height_aligned;
- p_pic->p->i_visible_lines = i_height;
- p_pic->p->i_pitch = i_width_aligned * 4;
- p_pic->p->i_visible_pitch = i_width * 4;
- p_pic->p->i_pixel_pitch = 4;
- p_pic->i_planes = 1;
- break;
-
- case FOURCC_GREY:
- case FOURCC_Y800:
- case FOURCC_Y8:
- case FOURCC_RGBP:
- p_pic->p->i_lines = i_height_aligned;
- p_pic->p->i_visible_lines = i_height;
- p_pic->p->i_pitch = i_width_aligned;
- p_pic->p->i_visible_pitch = i_width;
- p_pic->p->i_pixel_pitch = 1;
- p_pic->i_planes = 1;
- break;
-
- default:
- if( p_this )
- msg_Err( p_this, "unknown chroma type 0x%.8x (%4.4s)",
- i_chroma, (char*)&i_chroma );
- p_pic->i_planes = 0;
- return VLC_EGENERIC;
- }
-
- return VLC_SUCCESS;
-}
-
/**
* Compare two chroma values
*
int vout_ChromaCmp( vlc_fourcc_t i_chroma, vlc_fourcc_t i_amorhc )
{
static const vlc_fourcc_t p_I420[] = {
- FOURCC_I420, FOURCC_IYUV, FOURCC_YV12, FOURCC_J420, 0
+ VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, 0
};
static const vlc_fourcc_t p_I422[] = {
- FOURCC_I422, FOURCC_J422, 0
+ VLC_CODEC_I422, VLC_CODEC_J422, 0
};
static const vlc_fourcc_t p_I440[] = {
- FOURCC_I440, FOURCC_J440, 0
+ VLC_CODEC_I440, VLC_CODEC_J440, 0
};
static const vlc_fourcc_t p_I444[] = {
- FOURCC_I444, FOURCC_J444, 0
- };
- static const vlc_fourcc_t p_UYVY[] = {
- FOURCC_UYVY, FOURCC_UYNV, FOURCC_Y422, 0
- };
- static const vlc_fourcc_t p_YUYV[] = {
- FOURCC_YUY2, FOURCC_YUNV, 0
- };
- static const vlc_fourcc_t p_GREY[] = {
- FOURCC_GREY, FOURCC_Y800, FOURCC_Y8, 0
+ VLC_CODEC_I444, VLC_CODEC_J444, 0
};
static const vlc_fourcc_t *pp_fcc[] = {
- p_I420, p_I422, p_I440, p_I444, p_UYVY, p_YUYV, p_GREY, NULL
+ p_I420, p_I422, p_I440, p_I444, NULL
};
+ /* */
+ i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, i_chroma );
+ i_amorhc = vlc_fourcc_GetCodec( VIDEO_ES, i_amorhc );
+
/* If they are the same, they are the same ! */
if( i_chroma == i_amorhc )
return 1;
return;
picture_Delete( p_picture );
}
+
+/*****************************************************************************
+ *
+ *****************************************************************************/
+int picture_Setup( picture_t *p_picture, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect )
+{
+ int i_index, i_width_aligned, i_height_aligned;
+
+ /* Store default values */
+ for( i_index = 0; i_index < VOUT_MAX_PLANES; i_index++ )
+ {
+ p_picture->p[i_index].p_pixels = NULL;
+ p_picture->p[i_index].i_pixel_pitch = 1;
+ }
+
+ p_picture->pf_release = NULL;
+ p_picture->p_release_sys = NULL;
+ p_picture->pf_lock = NULL;
+ p_picture->pf_unlock = NULL;
+ p_picture->i_refcount = 0;
+
+ p_picture->i_qtype = QTYPE_NONE;
+ p_picture->i_qstride = 0;
+ p_picture->p_q = NULL;
+
+ video_format_Setup( &p_picture->format, i_chroma, i_width, i_height, i_aspect );
+
+ /* Make sure the real dimensions are a multiple of 16 */
+ i_width_aligned = (i_width + 15) >> 4 << 4;
+ i_height_aligned = (i_height + 15) >> 4 << 4;
+
+ /* Calculate coordinates */
+ switch( vlc_fourcc_GetCodec( VIDEO_ES, i_chroma ) )
+ {
+ case VLC_CODEC_I411:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned / 4;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width / 4;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned / 4;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width / 4;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_I410:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned / 4;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height / 4;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned / 4;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width / 4;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned / 4;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height / 4;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned / 4;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width / 4;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I420:
+ case VLC_CODEC_J420:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned / 2;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height / 2;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned / 2;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width / 2;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned / 2;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height / 2;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned / 2;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width / 2;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_I422:
+ case VLC_CODEC_J422:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned / 2;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width / 2;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned / 2;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width / 2;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_I440:
+ case VLC_CODEC_J440:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned / 2;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height / 2;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned / 2;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height / 2;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_I444:
+ case VLC_CODEC_J444:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_YUVA:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ A_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ A_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ A_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ A_PLANE ].i_visible_pitch = i_width;
+ p_picture->i_planes = 4;
+ break;
+
+ case VLC_CODEC_YUVP:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned;
+ p_picture->p->i_visible_pitch = i_width;
+ p_picture->p->i_pixel_pitch = 8;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_Y211:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned;
+ p_picture->p->i_visible_pitch = i_width;
+ p_picture->p->i_pixel_pitch = 4;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_UYVY:
+ case VLC_CODEC_VYUY:
+ case VLC_CODEC_YUYV:
+ case VLC_CODEC_YVYU:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned * 2;
+ p_picture->p->i_visible_pitch = i_width * 2;
+ p_picture->p->i_pixel_pitch = 4;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_RGB8:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned;
+ p_picture->p->i_visible_pitch = i_width;
+ p_picture->p->i_pixel_pitch = 1;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_RGB15:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned * 2;
+ p_picture->p->i_visible_pitch = i_width * 2;
+ p_picture->p->i_pixel_pitch = 2;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_RGB16:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned * 2;
+ p_picture->p->i_visible_pitch = i_width * 2;
+ p_picture->p->i_pixel_pitch = 2;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_RGB24:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned * 3;
+ p_picture->p->i_visible_pitch = i_width * 3;
+ p_picture->p->i_pixel_pitch = 3;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_RGB32:
+ case VLC_CODEC_RGBA:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned * 4;
+ p_picture->p->i_visible_pitch = i_width * 4;
+ p_picture->p->i_pixel_pitch = 4;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_GREY:
+ case VLC_CODEC_RGBP:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned;
+ p_picture->p->i_visible_pitch = i_width;
+ p_picture->p->i_pixel_pitch = 1;
+ p_picture->i_planes = 1;
+ break;
+
+ default:
+ p_picture->i_planes = 0;
+ return VLC_EGENERIC;
+ }
+
+ return VLC_SUCCESS;
+}
+
/*****************************************************************************
*
*****************************************************************************/
void picture_Delete( picture_t *p_picture )
{
assert( p_picture && p_picture->i_refcount == 0 );
+ assert( p_picture->p_release_sys == NULL );
free( p_picture->p_q );
free( p_picture->p_data_orig );
/*****************************************************************************
*
*****************************************************************************/
-
* Fourcc definitions that we can handle internally
*****************************************************************************/
-/* Packed RGB for 8bpp */
-#define FOURCC_BI_RGB 0x00000000
-#define FOURCC_RGB2 VLC_FOURCC('R','G','B','2')
-
-/* Packed RGB for 16, 24, 32bpp */
-#define FOURCC_BI_BITFIELDS 0x00000003
-
-/* Packed RGB 15bpp, usually 0x7c00, 0x03e0, 0x001f */
-#define FOURCC_RV15 VLC_FOURCC('R','V','1','5')
-
-/* Packed RGB 16bpp, usually 0xf800, 0x07e0, 0x001f */
-#define FOURCC_RV16 VLC_FOURCC('R','V','1','6')
-
-/* Packed RGB 24bpp, usually 0x00ff0000, 0x0000ff00, 0x000000ff */
-#define FOURCC_RV24 VLC_FOURCC('R','V','2','4')
-
-/* Packed RGB 32bpp, usually 0x00ff0000, 0x0000ff00, 0x000000ff */
-#define FOURCC_RV32 VLC_FOURCC('R','V','3','2')
-
-/* Packed RGBA 32bpp, like RV32 with 0xff000000 used for alpha */
-#define FOURCC_RGBA VLC_FOURCC('R','G','B','A')
-
-/* Planar YUV 4:2:0, Y:U:V */
-#define FOURCC_I420 VLC_FOURCC('I','4','2','0')
-#define FOURCC_IYUV VLC_FOURCC('I','Y','U','V')
-#define FOURCC_J420 VLC_FOURCC('J','4','2','0')
-
-/* Planar YUV 4:2:0, Y:V:U */
-#define FOURCC_YV12 VLC_FOURCC('Y','V','1','2')
-
-/* Packed YUV 4:2:2, U:Y:V:Y, interlaced */
-#define FOURCC_IUYV VLC_FOURCC('I','U','Y','V')
-
-/* Packed YUV 4:2:2, U:Y:V:Y */
-#define FOURCC_UYVY VLC_FOURCC('U','Y','V','Y')
-#define FOURCC_UYNV VLC_FOURCC('U','Y','N','V')
-#define FOURCC_Y422 VLC_FOURCC('Y','4','2','2')
-
-/* Packed YUV 4:2:2, U:Y:V:Y, reverted */
-#define FOURCC_cyuv VLC_FOURCC('c','y','u','v')
-
-/* Packed YUV 4:2:2, Y:U:Y:V */
-#define FOURCC_YUY2 VLC_FOURCC('Y','U','Y','2')
-#define FOURCC_YUNV VLC_FOURCC('Y','U','N','V')
-
-/* Packed YUV 4:2:2, Y:V:Y:U */
-#define FOURCC_YVYU VLC_FOURCC('Y','V','Y','U')
-
-/* Packed YUV 2:1:1, Y:U:Y:V */
-#define FOURCC_Y211 VLC_FOURCC('Y','2','1','1')
-
-/* Planar YUV 4:1:1, Y:U:V */
-#define FOURCC_I411 VLC_FOURCC('I','4','1','1')
-
-/* Planar YUV 4:1:0, Y:U:V */
-#define FOURCC_I410 VLC_FOURCC('I','4','1','0')
-#define FOURCC_YVU9 VLC_FOURCC('Y','V','U','9')
-
-/* Planar Y, packed UV, from Matrox */
-#define FOURCC_YMGA VLC_FOURCC('Y','M','G','A')
-
-/* Planar 4:2:2, Y:U:V */
-#define FOURCC_I422 VLC_FOURCC('I','4','2','2')
-#define FOURCC_J422 VLC_FOURCC('J','4','2','2')
-
-/* Planar 4:4:0, Y:U:V */
-#define FOURCC_I440 VLC_FOURCC('I','4','4','0')
-#define FOURCC_J440 VLC_FOURCC('J','4','4','0')
-
-/* Planar 4:4:4, Y:U:V */
-#define FOURCC_I444 VLC_FOURCC('I','4','4','4')
-#define FOURCC_J444 VLC_FOURCC('J','4','4','4')
-
-/* Planar 4:4:4:4 Y:U:V:A */
-#define FOURCC_YUVA VLC_FOURCC('Y','U','V','A')
-
-/* Palettized YUV with palette element Y:U:V:A */
-#define FOURCC_YUVP VLC_FOURCC('Y','U','V','P')
-
-/* Palettized RGB with palette element R:G:B */
-#define FOURCC_RGBP VLC_FOURCC('R','G','B','P')
-
-
-/* Planar 8-bit grayscale */
-#define FOURCC_GREY VLC_FOURCC('G','R','E','Y')
-#define FOURCC_Y800 VLC_FOURCC('Y','8','0','0')
-#define FOURCC_Y8 VLC_FOURCC('Y','8',' ',' ')
-
/* Alignment of critical dynamic data structure
*
* Not all platforms support memalign so we provide a vlc_memalign wrapper
/* Number of simultaneous subpictures */
#define VOUT_MAX_SUBPICTURES (VOUT_MAX_PICTURES)
-#define VLC_FOURCC_YUVP VLC_FOURCC('Y','U','V','P')
-#define VLC_FOURCC_YUVA VLC_FOURCC('Y','U','V','A')
-#define VLC_FOURCC_RGBA VLC_FOURCC('R','G','B','A')
-#define VLC_FOURCC_TEXT VLC_FOURCC('T','E','X','T')
-
/* */
typedef struct
{
p_region->fmt = *p_fmt;
p_region->fmt.p_palette = NULL;
- if( p_fmt->i_chroma == VLC_FOURCC_YUVP )
+ if( p_fmt->i_chroma == VLC_CODEC_YUVP )
{
p_region->fmt.p_palette = calloc( 1, sizeof(*p_region->fmt.p_palette) );
if( p_fmt->p_palette )
p_region->p_style = NULL;
p_region->p_picture = NULL;
- if( p_fmt->i_chroma == VLC_FOURCC_TEXT )
+ if( p_fmt->i_chroma == VLC_CODEC_TEXT )
return p_region;
p_region->p_picture = picture_New( p_fmt->i_chroma, p_fmt->i_width, p_fmt->i_height,
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 );
}
/* XXX p_spu->p_scale is used for all conversion/scaling except yuvp to
* yuva/rgba */
p_spu->p->p_scale = CreateAndLoadScale( VLC_OBJECT(p_spu),
- VLC_FOURCC_YUVA, VLC_FOURCC_YUVA, true );
+ VLC_CODEC_YUVA, VLC_CODEC_YUVA, true );
/* This one is used for YUVP to YUVA/RGBA without scaling
* FIXME rename it */
p_spu->p->p_scale_yuvp = CreateAndLoadScale( VLC_OBJECT(p_spu),
- VLC_FOURCC_YUVP, VLC_FOURCC_YUVA, false );
+ VLC_CODEC_YUVP, VLC_CODEC_YUVA, false );
}
static void SpuRenderText( spu_t *p_spu, bool *pb_rerender_text,
{
filter_t *p_text = p_spu->p->p_text;
- assert( p_region->fmt.i_chroma == VLC_FOURCC_TEXT );
+ assert( p_region->fmt.i_chroma == VLC_CODEC_TEXT );
if( !p_text || !p_text->p_module )
goto exit;
*p_area = spu_area_create( 0,0, 0,0, scale_size );
/* Render text region */
- if( p_region->fmt.i_chroma == VLC_FOURCC_TEXT )
+ if( p_region->fmt.i_chroma == VLC_CODEC_TEXT )
{
const int i_min_scale_ratio = SCALE_UNIT; /* FIXME what is the right value? (scale_size is not) */
SpuRenderText( p_spu, &b_rerender_text, p_subpic, p_region, i_min_scale_ratio );
b_restore_format = b_rerender_text;
/* Check if the rendering has failed ... */
- if( p_region->fmt.i_chroma == VLC_FOURCC_TEXT )
+ if( p_region->fmt.i_chroma == VLC_CODEC_TEXT )
goto exit;
}
* FIXME b_force_palette and b_force_crop are applied to all subpictures using palette
* instead of only the right one (being the dvd spu).
*/
- const bool b_using_palette = p_region->fmt.i_chroma == VLC_FOURCC_YUVP;
+ const bool b_using_palette = p_region->fmt.i_chroma == VLC_CODEC_YUVP;
const bool b_force_palette = b_using_palette && p_sys->b_force_palette;
const bool b_force_crop = b_force_palette && p_sys->b_force_crop;
bool b_changed_palette = false;
/* TODO converting to RGBA for RGB video output is better */
p_scale_yuvp->fmt_out.video = p_region->fmt;
- p_scale_yuvp->fmt_out.video.i_chroma = VLC_FOURCC_YUVA;
+ p_scale_yuvp->fmt_out.video.i_chroma = VLC_CODEC_YUVA;
p_picture = p_scale_yuvp->pf_video_filter( p_scale_yuvp, p_picture );
if( !p_picture )
test_libvlc_events \
test_libvlc_media_list \
test_libvlc_media_list_player \
- $(NULL)
-EXTRA_PROGRAMS = \
test_libvlc_media_player \
+ $(NULL)
+
+# Disabled test:
+# meta: No suitable test file
+EXTRA_PROGRAMS = \
test_libvlc_meta \
$(NULL)
+
#check_DATA = samples/test.sample samples/meta.sample
EXTRA_DIST = samples/empty.voc
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
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);
#include "test.h"
+static void media_list_add_file_path(libvlc_instance_t *vlc, libvlc_media_list_t *ml, const char * file_path)
+{
+ libvlc_media_t *md = libvlc_media_new (vlc, file_path, &ex);
+ catch ();
+
+ libvlc_media_list_add_media (ml, md, &ex);
+ catch ();
+
+ libvlc_media_release (md);
+}
+
+static void test_media_list_player_next(const char** argv, int argc)
+{
+ libvlc_instance_t *vlc;
+ libvlc_media_t *md;
+ libvlc_media_list_t *ml;
+ libvlc_media_list_player_t *mlp;
+
+ const char * file = test_default_sample;
+
+ log ("Testing media player next()\n");
+
+ libvlc_exception_init (&ex);
+ vlc = libvlc_new (argc, argv, &ex);
+ catch ();
+
+ md = libvlc_media_new (vlc, file, &ex);
+ catch ();
+
+ ml = libvlc_media_list_new (vlc, &ex);
+ catch ();
+
+ mlp = libvlc_media_list_player_new (vlc, &ex);
+ catch ();
+
+ libvlc_media_list_add_media (ml, md, &ex);
+ catch ();
+
+ // Add three media
+ media_list_add_file_path (vlc, ml, file);
+ media_list_add_file_path (vlc, ml, file);
+ media_list_add_file_path (vlc, ml, file);
+
+ libvlc_media_list_player_set_media_list (mlp, ml, &ex);
+
+ libvlc_media_list_player_play_item (mlp, md, &ex);
+ catch ();
+
+ libvlc_media_release (md);
+
+ usleep(500000);
+
+ libvlc_media_list_player_next (mlp, &ex);
+ catch ();
+
+ libvlc_media_list_player_pause (mlp, &ex);
+ catch();
+
+ usleep(500000);
+
+ libvlc_media_list_player_next (mlp, &ex);
+ catch ();
+
+ libvlc_media_list_player_stop (mlp, &ex);
+ catch ();
+
+ usleep(500000);
+
+ libvlc_media_list_player_next (mlp, &ex);
+ catch ();
+
+ libvlc_media_list_player_release (mlp);
+ catch ();
+
+ libvlc_release (vlc);
+ catch ();
+}
+
static void test_media_list_player_pause_stop(const char** argv, int argc)
{
libvlc_instance_t *vlc;
const char * file = test_default_sample;
- log ("Testing play and pause of %s using the media list.\n", file);
+ log ("Testing play_item_at_index of %s using the media list.\n", file);
libvlc_exception_init (&ex);
vlc = libvlc_new (argc, argv, &ex);
test_media_list_player_pause_stop (test_defaults_args, test_defaults_nargs);
test_media_list_player_play_item_at_index (test_defaults_args, test_defaults_nargs);
+ if(0) // Core hangs here, because it doesn't support callback removal from callbacks (variable)
+ test_media_list_player_next (test_defaults_args, test_defaults_nargs);
+
return 0;
}
catch ();
} while( state != libvlc_Playing &&
state != libvlc_Error &&
- state != libvlc_MediaPlayerEndReached );
+ state != libvlc_Ended );
- assert( state == libvlc_Playing || state == libvlc_MediaPlayerEndReached );
+ assert( state == libvlc_Playing || state == libvlc_Ended );
libvlc_media_player_stop (mi, &ex);
catch ();
libvlc_media_player_t *mi;
const char * file = test_default_sample;
- log ("Testing play and pause of %s\n", file);
+ log ("Testing pause and stop of %s\n", file);
libvlc_exception_init (&ex);
vlc = libvlc_new (argc, argv, &ex);
libvlc_media_player_play (mi, &ex);
catch ();
+ log ("Waiting for playing\n");
+
/* Wait a correct state */
libvlc_state_t state;
do {
catch ();
} while( state != libvlc_Playing &&
state != libvlc_Error &&
- state != libvlc_MediaPlayerEndReached );
+ state != libvlc_Ended );
- assert( state == libvlc_Playing || state == libvlc_MediaPlayerEndReached );
+ assert( state == libvlc_Playing || state == libvlc_Ended );
+#if 0
+ /* This can't work because under some condition (short file, this is the case) this will be
+ * equivalent to a play() */
libvlc_media_player_pause (mi, &ex);
- assert( libvlc_media_player_get_state (mi, &ex) == libvlc_Paused );
catch();
+ log ("Waiting for pause\n");
+
+ /* Wait a correct state */
+ do {
+ state = libvlc_media_player_get_state (mi, &ex);
+ catch ();
+ } while( state != libvlc_Paused &&
+ state != libvlc_Error &&
+ state != libvlc_Ended );
+
+ assert( state == libvlc_Paused || state == libvlc_Ended );
+ catch();
+#endif
+
libvlc_media_player_stop (mi, &ex);
catch ();
* http://www.gnu.org/copyleft/gpl.html *
**********************************************************************/
+#include <strings.h>
+
#include "test.h"
static void test_meta (const char ** argv, int argc)
while (!libvlc_media_is_preparsed (media, &ex))
{
catch ();
- msleep (10000);
+ usleep (10000);
}
artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex);
static libvlc_exception_t ex;
static const char * test_defaults_args[] = {
- "-vvv",
+ "-v",
"--ignore-config",
"-I",
"dummy",