--- vlc-0.8.4.debian.orig/debian/changelog +++ vlc-0.8.4.debian/debian/changelog @@ -1,3 +1,73 @@ +vlc (0.8.4.debian-1ubuntu6) dapper; urgency=low + + "'Time to race', she said, 'Race the downhill'." + + * Add debian/patches/24_prefs_stacking_fix, fixing stacking in + Preferences dialog. Taken from upstream svn changeset 13795, thanks + to Bruce Cowan (Closes: Malone #31891). + * Demote ttf-freefont, ttf-thryomanes to Suggests as the former + provides bad metrics for Thai. See Debian #362071 for additional + information. + * Don't use gcc-snapshot as the compiler. See Debian #361729 for more + information. + * Make vlc.desktop HIG-compliant. + * Rebuild against new libebml-dev and libmatroska-dev, fixing crashes + with Matroska files (Closes: Malone #29644). + * Use our own faad2 and x264, fixing garbled graphics (Closes: Malone + #28539). Please see Debian #365389 if the inclusion of these + libraries stirs your ire. + + -- Daniel T Chen Tue, 23 May 2006 03:42:19 -0400 + +vlc (0.8.4.debian-1ubuntu5) dapper; urgency=low + + * Integrate updates from Debian: + - Enable support for zeroconf/bonjour, musepack decoding, and VCD + navigation (and adjust debian/{control,rules} accordingly, adding + debian/patches/22_avahi_client_0.6_api). + + -- Daniel T Chen Sun, 05 Mar 2006 18:38:55 -0800 + +vlc (0.8.4.debian-1ubuntu4) dapper; urgency=low + + * removed nonexistent xlibs-static-pic build dep to fix FTBFS + * changes UBUNTU_ENV from /usr/lib/mozilla-firefox/xpidl + to /usr/lib/firefox/xpidl to fix FTBFS + * added 21_gnome-screensaver-support.dpatch to automagically + disable screensavers while playing a movie + + -- Oliver Grawert Tue, 28 Feb 2006 20:24:37 +0100 + +vlc (0.8.4.debian-1ubuntu3) dapper; urgency=low + + * debian/control: Replace mozilla-dev build dependency with + firefox-dev. Change mozilla-plugin-vlc's Recommends appropriately. + Fixes FTBFS due to mozilla-dev muck on [!amd64]. + * debian/rules: Elide Ubuntu modifications into UBUNTU_ENV to pass + to configure (MOZILLA_CONFIG=/usr/bin/firefox-config , + XPIDL=/usr/lib/mozilla-firefox/xpidl) + + -- Daniel T Chen Fri, 30 Dec 2005 19:29:07 -0800 + +vlc (0.8.4.debian-1ubuntu2) dapper; urgency=low + + * Rebuild for new dbus. + + -- Daniel T Chen Thu, 22 Dec 2005 14:32:09 -0800 + +vlc (0.8.4.debian-1ubuntu1) dapper; urgency=low + + * Resynchronise with Debian: + - Fix build dependency on GL headers. + - Reintegrate patch for HAL 0.5 API in src/libvlc.c(Debian#332927), + fixing FTBFS. + - Fix broken mailcap entries in vlc.mime (Closes: Debian#340434, + Debian#339570). + - Make vlc depend on vlc-plugin-alsa (Closes: #3678, #4544). + - Fix unicast streaming (Closes: #4444). + + -- Daniel T Chen Sun, 27 Nov 2005 22:50:24 -0800 + vlc (0.8.4.debian-1) unstable; urgency=low * New upstream release. --- vlc-0.8.4.debian.orig/debian/control +++ vlc-0.8.4.debian/debian/control @@ -2,15 +2,15 @@ Section: graphics Priority: optional Maintainer: Sam Hocevar (Debian packages) -Build-Depends: debhelper (>= 4.0), dh-buildinfo, dpatch, gettext, libx11-dev, libxext-dev, libxt-dev, libxv-dev, xlibs-static-pic, libggi2-dev, libglide2-dev [i386], libesd0-dev, libaudiofile-dev, libsdl1.2-dev (>= 1.2.7+1.2.8cvs20041007-5.3), libasound2-dev (>= 0.9.0beta10a), libarts1-dev (>= 1.4.2-1), libmad0-dev, liblircclient-dev, liba52-0.7.4-dev, libaa1-dev, libdvbpsi4-dev, mozilla-dev (>= 2:1.7.10-1), libidl0, libglib2.0-0, libxosd-dev (>= 2.2.4-1.3), libsvga1-dev [i386], libogg-dev, libvorbis-dev, libwxgtk2.6-dev, libdvdread3-dev, libflac-dev (>= 1.1.2-3), libimlib2-dev, libmatroska-dev (>= 0.7.7), libfreetype6-dev, linux-kernel-headers (>= 2.5.999-test7-bk-7), libcaca-dev (>= 0.9), liblivemedia-dev (>= 2004.11.11a-1), libmpeg2-4-dev, zlib1g-dev, libdts-dev, libfribidi-dev, libcdio-dev, libxml2-dev, libid3tag0-dev, libtheora-dev, nasm, libmodplug-dev, libhal-dev, libtar-dev, libdvdnav-dev, libgnutls-dev (>= 1.2.8), libavcodec-dev (>= 0.cvs20050918-2), libavformat-dev (>= 0.cvs20050918-2), libpostproc-dev (>= 0.cvs20050918-2), libncurses5-dev, libpng12-dev, xlibmesa-gl-dev, libsmbclient-dev, gcc-snapshot [i386 amd64], yasm [amd64] +Build-Depends: debhelper (>= 4.0), dh-buildinfo, dpatch, gettext, libx11-dev, libxext-dev, libxt-dev, libxv-dev, libggi2-dev, libglide2-dev [i386], libesd0-dev, libaudiofile-dev, libsdl1.2-dev (>= 1.2.7+1.2.8cvs20041007-5.3), libasound2-dev (>= 0.9.0beta10a), libarts1-dev (>= 1.4.2-1), libmad0-dev, liblircclient-dev, liba52-0.7.4-dev, libaa1-dev, libdvbpsi4-dev, firefox-dev, libidl0, libglib2.0-0, libxosd-dev (>= 2.2.4-1.3), libsvga1-dev [i386], libogg-dev, libvorbis-dev, libwxgtk2.6-dev, libdvdread3-dev, libflac-dev (>= 1.1.2-3), libimlib2-dev, libmatroska-dev (>= 0.7.7), libfreetype6-dev, linux-kernel-headers (>= 2.5.999-test7-bk-7), libcaca-dev (>= 0.9), liblivemedia-dev (>= 2004.11.11a-1), libmpeg2-4-dev, zlib1g-dev, libdts-dev, libfribidi-dev, libcdio-dev, libxml2-dev, libid3tag0-dev, libtheora-dev, nasm, libmodplug-dev, libhal-dev, libtar-dev, libdvdnav-dev, libgnutls-dev (>= 1.2.8), libavcodec-dev (>= 0.cvs20050918-2), libavformat-dev (>= 0.cvs20050918-2), libpostproc-dev (>= 0.cvs20050918-2), libncurses5-dev, libpng12-dev, libgl1-mesa-dev | libgl-dev, libsmbclient-dev, yasm [amd64], libavahi-client-dev, libavahi-core-dev, libmpcdec-dev, libsysfs-dev, libvcdinfo-dev Standards-Version: 3.6.2.1 Package: vlc Section: graphics Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, wxvlc, ttf-freefont -Recommends: ttf-thryomanes, videolan-doc -Suggests: vlc-plugin-alsa, mozilla-plugin-vlc +Depends: ${shlibs:Depends}, ${misc:Depends}, wxvlc, vlc-plugin-alsa +Recommends: videolan-doc +Suggests: ttf-freefont, ttf-thryomanes, mozilla-plugin-vlc Replaces: vlc-plugin-dvb (<< 0.5.2-2), vlc-plugin-xosd (<< 0.5.2-2), vlc-plugin-dv (<< 0.5.2-2), vlc-plugin-mad (<< 0.5.2-2), vlc-mad (<< 0.5.0), vlc-plugin-a52 (<< 0.5.2-2), vlc-plugin-ogg (<< 0.5.2-2), vlc-plugin-lirc (<< 0.5.2-2), vlc-lirc (<< 0.5.0), vlc-plugin-aa (<< 0.5.2-2), vlc-aa (<< 0.5.0) Conflicts: vlc-plugin-dvb (<< 0.5.2-2), vlc-plugin-xosd (<< 0.5.2-2), vlc-plugin-dv (<< 0.5.2-2), vlc-plugin-mad (<< 0.5.2-2), vlc-mad (<< 0.5.0), vlc-plugin-a52 (<< 0.5.2-2), vlc-plugin-ogg (<< 0.5.2-2), vlc-plugin-lirc (<< 0.5.2-2), vlc-lirc (<< 0.5.0), vlc-plugin-aa (<< 0.5.2-2), vlc-aa (<< 0.5.0) Provides: mp3-decoder @@ -170,7 +170,7 @@ Package: mozilla-plugin-vlc Architecture: any Depends: vlc (= ${Source-Version}), ${shlibs:Depends}, ${misc:Depends} -Recommends: mozilla-browser | mozilla-firefox +Recommends: firefox | mozilla-firefox | mozilla-browser Description: multimedia plugin for Mozilla based on VLC This plugin adds support for MPEG, MPEG2, DVD, DivX, Ogg/Vorbis and many more formats to your Mozilla browser. The decoding process is done by VLC --- vlc-0.8.4.debian.orig/debian/patches/00list +++ vlc-0.8.4.debian/debian/patches/00list @@ -1,2 +1,6 @@ +01_libhal_api-libvlc.c #20_no-wx-updates 20_osdmenu-paths +21_gnome-screensaver-support +22_avahi_client_0.6_api +24_prefs_stacking_fix --- vlc-0.8.4.debian.orig/debian/patches/01_libhal_api-libvlc.c.dpatch +++ vlc-0.8.4.debian/debian/patches/01_libhal_api-libvlc.c.dpatch @@ -0,0 +1,155 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_libhal_api-libvlc.c.dpatch by Daniel T Chen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Use new HAL 0.5 API in src/libvlc.c + +@DPATCH@ + +--- vlc-0.8.4-svn20050920.orig/src/libvlc.c ++++ vlc-0.8.4-svn20050920/src/libvlc.c +@@ -2561,22 +2561,26 @@ + char *block_dev; + dbus_bool_t b_dvd; + +- if( ( ctx = hal_initialize( NULL, FALSE ) ) ) ++ if( ( ctx = libhal_ctx_init_direct( NULL ) ) ) + { +- if( ( devices = hal_get_all_devices( ctx, &i_devices ) ) ) ++ if( ( devices = libhal_get_all_devices( ctx, &i_devices, NULL ) ) ) + { + for( i = 0; i < i_devices; i++ ) + { +- if( !hal_device_property_exists( ctx, devices[ i ], +- "storage.cdrom.dvd" ) ) ++ if( !libhal_device_property_exists( ctx, devices[ i ], ++ "storage.cdrom.dvd", ++ NULL ) ) + { + continue; + } + +- b_dvd = hal_device_get_property_bool( ctx, devices[ i ], +- "storage.cdrom.dvd" ); +- block_dev = hal_device_get_property_string( ctx, devices[ i ], +- "block.device" ); ++ b_dvd = libhal_device_get_property_bool( ctx, devices[ i ], ++ "storage.cdrom.dvd", ++ NULL ); ++ block_dev = libhal_device_get_property_string( ctx, ++ devices[ i ], ++ "block.device", ++ NULL ); + + if( b_dvd ) + { +@@ -2586,12 +2586,12 @@ + config_PutPsz( p_vlc, "vcd", block_dev ); + config_PutPsz( p_vlc, "cd-audio", block_dev ); + +- hal_free_string( block_dev ); ++ libhal_free_string( block_dev ); + } +- hal_free_string_array( devices ); ++ libhal_free_string_array( devices ); + } + +- hal_shutdown( ctx ); ++ libhal_ctx_shutdown( ctx, NULL ); + } + #endif + } +--- vlc-0.8.4-svn20050920.orig/modules/services_discovery/hal.c ++++ vlc-0.8.4-svn20050920/modules/services_discovery/hal.c +@@ -106,7 +106,7 @@ + p_sd->pf_run = Run; + p_sd->p_sys = p_sys; + +- if( !( p_sys->p_ctx = hal_initialize( NULL, FALSE ) ) ) ++ if( !( p_sys->p_ctx = libhal_ctx_init_direct( NULL ) ) ) + { + free( p_sys ); + msg_Err( p_sd, "hal not available" ); +@@ -160,16 +160,17 @@ + services_discovery_sys_t *p_sys = p_sd->p_sys; + playlist_t *p_playlist; + playlist_item_t *p_item; +- psz_name = hal_device_get_property_string( p_sd->p_sys->p_ctx, +- psz_device, "volume.label" ); +- psz_blockdevice = hal_device_get_property_string( p_sd->p_sys->p_ctx, +- psz_device, "block.device" ); ++ psz_name = libhal_device_get_property_string( p_sd->p_sys->p_ctx, ++ psz_device, "volume.label", ++ NULL ); ++ psz_blockdevice = libhal_device_get_property_string( p_sd->p_sys->p_ctx, ++ psz_device, "block.device", NULL ); + asprintf( &psz_uri, "dvd://%s", psz_blockdevice ); + /* Create the playlist item here */ + p_item = playlist_ItemNew( p_sd, psz_uri, + psz_name ); + free( psz_uri ); +- hal_free_string( psz_device ); ++ libhal_free_string( psz_device ); + if( !p_item ) + { + return; +@@ -197,14 +198,14 @@ + services_discovery_sys_t *p_sys = p_sd->p_sys; + playlist_t *p_playlist; + playlist_item_t *p_item; +- psz_blockdevice = hal_device_get_property_string( p_sd->p_sys->p_ctx, +- psz_device, "block.device" ); ++ psz_blockdevice = libhal_device_get_property_string( p_sd->p_sys->p_ctx, ++ psz_device, "block.device", NULL ); + asprintf( &psz_uri, "cdda://%s", psz_blockdevice ); + /* Create the playlist item here */ + p_item = playlist_ItemNew( p_sd, psz_uri, + psz_name ); + free( psz_uri ); +- hal_free_string( psz_device ); ++ libhal_free_string( psz_device ); + if( !p_item ) + { + return; +@@ -229,24 +230,25 @@ + { + char *psz_disc_type; + services_discovery_sys_t *p_sys = p_sd->p_sys; +- if( hal_device_property_exists( p_sys->p_ctx, psz_device, +- "volume.disc.type" ) ) ++ if( libhal_device_property_exists( p_sys->p_ctx, psz_device, ++ "volume.disc.type", NULL ) ) + { +- psz_disc_type = hal_device_get_property_string( p_sys->p_ctx, +- psz_device, +- "volume.disc.type" ); ++ psz_disc_type = libhal_device_get_property_string( p_sys->p_ctx, ++ psz_device, ++ "volume.disc.type", ++ NULL ); + if( !strcmp( psz_disc_type, "dvd_rom" ) ) + { + AddDvd( p_sd, psz_device ); + } + else if( !strcmp( psz_disc_type, "cd_rom" ) ) + { +- if( hal_device_get_property_bool( p_sys->p_ctx, psz_device, "volume.disc.has_audio" ) ) ++ if( libhal_device_get_property_bool( p_sys->p_ctx, psz_device, "volume.disc.has_audio", NULL ) ) + { + AddCdda( p_sd, psz_device ); + } + } +- hal_free_string( psz_disc_type ); ++ libhal_free_string( psz_disc_type ); + } + } + +@@ -260,7 +262,7 @@ + services_discovery_sys_t *p_sys = p_sd->p_sys; + + /* parse existing devices first */ +- if( ( devices = hal_get_all_devices( p_sys->p_ctx, &i_devices ) ) ) ++ if( ( devices = libhal_get_all_devices( p_sys->p_ctx, &i_devices, NULL ) ) ) + { + for( i = 0; i < i_devices; i++ ) + { --- vlc-0.8.4.debian.orig/debian/patches/21_gnome-screensaver-support.dpatch +++ vlc-0.8.4.debian/debian/patches/21_gnome-screensaver-support.dpatch @@ -0,0 +1,29 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 21_gnome-screensaver-support.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad vlc-0.8.4.debian~/modules/misc/screensaver.c vlc-0.8.4.debian/modules/misc/screensaver.c +--- vlc-0.8.4.debian~/modules/misc/screensaver.c 2005-11-26 15:37:50.000000000 +0100 ++++ vlc-0.8.4.debian/modules/misc/screensaver.c 2006-02-28 20:23:53.000000000 +0100 +@@ -25,6 +25,7 @@ + * Preamble + *****************************************************************************/ + #include ++#include + + #include + #include +@@ -85,6 +86,10 @@ + /* http://www.jwz.org/xscreensaver/faq.html#dvd */ + system( "xscreensaver-command -deactivate >&- 2>&- &" ); + ++ if (access("/usr/bin/gnome-screensaver-command", X_OK) == 0) ++ { ++ system( "gnome-screensaver-command --poke >&- 2>&- &" ); ++ } + /* FIXME: add support for other screensavers */ + } + --- vlc-0.8.4.debian.orig/debian/patches/22_avahi_client_0.6_api.dpatch +++ vlc-0.8.4.debian/debian/patches/22_avahi_client_0.6_api.dpatch @@ -0,0 +1,116 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 22_avahi_client_0.6_api.dpatch by Daniel T Chen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Update from svn changeset 13520 to enable Avahi client 0.6 API support + +@DPATCH@ + +diff -uNr vlc-0.8.4.debian/modules/access_output/bonjour.c vlc-0.8.4.debian.work/modules/access_output/bonjour.c +--- vlc-0.8.4.debian/modules/access_output/bonjour.c 2005-11-26 06:37:47.000000000 -0800 ++++ vlc-0.8.4.debian.work/modules/access_output/bonjour.c 2006-03-05 18:29:38.000000000 -0800 +@@ -33,6 +33,8 @@ + #include + + #include ++#include ++#include + #include + #include + #include +@@ -114,7 +116,7 @@ + } + + error = avahi_entry_group_add_service( p_sys->group, AVAHI_IF_UNSPEC, +- AVAHI_PROTO_UNSPEC, p_sys->psz_name, ++ AVAHI_PROTO_UNSPEC, 0, p_sys->psz_name, + p_sys->psz_stype, NULL, NULL, + p_sys->i_port, + p_sys->psz_txt, NULL ); +@@ -155,7 +157,8 @@ + if( p_sys->group != NULL ) + avahi_entry_group_reset( p_sys->group ); + } +- else if( state == AVAHI_CLIENT_DISCONNECTED ) ++ else if( state == AVAHI_CLIENT_FAILURE && ++ (avahi_client_errno(c) == AVAHI_ERR_DISCONNECTED) ) + { + msg_Err( p_sys->p_log, "avahi client disconnected" ); + avahi_simple_poll_quit( p_sys->simple_poll ); +@@ -221,6 +224,7 @@ + } + + p_sys->client = avahi_client_new( avahi_simple_poll_get(p_sys->simple_poll), ++ 0, + client_callback, p_sys, &err ); + if( p_sys->client == NULL ) + { +diff -uNr vlc-0.8.4.debian/modules/services_discovery/bonjour.c vlc-0.8.4.debian.work/modules/services_discovery/bonjour.c +--- vlc-0.8.4.debian/modules/services_discovery/bonjour.c 2005-11-26 06:37:50.000000000 -0800 ++++ vlc-0.8.4.debian.work/modules/services_discovery/bonjour.c 2006-03-05 18:30:37.000000000 -0800 +@@ -30,6 +30,8 @@ + #include + + #include ++#include ++#include + #include + #include + #include +@@ -82,7 +84,8 @@ + services_discovery_t *p_sd = ( services_discovery_t* )userdata; + services_discovery_sys_t *p_sys = p_sd->p_sys; + +- if( state == AVAHI_CLIENT_DISCONNECTED ) ++ if( state == AVAHI_CLIENT_FAILURE && ++ (avahi_client_errno(c) == AVAHI_ERR_DISCONNECTED) ) + { + msg_Err( p_sd, "avahi client disconnected" ); + avahi_simple_poll_quit( p_sys->simple_poll ); +@@ -104,12 +107,13 @@ + const AvahiAddress *address, + uint16_t port, + AvahiStringList *txt, ++ AvahiLookupResultFlags flags, + void* userdata ) + { + services_discovery_t *p_sd = ( services_discovery_t* )userdata; + services_discovery_sys_t *p_sys = p_sd->p_sys; + +- if( event == AVAHI_RESOLVER_TIMEOUT ) ++ if( event == AVAHI_RESOLVER_FAILURE ) + { + msg_Err( p_sd, + "failed to resolve service '%s' of type '%s' in domain '%s'", +@@ -186,6 +190,7 @@ + const char *name, + const char *type, + const char *domain, ++ AvahiLookupResultFlags flags, + void* userdata ) + { + services_discovery_t *p_sd = ( services_discovery_t* )userdata; +@@ -195,6 +200,7 @@ + { + if( avahi_service_resolver_new( p_sys->client, interface, protocol, + name, type, domain, AVAHI_PROTO_UNSPEC, ++ 0, + resolve_callback, userdata ) == NULL ) + { + msg_Err( p_sd, "failed to resolve service '%s': %s", name, +@@ -246,6 +252,7 @@ + } + + p_sys->client = avahi_client_new( avahi_simple_poll_get(p_sys->simple_poll), ++ 0, + client_callback, p_sd, &err ); + if( p_sys->client == NULL ) + { +@@ -257,6 +264,7 @@ + p_sys->sb = avahi_service_browser_new( p_sys->client, AVAHI_IF_UNSPEC, + AVAHI_PROTO_UNSPEC, + "_vlc-http._tcp", NULL, ++ 0, + browse_callback, p_sd ); + if( p_sys->sb == NULL ) + { --- vlc-0.8.4.debian.orig/debian/patches/24_prefs_stacking_fix.dpatch +++ vlc-0.8.4.debian/debian/patches/24_prefs_stacking_fix.dpatch @@ -0,0 +1,142 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 24_prefs_stacking_fix.dpatch by Daniel T Chen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix stacking in Preferences dialog, taken from upstream svn changeset +## DP: 13795. Closes: Malone #31981. + +@DPATCH@ + +--- trunk/modules/gui/wxwidgets/preferences.cpp ++++ trunk/modules/gui/wxwidgets/preferences.cpp +@@ -84,4 +84,6 @@ + wxWindow *p_parent; + vlc_bool_t b_advanced; ++ ++ wxPanel *p_current; + + wxTreeItemId root_item; +@@ -606,9 +608,9 @@ + + /* Sort all this mess */ +- wxTreeItemIdValue cookie; ++ wxTreeItemIdValue cookie; + size_t i_child_index; + wxTreeItemId capability_item = GetFirstChild( root_item, cookie); + for( i_child_index = 0; +- (capability_item.IsOk() && ++ (capability_item.IsOk() && + //(i_child_index < GetChildrenCount( plugins_item, FALSE ))); + (i_child_index < GetChildrenCount( root_item, FALSE ))); +@@ -625,4 +627,6 @@ + p_sizer->Add( this, 1, wxEXPAND | wxALL, 0 ); + p_sizer->Layout(); ++ ++ p_current = NULL; + + /* Update Tree Ctrl */ +@@ -690,4 +694,5 @@ + p_sizer->Remove( config_data->panel ); + #endif ++ p_current = NULL; + } + +@@ -775,8 +780,48 @@ + ConfigTreeData *config_data = NULL; + +- if( event.GetOldItem() ) +- config_data = FindModuleConfig( (ConfigTreeData *)GetItemData( +- event.GetOldItem() ) ); +- if( config_data && config_data->panel ) ++ if( p_current ) ++ { ++ p_current->Hide(); ++#if (wxCHECK_VERSION(2,5,0)) ++ p_sizer->Detach( p_current ); ++#else ++ p_sizer->Remove( p_current ); ++#endif ++ p_current = NULL; ++ } ++ ++ /* Don't use event.GetItem() because we also send fake events */ ++ config_data = FindModuleConfig( (ConfigTreeData *)GetItemData( ++ GetSelection() ) ); ++ if( config_data ) ++ { ++ if( !config_data->panel ) ++ { ++ /* The panel hasn't been created yet. Let's do it. */ ++ config_data->panel = ++ new PrefsPanel( p_parent, p_intf, p_prefs_dialog, ++ config_data ); ++ config_data->panel->SwitchAdvanced( b_advanced ); ++ } ++ else ++ { ++ config_data->panel->SwitchAdvanced( b_advanced ); ++ config_data->panel->Show(); ++ } ++ ++ p_current = config_data->panel; ++ ++ p_sizer->Add( config_data->panel, 3, wxEXPAND | wxALL, 0 ); ++ p_sizer->Layout(); ++ } ++} ++ ++void PrefsTreeCtrl::OnAdvanced( wxCommandEvent& event ) ++{ ++ b_advanced = event.GetInt(); ++ ++ ConfigTreeData *config_data = !GetSelection() ? NULL : ++ FindModuleConfig( (ConfigTreeData *)GetItemData( GetSelection() ) ); ++ if( config_data ) + { + config_data->panel->Hide(); +@@ -786,44 +831,5 @@ + p_sizer->Remove( config_data->panel ); + #endif +- } +- +- /* Don't use event.GetItem() because we also send fake events */ +- config_data = FindModuleConfig( (ConfigTreeData *)GetItemData( +- GetSelection() ) ); +- if( config_data ) +- { +- if( !config_data->panel ) +- { +- /* The panel hasn't been created yet. Let's do it. */ +- config_data->panel = +- new PrefsPanel( p_parent, p_intf, p_prefs_dialog, +- config_data ); +- config_data->panel->SwitchAdvanced( b_advanced ); +- } +- else +- { +- config_data->panel->SwitchAdvanced( b_advanced ); +- config_data->panel->Show(); +- } +- +- p_sizer->Add( config_data->panel, 3, wxEXPAND | wxALL, 0 ); +- p_sizer->Layout(); +- } +-} +- +-void PrefsTreeCtrl::OnAdvanced( wxCommandEvent& event ) +-{ +- b_advanced = event.GetInt(); +- +- ConfigTreeData *config_data = !GetSelection() ? NULL : +- FindModuleConfig( (ConfigTreeData *)GetItemData( GetSelection() ) ); +- if( config_data ) +- { +- config_data->panel->Hide(); +-#if (wxCHECK_VERSION(2,5,0)) +- p_sizer->Detach( config_data->panel ); +-#else +- p_sizer->Remove( config_data->panel ); +-#endif ++ p_current = NULL; + } + --- vlc-0.8.4.debian.orig/debian/rules +++ vlc-0.8.4.debian/debian/rules @@ -13,6 +13,8 @@ DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) confflags = --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) +UBUNTU_ENV += MOZILLA_CONFIG=/usr/bin/firefox-config XPIDL=/usr/lib/firefox/xpidl + # # Compilation options # @@ -69,6 +71,10 @@ --enable-ncurses \ --enable-smb \ --disable-gnomevfs \ + --enable-bonjour \ + --enable-mpc \ + --enable-vcd \ + --enable-vcdx \ $(NULL) # These ones are currently shipped with VLC @@ -135,6 +141,7 @@ && $(MAKE) # Configure VLC + $(UBUNTU_ENV) \ ./configure --mandir=$${prefix}/share/man \ --infodir=$${prefix}/share/info $(confflags) $(vlc_confflags) --- vlc-0.8.4.debian.orig/debian/vlc.desktop +++ vlc-0.8.4.debian/debian/vlc.desktop @@ -1,9 +1,7 @@ [Desktop Entry] Encoding=UTF-8 -Name=VLC media player -Name[fr]=lecteur multimédia VLC -Comment=Universal movies and music player -Comment[fr]=Lecteur universel pour films et musique +Name=VLC Media Player +Comment=Play movies and music Exec=wxvlc Icon=vlc.png Terminal=false --- vlc-0.8.4.debian.orig/debian/vlc.mime +++ vlc-0.8.4.debian/debian/vlc.mime @@ -7,17 +7,17 @@ video/x-mpeg-system; vlc %s; description="MPEG Video"; test=test -n "$DISPLAY"; priority=7 video/x-mpeg-system; vlc -I rc -V caca %s; needsterminal; description="MPEG Video"; priority=4 -audio/x-wav; nametemplate=%s.wav; vlc %s; description="WAV Audio"; test=test -n "$DISPLAY"; priority=7 -audio/x-wav; nametemplate=%s.wav; vlc -I rc -V caca %s; needsterminal; description="WAV Audio"; priority=4 +audio/x-wav; vlc %s; nametemplate=%s.wav; description="WAV Audio"; test=test -n "$DISPLAY"; priority=7 +audio/x-wav; vlc -I rc -V caca %s; nametemplate=%s.wav; needsterminal; description="WAV Audio"; priority=4 video/mpeg4; vlc %s; description="MPEG-4 Video"; test=test -n "$DISPLAY"; priority=7 video/mpeg4; vlc -I rc -V caca %s; needsterminal; description="MPEG-4 Video"; priority=4 -audio/mpeg; nametemplate=%s.mpg; vlc %s; description="MPEG Audio"; test=test -n "$DISPLAY"; priority=7 -audio/mpeg; nametemplate=%s.mpg; vlc -I rc -V caca %s; needsterminal; description="MPEG Audio"; priority=4 -audio/mpegurl; nametemplate=%s.m3u; vlc %s; description="MPEG Audio URL"; test=test -n "$DISPLAY"; priority=7 -audio/mpegurl; nametemplate=%s.m3u; vlc -I rc -V caca %s; needsterminal; description="MPEG Audio URL"; priority=4 -audio/x-mp3; nametemplate=%s.mp3; vlc %s; description="MPEG Audio"; test=test -n "$DISPLAY"; priority=7 -audio/x-mp3; nametemplate=%s.mp3; vlc -I rc -V caca %s; needsterminal; description="MPEG Audio"; priority=4 +audio/mpeg; vlc %s; nametemplate=%s.mpg; description="MPEG Audio"; test=test -n "$DISPLAY"; priority=7 +audio/mpeg; vlc -I rc -V caca %s; nametemplate=%s.mpg; needsterminal; description="MPEG Audio"; priority=4 +audio/mpegurl; vlc %s; nametemplate=%s.m3u; description="MPEG Audio URL"; test=test -n "$DISPLAY"; priority=7 +audio/mpegurl; vlc -I rc -V caca %s; nametemplate=%s.m3u; needsterminal; description="MPEG Audio URL"; priority=4 +audio/x-mp3; vlc %s; nametemplate=%s.mp3; description="MPEG Audio"; test=test -n "$DISPLAY"; priority=7 +audio/x-mp3; vlc -I rc -V caca %s; nametemplate=%s.mp3; needsterminal; description="MPEG Audio"; priority=4 audio/mpeg4; vlc %s; description="MPEG-4 Audio"; test=test -n "$DISPLAY"; priority=7 audio/mpeg4; vlc -I rc -V caca %s; needsterminal; description="MPEG-4 Audio"; priority=4 application/mpeg4-iod; vlc %s; description="MPEG-4 Video"; test=test -n "$DISPLAY"; priority=7 @@ -31,10 +31,10 @@ video/quicktime; vlc %s; description="Apple Quicktime Video"; test=test -n "$DISPLAY"; priority=4 video/quicktime; vlc -I rc -V caca %s; needsterminal; description="Apple Quicktime Video"; priority=3 -application/ogg; nametemplate=%s.ogg; vlc %s; description="Ogg stream"; test=test -n "$DISPLAY"; priority=4 -application/ogg; nametemplate=%s.ogg; vlc -I rc -V caca %s; needsterminal; description="Ogg stream"; priority=3 -application/x-ogg; nametemplate=%s.ogg; vlc %s; description="Ogg stream"; test=test -n "$DISPLAY"; priority=4 -application/x-ogg; nametemplate=%s.ogg; vlc -I rc -V caca %s; needsterminal; description="Ogg stream"; priority=3 +application/ogg; vlc %s; nametemplate=%s.ogg; description="Ogg stream"; test=test -n "$DISPLAY"; priority=4 +application/ogg; vlc -I rc -V caca %s; nametemplate=%s.ogg; needsterminal; description="Ogg stream"; priority=3 +application/x-ogg; vlc %s; nametemplate=%s.ogg; description="Ogg stream"; test=test -n "$DISPLAY"; priority=4 +application/x-ogg; vlc -I rc -V caca %s; nametemplate=%s.ogg; needsterminal; description="Ogg stream"; priority=3 application/x-ms-asf-plugin; vlc %s; description="Windows Media Video"; test=test -n "$DISPLAY"; priority=4 application/x-ms-asf-plugin; vlc -I rc -V caca %s; needsterminal; description="Windows Media Video"; priority=3 --- vlc-0.8.4.debian.orig/extras/faad2/COPYING +++ vlc-0.8.4.debian/extras/faad2/COPYING @@ -1,12 +1,22 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + +Any non-GPL usage of this software or parts of this software is strictly +forbidden. + +Commercial non-GPL licensing of this software is possible. +For more info contact Ahead Software through Mpeg4AAClicense@nero.com. + + + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -56,7 +66,7 @@ The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -255,7 +265,7 @@ of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +287,9 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -291,7 +301,7 @@ the "copyright" line and a pointer to where the full notice is found. - Copyright (C) + Copyright (C) 19yy 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 @@ -313,7 +323,7 @@ If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author + Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. --- vlc-0.8.4.debian.orig/extras/faad2/ChangeLog +++ vlc-0.8.4.debian/extras/faad2/ChangeLog @@ -1,40 +1,3 @@ -21 january 2005 gpascutto(at)nero.com - - hcr.c, drm_dec.c: updates for DRM PS standard, error resilience changes - - reverted above error resilience changes - -8 december 2004 mbakker(at)nero.com - - ps_dec.c, ps_syntax.c: PS fixes (OPD huffman table and modulo decoding) - -6 december 2004 gpascutto(at)nero.com - - drm_dec.c, drm_dec.h, sbr_dec.c: DRM PS Standards update - -5 december 2004 gpascutto(at)nero.com - - syntax.c, hcr.c, decoder.c, sbr_syntax.c, specrec.c: - Improved (DRM) error resilience - -18 october 2004 mbakker(at)nero.com - - sbr_dec.c, sbr_hfadj.c, common.h: fixed Low Power SBR decoding - -18 october 2004 mbakker(at)nero.com - - main.c: added "quiet" option to frontend - -5 october 2004 mbakker(at)nero.com - - decoder.c: skip ID3 tags in library - -24 september 2004 mbakker(at)nero.com - - syntax.c,h, lt_predict.c, mp4.c, decoder.c: - Added stereo DRM support, removed fake scalable support - -21 september 2004 mbakker(at)nero.com - - specrec.c, bits.h, common.h, error.h, sbr_hfadj.h, structs.h, - decoder.c, error.c, hcr.c, sbr_dec.c, sbr_hfadj.c, sbr_syntax.c, syntax.c: - Improved error detection and handling. - -16 september 2004 mbakker(at)nero.com - - specrec.c, bits.h, common.h, error.h, sbr_hfadj.h, structs.h, - decoder.c, error.c, hcr.c, sbr_dec.c, sbr_hfadj.c, sbr_syntax.c, syntax.c: - Improved error detection and handling. - 8 september 2004 mbakker(at)nero.com - specrec.c: fixed compilation without PS @@ -49,7 +12,7 @@ - specrec.c: small optimizations to inverse quant 3 september 2004 mbakker(at)nero.com - - neaacdec.h, decoder.c, syntax.c, structs.h: added output flag for PS + - faad.h, decoder.c, syntax.c, structs.h: added output flag for PS 3 september 2004 mbakker(at)nero.com - common.c: added log2_fix() @@ -137,7 +100,7 @@ - sbr_hfgen.c: use block exponent instead of stupid search to find max value 5 may 2004 mbakker(at)nero.com - - decoder.c, neaacdec.h, decoder.h: added extra decode function to which a + - decoder.c, faad.h, decoder.h: added extra decode function to which a buffer can be provided. Instead of the library providing a buffer. 5 may 2004 mbakker(at)nero.com --- vlc-0.8.4.debian.orig/extras/faad2/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.8.5 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -21,7 +20,6 @@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,6 +34,43 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/faad2.spec.in $(top_srcdir)/configure AUTHORS \ + COPYING ChangeLog INSTALL NEWS TODO compile config.guess \ + config.sub depcomp install-sh ltmain.sh missing +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = faad2.spec +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -45,6 +80,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -66,6 +103,8 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ @@ -91,12 +130,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ XMMS_CONFIG = @XMMS_CONFIG@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ @@ -104,6 +146,7 @@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -119,7 +162,6 @@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ -external_mp4v2 = @external_mp4v2@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -132,6 +174,7 @@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -140,45 +183,43 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = libfaad common frontend plugins - EXTRA_DIST = faad2.spec -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = faad2.spec -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \ - COPYING ChangeLog INSTALL Makefile.am NEWS TODO aclocal.m4 \ - compile config.guess config.h.in config.sub configure \ - configure.in depcomp faad2.spec.in install-sh ltmain.sh missing \ - mkinstalldirs -DIST_SUBDIRS = $(SUBDIRS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: - -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; -$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): configure.in +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @@ -190,14 +231,14 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h - -$(srcdir)/config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) - touch $(srcdir)/config.h.in + rm -f stamp-h1 + touch $@ distclean-hdr: -rm -f config.h stamp-h1 -faad2.spec: $(top_builddir)/config.status faad2.spec.in +faad2.spec: $(top_builddir)/config.status $(srcdir)/faad2.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: @@ -269,14 +310,6 @@ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -285,19 +318,22 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ + empty_fix=.; \ else \ include_option=--include; \ + empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ + test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -307,10 +343,11 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -333,24 +370,11 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = . -distdir = $(PACKAGE)-$(VERSION) - -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } - -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkinstalldirs) $(distdir)/. + $(mkdir_p) $(distdir)/. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ @@ -362,7 +386,7 @@ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -379,13 +403,13 @@ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ + test -d "$(distdir)/$$subdir" \ + || mkdir "$(distdir)/$$subdir" \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ + top_distdir="../$(top_distdir)" \ + distdir="../$(distdir)/$$subdir" \ distdir) \ || exit 1; \ fi; \ @@ -399,6 +423,23 @@ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) +dist-bzip2: distdir + $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) @@ -407,8 +448,18 @@ # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist - $(am__remove_distdir) - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst @@ -428,19 +479,20 @@ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ - (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ - && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) - @echo "$(distdir).tar.gz is ready for distribution" | \ - sed 'h;s/./=/g;p;x;p;x' + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ @@ -464,7 +516,6 @@ all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: - install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -496,13 +547,15 @@ distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \ - distclean-tags +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: +html: html-recursive + info: info-recursive info-am: @@ -539,23 +592,20 @@ uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive dist dist-all dist-gzip distcheck distclean \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-libtool clean-recursive \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am dvi-recursive info info-am \ - info-recursive install install-am install-data install-data-am \ - install-data-recursive install-exec install-exec-am \ - install-exec-recursive install-info install-info-am \ - install-info-recursive install-man install-recursive \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ - installdirs-am installdirs-recursive maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive mostlyclean \ - mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ - pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \ - tags-recursive uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am rpm: Makefile --- vlc-0.8.4.debian.orig/extras/faad2/README +++ vlc-0.8.4.debian/extras/faad2/README @@ -14,7 +14,7 @@ ****************************************************************************** ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003 M. Bakker (mbakker(at)nero.com), Ahead Software AG ** ** 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 @@ -30,15 +30,7 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** -** Any non-GPL usage of this software or parts of this software is strictly -** forbidden. -** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** -** Commercial non-GPL licensing of this software is possible. +** Commercial non-GPL licensing of this software is also possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ****************************************************************************** @@ -62,6 +54,27 @@ Sorry, try building a ChangeLog from CVS. +__________________________________ +REDISTRIBUTED OPEN SOURCE PACKAGES + +This is the list of redistributed open source packages that are included +in FAAD2: + +Name: mp4v2 +Version: 0.9.8.6 +Origin: http://www.mpeg4ip.net +Author: David Mackie +Directory: common/mp4v2 +License: MPL, Mozilla Public License, version 1.1 + +Name: mp4av +Version: 0.9.8.6 +Origin: http://www.mpeg4ip.net +Author: David Mackie +Directory: common/mp4av +License: MPL, Mozilla Public License, version 1.1 + + ___________________ DIRECTORY STRUCTURE @@ -74,8 +87,14 @@ faad - general common functions like filereading and streaming as well as getting info from aac files. + mp4v2 - MPEG-4 file reading library. + + mp4av - MPEG-4 file general function library. + mp4ff - Small MP4 file format library (includes tagging abilities). + CoreAAC - AAC DirectShow filter. + frontend - command line frontend to the FAAD2 library, also supports MPEG-4 file decoding. @@ -93,6 +112,10 @@ QCDMp4 - Quintessential player MP4 plugin. + winamp - winamp2 AAC input plugin. + + winamp3 - winamp3 AAC input plugin. + xmms - xmms AAC plugin mpeg4ip - plugin for the mpeg4ip player --- vlc-0.8.4.debian.orig/extras/faad2/README.linux +++ vlc-0.8.4.debian/extras/faad2/README.linux @@ -0,0 +1,16 @@ +To compile under Linux. +---------------------- +just run : + +autoreconf -vif +./configure --with-mp4v2 +make +sudo make install + + +about the xmms plugin. +--------------------- + The xmms plugin need to be build after the install of the faad project. +so after you have installed correctly faad (--with-xmms options) you need +to configure and build the xmms plugin part in the plugins/xmms directory. +Read the README and INSTALL files into the xmms directory. --- vlc-0.8.4.debian.orig/extras/faad2/aclocal.m4 +++ vlc-0.8.4.debian/extras/faad2/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.7.9 -*- Autoconf -*- +# generated automatically by aclocal 1.8.5 -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -11,12987 +11,6937 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# Do all the work for Automake. -*- Autoconf -*- - -# This macro actually does too much some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# 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, or (at your option) -# any later version. +# serial 47 AC_PROG_LIBTOOL +# Debian $Rev: 214 $ -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) -# serial 10 -AC_PREREQ([2.54]) +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) -# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow -# the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl - AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_MISSING_PROG(AMTAR, tar) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -]) -]) +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $1 | $1:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR -# Copyright 2002 Free Software Foundation, Inc. +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH -# 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, or (at your option) -# any later version. +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac -# 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. +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] -# 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., 59 Temple Place - Suite 330, Boston, MA +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.7.9])]) +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' -# Helper functions for option handling. -*- Autoconf -*- +# Constants: +rm="rm -f" -# Copyright 2001, 2002 Free Software Foundation, Inc. +# Global variables: +default_ofile=libtool +can_build_shared=yes -# 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, or (at your option) -# any later version. +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" -# 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. +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +old_CC="$CC" +old_CFLAGS="$CFLAGS" -# serial 2 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o -# -# Check to make sure that the build environment is sane. -# +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= -# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi -# 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, or (at your option) -# any later version. +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac -# 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. +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -# serial 3 +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl -# -*- Autoconf -*- +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER -# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. -# 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, or (at your option) -# any later version. +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT -# serial 3 -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi -]) - -# AM_AUX_DIR_EXPAND - -# Copyright 2001 Free Software Foundation, Inc. -# 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, 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. +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# -*- Autoconf -*- -# Copyright (C) 2003 Free Software Foundation, Inc. - -# 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, or (at your option) -# any later version. +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. -# 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. + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: -# serial 1 + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# serial 5 -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -# 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, or (at your option) -# any later version. +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi -# 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. +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +need_locks="$enable_libtool_lock" -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub +])# _LT_AC_LOCK - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - : > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # (even with -Werror). So we grep stderr for any message - # that says an option was ignored. - if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + $2=yes + fi + fi + $rm conftest* +]) - cd .. - rm -rf conftest.dir +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) else - am_cv_$1_dependencies_compiler_type=none + ifelse([$6], , :, [$6]) fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) +])# AC_LIBTOOL_COMPILER_OPTION -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" ]) - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking Speeds up one-time builds - --enable-dependency-tracking Do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) -]) +])# AC_LIBTOOL_LINKER_OPTION -# Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" -# 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, or (at your option) -# any later version. + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; -# 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. + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; -#serial 2 + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` - test -z "$DEPDIR" && continue - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n -e '/^U = / s///p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # We invoke sed twice because it is the simplest approach to - # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n -e ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done -])# _AM_OUTPUT_DEPENDENCY_COMMANDS + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN -# Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ------------------------------------------------------------------ +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif -# 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. +#include -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif -# serial 2 +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. - -# 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, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +#ifdef __cplusplus +extern "C" void exit (int); +#endif -# serial 5 +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; -AC_PREREQ(2.52) + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]) -fi])]) +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. -]) +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= -# serial 49 LT_INIT + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_define([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; -# LT_INIT([OPTIONS]) -# -------------------------- -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([_LT_PROG_LTMAIN])dnl -AC_BEFORE([$0], [LT_LANG])dnl + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -# Set options -_LT_SET_OPTIONS([$1])dnl + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -_LT_SETUP + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" -# Only expand once: -m4_define([LT_INIT]) -])# _LT_INIT + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) -# Old names: -AU_DEFUN([AC_PROG_LIBTOOL], [LT_INIT]) -AU_DEFUN([AM_PROG_LIBTOOL], [LT_INIT]) + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac -# _LT_SETUP -# --------- -m4_define([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -AC_REQUIRE([AC_LIBTOOL_SYS_OLD_ARCHIVE])dnl -AC_REQUIRE([AC_LIBTOOL_SYS_MAX_CMD_LEN])dnl -AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl -AC_REQUIRE([AC_OBJEXT])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -AC_REQUIRE([AC_EXEEXT])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac fi +])# AC_LIBTOOL_DLOPEN_SELF -AC_LIBTOOL_OBJDIR -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -ofile="$default_ofile" -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn fi - ;; -esac - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Use C for the default configuration in the libtool script -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS -# _LT_PROG_LTMAIN -# --------------- -# In libtool itself `ltmain.sh' is in the build tree, but everything else -# ships it in the source tree, for completeness, if we find a copy in the -# build tree use that before falling back to auxdir. -# -# Note that this code is called both from `configure', and `config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -AC_DEFUN([_LT_PROG_LTMAIN], -[_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -case $ac_aux_dir in - $srcdir) ltmain=./ltmain.sh ;; - $srcdir/*) ltmain=`expr "$ac_aux_dir" : "$srcdir/\(.*\)"`/ltmain.sh ;; -esac -test -f "$ltmain" || ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# --------------------------------------------------- -m4_define([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP -# _LT_FORMAT_COMMENT([COMMENT]) +# AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([$1], [^ *], [# ])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [[, ]], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------- -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# ---------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# ---------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_quote(m4_if([$2], [], - m4_quote(lt_decl_tag_varnames), - m4_quote(m4_shift($@)))), - m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) -m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$echo "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# ='`$echo "X$" | $Xsed -e "$delay_single_quote_subst"`' -m4_define([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_define([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="[]_LT_TAGS[]"dnl -]) - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_define([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -m4_define([_LT_AC_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_define([_LT_CONFIG_COMMANDS], -[AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X${CDPATH+set}" = Xset; then CDPATH=${ZSH_VERSION+.}:; export CDPATH; fi - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -compiler='$compiler_DEFAULT' - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ ]], lt_decl_quote_varnames); do - eval "lt_\$var=\\\\\\"\\\`\\\$echo \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ ]], lt_decl_dquote_varnames); do - eval "lt_\$var=\\\\\\"\\\`\\\$echo \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" -done +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_echo in -*'\\\[$]0 --fallback-echo"')dnl " - lt_echo=\`\$echo "X\$lt_echo" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; -esac -_LT_OUTPUT_LIBTOOL_INIT -]) -])#_LT_CONFIG_COMMANDS +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; -# _LT_CONFIG(TAG) -# ---------------------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_define([_LT_CONFIG], -[_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no - cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by config.status (GNU $PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -_LT_COPYING + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; -_LT_LIBTOOL_TAGS +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi +freebsd1*) + dynamic_linker=no + ;; -_LT_EOF +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes ;; esac + ;; - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - rm='$rm' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; -# _LT_LANG(LANGNAME) -# ------------------ -m4_define([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_define([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java])]) +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi -_LT_DECL([LTCC], [CC], [1], [A C compiler]) -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU C compiler?]) + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -m4_define([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -m4_define([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=yes + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -m4_define([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH ;; -esac -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 -fi +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi - done -fi + fi -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + case $tagname in + CXX) + if test -n "$CXX" && test "X$CXX" != "Xno"; then + AC_LIBTOOL_LANG_CXX_CONFIG else - # Oops. We lost completely, so just stick with echo. - echo=echo + tagname="" fi - fi - fi - fi -fi -fi + ;; -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; -AC_SUBST(ECHO) -]) -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [echo], [1], - [An echo program that does not interpret backslashes]) -])# _LT_AC_PROG_ECHO_BACKSLASH + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_REQUIRE([AC_OBJEXT])dnl -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -esac -need_locks="$enable_libtool_lock" -])# _LT_AC_LOCK + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG -# AC_LIBTOOL_SYS_OLD_ARCHIVE -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 dll's +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -])# AC_LIBTOOL_SYS_OLD_ARCHIVE +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - $2=yes - fi - fi - $rm conftest* -]) -if test x"[$]$2" = xyes; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION +# AC_DISABLE_SHARED +# ----------------- +#- set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -m4_define([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC -if test x"[$]$2" = xyes; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - *) - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring") >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -_LT_DECL([max_cmd_len], [lt_cv_sys_max_cmd_len], [0], - [What is the maximum length of a command?]) -])# AC_LIBTOOL_SYS_MAX_CMD_LEN +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_AC_CHECK_DLFCN +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" -#include "confdefs.h" +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 -#if HAVE_DLFCN_H -#include -#endif +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org -#include +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: fi fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - +])# AC_PATH_MAGIC -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown ;; esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +bsdi4*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s out/conftest.err; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -_LT_DECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# AC_LIBTOOL_PROG_CC_C_O +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([AC_LIBTOOL_PROG_CC_C_O])dnl -AC_REQUIRE([_LT_AC_LOCK])dnl +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn +freebsd* | kfreebsd*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + ;; +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -])# AC_LIBTOOL_OBJDIR +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_AC_TAGVAR(runpath_var $1)" || - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink +netbsd* | netbsdelf*-gnu | knetbsd*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + ;; -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_AC_TAGVAR(inherit_rpath, $1)" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[AC_REQUIRE([LT_AC_PROG_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([LT_AC_PROG_EGREP]) -AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | $GREP ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; -amigaos*) - if test "$host_cpu" = m68k; then - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - else - dynamic_linker=no - fi +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all ;; -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all ;; -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs +solaris*) + lt_cv_deplibs_check_method=pass_all ;; -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all ;; esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | $GREP "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") ;; +esac +])# AC_CHECK_LIBM -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided and an installed libltdl is not found, it is +# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' +# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single +# quotes!). If your package is not flat and you're not using automake, +# define top_builddir and top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=yes - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +# AC_LIBTOOL_RC +# -------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [List of archive names. First name is the real one, the rest are links. - The last name is the one that the linker finds with -lNAME]) -_LT_DECL([], [soname_spec], [1], - [The coded name of the library, if different from the real name]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [As "finish_cmds", except a single script fragment to be evaled but - not shown]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([LT_AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 +# Source file extension for C test sources. +ac_ext=c -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins "file"])dnl -])# AC_PATH_TOOL_PREFIX +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) +_LT_AC_SYS_COMPILER + +# +# Check for any special shared library compilation flags. +# +_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' + ;; + esac +fi +if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then + AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : else - MAGIC_CMD=: + AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) + _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no fi fi -])# AC_PATH_MAGIC -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([LT_AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl +# +# Check to make sure the static flag actually works. +# +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; +# Source file extension for C++ test sources. +ac_ext=cc -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case "$host_cpu" in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" -# This must be Linux ELF. -linux*) - case $host_cpu in - alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - lt_cv_deplibs_check_method=pass_all - ;; +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' -netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi -openbsd*) - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' - else - lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' - fi - ;; +if test "$GXX" = yes; then + # Set up default GNU C++ configuration -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; + AC_PROG_LD -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) -])# AC_DEPLIBS_CHECK_METHOD + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD-compatible nm program])dnl -])# AC_PROG_NM - -# Old name: -AU_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + GXX=no + with_gnu_ld=no + wlarc= +fi +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + esac + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'m4_if($#, 1,[$1], ['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'m4_if($#, 1, [$1], ['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided and an installed libltdl is not found, it is -# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' -# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single -# quotes!). If your package is not flat and you're not using automake, -# define top_builddir and top_srcdir appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'m4_if($#, 1, [$1], ['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'m4_if($#, 1, [$1], ['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([LT_AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_OBJEXT])dnl -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDRT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi + darwin* | rhapsody*) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' + ;; + esac fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else - lt_cv_sys_global_symbol_pipe= + _LT_AC_TAGVAR(ld_shlibs, $1)=no fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi + ;; -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], - [Take the output of nm and produce a listing of raw symbols and C names]) -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - if test "$host_cpu" = m68k; then - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - fi - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + aCC) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then case "$host_cpu" in - hppa*64*|ia64*) - ;; + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; esac + fi + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. ;; *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. ;; esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; - chorus*) - case $cc_basename in - cxch68) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case "$cc_basename" in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default + ia64*|hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - cxx) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi ;; - mvs*) - case $cc_basename in - cxx) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; - netbsd*) + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac + icpc) + # Intel C++ + with_gnu_ld=yes + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; - unixware*) + cxx) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; - vxworks*) + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - if test "$host_cpu" = m68k; then - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - fi - ;; + ;; + netbsd* | netbsdelf*-gnu | knetbsd*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case "$cc_basename" in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $CC in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' - ;; + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; esac - fi -]) -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1)], - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) + sco*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' -# -# Check to make sure the static flag actually works. -# -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# AC_LIBTOOL_PROG_COMPILER_PIC + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_REQUIRE([LT_AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -m4_if([$1], [CXX], [ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -], [ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(inherit_rpath, $1)=no - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" -_LT_EOF - fi - ;; +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) - amigaos*) - if test "$host_cpu" = m68k; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - fi +AC_LIBTOOL_CONFIG($1) - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < $export_symbols' + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; + for p in `eval $output_verbose_link_cmd`; do + case $p in - solaris* | sysv5*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then + _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then + _LT_AC_TAGVAR(predep_objects, $1)="$p" + else + _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then + _LT_AC_TAGVAR(postdep_objects, $1)="$p" + else + _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; - linux*) - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test "x$supports_anon_versioning" = xyes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~$echo "local: *; };" >> $output_objdir/$libname.ver~$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)=$_LT_AC_TAGVAR(archive_cmds, $1) - fi - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; + *) ;; # Ignore the rest. - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; esac + done - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no +$rm -f confest.$objext - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac +case " $_LT_AC_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac +])# AC_LIBTOOL_POSTDEP_PREDEP - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +# AC_LIBTOOL_LANG_F77_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) +AC_DEFUN([_LT_AC_LANG_F77_CONFIG], +[AC_REQUIRE([AC_PROG_F77]) +AC_LANG_PUSH(Fortran 77) - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +# Source file extension for f77 test sources. +ac_ext=f - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi +# Object file extension for compiled f77 test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" - amigaos*) - if test "$host_cpu" = m68k; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - fi - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" - bsdi4*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${Wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case "$cc_basename" in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + test "$enable_shared" = yes && enable_static=no + ;; +esac +AC_MSG_RESULT([$enable_shared]) - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes +_LT_AC_TAGVAR(GCC, $1)="$G77" +_LT_AC_TAGVAR(LD, $1)="$LD" - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +AC_LIBTOOL_CONFIG($1) - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_F77_CONFIG - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(inherit_rpath, $1)=yes - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# AC_LIBTOOL_LANG_GCJ_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) +AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], +[AC_LANG_SAVE - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# Source file extension for Java test sources. +ac_ext=java - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; +# Object file extension for compiled Java test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC - sco3.2v5*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +AC_LIBTOOL_CONFIG($1) - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +AC_LANG_RESTORE +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_GCJ_CONFIG - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; +# AC_LIBTOOL_LANG_RC_CONFIG +# -------------------------- +# Ensure that the configuration vars for the Windows resource compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) +AC_DEFUN([_LT_AC_LANG_RC_CONFIG], +[AC_LANG_SAVE - sysv4.2uw2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; +# Source file extension for RC test sources. +ac_ext=rc - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# Object file extension for compiled RC test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext - sysv5*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - ;; +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) +AC_LIBTOOL_CONFIG($1) -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) +AC_LANG_RESTORE +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_RC_CONFIG -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +# AC_LIBTOOL_CONFIG([TAGNAME]) +# ---------------------------- +# If TAGNAME is not passed, then create an initial libtool script +# with a default configuration from the untagged config vars. Otherwise +# add code to config.status for appending the configuration named by +# TAGNAME from the matching tagged config vars. +AC_DEFUN([AC_LIBTOOL_CONFIG], +[# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + _LT_AC_TAGVAR(compiler, $1) \ + _LT_AC_TAGVAR(CC, $1) \ + _LT_AC_TAGVAR(LD, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ + _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ + _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ + _LT_AC_TAGVAR(old_archive_cmds, $1) \ + _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ + _LT_AC_TAGVAR(predep_objects, $1) \ + _LT_AC_TAGVAR(postdep_objects, $1) \ + _LT_AC_TAGVAR(predeps, $1) \ + _LT_AC_TAGVAR(postdeps, $1) \ + _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ + _LT_AC_TAGVAR(archive_cmds, $1) \ + _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ + _LT_AC_TAGVAR(postinstall_cmds, $1) \ + _LT_AC_TAGVAR(postuninstall_cmds, $1) \ + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ + _LT_AC_TAGVAR(allow_undefined_flag, $1) \ + _LT_AC_TAGVAR(no_undefined_flag, $1) \ + _LT_AC_TAGVAR(export_symbols_cmds, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ + _LT_AC_TAGVAR(hardcode_automatic, $1) \ + _LT_AC_TAGVAR(module_cmds, $1) \ + _LT_AC_TAGVAR(module_expsym_cmds, $1) \ + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ + _LT_AC_TAGVAR(exclude_expsyms, $1) \ + _LT_AC_TAGVAR(include_expsyms, $1); do - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + case $var in + _LT_AC_TAGVAR(old_archive_cmds, $1) | \ + _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ + _LT_AC_TAGVAR(archive_cmds, $1) | \ + _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ + _LT_AC_TAGVAR(module_cmds, $1) | \ + _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ + _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac - fi - ;; -esac + done -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# AC_LIBTOOL_PROG_LD_SHLIBS + case $lt_echo in + *'\[$]0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` + ;; + esac +ifelse([$1], [], + [cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + AC_MSG_NOTICE([creating $ofile])], + [cfgfile="$ofile"]) -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_define([_LT_LANG_C_CONFIG], -[AC_REQUIRE([LT_AC_PROG_EGREP]) -lt_save_CC="$CC" -AC_LANG_PUSH(C) + cat <<__EOF__ >> "$cfgfile" +ifelse([$1], [], +[#! $SHELL -# Source file extension for C test sources. -ac_ext=c +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext +# A sed program that does not truncate output. +SED=$lt_SED -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e s/^X//" -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi -_LT_AC_SYS_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_AC_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC +# The names of the tagged configurations supported by this script. +available_tags= -# -# Check for any special shared library compilation flags. -# -_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' - ;; - esac -fi -if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then - AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | $GREP "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) - _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no - fi -fi +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -if test -n "$compiler"; then - AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) - AC_LIBTOOL_PROG_COMPILER_PIC($1) - AC_LIBTOOL_PROG_CC_C_O($1) - AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) - AC_LIBTOOL_PROG_LD_SHLIBS($1) - AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) - AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - AC_LIBTOOL_SYS_LIB_STRIP - AC_LIBTOOL_DLOPEN_SELF($1) - - # Report which library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case "$host_os" in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL - aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) +# Whether or not to build static libraries. +build_old_libs=$enable_static - _LT_CONFIG($1) -fi -AC_LANG_POP -CC="$lt_save_CC" -])# _LT_LANG_C_CONFIG +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_define([_LT_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([LT_AC_PROG_EGREP]) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(inherit_rpath, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +# The host system. +host_alias=$host_alias +host=$host -# Source file extension for C++ test sources. -ac_ext=cc +# An echo program that does not interpret backslashes. +echo=$lt_echo -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" +# A C compiler. +LTCC=$lt_LTCC -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` +# An ERE matcher. +EGREP=$lt_EGREP -if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - if test "$GXX" = yes; then - # Set up default GNU C++ configuration +# Whether we need hard or soft links. +LN_S=$lt_LN_S - AC_PROG_LD +# A BSD-compatible nm program. +NM=$lt_NM - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +# A symbol stripping program +STRIP=$lt_STRIP - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi +# Used on cygwin: assembler. +AS="$AS" - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' +# The name of the directory that contains temporary libtool files. +objdir=$objdir - else - GXX=no - with_gnu_ld=no - wlarc= - fi +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac +# Object file suffix (normally "o"). +objext="$ac_objext" - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +# Old archive suffix (normally "a"). +libext="$libext" - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +# Executable file suffix (normally ""). +exeext="$exeext" - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${Wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $GREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case "$cc_basename" in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; +# Do we need a version for libraries? +need_version=$need_version - dgux*) - case $cc_basename in - ec++) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. +# Whether dlopen is supported. +dlopen_support=$enable_dlopen - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*|hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(inherit_rpath, $1)=yes - ;; - linux*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc) - # Intel C++ - with_gnu_ld=yes - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - cxx) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - osf3*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sco*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP \"\-L\"" - fi +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) - test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - _LT_AC_TAGVAR(GCC, $1)="$GXX" - _LT_AC_TAGVAR(LD, $1)="$LD" +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - AC_LIBTOOL_POSTDEP_PREDEP($1) - AC_LIBTOOL_PROG_COMPILER_PIC($1) - AC_LIBTOOL_PROG_CC_C_O($1) - AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) - AC_LIBTOOL_PROG_LD_SHLIBS($1) - AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) - AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - AC_LIBTOOL_SYS_LIB_STRIP - AC_LIBTOOL_DLOPEN_SELF($1) +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - _LT_CONFIG($1) -fi +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# _LT_LANG_CXX_CONFIG +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) +# Library versioning type. +version_type=$version_type -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= +# Format of library name prefix. +libname_spec=$lt_libname_spec -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -]) -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds - for p in `eval $output_verbose_link_cmd`; do - case $p in +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - else - prev= - fi +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then - _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}" - else - _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}" - fi - fi - ;; +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - if test "$pre_test_object_deps_done" = no; then - if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then - _LT_AC_TAGVAR(predep_objects, $1)="$p" - else - _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then - _LT_AC_TAGVAR(postdep_objects, $1)="$p" - else - _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib - *) ;; # Ignore the rest. +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - esac - done +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) -$rm -f confest.$objext +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) -case " $_LT_AC_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# AC_LIBTOOL_POSTDEP_PREDEP +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_define([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([AC_PROG_F77]) -AC_LANG_PUSH(Fortran 77) +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(inherit_rpath, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd -# Source file extension for f77 test sources. -ac_ext=f +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) -# Object file extension for compiled f77 test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case "$host_os" in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix4* | aix5*) - test "$enable_shared" = yes && enable_static=no - ;; - esac - AC_MSG_RESULT([$enable_shared]) +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - - _LT_AC_TAGVAR(GCC, $1)="$G77" - _LT_AC_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - AC_LIBTOOL_PROG_COMPILER_PIC($1) - AC_LIBTOOL_PROG_CC_C_O($1) - AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) - AC_LIBTOOL_PROG_LD_SHLIBS($1) - AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) - AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - AC_LIBTOOL_SYS_LIB_STRIP +# This is the shared library runtime path variable. +runpath_var=$runpath_var - _LT_CONFIG($1) -fi +# This is the shared library path variable. +shlibpath_var=$shlibpath_var -AC_LANG_POP -CC="$lt_save_CC" -])# _LT_LANG_F77_CONFIG +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_define([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ]) -AC_LANG_SAVE +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs -# Source file extension for Java test sources. -ac_ext=java +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) -# Object file extension for compiled Java test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) -if test -n "$compiler"; then - AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) - AC_LIBTOOL_PROG_COMPILER_PIC($1) - AC_LIBTOOL_PROG_CC_C_O($1) - AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) - AC_LIBTOOL_PROG_LD_SHLIBS($1) - AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) - AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - AC_LIBTOOL_SYS_LIB_STRIP - AC_LIBTOOL_DLOPEN_SELF($1) +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" - _LT_CONFIG($1) -fi +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) -AC_LANG_RESTORE -CC="$lt_save_CC" -])# _LT_LANG_GCJ_CONFIG +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# _LT_LANG_RC_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_define([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC]) -AC_LANG_SAVE +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" -# Source file extension for RC test sources. -ac_ext=rc +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) -# Object file extension for compiled RC test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi +__EOF__ -AC_LANG_RESTORE -CC="$lt_save_CC" -])# _LT_LANG_RC_CONFIG +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])dnl -]) -AU_DEFUN([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" ]) -AU_DEFUN([LT_AC_PROG_RC], [LT_PROG_RC]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG -# LT_AC_PROG_EGREP -# ---------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -AC_DEFUN([LT_AC_PROG_EGREP], -[AC_REQUIRE([AC_PROG_EGREP]) -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long line]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -]) +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# LT_AC_PROG_SED +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -m4_ifndef([AC_PROG_SED], [ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI -m4_define([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && break - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -SED=$lt_cv_path_SED -AC_SUBST([SED]) -]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef -# Helper functions for option handling. -*- Autoconf -*- -# Written by Gary V. Vaughan +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] -# Copyright (C) 2004 Free Software Foundation, Inc. - -# 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, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 1 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(NAME) -# ----------------------- -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Other NAMEs are saved as a flag. -m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1]))]) - - -# _LT_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1]), [$2], [$3])]) - - -# _LT_UNLESS_OPTIONS(OPTIONS, IF-NOT-SET) -# --------------------------------------- -# Execute IF-NOT-SET if all OPTIONS are not set. -m4_define([_LT_UNLESS_OPTIONS], -[AC_FOREACH([_LT_Option], [$1], - [m4_ifdef(_LT_MANGLE_OPTION(_LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$2 -])[]dnl -]) - - -# _LT_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -# If any OPTION has a handler macro declared with LT_OPTION_DEFINE, -# despatch to that macro; otherwise complain about the unknown option -# and exit. -m4_define([_LT_SET_OPTIONS], -[AC_FOREACH([_LT_Option], [$1], - [_LT_SET_OPTION(_LT_Option) - m4_ifdef(_LT_MANGLE_DEFUN(_LT_Option), - _LT_MANGLE_DEFUN(_LT_Option), - [m4_fatal([Unknown option `]_LT_Option[' to LT][_INIT_LIBTOOL])]) - ])dnl -dnl -dnl Simply set some default values (i.e off) if boolean options were not -dnl specified: -_LT_UNLESS_OPTIONS([dlopen], enable_dlopen=no) -_LT_UNLESS_OPTIONS([win32-dll], enable_win32_dll=no) -dnl -dnl If no reference was made to various pairs of opposing options, then -dnl we run the default mode handler for the pair. For example, if neither -dnl `shared' nor `disable-shared' was passed, we enable building of shared -dnl archives by default: -_LT_UNLESS_OPTIONS([shared disable-shared], [_LT_ENABLE_SHARED]) -_LT_UNLESS_OPTIONS([static disable-static], [_LT_ENABLE_STATIC]) -_LT_UNLESS_OPTIONS([pic-only no-pic], [_LT_WITH_PIC]) -_LT_UNLESS_OPTIONS([fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) -])# _LT_SET_OPTIONS - - - -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(NAME, CODE) -# ---------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1]), [$2])[]dnl -])# LT_OPTION_DEFINE +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' -# dlopen -# ------ -LT_OPTION_DEFINE([dlopen], [enable_dlopen=yes]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_LIBTOOL_INIT's first parameter.]) -]) +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([win32-dll], -[enable_win32_dll=yes +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris* | sysv5*) + symcode='[[BDRT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' ;; esac -test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl -])# win32-dll +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[_LT_SET_OPTION([win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_LIBTOOL_INIT's first parameter.]) -]) + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + # Check to see that the pipe works correctly. + pipe_works=no -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT_LIBTOOL options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi -AU_DEFUN([AM_ENABLE_SHARED], -[_LT_SET_OPTION([shared]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `shared' option into LT_LIBTOOL_INIT's first parameter.]) -]) + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif -AU_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([disable-shared]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-shared' option into LT_LIBTOOL_INIT's first parameter.]) -]) +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' -AU_DEFUN([AM_DISABLE_SHARED], -[_LT_SET_OPTION([disable-shared]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-shared' option into LT_LIBTOOL_INIT's first parameter.]) -]) + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT_LIBTOOL options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([static]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `static' option into LT_LIBTOOL_INIT's first parameter.]) -]) + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* -AU_DEFUN([AM_ENABLE_STATIC], -[_LT_SET_OPTION([static]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `static' option into LT_LIBTOOL_INIT's first parameter.]) + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done ]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AU_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([disable-static]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-static' option into LT_LIBTOOL_INIT's first parameter.]) -]) -AU_DEFUN([AM_DISABLE_STATIC], -[_LT_SET_OPTION([disable-static]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-static' option into LT_LIBTOOL_INIT's first parameter.]) -]) +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT_LIBTOOL options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_LIBTOOL_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_LIBTOOL_INIT's first parameter.]) -]) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' -# LT_INIT_LIBTOOL options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_if($#, 1, $1, default) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PIC_MODE], -[_LT_SET_OPTION([pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_LIBTOOL_INIT's first parameter.]) -]) - -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004 Free Software Foundation, Inc. -# Written by Gary V. Vaughan. -# -# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# serial 1 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -m4_define([lt_join], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [], - [2], [[$2]], - [m4_ifval([$2], - [m4_ifval([$3], - [[$2][$1][]$0([$1], m4_shiftn(2, $@))], - [m4_if([$#], [3], - [$2], - [$0([$1], [$2], m4_shiftn(3, $@))])])], - [$0([$1], m4_shiftn(2, $@))])])[]dnl -]) - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -m4_define([lt_combine], -[m4_if([$2], [[]], [], - [lt_join(m4_quote(m4_default([$1], [, ])), - _$0([$1], m4_car($2)[$3], m4_shiftn(3, $@)), - $0([$1], m4_cdr($2), m4_shiftn(2, $@)))])]) -m4_define([_lt_combine], -[m4_if([$3], [], [], - [lt_join(m4_quote(m4_default([$1], [, ])), - [$2$3], - $0([$1], [$2], m4_shiftn(3, $@)))])[]dnl -]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_bmatch($3[]m4_defn([$1])$3, $3[]m4_re_escape([$2])$3, - [$5], - [m4_append([$1], [$2], [$3])$4])], - [m4_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$4])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# ------------------------------------------------------------ -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - m4_quote(lt_if_dict_fetch([$1], [$5], [$2], [$3], [$5])), - m4_quote($0([$1], [$2], [$3], [$4], m4_shiftn(5, $@))))])dnl -]) - -# ltversion.m4 -- version numbers -*- Autoconf -*- -# Generated from ltversion.in; do not edit by hand. - -# serial 1467 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], []) -m4_define([LT_PACKAGE_REVISION], [1.1467]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='' -macro_revision='1.1467' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 47 AC_PROG_LIBTOOL -# Debian $Rev: 214 $ - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s out/conftest.err; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=yes - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && test "X$CXX" != "Xno"; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -#- set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case "$host_cpu" in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' - else - lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided and an installed libltdl is not found, it is -# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' -# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single -# quotes!). If your package is not flat and you're not using automake, -# define top_builddir and top_srcdir appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# -------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# -# Check for any special shared library compilation flags. -# -_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' - ;; - esac -fi -if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then - AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) - _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) - - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -# Report which librarie types wil actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - darwin* | rhapsody*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cc - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - darwin* | rhapsody*) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - dgux*) - case $cc_basename in - ec++) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*|hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc) - # Intel C++ - with_gnu_ld=yes - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - cxx) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - osf3*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sco*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu | knetbsd*-gnu) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; -# This is the shared library runtime path variable. -runpath_var=$runpath_var + linux*) + case $CC in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; -# This is the shared library path variable. -shlibpath_var=$shlibpath_var + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' + ;; -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac +]) -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux*) + _LT_AC_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" +EOF + fi + ;; -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) + netbsd* | netbsdelf*-gnu | knetbsd*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; -__EOF__ + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds" + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds" + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=no + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + bsdi4*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDRT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac + darwin* | rhapsody*) + if test "$GXX" = yes ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; - # Check to see that the pipe works correctly. - pipe_works=no + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - rm -f "$nlist"T + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + netbsd* | netbsdelf*-gnu | knetbsd*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac fi ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + + sco3.2v5*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4.2uw2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv5*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - cxx) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; esac fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +SED=$lt_cv_path_SED +]) +AC_MSG_RESULT([$SED]) +]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_ifval([$1], [$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; +pkg_failed=no +AC_MSG_CHECKING([for $1]) - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; +if test $pkg_failed = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met. +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details.])], + [$4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details. + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +# -*- Autoconf -*- +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Generated from amversion.in; do not edit by hand. - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; +# 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, or (at your option) +# any later version. - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; +# 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. - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; +# 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., 59 Temple Place - Suite 330, Boston, MA - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.8.5])]) - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; +# AM_AUX_DIR_EXPAND - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - linux*) - case $CC in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; +# 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, 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# 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, 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 6 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +# serial 7 -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# 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, 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. - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' - ;; - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi ;; + none) break ;; esac - fi + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) ]) +# Generate code to set up dependency tracking. -*- Autoconf -*- -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - linux*) - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + +# 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, or (at your option) +# any later version. - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac +# 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. - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 +#serial 2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS -EOF - fi - ;; - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' +# 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, or (at your option) +# any later version. - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; +# 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. - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 +# serial 7 -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; +# Do all the work for Automake. -*- Autoconf -*- - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds" - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ -cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -$echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds" - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac +# 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, 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 11 + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - fi +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. - bsdi4*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; +# 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, 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. - darwin* | rhapsody*) - if test "$GXX" = yes ; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' - ;; - esac - fi - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; +# 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, or (at your option) +# any later version. - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# 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. - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# serial 1 - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; +# Check to see how 'make' treats includes. -*- Autoconf -*- - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +# 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, or (at your option) +# any later version. - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; +# 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. - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. - netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# serial 2 - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; +# -*- Autoconf -*- - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; +# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' +# 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, or (at your option) +# any later version. - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; +# 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. - sco3.2v5*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; +# serial 3 - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. - sysv4.2uw2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; +# Copyright (C) 2003, 2004 Free Software Foundation, Inc. - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# 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, or (at your option) +# any later version. - sysv5*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - ;; +# 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. - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + mkdir_p='mkdir -p -- .' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi +AC_SUBST([mkdir_p])]) -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# 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, 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif # -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; +# Check to make sure that the build environment is sane. # -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) +# 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, 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. -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) +# serial 3 -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && break - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -SED=$lt_cv_path_SED -]) -AC_MSG_RESULT([$SED]) -]) + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) -# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- +# AM_PROG_INSTALL_STRIP -# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. # 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 @@ -13008,10 +6958,23 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. -AC_PREREQ([2.52]) - -# serial 6 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) --- vlc-0.8.4.debian.orig/extras/faad2/common/Makefile.am +++ vlc-0.8.4.debian/extras/faad2/common/Makefile.am @@ -1 +1,5 @@ +if WITH_MP4V2 +SUBDIRS = mp4v2 mp4ff +else SUBDIRS = mp4ff +endif --- vlc-0.8.4.debian.orig/extras/faad2/common/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/common/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.8.5 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -21,7 +20,6 @@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,6 +34,27 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ +subdir = common +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = mp4ff mp4v2 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -45,6 +64,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -66,6 +87,8 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ @@ -91,12 +114,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ XMMS_CONFIG = @XMMS_CONFIG@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ @@ -104,6 +130,7 @@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -119,7 +146,6 @@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ -external_mp4v2 = @external_mp4v2@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -132,6 +158,7 @@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -139,29 +166,40 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -SUBDIRS = mp4ff -subdir = common -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = $(SUBDIRS) +@WITH_MP4V2_FALSE@SUBDIRS = mp4ff +@WITH_MP4V2_TRUE@SUBDIRS = mp4v2 mp4ff all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu common/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo @@ -232,14 +270,6 @@ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -248,19 +278,22 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ + empty_fix=.; \ else \ include_option=--include; \ + empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ + test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -270,10 +303,11 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -296,10 +330,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -313,7 +343,7 @@ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -328,15 +358,15 @@ || exit 1; \ fi; \ done - list='$(SUBDIRS)'; for subdir in $$list; do \ + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ + test -d "$(distdir)/$$subdir" \ + || mkdir "$(distdir)/$$subdir" \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ + top_distdir="../$(top_distdir)" \ + distdir="../$(distdir)/$$subdir" \ distdir) \ || exit 1; \ fi; \ @@ -346,7 +376,6 @@ all-am: Makefile installdirs: installdirs-recursive installdirs-am: - install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -384,6 +413,8 @@ dvi-am: +html: html-recursive + info: info-recursive info-am: @@ -418,22 +449,18 @@ uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/aacinfo.c +++ vlc-0.8.4.debian/extras/faad2/common/faad/aacinfo.c @@ -0,0 +1,372 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: aacinfo.c,v 1.4 2003/07/29 08:20:11 menno Exp $ +**/ + +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif +#include +#include "filestream.h" +#include "aacinfo.h" + +#define ADIF_MAX_SIZE 30 /* Should be enough */ +#define ADTS_MAX_SIZE 10 /* Should be enough */ + +static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000}; + +static int read_ADIF_header(FILE_STREAM *file, faadAACInfo *info) +{ + int bitstream; + unsigned char buffer[ADIF_MAX_SIZE]; + int skip_size = 0; + int sf_idx; + + /* Get ADIF header data */ + info->headertype = 1; + + if(read_buffer_filestream(file, buffer, ADIF_MAX_SIZE) < 0) + return -1; + + /* copyright string */ + if(buffer[0] & 0x80) + skip_size += 9; /* skip 9 bytes */ + + bitstream = buffer[0 + skip_size] & 0x10; + info->bitrate = ((unsigned int)(buffer[0 + skip_size] & 0x0F)<<19)| + ((unsigned int)buffer[1 + skip_size]<<11)| + ((unsigned int)buffer[2 + skip_size]<<3)| + ((unsigned int)buffer[3 + skip_size] & 0xE0); + + if (bitstream == 0) + { + info->object_type = ((buffer[6 + skip_size]&0x01)<<1)|((buffer[7 + skip_size]&0x80)>>7); + sf_idx = (buffer[7 + skip_size]&0x78)>>3; + } else { + info->object_type = (buffer[4 + skip_size] & 0x18)>>3; + sf_idx = ((buffer[4 + skip_size] & 0x07)<<1)|((buffer[5 + skip_size] & 0x80)>>7); + } + info->sampling_rate = sample_rates[sf_idx]; + + return 0; +} + +static int read_ADTS_header(FILE_STREAM *file, faadAACInfo *info, + unsigned long **seek_table, int *seek_table_len, + int tagsize, int no_seek_table) +{ + /* Get ADTS header data */ + unsigned char buffer[ADTS_MAX_SIZE]; + int frames, framesinsec=0, t_framelength = 0, frame_length, sr_idx, ID; + int second = 0, pos; + int i; + float frames_per_sec = 0; + unsigned long bytes; + unsigned long *tmp_seek_table = NULL; + + info->headertype = 2; + + /* Read all frames to ensure correct time and bitrate */ + for(frames=0; /* */; frames++, framesinsec++) + { + /* If streaming, only go until we hit 5 seconds worth */ + if(file->http) + { + if(frames >= 43 * 5) + { + break; + } + } + + pos = tell_filestream(file); + + /* 12 bit SYNCWORD */ + bytes = read_buffer_filestream(file, buffer, ADTS_MAX_SIZE); + + if(bytes != ADTS_MAX_SIZE) + { + /* Bail out if no syncword found */ + break; + } + + /* check syncword */ + if (!((buffer[0] == 0xFF)&&((buffer[1] & 0xF6) == 0xF0))) + break; + + if(!frames) + { + /* fixed ADTS header is the same for every frame, so we read it only once */ + /* Syncword found, proceed to read in the fixed ADTS header */ + ID = buffer[1] & 0x08; + info->object_type = (buffer[2]&0xC0)>>6; + sr_idx = (buffer[2]&0x3C)>>2; + info->channels = ((buffer[2]&0x01)<<2)|((buffer[3]&0xC0)>>6); + + frames_per_sec = sample_rates[sr_idx] / 1024.f; + } + + /* ...and the variable ADTS header */ + if (ID == 0) { + info->version = 4; + } else { /* MPEG-2 */ + info->version = 2; + } + frame_length = ((((unsigned int)buffer[3] & 0x3)) << 11) + | (((unsigned int)buffer[4]) << 3) | (buffer[5] >> 5); + + t_framelength += frame_length; + + if(!file->http) + { + if(framesinsec == 43) + framesinsec = 0; + + if(framesinsec == 0 && seek_table_len) + { + tmp_seek_table = (unsigned long *) realloc(tmp_seek_table, (second + 1) * sizeof(unsigned long)); + tmp_seek_table[second] = pos; + } + if(framesinsec == 0) + second++; + } + + /* NOTE: While simply skipping ahead by reading may seem to be more work than seeking, + it is actually much faster, and keeps compatibility with streaming */ + for(i=0; i < frame_length - ADTS_MAX_SIZE; i++) + { + if(read_byte_filestream(file) < 0) + break; + } + } + + if(seek_table_len) + { + *seek_table_len = second; + *seek_table = tmp_seek_table; + } + + info->sampling_rate = sample_rates[sr_idx]; + info->bitrate = (int)(((t_framelength / frames) * (info->sampling_rate/1024.0)) +0.5)*8; + + if(file->http) + { + /* Since we only use 5 seconds of aac data to get a rough bitrate, we must use a different + method of calculating the overall length */ + if(filelength_filestream(file)) + { + info->length = (int)((filelength_filestream(file)/(((info->bitrate*8)/1024)*16))*1000); + } + else + { + /* Since the server didnt tell us how long the file is, + we have no way of determining length */ + info->length = 0; + } + } + else + { + info->length = (int)((float)(frames/frames_per_sec))*1000; + } + + return 0; +} + +int get_AAC_format(char *filename, faadAACInfo *info, + unsigned long **seek_table, int *seek_table_len, + int no_seek_table) +{ + unsigned long tagsize; + FILE_STREAM *file; + char buffer[10]; + unsigned long file_len; + unsigned char adxx_id[5]; + unsigned long tmp; + + memset(info, 0, sizeof(faadAACInfo)); + + file = open_filestream(filename); + + if(file == NULL) + return -1; + + file_len = filelength_filestream(file); + + /* Skip the tag, if it's there */ + tmp = read_buffer_filestream(file, buffer, 10); + + if (StringComp(buffer, "ID3", 3) == 0) + { + unsigned int i; + + /* high bit is not used */ + tagsize = (buffer[6] << 21) | (buffer[7] << 14) | + (buffer[8] << 7) | (buffer[9] << 0); + + for(i=0; i < tagsize; i++) + if(read_byte_filestream(file) < 0) + return -1; + + tagsize += 10; + } + else + { + tagsize = 0; + + /* Simple hack to reset to the beginning */ + file->buffer_offset = 0; + file->file_offset = 0; + } + + if(file_len) + file_len -= tagsize; + + tmp = read_buffer_filestream(file, adxx_id, 2); + //seek_filestream(file, tagsize, FILE_BEGIN); + + adxx_id[5-1] = 0; + info->length = 0; + + /* Determine the header type of the file, check the first two bytes */ + if(StringComp(adxx_id, "AD", 2) == 0) + { + /* We think its an ADIF header, but check the rest just to make sure */ + tmp = read_buffer_filestream(file, adxx_id + 2, 2); + + if(StringComp(adxx_id, "ADIF", 4) == 0) + { + read_ADIF_header(file, info); + } + } + else + { + /* No ADIF, check for ADTS header */ + if ((adxx_id[0] == 0xFF)&&((adxx_id[1] & 0xF6) == 0xF0)) + { + /* ADTS header located */ + /* Since this routine must work for streams, we can't use the seek function to go backwards, thus + we have to use a quick hack as seen below to go back where we need to. */ + + if(file->buffer_offset >= 2) + { + // simple seeking hack, though not really safe, the probability of it causing a problem is low. + file->buffer_offset -= 2; + file->file_offset -= 2; + } + + read_ADTS_header(file, info, seek_table, seek_table_len, tagsize, + no_seek_table); + } + else + { + /* Unknown/headerless AAC file, assume format: */ + info->version = 2; + info->bitrate = 128000; + info->sampling_rate = 44100; + info->channels = 2; + info->headertype = 0; + info->object_type = 1; + } + } + + close_filestream(file); + + return 0; +} + +int StringComp(char const *str1, char const *str2, unsigned long len) +{ + signed int c1 = 0, c2 = 0; + + while (len--) { + c1 = *str1++; + c2 = *str2++; + + if (c1 == 0 || c1 != c2) + break; + } + + return c1 - c2; +} + +#ifdef TEST +/* Program to test aacinfo functionality */ + +#include + +void main(int argc, char *argv[]) +{ + faadAACInfo info; + unsigned long *seek_table = NULL; + int seek_table_len = 0; + char *header, *object; + + if (argc < 2) + { + fprintf(stderr, "USAGE: aacinfo aacfile.aac\n"); + return; + } + + get_AAC_format(argv[1], &info, &seek_table, &seek_table_len, 0); + + fprintf(stdout, "MPEG version: %d\n", info.version); + fprintf(stdout, "channels: %d\n", info.channels); + fprintf(stdout, "sampling_rate: %d\n", info.sampling_rate); + fprintf(stdout, "bitrate: %d\n", info.bitrate); + fprintf(stdout, "length: %.3f\n", (float)info.length/1000.0); + + switch (info.object_type) + { + case 0: + object = "MAIN"; + break; + case 1: + object = "LC"; + break; + case 2: + object = "SSR"; + break; + case 3: + object = "LTP"; + break; + } + fprintf(stdout, "object_type: %s\n", object); + + switch (info.headertype) + { + case 0: + header = "RAW"; + break; + case 1: + header = "ADIF"; + break; + case 2: + header = "ADTS"; + break; + } + fprintf(stdout, "headertype: %s\n", header); +} + +#endif \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/aacinfo.dsp +++ vlc-0.8.4.debian/extras/faad2/common/faad/aacinfo.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="aacinfo" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=aacinfo - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "aacinfo.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "aacinfo.mak" CFG="aacinfo - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "aacinfo - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "aacinfo - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "aacinfo - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "TEST" /YX /FD /c +# ADD BASE RSC /l 0x413 /d "NDEBUG" +# ADD RSC /l 0x413 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "aacinfo - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "TEST" /YX /FD /GZ /c +# ADD BASE RSC /l 0x413 /d "_DEBUG" +# ADD RSC /l 0x413 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "aacinfo - Win32 Release" +# Name "aacinfo - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\aacinfo.c +# End Source File +# Begin Source File + +SOURCE=.\filestream.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\aacinfo.h +# End Source File +# Begin Source File + +SOURCE=.\filestream.h +# End Source File +# End Group +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/aacinfo.dsw +++ vlc-0.8.4.debian/extras/faad2/common/faad/aacinfo.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "aacinfo"=.\aacinfo.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/aacinfo.h +++ vlc-0.8.4.debian/extras/faad2/common/faad/aacinfo.h @@ -0,0 +1,53 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: aacinfo.h,v 1.3 2003/07/29 08:20:11 menno Exp $ +**/ + +#ifndef AACINFO_H__ +#define AACINFO_H__ + +#include "filestream.h" + +typedef struct { + int version; + int channels; + int sampling_rate; + int bitrate; + int length; + int object_type; + int headertype; +} faadAACInfo; + +int get_AAC_format(char *filename, faadAACInfo *info, + unsigned long **seek_table, int *seek_table_len, + int no_seek_table); + +static int read_ADIF_header(FILE_STREAM *file, faadAACInfo *info); +static int read_ADTS_header(FILE_STREAM *file, faadAACInfo *info, + unsigned long **seek_table, int *seek_table_len, + int tagsize, int no_seek_table); +int StringComp(char const *str1, char const *str2, unsigned long len); + +#endif --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/aacinfo.sln +++ vlc-0.8.4.debian/extras/faad2/common/faad/aacinfo.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aacinfo", "aacinfo.vcproj", "{FE985E4D-79DB-4DD3-BFED-824B4677A161}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Debug.ActiveCfg = Debug|Win32 + {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Debug.Build.0 = Debug|Win32 + {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Release.ActiveCfg = Release|Win32 + {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/aacinfo.vcproj +++ vlc-0.8.4.debian/extras/faad2/common/faad/aacinfo.vcproj @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/filestream.c +++ vlc-0.8.4.debian/extras/faad2/common/faad/filestream.c @@ -0,0 +1,470 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: filestream.c,v 1.3 2003/07/29 08:20:11 menno Exp $ +**/ + +/* Not very portable yet */ + +#include // Note: Must be *before* windows.h +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif +#include "filestream.h" +#include "aacinfo.h" + +/* TEMPROARY HACK */ +#define CommonExit(A) MessageBox(NULL, A, "FAAD Plugin", MB_OK) + +int winsock_init=0; // 0=winsock not initialized, 1=success +long m_local_buffer_size = 64; +long m_stream_buffer_size = 128; + +FILE_STREAM *open_filestream(char *filename) +{ + FILE_STREAM *fs; + + if(StringComp(filename,"http://", 7) == 0) + { + fs = (FILE_STREAM *)LocalAlloc(LPTR, sizeof(FILE_STREAM) + m_stream_buffer_size * 1024); + + if(fs == NULL) + return NULL; + + fs->data = (unsigned char *)&fs[1]; + + if(http_file_open(filename, fs) < 0) + { + LocalFree(fs); + return NULL; + } + + fs->http = 1; + } + else + { + fs = (FILE_STREAM*)LocalAlloc(LPTR, sizeof(FILE_STREAM) + m_local_buffer_size * 1024); + + if(fs == NULL) + return NULL; + + fs->data = (unsigned char *)&fs[1]; + + fs->stream = CreateFile(filename, GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, 0, + OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, 0); + if (fs->stream == INVALID_HANDLE_VALUE) + { + LocalFree(fs); + return NULL; + } + + fs->http = 0; + } + + fs->buffer_length = 0; + fs->buffer_offset = 0; + fs->file_offset = 0; + + return fs; +} + +int read_byte_filestream(FILE_STREAM *fs) +{ + if(fs->buffer_offset == fs->buffer_length) + { + fs->buffer_offset = 0; + + if(fs->http) + fs->buffer_length = recv(fs->inetStream, fs->data, m_stream_buffer_size * 1024, 0); + else + ReadFile(fs->stream, fs->data, m_local_buffer_size * 1024, &fs->buffer_length, 0); + + if(fs->buffer_length <= 0) + { + if(fs->http) + { + int x; + x = WSAGetLastError(); + + if(x == 0) + { + /* Equivalent of a successful EOF for HTTP */ + } + } + + fs->buffer_length = 0; + return -1; + } + } + + fs->file_offset++; + + return fs->data[fs->buffer_offset++]; +} + +int read_buffer_filestream(FILE_STREAM *fs, void *data, int length) +{ + int i, tmp; + unsigned char *data2 = (unsigned char *)data; + + for(i=0; i < length; i++) + { + if((tmp = read_byte_filestream(fs)) < 0) + { + if(i) + { + break; + } + else + { + return -1; + } + } + data2[i] = tmp; + } + + return i; +} + +unsigned long filelength_filestream(FILE_STREAM *fs) +{ + unsigned long fsize; + + if (fs->http) + { + fsize = fs->http_file_length; + } + else + { + fsize = GetFileSize(fs->stream, NULL); + } + + return fsize; +} + +void seek_filestream(FILE_STREAM *fs, unsigned long offset, int mode) +{ + if(fs->http) + { + return; + } + + SetFilePointer(fs->stream, offset, NULL, mode); + + if(mode == FILE_CURRENT) + fs->file_offset += offset; + else if(mode == FILE_END) + fs->file_offset = filelength_filestream(fs) + offset; + else + fs->file_offset = offset; + + fs->buffer_length = 0; + fs->buffer_offset = 0; +} + +unsigned long tell_filestream(FILE_STREAM *fs) +{ + return fs->file_offset; +} + +void close_filestream(FILE_STREAM *fs) +{ + if(fs) + { + if (fs->http) + { + if (fs->inetStream) + { + /* The 'proper' way to close a TCP connection */ + if(fs->inetStream) + { + CloseTCP(fs->inetStream); + } + } + } + else + { + if(fs->stream) + CloseHandle(fs->stream); + } + + LocalFree(fs); + fs = NULL; + } +} + +int WinsockInit() +{ + /* Before using winsock, you must load the DLL... */ + WSADATA wsaData; + + /* Load version 2.0 */ + if (WSAStartup( MAKEWORD( 2, 0 ), &wsaData )) + { + /* Disable streaming */ + return -1; + } + + winsock_init = 1; + + return 0; +} + +void WinsockDeInit() +{ + /* Unload the DLL */ + + if(winsock_init) + WSACleanup(); +} + +int FindCRLF(char *str) +{ + int i; + + for(i=0; i != lstrlen(str) && str[i] != '\r'; i++); + + return i; +} + +void CloseTCP(int s) +{ + char tempbuf[1024]; + + /* Set the socket to ignore any new incoming data */ + shutdown(s, 1); + + /* Get any old remaining data */ + while(recv(s, tempbuf, 1024, 0) > 0); + + /* Deallocate the socket */ + closesocket(s); +} + +int resolve_host(char *host, SOCKADDR_IN *sck_addr, unsigned short remote_port) +{ + HOSTENT *hp; + + if (isalpha(host[0])) + { + /* server address is a name */ + hp = gethostbyname(host); + } + else + { + unsigned long addr; + /* Convert nnn.nnn address to a usable one */ + addr = inet_addr(host); + hp = gethostbyaddr((char *)&addr, 4, AF_INET); + } + + if (hp == NULL) + { + char tmp[128]; + wsprintf(tmp, "Error resolving host address [%s]!\n", host); + CommonExit(tmp); + return -1; + } + + ZeroMemory(sck_addr, sizeof(SOCKADDR_IN)); + sck_addr->sin_family = AF_INET; + sck_addr->sin_port = htons(remote_port); + CopyMemory(&sck_addr->sin_addr, hp->h_addr, hp->h_length); + + return 0; +} + +int http_file_open(char *url, FILE_STREAM *fs) +{ + SOCKET sck; + SOCKADDR_IN host; + char server[1024], file[1024], request[1024], *temp = NULL, *tmpfile = NULL; + int i, j, port = 80, bytes_recv, http_code; + + /* No winsock, no streaming */ + if(!winsock_init) + { + return -1; + } + + url += 7; // Skip over http:// + + /* Extract data from the URL */ + for(i=0; url[i] != '/' && url[i] != ':' && url[i] != 0; i++); + + ZeroMemory(server, 1024); + CopyMemory(server, url, i); + + if(url[i] == ':') + { + /* A certain port was specified */ + port = atol(url + (i + 1)); + } + + for(; url[i] != '/' && url[i] != 0; i++); + + ZeroMemory(file, 1024); + + CopyMemory(file, url + i, lstrlen(url)); + + /* END OF URL PARSING */ + + /* Create a TCP/IP socket */ + sck = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + + if(sck == INVALID_SOCKET) + { + CommonExit("Error creating TCP/IP new socket"); + return -1; + } + + /* Resolve the host address (turn www.blah.com into an IP) */ + if(resolve_host(server, &host, (unsigned short)port)) + { + CommonExit("Error resolving host address"); + CloseTCP(sck); + return -1; + } + + /* Connect to the server */ + if(connect(sck, (SOCKADDR *)&host, sizeof(SOCKADDR)) == SOCKET_ERROR) + { + CommonExit("Error connecting to remote server"); + CloseTCP(sck); + return -1; + } + + tmpfile = calloc(1, (strlen(file) * 3) + 1); + + /* Encode URL */ + for(i=0, j=0; i < (int)strlen(file); i++) + { + if((unsigned char)file[i] <= 31 || (unsigned char)file[i] >= 127) + { + /* encode ASCII-control characters */ + wsprintf(tmpfile + j, "%%%X", (unsigned char)file[i]); + j += 3; + continue; + } + else + { + switch(file[i]) + { + /* encode characters that could confuse some servers */ + case ' ': + case '"': + case '>': + case '<': + case '#': + case '%': + case '{': + case '}': + case '|': + case '\\': + case '^': + case '~': + case '[': + case ']': + case '`': + + wsprintf(tmpfile + j, "%%%X", (unsigned char)file[i]); + j += 3; + continue; + } + } + + tmpfile[j] = file[i]; + j++; + } + + wsprintf(request, "GET %s\r\n\r\n", tmpfile); + + free(tmpfile); + + /* Send the request */ + if(send(sck, request, lstrlen(request), 0) <= 0) + { + /* Error sending data */ + CloseTCP(sck); + return -1; + } + + ZeroMemory(request, 1024); + + /* Send the request */ + if((bytes_recv = recv(sck, request, 1024, 0)) <= 0) + { + /* Error sending data */ + CloseTCP(sck); + return -1; + } + + if(StringComp(request,"HTTP/1.", 7) != 0) + { + /* Invalid header */ + CloseTCP(sck); + return -1; + } + + http_code = atol(request + 9); + + if(http_code < 200 || http_code > 299) + { + /* HTTP error */ + CloseTCP(sck); + return -1; + } + + // Search for a length field + fs->http_file_length = 0; + + /* Limit search to only 20 loops */ + if((temp = strstr(request, "Content-Length: ")) != NULL) + { + /* Has a content-length field, copy into structure */ + fs->http_file_length = atol(temp + 16); + } + + /* Copy the handle data into the structure */ + fs->inetStream = sck; + + /* Copy any excess data beyond the header into the filestream buffers */ + temp = strstr(request, "\r\n\r\n"); + + if(temp) + { + temp += 4; + } + + if(temp - request < bytes_recv) + { + memcpy(fs->data, temp, (temp - request) - bytes_recv); + fs->buffer_length = (temp - request) - bytes_recv; + fs->buffer_offset = 0; + } + + return 0; +} --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/filestream.h +++ vlc-0.8.4.debian/extras/faad2/common/faad/filestream.h @@ -0,0 +1,57 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: filestream.h,v 1.3 2003/07/29 08:20:11 menno Exp $ +**/ + +#ifndef FILESTREAM_H +#define FILESTREAM_H + +typedef struct { + HANDLE stream; + unsigned short inetStream; + unsigned char *data; + int http; + int buffer_offset; + int buffer_length; + int file_offset; + int http_file_length; +} FILE_STREAM; + +extern long m_local_buffer_size; +extern long m_stream_buffer_size; + +FILE_STREAM *open_filestream(char *filename); +int read_byte_filestream(FILE_STREAM *fs); +int read_buffer_filestream(FILE_STREAM *fs, void *data, int length); +unsigned long filelength_filestream(FILE_STREAM *fs); +void close_filestream(FILE_STREAM *fs); +void seek_filestream(FILE_STREAM *fs, unsigned long offset, int mode); +unsigned long tell_filestream(FILE_STREAM *fs); +int http_file_open(char *url, FILE_STREAM *fs); + +int WinsockInit(); +void WinsockDeInit(); +void CloseTCP(int s); +#endif \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/getopt.h +++ vlc-0.8.4.debian/extras/faad2/common/faad/getopt.h @@ -0,0 +1,130 @@ +/* Declarations for getopt. + Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + + 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, 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __MacOSX__ + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; +#endif + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +//#if __STDC__ || defined(PROTO) +#if defined(__GNU_LIBRARY__) +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +#endif /* not __GNU_LIBRARY__ */ +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +//#else /* not __STDC__ */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +//extern int getopt_long (); +//extern int getopt_long_only (); + +//extern int _getopt_internal (); +//#endif /* not __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/id3v2tag.c +++ vlc-0.8.4.debian/extras/faad2/common/faad/id3v2tag.c @@ -0,0 +1,1124 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: id3v2tag.c,v 1.4 2003/07/29 08:20:11 menno Exp $ +**/ + +#define WIN32_LEAN_AND_MEAN +#include +#include +#include + +#include + +#include + +HWND m_hwndList; + +LPSTR ID3Frames[] = +{ + "No known frame", + "Audio encryption", + "Attached picture", + "Comments", + "Commercial frame", + "Encryption method registration", + "Equalization", + "Event timing codes", + "General encapsulated object", + "Group identification registration", + "Involved people list", + "Linked information", + "Music CD identifier", + "MPEG location lookup table", + "Ownership frame", + "Private frame", + "Play counter", + "Popularimeter", + "Position synchronisation frame", + "Recommended buffer size", + "Relative volume adjustment", + "Reverb", + "Synchronized lyric", + "Synchronized tempo codes", + "Album title", + "BPM (beats per minute)", + "Composer", + "Genre", //"Content type", + "Copyright message", + "Date", + "Playlist delay", + "Encoded by", + "Lyricist", + "File type", + "Time", + "Content group description", + "Title", + "Subtitle", + "Initial key", + "Language(s)", + "Length", + "Media type", + "Original album title", + "Original filename", + "Original lyricist(s)", + "Original artist(s)", + "Original release year", + "File owner", + "Lead performer(s)", + "Band/orchestra/accompaniment", + "Conductor/performer refinement", + "Interpreted, remixed, or otherwise modified by", + "Part of a set", + "Publisher", + "Track number", + "Recording dates", + "Internet radio station name", + "Internet radio station owner", + "Size", + "ISRC (international standard recording code)", + "Software/Hardware and settings used for encoding", + "User defined text information", + "Year", + "Unique file identifier", + "Terms of use", + "Unsynchronized lyric", + "Commercial information", + "Copyright/Legal information", + "Official audio file webpage", + "Official artist webpage", + "Official audio source webpage", + "Official internet radio station homepage", + "Payment", + "Official publisher webpage", + "User defined URL link", + "Encrypted meta frame (id3v2.2.x)", + "Compressed meta frame (id3v2.2.1)" +}; + +ID3GENRES ID3Genres[]= +{ + 123, "Acapella", + 34, "Acid", + 74, "Acid Jazz", + 73, "Acid Punk", + 99, "Acoustic", + 20, "Alternative", + 40, "AlternRock", + 26, "Ambient", + 90, "Avantgarde", + 116, "Ballad", + 41, "Bass", + 85, "Bebob", + 96, "Big Band", + 89, "Bluegrass", + 0, "Blues", + 107, "Booty Bass", + 65, "Cabaret", + 88, "Celtic", + 104, "Chamber Music", + 102, "Chanson", + 97, "Chorus", + 61, "Christian Rap", + 1, "Classic Rock", + 32, "Classical", + 112, "Club", + 57, "Comedy", + 2, "Country", + 58, "Cult", + 3, "Dance", + 125, "Dance Hall", + 50, "Darkwave", + 254, "Data", + 22, "Death Metal", + 4, "Disco", + 55, "Dream", + 122, "Drum Solo", + 120, "Duet", + 98, "Easy Listening", + 52, "Electronic", + 48, "Ethnic", + 124, "Euro-House", + 25, "Euro-Techno", + 54, "Eurodance", + 84, "Fast Fusion", + 80, "Folk", + 81, "Folk-Rock", + 115, "Folklore", + 119, "Freestyle", + 5, "Funk", + 30, "Fusion", + 36, "Game", + 59, "Gangsta", + 38, "Gospel", + 49, "Gothic", + 91, "Gothic Rock", + 6, "Grunge", + 79, "Hard Rock", + 7, "Hip-Hop", + 35, "House", + 100, "Humour", + 19, "Industrial", + 33, "Instrumental", + 46, "Instrumental Pop", + 47, "Instrumental Rock", + 8, "Jazz", + 29, "Jazz+Funk", + 63, "Jungle", + 86, "Latin", + 71, "Lo-Fi", + 45, "Meditative", + 9, "Metal", + 77, "Musical", + 82, "National Folk", + 64, "Native American", + 10, "New Age", + 66, "New Wave", + 39, "Noise", + 255, "Not Set", + 11, "Oldies", + 103, "Opera", + 12, "Other", + 75, "Polka", + 13, "Pop", + 62, "Pop/Funk", + 53, "Pop-Folk", + 109, "Porn Groove", + 117, "Power Ballad", + 23, "Pranks", + 108, "Primus", + 92, "Progressive Rock", + 67, "Psychadelic", + 93, "Psychedelic Rock", + 43, "Punk", + 121, "Punk Rock", + 14, "R&B", + 15, "Rap", + 68, "Rave", + 16, "Reggae", + 76, "Retro", + 87, "Revival", + 118, "Rhythmic Soul", + 17, "Rock", + 78, "Rock & Roll", + 114, "Samba", + 110, "Satire", + 69, "Showtunes", + 21, "Ska", + 111, "Slow Jam", + 95, "Slow Rock", + 105, "Sonata", + 42, "Soul", + 37, "Sound Clip", + 24, "Soundtrack", + 56, "Southern Rock", + 44, "Space", + 101, "Speech", + 83, "Swing", + 94, "Symphonic Rock", + 106, "Symphony", + 113, "Tango", + 18, "Techno", + 51, "Techno-Industrial", + 60, "Top 40", + 70, "Trailer", + 31, "Trance", + 72, "Tribal", + 27, "Trip-Hop", + 28, "Vocal" +}; + +const int NUMFRAMES = sizeof(ID3Frames)/sizeof(ID3Frames[0]); +const int NUMGENRES = sizeof(ID3Genres)/sizeof(ID3Genres[0]); + + +LPSTR DupString(LPSTR lpsz) +{ + int cb = lstrlen(lpsz) + 1; + LPSTR lpszNew = LocalAlloc(LMEM_FIXED, cb); + if (lpszNew != NULL) + CopyMemory(lpszNew, lpsz, cb); + return lpszNew; +} + +LPSTR GetFrameDesc(ID3_FrameID id) +{ + return DupString(ID3Frames[id]); +} + +LPSTR GetGenre(LPSTR lpsz) +{ + int id = atoi(lpsz + 1); + int i; + + if ((*(lpsz + 1) > '0') && (*(lpsz + 1) < '9')) + { + for (i = 0; i < NUMGENRES; i++) + { + if (id == ID3Genres[i].id) + return DupString(ID3Genres[i].name); + } + } + return DupString(lpsz); +} + +void FillID3List(HWND hwndDlg, HWND hwndList, char *filename) +{ + ID3Tag *tag; + ID3Frame *frame; + ID3Field *field; + ID3_FrameID eFrameID; + char info[1024]; + int numFrames; + int i; + int iItem = 0; + + + if ((tag = ID3Tag_New()) != NULL) + { + ID3Tag_Link(tag, filename); + + numFrames = ID3Tag_NumFrames(tag); + + for (i = 0; i < numFrames; i++) + { + iItem++; + + frame = ID3Tag_GetFrameNum(tag, i); + eFrameID = ID3Frame_GetID(frame); + + switch (eFrameID) + { + case ID3FID_ALBUM: case ID3FID_BPM: + case ID3FID_COMPOSER: case ID3FID_CONTENTTYPE: + case ID3FID_COPYRIGHT: case ID3FID_DATE: + case ID3FID_PLAYLISTDELAY: case ID3FID_ENCODEDBY: + case ID3FID_LYRICIST: case ID3FID_FILETYPE: + case ID3FID_TIME: case ID3FID_CONTENTGROUP: + case ID3FID_TITLE: case ID3FID_SUBTITLE: + case ID3FID_INITIALKEY: case ID3FID_LANGUAGE: + case ID3FID_SONGLEN: case ID3FID_MEDIATYPE: + case ID3FID_ORIGALBUM: case ID3FID_ORIGFILENAME: + case ID3FID_ORIGLYRICIST: case ID3FID_ORIGARTIST: + case ID3FID_ORIGYEAR: case ID3FID_FILEOWNER: + case ID3FID_LEADARTIST: case ID3FID_BAND: + case ID3FID_CONDUCTOR: case ID3FID_MIXARTIST: + case ID3FID_PARTINSET: case ID3FID_PUBLISHER: + case ID3FID_TRACKNUM: case ID3FID_RECORDINGDATES: + case ID3FID_NETRADIOSTATION: case ID3FID_NETRADIOOWNER: + case ID3FID_SIZE: case ID3FID_ISRC: + case ID3FID_ENCODERSETTINGS: case ID3FID_YEAR: + { + LV_ITEM lvi; + ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM)); + + /* Initialize LV_ITEM members that are common to all items. */ + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; + lvi.state = 0; + lvi.stateMask = 0; + lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */ + lvi.iImage = 0; + lvi.iItem = iItem; + lvi.iSubItem = 0; + + pItem->frameId = eFrameID; + pItem->aCols[0] = GetFrameDesc(eFrameID); + + field = ID3Frame_GetField(frame, ID3FN_TEXT); + ID3Field_GetASCII(field, info, 1024, 1); + if (eFrameID == ID3FID_CONTENTTYPE) + pItem->aCols[1] = GetGenre(info); + else + pItem->aCols[1] = DupString(info); + + lvi.lParam = (LPARAM)pItem; /* item data */ + + /* Add the item. */ + ListView_InsertItem(hwndList, &lvi); + + break; + } + case ID3FID_USERTEXT: + case ID3FID_COMMENT: /* Can also contain an extra language field (but not used now) */ + case ID3FID_UNSYNCEDLYRICS: /* Can also contain an extra language field (but not used now) */ + { + LV_ITEM lvi; + ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM)); + + /* Initialize LV_ITEM members that are common to all items. */ + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; + lvi.state = 0; + lvi.stateMask = 0; + lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */ + lvi.iImage = 0; + lvi.iItem = iItem; + lvi.iSubItem = 0; + + pItem->frameId = eFrameID; + + field = ID3Frame_GetField(frame, ID3FN_DESCRIPTION); + ID3Field_GetASCII(field, info, 1024, 1); + pItem->aCols[0] = DupString(info); + + field = ID3Frame_GetField(frame, ID3FN_TEXT); + ID3Field_GetASCII(field, info, 1024, 1); + pItem->aCols[1] = DupString(info); + + lvi.lParam = (LPARAM)pItem; /* item data */ + + /* Add the item. */ + ListView_InsertItem(hwndList, &lvi); + + break; + } + case ID3FID_WWWAUDIOFILE: case ID3FID_WWWARTIST: + case ID3FID_WWWAUDIOSOURCE: case ID3FID_WWWCOMMERCIALINFO: + case ID3FID_WWWCOPYRIGHT: case ID3FID_WWWPUBLISHER: + case ID3FID_WWWPAYMENT: case ID3FID_WWWRADIOPAGE: + { + LV_ITEM lvi; + ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM)); + + /* Initialize LV_ITEM members that are common to all items. */ + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; + lvi.state = 0; + lvi.stateMask = 0; + lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */ + lvi.iImage = 0; + lvi.iItem = iItem; + lvi.iSubItem = 0; + + pItem->frameId = eFrameID; + + pItem->aCols[0] = GetFrameDesc(eFrameID); + + field = ID3Frame_GetField(frame, ID3FN_URL); + ID3Field_GetASCII(field, info, 1024, 1); + pItem->aCols[1] = DupString(info); + + lvi.lParam = (LPARAM)pItem; /* item data */ + + /* Add the item. */ + ListView_InsertItem(hwndList, &lvi); + + break; + } + case ID3FID_WWWUSER: + { + LV_ITEM lvi; + ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM)); + + /* Initialize LV_ITEM members that are common to all items. */ + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; + lvi.state = 0; + lvi.stateMask = 0; + lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */ + lvi.iImage = 0; + lvi.iItem = iItem; + lvi.iSubItem = 0; + + pItem->frameId = eFrameID; + + field = ID3Frame_GetField(frame, ID3FN_DESCRIPTION); + ID3Field_GetASCII(field, info, 1024, 1); + pItem->aCols[0] = DupString(info); + + field = ID3Frame_GetField(frame, ID3FN_URL); + ID3Field_GetASCII(field, info, 1024, 1); + pItem->aCols[1] = DupString(info); + + lvi.lParam = (LPARAM)pItem; /* item data */ + + /* Add the item. */ + ListView_InsertItem(hwndList, &lvi); + + break; + } + default: + break; + } + } + ID3Tag_Delete(tag); + } +} + +BOOL CALLBACK AddFrameProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + int i, cursel; + + switch (message) { + case WM_INITDIALOG: + EnableWindow(GetDlgItem(hwndDlg, IDC_COL0), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE); + + /* Note: FRAMEID is the index in the combo box + 1 */ + for (i = 1; i < NUMFRAMES; i++) + { + SendMessage(GetDlgItem(hwndDlg, IDC_FRAMETYPE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)ID3Frames[i]); + } + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDC_FRAMETYPE: + if (HIWORD(wParam) == CBN_SELCHANGE) + { + cursel = SendMessage(GetDlgItem(hwndDlg, IDC_FRAMETYPE), CB_GETCURSEL, 0, 0); + + switch (cursel + 1) + { + case ID3FID_ALBUM: case ID3FID_BPM: + case ID3FID_COMPOSER: case ID3FID_COPYRIGHT: + case ID3FID_DATE: case ID3FID_PLAYLISTDELAY: + case ID3FID_ENCODEDBY: case ID3FID_LYRICIST: + case ID3FID_FILETYPE: case ID3FID_TIME: + case ID3FID_CONTENTGROUP: case ID3FID_TITLE: + case ID3FID_SUBTITLE: case ID3FID_INITIALKEY: + case ID3FID_LANGUAGE: case ID3FID_SONGLEN: + case ID3FID_MEDIATYPE: case ID3FID_ORIGALBUM: + case ID3FID_ORIGFILENAME: case ID3FID_ORIGLYRICIST: + case ID3FID_ORIGARTIST: case ID3FID_ORIGYEAR: + case ID3FID_FILEOWNER: case ID3FID_LEADARTIST: + case ID3FID_BAND: case ID3FID_CONDUCTOR: + case ID3FID_MIXARTIST: case ID3FID_PARTINSET: + case ID3FID_PUBLISHER: case ID3FID_TRACKNUM: + case ID3FID_RECORDINGDATES: case ID3FID_NETRADIOSTATION: + case ID3FID_NETRADIOOWNER: case ID3FID_SIZE: + case ID3FID_ISRC: case ID3FID_ENCODERSETTINGS: + case ID3FID_YEAR: case ID3FID_WWWAUDIOFILE: + case ID3FID_WWWARTIST: case ID3FID_WWWAUDIOSOURCE: + case ID3FID_WWWCOMMERCIALINFO: case ID3FID_WWWCOPYRIGHT: + case ID3FID_WWWPUBLISHER: case ID3FID_WWWPAYMENT: + case ID3FID_WWWRADIOPAGE: case ID3FID_CONTENTTYPE: + { + SetDlgItemText(hwndDlg, IDC_COL0, ID3Frames[cursel+1]); + EnableWindow(GetDlgItem(hwndDlg, IDC_COL0), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE); + break; + } + case ID3FID_USERTEXT: case ID3FID_COMMENT: + case ID3FID_UNSYNCEDLYRICS: case ID3FID_WWWUSER: + { + SetDlgItemText(hwndDlg, IDC_COL0, ID3Frames[cursel+1]); + EnableWindow(GetDlgItem(hwndDlg, IDC_COL0), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE); + break; + } + default: + MessageBox(hwndDlg, "Sorry, this frame type cannot be added (yet).", "Sorry", MB_OK); + EnableWindow(GetDlgItem(hwndDlg, IDC_COL0), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE); + break; + } + } + return TRUE; + case IDOK: + { + LV_ITEM lvi; + ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM)); + char *col0 = LocalAlloc(LPTR, 1024); + char *col1 = LocalAlloc(LPTR, 1024); + + /* Initialize LV_ITEM members that are common to all items. */ + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; + lvi.state = 0; + lvi.stateMask = 0; + lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */ + lvi.iImage = 0; + lvi.iItem = ListView_GetItemCount(m_hwndList) + 1; + lvi.iSubItem = 0; + + cursel = SendMessage(GetDlgItem(hwndDlg, IDC_FRAMETYPE), CB_GETCURSEL, 0, 0); + pItem->frameId = cursel + 1; + GetDlgItemText(hwndDlg, IDC_COL0, col0, 1024); + GetDlgItemText(hwndDlg, IDC_COL1, col1, 1024); + pItem->aCols[0] = col0; + pItem->aCols[1] = col1; + + lvi.lParam = (LPARAM)pItem; /* item data */ + + /* Add the item. */ + ListView_InsertItem(m_hwndList, &lvi); + ListView_Update(m_hwndList, lvi.iItem); + } + case IDCANCEL: + EndDialog(hwndDlg, wParam); + return TRUE; + } + } + return FALSE; +} + +BOOL List_AddFrame(HWND hwndApp, HWND hwndList) +{ + int result; + + m_hwndList = hwndList; + + result = DialogBox(hInstance_for_id3editor, MAKEINTRESOURCE(IDD_ADDFRAME), + hwndApp, AddFrameProc); + + if (LOWORD(result) == IDOK) + return TRUE; + return FALSE; +} + + +void InsertTextFrame(HWND dlg, HWND list, int control, int item, int frame_id) +{ + LV_ITEM lvi; + ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM)); + + /* Initialize LV_ITEM members that are common to all items. */ + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; + lvi.state = 0; + lvi.stateMask = 0; + lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */ + lvi.iImage = 0; + lvi.iItem = item; + lvi.iSubItem = 0; + + pItem->frameId = frame_id; + pItem->aCols[0] = GetFrameDesc(frame_id); + + pItem->aCols[1] = LocalAlloc(LPTR, 1024); + GetDlgItemText(dlg, control, pItem->aCols[1], 1024); + + lvi.lParam = (LPARAM)pItem; /* item data */ + + /* Add the item. */ + ListView_InsertItem(list, &lvi); +} + +void AddFrameFromRAWData(HWND hwndList, int frameId, LPSTR data1, LPSTR data2) +{ + LV_ITEM lvi; + ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM)); + int nextItem; + + nextItem = ListView_GetItemCount(hwndList); + + /* Initialize LV_ITEM members that are common to all items. */ + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; + lvi.state = 0; + lvi.stateMask = 0; + lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */ + lvi.iImage = 0; + lvi.iItem = nextItem; + lvi.iSubItem = 0; + + pItem->frameId = frameId; + + pItem->aCols[0] = LocalAlloc(LPTR, 1024); + pItem->aCols[1] = LocalAlloc(LPTR, 1024); + + lstrcpy(pItem->aCols[0], data1); + lstrcpy(pItem->aCols[1], data2); + + lvi.lParam = (LPARAM)pItem; /* item data */ + + /* Add the item. */ + ListView_InsertItem(hwndList, &lvi); +} + +HWND m_hwndDlg; +int changed; + +BOOL CALLBACK AddStandardProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + int added = 0; + + switch (message) { + case WM_INITDIALOG: + changed = 0; + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + { + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TRACK)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_TRACK, ListView_GetItemCount(m_hwndList)+1, ID3FID_TRACKNUM); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TITLE)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_TITLE, ListView_GetItemCount(m_hwndList)+1, ID3FID_TITLE); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ARTIST)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_ARTIST, ListView_GetItemCount(m_hwndList)+1, ID3FID_LEADARTIST); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ALBUM)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_ALBUM, ListView_GetItemCount(m_hwndList)+1, ID3FID_ALBUM); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_YEAR)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_YEAR, ListView_GetItemCount(m_hwndList)+1, ID3FID_YEAR); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GENRE)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_GENRE, ListView_GetItemCount(m_hwndList)+1, ID3FID_CONTENTTYPE); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_COMMENT)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_COMMENT, ListView_GetItemCount(m_hwndList)+1, ID3FID_COMMENT); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_COMPOSER)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_COMPOSER, ListView_GetItemCount(m_hwndList)+1, ID3FID_COMPOSER); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ORIGARTIST)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_ORIGARTIST, ListView_GetItemCount(m_hwndList)+1, ID3FID_ORIGARTIST); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_COPYRIGHT)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_COPYRIGHT, ListView_GetItemCount(m_hwndList)+1, ID3FID_COPYRIGHT); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_URL)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_URL, ListView_GetItemCount(m_hwndList)+1, ID3FID_WWWARTIST); + added++; + } + + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ENCBY)) > 0) { + InsertTextFrame(hwndDlg, m_hwndList, IDC_ENCBY, ListView_GetItemCount(m_hwndList)+1, ID3FID_ENCODEDBY); + added++; + } + + if (added > 0) + changed = 1; + } + case IDCANCEL: + EndDialog(hwndDlg, changed); + return TRUE; + } + } + return FALSE; +} + + +BOOL List_AddStandardFrames(HWND hwndApp, HWND hwndList) +{ + int result; + + m_hwndList = hwndList; + m_hwndDlg = hwndApp; + + result = DialogBox(hInstance_for_id3editor, MAKEINTRESOURCE(IDD_ADDSTANDARD), + hwndApp, AddStandardProc); + + return result?TRUE:FALSE; +} + + +/* List_OnGetDispInfo - processes the LVN_GETDISPINFO */ +/* notification message. */ +/* pnmv - value of lParam (points to an LV_DISPINFO structure) */ +void List_OnGetDispInfo(LV_DISPINFO *pnmv) +{ + /* Provide the item or subitem's text, if requested. */ + if (pnmv->item.mask & LVIF_TEXT) { + ID3ITEM *pItem = (ID3ITEM *) (pnmv->item.lParam); + lstrcpy(pnmv->item.pszText, + pItem->aCols[pnmv->item.iSubItem]); + } +} + +ID3ITEM *pItem; +int editItemIndex; + +BOOL CALLBACK EditTextFrameProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + LV_ITEM lvi; + + switch (message) { + case WM_INITDIALOG: + SetDlgItemText(hwndDlg, IDC_TEXTFRAMENAME, pItem->aCols[0]); + SetDlgItemText(hwndDlg, IDC_EDITTEXTFRAME, pItem->aCols[1]); + + switch (pItem->frameId) + { + case ID3FID_ALBUM: case ID3FID_BPM: + case ID3FID_COMPOSER: case ID3FID_COPYRIGHT: + case ID3FID_DATE: case ID3FID_PLAYLISTDELAY: + case ID3FID_ENCODEDBY: case ID3FID_LYRICIST: + case ID3FID_FILETYPE: case ID3FID_TIME: + case ID3FID_CONTENTGROUP: case ID3FID_TITLE: + case ID3FID_SUBTITLE: case ID3FID_INITIALKEY: + case ID3FID_LANGUAGE: case ID3FID_SONGLEN: + case ID3FID_MEDIATYPE: case ID3FID_ORIGALBUM: + case ID3FID_ORIGFILENAME: case ID3FID_ORIGLYRICIST: + case ID3FID_ORIGARTIST: case ID3FID_ORIGYEAR: + case ID3FID_FILEOWNER: case ID3FID_LEADARTIST: + case ID3FID_BAND: case ID3FID_CONDUCTOR: + case ID3FID_MIXARTIST: case ID3FID_PARTINSET: + case ID3FID_PUBLISHER: case ID3FID_TRACKNUM: + case ID3FID_RECORDINGDATES: case ID3FID_NETRADIOSTATION: + case ID3FID_NETRADIOOWNER: case ID3FID_SIZE: + case ID3FID_ISRC: case ID3FID_ENCODERSETTINGS: + case ID3FID_YEAR: case ID3FID_WWWAUDIOFILE: + case ID3FID_WWWARTIST: case ID3FID_WWWAUDIOSOURCE: + case ID3FID_WWWCOMMERCIALINFO: case ID3FID_WWWCOPYRIGHT: + case ID3FID_WWWPUBLISHER: case ID3FID_WWWPAYMENT: + case ID3FID_WWWRADIOPAGE: case ID3FID_CONTENTTYPE: + { + EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTFRAMENAME), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_EDITTEXTFRAME), TRUE); + break; + } + case ID3FID_USERTEXT: case ID3FID_COMMENT: + case ID3FID_UNSYNCEDLYRICS: case ID3FID_WWWUSER: + { + EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTFRAMENAME), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_EDITTEXTFRAME), TRUE); + break; + } + default: + EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTFRAMENAME), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_EDITTEXTFRAME), FALSE); + break; + } + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + { + GetDlgItemText(hwndDlg, IDC_TEXTFRAMENAME, pItem->aCols[0], 1024); + GetDlgItemText(hwndDlg, IDC_EDITTEXTFRAME, pItem->aCols[1], 1024); + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; + lvi.state = 0; + lvi.stateMask = 0; + lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */ + lvi.iImage = 0; + lvi.iItem = editItemIndex; + lvi.iSubItem = 0; + lvi.lParam = (LPARAM)pItem; /* item data */ + + /* Add the item. */ + ListView_SetItem(m_hwndList, &lvi); + ListView_Update(m_hwndList, editItemIndex); + } /* Fall through */ + case IDCANCEL: + EndDialog(hwndDlg, wParam); + return TRUE; + } + } + return FALSE; +} + + +/* Double clicking means editing a frame */ +BOOL List_EditData(HWND hwndApp, HWND hwndList) +{ + LV_ITEM lvi; + BOOL result; + + /* First get the selected item */ + int index = ListView_GetNextItem(hwndList, -1, LVNI_SELECTED); + + m_hwndList = hwndList; + + if (index != -1) + { + lvi.mask = LVIF_PARAM; + lvi.iItem = index; + lvi.iSubItem = 0; + + if (ListView_GetItem(hwndList, &lvi) == TRUE) + { + pItem = (ID3ITEM*)lvi.lParam; + editItemIndex = lvi.iItem; + + result = DialogBox(hInstance_for_id3editor, MAKEINTRESOURCE(IDD_EDITTEXTFRAME), + hwndApp, EditTextFrameProc); + if (LOWORD(result) == IDOK) + return TRUE; + } + } + return FALSE; +} + + +/* Delete the selected frame */ +BOOL List_DeleteSelected(HWND hwndApp, HWND hwndList) +{ + int items; + + /* First get the selected item */ + int index = ListView_GetNextItem(hwndList, -1, LVNI_SELECTED); + + if (index != -1) + ListView_DeleteItem(hwndList, index); + + items = ListView_GetItemCount(hwndList); + if (index != -1) return TRUE; + else return FALSE; +} + + +/* Save the ID3 to the file */ +void List_SaveID3(HWND hwndApp, HWND hwndList, char *filename) +{ + LV_ITEM lvi; + ID3ITEM *pItem1; + int i, items; + ID3Tag *tag; + ID3Frame *frame; + ID3Field *field; + + /* Strip the tag first, before completely rewriting it */ + if ((tag = ID3Tag_New()) != NULL) + { + ID3Tag_Link(tag, filename); + ID3Tag_Strip(tag, ID3TT_ALL); + ID3Tag_Clear(tag); + + if (SendMessage(GetDlgItem(hwndApp, IDC_ID3V2TAG), BM_GETCHECK, 0, 0) == BST_UNCHECKED) + { + /* No frames saved */ + ID3Tag_Delete(tag); + EnableWindow(GetDlgItem(hwndApp, IDC_ID3V2TAG), FALSE); + ListView_DeleteAllItems(hwndList); + return; + } + + /* First get the number of items */ + items = ListView_GetItemCount(hwndList); + + if (items > 0) + { + for (i = 0; i < items; i++) + { + lvi.mask = LVIF_PARAM; + lvi.iItem = i; + lvi.iSubItem = 0; + + if (ListView_GetItem(hwndList, &lvi) == TRUE) + { + pItem1 = (ID3ITEM*)lvi.lParam; + + frame = ID3Frame_NewID(pItem1->frameId); + + switch (pItem1->frameId) + { + case ID3FID_ALBUM: case ID3FID_BPM: + case ID3FID_COMPOSER: case ID3FID_CONTENTTYPE: + case ID3FID_COPYRIGHT: case ID3FID_DATE: + case ID3FID_PLAYLISTDELAY: case ID3FID_ENCODEDBY: + case ID3FID_LYRICIST: case ID3FID_FILETYPE: + case ID3FID_TIME: case ID3FID_CONTENTGROUP: + case ID3FID_TITLE: case ID3FID_SUBTITLE: + case ID3FID_INITIALKEY: case ID3FID_LANGUAGE: + case ID3FID_SONGLEN: case ID3FID_MEDIATYPE: + case ID3FID_ORIGALBUM: case ID3FID_ORIGFILENAME: + case ID3FID_ORIGLYRICIST: case ID3FID_ORIGARTIST: + case ID3FID_ORIGYEAR: case ID3FID_FILEOWNER: + case ID3FID_LEADARTIST: case ID3FID_BAND: + case ID3FID_CONDUCTOR: case ID3FID_MIXARTIST: + case ID3FID_PARTINSET: case ID3FID_PUBLISHER: + case ID3FID_TRACKNUM: case ID3FID_RECORDINGDATES: + case ID3FID_NETRADIOSTATION: case ID3FID_NETRADIOOWNER: + case ID3FID_SIZE: case ID3FID_ISRC: + case ID3FID_ENCODERSETTINGS: case ID3FID_YEAR: + { + field = ID3Frame_GetField(frame, ID3FN_TEXT); + ID3Field_SetASCII(field, pItem1->aCols[1]); + ID3Tag_AddFrame(tag, frame); + break; + } + case ID3FID_USERTEXT: + case ID3FID_COMMENT: /* Can also contain an extra language field (but not used now) */ + case ID3FID_UNSYNCEDLYRICS: /* Can also contain an extra language field (but not used now) */ + { + field = ID3Frame_GetField(frame, ID3FN_DESCRIPTION); + ID3Field_SetASCII(field, pItem1->aCols[0]); + field = ID3Frame_GetField(frame, ID3FN_TEXT); + ID3Field_SetASCII(field, pItem1->aCols[1]); + ID3Tag_AddFrame(tag, frame); + break; + } + case ID3FID_WWWAUDIOFILE: case ID3FID_WWWARTIST: + case ID3FID_WWWAUDIOSOURCE: case ID3FID_WWWCOMMERCIALINFO: + case ID3FID_WWWCOPYRIGHT: case ID3FID_WWWPUBLISHER: + case ID3FID_WWWPAYMENT: case ID3FID_WWWRADIOPAGE: + { + field = ID3Frame_GetField(frame, ID3FN_URL); + ID3Field_SetASCII(field, pItem1->aCols[1]); + ID3Tag_AddFrame(tag, frame); + break; + } + case ID3FID_WWWUSER: + { + field = ID3Frame_GetField(frame, ID3FN_DESCRIPTION); + ID3Field_SetASCII(field, pItem1->aCols[0]); + field = ID3Frame_GetField(frame, ID3FN_URL); + ID3Field_SetASCII(field, pItem1->aCols[1]); + ID3Tag_AddFrame(tag, frame); + break; + } + default: + break; + } + } + } + ID3Tag_UpdateByTagType(tag, ID3TT_ID3V2); + } + + ID3Tag_Delete(tag); + } +} + +/* Get the title from the file */ +void GetID3FileTitle(char *filename, char *title, char *format) +{ + ID3Tag *tag; + ID3Frame *frame; + ID3Field *field; + char buffer[255]; + int some_info = 0; + char *in = format; + char *out = title; + char *bound = out + (MAX_PATH - 10 - 1); + + + if ((tag = ID3Tag_New()) != NULL) + { + ID3Tag_Link(tag, filename); + + while (*in && out < bound) + { + switch (*in) { + case '%': + ++in; + break; + + default: + *out++ = *in++; + continue; + } + + /* handle % escape sequence */ + switch (*in++) { + case '0': + if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_TRACKNUM)) != NULL) { + int size; + field = ID3Frame_GetField(frame, ID3FN_TEXT); + size = ID3Field_GetASCII(field, buffer, 255, 1); + lstrcpy(out, buffer); out += size; + some_info = 1; + } + break; + case '1': + if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_LEADARTIST)) != NULL) { + int size; + field = ID3Frame_GetField(frame, ID3FN_TEXT); + size = ID3Field_GetASCII(field, buffer, 255, 1); + lstrcpy(out, buffer); out += size; + some_info = 1; + } + break; + case '2': + if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_TITLE)) != NULL) { + int size; + field = ID3Frame_GetField(frame, ID3FN_TEXT); + size = ID3Field_GetASCII(field, buffer, 255, 1); + lstrcpy(out, buffer); out += size; + some_info = 1; + } + break; + case '3': + if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_ALBUM)) != NULL) { + int size; + field = ID3Frame_GetField(frame, ID3FN_TEXT); + size = ID3Field_GetASCII(field, buffer, 255, 1); + lstrcpy(out, buffer); out += size; + some_info = 1; + } + break; + case '4': + if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_YEAR)) != NULL) { + int size; + field = ID3Frame_GetField(frame, ID3FN_TEXT); + size = ID3Field_GetASCII(field, buffer, 255, 1); + lstrcpy(out, buffer); out += size; + some_info = 1; + } + break; + case '5': + if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_COMMENT)) != NULL) { + int size; + field = ID3Frame_GetField(frame, ID3FN_TEXT); + size = ID3Field_GetASCII(field, buffer, 255, 1); + lstrcpy(out, buffer); out += size; + some_info = 1; + } + break; + case '6': + if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_CONTENTTYPE)) != NULL) { + int size; char *tmp; + field = ID3Frame_GetField(frame, ID3FN_TEXT); + size = ID3Field_GetASCII(field, buffer, 255, 1); + tmp = GetGenre(buffer); + lstrcpy(out, tmp); out += size; + some_info = 1; + } + break; + case '7': + { + char *p=filename+lstrlen(filename); + int len = 0; + while (*p != '\\' && p >= filename) { p--; len++; } + lstrcpy(out, ++p); out += len; + some_info = 1; + break; + } + } + } + + *out = '\0'; + ID3Tag_Delete(tag); + } + + if (!some_info) + { + char *p=filename+lstrlen(filename); + while (*p != '\\' && p >= filename) p--; + lstrcpy(title,++p); + } +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/faad/id3v2tag.h +++ vlc-0.8.4.debian/extras/faad2/common/faad/id3v2tag.h @@ -0,0 +1,54 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: id3v2tag.h,v 1.3 2003/07/29 08:20:11 menno Exp $ +**/ + +#ifndef __ID3V2TAG_H__ +#define __ID3V2TAG_H__ + +void GetID3FileTitle(char *filename, char *title, char *format); +void FillID3List(HWND hwndDlg, HWND hwndList, char *filename); +void List_OnGetDispInfo(LV_DISPINFO *pnmv); +BOOL List_EditData(HWND hwndApp, HWND hwndList); +void List_SaveID3(HWND hwndApp, HWND hwndList, char *filename); +BOOL List_DeleteSelected(HWND hwndApp, HWND hwndList); +BOOL List_AddFrame(HWND hwndApp, HWND hwndList); +BOOL List_AddStandardFrames(HWND hwndApp, HWND hwndList); +void AddFrameFromRAWData(HWND hwndList, int frameId, LPSTR data1, LPSTR data2); + +HINSTANCE hInstance_for_id3editor; + +typedef struct ID3GENRES_TAG +{ + BYTE id; + char name[30]; +} ID3GENRES; + +typedef struct id3item_tag { + int frameId; + LPSTR aCols[2]; +} ID3ITEM; + +#endif \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/Makefile.am +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/Makefile.am @@ -1,8 +1,12 @@ -noinst_LIBRARIES = libmp4ff.a +lib_LTLIBRARIES = libmp4ff.la -libmp4ff_a_CFLAGS = -DUSE_TAGGING=1 +include_HEADERS = mp4ff.h -libmp4ff_a_SOURCES = mp4ff.c mp4atom.c mp4meta.c mp4sample.c mp4util.c \ +libmp4ff_la_SOURCES = mp4ff.c mp4atom.c mp4meta.c mp4sample.c mp4util.c \ mp4tagupdate.c mp4ff.h mp4ffint.h mp4ff_int_types.h \ drms.h drms.c drmstables.h +AM_CFLAGS = -O2 -g -DUSE_TAGGING=1 +LIBTOOL_DEPS = +LIBS = + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.8.5 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,6 +14,9 @@ @SET_MAKE@ + +SOURCES = $(libmp4ff_la_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -21,7 +24,6 @@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,6 +38,46 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ +subdir = common/mp4ff +DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libmp4ff_la_LIBADD = +am_libmp4ff_la_OBJECTS = mp4ff.lo mp4atom.lo mp4meta.lo mp4sample.lo \ + mp4util.lo mp4tagupdate.lo drms.lo +libmp4ff_la_OBJECTS = $(am_libmp4ff_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/drms.Plo ./$(DEPDIR)/mp4atom.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4ff.Plo ./$(DEPDIR)/mp4meta.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4sample.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4tagupdate.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4util.Plo +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libmp4ff_la_SOURCES) +DIST_SOURCES = $(libmp4ff_la_SOURCES) +includeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(include_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -45,6 +87,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -66,6 +110,8 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ @@ -76,9 +122,9 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ +LIBS = LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIBTOOL_DEPS = LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ @@ -91,12 +137,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ XMMS_CONFIG = @XMMS_CONFIG@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ @@ -104,6 +153,7 @@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -119,7 +169,6 @@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ -external_mp4v2 = @external_mp4v2@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -132,6 +181,7 @@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -139,344 +189,113 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -noinst_LIBRARIES = libmp4ff.a - -libmp4ff_a_CFLAGS = -DUSE_TAGGING=1 - -libmp4ff_a_SOURCES = mp4ff.c mp4atom.c mp4meta.c mp4sample.c mp4util.c \ +lib_LTLIBRARIES = libmp4ff.la +include_HEADERS = mp4ff.h +libmp4ff_la_SOURCES = mp4ff.c mp4atom.c mp4meta.c mp4sample.c mp4util.c \ mp4tagupdate.c mp4ff.h mp4ffint.h mp4ff_int_types.h \ drms.h drms.c drmstables.h -subdir = common/mp4ff -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - -libmp4ff_a_AR = $(AR) cru -libmp4ff_a_LIBADD = -am_libmp4ff_a_OBJECTS = libmp4ff_a-mp4ff.$(OBJEXT) \ - libmp4ff_a-mp4atom.$(OBJEXT) libmp4ff_a-mp4meta.$(OBJEXT) \ - libmp4ff_a-mp4sample.$(OBJEXT) libmp4ff_a-mp4util.$(OBJEXT) \ - libmp4ff_a-mp4tagupdate.$(OBJEXT) libmp4ff_a-drms.$(OBJEXT) -libmp4ff_a_OBJECTS = $(am_libmp4ff_a_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/libmp4ff_a-drms.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/libmp4ff_a-mp4atom.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/libmp4ff_a-mp4ff.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/libmp4ff_a-mp4meta.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/libmp4ff_a-mp4sample.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/libmp4ff_a-mp4tagupdate.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/libmp4ff_a-mp4util.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libmp4ff_a_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libmp4ff_a_SOURCES) - +AM_CFLAGS = -O2 -g -DUSE_TAGGING=1 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/mp4ff/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu common/mp4ff/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libmp4ff.a: $(libmp4ff_a_OBJECTS) $(libmp4ff_a_DEPENDENCIES) - -rm -f libmp4ff.a - $(libmp4ff_a_AR) libmp4ff.a $(libmp4ff_a_OBJECTS) $(libmp4ff_a_LIBADD) - $(RANLIB) libmp4ff.a +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmp4ff.la: $(libmp4ff_la_OBJECTS) $(libmp4ff_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libmp4ff_la_LDFLAGS) $(libmp4ff_la_OBJECTS) $(libmp4ff_la_LIBADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4ff_a-drms.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4ff_a-mp4atom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4ff_a-mp4ff.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4ff_a-mp4meta.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4ff_a-mp4sample.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4ff_a-mp4tagupdate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4ff_a-mp4util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drms.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4atom.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4ff.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4meta.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4sample.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4tagupdate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4util.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -libmp4ff_a-mp4ff.o: mp4ff.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4ff.o -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4ff.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4ff.o `test -f 'mp4ff.c' || echo '$(srcdir)/'`mp4ff.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4ff.Tpo" "$(DEPDIR)/libmp4ff_a-mp4ff.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4ff.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4ff.c' object='libmp4ff_a-mp4ff.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4ff.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4ff.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4ff.o `test -f 'mp4ff.c' || echo '$(srcdir)/'`mp4ff.c - -libmp4ff_a-mp4ff.obj: mp4ff.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4ff.obj -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4ff.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4ff.obj `if test -f 'mp4ff.c'; then $(CYGPATH_W) 'mp4ff.c'; else $(CYGPATH_W) '$(srcdir)/mp4ff.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4ff.Tpo" "$(DEPDIR)/libmp4ff_a-mp4ff.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4ff.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4ff.c' object='libmp4ff_a-mp4ff.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4ff.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4ff.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4ff.obj `if test -f 'mp4ff.c'; then $(CYGPATH_W) 'mp4ff.c'; else $(CYGPATH_W) '$(srcdir)/mp4ff.c'; fi` - -libmp4ff_a-mp4ff.lo: mp4ff.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4ff.lo -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4ff.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4ff.lo `test -f 'mp4ff.c' || echo '$(srcdir)/'`mp4ff.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4ff.Tpo" "$(DEPDIR)/libmp4ff_a-mp4ff.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4ff.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4ff.c' object='libmp4ff_a-mp4ff.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4ff.Plo' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4ff.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4ff.lo `test -f 'mp4ff.c' || echo '$(srcdir)/'`mp4ff.c - -libmp4ff_a-mp4atom.o: mp4atom.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4atom.o -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4atom.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4atom.o `test -f 'mp4atom.c' || echo '$(srcdir)/'`mp4atom.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4atom.Tpo" "$(DEPDIR)/libmp4ff_a-mp4atom.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4atom.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4atom.c' object='libmp4ff_a-mp4atom.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4atom.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4atom.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4atom.o `test -f 'mp4atom.c' || echo '$(srcdir)/'`mp4atom.c - -libmp4ff_a-mp4atom.obj: mp4atom.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4atom.obj -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4atom.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4atom.obj `if test -f 'mp4atom.c'; then $(CYGPATH_W) 'mp4atom.c'; else $(CYGPATH_W) '$(srcdir)/mp4atom.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4atom.Tpo" "$(DEPDIR)/libmp4ff_a-mp4atom.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4atom.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4atom.c' object='libmp4ff_a-mp4atom.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4atom.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4atom.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4atom.obj `if test -f 'mp4atom.c'; then $(CYGPATH_W) 'mp4atom.c'; else $(CYGPATH_W) '$(srcdir)/mp4atom.c'; fi` - -libmp4ff_a-mp4atom.lo: mp4atom.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4atom.lo -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4atom.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4atom.lo `test -f 'mp4atom.c' || echo '$(srcdir)/'`mp4atom.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4atom.Tpo" "$(DEPDIR)/libmp4ff_a-mp4atom.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4atom.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4atom.c' object='libmp4ff_a-mp4atom.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4atom.Plo' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4atom.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4atom.lo `test -f 'mp4atom.c' || echo '$(srcdir)/'`mp4atom.c - -libmp4ff_a-mp4meta.o: mp4meta.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4meta.o -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4meta.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4meta.o `test -f 'mp4meta.c' || echo '$(srcdir)/'`mp4meta.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4meta.Tpo" "$(DEPDIR)/libmp4ff_a-mp4meta.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4meta.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4meta.c' object='libmp4ff_a-mp4meta.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4meta.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4meta.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4meta.o `test -f 'mp4meta.c' || echo '$(srcdir)/'`mp4meta.c - -libmp4ff_a-mp4meta.obj: mp4meta.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4meta.obj -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4meta.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4meta.obj `if test -f 'mp4meta.c'; then $(CYGPATH_W) 'mp4meta.c'; else $(CYGPATH_W) '$(srcdir)/mp4meta.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4meta.Tpo" "$(DEPDIR)/libmp4ff_a-mp4meta.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4meta.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4meta.c' object='libmp4ff_a-mp4meta.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4meta.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4meta.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4meta.obj `if test -f 'mp4meta.c'; then $(CYGPATH_W) 'mp4meta.c'; else $(CYGPATH_W) '$(srcdir)/mp4meta.c'; fi` - -libmp4ff_a-mp4meta.lo: mp4meta.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4meta.lo -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4meta.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4meta.lo `test -f 'mp4meta.c' || echo '$(srcdir)/'`mp4meta.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4meta.Tpo" "$(DEPDIR)/libmp4ff_a-mp4meta.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4meta.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4meta.c' object='libmp4ff_a-mp4meta.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4meta.Plo' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4meta.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4meta.lo `test -f 'mp4meta.c' || echo '$(srcdir)/'`mp4meta.c - -libmp4ff_a-mp4sample.o: mp4sample.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4sample.o -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4sample.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4sample.o `test -f 'mp4sample.c' || echo '$(srcdir)/'`mp4sample.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4sample.Tpo" "$(DEPDIR)/libmp4ff_a-mp4sample.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4sample.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4sample.c' object='libmp4ff_a-mp4sample.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4sample.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4sample.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4sample.o `test -f 'mp4sample.c' || echo '$(srcdir)/'`mp4sample.c - -libmp4ff_a-mp4sample.obj: mp4sample.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4sample.obj -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4sample.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4sample.obj `if test -f 'mp4sample.c'; then $(CYGPATH_W) 'mp4sample.c'; else $(CYGPATH_W) '$(srcdir)/mp4sample.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4sample.Tpo" "$(DEPDIR)/libmp4ff_a-mp4sample.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4sample.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4sample.c' object='libmp4ff_a-mp4sample.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4sample.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4sample.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4sample.obj `if test -f 'mp4sample.c'; then $(CYGPATH_W) 'mp4sample.c'; else $(CYGPATH_W) '$(srcdir)/mp4sample.c'; fi` - -libmp4ff_a-mp4sample.lo: mp4sample.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4sample.lo -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4sample.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4sample.lo `test -f 'mp4sample.c' || echo '$(srcdir)/'`mp4sample.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4sample.Tpo" "$(DEPDIR)/libmp4ff_a-mp4sample.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4sample.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4sample.c' object='libmp4ff_a-mp4sample.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4sample.Plo' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4sample.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4sample.lo `test -f 'mp4sample.c' || echo '$(srcdir)/'`mp4sample.c - -libmp4ff_a-mp4util.o: mp4util.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4util.o -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4util.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4util.o `test -f 'mp4util.c' || echo '$(srcdir)/'`mp4util.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4util.Tpo" "$(DEPDIR)/libmp4ff_a-mp4util.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4util.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4util.c' object='libmp4ff_a-mp4util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4util.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4util.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4util.o `test -f 'mp4util.c' || echo '$(srcdir)/'`mp4util.c - -libmp4ff_a-mp4util.obj: mp4util.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4util.obj -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4util.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4util.obj `if test -f 'mp4util.c'; then $(CYGPATH_W) 'mp4util.c'; else $(CYGPATH_W) '$(srcdir)/mp4util.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4util.Tpo" "$(DEPDIR)/libmp4ff_a-mp4util.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4util.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4util.c' object='libmp4ff_a-mp4util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4util.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4util.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4util.obj `if test -f 'mp4util.c'; then $(CYGPATH_W) 'mp4util.c'; else $(CYGPATH_W) '$(srcdir)/mp4util.c'; fi` - -libmp4ff_a-mp4util.lo: mp4util.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4util.lo -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4util.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4util.lo `test -f 'mp4util.c' || echo '$(srcdir)/'`mp4util.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4util.Tpo" "$(DEPDIR)/libmp4ff_a-mp4util.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4util.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4util.c' object='libmp4ff_a-mp4util.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4util.Plo' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4util.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4util.lo `test -f 'mp4util.c' || echo '$(srcdir)/'`mp4util.c - -libmp4ff_a-mp4tagupdate.o: mp4tagupdate.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4tagupdate.o -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4tagupdate.o `test -f 'mp4tagupdate.c' || echo '$(srcdir)/'`mp4tagupdate.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Tpo" "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4tagupdate.c' object='libmp4ff_a-mp4tagupdate.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4tagupdate.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4tagupdate.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4tagupdate.o `test -f 'mp4tagupdate.c' || echo '$(srcdir)/'`mp4tagupdate.c - -libmp4ff_a-mp4tagupdate.obj: mp4tagupdate.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4tagupdate.obj -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4tagupdate.obj `if test -f 'mp4tagupdate.c'; then $(CYGPATH_W) 'mp4tagupdate.c'; else $(CYGPATH_W) '$(srcdir)/mp4tagupdate.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Tpo" "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4tagupdate.c' object='libmp4ff_a-mp4tagupdate.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4tagupdate.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4tagupdate.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4tagupdate.obj `if test -f 'mp4tagupdate.c'; then $(CYGPATH_W) 'mp4tagupdate.c'; else $(CYGPATH_W) '$(srcdir)/mp4tagupdate.c'; fi` - -libmp4ff_a-mp4tagupdate.lo: mp4tagupdate.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-mp4tagupdate.lo -MD -MP -MF "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-mp4tagupdate.lo `test -f 'mp4tagupdate.c' || echo '$(srcdir)/'`mp4tagupdate.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Tpo" "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-mp4tagupdate.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4tagupdate.c' object='libmp4ff_a-mp4tagupdate.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-mp4tagupdate.Plo' tmpdepfile='$(DEPDIR)/libmp4ff_a-mp4tagupdate.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-mp4tagupdate.lo `test -f 'mp4tagupdate.c' || echo '$(srcdir)/'`mp4tagupdate.c - -libmp4ff_a-drms.o: drms.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-drms.o -MD -MP -MF "$(DEPDIR)/libmp4ff_a-drms.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-drms.o `test -f 'drms.c' || echo '$(srcdir)/'`drms.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-drms.Tpo" "$(DEPDIR)/libmp4ff_a-drms.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-drms.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drms.c' object='libmp4ff_a-drms.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-drms.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-drms.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-drms.o `test -f 'drms.c' || echo '$(srcdir)/'`drms.c - -libmp4ff_a-drms.obj: drms.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-drms.obj -MD -MP -MF "$(DEPDIR)/libmp4ff_a-drms.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-drms.obj `if test -f 'drms.c'; then $(CYGPATH_W) 'drms.c'; else $(CYGPATH_W) '$(srcdir)/drms.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-drms.Tpo" "$(DEPDIR)/libmp4ff_a-drms.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-drms.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drms.c' object='libmp4ff_a-drms.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-drms.Po' tmpdepfile='$(DEPDIR)/libmp4ff_a-drms.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-drms.obj `if test -f 'drms.c'; then $(CYGPATH_W) 'drms.c'; else $(CYGPATH_W) '$(srcdir)/drms.c'; fi` - -libmp4ff_a-drms.lo: drms.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -MT libmp4ff_a-drms.lo -MD -MP -MF "$(DEPDIR)/libmp4ff_a-drms.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4ff_a-drms.lo `test -f 'drms.c' || echo '$(srcdir)/'`drms.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4ff_a-drms.Tpo" "$(DEPDIR)/libmp4ff_a-drms.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4ff_a-drms.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drms.c' object='libmp4ff_a-drms.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4ff_a-drms.Plo' tmpdepfile='$(DEPDIR)/libmp4ff_a-drms.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4ff_a_CFLAGS) $(CFLAGS) -c -o libmp4ff_a-drms.lo `test -f 'drms.c' || echo '$(srcdir)/'`drms.c +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -487,14 +306,23 @@ distclean-libtool: -rm -f libtool uninstall-info-am: +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" + @list='$(include_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ + $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ + done -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ + rm -f "$(DESTDIR)$(includedir)/$$f"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -504,6 +332,7 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -515,10 +344,11 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -541,10 +371,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -558,7 +384,7 @@ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -575,9 +401,11 @@ done check-am: all-am check: check-am -all-am: Makefile $(LIBRARIES) - +all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -604,7 +432,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am @@ -617,13 +445,15 @@ dvi-am: +html: html-am + info: info-am info-am: -install-data-am: +install-data-am: install-includeHEADERS -install-exec-am: +install-exec-am: install-libLTLIBRARIES install-info: install-info-am @@ -649,18 +479,22 @@ ps-am: -uninstall-am: uninstall-info-am +uninstall-am: uninstall-includeHEADERS uninstall-info-am \ + uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES ctags distclean \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-includeHEADERS uninstall-info-am \ + uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/drms.c +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/drms.c @@ -2,7 +2,7 @@ * drms.c: DRMS ***************************************************************************** * Copyright (C) 2004 VideoLAN - * $Id: drms.c,v 1.7 2005/02/01 13:15:55 menno Exp $ + * $Id: drms.c,v 1.6 2004/04/12 18:17:41 menno Exp $ * * Authors: Jon Lech Johansen * Sam Hocevar --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/drms.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/drms.h @@ -2,7 +2,7 @@ * drms.h : DRMS ***************************************************************************** * Copyright (C) 2004 VideoLAN - * $Id: drms.h,v 1.7 2005/02/01 13:15:55 menno Exp $ + * $Id: drms.h,v 1.6 2004/04/12 18:17:41 menno Exp $ * * Author: Jon Lech Johansen * --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/drmstables.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/drmstables.h @@ -2,7 +2,7 @@ * drmstables.h : AES/Rijndael block cipher and miscellaneous tables ***************************************************************************** * Copyright (C) 2004 VideoLAN - * $Id: drmstables.h,v 1.6 2005/02/01 13:15:55 menno Exp $ + * $Id: drmstables.h,v 1.5 2004/04/12 18:17:41 menno Exp $ * * Author: Jon Lech Johansen * --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4atom.c +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4atom.c @@ -22,7 +22,7 @@ ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mp4atom.c,v 1.22 2005/02/01 13:15:55 menno Exp $ +** $Id: mp4atom.c,v 1.21 2004/05/17 10:18:02 menno Exp $ **/ #include --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4ff.c +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4ff.c @@ -22,7 +22,7 @@ ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mp4ff.c,v 1.17 2005/02/01 13:15:55 menno Exp $ +** $Id: mp4ff.c,v 1.16 2004/03/27 11:14:48 menno Exp $ **/ #include --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4ff.dsp +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4ff.dsp @@ -0,0 +1,144 @@ +# Microsoft Developer Studio Project File - Name="mp4ff" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=mp4ff - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mp4ff.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mp4ff.mak" CFG="mp4ff - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mp4ff - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "mp4ff - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "mp4ff - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +F90=df.exe +MTL=midl.exe +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_TAGGING" /YX /FD /c +# ADD BASE RSC /l 0x413 /d "NDEBUG" +# ADD RSC /l 0x413 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "mp4ff - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +F90=df.exe +MTL=midl.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_TAGGING" /YX /FD /GZ /c +# ADD BASE RSC /l 0x413 /d "_DEBUG" +# ADD RSC /l 0x413 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "mp4ff - Win32 Release" +# Name "mp4ff - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\drms.c +# End Source File +# Begin Source File + +SOURCE=.\mp4atom.c +# End Source File +# Begin Source File + +SOURCE=.\mp4ff.c +# End Source File +# Begin Source File + +SOURCE=.\mp4meta.c +# End Source File +# Begin Source File + +SOURCE=.\mp4sample.c +# End Source File +# Begin Source File + +SOURCE=.\mp4tagupdate.c +# End Source File +# Begin Source File + +SOURCE=.\mp4util.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\drms.h +# End Source File +# Begin Source File + +SOURCE=.\drmstables.h +# End Source File +# Begin Source File + +SOURCE=.\mp4ff.h +# End Source File +# Begin Source File + +SOURCE=.\mp4ff_int_types.h +# End Source File +# Begin Source File + +SOURCE=.\mp4ffint.h +# End Source File +# End Group +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4ff.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4ff.h @@ -22,7 +22,7 @@ ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mp4ff.h,v 1.22 2005/02/01 13:15:55 menno Exp $ +** $Id: mp4ff.h,v 1.21 2004/09/03 19:38:58 menno Exp $ **/ #ifndef MP4FF_H --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4ff.vcproj +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4ff.vcproj @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4ff_int_types.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4ff_int_types.h @@ -1,7 +1,7 @@ #ifndef _MP4FF_INT_TYPES_H_ #define _MP4FF_INT_TYPES_H_ -#if defined (_WIN32) +#ifdef _WIN32 typedef char int8_t; typedef unsigned char uint8_t; @@ -20,4 +20,4 @@ #endif -#endif +#endif \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4ffint.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4ffint.h @@ -22,7 +22,7 @@ ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mp4ffint.h,v 1.19 2005/02/01 13:15:55 menno Exp $ +** $Id: mp4ffint.h,v 1.18 2004/04/12 18:17:42 menno Exp $ **/ #ifndef MP4FF_INTERNAL_H @@ -33,7 +33,7 @@ #endif /* __cplusplus */ #include "mp4ff_int_types.h" -#include + #if defined(_WIN32) && !defined(_WIN32_WCE) #define ITUNES_DRM @@ -81,6 +81,7 @@ #define FOURCC_priv VLC_FOURCC( 'p', 'r', 'i', 'v' ) #endif + #define MAX_TRACKS 1024 #define TRACK_UNKNOWN 0 #define TRACK_AUDIO 1 @@ -152,14 +153,11 @@ #define ATOM_SCHI 25 #ifdef HAVE_CONFIG_H -#include "../../config.h" +#include "../../config.h" #endif #if !(defined(_WIN32) || defined(_WIN32_WCE)) #define stricmp strcasecmp -#else -#define stricmp _stricmp -#define strdup _strdup #endif /* file callback structure */ @@ -372,4 +370,4 @@ } #endif /* __cplusplus */ -#endif +#endif \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4meta.c +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4meta.c @@ -22,7 +22,7 @@ ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mp4meta.c,v 1.16 2005/02/01 13:15:55 menno Exp $ +** $Id: mp4meta.c,v 1.15 2004/09/03 19:38:58 menno Exp $ **/ #ifdef USE_TAGGING @@ -300,8 +300,6 @@ while (sumsize < size) { subsize = mp4ff_atom_read_header(f, &atom_type, &header_size); - if (subsize == 0) - break; mp4ff_parse_tag(f, atom_type, (uint32_t)(subsize-header_size)); sumsize += subsize; } --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4sample.c +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4sample.c @@ -22,7 +22,7 @@ ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mp4sample.c,v 1.17 2005/02/01 13:15:55 menno Exp $ +** $Id: mp4sample.c,v 1.16 2004/03/27 11:14:49 menno Exp $ **/ #include --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4tagupdate.c +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4tagupdate.c @@ -529,7 +529,7 @@ { udta_offset = mp4ff_position(f); udta_size = mp4ff_read_int32(f); - if (!find_atom_v2(f,udta_offset+8,udta_size-8,"meta",4,"ilst")) + if (find_atom_v2(f,udta_offset+8,udta_size-8,"meta",4,"ilst")<2) { membuffer * buf; void * new_meta_buffer; --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4ff/mp4util.c +++ vlc-0.8.4.debian/extras/faad2/common/mp4ff/mp4util.c @@ -22,7 +22,7 @@ ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mp4util.c,v 1.17 2005/02/01 13:15:55 menno Exp $ +** $Id: mp4util.c,v 1.16 2004/03/27 11:14:49 menno Exp $ **/ #include "mp4ffint.h" --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/API_CHANGES +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/API_CHANGES @@ -0,0 +1,85 @@ +Changes from 0.9.4 to 0.9.5 +--------------------------- +Added + MP4GetTrackAudioMpeg4Type() + Returns MPEG-4 Audio type (e.g. AAC, CELP, HXVC, MIDI, etc.) + MP4ReadSampleFromTime() + Variant of MP4ReadSample() that uses time instead of sample id + (basically MP4GetSampleIdFromTime() + MP4ReadSample()) + MP4Info() + MP4FileInfo() + Returns summary info on tracks in file (from util/mp4info.cpp) + + The following functions add support for mp4 authoring/editting: + + MP4CloneTrack() + Make a copy of a specified track, without media samples + MP4CopyTrack() + Make a copy of a specified track, with or without media samples + MP4CopySample() + Make a copy of a specified media sample + + MP4AddTrackEdit() + Add a track edit list element + MP4DeleteTrackEdit() + Delete a track edit list element + MP4GetTrackNumberOfEdits() + Return the number of track edit list elements + MP4GetTrackEditTotalDuration() + Return the total duration of the track edit list + MP4GetTrackEditStart() + Return the edit start time for the edit list element + MP4GetTrackEditMediaStart() + Return the media start time for the edit list element + MP4SetTrackEditMediaStart() + Set the media start time for the edit list element + MP4GetTrackEditDuration() + Return the edit list element duration + MP4SetTrackEditDuration() + Set the edit list element duration + MP4GetTrackEditDwell() + Return the edit list element dwell parameter, see man page + MP4SetTrackEditDwell() + Set the edit list element dwell parameter, see man page + MP4ReadSampleFromEditTime() + Apply the edit list timeline to reading a sample + MP4GetSampleIdFromEditTime() + Return the sample id for a specified time on the edit list timeline + +Modified + MP4GetSampleIdFromTime() + Semantic change - now returns sample id corresponding + to specified time, not the sample id with the smallest positive + start time difference from the specified time. + + +Changes from 0.9.3 to 0.9.4 +--------------------------- +Added + MP4GetTrackVideoFrameRate() + Returns video frame rate (average rate if video is variable rate). + + MP4GetTrackBitRate() + Returns track average bit rate in bits-per-second. + +Changes from 0.9.2 to 0.9.3 +--------------------------- +Modified + MP4Optimize() + Second argument, newFileName, can now be NULL in which case + a temporary file is created for the results of the optimization. + Upon success, the existing file specified with the first argument + is overwritten with the optimized file. + + MP4GetNumberOfTracks() + MP4FindTrackId() + Both have a new optional argument, subType, with default value 0. + The subType can be specified for audio and video tracks to + match only a specific encoding type. See man page for more details. + +Added + MP4GetTrackVideoWidth() + Returns video width in pixels. See man page for caveat. + + MP4GetTrackVideoHeight() + Returns video height in pixels. See man page for caveat. --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/COPYING +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/COPYING @@ -0,0 +1,471 @@ + + MOZILLA PUBLIC LICENSE + Version 1.1 + + --------------- + +1. Definitions. + + 1.0.1. "Commercial Use" means distribution or otherwise making the + Covered Code available to a third party. + + 1.1. "Contributor" means each entity that creates or contributes to + the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Code, prior Modifications used by a Contributor, and the Modifications + made by that particular Contributor. + + 1.3. "Covered Code" means the Original Code or Modifications or the + combination of the Original Code and Modifications, in each case + including portions thereof. + + 1.4. "Electronic Distribution Mechanism" means a mechanism generally + accepted in the software development community for the electronic + transfer of data. + + 1.5. "Executable" means Covered Code in any form other than Source + Code. + + 1.6. "Initial Developer" means the individual or entity identified + as the Initial Developer in the Source Code notice required by Exhibit + A. + + 1.7. "Larger Work" means a work which combines Covered Code or + portions thereof with code not governed by the terms of this License. + + 1.8. "License" means this document. + + 1.8.1. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means any addition to or deletion from the + substance or structure of either the Original Code or any previous + Modifications. When Covered Code is released as a series of files, a + Modification is: + A. Any addition to or deletion from the contents of a file + containing Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or + previous Modifications. + + 1.10. "Original Code" means Source Code of computer software code + which is described in the Source Code notice required by Exhibit A as + Original Code, and which, at the time of its release under this + License is not already Covered Code governed by this License. + + 1.10.1. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, process, + and apparatus claims, in any patent Licensable by grantor. + + 1.11. "Source Code" means the preferred form of the Covered Code for + making modifications to it, including all modules it contains, plus + any associated interface definition files, scripts used to control + compilation and installation of an Executable, or source code + differential comparisons against either the Original Code or another + well known, available Covered Code of the Contributor's choice. The + Source Code can be in a compressed or archival form, provided the + appropriate decompression or de-archiving software is widely available + for no charge. + + 1.12. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms of, this + License or a future version of this License issued under Section 6.1. + For legal entities, "You" includes any entity which controls, is + controlled by, or is under common control with You. For purposes of + this definition, "control" means (a) the power, direct or indirect, + to cause the direction or management of such entity, whether by + contract or otherwise, or (b) ownership of more than fifty percent + (50%) of the outstanding shares or beneficial ownership of such + entity. + +2. Source Code License. + + 2.1. The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer to use, reproduce, + modify, display, perform, sublicense and distribute the Original + Code (or portions thereof) with or without Modifications, and/or + as part of a Larger Work; and + + (b) under Patents Claims infringed by the making, using or + selling of Original Code, to make, have made, use, practice, + sell, and offer for sale, and/or otherwise dispose of the + Original Code (or portions thereof). + + (c) the licenses granted in this Section 2.1(a) and (b) are + effective on the date Initial Developer first distributes + Original Code under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: 1) for code that You delete from the Original Code; 2) + separate from the Original Code; or 3) for infringements caused + by: i) the modification of the Original Code or ii) the + combination of the Original Code with other software or devices. + + 2.2. Contributor Grant. + Subject to third party intellectual property claims, each Contributor + hereby grants You a world-wide, royalty-free, non-exclusive license + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor, to use, reproduce, modify, + display, perform, sublicense and distribute the Modifications + created by such Contributor (or portions thereof) either on an + unmodified basis, with other Modifications, as Covered Code + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or + selling of Modifications made by that Contributor either alone + and/or in combination with its Contributor Version (or portions + of such combination), to make, use, sell, offer for sale, have + made, and/or otherwise dispose of: 1) Modifications made by that + Contributor (or portions thereof); and 2) the combination of + Modifications made by that Contributor with its Contributor + Version (or portions of such combination). + + (c) the licenses granted in Sections 2.2(a) and 2.2(b) are + effective on the date Contributor first makes Commercial Use of + the Covered Code. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: 1) for any code that Contributor has deleted from the + Contributor Version; 2) separate from the Contributor Version; + 3) for infringements caused by: i) third party modifications of + Contributor Version or ii) the combination of Modifications made + by that Contributor with other software (except as part of the + Contributor Version) or other devices; or 4) under Patent Claims + infringed by Covered Code in the absence of Modifications made by + that Contributor. + +3. Distribution Obligations. + + 3.1. Application of License. + The Modifications which You create or to which You contribute are + governed by the terms of this License, including without limitation + Section 2.2. The Source Code version of Covered Code may be + distributed only under the terms of this License or a future version + of this License released under Section 6.1, and You must include a + copy of this License with every copy of the Source Code You + distribute. You may not offer or impose any terms on any Source Code + version that alters or restricts the applicable version of this + License or the recipients' rights hereunder. However, You may include + an additional document offering the additional rights described in + Section 3.5. + + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be + made available in Source Code form under the terms of this License + either on the same media as an Executable version or via an accepted + Electronic Distribution Mechanism to anyone to whom you made an + Executable version available; and if made available via Electronic + Distribution Mechanism, must remain available for at least twelve (12) + months after the date it initially became available, or at least six + (6) months after a subsequent version of that particular Modification + has been made available to such recipients. You are responsible for + ensuring that the Source Code version remains available even if the + Electronic Distribution Mechanism is maintained by a third party. + + 3.3. Description of Modifications. + You must cause all Covered Code to which You contribute to contain a + file documenting the changes You made to create that Covered Code and + the date of any change. You must include a prominent statement that + the Modification is derived, directly or indirectly, from Original + Code provided by the Initial Developer and including the name of the + Initial Developer in (a) the Source Code, and (b) in any notice in an + Executable version or related documentation in which You describe the + origin or ownership of the Covered Code. + + 3.4. Intellectual Property Matters + (a) Third Party Claims. + If Contributor has knowledge that a license under a third party's + intellectual property rights is required to exercise the rights + granted by such Contributor under Sections 2.1 or 2.2, + Contributor must include a text file with the Source Code + distribution titled "LEGAL" which describes the claim and the + party making the claim in sufficient detail that a recipient will + know whom to contact. If Contributor obtains such knowledge after + the Modification is made available as described in Section 3.2, + Contributor shall promptly modify the LEGAL file in all copies + Contributor makes available thereafter and shall take other steps + (such as notifying appropriate mailing lists or newsgroups) + reasonably calculated to inform those who received the Covered + Code that new knowledge has been obtained. + + (b) Contributor APIs. + If Contributor's Modifications include an application programming + interface and Contributor has knowledge of patent licenses which + are reasonably necessary to implement that API, Contributor must + also include this information in the LEGAL file. + + (c) Representations. + Contributor represents that, except as disclosed pursuant to + Section 3.4(a) above, Contributor believes that Contributor's + Modifications are Contributor's original creation(s) and/or + Contributor has sufficient rights to grant the rights conveyed by + this License. + + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source + Code. If it is not possible to put such notice in a particular Source + Code file due to its structure, then You must include such notice in a + location (such as a relevant directory) where a user would be likely + to look for such a notice. If You created one or more Modification(s) + You may add your name as a Contributor to the notice described in + Exhibit A. You must also duplicate this License in any documentation + for the Source Code where You describe recipients' rights or ownership + rights relating to Covered Code. You may choose to offer, and to + charge a fee for, warranty, support, indemnity or liability + obligations to one or more recipients of Covered Code. However, You + may do so only on Your own behalf, and not on behalf of the Initial + Developer or any Contributor. You must make it absolutely clear than + any such warranty, support, indemnity or liability obligation is + offered by You alone, and You hereby agree to indemnify the Initial + Developer and every Contributor for any liability incurred by the + Initial Developer or such Contributor as a result of warranty, + support, indemnity or liability terms You offer. + + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the + requirements of Section 3.1-3.5 have been met for that Covered Code, + and if You include a notice stating that the Source Code version of + the Covered Code is available under the terms of this License, + including a description of how and where You have fulfilled the + obligations of Section 3.2. The notice must be conspicuously included + in any notice in an Executable version, related documentation or + collateral in which You describe recipients' rights relating to the + Covered Code. You may distribute the Executable version of Covered + Code or ownership rights under a license of Your choice, which may + contain terms different from this License, provided that You are in + compliance with the terms of this License and that the license for the + Executable version does not attempt to limit or alter the recipient's + rights in the Source Code version from the rights set forth in this + License. If You distribute the Executable version under a different + license You must make it absolutely clear that any terms which differ + from this License are offered by You alone, not by the Initial + Developer or any Contributor. You hereby agree to indemnify the + Initial Developer and every Contributor for any liability incurred by + the Initial Developer or such Contributor as a result of any such + terms You offer. + + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code + not governed by the terms of this License and distribute the Larger + Work as a single product. In such a case, You must make sure the + requirements of this License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. + + If it is impossible for You to comply with any of the terms of this + License with respect to some or all of the Covered Code due to + statute, judicial order, or regulation then You must: (a) comply with + the terms of this License to the maximum extent possible; and (b) + describe the limitations and the code they affect. Such description + must be included in the LEGAL file described in Section 3.4 and must + be included with all distributions of the Source Code. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Application of this License. + + This License applies to code to which the Initial Developer has + attached the notice in Exhibit A and to related Covered Code. + +6. Versions of the License. + + 6.1. New Versions. + Netscape Communications Corporation ("Netscape") may publish revised + and/or new versions of the License from time to time. Each version + will be given a distinguishing version number. + + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of the + License, You may always continue to use it under the terms of that + version. You may also choose to use such Covered Code under the terms + of any subsequent version of the License published by Netscape. No one + other than Netscape has the right to modify the terms applicable to + Covered Code created under this License. + + 6.3. Derivative Works. + If You create or use a modified version of this License (which you may + only do in order to apply it to code which is not already Covered Code + governed by this License), You must (a) rename Your license so that + the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", + "MPL", "NPL" or any confusingly similar phrase do not appear in your + license (except to note that your license differs from this License) + and (b) otherwise make it clear that Your version of the license + contains terms which differ from the Mozilla Public License and + Netscape Public License. (Filling in the name of the Initial + Developer, Original Code or Contributor in the notice described in + Exhibit A shall not of themselves be deemed to be modifications of + this License.) + +7. DISCLAIMER OF WARRANTY. + + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF + DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. + THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE + IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, + YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE + COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER + OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +8. TERMINATION. + + 8.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to cure + such breach within 30 days of becoming aware of the breach. All + sublicenses to the Covered Code which are properly granted shall + survive any termination of this License. Provisions which, by their + nature, must remain in effect beyond the termination of this License + shall survive. + + 8.2. If You initiate litigation by asserting a patent infringement + claim (excluding declatory judgment actions) against Initial Developer + or a Contributor (the Initial Developer or Contributor against whom + You file such action is referred to as "Participant") alleging that: + + (a) such Participant's Contributor Version directly or indirectly + infringes any patent, then any and all rights granted by such + Participant to You under Sections 2.1 and/or 2.2 of this License + shall, upon 60 days notice from Participant terminate prospectively, + unless if within 60 days after receipt of notice You either: (i) + agree in writing to pay Participant a mutually agreeable reasonable + royalty for Your past and future use of Modifications made by such + Participant, or (ii) withdraw Your litigation claim with respect to + the Contributor Version against such Participant. If within 60 days + of notice, a reasonable royalty and payment arrangement are not + mutually agreed upon in writing by the parties or the litigation claim + is not withdrawn, the rights granted by Participant to You under + Sections 2.1 and/or 2.2 automatically terminate at the expiration of + the 60 day notice period specified above. + + (b) any software, hardware, or device, other than such Participant's + Contributor Version, directly or indirectly infringes any patent, then + any rights granted to You by such Participant under Sections 2.1(b) + and 2.2(b) are revoked effective as of the date You first made, used, + sold, distributed, or had made, Modifications made by that + Participant. + + 8.3. If You assert a patent infringement claim against Participant + alleging that such Participant's Contributor Version directly or + indirectly infringes any patent where such claim is resolved (such as + by license or settlement) prior to the initiation of patent + infringement litigation, then the reasonable value of the licenses + granted by such Participant under Sections 2.1 or 2.2 shall be taken + into account in determining the amount or value of any payment or + license. + + 8.4. In the event of termination under Sections 8.1 or 8.2 above, + all end user license agreements (excluding distributors and resellers) + which have been validly granted by You or any distributor hereunder + prior to termination shall survive termination. + +9. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL + DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, + OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR + ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY + CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, + WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY + RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW + PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE + EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO + THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. + + The Covered Code is a "commercial item," as that term is defined in + 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer + software" and "commercial computer software documentation," as such + terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 + C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), + all U.S. Government End Users acquire Covered Code with only those + rights set forth herein. + +11. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + California law provisions (except to the extent applicable law, if + any, provides otherwise), excluding its conflict-of-law provisions. + With respect to disputes in which at least one party is a citizen of, + or an entity chartered or registered to do business in the United + States of America, any litigation relating to this License shall be + subject to the jurisdiction of the Federal Courts of the Northern + District of California, with venue lying in Santa Clara County, + California, with the losing party responsible for costs, including + without limitation, court costs and reasonable attorneys' fees and + expenses. The application of the United Nations Convention on + Contracts for the International Sale of Goods is expressly excluded. + Any law or regulation which provides that the language of a contract + shall be construed against the drafter shall not apply to this + License. + +12. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or indirectly, + out of its utilization of rights under this License and You agree to + work with Initial Developer and Contributors to distribute such + responsibility on an equitable basis. Nothing herein is intended or + shall be deemed to constitute any admission of liability. + +13. MULTIPLE-LICENSED CODE. + + Initial Developer may designate portions of the Covered Code as + "Multiple-Licensed". "Multiple-Licensed" means that the Initial + Developer permits you to utilize portions of the Covered Code under + Your choice of the NPL or the alternative licenses, if any, specified + by the Initial Developer in the file described in Exhibit A. + +EXHIBIT A -Mozilla Public License. + + ``The contents of this file are subject to the Mozilla Public License + Version 1.1 (the "License"); you may not use this file except in + compliance with the License. You may obtain a copy of the License at + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + License for the specific language governing rights and limitations + under the License. + + The Original Code is ______________________________________. + + The Initial Developer of the Original Code is ________________________. + Portions created by ______________________ are Copyright (C) ______ + _______________________. All Rights Reserved. + + Contributor(s): ______________________________________. + + Alternatively, the contents of this file may be used under the terms + of the _____ license (the "[___] License"), in which case the + provisions of [______] License are applicable instead of those + above. If you wish to allow use of your version of this file only + under the terms of the [____] License and not to allow others to use + your version of this file under the MPL, indicate your decision by + deleting the provisions above and replace them with the notice and + other provisions required by the [___] License. If you do not delete + the provisions above, a recipient may use your version of this file + under either the MPL or the [___] License." + + [NOTE: The text of this Exhibit A may differ slightly from the text of + the notices in the Source Code files of the Original Code. You should + use the text of this Exhibit A rather than the text found in the + Original Code Source Code for Your Modifications.] + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/INTERNALS +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/INTERNALS @@ -0,0 +1,209 @@ +January 7, 2002 + +MP4V2 LIBRARY INTERNALS +======================= + +This document provides an overview of the interals of the mp4v2 library +to aid those who wish to modify and extend it. Before reading this document, +I recommend familiarizing yourself with the MP4 (or Quicktime) file format +standard and the mp4v2 library API. The API is described in a set of man pages +in mpeg4ip/doc/mp4v2, or if you prefer by looking at mp4.h. + +All the library code is written in C++, however the library API follows uses +C calling conventions hence is linkable by both C and C++ programs. The +library has been compiled and used on Linux, BSD, Windows, and Mac OS X. +Other than libc, the library has no external dependencies, and hence can +be used independently of the mpeg4ip package if desired. The library is +used for both real-time recording and playback in mpeg4ip, and its runtime +performance is up to those tasks. On the IA32 architecture compiled with gcc, +the stripped library is approximately 600 KB code and initialized data. + +It is useful to think of the mp4v2 library as consisting of four layers: +infrastructure, file format, generic tracks, and type specific track helpers. +A description of each layer follows, from the fundamental to the optional. + + +Infrastructure +============== + +The infrastructure layer provides basic file I/O, memory allocation, +error handling, string utilities, and protected arrays. The source files +for this layer are mp4file_io, mp4util, and mp4array. + +Note that the array classes uses preprocessor macros instead of C++ +templates. The rationale for this is to increase portability given the +sometimes incomplete support by some compilers for templates. + + +File Format +=========== + +The file format layer provides the translation from the on-disk MP4 file +format to in-memory C++ structures and back to disk. It is intended +to exactly match the MP4 specification in syntax and semantics. It +represents the majority of the code. + +There are three key structures at the file format layer: atoms, properties, +and descriptors. + +Atoms are the primary containers within an mp4 file. They can contain +any combination of properties, other atoms, or descriptors. + +The mp4atom files contain the base class for all the atoms, and provide +generic functions that cover most cases. However, each atom has it's own +subclass contained in file atom_.cpp, where is the four +letter name of the atom defined in the MP4 specification. Typically this +atom file just specifies the properties of the atom or the possible child +atoms in the case of a container atom. In more specialized cases the atom +specific file provides routines to initialize, read, or write the atom. + +Properties are the atomic pieces of information. The basic types of +properties are integers, floats, strings, and byte arrays. For integers +and floats there are subclasses that represent the different storage sizes, +e.g. 8, 16, 24, 32, and 64 bit integers. For strings, there is 1 property +class with a number of options regarding exact storage details, e.g. null +terminated, fixed length, counted. + +For implementation reasons, there are also two special properties, table +and descriptor, that are actually containers for groups of properties. +I.e by making these containers provide a property interface much code can +be written in a generic fashion. + +The mp4property files contain all the property related classes. + +Descriptors are containers that derive from the MPEG conventions and use +different encoding rules than the atoms derived from the QuickTime file +format. This means more use of bitfields and conditional existence with +an emphasis on bit efficiency at the cost of encoding/decoding complexity. +Descriptors can contain other descriptors and/or properties. + +The mp4descriptor files contain the generic base class for descriptors. +Also the mp4property files have a descriptor wrapper class that allows a +descriptor to behave as if it were a property. The specific descriptors +are implemented as subclasses of the base class descriptor in manner similar +to that of atoms. The descriptors, ocidescriptors, and qosqualifiers files +contain these implementations. + +Each atom/property/descriptor has a name closely related to that in the +MP4 specification. The difference being that the mp4v2 library doesn't +use '-' or '_' in property names and capitalizes the first letter of each +word, e.g. "thisIsAPropertyName". A complete name specifies the complete +container path. The names follow the C/C++ syntax for elements and array +indices. + +Examples are: + "moov.mvhd.duration" + "moov.trak[2].tkhd.duration" + "moov.trak[3].minf.mdia.stbl.stsz[101].sampleSize" + +Note "*" can be used as a wildcard for an atom name (only). This is most +useful when dealing with the stsd atom which contains child atoms with +various names, but shared property names. + +Note that internally when performance matters the code looks up a property +by name once, and then stores the returned pointer to the property class. + + +Generic Tracks +============== + +The two entities at this level are the mp4 file as a whole and the tracks +which are contained with it. The mp4file and mp4track files contain the +implementation. + +The critical work done by this layer is to map the collection of atoms, +properties, and descriptors that represent a media track into a useful, +and consistent set of operations. For example, reading or writing a media +sample of a track is a relatively simple operation from the library API +perspective. However there are numerous pieces of information in the mp4 +file that need to be properly used and updated to do this. This layer +handles all those details. + +Given familiarity with the mp4 spec, the code should be straight-forward. +What may not be immediately obvious are the functions to handle chunks of +media samples. These exist to allow optimization of the mp4 file layout by +reordering the chunks on disk to interleave the media sample chunks of +multiple tracks in time order. (See MP4Optimize API doc). + + +Type Specific Track Helpers +=========================== + +This specialized code goes beyond the meta-information about tracks in +the mp4 file to understanding and manipulating the information in the +track samples. There are currently two helpers in the library: +the MPEG-4 Systems Helper, and the RTP Hint Track Helper. + +The MPEG-4 Systems Helper is currently limited to creating the OD, BIFS, +and SDP information about a minimal audio/video scene consistent with +the Internet Streaming Media Alliance (ISMA) specifications. We will be +evaluating how best to generalize the library's helper functions for +MPEG-4 Systems without overburdening the implementation. The code for +this helper is found in the isma and odcommands files. + +The RTP Hint Track Helper is more extensive in its support. The hint +tracks contain the track packetization information needed to build +RTP packets for streaming. The library can construct RTP packets based +on the hint track making RTP based servers significantly easier to write. + +All code related to rtp hint tracks is in the rtphint files. It would also +be useful to look at test/mp4broadcaster and mpeg4ip/server/mp4creator for +examples of how this part of the library API can be used. + + +Library API +=========== + +The library API is defined and implemented in the mp4 files. The API uses +C linkage conventions, and the mp4.h file adapts itself according to whether +C or C++ is the compilation mode. + +All API calls are implemented in mp4.cpp and basically pass thru's to the +MP4File member functions. This ensures that the library has internal access +to the same functions as available via the API. All the calls in mp4.cpp use +C++ try/catch blocks to protect against any runtime errors in the library. +Upon error the library will print a diagnostic message if the verbostiy level +has MP4_DETAILS_ERROR set, and return a distinguished error value, typically +0 or -1. + +The test and util subdirectories contain useful examples of how to +use the library. Also the mp4creator and mp4live programs within +mpeg4ip demonstrate more complete usage of the library API. + + +Debugging +========= + +Since mp4 files are fairly complicated, extensive debugging support is +built into the library. Multi-level diagnostic messages are available +under the control of a verbosity bitmask described in the API. + +Also the library provides the MP4Dump() call which provides an ASCII +version of the mp4 file meta-information. The mp4dump utilitity is a +wrapper executable around this function. + +The mp4extract program is also provided in the utilities directory +which is useful for extracting a track from an mp4file and putting the +media data back into it's own file. It can also extract each sample of +a track into its own file it that is desired. + +When all else fails, mp4 files are amenable to debugging by direct +examination. Since the atom names are four letter ASCII codes finding +reference points in a hex dump is feasible. On UNIX, the od command +is your friend: "od -t x1z -A x [-j 0xXXXXXX] foo.mp4" will print +a hex and ASCII dump, with hex addresses, starting optionally from +a specified offset. The library diagnostic messages can provide +information on where the library is reading or writing. + + +General caveats +=============== + +The coding convention is to use the C++ throw operator whenever an +unrecoverable error occurs. This throw is caught at the API layer +in mp4.cpp and translated into an error value. + +Be careful about indices. Internally, we follow the C/C++ convention +to use zero-based indices. However the MP4 spec uses one-based indices +for things like samples and hence the library API uses this convention. + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/Makefile.am +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/Makefile.am @@ -0,0 +1,128 @@ +INCLUDES = -I$(top_srcdir)/include + +AM_CXXFLAGS = -Wall + +lib_LTLIBRARIES = libmp4v2.la + +include_HEADERS = mp4.h mpeg4ip.h systems.h + +libmp4v2_la_SOURCES = \ + atom_co64.cpp \ + atom_cprt.cpp \ + atom_ctts.cpp \ + atom_dimm.cpp \ + atom_dinf.cpp \ + atom_dmax.cpp \ + atom_dmed.cpp \ + atom_dref.cpp \ + atom_drep.cpp \ + atom_edts.cpp \ + atom_elst.cpp \ + atom_enca.cpp \ + atom_encv.cpp \ + atom_esds.cpp \ + atom_free.cpp \ + atom_frma.cpp \ + atom_ftyp.cpp \ + atom_hdlr.cpp \ + atom_hinf.cpp \ + atom_hmhd.cpp \ + atom_hnti.cpp \ + atom_iKMS.cpp \ + atom_iSFM.cpp \ + atom_iods.cpp \ + atom_maxr.cpp \ + atom_mdat.cpp \ + atom_mdhd.cpp \ + atom_mdia.cpp \ + atom_meta.cpp \ + atom_mfhd.cpp \ + atom_minf.cpp \ + atom_moof.cpp \ + atom_moov.cpp \ + atom_mp4a.cpp \ + atom_mp4s.cpp \ + atom_mp4v.cpp \ + atom_mvex.cpp \ + atom_mvhd.cpp \ + atom_nmhd.cpp \ + atom_nump.cpp \ + atom_payt.cpp \ + atom_pmax.cpp \ + atom_root.cpp \ + atom_rtp.cpp \ + atom_schi.cpp \ + atom_schm.cpp \ + atom_sdp.cpp \ + atom_sinf.cpp \ + atoms.h \ + atom_smhd.cpp \ + atom_snro.cpp \ + atom_stbl.cpp \ + atom_stco.cpp \ + atom_stdp.cpp \ + atom_stsc.cpp \ + atom_stsd.cpp \ + atom_stsh.cpp \ + atom_stss.cpp \ + atom_stsz.cpp \ + atom_stts.cpp \ + atom_tfhd.cpp \ + atom_tims.cpp \ + atom_tkhd.cpp \ + atom_tmax.cpp \ + atom_tmin.cpp \ + atom_tpyl.cpp \ + atom_traf.cpp \ + atom_trak.cpp \ + atom_tref.cpp \ + atom_treftype.cpp \ + atom_trex.cpp \ + atom_trpy.cpp \ + atom_trun.cpp \ + atom_tsro.cpp \ + atom_udta.cpp \ + atom_url.cpp \ + atom_urn.cpp \ + atom_vmhd.cpp \ + descriptors.cpp \ + descriptors.h \ + isma.cpp \ + mp4array.h \ + mp4atom.cpp \ + mp4atom.h \ + mp4common.h \ + mp4container.cpp \ + mp4container.h \ + mp4.h \ + mp4.cpp \ + mp4descriptor.cpp \ + mp4descriptor.h \ + mp4file.cpp \ + mp4file.h \ + mp4file_io.cpp \ + mp4info.cpp \ + mp4meta.cpp \ + mp4property.cpp \ + mp4property.h \ + mp4track.cpp \ + mp4track.h \ + mp4util.cpp \ + mp4util.h \ + ocidescriptors.cpp \ + ocidescriptors.h \ + odcommands.cpp \ + odcommands.h \ + qosqualifiers.cpp \ + qosqualifiers.h \ + rtphint.cpp \ + rtphint.h + +EXTRA_DIST = API_CHANGES \ + INTERNALS \ + libmp4v260.dsp \ + libmp4v2_st60.dsp \ + TODO + +LIBTOOL_DEPS = +LIBS = --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/Makefile.in @@ -0,0 +1,812 @@ +# Makefile.in generated by automake 1.8.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +SOURCES = $(libmp4v2_la_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +subdir = common/mp4v2 +DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in COPYING TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libmp4v2_la_LIBADD = +am_libmp4v2_la_OBJECTS = atom_co64.lo atom_cprt.lo atom_ctts.lo \ + atom_dimm.lo atom_dinf.lo atom_dmax.lo atom_dmed.lo \ + atom_dref.lo atom_drep.lo atom_edts.lo atom_elst.lo \ + atom_enca.lo atom_encv.lo atom_esds.lo atom_free.lo \ + atom_frma.lo atom_ftyp.lo atom_hdlr.lo atom_hinf.lo \ + atom_hmhd.lo atom_hnti.lo atom_iKMS.lo atom_iSFM.lo \ + atom_iods.lo atom_maxr.lo atom_mdat.lo atom_mdhd.lo \ + atom_mdia.lo atom_meta.lo atom_mfhd.lo atom_minf.lo \ + atom_moof.lo atom_moov.lo atom_mp4a.lo atom_mp4s.lo \ + atom_mp4v.lo atom_mvex.lo atom_mvhd.lo atom_nmhd.lo \ + atom_nump.lo atom_payt.lo atom_pmax.lo atom_root.lo \ + atom_rtp.lo atom_schi.lo atom_schm.lo atom_sdp.lo atom_sinf.lo \ + atom_smhd.lo atom_snro.lo atom_stbl.lo atom_stco.lo \ + atom_stdp.lo atom_stsc.lo atom_stsd.lo atom_stsh.lo \ + atom_stss.lo atom_stsz.lo atom_stts.lo atom_tfhd.lo \ + atom_tims.lo atom_tkhd.lo atom_tmax.lo atom_tmin.lo \ + atom_tpyl.lo atom_traf.lo atom_trak.lo atom_tref.lo \ + atom_treftype.lo atom_trex.lo atom_trpy.lo atom_trun.lo \ + atom_tsro.lo atom_udta.lo atom_url.lo atom_urn.lo atom_vmhd.lo \ + descriptors.lo isma.lo mp4atom.lo mp4container.lo mp4.lo \ + mp4descriptor.lo mp4file.lo mp4file_io.lo mp4info.lo \ + mp4meta.lo mp4property.lo mp4track.lo mp4util.lo \ + ocidescriptors.lo odcommands.lo qosqualifiers.lo rtphint.lo +libmp4v2_la_OBJECTS = $(am_libmp4v2_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/atom_co64.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_cprt.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_ctts.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_dimm.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_dinf.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_dmax.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_dmed.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_dref.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_drep.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_edts.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_elst.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_enca.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_encv.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_esds.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_free.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_frma.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_ftyp.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_hdlr.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_hinf.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_hmhd.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_hnti.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_iKMS.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_iSFM.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_iods.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_maxr.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_mdat.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_mdhd.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_mdia.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_meta.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_mfhd.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_minf.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_moof.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_moov.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_mp4a.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_mp4s.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_mp4v.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_mvex.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_mvhd.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_nmhd.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_nump.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_payt.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_pmax.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_root.Plo ./$(DEPDIR)/atom_rtp.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_schi.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_schm.Plo ./$(DEPDIR)/atom_sdp.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_sinf.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_smhd.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_snro.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_stbl.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_stco.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_stdp.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_stsc.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_stsd.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_stsh.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_stss.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_stsz.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_stts.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_tfhd.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_tims.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_tkhd.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_tmax.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_tmin.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_tpyl.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_traf.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_trak.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_tref.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_treftype.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_trex.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_trpy.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_trun.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_tsro.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_udta.Plo ./$(DEPDIR)/atom_url.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/atom_urn.Plo ./$(DEPDIR)/atom_vmhd.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/descriptors.Plo ./$(DEPDIR)/isma.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4.Plo ./$(DEPDIR)/mp4atom.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4container.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4descriptor.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4file.Plo ./$(DEPDIR)/mp4file_io.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4info.Plo ./$(DEPDIR)/mp4meta.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4property.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4track.Plo ./$(DEPDIR)/mp4util.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/ocidescriptors.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/odcommands.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/qosqualifiers.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/rtphint.Plo +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libmp4v2_la_SOURCES) +DIST_SOURCES = $(libmp4v2_la_SOURCES) +includeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(include_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ +HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ +HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ +HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ +HAVE_XMMS_TRUE = @HAVE_XMMS_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MP4FF_LIBS = @MP4FF_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RPMBUILD = @RPMBUILD@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ +XMMS_CONFIG = @XMMS_CONFIG@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +INCLUDES = -I$(top_srcdir)/include +AM_CXXFLAGS = -Wall +lib_LTLIBRARIES = libmp4v2.la +include_HEADERS = mp4.h mpeg4ip.h systems.h +libmp4v2_la_SOURCES = \ + atom_co64.cpp \ + atom_cprt.cpp \ + atom_ctts.cpp \ + atom_dimm.cpp \ + atom_dinf.cpp \ + atom_dmax.cpp \ + atom_dmed.cpp \ + atom_dref.cpp \ + atom_drep.cpp \ + atom_edts.cpp \ + atom_elst.cpp \ + atom_enca.cpp \ + atom_encv.cpp \ + atom_esds.cpp \ + atom_free.cpp \ + atom_frma.cpp \ + atom_ftyp.cpp \ + atom_hdlr.cpp \ + atom_hinf.cpp \ + atom_hmhd.cpp \ + atom_hnti.cpp \ + atom_iKMS.cpp \ + atom_iSFM.cpp \ + atom_iods.cpp \ + atom_maxr.cpp \ + atom_mdat.cpp \ + atom_mdhd.cpp \ + atom_mdia.cpp \ + atom_meta.cpp \ + atom_mfhd.cpp \ + atom_minf.cpp \ + atom_moof.cpp \ + atom_moov.cpp \ + atom_mp4a.cpp \ + atom_mp4s.cpp \ + atom_mp4v.cpp \ + atom_mvex.cpp \ + atom_mvhd.cpp \ + atom_nmhd.cpp \ + atom_nump.cpp \ + atom_payt.cpp \ + atom_pmax.cpp \ + atom_root.cpp \ + atom_rtp.cpp \ + atom_schi.cpp \ + atom_schm.cpp \ + atom_sdp.cpp \ + atom_sinf.cpp \ + atoms.h \ + atom_smhd.cpp \ + atom_snro.cpp \ + atom_stbl.cpp \ + atom_stco.cpp \ + atom_stdp.cpp \ + atom_stsc.cpp \ + atom_stsd.cpp \ + atom_stsh.cpp \ + atom_stss.cpp \ + atom_stsz.cpp \ + atom_stts.cpp \ + atom_tfhd.cpp \ + atom_tims.cpp \ + atom_tkhd.cpp \ + atom_tmax.cpp \ + atom_tmin.cpp \ + atom_tpyl.cpp \ + atom_traf.cpp \ + atom_trak.cpp \ + atom_tref.cpp \ + atom_treftype.cpp \ + atom_trex.cpp \ + atom_trpy.cpp \ + atom_trun.cpp \ + atom_tsro.cpp \ + atom_udta.cpp \ + atom_url.cpp \ + atom_urn.cpp \ + atom_vmhd.cpp \ + descriptors.cpp \ + descriptors.h \ + isma.cpp \ + mp4array.h \ + mp4atom.cpp \ + mp4atom.h \ + mp4common.h \ + mp4container.cpp \ + mp4container.h \ + mp4.h \ + mp4.cpp \ + mp4descriptor.cpp \ + mp4descriptor.h \ + mp4file.cpp \ + mp4file.h \ + mp4file_io.cpp \ + mp4info.cpp \ + mp4meta.cpp \ + mp4property.cpp \ + mp4property.h \ + mp4track.cpp \ + mp4track.h \ + mp4util.cpp \ + mp4util.h \ + ocidescriptors.cpp \ + ocidescriptors.h \ + odcommands.cpp \ + odcommands.h \ + qosqualifiers.cpp \ + qosqualifiers.h \ + rtphint.cpp \ + rtphint.h + +EXTRA_DIST = API_CHANGES \ + INTERNALS \ + libmp4v260.dsp \ + libmp4v2_st60.dsp \ + TODO + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/mp4v2/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/mp4v2/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmp4v2.la: $(libmp4v2_la_OBJECTS) $(libmp4v2_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libmp4v2_la_LDFLAGS) $(libmp4v2_la_OBJECTS) $(libmp4v2_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_co64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_cprt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_ctts.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dimm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dinf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dmax.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dmed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dref.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_drep.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_edts.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_elst.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_enca.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_encv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_esds.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_free.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_frma.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_ftyp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hdlr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hinf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hmhd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hnti.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_iKMS.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_iSFM.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_iods.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_maxr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mdat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mdhd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mdia.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_meta.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mfhd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_minf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_moof.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_moov.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mp4a.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mp4s.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mp4v.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mvex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mvhd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_nmhd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_nump.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_payt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_pmax.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_root.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_rtp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_schi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_schm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_sdp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_sinf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_smhd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_snro.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stbl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stco.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stdp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsh.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stss.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsz.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stts.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tfhd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tims.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tkhd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tmax.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tmin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tpyl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_traf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_trak.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tref.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_treftype.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_trex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_trpy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_trun.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tsro.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_udta.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_url.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_urn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_vmhd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/descriptors.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isma.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4atom.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4container.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4descriptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4file_io.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4info.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4meta.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4property.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4track.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocidescriptors.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/odcommands.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qosqualifiers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtphint.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" + @list='$(include_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ + $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ + rm -f "$(DESTDIR)$(includedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-includeHEADERS + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-includeHEADERS uninstall-info-am \ + uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-includeHEADERS uninstall-info-am \ + uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/TODO +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/TODO @@ -0,0 +1,11 @@ + +Extended format (v2) support + +Means to dump all possible atoms/properties with types + +Wrap printf's for verbosity - see example is player/lib/http/http_util.c + +Distinguish cases of no ES Config and error parsing esds + +Improve error recovery when length of atom/descriptor is larger than parent/file, resync on parent. + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_co64.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_co64.cpp @@ -0,0 +1,38 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4Co64Atom::MP4Co64Atom() + : MP4Atom("co64") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty( + new MP4Integer64Property("chunkOffset")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_cprt.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_cprt.cpp @@ -0,0 +1,32 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4CprtAtom::MP4CprtAtom() + : MP4Atom("cprt") +{ + AddVersionAndFlags(); + AddProperty( + new MP4Integer16Property("language")); + AddProperty( + new MP4StringProperty("notice")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_ctts.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_ctts.cpp @@ -0,0 +1,40 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4CttsAtom::MP4CttsAtom() + : MP4Atom("ctts") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty( + new MP4Integer32Property("sampleCount")); + pTable->AddProperty( + new MP4Integer32Property("sampleOffset")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_dimm.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_dimm.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4DimmAtom::MP4DimmAtom() + : MP4Atom("dimm") +{ + AddProperty( // bytes of immediate data + new MP4Integer64Property("bytes")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_dinf.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_dinf.cpp @@ -0,0 +1,28 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4DinfAtom::MP4DinfAtom() + : MP4Atom("dinf") +{ + ExpectChildAtom("dref", Required, OnlyOne); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_dmax.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_dmax.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4DmaxAtom::MP4DmaxAtom() + : MP4Atom("dmax") +{ + AddProperty( // max packet duration + new MP4Integer32Property("milliSecs")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_dmed.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_dmed.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4DmedAtom::MP4DmedAtom() + : MP4Atom("dmed") +{ + AddProperty( // bytes sent from media data + new MP4Integer64Property("bytes")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_dref.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_dref.cpp @@ -0,0 +1,56 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4DrefAtom::MP4DrefAtom() + : MP4Atom("dref") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + pCount->SetReadOnly(); + AddProperty(pCount); + + ExpectChildAtom("url ", Optional, Many); + ExpectChildAtom("urn ", Optional, Many); +} + +void MP4DrefAtom::Read() +{ + /* do the usual read */ + MP4Atom::Read(); + + // check that number of children == entryCount + MP4Integer32Property* pCount = + (MP4Integer32Property*)m_pProperties[2]; + + if (m_pChildAtoms.Size() != pCount->GetValue()) { + VERBOSE_READ(GetVerbosity(), + MP4Printf("Warning: dref inconsistency with number of entries")); + + /* fix it */ + pCount->SetReadOnly(false); + pCount->SetValue(m_pChildAtoms.Size()); + pCount->SetReadOnly(true); + } +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_drep.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_drep.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4DrepAtom::MP4DrepAtom() + : MP4Atom("drep") +{ + AddProperty( // bytes of repeated data + new MP4Integer64Property("bytes")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_edts.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_edts.cpp @@ -0,0 +1,28 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4EdtsAtom::MP4EdtsAtom() + : MP4Atom("edts") +{ + ExpectChildAtom("elst", Required, OnlyOne); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_elst.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_elst.cpp @@ -0,0 +1,80 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4ElstAtom::MP4ElstAtom() + : MP4Atom("elst") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); +} + +void MP4ElstAtom::AddProperties(u_int8_t version) +{ + MP4TableProperty* pTable = (MP4TableProperty*)m_pProperties[3]; + + if (version == 1) { + pTable->AddProperty( + new MP4Integer64Property("segmentDuration")); + pTable->AddProperty( + new MP4Integer64Property("mediaTime")); + } else { + pTable->AddProperty( + new MP4Integer32Property("segmentDuration")); + pTable->AddProperty( + new MP4Integer32Property("mediaTime")); + } + + pTable->AddProperty( + new MP4Integer16Property("mediaRate")); + pTable->AddProperty( + new MP4Integer16Property("reserved")); +} + +void MP4ElstAtom::Generate() +{ + SetVersion(0); + AddProperties(GetVersion()); + + MP4Atom::Generate(); +} + +void MP4ElstAtom::Read() +{ + /* read atom version */ + ReadProperties(0, 1); + + /* need to create the properties based on the atom version */ + AddProperties(GetVersion()); + + /* now we can read the remaining properties */ + ReadProperties(1); + + Skip(); // to end of atom +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_enca.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_enca.cpp @@ -0,0 +1,61 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +#include "mp4common.h" + +MP4EncaAtom::MP4EncaAtom() + : MP4Atom("enca") +{ + AddReserved("reserved1", 6); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer16Property("dataReferenceIndex")); + + AddReserved("reserved2", 16); /* 2 */ + + AddProperty( /* 3 */ + new MP4Integer16Property("timeScale")); + + AddReserved("reserved3", 2); /* 4 */ + + ExpectChildAtom("esds", Required, OnlyOne); + ExpectChildAtom("sinf", Required, OnlyOne); +} + +void MP4EncaAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + + // property reserved2 has non-zero fixed values + static u_int8_t reserved2[16] = { + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, + }; + m_pProperties[2]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[2])-> + SetValue(reserved2, sizeof(reserved2)); + m_pProperties[2]->SetReadOnly(true); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_encv.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_encv.cpp @@ -0,0 +1,80 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +#include "mp4common.h" + +MP4EncvAtom::MP4EncvAtom() + : MP4Atom("encv") +{ + AddReserved("reserved1", 6); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer16Property("dataReferenceIndex")); + + AddReserved("reserved2", 16); /* 2 */ + + AddProperty( /* 3 */ + new MP4Integer16Property("width")); + AddProperty( /* 4 */ + new MP4Integer16Property("height")); + + AddReserved("reserved3", 14); /* 5 */ + + MP4StringProperty* pProp = + new MP4StringProperty("compressorName"); + pProp->SetFixedLength(32); + pProp->SetValue(""); + AddProperty(pProp); /* 6 */ + AddReserved("reserved4", 4); /* 7 */ + + ExpectChildAtom("esds", Required, OnlyOne); + ExpectChildAtom("sinf", Required, OnlyOne); +} + +void MP4EncvAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + + // property reserved3 has non-zero fixed values + static u_int8_t reserved3[14] = { + 0x00, 0x48, 0x00, 0x00, + 0x00, 0x48, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, + }; + m_pProperties[5]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[5])-> + SetValue(reserved3, sizeof(reserved3)); + m_pProperties[5]->SetReadOnly(true); + + // property reserved4 has non-zero fixed values + static u_int8_t reserved4[4] = { + 0x00, 0x18, 0xFF, 0xFF, + }; + m_pProperties[7]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[7])-> + SetValue(reserved4, sizeof(reserved4)); + m_pProperties[7]->SetReadOnly(true); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_esds.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_esds.cpp @@ -0,0 +1,31 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4EsdsAtom::MP4EsdsAtom() + : MP4Atom("esds") +{ + AddVersionAndFlags(); + AddProperty( + new MP4DescriptorProperty(NULL, + MP4ESDescrTag, 0, Required, OnlyOne)); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_free.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_free.cpp @@ -0,0 +1,43 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4FreeAtom::MP4FreeAtom() + : MP4Atom("free") +{ +} + +void MP4FreeAtom::Read() +{ + Skip(); +} + +void MP4FreeAtom::Write() +{ + ASSERT(m_pFile); + + bool use64 = (GetSize() > (0xFFFFFFFF - 8)); + BeginWrite(use64); + m_pFile->SetPosition(m_pFile->GetPosition() + GetSize()); + FinishWrite(use64); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_frma.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_frma.cpp @@ -0,0 +1,32 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Alix Marchandise-Franquet alix@cisco.com + * + * Add the OriginalFormatBox for ISMACrypt + * contains the original format of the data (i.e. decrypted format) + */ + +#include "mp4common.h" + +MP4FrmaAtom::MP4FrmaAtom() + : MP4Atom("frma") +{ + AddProperty( /* 0 */ + new MP4Integer32Property("data-format")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_ftyp.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_ftyp.cpp @@ -0,0 +1,71 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4FtypAtom::MP4FtypAtom() + : MP4Atom("ftyp") +{ + MP4StringProperty* pProp = new MP4StringProperty("majorBrand"); + pProp->SetFixedLength(4); + AddProperty(pProp); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer32Property("minorVersion")); + + MP4Integer32Property* pCount = + new MP4Integer32Property("compatibleBrandsCount"); + pCount->SetImplicit(); + AddProperty(pCount); /* 2 */ + + MP4TableProperty* pTable = + new MP4TableProperty("compatibleBrands", pCount); + AddProperty(pTable); /* 3 */ + + pProp = new MP4StringProperty("brand"); + pProp->SetFixedLength(4); + pTable->AddProperty(pProp); +} + +void MP4FtypAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4StringProperty*)m_pProperties[0])->SetValue("mp42"); + + MP4StringProperty* pBrandProperty = (MP4StringProperty*) + ((MP4TableProperty*)m_pProperties[3])->GetProperty(0); + ASSERT(pBrandProperty); + pBrandProperty->AddValue("mp42"); + pBrandProperty->AddValue("isom"); + ((MP4Integer32Property*)m_pProperties[2])->IncrementValue(); + ((MP4Integer32Property*)m_pProperties[2])->IncrementValue(); +} + +void MP4FtypAtom::Read() +{ + // table entry count computed from atom size + ((MP4Integer32Property*)m_pProperties[2])->SetReadOnly(false); + ((MP4Integer32Property*)m_pProperties[2])->SetValue((m_size - 8) / 4); + ((MP4Integer32Property*)m_pProperties[2])->SetReadOnly(true); + + MP4Atom::Read(); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_hdlr.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_hdlr.cpp @@ -0,0 +1,64 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4HdlrAtom::MP4HdlrAtom() + : MP4Atom("hdlr") +{ + AddVersionAndFlags(); /* 0, 1 */ + AddReserved("reserved1", 4); /* 2 */ + MP4StringProperty* pProp = new MP4StringProperty("handlerType"); + pProp->SetFixedLength(4); + AddProperty(pProp); /* 3 */ + AddReserved("reserved2", 12); /* 4 */ + AddProperty( /* 5 */ + new MP4StringProperty("name")); +} + +// There is a spec incompatiblity between QT and MP4 +// QT says name field is a counted string +// MP4 says name field is a null terminated string +// Here we attempt to make all things work +void MP4HdlrAtom::Read() +{ + // read all the properties but the "name" field + ReadProperties(0, 5); + + // take a peek at the next byte + u_int8_t strLength; + m_pFile->PeekBytes(&strLength, 1); + + // if the value matches the remaining atom length + if (m_pFile->GetPosition() + strLength + 1 == GetEnd()) { + // read a counted string + MP4StringProperty* pNameProp = + (MP4StringProperty*)m_pProperties[5]; + pNameProp->SetCountedFormat(true); + ReadProperties(5); + pNameProp->SetCountedFormat(false); + } else { + // read a null terminated string + ReadProperties(5); + } + + Skip(); // to end of atom +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_hinf.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_hinf.cpp @@ -0,0 +1,57 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4HinfAtom::MP4HinfAtom() + : MP4Atom("hinf") +{ + ExpectChildAtom("trpy", Optional, OnlyOne); + ExpectChildAtom("nump", Optional, OnlyOne); + ExpectChildAtom("tpyl", Optional, OnlyOne); + ExpectChildAtom("maxr", Optional, Many); + ExpectChildAtom("dmed", Optional, OnlyOne); + ExpectChildAtom("dimm", Optional, OnlyOne); + ExpectChildAtom("drep", Optional, OnlyOne); + ExpectChildAtom("tmin", Optional, OnlyOne); + ExpectChildAtom("tmax", Optional, OnlyOne); + ExpectChildAtom("pmax", Optional, OnlyOne); + ExpectChildAtom("dmax", Optional, OnlyOne); + ExpectChildAtom("payt", Optional, OnlyOne); +} + +void MP4HinfAtom::Generate() +{ + // hinf is special in that although all it's child atoms + // are optional (on read), if we generate it for writing + // we really want all the children + + for (u_int32_t i = 0; i < m_pChildAtomInfos.Size(); i++) { + MP4Atom* pChildAtom = + CreateAtom(m_pChildAtomInfos[i]->m_name); + + AddChildAtom(pChildAtom); + + // and ask it to self generate + pChildAtom->Generate(); + } +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_hmhd.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_hmhd.cpp @@ -0,0 +1,39 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4HmhdAtom::MP4HmhdAtom() + : MP4Atom("hmhd") +{ + AddVersionAndFlags(); + + AddProperty( + new MP4Integer16Property("maxPduSize")); + AddProperty( + new MP4Integer16Property("avgPduSize")); + AddProperty( + new MP4Integer32Property("maxBitRate")); + AddProperty( + new MP4Integer32Property("avgBitRate")); + AddProperty( + new MP4Integer32Property("slidingAvgBitRate")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_hnti.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_hnti.cpp @@ -0,0 +1,40 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4HntiAtom::MP4HntiAtom() + : MP4Atom("hnti") +{ +} + +void MP4HntiAtom::Read() +{ + MP4Atom* grandParent = m_pParentAtom->GetParentAtom(); + ASSERT(grandParent); + if (ATOMID(grandParent->GetType()) == ATOMID("trak")) { + ExpectChildAtom("sdp ", Optional, OnlyOne); + } else { + ExpectChildAtom("rtp ", Optional, OnlyOne); + } + + MP4Atom::Read(); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_iKMS.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_iKMS.cpp @@ -0,0 +1,34 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Alix Marchandise-Franquet alix@cisco.com + * + * ISMAKMSBox for ISMACrypt + * Do we care about the string length? Do we need to handle the null-term + * issue like in the hdlr atom? + */ + +#include "mp4common.h" + +MP4IKMSAtom::MP4IKMSAtom() + : MP4Atom("iKMS") +{ + AddVersionAndFlags(); /* 0, 1 */ + MP4StringProperty* pProp = new MP4StringProperty("kms_URI"); + AddProperty(pProp); /* 2 */ +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_iSFM.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_iSFM.cpp @@ -0,0 +1,38 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Alix Marchandise-Franquet alix@cisco.com + * + * ISMASampleFormatBox for ISMACrypt + */ + +#include "mp4common.h" + +MP4ISFMAtom::MP4ISFMAtom() + : MP4Atom("iSFM") +{ + AddVersionAndFlags(); /* 0, 1 */ + AddProperty( /* 2 */ + new MP4BitfieldProperty("selective-encryption", 1)); + AddProperty( /* 3 */ + new MP4BitfieldProperty("reserved", 7)); + AddProperty( /* 4 */ + new MP4Integer8Property("key-indicator-length")); + AddProperty( /* 5 */ + new MP4Integer8Property("IV-length")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_iods.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_iods.cpp @@ -0,0 +1,31 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4IodsAtom::MP4IodsAtom() + : MP4Atom("iods") +{ + AddVersionAndFlags(); + AddProperty( + new MP4DescriptorProperty(NULL, + MP4FileIODescrTag, MP4FileODescrTag, Required, OnlyOne)); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_maxr.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_maxr.cpp @@ -0,0 +1,31 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4MaxrAtom::MP4MaxrAtom() + : MP4Atom("maxr") +{ + AddProperty( + new MP4Integer32Property("granularity")); + AddProperty( + new MP4Integer32Property("bytes")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_mdat.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_mdat.cpp @@ -0,0 +1,38 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4MdatAtom::MP4MdatAtom() + : MP4Atom("mdat") +{ +} + +void MP4MdatAtom::Read() +{ + Skip(); +} + +void MP4MdatAtom::Write() +{ + // should never get here + ASSERT(false); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_mdhd.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_mdhd.cpp @@ -0,0 +1,91 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4MdhdAtom::MP4MdhdAtom() + : MP4Atom("mdhd") +{ + AddVersionAndFlags(); +} + +void MP4MdhdAtom::AddProperties(u_int8_t version) +{ + if (version == 1) { + AddProperty( + new MP4Integer64Property("creationTime")); + AddProperty( + new MP4Integer64Property("modificationTime")); + } else { + AddProperty( + new MP4Integer32Property("creationTime")); + AddProperty( + new MP4Integer32Property("modificationTime")); + } + + AddProperty( + new MP4Integer32Property("timeScale")); + + if (version == 1) { + AddProperty( + new MP4Integer64Property("duration")); + } else { + AddProperty( + new MP4Integer32Property("duration")); + } + + AddProperty( + new MP4Integer16Property("language")); + AddReserved("reserved", 2); +} + +void MP4MdhdAtom::Generate() +{ + u_int8_t version = m_pFile->Use64Bits() ? 1 : 0; + SetVersion(version); + AddProperties(version); + + MP4Atom::Generate(); + + // set creation and modification times + MP4Timestamp now = MP4GetAbsTimestamp(); + if (version == 1) { + ((MP4Integer64Property*)m_pProperties[2])->SetValue(now); + ((MP4Integer64Property*)m_pProperties[3])->SetValue(now); + } else { + ((MP4Integer32Property*)m_pProperties[2])->SetValue(now); + ((MP4Integer32Property*)m_pProperties[3])->SetValue(now); + } +} + +void MP4MdhdAtom::Read() +{ + /* read atom version */ + ReadProperties(0, 1); + + /* need to create the properties based on the atom version */ + AddProperties(GetVersion()); + + /* now we can read the remaining properties */ + ReadProperties(1); + + Skip(); // to end of atom +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_mdia.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_mdia.cpp @@ -0,0 +1,30 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4MdiaAtom::MP4MdiaAtom() + : MP4Atom("mdia") +{ + ExpectChildAtom("mdhd", Required, OnlyOne); + ExpectChildAtom("hdlr", Required, OnlyOne); + ExpectChildAtom("minf", Required, OnlyOne); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_meta.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_meta.cpp @@ -0,0 +1,197 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * M. Bakker mbakker at nero.com + * + * Apple iTunes META data + */ + +#include "mp4common.h" + +MP4MetaAtom::MP4MetaAtom() + : MP4Atom("meta") +{ + AddVersionAndFlags(); /* 0, 1 */ + + ExpectChildAtom("hdlr", Required, OnlyOne); + ExpectChildAtom("ilst", Required, OnlyOne); +} + +MP4MeanAtom::MP4MeanAtom() + : MP4Atom("mean") +{ + AddVersionAndFlags(); /* 0, 1 */ + + AddProperty( + new MP4BytesProperty("metadata")); /* 2 */ +} + +void MP4MeanAtom::Read() +{ + // calculate size of the metadata from the atom size + ((MP4BytesProperty*)m_pProperties[2])->SetValueSize(m_size - 4); + + MP4Atom::Read(); +} + +MP4NameAtom::MP4NameAtom() + : MP4Atom("name") +{ + AddVersionAndFlags(); /* 0, 1 */ + + AddProperty( + new MP4BytesProperty("metadata")); /* 2 */ +} + +void MP4NameAtom::Read() +{ + // calculate size of the metadata from the atom size + ((MP4BytesProperty*)m_pProperties[2])->SetValueSize(m_size - 4); + + MP4Atom::Read(); +} + +MP4DataAtom::MP4DataAtom() + : MP4Atom("data") +{ + AddVersionAndFlags(); /* 0, 1 */ + AddReserved("reserved2", 4); /* 2 */ + + AddProperty( + new MP4BytesProperty("metadata")); /* 3 */ +} + +void MP4DataAtom::Read() +{ + // calculate size of the metadata from the atom size + ((MP4BytesProperty*)m_pProperties[3])->SetValueSize(m_size - 8); + + MP4Atom::Read(); +} + +MP4IlstAtom::MP4IlstAtom() + : MP4Atom("ilst") +{ + ExpectChildAtom("©nam", Optional, OnlyOne); /* name */ + ExpectChildAtom("©ART", Optional, OnlyOne); /* artist */ + ExpectChildAtom("©wrt", Optional, OnlyOne); /* writer */ + ExpectChildAtom("©alb", Optional, OnlyOne); /* album */ + ExpectChildAtom("©day", Optional, OnlyOne); /* date */ + ExpectChildAtom("©too", Optional, OnlyOne); /* tool */ + ExpectChildAtom("©cmt", Optional, OnlyOne); /* comment */ + ExpectChildAtom("©gen", Optional, OnlyOne); /* custom genre */ + ExpectChildAtom("trkn", Optional, OnlyOne); /* tracknumber */ + ExpectChildAtom("disk", Optional, OnlyOne); /* disknumber */ + ExpectChildAtom("gnre", Optional, OnlyOne); /* genre (ID3v1 index + 1) */ + ExpectChildAtom("cpil", Optional, OnlyOne); /* compilation */ + ExpectChildAtom("tmpo", Optional, OnlyOne); /* BPM */ + ExpectChildAtom("covr", Optional, OnlyOne); /* cover art */ + ExpectChildAtom("----", Optional, Many); /* ---- free form */ +} + +MP4DashAtom::MP4DashAtom() + : MP4Atom("----") +{ + ExpectChildAtom("mean", Required, OnlyOne); + ExpectChildAtom("name", Required, OnlyOne); + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4NamAtom::MP4NamAtom() + : MP4Atom("©nam") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4ArtAtom::MP4ArtAtom() + : MP4Atom("©ART") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4WrtAtom::MP4WrtAtom() + : MP4Atom("©wrt") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4AlbAtom::MP4AlbAtom() + : MP4Atom("©alb") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4CmtAtom::MP4CmtAtom() + : MP4Atom("©cmt") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4TrknAtom::MP4TrknAtom() + : MP4Atom("trkn") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4DiskAtom::MP4DiskAtom() + : MP4Atom("disk") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4DayAtom::MP4DayAtom() + : MP4Atom("©day") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4GenAtom::MP4GenAtom() + : MP4Atom("©gen") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4TooAtom::MP4TooAtom() + : MP4Atom("©too") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4GnreAtom::MP4GnreAtom() + : MP4Atom("gnre") +{ + ExpectChildAtom("data", Optional, OnlyOne); +} + +MP4CpilAtom::MP4CpilAtom() + : MP4Atom("cpil") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4TmpoAtom::MP4TmpoAtom() + : MP4Atom("tmpo") +{ + ExpectChildAtom("data", Required, OnlyOne); +} + +MP4CovrAtom::MP4CovrAtom() + : MP4Atom("covr") +{ + ExpectChildAtom("data", Required, OnlyOne); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_mfhd.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_mfhd.cpp @@ -0,0 +1,31 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4MfhdAtom::MP4MfhdAtom() + : MP4Atom("mfhd") +{ + AddVersionAndFlags(); /* 0, 1 */ + AddProperty( /* 2 */ + new MP4Integer32Property("sequenceNumber")); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_minf.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_minf.cpp @@ -0,0 +1,33 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4MinfAtom::MP4MinfAtom() + : MP4Atom("minf") +{ + ExpectChildAtom("vmhd", Optional, OnlyOne); + ExpectChildAtom("smhd", Optional, OnlyOne); + ExpectChildAtom("hmhd", Optional, OnlyOne); + ExpectChildAtom("nmhd", Optional, OnlyOne); + ExpectChildAtom("dinf", Required, OnlyOne); + ExpectChildAtom("stbl", Required, OnlyOne); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_moof.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_moof.cpp @@ -0,0 +1,30 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4MoofAtom::MP4MoofAtom() + : MP4Atom("moof") +{ + ExpectChildAtom("mfhd", Required, OnlyOne); + ExpectChildAtom("traf", Optional, Many); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_moov.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_moov.cpp @@ -0,0 +1,33 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4MoovAtom::MP4MoovAtom() + : MP4Atom("moov") +{ + ExpectChildAtom("mvhd", Required, OnlyOne); + ExpectChildAtom("iods", Required, OnlyOne); + ExpectChildAtom("trak", Required, Many); + ExpectChildAtom("udta", Optional, Many); + ExpectChildAtom("mvex", Optional, OnlyOne); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_mp4a.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_mp4a.cpp @@ -0,0 +1,59 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4Mp4aAtom::MP4Mp4aAtom() + : MP4Atom("mp4a") +{ + AddReserved("reserved1", 6); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer16Property("dataReferenceIndex")); + + AddReserved("reserved2", 16); /* 2 */ + + AddProperty( /* 3 */ + new MP4Integer16Property("timeScale")); + + AddReserved("reserved3", 2); /* 4 */ + + ExpectChildAtom("esds", Required, OnlyOne); +} + +void MP4Mp4aAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + + // property reserved2 has non-zero fixed values + static u_int8_t reserved2[16] = { + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, + }; + m_pProperties[2]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[2])-> + SetValue(reserved2, sizeof(reserved2)); + m_pProperties[2]->SetReadOnly(true); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_mp4s.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_mp4s.cpp @@ -0,0 +1,40 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4Mp4sAtom::MP4Mp4sAtom() + : MP4Atom("mp4s") +{ + AddReserved("reserved1", 6); + AddProperty( + new MP4Integer16Property("dataReferenceIndex")); + + ExpectChildAtom("esds", Required, OnlyOne); +} + +void MP4Mp4sAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_mp4v.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_mp4v.cpp @@ -0,0 +1,79 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4Mp4vAtom::MP4Mp4vAtom() + : MP4Atom("mp4v") +{ + AddReserved("reserved1", 6); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer16Property("dataReferenceIndex")); + + AddReserved("reserved2", 16); /* 2 */ + + AddProperty( /* 3 */ + new MP4Integer16Property("width")); + AddProperty( /* 4 */ + new MP4Integer16Property("height")); + + AddReserved("reserved3", 14); /* 5 */ + + MP4StringProperty* pProp = + new MP4StringProperty("compressorName"); + pProp->SetFixedLength(32); + pProp->SetValue(""); + AddProperty(pProp); /* 6 */ + + AddReserved("reserved4", 4); /* 7 */ + + ExpectChildAtom("esds", Required, OnlyOne); +} + +void MP4Mp4vAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + + // property reserved3 has non-zero fixed values + static u_int8_t reserved3[14] = { + 0x00, 0x48, 0x00, 0x00, + 0x00, 0x48, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, + }; + m_pProperties[5]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[5])-> + SetValue(reserved3, sizeof(reserved3)); + m_pProperties[5]->SetReadOnly(true); + + // property reserved4 has non-zero fixed values + static u_int8_t reserved4[4] = { + 0x00, 0x18, 0xFF, 0xFF, + }; + m_pProperties[7]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[7])-> + SetValue(reserved4, sizeof(reserved4)); + m_pProperties[7]->SetReadOnly(true); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_mvex.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_mvex.cpp @@ -0,0 +1,28 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4MvexAtom::MP4MvexAtom() + : MP4Atom("mvex") +{ + ExpectChildAtom("trex", Required, Many); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_mvhd.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_mvhd.cpp @@ -0,0 +1,136 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4MvhdAtom::MP4MvhdAtom() + : MP4Atom("mvhd") +{ + AddVersionAndFlags(); +} + +void MP4MvhdAtom::AddProperties(u_int8_t version) +{ + if (version == 1) { + AddProperty( /* 2 */ + new MP4Integer64Property("creationTime")); + AddProperty( /* 3 */ + new MP4Integer64Property("modificationTime")); + } else { + AddProperty( /* 2 */ + new MP4Integer32Property("creationTime")); + AddProperty( /* 3 */ + new MP4Integer32Property("modificationTime")); + } + + AddProperty( /* 4 */ + new MP4Integer32Property("timeScale")); + + if (version == 1) { + AddProperty( /* 5 */ + new MP4Integer64Property("duration")); + } else { + AddProperty( /* 5 */ + new MP4Integer32Property("duration")); + } + + MP4Float32Property* pProp; + + pProp = new MP4Float32Property("rate"); + pProp->SetFixed32Format(); + AddProperty(pProp); /* 6 */ + + pProp = new MP4Float32Property("volume"); + pProp->SetFixed16Format(); + AddProperty(pProp); /* 7 */ + + AddReserved("reserved1", 70); /* 8 */ + + AddProperty( /* 9 */ + new MP4Integer32Property("nextTrackId")); +} + +void MP4MvhdAtom::Generate() +{ + u_int8_t version = m_pFile->Use64Bits() ? 1 : 0; + SetVersion(version); + AddProperties(version); + + MP4Atom::Generate(); + + // set creation and modification times + MP4Timestamp now = MP4GetAbsTimestamp(); + if (version == 1) { + ((MP4Integer64Property*)m_pProperties[2])->SetValue(now); + ((MP4Integer64Property*)m_pProperties[3])->SetValue(now); + } else { + ((MP4Integer32Property*)m_pProperties[2])->SetValue(now); + ((MP4Integer32Property*)m_pProperties[3])->SetValue(now); + } + + ((MP4Integer32Property*)m_pProperties[4])->SetValue(1000); + + ((MP4Float32Property*)m_pProperties[6])->SetValue(1.0); + ((MP4Float32Property*)m_pProperties[7])->SetValue(1.0); + + // property reserved has non-zero fixed values + static u_int8_t reserved[70] = { + 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + }; + m_pProperties[8]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[8])-> + SetValue(reserved, sizeof(reserved)); + m_pProperties[8]->SetReadOnly(true); + + // set next track id + ((MP4Integer32Property*)m_pProperties[9])->SetValue(1); +} + +void MP4MvhdAtom::Read() +{ + /* read atom version */ + ReadProperties(0, 1); + + /* need to create the properties based on the atom version */ + AddProperties(GetVersion()); + + /* now we can read the remaining properties */ + ReadProperties(1); + + Skip(); // to end of atom +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_nmhd.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_nmhd.cpp @@ -0,0 +1,28 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4NmhdAtom::MP4NmhdAtom() + : MP4Atom("nmhd") +{ + AddVersionAndFlags(); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_nump.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_nump.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4NumpAtom::MP4NumpAtom() + : MP4Atom("nump") +{ + AddProperty( // packets sent + new MP4Integer64Property("packets")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_payt.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_payt.cpp @@ -0,0 +1,31 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4PaytAtom::MP4PaytAtom() + : MP4Atom("payt") +{ + AddProperty( + new MP4Integer32Property("payloadNumber")); + AddProperty( + new MP4StringProperty("rtpMap", Counted)); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_pmax.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_pmax.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4PmaxAtom::MP4PmaxAtom() + : MP4Atom("pmax") +{ + AddProperty( // max packet size + new MP4Integer32Property("bytes")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_root.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_root.cpp @@ -0,0 +1,123 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4RootAtom::MP4RootAtom() + : MP4Atom(NULL) +{ + ExpectChildAtom("ftyp", Required, OnlyOne); + ExpectChildAtom("moov", Required, OnlyOne); + ExpectChildAtom("mdat", Optional, Many); + ExpectChildAtom("free", Optional, Many); + ExpectChildAtom("skip", Optional, Many); + ExpectChildAtom("udta", Optional, Many); + ExpectChildAtom("moof", Optional, Many); +} + +void MP4RootAtom::BeginWrite(bool use64) +{ + // only call under MP4Create() control + WriteAtomType("ftyp", OnlyOne); + + m_pChildAtoms[GetLastMdatIndex()]->BeginWrite(m_pFile->Use64Bits()); +} + +void MP4RootAtom::Write() +{ + // no-op +} + +void MP4RootAtom::FinishWrite(bool use64) +{ + // finish writing last mdat atom + u_int32_t mdatIndex = GetLastMdatIndex(); + m_pChildAtoms[mdatIndex]->FinishWrite(m_pFile->Use64Bits()); + + // write all atoms after last mdat + u_int32_t size = m_pChildAtoms.Size(); + for (u_int32_t i = mdatIndex + 1; i < size; i++) { + m_pChildAtoms[i]->Write(); + } +} + +void MP4RootAtom::BeginOptimalWrite() +{ + WriteAtomType("ftyp", OnlyOne); + WriteAtomType("moov", OnlyOne); + WriteAtomType("udta", Many); + + m_pChildAtoms[GetLastMdatIndex()]->BeginWrite(m_pFile->Use64Bits()); +} + +void MP4RootAtom::FinishOptimalWrite() +{ + // finish writing mdat + m_pChildAtoms[GetLastMdatIndex()]->FinishWrite(m_pFile->Use64Bits()); + + // find moov atom + u_int32_t size = m_pChildAtoms.Size(); + MP4Atom* pMoovAtom = NULL; + + u_int32_t i; + for (i = 0; i < size; i++) { + if (!strcmp("moov", m_pChildAtoms[i]->GetType())) { + pMoovAtom = m_pChildAtoms[i]; + break; + } + } + ASSERT(i < size); + + // rewrite moov so that updated chunkOffsets are written to disk + m_pFile->SetPosition(pMoovAtom->GetStart()); + u_int64_t oldSize = pMoovAtom->GetSize(); + + pMoovAtom->Write(); + + // sanity check + u_int64_t newSize = pMoovAtom->GetSize(); + ASSERT(oldSize == newSize); +} + +u_int32_t MP4RootAtom::GetLastMdatIndex() +{ + for (int32_t i = m_pChildAtoms.Size() - 1; i >= 0; i--) { + if (!strcmp("mdat", m_pChildAtoms[i]->GetType())) { + return i; + } + } + ASSERT(false); + return (u_int32_t)-1; +} + +void MP4RootAtom::WriteAtomType(const char* type, bool onlyOne) +{ + u_int32_t size = m_pChildAtoms.Size(); + + for (u_int32_t i = 0; i < size; i++) { + if (!strcmp(type, m_pChildAtoms[i]->GetType())) { + m_pChildAtoms[i]->Write(); + if (onlyOne) { + break; + } + } + } +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_rtp.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_rtp.cpp @@ -0,0 +1,147 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4RtpAtom::MP4RtpAtom() + : MP4Atom("rtp ") +{ + // The atom type "rtp " is used in two complete unrelated ways + // i.e. it's real two atoms with the same name + // To handle that we need to postpone property creation until + // we know who our parent atom is (stsd or hnti) which gives us + // the context info we need to know who we are +} + +void MP4RtpAtom::AddPropertiesStsdType() +{ + AddReserved("reserved1", 6); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer16Property("dataReferenceIndex")); + + AddProperty( /* 2 */ + new MP4Integer16Property("hintTrackVersion")); + AddProperty( /* 3 */ + new MP4Integer16Property("highestCompatibleVersion")); + AddProperty( /* 4 */ + new MP4Integer32Property("maxPacketSize")); + + ExpectChildAtom("tims", Required, OnlyOne); + ExpectChildAtom("tsro", Optional, OnlyOne); + ExpectChildAtom("snro", Optional, OnlyOne); +} + +void MP4RtpAtom::AddPropertiesHntiType() +{ + MP4StringProperty* pProp = + new MP4StringProperty("descriptionFormat"); + pProp->SetFixedLength(4); + AddProperty(pProp); /* 0 */ + + AddProperty( /* 1 */ + new MP4StringProperty("sdpText")); +} + +void MP4RtpAtom::Generate() +{ + if (!strcmp(m_pParentAtom->GetType(), "stsd")) { + AddPropertiesStsdType(); + GenerateStsdType(); + } else if (!strcmp(m_pParentAtom->GetType(), "hnti")) { + AddPropertiesHntiType(); + GenerateHntiType(); + } else { + VERBOSE_WARNING(m_pFile->GetVerbosity(), + printf("Warning: rtp atom in unexpected context, can not generate")); + } +} + +void MP4RtpAtom::GenerateStsdType() +{ + // generate children + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + ((MP4Integer16Property*)m_pProperties[2])->SetValue(1); + ((MP4Integer16Property*)m_pProperties[3])->SetValue(1); +} + +void MP4RtpAtom::GenerateHntiType() +{ + MP4Atom::Generate(); + + ((MP4StringProperty*)m_pProperties[0])->SetValue("sdp "); +} + +void MP4RtpAtom::Read() +{ + if (!strcmp(m_pParentAtom->GetType(), "stsd")) { + AddPropertiesStsdType(); + ReadStsdType(); + } else if (!strcmp(m_pParentAtom->GetType(), "hnti")) { + AddPropertiesHntiType(); + ReadHntiType(); + } else { + VERBOSE_READ(m_pFile->GetVerbosity(), + printf("rtp atom in unexpected context, can not read")); + } + + Skip(); // to end of atom +} + +void MP4RtpAtom::ReadStsdType() +{ + MP4Atom::Read(); +} + +void MP4RtpAtom::ReadHntiType() +{ + ReadProperties(0, 1); + + // read sdp string, length is implicit in size of atom + u_int64_t size = GetEnd() - m_pFile->GetPosition(); + char* data = (char*)MP4Malloc(size + 1); + m_pFile->ReadBytes((u_int8_t*)data, size); + data[size] = '\0'; + ((MP4StringProperty*)m_pProperties[1])->SetValue(data); + MP4Free(data); +} + +void MP4RtpAtom::Write() +{ + if (!strcmp(m_pParentAtom->GetType(), "hnti")) { + WriteHntiType(); + } else { + MP4Atom::Write(); + } +} + +void MP4RtpAtom::WriteHntiType() +{ + // since length of string is implicit in size of atom + // we need to handle this specially, and not write the terminating \0 + MP4StringProperty* pSdp = (MP4StringProperty*)m_pProperties[1]; + pSdp->SetFixedLength(strlen(pSdp->GetValue())); + MP4Atom::Write(); + pSdp->SetFixedLength(0); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_schi.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_schi.cpp @@ -0,0 +1,34 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Alix Marchandise-Franquet alix@cisco.com + * + * SchemeInformationBox for ISMACrypt + */ + +#include "mp4common.h" + +MP4SchiAtom::MP4SchiAtom() + : MP4Atom("schi") +{ + AddVersionAndFlags(); + // not sure if this is child atoms or table of boxes + // get clarification on spec 9.1.2.5 + ExpectChildAtom("iKMS", Required, OnlyOne); + ExpectChildAtom("iSFM", Required, OnlyOne); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_schm.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_schm.cpp @@ -0,0 +1,35 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Alix Marchandise-Franquet alix@cisco.com + * + * Add the SchemeTypeBox for ISMACrypt + */ + +#include "mp4common.h" + +MP4SchmAtom::MP4SchmAtom() + : MP4Atom("schm") +{ + AddVersionAndFlags(); /* 0, 1 */ + AddProperty( /* 2 */ + new MP4Integer32Property("scheme_type")); + AddProperty( /* 3 */ + new MP4Integer32Property("scheme_version")); + // browser URI if flags set, TODO +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_sdp.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_sdp.cpp @@ -0,0 +1,53 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4SdpAtom::MP4SdpAtom() : MP4Atom("sdp ") +{ + AddProperty( + new MP4StringProperty("sdpText")); +} + +void MP4SdpAtom::Read() +{ + // read sdp string, length is implicit in size of atom + u_int64_t size = GetEnd() - m_pFile->GetPosition(); + char* data = (char*)MP4Malloc(size + 1); + m_pFile->ReadBytes((u_int8_t*)data, size); + data[size] = '\0'; + ((MP4StringProperty*)m_pProperties[0])->SetValue(data); + MP4Free(data); +} + +void MP4SdpAtom::Write() +{ + // since length of string is implicit in size of atom + // we need to handle this specially, and not write the terminating \0 + MP4StringProperty* pSdp = (MP4StringProperty*)m_pProperties[0]; + const char* sdpText = pSdp->GetValue(); + if (sdpText) { + pSdp->SetFixedLength(strlen(sdpText)); + } + MP4Atom::Write(); + pSdp->SetFixedLength(0); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_sinf.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_sinf.cpp @@ -0,0 +1,34 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + * + * Add the ProtectionInfoBox for ISMACrypt + */ + +#include "mp4common.h" + +MP4SinfAtom::MP4SinfAtom() + : MP4Atom("sinf") +{ + AddVersionAndFlags(); + ExpectChildAtom("frma", Required, OnlyOne); + ExpectChildAtom("schm", Required, OnlyOne); + ExpectChildAtom("schi", Required, OnlyOne); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_smhd.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_smhd.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4SmhdAtom::MP4SmhdAtom() + : MP4Atom("smhd") +{ + AddVersionAndFlags(); + AddReserved("reserved", 4); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_snro.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_snro.cpp @@ -0,0 +1,30 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4SnroAtom::MP4SnroAtom() + : MP4Atom("snro") +{ + AddProperty( + new MP4Integer32Property("offset")); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_stbl.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_stbl.cpp @@ -0,0 +1,57 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4StblAtom::MP4StblAtom() + : MP4Atom("stbl") +{ + ExpectChildAtom("stsd", Required, OnlyOne); + ExpectChildAtom("stts", Required, OnlyOne); + ExpectChildAtom("ctts", Optional, OnlyOne); + ExpectChildAtom("stsz", Required, OnlyOne); + ExpectChildAtom("stsc", Required, OnlyOne); + ExpectChildAtom("stco", Optional, OnlyOne); + ExpectChildAtom("co64", Optional, OnlyOne); + ExpectChildAtom("stss", Optional, OnlyOne); + ExpectChildAtom("stsh", Optional, OnlyOne); + ExpectChildAtom("stdp", Optional, OnlyOne); +} + +void MP4StblAtom::Generate() +{ + // as usual + MP4Atom::Generate(); + + // but we also need one of the chunk offset atoms + MP4Atom* pChunkOffsetAtom; + if (m_pFile->Use64Bits()) { + pChunkOffsetAtom = CreateAtom("co64"); + } else { + pChunkOffsetAtom = CreateAtom("stco"); + } + + AddChildAtom(pChunkOffsetAtom); + + // and ask it to self generate + pChunkOffsetAtom->Generate(); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_stco.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_stco.cpp @@ -0,0 +1,38 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4StcoAtom::MP4StcoAtom() + : MP4Atom("stco") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty( + new MP4Integer32Property("chunkOffset")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_stdp.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_stdp.cpp @@ -0,0 +1,49 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4StdpAtom::MP4StdpAtom() + : MP4Atom("stdp") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + pCount->SetImplicit(); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty( + new MP4Integer16Property("priority")); +} + +void MP4StdpAtom::Read() +{ + // table entry count computed from atom size + ((MP4Integer32Property*)m_pProperties[2])->SetReadOnly(false); + ((MP4Integer32Property*)m_pProperties[2])->SetValue((m_size - 4) / 2); + ((MP4Integer32Property*)m_pProperties[2])->SetReadOnly(true); + + MP4Atom::Read(); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_stsc.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_stsc.cpp @@ -0,0 +1,78 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4StscAtom::MP4StscAtom() + : MP4Atom("stsc") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty( + new MP4Integer32Property("firstChunk")); + pTable->AddProperty( + new MP4Integer32Property("samplesPerChunk")); + pTable->AddProperty( + new MP4Integer32Property("sampleDescriptionIndex")); + + // As an optimization we add an implicit property to this table, + // "firstSample" that corresponds to the first sample of the firstChunk + MP4Integer32Property* pSample = + new MP4Integer32Property("firstSample"); + pSample->SetImplicit(); + pTable->AddProperty(pSample); +} + +void MP4StscAtom::Read() +{ + // Read as usual + MP4Atom::Read(); + + // Compute the firstSample values for later use + u_int32_t count = + ((MP4Integer32Property*)m_pProperties[2])->GetValue(); + + MP4Integer32Property* pFirstChunk = (MP4Integer32Property*) + ((MP4TableProperty*)m_pProperties[3])->GetProperty(0); + MP4Integer32Property* pSamplesPerChunk = (MP4Integer32Property*) + ((MP4TableProperty*)m_pProperties[3])->GetProperty(1); + MP4Integer32Property* pFirstSample = (MP4Integer32Property*) + ((MP4TableProperty*)m_pProperties[3])->GetProperty(3); + + MP4SampleId sampleId = 1; + + for (u_int32_t i = 0; i < count; i++) { + pFirstSample->SetValue(sampleId, i); + + if (i < count - 1) { + sampleId += + (pFirstChunk->GetValue(i+1) - pFirstChunk->GetValue(i)) + * pSamplesPerChunk->GetValue(i); + } + } +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_stsd.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_stsd.cpp @@ -0,0 +1,61 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +#include "mp4common.h" + +MP4StsdAtom::MP4StsdAtom() + : MP4Atom("stsd") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + pCount->SetReadOnly(); + AddProperty(pCount); + + ExpectChildAtom("mp4a", Optional, Many); + ExpectChildAtom("enca", Optional, Many); + ExpectChildAtom("mp4s", Optional, Many); + ExpectChildAtom("mp4v", Optional, Many); + ExpectChildAtom("encv", Optional, Many); + ExpectChildAtom("rtp ", Optional, Many); +} + +void MP4StsdAtom::Read() +{ + /* do the usual read */ + MP4Atom::Read(); + + // check that number of children == entryCount + MP4Integer32Property* pCount = + (MP4Integer32Property*)m_pProperties[2]; + + if (m_pChildAtoms.Size() != pCount->GetValue()) { + VERBOSE_READ(GetVerbosity(), + printf("Warning: stsd inconsistency with number of entries")); + + /* fix it */ + pCount->SetReadOnly(false); + pCount->SetValue(m_pChildAtoms.Size()); + pCount->SetReadOnly(true); + } +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_stsh.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_stsh.cpp @@ -0,0 +1,40 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4StshAtom::MP4StshAtom() + : MP4Atom("stsh") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty( + new MP4Integer32Property("shadowedSampleNumber")); + pTable->AddProperty( + new MP4Integer32Property("syncSampleNumber")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_stss.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_stss.cpp @@ -0,0 +1,38 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4StssAtom::MP4StssAtom() + : MP4Atom("stss") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty( + new MP4Integer32Property("sampleNumber")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_stsz.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_stsz.cpp @@ -0,0 +1,69 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4StszAtom::MP4StszAtom() + : MP4Atom("stsz") +{ + AddVersionAndFlags(); /* 0, 1 */ + + AddProperty( /* 2 */ + new MP4Integer32Property("sampleSize")); + + MP4Integer32Property* pCount = + new MP4Integer32Property("sampleCount"); + AddProperty(pCount); /* 3 */ + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); /* 4 */ + + pTable->AddProperty( /* 4/0 */ + new MP4Integer32Property("sampleSize")); +} + +void MP4StszAtom::Read() +{ + ReadProperties(0, 4); + + u_int32_t sampleSize = + ((MP4Integer32Property*)m_pProperties[2])->GetValue(); + + // only attempt to read entries table if sampleSize is zero + // i.e sample size is not constant + m_pProperties[4]->SetImplicit(sampleSize != 0); + + ReadProperties(4); + + Skip(); // to end of atom +} + +void MP4StszAtom::Write() +{ + u_int32_t sampleSize = + ((MP4Integer32Property*)m_pProperties[2])->GetValue(); + + // only attempt to write entries table if sampleSize is zero + // i.e sample size is not constant + m_pProperties[4]->SetImplicit(sampleSize != 0); + + MP4Atom::Write(); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_stts.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_stts.cpp @@ -0,0 +1,40 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4SttsAtom::MP4SttsAtom() + : MP4Atom("stts") +{ + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty( + new MP4Integer32Property("sampleCount")); + pTable->AddProperty( + new MP4Integer32Property("sampleDelta")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_tfhd.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_tfhd.cpp @@ -0,0 +1,69 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TfhdAtom::MP4TfhdAtom() + : MP4Atom("tfhd") +{ + AddVersionAndFlags(); /* 0, 1 */ + AddProperty( /* 2 */ + new MP4Integer32Property("trackId")); +} + +void MP4TfhdAtom::AddProperties(u_int32_t flags) +{ + if (flags & 0x01) { + // note this property is signed 64! + AddProperty( + new MP4Integer64Property("baseDataOffset")); + } + if (flags & 0x02) { + AddProperty( + new MP4Integer32Property("sampleDescriptionIndex")); + } + if (flags & 0x08) { + AddProperty( + new MP4Integer32Property("defaultSampleDuration")); + } + if (flags & 0x10) { + AddProperty( + new MP4Integer32Property("defaultSampleSize")); + } + if (flags & 0x20) { + AddProperty( + new MP4Integer32Property("defaultSampleFlags")); + } +} + +void MP4TfhdAtom::Read() +{ + /* read atom version, flags, and trackId */ + ReadProperties(0, 3); + + /* need to create the properties based on the atom flags */ + AddProperties(GetFlags()); + + /* now we can read the remaining properties */ + ReadProperties(3); + + Skip(); // to end of atom +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_tims.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_tims.cpp @@ -0,0 +1,30 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TimsAtom::MP4TimsAtom() + : MP4Atom("tims") +{ + AddProperty( + new MP4Integer32Property("timeScale")); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_tkhd.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_tkhd.cpp @@ -0,0 +1,124 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TkhdAtom::MP4TkhdAtom() + : MP4Atom("tkhd") +{ + AddVersionAndFlags(); +} + +void MP4TkhdAtom::AddProperties(u_int8_t version) +{ + if (version == 1) { + AddProperty( /* 2 */ + new MP4Integer64Property("creationTime")); + AddProperty( /* 3 */ + new MP4Integer64Property("modificationTime")); + } else { // version == 0 + AddProperty( /* 2 */ + new MP4Integer32Property("creationTime")); + AddProperty( /* 3 */ + new MP4Integer32Property("modificationTime")); + } + + AddProperty( /* 4 */ + new MP4Integer32Property("trackId")); + AddReserved("reserved1", 4); /* 5 */ + + if (version == 1) { + AddProperty( /* 6 */ + new MP4Integer64Property("duration")); + } else { + AddProperty( /* 6 */ + new MP4Integer32Property("duration")); + } + + AddReserved("reserved2", 12); /* 7 */ + + MP4Float32Property* pProp; + + pProp = new MP4Float32Property("volume"); + pProp->SetFixed16Format(); + AddProperty(pProp); /* 8 */ + + AddReserved("reserved3", 38); /* 9 */ + + pProp = new MP4Float32Property("width"); + pProp->SetFixed32Format(); + AddProperty(pProp); /* 10 */ + + pProp = new MP4Float32Property("height"); + pProp->SetFixed32Format(); + AddProperty(pProp); /* 11 */ +} + +void MP4TkhdAtom::Generate() +{ + u_int8_t version = m_pFile->Use64Bits() ? 1 : 0; + SetVersion(version); + AddProperties(version); + + MP4Atom::Generate(); + + // set creation and modification times + MP4Timestamp now = MP4GetAbsTimestamp(); + if (version == 1) { + ((MP4Integer64Property*)m_pProperties[2])->SetValue(now); + ((MP4Integer64Property*)m_pProperties[3])->SetValue(now); + } else { + ((MP4Integer32Property*)m_pProperties[2])->SetValue(now); + ((MP4Integer32Property*)m_pProperties[3])->SetValue(now); + } + + // property reserved3 has non-zero fixed values + static u_int8_t reserved3[38] = { + 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, + }; + m_pProperties[9]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[9])-> + SetValue(reserved3, sizeof(reserved3)); + m_pProperties[9]->SetReadOnly(true); +} + +void MP4TkhdAtom::Read() +{ + /* read atom version */ + ReadProperties(0, 1); + + /* need to create the properties based on the atom version */ + AddProperties(GetVersion()); + + /* now we can read the remaining properties */ + ReadProperties(1); + + Skip(); // to end of atom +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_tmax.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_tmax.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TmaxAtom::MP4TmaxAtom() + : MP4Atom("tmax") +{ + AddProperty( // max relative xmit time + new MP4Integer32Property("milliSecs")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_tmin.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_tmin.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TminAtom::MP4TminAtom() + : MP4Atom("tmin") +{ + AddProperty( // min relative xmit time + new MP4Integer32Property("milliSecs")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_tpyl.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_tpyl.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TpylAtom::MP4TpylAtom() + : MP4Atom("tpyl") +{ + AddProperty( // bytes sent of RTP payload data + new MP4Integer64Property("bytes")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_traf.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_traf.cpp @@ -0,0 +1,30 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TrafAtom::MP4TrafAtom() + : MP4Atom("traf") +{ + ExpectChildAtom("tfhd", Required, OnlyOne); + ExpectChildAtom("trun", Optional, Many); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_trak.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_trak.cpp @@ -0,0 +1,32 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TrakAtom::MP4TrakAtom() + : MP4Atom("trak") +{ + ExpectChildAtom("tkhd", Required, OnlyOne); + ExpectChildAtom("tref", Optional, OnlyOne); + ExpectChildAtom("edts", Optional, OnlyOne); + ExpectChildAtom("mdia", Required, OnlyOne); + ExpectChildAtom("udta", Optional, Many); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_tref.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_tref.cpp @@ -0,0 +1,32 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TrefAtom::MP4TrefAtom() + : MP4Atom("tref") +{ + ExpectChildAtom("dpnd", Optional, OnlyOne); + ExpectChildAtom("hint", Optional, OnlyOne); + ExpectChildAtom("ipir", Optional, OnlyOne); + ExpectChildAtom("mpod", Optional, OnlyOne); + ExpectChildAtom("sync", Optional, OnlyOne); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_treftype.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_treftype.cpp @@ -0,0 +1,47 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TrefTypeAtom::MP4TrefTypeAtom(const char* type) + : MP4Atom(type) +{ + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + pCount->SetImplicit(); + AddProperty(pCount); /* 0 */ + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); /* 1 */ + + pTable->AddProperty( /* 1, 0 */ + new MP4Integer32Property("trackId")); +} + +void MP4TrefTypeAtom::Read() +{ + // table entry count computed from atom size + ((MP4Integer32Property*)m_pProperties[0])->SetReadOnly(false); + ((MP4Integer32Property*)m_pProperties[0])->SetValue(m_size / 4); + ((MP4Integer32Property*)m_pProperties[0])->SetReadOnly(true); + + MP4Atom::Read(); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_trex.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_trex.cpp @@ -0,0 +1,39 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TrexAtom::MP4TrexAtom() + : MP4Atom("trex") +{ + AddVersionAndFlags(); /* 0, 1 */ + AddProperty( /* 2 */ + new MP4Integer32Property("trackId")); + AddProperty( /* 3 */ + new MP4Integer32Property("defaultSampleDesriptionIndex")); + AddProperty( /* 4 */ + new MP4Integer32Property("defaultSampleDuration")); + AddProperty( /* 5 */ + new MP4Integer32Property("defaultSampleSize")); + AddProperty( /* 6 */ + new MP4Integer32Property("defaultSampleFlags")); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_trpy.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_trpy.cpp @@ -0,0 +1,29 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TrpyAtom::MP4TrpyAtom() + : MP4Atom("trpy") +{ + AddProperty( // bytes sent including RTP headers + new MP4Integer64Property("bytes")); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_trun.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_trun.cpp @@ -0,0 +1,78 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TrunAtom::MP4TrunAtom() + : MP4Atom("trun") +{ + AddVersionAndFlags(); /* 0, 1 */ + AddProperty( /* 2 */ + new MP4Integer32Property("sampleCount")); +} + +void MP4TrunAtom::AddProperties(u_int32_t flags) +{ + if (flags & 0x01) { + // Note this is a signed 32 value + AddProperty( + new MP4Integer32Property("dataOffset")); + } + if (flags & 0x04) { + AddProperty( + new MP4Integer32Property("firstSampleFlags")); + } + + MP4TableProperty* pTable = + new MP4TableProperty("samples", m_pProperties[2]); + AddProperty(pTable); + + if (flags & 0x100) { + pTable->AddProperty( + new MP4Integer32Property("sampleDuration")); + } + if (flags & 0x200) { + pTable->AddProperty( + new MP4Integer32Property("sampleSize")); + } + if (flags & 0x400) { + pTable->AddProperty( + new MP4Integer32Property("sampleFlags")); + } + if (flags & 0x800) { + pTable->AddProperty( + new MP4Integer32Property("sampleCompositionTimeOffset")); + } +} + +void MP4TrunAtom::Read() +{ + /* read atom version, flags, and sampleCount */ + ReadProperties(0, 3); + + /* need to create the properties based on the atom flags */ + AddProperties(GetFlags()); + + /* now we can read the remaining properties */ + ReadProperties(3); + + Skip(); // to end of atom +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_tsro.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_tsro.cpp @@ -0,0 +1,30 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4TsroAtom::MP4TsroAtom() + : MP4Atom("tsro") +{ + AddProperty( + new MP4Integer32Property("offset")); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_udta.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_udta.cpp @@ -0,0 +1,39 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4UdtaAtom::MP4UdtaAtom() + : MP4Atom("udta") +{ + ExpectChildAtom("cprt", Optional, Many); + ExpectChildAtom("hnti", Optional, OnlyOne); + ExpectChildAtom("meta", Optional, OnlyOne); +} + +void MP4UdtaAtom::Read() +{ + if (ATOMID(m_pParentAtom->GetType()) == ATOMID("trak")) { + ExpectChildAtom("hinf", Optional, OnlyOne); + } + + MP4Atom::Read(); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_url.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_url.cpp @@ -0,0 +1,63 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4UrlAtom::MP4UrlAtom() + : MP4Atom("url ") +{ + AddVersionAndFlags(); + AddProperty(new MP4StringProperty("location")); +} + +void MP4UrlAtom::Read() +{ + // read the version and flags properties + ReadProperties(0, 2); + + // check if self-contained flag is set + if (!(GetFlags() & 1)) { + // if not then read url location + ReadProperties(2); + } + + Skip(); // to end of atom +} + +void MP4UrlAtom::Write() +{ + MP4StringProperty* pLocationProp = + (MP4StringProperty*)m_pProperties[2]; + + // if no url location has been set + // then set self-contained flag + // and don't attempt to write anything + if (pLocationProp->GetValue() == NULL) { + SetFlags(GetFlags() | 1); + pLocationProp->SetImplicit(true); + } else { + SetFlags(GetFlags() & 0xFFFFFE); + pLocationProp->SetImplicit(false); + } + + // write atom as usual + MP4Atom::Write(); +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_urn.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_urn.cpp @@ -0,0 +1,44 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4UrnAtom::MP4UrnAtom() + : MP4Atom("urn ") +{ + AddVersionAndFlags(); + AddProperty(new MP4StringProperty("name")); + AddProperty(new MP4StringProperty("location")); +} + +void MP4UrnAtom::Read() +{ + // read the version, flags, and name properties + ReadProperties(0, 3); + + // check if location is present + if (m_pFile->GetPosition() < GetEnd()) { + // read it + ReadProperties(3); + } + + Skip(); // to end of atom +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atom_vmhd.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atom_vmhd.cpp @@ -0,0 +1,37 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4VmhdAtom::MP4VmhdAtom() + : MP4Atom("vmhd") +{ + AddVersionAndFlags(); + AddReserved("reserved", 8); +} + +void MP4VmhdAtom::Generate() +{ + MP4Atom::Generate(); + + SetFlags(1); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/atoms.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/atoms.h @@ -0,0 +1,593 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MP4_ATOMS_INCLUDED__ +#define __MP4_ATOMS_INCLUDED__ + +// declare all the atom subclasses +// i.e. spare us atom_xxxx.h for all the atoms +// +// The majority of atoms just need their own constructor declared +// Some atoms have a few special needs +// A small minority of atoms need lots of special handling + +class MP4RootAtom : public MP4Atom { +public: + MP4RootAtom(); + void BeginWrite(bool use64 = false); + void Write(); + void FinishWrite(bool use64 = false); + + void BeginOptimalWrite(); + void FinishOptimalWrite(); + +protected: + u_int32_t GetLastMdatIndex(); + void WriteAtomType(const char* type, bool onlyOne); +}; + +class MP4FtypAtom : public MP4Atom { +public: + MP4FtypAtom(); + void Generate(); + void Read(); +}; + +class MP4MdatAtom : public MP4Atom { +public: + MP4MdatAtom(); + void Read(); + void Write(); +}; + +class MP4MoovAtom : public MP4Atom { +public: + MP4MoovAtom(); +}; + +class MP4MvhdAtom : public MP4Atom { +public: + MP4MvhdAtom(); + void Generate(); + void Read(); +protected: + void AddProperties(u_int8_t version); +}; + +class MP4IodsAtom : public MP4Atom { +public: + MP4IodsAtom(); +}; + +class MP4TrakAtom : public MP4Atom { +public: + MP4TrakAtom(); +}; + +class MP4TkhdAtom : public MP4Atom { +public: + MP4TkhdAtom(); + void Generate(); + void Read(); +protected: + void AddProperties(u_int8_t version); +}; + +class MP4TrefAtom : public MP4Atom { +public: + MP4TrefAtom(); +}; + +class MP4TrefTypeAtom : public MP4Atom { +public: + MP4TrefTypeAtom(const char* type); + void Read(); +}; + +class MP4MdiaAtom : public MP4Atom { +public: + MP4MdiaAtom(); +}; + +class MP4MdhdAtom : public MP4Atom { +public: + MP4MdhdAtom(); + void Generate(); + void Read(); +protected: + void AddProperties(u_int8_t version); +}; + +class MP4HdlrAtom : public MP4Atom { +public: + MP4HdlrAtom(); + void Read(); +}; + +class MP4MinfAtom : public MP4Atom { +public: + MP4MinfAtom(); +}; + +class MP4VmhdAtom : public MP4Atom { +public: + MP4VmhdAtom(); + void Generate(); +}; + +class MP4SmhdAtom : public MP4Atom { +public: + MP4SmhdAtom(); +}; + +class MP4HmhdAtom : public MP4Atom { +public: + MP4HmhdAtom(); +}; + +class MP4NmhdAtom : public MP4Atom { +public: + MP4NmhdAtom(); +}; + +class MP4DinfAtom : public MP4Atom { +public: + MP4DinfAtom(); +}; + +class MP4DrefAtom : public MP4Atom { +public: + MP4DrefAtom(); + void Read(); +}; + +class MP4UrlAtom : public MP4Atom { +public: + MP4UrlAtom(); + void Read(); + void Write(); +}; + +class MP4UrnAtom : public MP4Atom { +public: + MP4UrnAtom(); + void Read(); +}; + +class MP4StblAtom : public MP4Atom { +public: + MP4StblAtom(); + void Generate(); +}; + +class MP4StsdAtom : public MP4Atom { +public: + MP4StsdAtom(); + void Read(); +}; + +class MP4Mp4aAtom : public MP4Atom { +public: + MP4Mp4aAtom(); + void Generate(); +}; + +class MP4Mp4sAtom : public MP4Atom { +public: + MP4Mp4sAtom(); + void Generate(); +}; + +class MP4Mp4vAtom : public MP4Atom { +public: + MP4Mp4vAtom(); + void Generate(); +}; + +class MP4EsdsAtom : public MP4Atom { +public: + MP4EsdsAtom(); +}; + +class MP4SttsAtom : public MP4Atom { +public: + MP4SttsAtom(); +}; + +class MP4CttsAtom : public MP4Atom { +public: + MP4CttsAtom(); +}; + +class MP4StszAtom : public MP4Atom { +public: + MP4StszAtom(); + void Read(); + void Write(); +}; + +class MP4StscAtom : public MP4Atom { +public: + MP4StscAtom(); + void Read(); +}; + +class MP4StcoAtom : public MP4Atom { +public: + MP4StcoAtom(); +}; + +class MP4Co64Atom : public MP4Atom { +public: + MP4Co64Atom(); +}; + +class MP4StssAtom : public MP4Atom { +public: + MP4StssAtom(); +}; + +class MP4StshAtom : public MP4Atom { +public: + MP4StshAtom(); +}; + +class MP4StdpAtom : public MP4Atom { +public: + MP4StdpAtom(); + void Read(); +}; + +class MP4EdtsAtom : public MP4Atom { +public: + MP4EdtsAtom(); +}; + +class MP4ElstAtom : public MP4Atom { +public: + MP4ElstAtom(); + void Generate(); + void Read(); +protected: + void AddProperties(u_int8_t version); +}; + +class MP4UdtaAtom : public MP4Atom { +public: + MP4UdtaAtom(); + void Read(); +}; + +class MP4CprtAtom : public MP4Atom { +public: + MP4CprtAtom(); +}; + +class MP4HntiAtom : public MP4Atom { +public: + MP4HntiAtom(); + void Read(); +}; + +class MP4RtpAtom : public MP4Atom { +public: + MP4RtpAtom(); + void Generate(); + void Read(); + void Write(); + +protected: + void AddPropertiesStsdType(); + void AddPropertiesHntiType(); + + void GenerateStsdType(); + void GenerateHntiType(); + + void ReadStsdType(); + void ReadHntiType(); + + void WriteHntiType(); +}; + +class MP4TimsAtom : public MP4Atom { +public: + MP4TimsAtom(); +}; + +class MP4TsroAtom : public MP4Atom { +public: + MP4TsroAtom(); +}; + +class MP4SnroAtom : public MP4Atom { +public: + MP4SnroAtom(); +}; + +class MP4SdpAtom : public MP4Atom { +public: + MP4SdpAtom(); + void Read(); + void Write(); +}; + +class MP4HinfAtom : public MP4Atom { +public: + MP4HinfAtom(); + void Generate(); +}; + +class MP4TrpyAtom : public MP4Atom { +public: + MP4TrpyAtom(); +}; + +class MP4NumpAtom : public MP4Atom { +public: + MP4NumpAtom(); +}; + +class MP4TpylAtom : public MP4Atom { +public: + MP4TpylAtom(); +}; + +class MP4MaxrAtom : public MP4Atom { +public: + MP4MaxrAtom(); +}; + +class MP4DmedAtom : public MP4Atom { +public: + MP4DmedAtom(); +}; + +class MP4DimmAtom : public MP4Atom { +public: + MP4DimmAtom(); +}; + +class MP4DrepAtom : public MP4Atom { +public: + MP4DrepAtom(); +}; + +class MP4TminAtom : public MP4Atom { +public: + MP4TminAtom(); +}; + +class MP4TmaxAtom : public MP4Atom { +public: + MP4TmaxAtom(); +}; + +class MP4PmaxAtom : public MP4Atom { +public: + MP4PmaxAtom(); +}; + +class MP4DmaxAtom : public MP4Atom { +public: + MP4DmaxAtom(); +}; + +class MP4PaytAtom : public MP4Atom { +public: + MP4PaytAtom(); +}; + +class MP4MvexAtom : public MP4Atom { +public: + MP4MvexAtom(); +}; + +class MP4TrexAtom : public MP4Atom { +public: + MP4TrexAtom(); +}; + +class MP4MoofAtom : public MP4Atom { +public: + MP4MoofAtom(); +}; + +class MP4MfhdAtom : public MP4Atom { +public: + MP4MfhdAtom(); +}; + +class MP4TrafAtom : public MP4Atom { +public: + MP4TrafAtom(); +}; + +class MP4TfhdAtom : public MP4Atom { +public: + MP4TfhdAtom(); + void Read(); +protected: + void AddProperties(u_int32_t flags); +}; + +class MP4TrunAtom : public MP4Atom { +public: + MP4TrunAtom(); + void Read(); +protected: + void AddProperties(u_int32_t flags); +}; + +class MP4FreeAtom : public MP4Atom { +public: + MP4FreeAtom(); + void Read(); + void Write(); +}; + +// ismacrypt +class MP4EncaAtom : public MP4Atom { +public: + MP4EncaAtom(); + void Generate(); +}; + +class MP4EncvAtom : public MP4Atom { +public: + MP4EncvAtom(); + void Generate(); +}; + +class MP4FrmaAtom : public MP4Atom { +public: + MP4FrmaAtom(); +}; + +class MP4IKMSAtom : public MP4Atom { +public: + MP4IKMSAtom(); +}; + +class MP4ISFMAtom : public MP4Atom { +public: + MP4ISFMAtom(); +}; + +class MP4SchiAtom : public MP4Atom { +public: + MP4SchiAtom(); +}; + +class MP4SchmAtom : public MP4Atom { +public: + MP4SchmAtom(); +}; + +class MP4SinfAtom : public MP4Atom { +public: + MP4SinfAtom(); +}; + +/* iTunes META data atoms */ +class MP4MetaAtom : public MP4Atom { +public: + MP4MetaAtom(); +}; + +class MP4NameAtom : public MP4Atom { +public: + MP4NameAtom(); + void Read(); +}; + +class MP4MeanAtom : public MP4Atom { +public: + MP4MeanAtom(); + void Read(); +}; + +class MP4DataAtom : public MP4Atom { +public: + MP4DataAtom(); + void Read(); +}; + +class MP4IlstAtom : public MP4Atom { +public: + MP4IlstAtom(); +}; + +class MP4DashAtom : public MP4Atom { +public: + MP4DashAtom(); +}; + +class MP4NamAtom : public MP4Atom { +public: + MP4NamAtom(); +}; + +class MP4ArtAtom : public MP4Atom { +public: + MP4ArtAtom(); +}; + +class MP4WrtAtom : public MP4Atom { +public: + MP4WrtAtom(); +}; + +class MP4AlbAtom : public MP4Atom { +public: + MP4AlbAtom(); +}; + +class MP4GenAtom : public MP4Atom { +public: + MP4GenAtom(); +}; + +class MP4TrknAtom : public MP4Atom { +public: + MP4TrknAtom(); +}; + +class MP4DayAtom : public MP4Atom { +public: + MP4DayAtom(); +}; + +class MP4TooAtom : public MP4Atom { +public: + MP4TooAtom(); +}; + +class MP4GnreAtom : public MP4Atom { +public: + MP4GnreAtom(); +}; + +class MP4CpilAtom : public MP4Atom { +public: + MP4CpilAtom(); +}; + +class MP4TmpoAtom : public MP4Atom { +public: + MP4TmpoAtom(); +}; + +class MP4CovrAtom : public MP4Atom { +public: + MP4CovrAtom(); +}; + +class MP4CmtAtom : public MP4Atom { +public: + MP4CmtAtom(); +}; + +class MP4DiskAtom : public MP4Atom { +public: + MP4DiskAtom(); +}; + +#endif /* __MP4_ATOMS_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/bootstrap +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/bootstrap @@ -0,0 +1,6 @@ +aclocal -I . +autoheader +libtoolize --automake +automake --add-missing +autoconf +./configure --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/descriptors.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/descriptors.cpp @@ -0,0 +1,634 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4IODescriptor::MP4IODescriptor() + : MP4Descriptor(MP4FileIODescrTag) +{ + /* N.B. other member functions depend on the property indicies */ + AddProperty( /* 0 */ + new MP4BitfieldProperty("objectDescriptorId", 10)); + AddProperty( /* 1 */ + new MP4BitfieldProperty("URLFlag", 1)); + AddProperty( /* 2 */ + new MP4BitfieldProperty("includeInlineProfileLevelFlag", 1)); + AddProperty( /* 3 */ + new MP4BitfieldProperty("reserved", 4)); + AddProperty( /* 4 */ + new MP4StringProperty("URL", Counted)); + AddProperty( /* 5 */ + new MP4Integer8Property("ODProfileLevelId")); + AddProperty( /* 6 */ + new MP4Integer8Property("sceneProfileLevelId")); + AddProperty( /* 7 */ + new MP4Integer8Property("audioProfileLevelId")); + AddProperty( /* 8 */ + new MP4Integer8Property("visualProfileLevelId")); + AddProperty( /* 9 */ + new MP4Integer8Property("graphicsProfileLevelId")); + AddProperty( /* 10 */ + new MP4DescriptorProperty("esIds", + MP4ESIDIncDescrTag, 0, Required, Many)); + AddProperty( /* 11 */ + new MP4DescriptorProperty("ociDescr", + MP4OCIDescrTagsStart, MP4OCIDescrTagsEnd, Optional, Many)); + AddProperty( /* 12 */ + new MP4DescriptorProperty("ipmpDescrPtr", + MP4IPMPPtrDescrTag, 0, Optional, Many)); + AddProperty( /* 13 */ + new MP4DescriptorProperty("extDescr", + MP4ExtDescrTagsStart, MP4ExtDescrTagsEnd, Optional, Many)); + + SetReadMutate(2); +} + +void MP4IODescriptor::Generate() +{ + ((MP4BitfieldProperty*)m_pProperties[0])->SetValue(1); + ((MP4BitfieldProperty*)m_pProperties[3])->SetValue(0xF); + for (u_int32_t i = 5; i <= 9; i++) { + ((MP4Integer8Property*)m_pProperties[i])->SetValue(0xFF); + } +} + +void MP4IODescriptor::Mutate() +{ + bool urlFlag = ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(); + + m_pProperties[4]->SetImplicit(!urlFlag); + for (u_int32_t i = 5; i <= 12; i++) { + m_pProperties[i]->SetImplicit(urlFlag); + } +} + +MP4ODescriptor::MP4ODescriptor() + : MP4Descriptor(MP4FileODescrTag) +{ + /* N.B. other member functions depend on the property indicies */ + AddProperty( /* 0 */ + new MP4BitfieldProperty("objectDescriptorId", 10)); + AddProperty( /* 1 */ + new MP4BitfieldProperty("URLFlag", 1)); + AddProperty( /* 2 */ + new MP4BitfieldProperty("reserved", 5)); + AddProperty( /* 3 */ + new MP4StringProperty("URL", Counted)); + AddProperty( /* 4 */ + new MP4DescriptorProperty("esIds", + MP4ESIDRefDescrTag, 0, Required, Many)); + AddProperty( /* 5 */ + new MP4DescriptorProperty("ociDescr", + MP4OCIDescrTagsStart, MP4OCIDescrTagsEnd, Optional, Many)); + AddProperty( /* 6 */ + new MP4DescriptorProperty("ipmpDescrPtr", + MP4IPMPPtrDescrTag, 0, Optional, Many)); + AddProperty( /* 7 */ + new MP4DescriptorProperty("extDescr", + MP4ExtDescrTagsStart, MP4ExtDescrTagsEnd, Optional, Many)); + + SetReadMutate(2); +} + +void MP4ODescriptor::Generate() +{ + ((MP4BitfieldProperty*)m_pProperties[2])->SetValue(0x1F); +} + +void MP4ODescriptor::Mutate() +{ + bool urlFlag = ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(); + + m_pProperties[3]->SetImplicit(!urlFlag); + for (u_int32_t i = 4; i <= 6; i++) { + m_pProperties[i]->SetImplicit(urlFlag); + } +} + +MP4ESIDIncDescriptor::MP4ESIDIncDescriptor() + : MP4Descriptor(MP4ESIDIncDescrTag) +{ + AddProperty( /* 0 */ + new MP4Integer32Property("id")); +} + +MP4ESIDRefDescriptor::MP4ESIDRefDescriptor() + : MP4Descriptor(MP4ESIDRefDescrTag) +{ + AddProperty( /* 0 */ + new MP4Integer16Property("refIndex")); +} + +MP4ESDescriptor::MP4ESDescriptor() + : MP4Descriptor(MP4ESDescrTag) +{ + /* N.B. other class functions depend on the property indicies */ + AddProperty( /* 0 */ + new MP4Integer16Property("ESID")); + AddProperty( /* 1 */ + new MP4BitfieldProperty("streamDependenceFlag", 1)); + AddProperty( /* 2 */ + new MP4BitfieldProperty("URLFlag", 1)); + AddProperty( /* 3 */ + new MP4BitfieldProperty("OCRstreamFlag", 1)); + AddProperty( /* 4 */ + new MP4BitfieldProperty("streamPriority", 5)); + AddProperty( /* 5 */ + new MP4Integer16Property("dependsOnESID")); + AddProperty( /* 6 */ + new MP4StringProperty("URL", Counted)); + AddProperty( /* 7 */ + new MP4Integer16Property("OCRESID")); + AddProperty( /* 8 */ + new MP4DescriptorProperty("decConfigDescr", + MP4DecConfigDescrTag, 0, Required, OnlyOne)); + AddProperty( /* 9 */ + new MP4DescriptorProperty("slConfigDescr", + MP4SLConfigDescrTag, 0, Required, OnlyOne)); + AddProperty( /* 10 */ + new MP4DescriptorProperty("ipiPtr", + MP4IPIPtrDescrTag, 0, Optional, OnlyOne)); + AddProperty( /* 11 */ + new MP4DescriptorProperty("ipIds", + MP4ContentIdDescrTag, MP4SupplContentIdDescrTag, Optional, Many)); + AddProperty( /* 12 */ + new MP4DescriptorProperty("ipmpDescrPtr", + MP4IPMPPtrDescrTag, 0, Optional, Many)); + AddProperty( /* 13 */ + new MP4DescriptorProperty("langDescr", + MP4LanguageDescrTag, 0, Optional, Many)); + AddProperty( /* 14 */ + new MP4DescriptorProperty("qosDescr", + MP4QosDescrTag, 0, Optional, OnlyOne)); + AddProperty( /* 15 */ + new MP4DescriptorProperty("regDescr", + MP4RegistrationDescrTag, 0, Optional, OnlyOne)); + AddProperty( /* 16 */ + new MP4DescriptorProperty("extDescr", + MP4ExtDescrTagsStart, MP4ExtDescrTagsEnd, Optional, Many)); + + SetReadMutate(5); +} + +void MP4ESDescriptor::Mutate() +{ + bool streamDependFlag = + ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(); + m_pProperties[5]->SetImplicit(!streamDependFlag); + + bool urlFlag = + ((MP4BitfieldProperty*)m_pProperties[2])->GetValue(); + m_pProperties[6]->SetImplicit(!urlFlag); + + bool ocrFlag = + ((MP4BitfieldProperty*)m_pProperties[3])->GetValue(); + m_pProperties[7]->SetImplicit(!ocrFlag); +} + +MP4DecConfigDescriptor::MP4DecConfigDescriptor() + : MP4Descriptor(MP4DecConfigDescrTag) +{ + AddProperty( /* 0 */ + new MP4Integer8Property("objectTypeId")); + AddProperty( /* 1 */ + new MP4BitfieldProperty("streamType", 6)); + AddProperty( /* 2 */ + new MP4BitfieldProperty("upStream", 1)); + AddProperty( /* 3 */ + new MP4BitfieldProperty("reserved", 1)); + AddProperty( /* 4 */ + new MP4BitfieldProperty("bufferSizeDB", 24)); + AddProperty( /* 5 */ + new MP4Integer32Property("maxBitrate")); + AddProperty( /* 6 */ + new MP4Integer32Property("avgBitrate")); + AddProperty( /* 7 */ + new MP4DescriptorProperty("decSpecificInfo", + MP4DecSpecificDescrTag, 0, Optional, OnlyOne)); + AddProperty( /* 8 */ + new MP4DescriptorProperty("profileLevelIndicationIndexDescr", + MP4ExtProfileLevelDescrTag, 0, Optional, Many)); +} + +void MP4DecConfigDescriptor::Generate() +{ + ((MP4BitfieldProperty*)m_pProperties[3])->SetValue(1); +} + +MP4DecSpecificDescriptor::MP4DecSpecificDescriptor() + : MP4Descriptor(MP4DecSpecificDescrTag) +{ + AddProperty( /* 0 */ + new MP4BytesProperty("info")); +} + +void MP4DecSpecificDescriptor::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + /* byte properties need to know how long they are before reading */ + ((MP4BytesProperty*)m_pProperties[0])->SetValueSize(m_size); + + ReadProperties(pFile); +} + +MP4SLConfigDescriptor::MP4SLConfigDescriptor() + : MP4Descriptor(MP4SLConfigDescrTag) +{ + AddProperty( /* 0 */ + new MP4Integer8Property("predefined")); + AddProperty( /* 1 */ + new MP4BitfieldProperty("useAccessUnitStartFlag", 1)); + AddProperty( /* 2 */ + new MP4BitfieldProperty("useAccessUnitEndFlag", 1)); + AddProperty( /* 3 */ + new MP4BitfieldProperty("useRandomAccessPointFlag", 1)); + AddProperty( /* 4 */ + new MP4BitfieldProperty("hasRandomAccessUnitsOnlyFlag", 1)); + AddProperty( /* 5 */ + new MP4BitfieldProperty("usePaddingFlag", 1)); + AddProperty( /* 6 */ + new MP4BitfieldProperty("useTimeStampsFlag", 1)); + AddProperty( /* 7 */ + new MP4BitfieldProperty("useIdleFlag", 1)); + AddProperty( /* 8 */ + new MP4BitfieldProperty("durationFlag", 1)); + AddProperty( /* 9 */ + new MP4Integer32Property("timeStampResolution")); + AddProperty( /* 10 */ + new MP4Integer32Property("OCRResolution")); + AddProperty( /* 11 */ + new MP4Integer8Property("timeStampLength")); + AddProperty( /* 12 */ + new MP4Integer8Property("OCRLength")); + AddProperty( /* 13 */ + new MP4Integer8Property("AULength")); + AddProperty( /* 14 */ + new MP4Integer8Property("instantBitrateLength")); + AddProperty( /* 15 */ + new MP4BitfieldProperty("degradationPriortyLength", 4)); + AddProperty( /* 16 */ + new MP4BitfieldProperty("AUSeqNumLength", 5)); + AddProperty( /* 17 */ + new MP4BitfieldProperty("packetSeqNumLength", 5)); + AddProperty( /* 18 */ + new MP4BitfieldProperty("reserved", 2)); + + // if durationFlag + AddProperty( /* 19 */ + new MP4Integer32Property("timeScale")); + AddProperty( /* 20 */ + new MP4Integer16Property("accessUnitDuration")); + AddProperty( /* 21 */ + new MP4Integer16Property("compositionUnitDuration")); + + // if !useTimeStampsFlag + AddProperty( /* 22 */ + new MP4BitfieldProperty("startDecodingTimeStamp", 64)); + AddProperty( /* 23 */ + new MP4BitfieldProperty("startCompositionTimeStamp", 64)); +} + +void MP4SLConfigDescriptor::Generate() +{ + // by default all tracks in an mp4 file + // use predefined SLConfig descriptor == 2 + ((MP4Integer8Property*)m_pProperties[0])->SetValue(2); + + // which implies UseTimestampsFlag = 1 + ((MP4BitfieldProperty*)m_pProperties[6])->SetValue(1); + + // reserved = 3 + ((MP4BitfieldProperty*)m_pProperties[18])->SetValue(3); +} + +void MP4SLConfigDescriptor::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + // read the first property, 'predefined' + ReadProperties(pFile, 0, 1); + + // if predefined == 0 + if (((MP4Integer8Property*)m_pProperties[0])->GetValue() == 0) { + + /* read the next 18 properties */ + ReadProperties(pFile, 1, 18); + } + + // now mutate + Mutate(); + + // and read the remaining properties + ReadProperties(pFile, 19); +} + +void MP4SLConfigDescriptor::Mutate() +{ + u_int32_t i; + u_int8_t predefined = + ((MP4Integer8Property*)m_pProperties[0])->GetValue(); + + if (predefined) { + // properties 1-18 are implicit + for (i = 1; i < m_pProperties.Size(); i++) { + m_pProperties[i]->SetImplicit(true); + } + + if (predefined == 1) { + // UseTimestampsFlag = 0 + ((MP4BitfieldProperty*)m_pProperties[6])->SetValue(0); + + // TimestampResolution = 1000 + ((MP4Integer32Property*)m_pProperties[9])->SetValue(1000); + + // TimeStampLength = 32 + ((MP4Integer8Property*)m_pProperties[11])->SetValue(32); + + } else if (predefined == 2) { + // UseTimestampsFlag = 1 + ((MP4BitfieldProperty*)m_pProperties[6])->SetValue(1); + } + } else { +#if 1 + for (i = 1; i <= 18; i++) { + m_pProperties[i]->SetImplicit(false); + } + ((MP4BitfieldProperty*)m_pProperties[18])->SetValue(3); +#endif + } + + bool durationFlag = + ((MP4BitfieldProperty*)m_pProperties[8])->GetValue(); + + for (i = 19; i <= 21; i++) { + m_pProperties[i]->SetImplicit(!durationFlag); + } + + bool useTimeStampsFlag = + ((MP4BitfieldProperty*)m_pProperties[6])->GetValue(); + + for (i = 22; i <= 23; i++) { + m_pProperties[i]->SetImplicit(useTimeStampsFlag); + + u_int8_t timeStampLength = MIN(64, + ((MP4Integer8Property*)m_pProperties[11])->GetValue()); + + ((MP4BitfieldProperty*)m_pProperties[i])->SetNumBits(timeStampLength); + + // handle a nonsensical situation gracefully + if (timeStampLength == 0) { + m_pProperties[i]->SetImplicit(true); + } + } +} + +MP4IPIPtrDescriptor::MP4IPIPtrDescriptor() + : MP4Descriptor(MP4IPIPtrDescrTag) +{ + AddProperty( /* 0 */ + new MP4Integer16Property("IPIESId")); +} + +MP4ContentIdDescriptor::MP4ContentIdDescriptor() + : MP4Descriptor(MP4ContentIdDescrTag) +{ + AddProperty( /* 0 */ + new MP4BitfieldProperty("compatibility", 2)); + AddProperty( /* 1 */ + new MP4BitfieldProperty("contentTypeFlag", 1)); + AddProperty( /* 2 */ + new MP4BitfieldProperty("contentIdFlag", 1)); + AddProperty( /* 3 */ + new MP4BitfieldProperty("protectedContent", 1)); + AddProperty( /* 4 */ + new MP4BitfieldProperty("reserved", 3)); + AddProperty( /* 5 */ + new MP4Integer8Property("contentType")); + AddProperty( /* 6 */ + new MP4Integer8Property("contentIdType")); + AddProperty( /* 7 */ + new MP4BytesProperty("contentId")); +} + +void MP4ContentIdDescriptor::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + /* read the first property, 'compatiblity' */ + ReadProperties(pFile, 0, 1); + + /* if compatiblity != 0 */ + if (((MP4Integer8Property*)m_pProperties[0])->GetValue() != 0) { + /* we don't understand it */ + VERBOSE_READ(pFile->GetVerbosity(), + printf("incompatible content id descriptor\n")); + return; + } + + /* read the next four properties */ + ReadProperties(pFile, 1, 4); + + /* which allows us to reconfigure ourselves */ + Mutate(); + + /* read the remaining properties */ + ReadProperties(pFile, 5); +} + +void MP4ContentIdDescriptor::Mutate() +{ + bool contentTypeFlag = ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(); + m_pProperties[5]->SetImplicit(!contentTypeFlag); + + bool contentIdFlag = ((MP4BitfieldProperty*)m_pProperties[2])->GetValue(); + m_pProperties[6]->SetImplicit(!contentIdFlag); + m_pProperties[7]->SetImplicit(!contentIdFlag); +} + +MP4SupplContentIdDescriptor::MP4SupplContentIdDescriptor() + : MP4Descriptor(MP4SupplContentIdDescrTag) +{ + AddProperty( /* 0 */ + new MP4BytesProperty("languageCode", 3)); + AddProperty( /* 1 */ + new MP4StringProperty("title", Counted)); + AddProperty( /* 2 */ + new MP4StringProperty("value", Counted)); +} + +MP4IPMPPtrDescriptor::MP4IPMPPtrDescriptor() + : MP4Descriptor(MP4IPMPPtrDescrTag) +{ + AddProperty( /* 0 */ + new MP4Integer8Property("IPMPDescriptorId")); +} + +MP4IPMPDescriptor::MP4IPMPDescriptor() + : MP4Descriptor(MP4IPMPDescrTag) +{ + AddProperty( /* 0 */ + new MP4Integer8Property("IPMPDescriptorId")); + AddProperty( /* 1 */ + new MP4Integer16Property("IPMPSType")); + AddProperty( /* 2 */ + new MP4BytesProperty("IPMPData")); + /* note: if IPMPSType == 0, IPMPData is an URL */ +} + +void MP4IPMPDescriptor::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + /* byte properties need to know how long they are before reading */ + ((MP4BytesProperty*)m_pProperties[2])->SetValueSize(m_size - 3); + + ReadProperties(pFile); +} + +MP4RegistrationDescriptor::MP4RegistrationDescriptor() + : MP4Descriptor(MP4RegistrationDescrTag) +{ + AddProperty( /* 0 */ + new MP4Integer32Property("formatIdentifier")); + AddProperty( /* 1 */ + new MP4BytesProperty("additionalIdentificationInfo")); +} + +void MP4RegistrationDescriptor::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + /* byte properties need to know how long they are before reading */ + ((MP4BytesProperty*)m_pProperties[1])->SetValueSize(m_size - 4); + + ReadProperties(pFile); +} + +MP4ExtProfileLevelDescriptor::MP4ExtProfileLevelDescriptor() + : MP4Descriptor(MP4ExtProfileLevelDescrTag) +{ + AddProperty( /* 0 */ + new MP4Integer8Property("profileLevelIndicationIndex")); + AddProperty( /* 1 */ + new MP4Integer8Property("ODProfileLevelIndication")); + AddProperty( /* 2 */ + new MP4Integer8Property("sceneProfileLevelIndication")); + AddProperty( /* 3 */ + new MP4Integer8Property("audioProfileLevelIndication")); + AddProperty( /* 4 */ + new MP4Integer8Property("visualProfileLevelIndication")); + AddProperty( /* 5 */ + new MP4Integer8Property("graphicsProfileLevelIndication")); + AddProperty( /* 6 */ + new MP4Integer8Property("MPEGJProfileLevelIndication")); +} + +MP4ExtensionDescriptor::MP4ExtensionDescriptor() + : MP4Descriptor() +{ + AddProperty( /* 0 */ + new MP4BytesProperty("data")); +} + +void MP4ExtensionDescriptor::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + /* byte properties need to know how long they are before reading */ + ((MP4BytesProperty*)m_pProperties[0])->SetValueSize(m_size); + + ReadProperties(pFile); +} + +MP4Descriptor* MP4DescriptorProperty::CreateDescriptor(u_int8_t tag) +{ + MP4Descriptor* pDescriptor = NULL; + + switch (tag) { + case MP4ESDescrTag: + pDescriptor = new MP4ESDescriptor(); + break; + case MP4DecConfigDescrTag: + pDescriptor = new MP4DecConfigDescriptor(); + break; + case MP4DecSpecificDescrTag: + pDescriptor = new MP4DecSpecificDescriptor(); + break; + case MP4SLConfigDescrTag: + pDescriptor = new MP4SLConfigDescriptor(); + break; + case MP4ContentIdDescrTag: + pDescriptor = new MP4ContentIdDescriptor(); + break; + case MP4SupplContentIdDescrTag: + pDescriptor = new MP4SupplContentIdDescriptor(); + break; + case MP4IPIPtrDescrTag: + pDescriptor = new MP4IPIPtrDescriptor(); + break; + case MP4IPMPPtrDescrTag: + pDescriptor = new MP4IPMPPtrDescriptor(); + break; + case MP4IPMPDescrTag: + pDescriptor = new MP4IPMPDescriptor(); + break; + case MP4QosDescrTag: + pDescriptor = new MP4QosDescriptor(); + break; + case MP4RegistrationDescrTag: + pDescriptor = new MP4RegistrationDescriptor(); + break; + case MP4ESIDIncDescrTag: + pDescriptor = new MP4ESIDIncDescriptor(); + break; + case MP4ESIDRefDescrTag: + pDescriptor = new MP4ESIDRefDescriptor(); + break; + case MP4IODescrTag: + case MP4FileIODescrTag: + pDescriptor = new MP4IODescriptor(); + pDescriptor->SetTag(tag); + break; + case MP4ODescrTag: + case MP4FileODescrTag: + pDescriptor = new MP4ODescriptor(); + pDescriptor->SetTag(tag); + break; + case MP4ExtProfileLevelDescrTag: + pDescriptor = new MP4ExtProfileLevelDescriptor(); + break; + } + + if (pDescriptor == NULL) { + if (tag >= MP4OCIDescrTagsStart && tag <= MP4OCIDescrTagsEnd) { + pDescriptor = CreateOCIDescriptor(tag); + } + + if (tag >= MP4ExtDescrTagsStart && tag <= MP4ExtDescrTagsEnd) { + pDescriptor = new MP4ExtensionDescriptor(); + pDescriptor->SetTag(tag); + } + } + + return pDescriptor; +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/descriptors.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/descriptors.h @@ -0,0 +1,164 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __DESCRIPTORS_INCLUDED__ +#define __DESCRIPTORS_INCLUDED__ + +const u_int8_t MP4ODescrTag = 0x01; +const u_int8_t MP4IODescrTag = 0x02; +const u_int8_t MP4ESDescrTag = 0x03; +const u_int8_t MP4DecConfigDescrTag = 0x04; +const u_int8_t MP4DecSpecificDescrTag = 0x05; +const u_int8_t MP4SLConfigDescrTag = 0x06; +const u_int8_t MP4ContentIdDescrTag = 0x07; +const u_int8_t MP4SupplContentIdDescrTag = 0x08; +const u_int8_t MP4IPIPtrDescrTag = 0x09; +const u_int8_t MP4IPMPPtrDescrTag = 0x0A; +const u_int8_t MP4IPMPDescrTag = 0x0B; +const u_int8_t MP4RegistrationDescrTag = 0x0D; +const u_int8_t MP4ESIDIncDescrTag = 0x0E; +const u_int8_t MP4ESIDRefDescrTag = 0x0F; +const u_int8_t MP4FileIODescrTag = 0x10; +const u_int8_t MP4FileODescrTag = 0x11; +const u_int8_t MP4ExtProfileLevelDescrTag = 0x13; +const u_int8_t MP4ExtDescrTagsStart = 0x80; +const u_int8_t MP4ExtDescrTagsEnd = 0xFE; + +class MP4IODescriptor : public MP4Descriptor { +public: + MP4IODescriptor(); + void Generate(); +protected: + void Mutate(); +}; + +class MP4ODescriptor : public MP4Descriptor { +public: + MP4ODescriptor(); + void Generate(); +protected: + void Mutate(); +}; + +class MP4ESIDIncDescriptor : public MP4Descriptor { +public: + MP4ESIDIncDescriptor(); +}; + +class MP4ESIDRefDescriptor : public MP4Descriptor { +public: + MP4ESIDRefDescriptor(); +}; + +class MP4ESDescriptor : public MP4Descriptor { +public: + MP4ESDescriptor(); +protected: + void Mutate(); +}; + +class MP4DecConfigDescriptor : public MP4Descriptor { +public: + MP4DecConfigDescriptor(); + void Generate(); +}; + +class MP4DecSpecificDescriptor : public MP4Descriptor { +public: + MP4DecSpecificDescriptor(); + void Read(MP4File* pFile); +}; + +class MP4SLConfigDescriptor : public MP4Descriptor { +public: + MP4SLConfigDescriptor(); + void Generate(); + void Read(MP4File* pFile); + protected: + void Mutate(); +}; + +class MP4IPIPtrDescriptor : public MP4Descriptor { +public: + MP4IPIPtrDescriptor(); +}; + +class MP4ContentIdDescriptor : public MP4Descriptor { +public: + MP4ContentIdDescriptor(); + void Read(MP4File* pFile); +protected: + void Mutate(); +}; + +class MP4SupplContentIdDescriptor : public MP4Descriptor { +public: + MP4SupplContentIdDescriptor(); +}; + +class MP4IPMPPtrDescriptor : public MP4Descriptor { +public: + MP4IPMPPtrDescriptor(); +}; + +class MP4IPMPDescriptor : public MP4Descriptor { +public: + MP4IPMPDescriptor(); + void Read(MP4File* pFile); +}; + +class MP4RegistrationDescriptor : public MP4Descriptor { +public: + MP4RegistrationDescriptor(); + void Read(MP4File* pFile); +}; + +class MP4ExtProfileLevelDescriptor : public MP4Descriptor { +public: + MP4ExtProfileLevelDescriptor(); +}; + +class MP4ExtensionDescriptor : public MP4Descriptor { +public: + MP4ExtensionDescriptor(); + void Read(MP4File* pFile); +}; + +// associated values in descriptors + +// ES objectTypeId +const u_int8_t MP4SystemsV1ObjectType = 0x01; +const u_int8_t MP4SystemsV2ObjectType = 0x02; + +// ES streamType +const u_int8_t MP4ObjectDescriptionStreamType = 0x01; +const u_int8_t MP4ClockReferenceStreamType = 0x02; +const u_int8_t MP4SceneDescriptionStreamType = 0x03; +const u_int8_t MP4VisualStreamType = 0x04; +const u_int8_t MP4AudioStreamType = 0x05; +const u_int8_t MP4Mpeg7StreamType = 0x06; +const u_int8_t MP4IPMPStreamType = 0x07; +const u_int8_t MP4OCIStreamType = 0x08; +const u_int8_t MP4MPEGJStreamType = 0x09; +const u_int8_t MP4UserPrivateStreamType = 0x20; + +#endif /* __DESCRIPTORS_INCLUDED__ */ + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/isma.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/isma.cpp @@ -0,0 +1,886 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +#include "mp4common.h" + +static u_int8_t BifsV2Config[3] = { + 0x00, 0x00, 0x60 // IsCommandStream = 1, PixelMetric = 1 +}; + +void MP4File::MakeIsmaCompliant(bool addIsmaComplianceSdp) +{ + ProtectWriteOperation("MP4MakeIsmaCompliant"); + + if (m_useIsma) { + // already done + return; + } + m_useIsma = true; + + // find first audio and/or video tracks + + MP4TrackId audioTrackId = MP4_INVALID_TRACK_ID; + try { + audioTrackId = FindTrackId(0, MP4_AUDIO_TRACK_TYPE); + } + catch (MP4Error* e) { + delete e; + } + + MP4TrackId videoTrackId = MP4_INVALID_TRACK_ID; + try { + videoTrackId = FindTrackId(0, MP4_VIDEO_TRACK_TYPE); + } + catch (MP4Error* e) { + delete e; + } + + u_int64_t fileMsDuration = + ConvertFromMovieDuration(GetDuration(), MP4_MSECS_TIME_SCALE); + + // delete any existing OD track + if (m_odTrackId != MP4_INVALID_TRACK_ID) { + DeleteTrack(m_odTrackId); + } + + AddODTrack(); + SetODProfileLevel(0xFF); + + if (audioTrackId != MP4_INVALID_TRACK_ID) { + AddTrackToOd(audioTrackId); + } + + if (videoTrackId != MP4_INVALID_TRACK_ID) { + AddTrackToOd(videoTrackId); + } + + // delete any existing scene track + MP4TrackId sceneTrackId = MP4_INVALID_TRACK_ID; + try { + sceneTrackId = FindTrackId(0, MP4_SCENE_TRACK_TYPE); + } + catch (MP4Error *e) { + delete e; + } + if (sceneTrackId != MP4_INVALID_TRACK_ID) { + DeleteTrack(sceneTrackId); + } + + // add scene track + sceneTrackId = AddSceneTrack(); + SetSceneProfileLevel(0xFF); + SetGraphicsProfileLevel(0xFF); + SetTrackIntegerProperty(sceneTrackId, + "mdia.minf.stbl.stsd.mp4s.esds.decConfigDescr.objectTypeId", + MP4SystemsV2ObjectType); + + SetTrackESConfiguration(sceneTrackId, + BifsV2Config, sizeof(BifsV2Config)); + + u_int8_t* pBytes = NULL; + u_int64_t numBytes = 0; + + // write OD Update Command + CreateIsmaODUpdateCommandFromFileForFile( + m_odTrackId, + audioTrackId, + videoTrackId, + &pBytes, + &numBytes); + + WriteSample(m_odTrackId, pBytes, numBytes, fileMsDuration); + + MP4Free(pBytes); + pBytes = NULL; + + // write BIFS Scene Replace Command + CreateIsmaSceneCommand( + MP4_IS_VALID_TRACK_ID(audioTrackId), + MP4_IS_VALID_TRACK_ID(videoTrackId), + &pBytes, + &numBytes); + + WriteSample(sceneTrackId, pBytes, numBytes, fileMsDuration); + + MP4Free(pBytes); + pBytes = NULL; + + // add session level sdp + CreateIsmaIodFromFile( + m_odTrackId, + sceneTrackId, + audioTrackId, + videoTrackId, + &pBytes, + &numBytes); + + char* iodBase64 = MP4ToBase64(pBytes, numBytes); + + char* sdpBuf = (char*)MP4Calloc(strlen(iodBase64) + 256); + + if (addIsmaComplianceSdp) { + strcpy(sdpBuf, "a=isma-compliance:1,1.0,1\015\012"); + } + + sprintf(&sdpBuf[strlen(sdpBuf)], + "a=mpeg4-iod: \042data:application/mpeg4-iod;base64,%s\042\015\012", + iodBase64); + + SetSessionSdp(sdpBuf); + + VERBOSE_ISMA(GetVerbosity(), + printf("IOD SDP = %s\n", sdpBuf)); + + MP4Free(iodBase64); + iodBase64 = NULL; + MP4Free(pBytes); + pBytes = NULL; + MP4Free(sdpBuf); + sdpBuf = NULL; +} + +static void CloneIntegerProperty( + MP4Descriptor* pDest, + MP4DescriptorProperty* pSrc, + const char* name) +{ + MP4IntegerProperty* pGetProperty; + MP4IntegerProperty* pSetProperty; + + pSrc->FindProperty(name, (MP4Property**)&pGetProperty); + pDest->FindProperty(name, (MP4Property**)&pSetProperty); + + pSetProperty->SetValue(pGetProperty->GetValue()); +} + +void MP4File::CreateIsmaIodFromFile( + MP4TrackId odTrackId, + MP4TrackId sceneTrackId, + MP4TrackId audioTrackId, + MP4TrackId videoTrackId, + u_int8_t** ppBytes, + u_int64_t* pNumBytes) +{ + MP4Descriptor* pIod = new MP4IODescriptor(); + pIod->SetTag(MP4IODescrTag); + pIod->Generate(); + + MP4Atom* pIodsAtom = FindAtom("moov.iods"); + ASSERT(pIodsAtom); + MP4DescriptorProperty* pSrcIod = + (MP4DescriptorProperty*)pIodsAtom->GetProperty(2); + + CloneIntegerProperty(pIod, pSrcIod, "objectDescriptorId"); + CloneIntegerProperty(pIod, pSrcIod, "ODProfileLevelId"); + CloneIntegerProperty(pIod, pSrcIod, "sceneProfileLevelId"); + CloneIntegerProperty(pIod, pSrcIod, "audioProfileLevelId"); + CloneIntegerProperty(pIod, pSrcIod, "visualProfileLevelId"); + CloneIntegerProperty(pIod, pSrcIod, "graphicsProfileLevelId"); + + // mutate esIds from MP4ESIDIncDescrTag to MP4ESDescrTag + MP4DescriptorProperty* pEsProperty; + pIod->FindProperty("esIds", (MP4Property**)&pEsProperty); + pEsProperty->SetTags(MP4ESDescrTag); + + MP4IntegerProperty* pSetProperty; + MP4IntegerProperty* pSceneESID; + MP4IntegerProperty* pOdESID; + + // OD + MP4Descriptor* pOdEsd = + pEsProperty->AddDescriptor(MP4ESDescrTag); + pOdEsd->Generate(); + + pOdEsd->FindProperty("ESID", + (MP4Property**)&pOdESID); + + // we set the OD ESID to a non-zero unique value + pOdESID->SetValue(m_odTrackId); + + pOdEsd->FindProperty("URLFlag", + (MP4Property**)&pSetProperty); + pSetProperty->SetValue(1); + + u_int8_t* pBytes; + u_int64_t numBytes; + + CreateIsmaODUpdateCommandFromFileForStream( + audioTrackId, + videoTrackId, + &pBytes, + &numBytes); + + VERBOSE_ISMA(GetVerbosity(), + printf("OD data =\n"); MP4HexDump(pBytes, numBytes)); + + char* odCmdBase64 = MP4ToBase64(pBytes, numBytes); + + char* urlBuf = (char*)MP4Malloc(strlen(odCmdBase64) + 64); + + sprintf(urlBuf, + "data:application/mpeg4-od-au;base64,%s", + odCmdBase64); + + MP4StringProperty* pUrlProperty; + pOdEsd->FindProperty("URL", + (MP4Property**)&pUrlProperty); + pUrlProperty->SetValue(urlBuf); + + VERBOSE_ISMA(GetVerbosity(), + printf("OD data URL = \042%s\042\n", urlBuf)); + + MP4Free(odCmdBase64); + odCmdBase64 = NULL; + MP4Free(pBytes); + pBytes = NULL; + MP4Free(urlBuf); + urlBuf = NULL; + + MP4DescriptorProperty* pSrcDcd = NULL; + + // HACK temporarily point to scene decoder config + FindProperty(MakeTrackName(odTrackId, + "mdia.minf.stbl.stsd.mp4s.esds.decConfigDescr"), + (MP4Property**)&pSrcDcd); + ASSERT(pSrcDcd); + MP4Property* pOrgOdEsdProperty = + pOdEsd->GetProperty(8); + pOdEsd->SetProperty(8, pSrcDcd); + + // bufferSizeDB needs to be set appropriately + MP4BitfieldProperty* pBufferSizeProperty = NULL; + pOdEsd->FindProperty("decConfigDescr.bufferSizeDB", + (MP4Property**)&pBufferSizeProperty); + ASSERT(pBufferSizeProperty); + pBufferSizeProperty->SetValue(numBytes); + + // SL config needs to change from 2 (file) to 1 (null) + pOdEsd->FindProperty("slConfigDescr.predefined", + (MP4Property**)&pSetProperty); + pSetProperty->SetValue(1); + + + // Scene + MP4Descriptor* pSceneEsd = + pEsProperty->AddDescriptor(MP4ESDescrTag); + pSceneEsd->Generate(); + + pSceneEsd->FindProperty("ESID", + (MP4Property**)&pSceneESID); + // we set the Scene ESID to a non-zero unique value + pSceneESID->SetValue(sceneTrackId); + + pSceneEsd->FindProperty("URLFlag", + (MP4Property**)&pSetProperty); + pSetProperty->SetValue(1); + + CreateIsmaSceneCommand( + MP4_IS_VALID_TRACK_ID(audioTrackId), + MP4_IS_VALID_TRACK_ID(videoTrackId), + &pBytes, + &numBytes); + + VERBOSE_ISMA(GetVerbosity(), + printf("Scene data =\n"); MP4HexDump(pBytes, numBytes)); + + char *sceneCmdBase64 = MP4ToBase64(pBytes, numBytes); + + urlBuf = (char*)MP4Malloc(strlen(sceneCmdBase64) + 64); + sprintf(urlBuf, + "data:application/mpeg4-bifs-au;base64,%s", + sceneCmdBase64); + + pSceneEsd->FindProperty("URL", + (MP4Property**)&pUrlProperty); + pUrlProperty->SetValue(urlBuf); + + VERBOSE_ISMA(GetVerbosity(), + printf("Scene data URL = \042%s\042\n", urlBuf)); + + MP4Free(sceneCmdBase64); + sceneCmdBase64 = NULL; + MP4Free(urlBuf); + urlBuf = NULL; + MP4Free(pBytes); + pBytes = NULL; + + // HACK temporarily point to scene decoder config + FindProperty(MakeTrackName(sceneTrackId, + "mdia.minf.stbl.stsd.mp4s.esds.decConfigDescr"), + (MP4Property**)&pSrcDcd); + ASSERT(pSrcDcd); + MP4Property* pOrgSceneEsdProperty = + pSceneEsd->GetProperty(8); + pSceneEsd->SetProperty(8, pSrcDcd); + + // bufferSizeDB needs to be set + pBufferSizeProperty = NULL; + pSceneEsd->FindProperty("decConfigDescr.bufferSizeDB", + (MP4Property**)&pBufferSizeProperty); + ASSERT(pBufferSizeProperty); + pBufferSizeProperty->SetValue(numBytes); + + // SL config needs to change from 2 (file) to 1 (null) + pSceneEsd->FindProperty("slConfigDescr.predefined", + (MP4Property**)&pSetProperty); + pSetProperty->SetValue(1); + + + // finally get the whole thing written to a memory + pIod->WriteToMemory(this, ppBytes, pNumBytes); + + + // now carefully replace esd properties before destroying + pOdEsd->SetProperty(8, pOrgOdEsdProperty); + pSceneEsd->SetProperty(8, pOrgSceneEsdProperty); + pSceneESID->SetValue(0); // restore 0 value + pOdESID->SetValue(0); + + delete pIod; + + VERBOSE_ISMA(GetVerbosity(), + printf("IOD data =\n"); MP4HexDump(*ppBytes, *pNumBytes)); +} + +void MP4File::CreateIsmaIodFromParams( + u_int8_t videoProfile, + u_int32_t videoBitrate, + u_int8_t* videoConfig, + u_int32_t videoConfigLength, + u_int8_t audioProfile, + u_int32_t audioBitrate, + u_int8_t* audioConfig, + u_int32_t audioConfigLength, + u_int8_t** ppIodBytes, + u_int64_t* pIodNumBytes) +{ + MP4IntegerProperty* pInt; + u_int8_t* pBytes = NULL; + u_int64_t numBytes; + + // Create the IOD + MP4Descriptor* pIod = new MP4IODescriptor(); + pIod->SetTag(MP4IODescrTag); + pIod->Generate(); + + // Set audio and video profileLevels + pIod->FindProperty("audioProfileLevelId", + (MP4Property**)&pInt); + pInt->SetValue(audioProfile); + + pIod->FindProperty("visualProfileLevelId", + (MP4Property**)&pInt); + pInt->SetValue(videoProfile); + + // Mutate esIds from MP4ESIDIncDescrTag to MP4ESDescrTag + MP4DescriptorProperty* pEsProperty; + pIod->FindProperty("esIds", (MP4Property**)&pEsProperty); + pEsProperty->SetTags(MP4ESDescrTag); + + // Add ES Descriptors + + // Scene + CreateIsmaSceneCommand( + (audioProfile != 0xFF), + (videoProfile != 0xFF), + &pBytes, + &numBytes); + + VERBOSE_ISMA(GetVerbosity(), + printf("Scene data =\n"); MP4HexDump(pBytes, numBytes)); + + char* sceneCmdBase64 = MP4ToBase64(pBytes, numBytes); + + char* urlBuf = + (char*)MP4Malloc(strlen(sceneCmdBase64) + 64); + sprintf(urlBuf, + "data:application/mpeg4-bifs-au;base64,%s", + sceneCmdBase64); + + VERBOSE_ISMA(GetVerbosity(), + printf("Scene data URL = \042%s\042\n", urlBuf)); + + /* MP4Descriptor* pSceneEsd = */ + CreateESD( + pEsProperty, + 201, // esid + MP4SystemsV2ObjectType, + MP4SceneDescriptionStreamType, + numBytes, // bufferSize + numBytes * 8, // bitrate + BifsV2Config, + sizeof(BifsV2Config), + urlBuf); + + MP4Free(sceneCmdBase64); + sceneCmdBase64 = NULL; + MP4Free(urlBuf); + urlBuf = NULL; + MP4Free(pBytes); + pBytes = NULL; + + // OD + + // Video + MP4DescriptorProperty* pVideoEsdProperty = + new MP4DescriptorProperty(); + pVideoEsdProperty->SetTags(MP4ESDescrTag); + + /* MP4Descriptor* pVideoEsd = */ + CreateESD( + pVideoEsdProperty, + 20, // esid + MP4_MPEG4_VIDEO_TYPE, + MP4VisualStreamType, + videoBitrate / 8, // bufferSize + videoBitrate, + videoConfig, + videoConfigLength, + NULL); + + // Audio + MP4DescriptorProperty* pAudioEsdProperty = + new MP4DescriptorProperty(); + pAudioEsdProperty->SetTags(MP4ESDescrTag); + + /* MP4Descriptor* pAudioEsd = */ + CreateESD( + pAudioEsdProperty, + 10, // esid + MP4_MPEG4_AUDIO_TYPE, + MP4AudioStreamType, + audioBitrate / 8, // bufferSize + audioBitrate, + audioConfig, + audioConfigLength, + NULL); + + CreateIsmaODUpdateCommandForStream( + pAudioEsdProperty, + pVideoEsdProperty, + &pBytes, + &numBytes); + + // cleanup temporary descriptor properties + delete pAudioEsdProperty; + delete pVideoEsdProperty; + + VERBOSE_ISMA(GetVerbosity(), + printf("OD data = %llu bytes\n", numBytes); MP4HexDump(pBytes, numBytes)); + + char* odCmdBase64 = MP4ToBase64(pBytes, numBytes); + + urlBuf = (char*)MP4Malloc(strlen(odCmdBase64) + 64); + + sprintf(urlBuf, + "data:application/mpeg4-od-au;base64,%s", + odCmdBase64); + + VERBOSE_ISMA(GetVerbosity(), + printf("OD data URL = \042%s\042\n", urlBuf)); + + /* MP4Descriptor* pOdEsd = */ + CreateESD( + pEsProperty, + 101, + MP4SystemsV1ObjectType, + MP4ObjectDescriptionStreamType, + numBytes, // bufferSize + numBytes * 8, // bitrate + NULL, // config + 0, // configLength + urlBuf); + + MP4Free(odCmdBase64); + odCmdBase64 = NULL; + MP4Free(pBytes); + pBytes = NULL; + MP4Free(urlBuf); + urlBuf = NULL; + + // finally get the whole thing written to a memory + pIod->WriteToMemory(this, ppIodBytes, pIodNumBytes); + + delete pIod; + + VERBOSE_ISMA(GetVerbosity(), + printf("IOD data =\n"); MP4HexDump(*ppIodBytes, *pIodNumBytes)); +} + +MP4Descriptor* MP4File::CreateESD( + MP4DescriptorProperty* pEsProperty, + u_int32_t esid, + u_int8_t objectType, + u_int8_t streamType, + u_int32_t bufferSize, + u_int32_t bitrate, + u_int8_t* pConfig, + u_int32_t configLength, + char* url) +{ + MP4IntegerProperty* pInt; + MP4StringProperty* pString; + MP4BytesProperty* pBytes; + MP4BitfieldProperty* pBits; + + MP4Descriptor* pEsd = + pEsProperty->AddDescriptor(MP4ESDescrTag); + pEsd->Generate(); + + pEsd->FindProperty("ESID", + (MP4Property**)&pInt); + pInt->SetValue(esid); + + pEsd->FindProperty("decConfigDescr.objectTypeId", + (MP4Property**)&pInt); + pInt->SetValue(objectType); + + pEsd->FindProperty("decConfigDescr.streamType", + (MP4Property**)&pInt); + pInt->SetValue(streamType); + + pEsd->FindProperty("decConfigDescr.bufferSizeDB", + (MP4Property**)&pInt); + pInt->SetValue(bufferSize); + + pEsd->FindProperty("decConfigDescr.maxBitrate", + (MP4Property**)&pInt); + pInt->SetValue(bitrate); + + pEsd->FindProperty("decConfigDescr.avgBitrate", + (MP4Property**)&pInt); + pInt->SetValue(bitrate); + + MP4DescriptorProperty* pConfigDescrProperty; + pEsd->FindProperty("decConfigDescr.decSpecificInfo", + (MP4Property**)&pConfigDescrProperty); + + MP4Descriptor* pConfigDescr = + pConfigDescrProperty->AddDescriptor(MP4DecSpecificDescrTag); + pConfigDescr->Generate(); + + pConfigDescrProperty->FindProperty("decSpecificInfo[0].info", + (MP4Property**)&pBytes); + pBytes->SetValue(pConfig, configLength); + + pEsd->FindProperty("slConfigDescr.predefined", + (MP4Property**)&pInt); + // changed 12/5/02 from plugfest to value 0 + pInt->SetValue(0); + + pEsd->FindProperty("slConfig.useAccessUnitEndFlag", + (MP4Property **)&pBits); + pBits->SetValue(1); + + if (url) { + pEsd->FindProperty("URLFlag", + (MP4Property**)&pInt); + pInt->SetValue(1); + + pEsd->FindProperty("URL", + (MP4Property**)&pString); + pString->SetValue(url); + } + + return pEsd; +} + +void MP4File::CreateIsmaODUpdateCommandFromFileForFile( + MP4TrackId odTrackId, + MP4TrackId audioTrackId, + MP4TrackId videoTrackId, + u_int8_t** ppBytes, + u_int64_t* pNumBytes) +{ + MP4Descriptor* pCommand = CreateODCommand(MP4ODUpdateODCommandTag); + pCommand->Generate(); + + for (u_int8_t i = 0; i < 2; i++) { + MP4TrackId trackId; + u_int16_t odId; + + if (i == 0) { + trackId = audioTrackId; + odId = 10; + } else { + trackId = videoTrackId; + odId = 20; + } + + if (trackId == MP4_INVALID_TRACK_ID) { + continue; + } + + MP4DescriptorProperty* pOdDescrProperty = + (MP4DescriptorProperty*)(pCommand->GetProperty(0)); + + pOdDescrProperty->SetTags(MP4FileODescrTag); + + MP4Descriptor* pOd = + pOdDescrProperty->AddDescriptor(MP4FileODescrTag); + + pOd->Generate(); + + MP4BitfieldProperty* pOdIdProperty = NULL; + pOd->FindProperty("objectDescriptorId", + (MP4Property**)&pOdIdProperty); + pOdIdProperty->SetValue(odId); + + MP4DescriptorProperty* pEsIdsDescriptorProperty = NULL; + pOd->FindProperty("esIds", + (MP4Property**)&pEsIdsDescriptorProperty); + ASSERT(pEsIdsDescriptorProperty); + + pEsIdsDescriptorProperty->SetTags(MP4ESIDRefDescrTag); + + MP4Descriptor *pRefDescriptor = + pEsIdsDescriptorProperty->AddDescriptor(MP4ESIDRefDescrTag); + pRefDescriptor->Generate(); + + MP4Integer16Property* pRefIndexProperty = NULL; + pRefDescriptor->FindProperty("refIndex", + (MP4Property**)&pRefIndexProperty); + ASSERT(pRefIndexProperty); + + u_int32_t mpodIndex = FindTrackReference( + MakeTrackName(odTrackId, "tref.mpod"), trackId); + ASSERT(mpodIndex != 0); + + pRefIndexProperty->SetValue(mpodIndex); + } + + pCommand->WriteToMemory(this, ppBytes, pNumBytes); + + delete pCommand; +} + +void MP4File::CreateIsmaODUpdateCommandFromFileForStream( + MP4TrackId audioTrackId, + MP4TrackId videoTrackId, + u_int8_t** ppBytes, + u_int64_t* pNumBytes) +{ + MP4DescriptorProperty* pAudioEsd = NULL; + MP4Integer8Property* pAudioSLConfigPredef = NULL; + MP4BitfieldProperty* pAudioAccessUnitEndFlag = NULL; + int oldAudioUnitEndFlagValue = 0; + MP4DescriptorProperty* pVideoEsd = NULL; + MP4Integer8Property* pVideoSLConfigPredef = NULL; + MP4BitfieldProperty* pVideoAccessUnitEndFlag = NULL; + int oldVideoUnitEndFlagValue = 0; + MP4IntegerProperty* pAudioEsdId = NULL; + MP4IntegerProperty* pVideoEsdId = NULL; + + if (audioTrackId != MP4_INVALID_TRACK_ID) { + // changed mp4a to * to handle enca case + MP4Atom* pEsdsAtom = + FindAtom(MakeTrackName(audioTrackId, + "mdia.minf.stbl.stsd.*.esds")); + ASSERT(pEsdsAtom); + + pAudioEsd = (MP4DescriptorProperty*)(pEsdsAtom->GetProperty(2)); + // ESID is 0 for file, stream needs to be non-ze + pAudioEsd->FindProperty("ESID", + (MP4Property**)&pAudioEsdId); + + ASSERT(pAudioEsdId); + pAudioEsdId->SetValue(audioTrackId); + + // SL config needs to change from 2 (file) to 1 (null) + pAudioEsd->FindProperty("slConfigDescr.predefined", + (MP4Property**)&pAudioSLConfigPredef); + ASSERT(pAudioSLConfigPredef); + pAudioSLConfigPredef->SetValue(0); + + pAudioEsd->FindProperty("slConfigDescr.useAccessUnitEndFlag", + (MP4Property **)&pAudioAccessUnitEndFlag); + oldAudioUnitEndFlagValue = + pAudioAccessUnitEndFlag->GetValue(); + pAudioAccessUnitEndFlag->SetValue(1); + } + + if (videoTrackId != MP4_INVALID_TRACK_ID) { + // changed mp4v to * to handle encv case + MP4Atom* pEsdsAtom = + FindAtom(MakeTrackName(videoTrackId, + "mdia.minf.stbl.stsd.*.esds")); + ASSERT(pEsdsAtom); + + pVideoEsd = (MP4DescriptorProperty*)(pEsdsAtom->GetProperty(2)); + pVideoEsd->FindProperty("ESID", + (MP4Property**)&pVideoEsdId); + + ASSERT(pVideoEsdId); + pVideoEsdId->SetValue(videoTrackId); + + // SL config needs to change from 2 (file) to 1 (null) + pVideoEsd->FindProperty("slConfigDescr.predefined", + (MP4Property**)&pVideoSLConfigPredef); + ASSERT(pVideoSLConfigPredef); + pVideoSLConfigPredef->SetValue(0); + + pVideoEsd->FindProperty("slConfigDescr.useAccessUnitEndFlag", + (MP4Property **)&pVideoAccessUnitEndFlag); + oldVideoUnitEndFlagValue = + pVideoAccessUnitEndFlag->GetValue(); + pVideoAccessUnitEndFlag->SetValue(1); + } + + CreateIsmaODUpdateCommandForStream( + pAudioEsd, pVideoEsd, ppBytes, pNumBytes); + VERBOSE_ISMA(GetVerbosity(), + printf("After CreateImsaODUpdateCommandForStream len %llu =\n", *pNumBytes); MP4HexDump(*ppBytes, *pNumBytes)); + // return SL config values to 2 (file) + // return ESID values to 0 + if (pAudioSLConfigPredef) { + pAudioSLConfigPredef->SetValue(2); + } + if (pAudioEsdId) { + pAudioEsdId->SetValue(0); + } + if (pAudioAccessUnitEndFlag) { + pAudioAccessUnitEndFlag->SetValue(oldAudioUnitEndFlagValue ); + } + if (pVideoEsdId) { + pVideoEsdId->SetValue(0); + } + if (pVideoSLConfigPredef) { + pVideoSLConfigPredef->SetValue(2); + } + if (pVideoAccessUnitEndFlag) { + pVideoAccessUnitEndFlag->SetValue(oldVideoUnitEndFlagValue ); + } +} + +void MP4File::CreateIsmaODUpdateCommandForStream( + MP4DescriptorProperty* pAudioEsdProperty, + MP4DescriptorProperty* pVideoEsdProperty, + u_int8_t** ppBytes, + u_int64_t* pNumBytes) +{ + MP4Descriptor* pAudioOd = NULL; + MP4Descriptor* pVideoOd = NULL; + + MP4Descriptor* pCommand = + CreateODCommand(MP4ODUpdateODCommandTag); + pCommand->Generate(); + + for (u_int8_t i = 0; i < 2; i++) { + u_int16_t odId; + MP4DescriptorProperty* pEsdProperty = NULL; + + if (i == 0) { + odId = 10; + pEsdProperty = pAudioEsdProperty; + } else { + odId = 20; + pEsdProperty = pVideoEsdProperty; + } + + if (pEsdProperty == NULL) { + continue; + } + + MP4DescriptorProperty* pOdDescrProperty = + (MP4DescriptorProperty*)(pCommand->GetProperty(0)); + + pOdDescrProperty->SetTags(MP4ODescrTag); + + MP4Descriptor* pOd = + pOdDescrProperty->AddDescriptor(MP4ODescrTag); + pOd->Generate(); + + if (i == 0) { + pAudioOd = pOd; + } else { + pVideoOd = pOd; + } + + MP4BitfieldProperty* pOdIdProperty = NULL; + pOd->FindProperty("objectDescriptorId", + (MP4Property**)&pOdIdProperty); + pOdIdProperty->SetValue(odId); + + delete (MP4DescriptorProperty*)pOd->GetProperty(4); + pOd->SetProperty(4, pEsdProperty); + } + + // serialize OD command + pCommand->WriteToMemory(this, ppBytes, pNumBytes); + + // detach from esd descriptor params + if (pAudioOd) { + pAudioOd->SetProperty(4, NULL); + } + if (pVideoOd) { + pVideoOd->SetProperty(4, NULL); + } + + // then destroy + delete pCommand; +} + +void MP4File::CreateIsmaSceneCommand( + bool hasAudio, + bool hasVideo, + u_int8_t** ppBytes, + u_int64_t* pNumBytes) +{ + // from ISMA 1.0 Tech Spec Appendix E + static u_int8_t bifsAudioOnly[] = { + 0xC0, 0x10, 0x12, + 0x81, 0x30, 0x2A, 0x05, 0x6D, 0xC0 + }; + static u_int8_t bifsVideoOnly[] = { + 0xC0, 0x10, 0x12, + 0x61, 0x04, + 0x1F, 0xC0, 0x00, 0x00, + 0x1F, 0xC0, 0x00, 0x00, + 0x44, 0x28, 0x22, 0x82, 0x9F, 0x80 + }; + static u_int8_t bifsAudioVideo[] = { + 0xC0, 0x10, 0x12, + 0x81, 0x30, 0x2A, 0x05, 0x6D, 0x26, + 0x10, 0x41, 0xFC, 0x00, 0x00, 0x01, 0xFC, 0x00, 0x00, + 0x04, 0x42, 0x82, 0x28, 0x29, 0xF8 + }; + + if (hasAudio && hasVideo) { + *pNumBytes = sizeof(bifsAudioVideo); + *ppBytes = (u_int8_t*)MP4Malloc(*pNumBytes); + memcpy(*ppBytes, bifsAudioVideo, sizeof(bifsAudioVideo)); + + } else if (hasAudio) { + *pNumBytes = sizeof(bifsAudioOnly); + *ppBytes = (u_int8_t*)MP4Malloc(*pNumBytes); + memcpy(*ppBytes, bifsAudioOnly, sizeof(bifsAudioOnly)); + + } else if (hasVideo) { + *pNumBytes = sizeof(bifsVideoOnly); + *ppBytes = (u_int8_t*)MP4Malloc(*pNumBytes); + memcpy(*ppBytes, bifsVideoOnly, sizeof(bifsVideoOnly)); + } else { + *pNumBytes = 0; + *ppBytes = NULL; + } +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/libmp4v260.dsp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/libmp4v260.dsp @@ -0,0 +1,493 @@ +# Microsoft Developer Studio Project File - Name="libmp4v2" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libmp4v2 - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libmp4v260.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libmp4v260.mak" CFG="libmp4v2 - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libmp4v2 - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libmp4v2 - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libmp4v2 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# SUBTRACT CPP /Fr +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libmp4v2 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libmp4v2 - Win32 Release" +# Name "libmp4v2 - Win32 Debug" +# Begin Group "source" + +# PROP Default_Filter ".c, .cpp" +# Begin Source File + +SOURCE=.\atom_co64.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_cprt.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_ctts.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dimm.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dinf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dmax.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dmed.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dref.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_drep.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_edts.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_elst.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_esds.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_free.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_ftyp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hdlr.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hinf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hmhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hnti.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_iods.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_maxr.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mdat.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mdhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mdia.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mfhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_minf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_moof.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_moov.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mp4a.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mp4s.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mp4v.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mvex.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mvhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_nmhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_nump.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_payt.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_pmax.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_root.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_rtp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_sdp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_smhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_snro.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stbl.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stco.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stdp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsc.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsh.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stss.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsz.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stts.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tfhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tims.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tkhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tmax.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tmin.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tpyl.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_traf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trak.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tref.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_treftype.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trex.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trpy.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trun.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tsro.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_udta.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_url.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_urn.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_vmhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\descriptors.cpp +# End Source File +# Begin Source File + +SOURCE=.\isma.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4atom.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4container.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4descriptor.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4file.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4file_io.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4info.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4property.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4track.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4util.cpp +# End Source File +# Begin Source File + +SOURCE=.\ocidescriptors.cpp +# End Source File +# Begin Source File + +SOURCE=.\odcommands.cpp +# End Source File +# Begin Source File + +SOURCE=.\qosqualifiers.cpp +# End Source File +# Begin Source File + +SOURCE=.\rtphint.cpp +# End Source File +# End Group +# Begin Group "include" + +# PROP Default_Filter ".h" +# Begin Source File + +SOURCE=.\atoms.h +# End Source File +# Begin Source File + +SOURCE=.\descriptors.h +# End Source File +# Begin Source File + +SOURCE=.\mp4.h +# End Source File +# Begin Source File + +SOURCE=.\mp4array.h +# End Source File +# Begin Source File + +SOURCE=.\mp4atom.h +# End Source File +# Begin Source File + +SOURCE=.\mp4common.h +# End Source File +# Begin Source File + +SOURCE=.\mp4container.h +# End Source File +# Begin Source File + +SOURCE=.\mp4descriptor.h +# End Source File +# Begin Source File + +SOURCE=.\mp4file.h +# End Source File +# Begin Source File + +SOURCE=.\mp4property.h +# End Source File +# Begin Source File + +SOURCE=.\mp4track.h +# End Source File +# Begin Source File + +SOURCE=.\mp4util.h +# End Source File +# Begin Source File + +SOURCE=.\ocidescriptors.h +# End Source File +# Begin Source File + +SOURCE=.\odcommands.h +# End Source File +# Begin Source File + +SOURCE=.\qosqualifiers.h +# End Source File +# Begin Source File + +SOURCE=.\rtphint.h +# End Source File +# End Group +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/libmp4v260.vcproj +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/libmp4v260.vcproj @@ -0,0 +1,413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/libmp4v2_cb.dsp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/libmp4v2_cb.dsp @@ -0,0 +1,556 @@ +# Microsoft Developer Studio Project File - Name="libmp4v2_cb" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libmp4v2_cb - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libmp4v2_cb.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libmp4v2_cb.mak" CFG="libmp4v2_cb - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libmp4v2_cb - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libmp4v2_cb - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "libmp4v2_cb - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "CB_Release" +# PROP Intermediate_Dir "CB_Release" +# PROP Target_Dir "" +MTL=midl.exe +F90=df.exe +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O1 /I ".\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_FILE_CALLBACKS" /YX /FD /c +# ADD BASE RSC /l 0x413 /d "NDEBUG" +# ADD RSC /l 0x413 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libmp4v2_cb - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "CB_Debug" +# PROP Intermediate_Dir "CB_Debug" +# PROP Target_Dir "" +MTL=midl.exe +F90=df.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_FILE_CALLBACKS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x413 /d "_DEBUG" +# ADD RSC /l 0x413 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libmp4v2_cb - Win32 Release" +# Name "libmp4v2_cb - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\atom_co64.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_cprt.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_ctts.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dimm.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dinf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dmax.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dmed.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dref.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_drep.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_edts.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_elst.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_enca.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_encv.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_esds.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_free.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_frma.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_ftyp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hdlr.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hinf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hmhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hnti.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_iKMS.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_iods.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_iSFM.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_maxr.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mdat.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mdhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mdia.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_meta.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mfhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_minf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_moof.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_moov.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mp4a.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mp4s.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mp4v.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mvex.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mvhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_nmhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_nump.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_payt.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_pmax.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_root.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_rtp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_schi.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_schm.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_sdp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_sinf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_smhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_snro.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stbl.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stco.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stdp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsc.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsh.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stss.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsz.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stts.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tfhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tims.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tkhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tmax.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tmin.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tpyl.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_traf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trak.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tref.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_treftype.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trex.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trpy.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trun.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tsro.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_udta.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_url.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_urn.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_vmhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\descriptors.cpp +# End Source File +# Begin Source File + +SOURCE=.\isma.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4atom.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4container.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4descriptor.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4file.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4file_io.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4info.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4meta.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4property.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4track.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4util.cpp +# End Source File +# Begin Source File + +SOURCE=.\need_for_win32.c +# End Source File +# Begin Source File + +SOURCE=.\ocidescriptors.cpp +# End Source File +# Begin Source File + +SOURCE=.\odcommands.cpp +# End Source File +# Begin Source File + +SOURCE=.\qosqualifiers.cpp +# End Source File +# Begin Source File + +SOURCE=.\rtphint.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\acconfig.h +# End Source File +# Begin Source File + +SOURCE=.\atoms.h +# End Source File +# Begin Source File + +SOURCE=.\descriptors.h +# End Source File +# Begin Source File + +SOURCE=.\mp4.h +# End Source File +# Begin Source File + +SOURCE=.\mp4array.h +# End Source File +# Begin Source File + +SOURCE=.\mp4atom.h +# End Source File +# Begin Source File + +SOURCE=.\mp4common.h +# End Source File +# Begin Source File + +SOURCE=.\mp4container.h +# End Source File +# Begin Source File + +SOURCE=.\mp4descriptor.h +# End Source File +# Begin Source File + +SOURCE=.\mp4file.h +# End Source File +# Begin Source File + +SOURCE=.\mp4property.h +# End Source File +# Begin Source File + +SOURCE=.\mp4track.h +# End Source File +# Begin Source File + +SOURCE=.\mp4util.h +# End Source File +# Begin Source File + +SOURCE=.\mpeg4ip.h +# End Source File +# Begin Source File + +SOURCE=.\ocidescriptors.h +# End Source File +# Begin Source File + +SOURCE=.\odcommands.h +# End Source File +# Begin Source File + +SOURCE=.\qosqualifiers.h +# End Source File +# Begin Source File + +SOURCE=.\rtphint.h +# End Source File +# Begin Source File + +SOURCE=.\systems.h +# End Source File +# Begin Source File + +SOURCE=.\win32_ver.h +# End Source File +# End Group +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/libmp4v2_cb.vcproj +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/libmp4v2_cb.vcproj @@ -0,0 +1,359 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/libmp4v2_st60.dsp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/libmp4v2_st60.dsp @@ -0,0 +1,552 @@ +# Microsoft Developer Studio Project File - Name="libmp4v2_st" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libmp4v2_st - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libmp4v2_st60.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libmp4v2_st60.mak" CFG="libmp4v2_st - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libmp4v2_st - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libmp4v2_st - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "libmp4v2_st - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ST_Release" +# PROP Intermediate_Dir "ST_Release" +# PROP Target_Dir "" +MTL=midl.exe +F90=df.exe +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O1 /I ".\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libmp4v2_st - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "ST_Debug" +# PROP Intermediate_Dir "ST_Debug" +# PROP Target_Dir "" +MTL=midl.exe +F90=df.exe +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I ".\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libmp4v2_st - Win32 Release" +# Name "libmp4v2_st - Win32 Debug" +# Begin Group "source" + +# PROP Default_Filter ".c, .cpp" +# Begin Source File + +SOURCE=.\atom_co64.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_cprt.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_ctts.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dimm.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dinf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dmax.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dmed.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_dref.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_drep.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_edts.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_elst.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_enca.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_encv.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_esds.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_free.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_frma.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_ftyp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hdlr.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hinf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hmhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_hnti.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_iKMS.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_iods.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_iSFM.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_maxr.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mdat.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mdhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mdia.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_meta.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mfhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_minf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_moof.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_moov.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mp4a.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mp4s.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mp4v.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mvex.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_mvhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_nmhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_nump.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_payt.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_pmax.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_root.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_rtp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_schi.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_schm.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_sdp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_sinf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_smhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_snro.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stbl.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stco.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stdp.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsc.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsh.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stss.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stsz.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_stts.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tfhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tims.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tkhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tmax.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tmin.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tpyl.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_traf.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trak.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tref.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_treftype.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trex.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trpy.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_trun.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_tsro.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_udta.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_url.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_urn.cpp +# End Source File +# Begin Source File + +SOURCE=.\atom_vmhd.cpp +# End Source File +# Begin Source File + +SOURCE=.\descriptors.cpp +# End Source File +# Begin Source File + +SOURCE=.\isma.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4atom.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4container.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4descriptor.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4file.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4file_io.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4meta.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4property.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4track.cpp +# End Source File +# Begin Source File + +SOURCE=.\mp4util.cpp +# End Source File +# Begin Source File + +SOURCE=.\need_for_win32.c +# End Source File +# Begin Source File + +SOURCE=.\ocidescriptors.cpp +# End Source File +# Begin Source File + +SOURCE=.\odcommands.cpp +# End Source File +# Begin Source File + +SOURCE=.\qosqualifiers.cpp +# End Source File +# Begin Source File + +SOURCE=.\rtphint.cpp +# End Source File +# End Group +# Begin Group "include" + +# PROP Default_Filter ".h" +# Begin Source File + +SOURCE=.\atoms.h +# End Source File +# Begin Source File + +SOURCE=.\descriptors.h +# End Source File +# Begin Source File + +SOURCE=.\mp4.h +# End Source File +# Begin Source File + +SOURCE=.\mp4array.h +# End Source File +# Begin Source File + +SOURCE=.\mp4atom.h +# End Source File +# Begin Source File + +SOURCE=.\mp4common.h +# End Source File +# Begin Source File + +SOURCE=.\mp4container.h +# End Source File +# Begin Source File + +SOURCE=.\mp4descriptor.h +# End Source File +# Begin Source File + +SOURCE=.\mp4file.h +# End Source File +# Begin Source File + +SOURCE=.\mp4property.h +# End Source File +# Begin Source File + +SOURCE=.\mp4track.h +# End Source File +# Begin Source File + +SOURCE=.\mp4util.h +# End Source File +# Begin Source File + +SOURCE=.\mpeg4ip.h +# End Source File +# Begin Source File + +SOURCE=.\ocidescriptors.h +# End Source File +# Begin Source File + +SOURCE=.\odcommands.h +# End Source File +# Begin Source File + +SOURCE=.\qosqualifiers.h +# End Source File +# Begin Source File + +SOURCE=.\rtphint.h +# End Source File +# Begin Source File + +SOURCE=.\systems.h +# End Source File +# Begin Source File + +SOURCE=.\win32_ver.h +# End Source File +# End Group +# Begin Source File + +SOURCE=.\mp4info.cpp +# End Source File +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/libmp4v2_st60.vcproj +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/libmp4v2_st60.vcproj @@ -0,0 +1,380 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4.cpp @@ -0,0 +1,3243 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +/* + * MP4 library API functions + * + * These are wrapper functions that provide C linkage conventions + * to the library, and catch any internal errors, ensuring that + * a proper return value is given. + */ + +#include "mp4common.h" + +#define PRINT_ERROR(e) \ + VERBOSE_ERROR(((MP4File*)hFile)->GetVerbosity(), e->Print()); + +/* file operations */ + +extern "C" MP4FileHandle MP4Read(const char* fileName, u_int32_t verbosity) +{ + MP4File* pFile = NULL; + try { + pFile = new MP4File(verbosity); + pFile->Read(fileName); + return (MP4FileHandle)pFile; + } + catch (MP4Error* e) { + VERBOSE_ERROR(verbosity, e->Print()); + delete e; + delete pFile; + return MP4_INVALID_FILE_HANDLE; + } +} + +#ifdef USE_FILE_CALLBACKS +extern "C" MP4FileHandle MP4CreateCb(u_int32_t verbosity, + bool use64bits, + bool useExtensibleFormat, + MP4OpenCallback MP4fopen, + MP4CloseCallback MP4fclose, + MP4ReadCallback MP4fread, + MP4WriteCallback MP4fwrite, + MP4SetposCallback MP4fsetpos, + MP4GetposCallback MP4fgetpos, + MP4FilesizeCallback MP4filesize, + void *userData) +{ + MP4File* pFile = NULL; + try { + pFile = new MP4File(verbosity); + // LATER useExtensibleFormat, moov first, then mvex's + + // Set user data and callbacks + pFile->m_userData = userData; + pFile->m_MP4fopen = MP4fopen; + pFile->m_MP4fclose = MP4fclose; + pFile->m_MP4fread = MP4fread; + pFile->m_MP4fwrite = MP4fwrite; + pFile->m_MP4fsetpos = MP4fsetpos; + pFile->m_MP4fgetpos = MP4fgetpos; + pFile->m_MP4filesize = MP4filesize; + pFile->Create("", use64bits); + return (MP4FileHandle)pFile; + } + catch (MP4Error* e) { + VERBOSE_ERROR(verbosity, e->Print()); + delete e; + delete pFile; + return MP4_INVALID_FILE_HANDLE; + } +} + +extern "C" MP4FileHandle MP4ReadCb(u_int32_t verbosity, + MP4OpenCallback MP4fopen, + MP4CloseCallback MP4fclose, + MP4ReadCallback MP4fread, + MP4WriteCallback MP4fwrite, + MP4SetposCallback MP4fsetpos, + MP4GetposCallback MP4fgetpos, + MP4FilesizeCallback MP4filesize, + void *userData + ) +{ + MP4File* pFile = NULL; + try { + pFile = new MP4File(verbosity); + + // Set user data and callbacks + pFile->m_userData = userData; + pFile->m_MP4fopen = MP4fopen; + pFile->m_MP4fclose = MP4fclose; + pFile->m_MP4fread = MP4fread; + pFile->m_MP4fwrite = MP4fwrite; + pFile->m_MP4fsetpos = MP4fsetpos; + pFile->m_MP4fgetpos = MP4fgetpos; + pFile->m_MP4filesize = MP4filesize; + + pFile->Read(""); + return (MP4FileHandle)pFile; + } + catch (MP4Error* e) { + VERBOSE_ERROR(verbosity, e->Print()); + delete e; + delete pFile; + return MP4_INVALID_FILE_HANDLE; + } +} + +extern "C" MP4FileHandle MP4ModifyCb(int32_t verbosity, + bool useExtensibleFormat, + MP4OpenCallback MP4fopen, MP4CloseCallback MP4fclose, + MP4ReadCallback MP4fread, MP4WriteCallback MP4fwrite, + MP4SetposCallback MP4fsetpos, MP4GetposCallback MP4fgetpos, + MP4FilesizeCallback MP4filesize, void *userData) +{ + MP4File* pFile = NULL; + try { + pFile = new MP4File(verbosity); + + // Set user data and callbacks + pFile->m_userData = userData; + pFile->m_MP4fopen = MP4fopen; + pFile->m_MP4fclose = MP4fclose; + pFile->m_MP4fread = MP4fread; + pFile->m_MP4fwrite = MP4fwrite; + pFile->m_MP4fsetpos = MP4fsetpos; + pFile->m_MP4fgetpos = MP4fgetpos; + pFile->m_MP4filesize = MP4filesize; + + // LATER useExtensibleFormat, moov first, then mvex's + pFile->Modify(""); + return (MP4FileHandle)pFile; + } + catch (MP4Error* e) { + VERBOSE_ERROR(verbosity, e->Print()); + delete e; + delete pFile; + return MP4_INVALID_FILE_HANDLE; + } +} +#endif + +extern "C" MP4FileHandle MP4Create(const char* fileName, + u_int32_t verbosity, bool use64bits, bool useExtensibleFormat) +{ + MP4File* pFile = NULL; + try { + pFile = new MP4File(verbosity); + // LATER useExtensibleFormat, moov first, then mvex's + pFile->Create(fileName, use64bits); + return (MP4FileHandle)pFile; + } + catch (MP4Error* e) { + VERBOSE_ERROR(verbosity, e->Print()); + delete e; + delete pFile; + return MP4_INVALID_FILE_HANDLE; + } +} + +extern "C" MP4FileHandle MP4Modify(const char* fileName, + u_int32_t verbosity, bool useExtensibleFormat) +{ + MP4File* pFile = NULL; + try { + pFile = new MP4File(verbosity); + // LATER useExtensibleFormat, moov first, then mvex's + pFile->Modify(fileName); + return (MP4FileHandle)pFile; + } + catch (MP4Error* e) { + VERBOSE_ERROR(verbosity, e->Print()); + delete e; + delete pFile; + return MP4_INVALID_FILE_HANDLE; + } +} + +extern "C" bool MP4Optimize(const char* existingFileName, + const char* newFileName, + u_int32_t verbosity) +{ + try { + MP4File* pFile = new MP4File(verbosity); + pFile->Optimize(existingFileName, newFileName); + delete pFile; + return true; + } + catch (MP4Error* e) { + VERBOSE_ERROR(verbosity, e->Print()); + delete e; + } + return false; +} + +extern "C" bool MP4Close(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->Close(); + delete (MP4File*)hFile; + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4Dump( + MP4FileHandle hFile, + FILE* pDumpFile, + bool dumpImplicits) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->Dump(pDumpFile, dumpImplicits); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + + +/* specific file properties */ + +extern "C" u_int32_t MP4GetVerbosity(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetVerbosity(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" bool MP4SetVerbosity(MP4FileHandle hFile, u_int32_t verbosity) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetVerbosity(verbosity); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" MP4Duration MP4GetDuration(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetDuration(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_DURATION; +} + +extern "C" u_int32_t MP4GetTimeScale(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTimeScale(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" bool MP4SetTimeScale(MP4FileHandle hFile, u_int32_t value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetTimeScale(value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" u_int8_t MP4GetODProfileLevel(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetODProfileLevel(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" bool MP4SetODProfileLevel(MP4FileHandle hFile, u_int8_t value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetODProfileLevel(value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" u_int8_t MP4GetSceneProfileLevel(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetSceneProfileLevel(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" bool MP4SetSceneProfileLevel(MP4FileHandle hFile, u_int8_t value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetSceneProfileLevel(value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" u_int8_t MP4GetVideoProfileLevel(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetVideoProfileLevel(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" bool MP4SetVideoProfileLevel(MP4FileHandle hFile, u_int8_t value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetVideoProfileLevel(value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" u_int8_t MP4GetAudioProfileLevel(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetAudioProfileLevel(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" bool MP4SetAudioProfileLevel(MP4FileHandle hFile, u_int8_t value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetAudioProfileLevel(value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" u_int8_t MP4GetGraphicsProfileLevel(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetGraphicsProfileLevel(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" bool MP4SetGraphicsProfileLevel(MP4FileHandle hFile, u_int8_t value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetGraphicsProfileLevel(value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +/* generic file properties */ + +extern "C" u_int64_t MP4GetIntegerProperty( + MP4FileHandle hFile, const char* propName) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetIntegerProperty(propName); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return (u_int64_t)-1; +} + +extern "C" float MP4GetFloatProperty( + MP4FileHandle hFile, const char* propName) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetFloatProperty(propName); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return NAN; +} + +extern "C" const char* MP4GetStringProperty( + MP4FileHandle hFile, const char* propName) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetStringProperty(propName); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return NULL; +} + +extern "C" void MP4GetBytesProperty( + MP4FileHandle hFile, const char* propName, + u_int8_t** ppValue, u_int32_t* pValueSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->GetBytesProperty(propName, ppValue, pValueSize); + return; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + *ppValue = NULL; + *pValueSize = 0; + return; +} + +extern "C" bool MP4SetIntegerProperty( + MP4FileHandle hFile, const char* propName, int64_t value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetIntegerProperty(propName, value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetFloatProperty( + MP4FileHandle hFile, const char* propName, float value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetFloatProperty(propName, value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetStringProperty( + MP4FileHandle hFile, const char* propName, const char* value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetStringProperty(propName, value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetBytesProperty( + MP4FileHandle hFile, const char* propName, + const u_int8_t* pValue, u_int32_t valueSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetBytesProperty(propName, pValue, valueSize); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +/* track operations */ + +extern "C" MP4TrackId MP4AddTrack( + MP4FileHandle hFile, const char* type) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->AddSystemsTrack(type); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" MP4TrackId MP4AddSystemsTrack( + MP4FileHandle hFile, const char* type) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->AddSystemsTrack(type); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" MP4TrackId MP4AddODTrack(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->AddODTrack(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" MP4TrackId MP4AddSceneTrack(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->AddSceneTrack(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" MP4TrackId MP4AddAudioTrack( + MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int8_t audioType) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)-> + AddAudioTrack(timeScale, sampleDuration, audioType); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" MP4TrackId MP4AddEncAudioTrack(MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int8_t audioType) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)-> + AddEncAudioTrack(timeScale, sampleDuration, audioType); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" MP4TrackId MP4AddVideoTrack( + MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + u_int8_t videoType) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->AddVideoTrack( + timeScale, sampleDuration, width, height, videoType); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" MP4TrackId MP4AddEncVideoTrack(MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + u_int8_t videoType) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->AddEncVideoTrack(timeScale, sampleDuration, + width, height, videoType); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" MP4TrackId MP4AddHintTrack( + MP4FileHandle hFile, MP4TrackId refTrackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->AddHintTrack(refTrackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" MP4TrackId MP4CloneTrack( + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4FileHandle dstFile) +{ + MP4TrackId dstTrackId = MP4_INVALID_TRACK_ID; + + if (dstFile == NULL) { + dstFile = srcFile; + } + + const char* trackType = + MP4GetTrackType(srcFile, srcTrackId); + + if (!trackType) { + return dstTrackId; + } + + if (MP4_IS_VIDEO_TRACK_TYPE(trackType)) { + MP4SetVideoProfileLevel(dstFile, + MP4GetVideoProfileLevel(srcFile)); + dstTrackId = MP4AddVideoTrack( + dstFile, + MP4GetTrackTimeScale(srcFile, srcTrackId), + MP4GetTrackFixedSampleDuration(srcFile, srcTrackId), + MP4GetTrackVideoWidth(srcFile, srcTrackId), + MP4GetTrackVideoHeight(srcFile, srcTrackId), + MP4GetTrackEsdsObjectTypeId(srcFile, srcTrackId)); + + } else if (MP4_IS_AUDIO_TRACK_TYPE(trackType)) { + MP4SetAudioProfileLevel(dstFile, + MP4GetAudioProfileLevel(srcFile)); + dstTrackId = MP4AddAudioTrack( + dstFile, + MP4GetTrackTimeScale(srcFile, srcTrackId), + MP4GetTrackFixedSampleDuration(srcFile, srcTrackId), + MP4GetTrackEsdsObjectTypeId(srcFile, srcTrackId)); + + } else if (MP4_IS_OD_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddODTrack(dstFile); + + } else if (MP4_IS_SCENE_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddSceneTrack(dstFile); + + } else if (MP4_IS_HINT_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddHintTrack( + dstFile, + MP4GetHintTrackReferenceTrackId(srcFile, srcTrackId)); + + } else if (MP4_IS_SYSTEMS_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddSystemsTrack(dstFile, trackType); + + } else { + dstTrackId = MP4AddTrack(dstFile, trackType); + } + + if (dstTrackId == MP4_INVALID_TRACK_ID) { + return dstTrackId; + } + + MP4SetTrackTimeScale( + dstFile, + dstTrackId, + MP4GetTrackTimeScale(srcFile, srcTrackId)); + + if (MP4_IS_AUDIO_TRACK_TYPE(trackType) + || MP4_IS_VIDEO_TRACK_TYPE(trackType)) { + // copy track ES configuration + u_int8_t* pConfig = NULL; + u_int32_t configSize = 0; + + MP4GetTrackESConfiguration( + srcFile, + srcTrackId, + &pConfig, + &configSize); + + MP4SetTrackESConfiguration( + dstFile, + dstTrackId, + pConfig, + configSize); + + free(pConfig); + } + + if (MP4_IS_HINT_TRACK_TYPE(trackType)) { + // probably not exactly what is wanted + // but caller can adjust later to fit their desires + + char* payloadName = NULL; + char *encodingParms = NULL; + u_int8_t payloadNumber; + u_int16_t maxPayloadSize; + + MP4GetHintTrackRtpPayload( + srcFile, + srcTrackId, + &payloadName, + &payloadNumber, + &maxPayloadSize, + &encodingParms); + + MP4SetHintTrackRtpPayload( + dstFile, + dstTrackId, + payloadName, + &payloadNumber, + maxPayloadSize, + encodingParms); + + MP4SetHintTrackSdp( + dstFile, + dstTrackId, + MP4GetHintTrackSdp(srcFile, srcTrackId)); + } + + return dstTrackId; +} + +// Given a track, make an encrypted clone of it in the dest. file +extern "C" MP4TrackId MP4EncAndCloneTrack(MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4FileHandle dstFile) +{ + MP4TrackId dstTrackId = MP4_INVALID_TRACK_ID; + + if (dstFile == NULL) { + dstFile = srcFile; + } + + const char* trackType = + MP4GetTrackType(srcFile, srcTrackId); + + if (!trackType) { + return dstTrackId; + } + + if (MP4_IS_VIDEO_TRACK_TYPE(trackType)) { + MP4SetVideoProfileLevel(dstFile, MP4GetVideoProfileLevel(srcFile)); + dstTrackId = MP4AddEncVideoTrack(dstFile, + MP4GetTrackTimeScale(srcFile, srcTrackId), + MP4GetTrackFixedSampleDuration(srcFile, + srcTrackId), + MP4GetTrackVideoWidth(srcFile, srcTrackId), + MP4GetTrackVideoHeight(srcFile, srcTrackId), + MP4GetTrackEsdsObjectTypeId(srcFile, + srcTrackId)); + + } else if (MP4_IS_AUDIO_TRACK_TYPE(trackType)) { + MP4SetAudioProfileLevel(dstFile, MP4GetAudioProfileLevel(srcFile)); + dstTrackId = MP4AddEncAudioTrack(dstFile, + MP4GetTrackTimeScale(srcFile, srcTrackId), + MP4GetTrackFixedSampleDuration(srcFile, + srcTrackId), + MP4GetTrackEsdsObjectTypeId(srcFile, + srcTrackId)); + + } else if (MP4_IS_OD_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddODTrack(dstFile); + + } else if (MP4_IS_SCENE_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddSceneTrack(dstFile); + + } else if (MP4_IS_HINT_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddHintTrack(dstFile, + MP4GetHintTrackReferenceTrackId(srcFile, + srcTrackId)); + + } else if (MP4_IS_SYSTEMS_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddSystemsTrack(dstFile, trackType); + + } else { + dstTrackId = MP4AddTrack(dstFile, trackType); + } + + if (dstTrackId == MP4_INVALID_TRACK_ID) { + return dstTrackId; + } + + MP4SetTrackTimeScale(dstFile, + dstTrackId, + MP4GetTrackTimeScale(srcFile, srcTrackId)); + + if (MP4_IS_AUDIO_TRACK_TYPE(trackType) + || MP4_IS_VIDEO_TRACK_TYPE(trackType)) { + // copy track ES configuration + u_int8_t* pConfig = NULL; + u_int32_t configSize = 0; + if (MP4GetTrackESConfiguration(srcFile, srcTrackId, + &pConfig, &configSize)) { + + if (pConfig != NULL) { + MP4SetTrackESConfiguration(dstFile, dstTrackId, + pConfig, configSize); + } + } + if (pConfig != NULL) + free(pConfig); + } + + return dstTrackId; +} + +extern "C" MP4TrackId MP4CopyTrack(MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4FileHandle dstFile, + bool applyEdits) +{ + bool copySamples = true; // LATER allow false => reference samples + + MP4TrackId dstTrackId = + MP4CloneTrack(srcFile, srcTrackId, dstFile); + + if (dstTrackId == MP4_INVALID_TRACK_ID) { + return dstTrackId; + } + + bool viaEdits = + applyEdits && MP4GetTrackNumberOfEdits(srcFile, srcTrackId); + + MP4SampleId sampleId = 0; + MP4SampleId numSamples = + MP4GetTrackNumberOfSamples(srcFile, srcTrackId); + + MP4Timestamp when = 0; + MP4Duration editsDuration = + MP4GetTrackEditTotalDuration(srcFile, srcTrackId); + + while (true) { + MP4Duration sampleDuration = MP4_INVALID_DURATION; + + if (viaEdits) { + sampleId = MP4GetSampleIdFromEditTime( + srcFile, + srcTrackId, + when, + NULL, + &sampleDuration); + + // in theory, this shouldn't happen + if (sampleId == MP4_INVALID_SAMPLE_ID) { + MP4DeleteTrack(dstFile, dstTrackId); + return MP4_INVALID_TRACK_ID; + } + + when += sampleDuration; + + if (when >= editsDuration) { + break; + } + } else { + sampleId++; + if (sampleId > numSamples) { + break; + } + } + + bool rc = false; + + if (copySamples) { + rc = MP4CopySample( + srcFile, + srcTrackId, + sampleId, + dstFile, + dstTrackId, + sampleDuration); + + } else { + rc = MP4ReferenceSample( + srcFile, + srcTrackId, + sampleId, + dstFile, + dstTrackId, + sampleDuration); + } + + if (!rc) { + MP4DeleteTrack(dstFile, dstTrackId); + return MP4_INVALID_TRACK_ID; + } + } + + return dstTrackId; +} + + +// Given a source track in a source file, make an encrypted copy of +// the track in the destination file, including sample encryption +extern "C" MP4TrackId MP4EncAndCopyTrack(MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4FileHandle dstFile, + bool applyEdits) +{ + bool copySamples = true; // LATER allow false => reference samples + + MP4TrackId dstTrackId = + MP4EncAndCloneTrack(srcFile, srcTrackId, dstFile); + + if (dstTrackId == MP4_INVALID_TRACK_ID) { + return dstTrackId; + } + + bool viaEdits = + applyEdits && MP4GetTrackNumberOfEdits(srcFile, srcTrackId); + + MP4SampleId sampleId = 0; + MP4SampleId numSamples = + MP4GetTrackNumberOfSamples(srcFile, srcTrackId); + + MP4Timestamp when = 0; + MP4Duration editsDuration = + MP4GetTrackEditTotalDuration(srcFile, srcTrackId); + + while (true) { + MP4Duration sampleDuration = MP4_INVALID_DURATION; + + if (viaEdits) { + sampleId = MP4GetSampleIdFromEditTime(srcFile, + srcTrackId, + when, + NULL, + &sampleDuration); + + // in theory, this shouldn't happen + if (sampleId == MP4_INVALID_SAMPLE_ID) { + MP4DeleteTrack(dstFile, dstTrackId); + return MP4_INVALID_TRACK_ID; + } + + when += sampleDuration; + + if (when >= editsDuration) { + break; + } + } else { + sampleId++; + if (sampleId > numSamples) { + break; + } + } + + bool rc = false; + + if (copySamples) { + // will need to encrypt the sample here + rc = MP4CopySample(srcFile, + srcTrackId, + sampleId, + dstFile, + dstTrackId, + sampleDuration); + + } else { + rc = MP4ReferenceSample(srcFile, + srcTrackId, + sampleId, + dstFile, + dstTrackId, + sampleDuration); + } + + if (!rc) { + MP4DeleteTrack(dstFile, dstTrackId); + return MP4_INVALID_TRACK_ID; + } + } + + return dstTrackId; +} + +extern "C" bool MP4DeleteTrack( + MP4FileHandle hFile, + MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->DeleteTrack(trackId); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" u_int32_t MP4GetNumberOfTracks( + MP4FileHandle hFile, + const char* type, + u_int8_t subType) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetNumberOfTracks(type, subType); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" MP4TrackId MP4FindTrackId( + MP4FileHandle hFile, + u_int16_t index, + const char* type, + u_int8_t subType) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->FindTrackId(index, type, subType); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" u_int16_t MP4FindTrackIndex( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->FindTrackIndex(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return (u_int16_t)-1; +} + +/* specific track properties */ + +extern "C" const char* MP4GetTrackType( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackType(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return NULL; +} + +extern "C" MP4Duration MP4GetTrackDuration( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackDuration(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_DURATION; +} + +extern "C" u_int32_t MP4GetTrackTimeScale( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackTimeScale(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" bool MP4SetTrackTimeScale( + MP4FileHandle hFile, MP4TrackId trackId, u_int32_t value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetTrackTimeScale(trackId, value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + + +// This function should not be used anymore +// use MP4GetTrackEsdsObjectTypeId instead +extern "C" u_int8_t MP4GetTrackAudioType( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + + return ((MP4File*)hFile)->GetTrackAudioType(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_AUDIO_TYPE; +} + +extern "C" u_int8_t MP4GetTrackAudioMpeg4Type( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackAudioMpeg4Type(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_MPEG4_INVALID_AUDIO_TYPE; +} + + +// This function should not be used anymore +// use MP4GetTrackEsdsObjectTypeId instead +extern "C" u_int8_t MP4GetTrackVideoType( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackVideoType(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_VIDEO_TYPE; +} + +// Replacement to MP4GetTrackVideoType and MP4GetTrackAudioType +// Basically does the same thing but with a more self-explanatory name +extern "C" u_int8_t MP4GetTrackEsdsObjectTypeId( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + + return ((MP4File*)hFile)->GetTrackEsdsObjectTypeId(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_AUDIO_TYPE; +} + +extern "C" MP4Duration MP4GetTrackFixedSampleDuration( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackFixedSampleDuration(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_DURATION; +} + +extern "C" u_int32_t MP4GetTrackBitRate( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.esds.decConfigDescr.avgBitrate"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" bool MP4GetTrackESConfiguration( + MP4FileHandle hFile, MP4TrackId trackId, + u_int8_t** ppConfig, u_int32_t* pConfigSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->GetTrackESConfiguration( + trackId, ppConfig, pConfigSize); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + *ppConfig = NULL; + *pConfigSize = 0; + return false; +} + +extern "C" bool MP4SetTrackESConfiguration( + MP4FileHandle hFile, MP4TrackId trackId, + const u_int8_t* pConfig, u_int32_t configSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetTrackESConfiguration( + trackId, pConfig, configSize); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" MP4SampleId MP4GetTrackNumberOfSamples( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackNumberOfSamples(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" u_int16_t MP4GetTrackVideoWidth( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.width"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" u_int16_t MP4GetTrackVideoHeight( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.height"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" float MP4GetTrackVideoFrameRate( + MP4FileHandle hFile, MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackVideoFrameRate(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0.0; +} + +/* generic track properties */ + +extern "C" u_int64_t MP4GetTrackIntegerProperty( + MP4FileHandle hFile, MP4TrackId trackId, + const char* propName) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackIntegerProperty(trackId, + propName); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return (u_int64_t)-1; +} + +extern "C" float MP4GetTrackFloatProperty( + MP4FileHandle hFile, MP4TrackId trackId, + const char* propName) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackFloatProperty(trackId, propName); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return NAN; +} + +extern "C" const char* MP4GetTrackStringProperty( + MP4FileHandle hFile, MP4TrackId trackId, + const char* propName) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackStringProperty(trackId, propName); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return NULL; +} + +extern "C" void MP4GetTrackBytesProperty( + MP4FileHandle hFile, MP4TrackId trackId, const char* propName, + u_int8_t** ppValue, u_int32_t* pValueSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->GetTrackBytesProperty( + trackId, propName, ppValue, pValueSize); + return; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + *ppValue = NULL; + *pValueSize = 0; + return; +} + +extern "C" bool MP4SetTrackIntegerProperty( + MP4FileHandle hFile, MP4TrackId trackId, + const char* propName, int64_t value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetTrackIntegerProperty(trackId, + propName, value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetTrackFloatProperty( + MP4FileHandle hFile, MP4TrackId trackId, + const char* propName, float value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetTrackFloatProperty(trackId, propName, value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetTrackStringProperty( + MP4FileHandle hFile, MP4TrackId trackId, + const char* propName, const char* value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetTrackStringProperty(trackId, propName, value); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetTrackBytesProperty( + MP4FileHandle hFile, MP4TrackId trackId, + const char* propName, const u_int8_t* pValue, u_int32_t valueSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetTrackBytesProperty( + trackId, propName, pValue, valueSize); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +/* sample operations */ + +extern "C" bool MP4ReadSample( + /* input parameters */ + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId, + /* output parameters */ + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + MP4Timestamp* pStartTime, + MP4Duration* pDuration, + MP4Duration* pRenderingOffset, + bool* pIsSyncSample) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->ReadSample( + trackId, + sampleId, + ppBytes, + pNumBytes, + pStartTime, + pDuration, + pRenderingOffset, + pIsSyncSample); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + *pNumBytes = 0; + return false; +} + +extern "C" bool MP4ReadSampleFromTime( + /* input parameters */ + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Timestamp when, + /* output parameters */ + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + MP4Timestamp* pStartTime, + MP4Duration* pDuration, + MP4Duration* pRenderingOffset, + bool* pIsSyncSample) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + MP4SampleId sampleId = + ((MP4File*)hFile)->GetSampleIdFromTime( + trackId, when, false); + + ((MP4File*)hFile)->ReadSample( + trackId, + sampleId, + ppBytes, + pNumBytes, + pStartTime, + pDuration, + pRenderingOffset, + pIsSyncSample); + + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + *pNumBytes = 0; + return false; +} + +extern "C" bool MP4WriteSample( + MP4FileHandle hFile, + MP4TrackId trackId, + const u_int8_t* pBytes, + u_int32_t numBytes, + MP4Duration duration, + MP4Duration renderingOffset, + bool isSyncSample) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->WriteSample( + trackId, + pBytes, + numBytes, + duration, + renderingOffset, + isSyncSample); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4CopySample( + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4SampleId srcSampleId, + MP4FileHandle dstFile, + MP4TrackId dstTrackId, + MP4Duration dstSampleDuration) +{ + bool rc; + u_int8_t* pBytes = NULL; + u_int32_t numBytes = 0; + MP4Duration sampleDuration; + MP4Duration renderingOffset; + bool isSyncSample; + + // Note: we leave it up to the caller to ensure that the + // source and destination tracks are compatible. + // i.e. copying audio samples into a video track + // is unlikely to do anything useful + + rc = MP4ReadSample( + srcFile, + srcTrackId, + srcSampleId, + &pBytes, + &numBytes, + NULL, + &sampleDuration, + &renderingOffset, + &isSyncSample); + + if (!rc) { + return false; + } + + if (dstFile == MP4_INVALID_FILE_HANDLE) { + dstFile = srcFile; + } + if (dstTrackId == MP4_INVALID_TRACK_ID) { + dstTrackId = srcTrackId; + } + if (dstSampleDuration != MP4_INVALID_DURATION) { + sampleDuration = dstSampleDuration; + } + + rc = MP4WriteSample( + dstFile, + dstTrackId, + pBytes, + numBytes, + sampleDuration, + renderingOffset, + isSyncSample); + + free(pBytes); + + return rc; +} + +extern "C" bool MP4ReferenceSample( + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4SampleId srcSampleId, + MP4FileHandle dstFile, + MP4TrackId dstTrackId, + MP4Duration dstSampleDuration) +{ + // LATER Not yet implemented + return false; +} + +extern "C" u_int32_t MP4GetSampleSize( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetSampleSize( + trackId, sampleId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" u_int32_t MP4GetTrackMaxSampleSize( + MP4FileHandle hFile, + MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackMaxSampleSize(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" MP4SampleId MP4GetSampleIdFromTime( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Timestamp when, + bool wantSyncSample) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetSampleIdFromTime( + trackId, when, wantSyncSample); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_SAMPLE_ID; +} + +extern "C" MP4Timestamp MP4GetSampleTime( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetSampleTime( + trackId, sampleId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TIMESTAMP; +} + +extern "C" MP4Duration MP4GetSampleDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetSampleDuration( + trackId, sampleId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_DURATION; +} + +extern "C" MP4Duration MP4GetSampleRenderingOffset( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetSampleRenderingOffset( + trackId, sampleId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_DURATION; +} + +extern "C" bool MP4SetSampleRenderingOffset( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId, + MP4Duration renderingOffset) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetSampleRenderingOffset( + trackId, sampleId, renderingOffset); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" int8_t MP4GetSampleSync( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetSampleSync( + trackId, sampleId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return -1; +} + + +extern "C" u_int64_t MP4ConvertFromMovieDuration( + MP4FileHandle hFile, + MP4Duration duration, + u_int32_t timeScale) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->ConvertFromMovieDuration( + duration, timeScale); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return (u_int64_t)MP4_INVALID_DURATION; +} + +extern "C" u_int64_t MP4ConvertFromTrackTimestamp( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Timestamp timeStamp, + u_int32_t timeScale) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->ConvertFromTrackTimestamp( + trackId, timeStamp, timeScale); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return (u_int64_t)MP4_INVALID_TIMESTAMP; +} + +extern "C" MP4Timestamp MP4ConvertToTrackTimestamp( + MP4FileHandle hFile, + MP4TrackId trackId, + u_int64_t timeStamp, + u_int32_t timeScale) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->ConvertToTrackTimestamp( + trackId, timeStamp, timeScale); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TIMESTAMP; +} + +extern "C" u_int64_t MP4ConvertFromTrackDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Duration duration, + u_int32_t timeScale) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->ConvertFromTrackDuration( + trackId, duration, timeScale); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return (u_int64_t)MP4_INVALID_DURATION; +} + +extern "C" MP4Duration MP4ConvertToTrackDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + u_int64_t duration, + u_int32_t timeScale) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->ConvertToTrackDuration( + trackId, duration, timeScale); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_DURATION; +} + +extern "C" bool MP4GetHintTrackRtpPayload( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + char** ppPayloadName, + u_int8_t* pPayloadNumber, + u_int16_t* pMaxPayloadSize, + char **ppEncodingParams) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->GetHintTrackRtpPayload( + hintTrackId, ppPayloadName, pPayloadNumber, pMaxPayloadSize, + ppEncodingParams); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetHintTrackRtpPayload( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + const char* pPayloadName, + u_int8_t* pPayloadNumber, + u_int16_t maxPayloadSize, + const char *encode_params, + bool include_rtp_map, + bool include_mpeg4_esid) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetHintTrackRtpPayload( + hintTrackId, pPayloadName, pPayloadNumber, maxPayloadSize, encode_params, + include_rtp_map, include_mpeg4_esid); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" const char* MP4GetSessionSdp( + MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetSessionSdp(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return NULL; +} + +extern "C" bool MP4SetSessionSdp( + MP4FileHandle hFile, + const char* sdpString) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetSessionSdp(sdpString); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4AppendSessionSdp( + MP4FileHandle hFile, + const char* sdpString) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->AppendSessionSdp(sdpString); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" const char* MP4GetHintTrackSdp( + MP4FileHandle hFile, + MP4TrackId hintTrackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetHintTrackSdp(hintTrackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return NULL; +} + +extern "C" bool MP4SetHintTrackSdp( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + const char* sdpString) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetHintTrackSdp(hintTrackId, sdpString); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4AppendHintTrackSdp( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + const char* sdpString) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->AppendHintTrackSdp(hintTrackId, sdpString); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" MP4TrackId MP4GetHintTrackReferenceTrackId( + MP4FileHandle hFile, + MP4TrackId hintTrackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)-> + GetHintTrackReferenceTrackId(hintTrackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" bool MP4ReadRtpHint( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + MP4SampleId hintSampleId, + u_int16_t* pNumPackets) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->ReadRtpHint( + hintTrackId, hintSampleId, pNumPackets); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" u_int16_t MP4GetRtpHintNumberOfPackets( + MP4FileHandle hFile, + MP4TrackId hintTrackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetRtpHintNumberOfPackets(hintTrackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" int8_t MP4GetRtpPacketBFrame( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + u_int16_t packetIndex) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)-> + GetRtpPacketBFrame(hintTrackId, packetIndex); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return -1; +} + +extern "C" int32_t MP4GetRtpPacketTransmitOffset( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + u_int16_t packetIndex) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)-> + GetRtpPacketTransmitOffset(hintTrackId, packetIndex); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" bool MP4ReadRtpPacket( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + u_int16_t packetIndex, + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + u_int32_t ssrc, + bool includeHeader, + bool includePayload) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->ReadRtpPacket( + hintTrackId, packetIndex, + ppBytes, pNumBytes, + ssrc, includeHeader, includePayload); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" MP4Timestamp MP4GetRtpTimestampStart( + MP4FileHandle hFile, + MP4TrackId hintTrackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetRtpTimestampStart(hintTrackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TIMESTAMP; +} + +extern "C" bool MP4SetRtpTimestampStart( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + MP4Timestamp rtpStart) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetRtpTimestampStart( + hintTrackId, rtpStart); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4AddRtpHint( + MP4FileHandle hFile, + MP4TrackId hintTrackId) +{ + return MP4AddRtpVideoHint(hFile, hintTrackId, false, 0); +} + +extern "C" bool MP4AddRtpVideoHint( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + bool isBframe, + u_int32_t timestampOffset) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->AddRtpHint(hintTrackId, + isBframe, timestampOffset); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4AddRtpPacket( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + bool setMbit, + int32_t transmitOffset) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->AddRtpPacket( + hintTrackId, setMbit, transmitOffset); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4AddRtpImmediateData( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + const u_int8_t* pBytes, + u_int32_t numBytes) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->AddRtpImmediateData(hintTrackId, + pBytes, numBytes); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4AddRtpSampleData( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + MP4SampleId sampleId, + u_int32_t dataOffset, + u_int32_t dataLength) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->AddRtpSampleData( + hintTrackId, sampleId, dataOffset, dataLength); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4AddRtpESConfigurationPacket( + MP4FileHandle hFile, + MP4TrackId hintTrackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->AddRtpESConfigurationPacket(hintTrackId); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4WriteRtpHint( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + MP4Duration duration, + bool isSyncSample) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->WriteRtpHint( + hintTrackId, duration, isSyncSample); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +/* ISMA specific operations */ + +extern "C" bool MP4MakeIsmaCompliant( + const char* fileName, + u_int32_t verbosity, + bool addIsmaComplianceSdp) +{ + MP4File* pFile = NULL; + + try { + pFile = new MP4File(verbosity); + pFile->Modify(fileName); + pFile->MakeIsmaCompliant(addIsmaComplianceSdp); + pFile->Close(); + delete pFile; + return true; + } + catch (MP4Error* e) { + VERBOSE_ERROR(verbosity, e->Print()); + delete e; + } + delete pFile; + return false; +} + +extern "C" char* MP4MakeIsmaSdpIod( + u_int8_t videoProfile, + u_int32_t videoBitrate, + u_int8_t* videoConfig, + u_int32_t videoConfigLength, + u_int8_t audioProfile, + u_int32_t audioBitrate, + u_int8_t* audioConfig, + u_int32_t audioConfigLength, + u_int32_t verbosity) +{ + MP4File* pFile = NULL; + + try { + pFile = new MP4File(verbosity); + + u_int8_t* pBytes = NULL; + u_int64_t numBytes = 0; + + pFile->CreateIsmaIodFromParams( + videoProfile, + videoBitrate, + videoConfig, + videoConfigLength, + audioProfile, + audioBitrate, + audioConfig, + audioConfigLength, + &pBytes, + &numBytes); + + char* iodBase64 = + MP4ToBase64(pBytes, numBytes); + MP4Free(pBytes); + + char* sdpIod = + (char*)MP4Malloc(strlen(iodBase64) + 64); + sprintf(sdpIod, + "a=mpeg4-iod: \042data:application/mpeg4-iod;base64,%s\042", + iodBase64); + MP4Free(iodBase64); + + delete pFile; + + return sdpIod; + } + catch (MP4Error* e) { + VERBOSE_ERROR(verbosity, e->Print()); + delete e; + } + delete pFile; + return NULL; +} + +/* Edit list */ + +extern "C" MP4EditId MP4AddTrackEdit( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId, + MP4Timestamp startTime, + MP4Duration duration, + bool dwell) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + MP4EditId newEditId = + ((MP4File*)hFile)->AddTrackEdit(trackId, editId); + + if (newEditId != MP4_INVALID_EDIT_ID) { + ((MP4File*)hFile)->SetTrackEditMediaStart( + trackId, newEditId, startTime); + ((MP4File*)hFile)->SetTrackEditDuration( + trackId, newEditId, duration); + ((MP4File*)hFile)->SetTrackEditDwell( + trackId, newEditId, dwell); + } + + return newEditId; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_EDIT_ID; +} + +extern "C" bool MP4DeleteTrackEdit( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->DeleteTrackEdit(trackId, editId); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" u_int32_t MP4GetTrackNumberOfEdits( + MP4FileHandle hFile, + MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackNumberOfEdits(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return 0; +} + +extern "C" MP4Timestamp MP4GetTrackEditMediaStart( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackEditMediaStart( + trackId, editId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TIMESTAMP; +} + +extern "C" MP4Duration MP4GetTrackEditTotalDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackEditTotalDuration( + trackId, editId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_DURATION; +} + +extern "C" bool MP4SetTrackEditMediaStart( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId, + MP4Timestamp startTime) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetTrackEditMediaStart( + trackId, editId, startTime); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" MP4Duration MP4GetTrackEditDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackEditDuration(trackId, editId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_DURATION; +} + +extern "C" bool MP4SetTrackEditDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId, + MP4Duration duration) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetTrackEditDuration(trackId, editId, duration); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" int8_t MP4GetTrackEditDwell( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackEditDwell(trackId, editId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return -1; +} + +extern "C" bool MP4SetTrackEditDwell( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId, + bool dwell) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->SetTrackEditDwell(trackId, editId, dwell); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4ReadSampleFromEditTime( + /* input parameters */ + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Timestamp when, + /* output parameters */ + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + MP4Timestamp* pStartTime, + MP4Duration* pDuration, + MP4Duration* pRenderingOffset, + bool* pIsSyncSample) +{ + MP4SampleId sampleId = + MP4GetSampleIdFromEditTime( + hFile, + trackId, + when, + pStartTime, + pDuration); + + return MP4ReadSample( + hFile, + trackId, + sampleId, + ppBytes, + pNumBytes, + NULL, + NULL, + pRenderingOffset, + pIsSyncSample); +} + +extern "C" MP4SampleId MP4GetSampleIdFromEditTime( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Timestamp when, + MP4Timestamp* pStartTime, + MP4Duration* pDuration) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetSampleIdFromEditTime( + trackId, when, pStartTime, pDuration); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_SAMPLE_ID; +} + +/* Utlities */ + +extern "C" char* MP4BinaryToBase16( + const u_int8_t* pData, + u_int32_t dataSize) +{ + if (pData || dataSize == 0) { + try { + return MP4ToBase16(pData, dataSize); + } + catch (MP4Error* e) { + delete e; + } + } + return NULL; +} + +extern "C" char* MP4BinaryToBase64( + const u_int8_t* pData, + u_int32_t dataSize) +{ + if (pData || dataSize == 0) { + try { + return MP4ToBase64(pData, dataSize); + } + catch (MP4Error* e) { + delete e; + } + } + return NULL; +} + + +/* iTunes meta data handling */ +extern "C" bool MP4GetMetadataByIndex(MP4FileHandle hFile, u_int32_t index, + const char** ppName, + u_int8_t** ppValue, u_int32_t* pValueSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataByIndex( + index, ppName, ppValue, pValueSize); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4MetadataDelete(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->MetadataDelete(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataName(MP4FileHandle hFile, + const char* value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataName(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataName(MP4FileHandle hFile, + char** value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataName(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataWriter(MP4FileHandle hFile, + const char* value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataWriter(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataWriter(MP4FileHandle hFile, + char** value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataWriter(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataAlbum(MP4FileHandle hFile, + const char* value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataAlbum(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataAlbum(MP4FileHandle hFile, + char** value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataAlbum(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataArtist(MP4FileHandle hFile, + const char* value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataArtist(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataArtist(MP4FileHandle hFile, + char** value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataArtist(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataTool(MP4FileHandle hFile, + const char* value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataTool(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataTool(MP4FileHandle hFile, + char** value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataTool(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataComment(MP4FileHandle hFile, + const char* value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataComment(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataComment(MP4FileHandle hFile, + char** value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataComment(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataYear(MP4FileHandle hFile, + const char* value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataYear(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataYear(MP4FileHandle hFile, + char** value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataYear(value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataTrack(MP4FileHandle hFile, + u_int16_t track, u_int16_t totalTracks) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataTrack(track, totalTracks); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataTrack(MP4FileHandle hFile, + u_int16_t* track, u_int16_t* totalTracks) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataTrack(track, totalTracks); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataDisk(MP4FileHandle hFile, + u_int16_t disk, u_int16_t totalDisks) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataDisk(disk, totalDisks); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataDisk(MP4FileHandle hFile, + u_int16_t* disk, u_int16_t* totalDisks) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataDisk(disk, totalDisks); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataGenre(MP4FileHandle hFile, const char* genre) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataGenre(genre); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataGenre(MP4FileHandle hFile, char** genre) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataGenre(genre); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataTempo(MP4FileHandle hFile, u_int16_t tempo) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataTempo(tempo); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataTempo(MP4FileHandle hFile, u_int16_t* tempo) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataTempo(tempo); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataCompilation(MP4FileHandle hFile, u_int8_t cpl) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataCompilation(cpl); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataCompilation(MP4FileHandle hFile, u_int8_t* cpl) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataCompilation(cpl); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataCoverArt(MP4FileHandle hFile, + u_int8_t *coverArt, u_int32_t size) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataCoverArt(coverArt, size); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataCoverArt(MP4FileHandle hFile, + u_int8_t **coverArt, u_int32_t* size) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataCoverArt(coverArt, size); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataFreeForm(MP4FileHandle hFile, char *name, + u_int8_t* pValue, u_int32_t valueSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataFreeForm(name, pValue, valueSize); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataFreeForm(MP4FileHandle hFile, char *name, + u_int8_t** pValue, u_int32_t* valueSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataFreeForm(name, pValue, valueSize); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4.h @@ -0,0 +1,1006 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +#ifndef __MP4_INCLUDED__ +#define __MP4_INCLUDED__ + +/* include system and project specific headers */ +#include + +#include /* to define float HUGE_VAL and/or NAN */ +#ifndef NAN +#define NAN HUGE_VAL +#endif + +#ifdef __cplusplus +/* exploit C++ ability of default values for function parameters */ +#define DEFAULT(x) =x +#else +#define DEFAULT(x) +#endif + +/* MP4 API types */ +typedef void* MP4FileHandle; +typedef u_int32_t MP4TrackId; +typedef u_int32_t MP4SampleId; +typedef u_int64_t MP4Timestamp; +typedef u_int64_t MP4Duration; +typedef u_int32_t MP4EditId; + +/* Invalid values for API types */ +#define MP4_INVALID_FILE_HANDLE ((MP4FileHandle)NULL) +#define MP4_INVALID_TRACK_ID ((MP4TrackId)0) +#define MP4_INVALID_SAMPLE_ID ((MP4SampleId)0) +#define MP4_INVALID_TIMESTAMP ((MP4Timestamp)-1) +#define MP4_INVALID_DURATION ((MP4Duration)-1) +#define MP4_INVALID_EDIT_ID ((MP4EditId)0) + +/* Macros to test for API type validity */ +#define MP4_IS_VALID_FILE_HANDLE(x) ((x) != MP4_INVALID_FILE_HANDLE) +#define MP4_IS_VALID_TRACK_ID(x) ((x) != MP4_INVALID_TRACK_ID) +#define MP4_IS_VALID_SAMPLE_ID(x) ((x) != MP4_INVALID_SAMPLE_ID) +#define MP4_IS_VALID_TIMESTAMP(x) ((x) != MP4_INVALID_TIMESTAMP) +#define MP4_IS_VALID_DURATION(x) ((x) != MP4_INVALID_DURATION) +#define MP4_IS_VALID_EDIT_ID(x) ((x) != MP4_INVALID_EDIT_ID) + +/* MP4 verbosity levels - e.g. MP4SetVerbosity() */ +#define MP4_DETAILS_ALL 0xFFFFFFFF +#define MP4_DETAILS_ERROR 0x00000001 +#define MP4_DETAILS_WARNING 0x00000002 +#define MP4_DETAILS_READ 0x00000004 +#define MP4_DETAILS_WRITE 0x00000008 +#define MP4_DETAILS_FIND 0x00000010 +#define MP4_DETAILS_TABLE 0x00000020 +#define MP4_DETAILS_SAMPLE 0x00000040 +#define MP4_DETAILS_HINT 0x00000080 +#define MP4_DETAILS_ISMA 0x00000100 +#define MP4_DETAILS_EDIT 0x00000200 + +#define MP4_DETAILS_READ_ALL \ + (MP4_DETAILS_READ | MP4_DETAILS_TABLE | MP4_DETAILS_SAMPLE) +#define MP4_DETAILS_WRITE_ALL \ + (MP4_DETAILS_WRITE | MP4_DETAILS_TABLE | MP4_DETAILS_SAMPLE) + +/* + * MP4 Known track type names - e.g. MP4GetNumberOfTracks(type) + * + * Note this first group of track types should be created + * via the MP4AddTrack() functions, and not MP4AddTrack(type) + */ +#define MP4_OD_TRACK_TYPE "odsm" +#define MP4_SCENE_TRACK_TYPE "sdsm" +#define MP4_AUDIO_TRACK_TYPE "soun" +#define MP4_VIDEO_TRACK_TYPE "vide" +#define MP4_HINT_TRACK_TYPE "hint" +/* + * This second set of track types should be created + * via MP4AddSystemsTrack(type) + */ +#define MP4_CLOCK_TRACK_TYPE "crsm" +#define MP4_MPEG7_TRACK_TYPE "m7sm" +#define MP4_OCI_TRACK_TYPE "ocsm" +#define MP4_IPMP_TRACK_TYPE "ipsm" +#define MP4_MPEGJ_TRACK_TYPE "mjsm" + +#define MP4_IS_VIDEO_TRACK_TYPE(type) \ + (!strcasecmp(type, MP4_VIDEO_TRACK_TYPE)) + +#define MP4_IS_AUDIO_TRACK_TYPE(type) \ + (!strcasecmp(type, MP4_AUDIO_TRACK_TYPE)) + +#define MP4_IS_OD_TRACK_TYPE(type) \ + (!strcasecmp(type, MP4_OD_TRACK_TYPE)) + +#define MP4_IS_SCENE_TRACK_TYPE(type) \ + (!strcasecmp(type, MP4_SCENE_TRACK_TYPE)) + +#define MP4_IS_HINT_TRACK_TYPE(type) \ + (!strcasecmp(type, MP4_HINT_TRACK_TYPE)) + +#define MP4_IS_SYSTEMS_TRACK_TYPE(type) \ + (!strcasecmp(type, MP4_CLOCK_TRACK_TYPE) \ + || !strcasecmp(type, MP4_MPEG7_TRACK_TYPE) \ + || !strcasecmp(type, MP4_OCI_TRACK_TYPE) \ + || !strcasecmp(type, MP4_IPMP_TRACK_TYPE) \ + || !strcasecmp(type, MP4_MPEGJ_TRACK_TYPE)) + +/* MP4 Audio track types - see MP4AddAudioTrack()*/ +#define MP4_INVALID_AUDIO_TYPE 0x00 +#define MP4_MPEG1_AUDIO_TYPE 0x6B +#define MP4_MPEG2_AUDIO_TYPE 0x69 +#define MP4_MP3_AUDIO_TYPE MP4_MPEG2_AUDIO_TYPE +#define MP4_MPEG2_AAC_MAIN_AUDIO_TYPE 0x66 +#define MP4_MPEG2_AAC_LC_AUDIO_TYPE 0x67 +#define MP4_MPEG2_AAC_SSR_AUDIO_TYPE 0x68 +#define MP4_MPEG2_AAC_AUDIO_TYPE MP4_MPEG2_AAC_MAIN_AUDIO_TYPE +#define MP4_MPEG4_AUDIO_TYPE 0x40 +#define MP4_PRIVATE_AUDIO_TYPE 0xC0 +#define MP4_PCM16_LITTLE_ENDIAN_AUDIO_TYPE 0xE0 /* a private definition */ +#define MP4_VORBIS_AUDIO_TYPE 0xE1 /* a private definition */ +#define MP4_AC3_AUDIO_TYPE 0xE2 /* a private definition */ +#define MP4_ALAW_AUDIO_TYPE 0xE3 /* a private definition */ +#define MP4_ULAW_AUDIO_TYPE 0xE4 /* a private definition */ +#define MP4_G723_AUDIO_TYPE 0xE5 /* a private definition */ +#define MP4_PCM16_BIG_ENDIAN_AUDIO_TYPE 0xE6 /* a private definition */ + +/* MP4 MPEG-4 Audio types from 14496-3 Table 1.5.1 */ +#define MP4_MPEG4_INVALID_AUDIO_TYPE 0 +#define MP4_MPEG4_AAC_MAIN_AUDIO_TYPE 1 +#define MP4_MPEG4_AAC_LC_AUDIO_TYPE 2 +#define MP4_MPEG4_AAC_SSR_AUDIO_TYPE 3 +#define MP4_MPEG4_AAC_LTP_AUDIO_TYPE 4 +#define MP4_MPEG4_AAC_SCALABLE_AUDIO_TYPE 6 +#define MP4_MPEG4_CELP_AUDIO_TYPE 8 +#define MP4_MPEG4_HVXC_AUDIO_TYPE 9 +#define MP4_MPEG4_TTSI_AUDIO_TYPE 12 +#define MP4_MPEG4_MAIN_SYNTHETIC_AUDIO_TYPE 13 +#define MP4_MPEG4_WAVETABLE_AUDIO_TYPE 14 +#define MP4_MPEG4_MIDI_AUDIO_TYPE 15 +#define MP4_MPEG4_ALGORITHMIC_FX_AUDIO_TYPE 16 + +/* MP4 Audio type utilities following common usage */ +#define MP4_IS_MP3_AUDIO_TYPE(type) \ + ((type) == MP4_MPEG1_AUDIO_TYPE || (type) == MP4_MPEG2_AUDIO_TYPE) + +#define MP4_IS_MPEG2_AAC_AUDIO_TYPE(type) \ + (((type) >= MP4_MPEG2_AAC_MAIN_AUDIO_TYPE \ + && (type) <= MP4_MPEG2_AAC_SSR_AUDIO_TYPE)) + +#define MP4_IS_MPEG4_AAC_AUDIO_TYPE(mpeg4Type) \ + (((mpeg4Type) >= MP4_MPEG4_AAC_MAIN_AUDIO_TYPE \ + && (mpeg4Type) <= MP4_MPEG4_AAC_LTP_AUDIO_TYPE) \ + || (mpeg4Type) == MP4_MPEG4_AAC_SCALABLE_AUDIO_TYPE \ + || (mpeg4Type) == 17) + +#define MP4_IS_AAC_AUDIO_TYPE(type) \ + (MP4_IS_MPEG2_AAC_AUDIO_TYPE(type) \ + || (type) == MP4_MPEG4_AUDIO_TYPE) + +/* MP4 Video track types - see MP4AddVideoTrack() */ +#define MP4_INVALID_VIDEO_TYPE 0x00 +#define MP4_MPEG1_VIDEO_TYPE 0x6A +#define MP4_MPEG2_SIMPLE_VIDEO_TYPE 0x60 +#define MP4_MPEG2_MAIN_VIDEO_TYPE 0x61 +#define MP4_MPEG2_SNR_VIDEO_TYPE 0x62 +#define MP4_MPEG2_SPATIAL_VIDEO_TYPE 0x63 +#define MP4_MPEG2_HIGH_VIDEO_TYPE 0x64 +#define MP4_MPEG2_442_VIDEO_TYPE 0x65 +#define MP4_MPEG2_VIDEO_TYPE MP4_MPEG2_MAIN_VIDEO_TYPE +#define MP4_MPEG4_VIDEO_TYPE 0x20 +#define MP4_JPEG_VIDEO_TYPE 0x6C +#define MP4_PRIVATE_VIDEO_TYPE 0xD0 +#define MP4_YUV12_VIDEO_TYPE 0xF0 /* a private definition */ +#define MP4_H264_VIDEO_TYPE 0xF1 /* a private definition */ +#define MP4_H263_VIDEO_TYPE 0xF2 /* a private definition */ +#define MP4_H261_VIDEO_TYPE 0xF3 /* a private definition */ + +/* MP4 Video type utilities */ +#define MP4_IS_MPEG1_VIDEO_TYPE(type) \ + ((type) == MP4_MPEG1_VIDEO_TYPE) + +#define MP4_IS_MPEG2_VIDEO_TYPE(type) \ + (((type) >= MP4_MPEG2_SIMPLE_VIDEO_TYPE \ + && (type) <= MP4_MPEG2_442_VIDEO_TYPE) \ + || MP4_IS_MPEG1_VIDEO_TYPE(type)) + +#define MP4_IS_MPEG4_VIDEO_TYPE(type) \ + ((type) == MP4_MPEG4_VIDEO_TYPE) + + +/* MP4 API declarations */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* file operations */ + +MP4FileHandle MP4Create( + const char* fileName, + u_int32_t verbosity DEFAULT(0), + bool use64bits DEFAULT(0), + bool useExtensibleFormat DEFAULT(0)); + +MP4FileHandle MP4Modify( + const char* fileName, + u_int32_t verbosity DEFAULT(0), + bool useExtensibleFormat DEFAULT(0)); + +MP4FileHandle MP4Read( + const char* fileName, + u_int32_t verbosity DEFAULT(0)); + +bool MP4Close( + MP4FileHandle hFile); + +bool MP4Optimize( + const char* existingFileName, + const char* newFileName DEFAULT(NULL), + u_int32_t verbosity DEFAULT(0)); + +bool MP4Dump( + MP4FileHandle hFile, + FILE* pDumpFile DEFAULT(NULL), + bool dumpImplicits DEFAULT(0)); + +char* MP4Info( + MP4FileHandle hFile, + MP4TrackId trackId DEFAULT(MP4_INVALID_TRACK_ID)); + +char* MP4FileInfo( + const char* fileName, + MP4TrackId trackId DEFAULT(MP4_INVALID_TRACK_ID)); + +/* file properties */ + +/* specific file properties */ + +u_int32_t MP4GetVerbosity(MP4FileHandle hFile); + +bool MP4SetVerbosity(MP4FileHandle hFile, u_int32_t verbosity); + +MP4Duration MP4GetDuration(MP4FileHandle hFile); + +u_int32_t MP4GetTimeScale(MP4FileHandle hFile); + +bool MP4SetTimeScale(MP4FileHandle hFile, u_int32_t value); + +u_int8_t MP4GetODProfileLevel(MP4FileHandle hFile); + +bool MP4SetODProfileLevel(MP4FileHandle hFile, u_int8_t value); + +u_int8_t MP4GetSceneProfileLevel(MP4FileHandle hFile); + +bool MP4SetSceneProfileLevel(MP4FileHandle hFile, u_int8_t value); + +u_int8_t MP4GetVideoProfileLevel(MP4FileHandle hFile); + +bool MP4SetVideoProfileLevel(MP4FileHandle hFile, u_int8_t value); + +u_int8_t MP4GetAudioProfileLevel(MP4FileHandle hFile); + +bool MP4SetAudioProfileLevel(MP4FileHandle hFile, u_int8_t value); + +u_int8_t MP4GetGraphicsProfileLevel(MP4FileHandle hFile); + +bool MP4SetGraphicsProfileLevel(MP4FileHandle hFile, u_int8_t value); + +/* generic file properties */ + +u_int64_t MP4GetIntegerProperty( + MP4FileHandle hFile, + const char* propName); + +float MP4GetFloatProperty( + MP4FileHandle hFile, + const char* propName); + +const char* MP4GetStringProperty( + MP4FileHandle hFile, + const char* propName); + +void MP4GetBytesProperty( + MP4FileHandle hFile, + const char* propName, + u_int8_t** ppValue, + u_int32_t* pValueSize); + +bool MP4SetIntegerProperty( + MP4FileHandle hFile, + const char* propName, + int64_t value); + +bool MP4SetFloatProperty( + MP4FileHandle hFile, + const char* propName, + float value); + +bool MP4SetStringProperty( + MP4FileHandle hFile, const char* propName, const char* value); + +bool MP4SetBytesProperty( + MP4FileHandle hFile, const char* propName, + const u_int8_t* pValue, u_int32_t valueSize); + +/* track operations */ + +MP4TrackId MP4AddTrack( + MP4FileHandle hFile, + const char* type); + +MP4TrackId MP4AddSystemsTrack( + MP4FileHandle hFile, + const char* type); + +MP4TrackId MP4AddODTrack( + MP4FileHandle hFile); + +MP4TrackId MP4AddSceneTrack( + MP4FileHandle hFile); + +MP4TrackId MP4AddAudioTrack( + MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int8_t audioType DEFAULT(MP4_MPEG4_AUDIO_TYPE)); + +MP4TrackId MP4AddEncAudioTrack( + MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int8_t audioType DEFAULT(MP4_MPEG4_AUDIO_TYPE)); + +MP4TrackId MP4AddVideoTrack( + MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + u_int8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE)); + +MP4TrackId MP4AddEncVideoTrack( + MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + u_int8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE)); + +MP4TrackId MP4AddHintTrack( + MP4FileHandle hFile, + MP4TrackId refTrackId); + +MP4TrackId MP4CloneTrack( + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE)); + +MP4TrackId MP4EncAndCloneTrack( + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE)); + +MP4TrackId MP4CopyTrack( + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE), + bool applyEdits DEFAULT(false)); + +MP4TrackId MP4EncAndCopyTrack( + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE), + bool applyEdits DEFAULT(false)); + +bool MP4DeleteTrack( + MP4FileHandle hFile, + MP4TrackId trackId); + +u_int32_t MP4GetNumberOfTracks( + MP4FileHandle hFile, + const char* type DEFAULT(NULL), + u_int8_t subType DEFAULT(0)); + +MP4TrackId MP4FindTrackId( + MP4FileHandle hFile, + u_int16_t index, + const char* type DEFAULT(NULL), + u_int8_t subType DEFAULT(0)); + +u_int16_t MP4FindTrackIndex( + MP4FileHandle hFile, + MP4TrackId trackId); + +/* track properties */ + +/* specific track properties */ + +const char* MP4GetTrackType( + MP4FileHandle hFile, + MP4TrackId trackId); + +MP4Duration MP4GetTrackDuration( + MP4FileHandle hFile, + MP4TrackId trackId); + +u_int32_t MP4GetTrackTimeScale( + MP4FileHandle hFile, + MP4TrackId trackId); + +bool MP4SetTrackTimeScale( + MP4FileHandle hFile, + MP4TrackId trackId, + u_int32_t value); + +// Should not be used, replace with MP4GetTrackEsdsObjectTypeId +u_int8_t MP4GetTrackAudioType( + MP4FileHandle hFile, + MP4TrackId trackId); + +u_int8_t MP4GetTrackAudioMpeg4Type( + MP4FileHandle hFile, + MP4TrackId trackId); + +// Should not be used, replace with MP4GetTrackEsdsObjectTypeId +u_int8_t MP4GetTrackVideoType( + MP4FileHandle hFile, + MP4TrackId trackId); + +u_int8_t MP4GetTrackEsdsObjectTypeId( + MP4FileHandle hFile, + MP4TrackId trackId); + +/* returns MP4_INVALID_DURATION if track samples do not have a fixed duration */ +MP4Duration MP4GetTrackFixedSampleDuration( + MP4FileHandle hFile, + MP4TrackId trackId); + +u_int32_t MP4GetTrackBitRate( + MP4FileHandle hFile, + MP4TrackId trackId); + +bool MP4GetTrackESConfiguration( + MP4FileHandle hFile, + MP4TrackId trackId, + u_int8_t** ppConfig, + u_int32_t* pConfigSize); + +bool MP4SetTrackESConfiguration( + MP4FileHandle hFile, + MP4TrackId trackId, + const u_int8_t* pConfig, + u_int32_t configSize); + +MP4SampleId MP4GetTrackNumberOfSamples( + MP4FileHandle hFile, + MP4TrackId trackId); + +u_int16_t MP4GetTrackVideoWidth( + MP4FileHandle hFile, + MP4TrackId trackId); + +u_int16_t MP4GetTrackVideoHeight( + MP4FileHandle hFile, + MP4TrackId trackId); + +float MP4GetTrackVideoFrameRate( + MP4FileHandle hFile, + MP4TrackId trackId); + +/* generic track properties */ + +u_int64_t MP4GetTrackIntegerProperty( + MP4FileHandle hFile, + MP4TrackId trackId, + const char* propName); + +float MP4GetTrackFloatProperty( + MP4FileHandle hFile, + MP4TrackId trackId, + const char* propName); + +const char* MP4GetTrackStringProperty( + MP4FileHandle hFile, + MP4TrackId trackId, + const char* propName); + +void MP4GetTrackBytesProperty( + MP4FileHandle hFile, + MP4TrackId trackId, + const char* propName, + u_int8_t** ppValue, + u_int32_t* pValueSize); + +bool MP4SetTrackIntegerProperty( + MP4FileHandle hFile, + MP4TrackId trackId, + const char* propName, + int64_t value); + +bool MP4SetTrackFloatProperty( + MP4FileHandle hFile, + MP4TrackId trackId, + const char* propName, + float value); + +bool MP4SetTrackStringProperty( + MP4FileHandle hFile, + MP4TrackId trackId, + const char* propName, + const char* value); + +bool MP4SetTrackBytesProperty( + MP4FileHandle hFile, + MP4TrackId trackId, + const char* propName, + const u_int8_t* pValue, + u_int32_t valueSize); + +/* sample operations */ + +bool MP4ReadSample( + /* input parameters */ + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId, + /* input/output parameters */ + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + /* output parameters */ + MP4Timestamp* pStartTime DEFAULT(NULL), + MP4Duration* pDuration DEFAULT(NULL), + MP4Duration* pRenderingOffset DEFAULT(NULL), + bool* pIsSyncSample DEFAULT(NULL)); + +/* uses (unedited) time to specify sample instead of sample id */ +bool MP4ReadSampleFromTime( + /* input parameters */ + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Timestamp when, + /* input/output parameters */ + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + /* output parameters */ + MP4Timestamp* pStartTime DEFAULT(NULL), + MP4Duration* pDuration DEFAULT(NULL), + MP4Duration* pRenderingOffset DEFAULT(NULL), + bool* pIsSyncSample DEFAULT(NULL)); + +bool MP4WriteSample( + MP4FileHandle hFile, + MP4TrackId trackId, + const u_int8_t* pBytes, + u_int32_t numBytes, + MP4Duration duration DEFAULT(MP4_INVALID_DURATION), + MP4Duration renderingOffset DEFAULT(0), + bool isSyncSample DEFAULT(true)); + +bool MP4CopySample( + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4SampleId srcSampleId, + MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE), + MP4TrackId dstTrackId DEFAULT(MP4_INVALID_TRACK_ID), + MP4Duration dstSampleDuration DEFAULT(MP4_INVALID_DURATION)); + +/* Note this function is not yet implemented */ +bool MP4ReferenceSample( + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4SampleId srcSampleId, + MP4FileHandle dstFile, + MP4TrackId dstTrackId, + MP4Duration dstSampleDuration DEFAULT(MP4_INVALID_DURATION)); + +u_int32_t MP4GetSampleSize( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId); + +u_int32_t MP4GetTrackMaxSampleSize( + MP4FileHandle hFile, + MP4TrackId trackId); + +MP4SampleId MP4GetSampleIdFromTime( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Timestamp when, + bool wantSyncSample DEFAULT(false)); + +MP4Timestamp MP4GetSampleTime( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId); + +MP4Duration MP4GetSampleDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId); + +MP4Duration MP4GetSampleRenderingOffset( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId); + +bool MP4SetSampleRenderingOffset( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId, + MP4Duration renderingOffset); + +int8_t MP4GetSampleSync( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4SampleId sampleId); + +/* rtp hint track operations */ + +bool MP4GetHintTrackRtpPayload( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + char** ppPayloadName DEFAULT(NULL), + u_int8_t* pPayloadNumber DEFAULT(NULL), + u_int16_t* pMaxPayloadSize DEFAULT(NULL), + char **ppEncodingParams DEFAULT(NULL)); + +#define MP4_SET_DYNAMIC_PAYLOAD 0xff + +bool MP4SetHintTrackRtpPayload( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + const char* pPayloadName, + u_int8_t* pPayloadNumber, + u_int16_t maxPayloadSize DEFAULT(0), + const char *encode_params DEFAULT(NULL), + bool include_rtp_map DEFAULT(true), + bool include_mpeg4_esid DEFAULT(true)); + +const char* MP4GetSessionSdp( + MP4FileHandle hFile); + +bool MP4SetSessionSdp( + MP4FileHandle hFile, + const char* sdpString); + +bool MP4AppendSessionSdp( + MP4FileHandle hFile, + const char* sdpString); + +const char* MP4GetHintTrackSdp( + MP4FileHandle hFile, + MP4TrackId hintTrackId); + +bool MP4SetHintTrackSdp( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + const char* sdpString); + +bool MP4AppendHintTrackSdp( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + const char* sdpString); + +MP4TrackId MP4GetHintTrackReferenceTrackId( + MP4FileHandle hFile, + MP4TrackId hintTrackId); + +bool MP4ReadRtpHint( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + MP4SampleId hintSampleId, + u_int16_t* pNumPackets DEFAULT(NULL)); + +u_int16_t MP4GetRtpHintNumberOfPackets( + MP4FileHandle hFile, + MP4TrackId hintTrackId); + +int8_t MP4GetRtpPacketBFrame( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + u_int16_t packetIndex); + +int32_t MP4GetRtpPacketTransmitOffset( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + u_int16_t packetIndex); + +bool MP4ReadRtpPacket( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + u_int16_t packetIndex, + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + u_int32_t ssrc DEFAULT(0), + bool includeHeader DEFAULT(true), + bool includePayload DEFAULT(true)); + +MP4Timestamp MP4GetRtpTimestampStart( + MP4FileHandle hFile, + MP4TrackId hintTrackId); + +bool MP4SetRtpTimestampStart( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + MP4Timestamp rtpStart); + +bool MP4AddRtpHint( + MP4FileHandle hFile, + MP4TrackId hintTrackId); + +bool MP4AddRtpVideoHint( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + bool isBframe DEFAULT(false), + u_int32_t timestampOffset DEFAULT(0)); + +bool MP4AddRtpPacket( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + bool setMbit DEFAULT(false), + int32_t transmitOffset DEFAULT(0)); + +bool MP4AddRtpImmediateData( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + const u_int8_t* pBytes, + u_int32_t numBytes); + +bool MP4AddRtpSampleData( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + MP4SampleId sampleId, + u_int32_t dataOffset, + u_int32_t dataLength); + +bool MP4AddRtpESConfigurationPacket( + MP4FileHandle hFile, + MP4TrackId hintTrackId); + +bool MP4WriteRtpHint( + MP4FileHandle hFile, + MP4TrackId hintTrackId, + MP4Duration duration, + bool isSyncSample DEFAULT(true)); + +/* ISMA specific utilities */ + +bool MP4MakeIsmaCompliant(const char* fileName, + u_int32_t verbosity DEFAULT(0), + bool addIsmaComplianceSdp DEFAULT(true)); + +char* MP4MakeIsmaSdpIod( + u_int8_t videoProfile, + u_int32_t videoBitrate, + u_int8_t* videoConfig, + u_int32_t videoConfigLength, + u_int8_t audioProfile, + u_int32_t audioBitrate, + u_int8_t* audioConfig, + u_int32_t audioConfigLength, + u_int32_t verbosity DEFAULT(0)); + +/* edit list */ + +/* NOTE this section of functionality + * has not yet been fully tested + */ + +MP4EditId MP4AddTrackEdit( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId DEFAULT(MP4_INVALID_EDIT_ID), + MP4Timestamp startTime DEFAULT(0), + MP4Duration duration DEFAULT(0), + bool dwell DEFAULT(false)); + +bool MP4DeleteTrackEdit( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId); + +u_int32_t MP4GetTrackNumberOfEdits( + MP4FileHandle hFile, + MP4TrackId trackId); + +MP4Timestamp MP4GetTrackEditStart( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId); + +MP4Duration MP4GetTrackEditTotalDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId DEFAULT(MP4_INVALID_EDIT_ID)); + +MP4Timestamp MP4GetTrackEditMediaStart( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId); + +bool MP4SetTrackEditMediaStart( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId, + MP4Timestamp startTime); + +MP4Duration MP4GetTrackEditDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId); + +bool MP4SetTrackEditDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId, + MP4Duration duration); + +int8_t MP4GetTrackEditDwell( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId); + +bool MP4SetTrackEditDwell( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4EditId editId, + bool dwell); + +bool MP4ReadSampleFromEditTime( + /* input parameters */ + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Timestamp when, + /* input/output parameters */ + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + /* output parameters */ + MP4Timestamp* pStartTime DEFAULT(NULL), + MP4Duration* pDuration DEFAULT(NULL), + MP4Duration* pRenderingOffset DEFAULT(NULL), + bool* pIsSyncSample DEFAULT(NULL)); + +MP4SampleId MP4GetSampleIdFromEditTime( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Timestamp when, + MP4Timestamp* pStartTime DEFAULT(NULL), + MP4Duration* pDuration DEFAULT(NULL)); + +/* time conversion utilties */ + +/* predefined values for timeScale parameter below */ +#define MP4_SECONDS_TIME_SCALE 1 +#define MP4_MILLISECONDS_TIME_SCALE 1000 +#define MP4_MICROSECONDS_TIME_SCALE 1000000 +#define MP4_NANOSECONDS_TIME_SCALE 1000000000 + +#define MP4_SECS_TIME_SCALE MP4_SECONDS_TIME_SCALE +#define MP4_MSECS_TIME_SCALE MP4_MILLISECONDS_TIME_SCALE +#define MP4_USECS_TIME_SCALE MP4_MICROSECONDS_TIME_SCALE +#define MP4_NSECS_TIME_SCALE MP4_NANOSECONDS_TIME_SCALE + +u_int64_t MP4ConvertFromMovieDuration( + MP4FileHandle hFile, + MP4Duration duration, + u_int32_t timeScale); + +u_int64_t MP4ConvertFromTrackTimestamp( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Timestamp timeStamp, + u_int32_t timeScale); + +MP4Timestamp MP4ConvertToTrackTimestamp( + MP4FileHandle hFile, + MP4TrackId trackId, + u_int64_t timeStamp, + u_int32_t timeScale); + +u_int64_t MP4ConvertFromTrackDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + MP4Duration duration, + u_int32_t timeScale); + +MP4Duration MP4ConvertToTrackDuration( + MP4FileHandle hFile, + MP4TrackId trackId, + u_int64_t duration, + u_int32_t timeScale); + +char* MP4BinaryToBase16( + const u_int8_t* pData, + u_int32_t dataSize); + +char* MP4BinaryToBase64( + const u_int8_t* pData, + u_int32_t dataSize); + +/* iTunes metadata handling */ +bool MP4MetadataDelete(MP4FileHandle hFile); +bool MP4GetMetadataByIndex(MP4FileHandle hFile, u_int32_t index, + const char** ppName, + u_int8_t** ppValue, u_int32_t* pValueSize); +bool MP4SetMetadataName(MP4FileHandle hFile, const char* value); +bool MP4GetMetadataName(MP4FileHandle hFile, char** value); +bool MP4SetMetadataArtist(MP4FileHandle hFile, const char* value); +bool MP4GetMetadataArtist(MP4FileHandle hFile, char** value); +bool MP4SetMetadataWriter(MP4FileHandle hFile, const char* value); +bool MP4GetMetadataWriter(MP4FileHandle hFile, char** value); +bool MP4SetMetadataComment(MP4FileHandle hFile, const char* value); +bool MP4GetMetadataComment(MP4FileHandle hFile, char** value); +bool MP4SetMetadataTool(MP4FileHandle hFile, const char* value); +bool MP4GetMetadataTool(MP4FileHandle hFile, char** value); +bool MP4SetMetadataYear(MP4FileHandle hFile, const char* value); +bool MP4GetMetadataYear(MP4FileHandle hFile, char** value); +bool MP4SetMetadataAlbum(MP4FileHandle hFile, const char* value); +bool MP4GetMetadataAlbum(MP4FileHandle hFile, char** value); +bool MP4SetMetadataTrack(MP4FileHandle hFile, + u_int16_t track, u_int16_t totalTracks); +bool MP4GetMetadataTrack(MP4FileHandle hFile, + u_int16_t* track, u_int16_t* totalTracks); +bool MP4SetMetadataDisk(MP4FileHandle hFile, + u_int16_t disk, u_int16_t totalDisks); +bool MP4GetMetadataDisk(MP4FileHandle hFile, + u_int16_t* disk, u_int16_t* totalDisks); +bool MP4SetMetadataGenre(MP4FileHandle hFile, const char* genre); +bool MP4GetMetadataGenre(MP4FileHandle hFile, char** genre); +bool MP4SetMetadataTempo(MP4FileHandle hFile, u_int16_t tempo); +bool MP4GetMetadataTempo(MP4FileHandle hFile, u_int16_t* tempo); +bool MP4SetMetadataCompilation(MP4FileHandle hFile, u_int8_t cpl); +bool MP4GetMetadataCompilation(MP4FileHandle hFile, u_int8_t* cpl); +bool MP4SetMetadataCoverArt(MP4FileHandle hFile, + u_int8_t *coverArt, u_int32_t size); +bool MP4GetMetadataCoverArt(MP4FileHandle hFile, + u_int8_t **coverArt, u_int32_t* size); +bool MP4SetMetadataFreeForm(MP4FileHandle hFile, char *name, + u_int8_t* pValue, u_int32_t valueSize); +bool MP4GetMetadataFreeForm(MP4FileHandle hFile, char *name, + u_int8_t** pValue, u_int32_t* valueSize); + +//#ifdef USE_FILE_CALLBACKS +typedef u_int32_t (*MP4OpenCallback)(const char *pName, const char *mode, void *userData); +typedef void (*MP4CloseCallback)(void *userData); +typedef u_int32_t (*MP4ReadCallback)(void *pBuffer, unsigned int nBytesToRead, void *userData); +typedef u_int32_t (*MP4WriteCallback)(void *pBuffer, unsigned int nBytesToWrite, void *userData); +typedef int32_t (*MP4SetposCallback)(u_int32_t pos, void *userData); +typedef int64_t (*MP4GetposCallback)(void *userData); +typedef int64_t (*MP4FilesizeCallback)(void *userData); + +MP4FileHandle MP4CreateCb(u_int32_t verbosity, + bool use64bits, + bool useExtensibleFormat, + MP4OpenCallback MP4fopen, + MP4CloseCallback MP4fclose, + MP4ReadCallback MP4fread, + MP4WriteCallback MP4fwrite, + MP4SetposCallback MP4fsetpos, + MP4GetposCallback MP4fgetpos, + MP4FilesizeCallback MP4filesize, + void *userData); + +MP4FileHandle MP4ReadCb(u_int32_t verbosity, + MP4OpenCallback MP4fopen, + MP4CloseCallback MP4fclose, + MP4ReadCallback MP4fread, + MP4WriteCallback MP4fwrite, + MP4SetposCallback MP4fsetpos, + MP4GetposCallback MP4fgetpos, + MP4FilesizeCallback MP4filesize, + void *userData); +MP4FileHandle MP4ModifyCb(int32_t verbosity, + bool useExtensibleFormat, + MP4OpenCallback MP4fopen, MP4CloseCallback MP4fclose, + MP4ReadCallback MP4fread, MP4WriteCallback MP4fwrite, + MP4SetposCallback MP4fsetpos, MP4GetposCallback MP4fgetpos, + MP4FilesizeCallback MP4filesize, void *userData); +//#endif + +#ifdef __cplusplus +} +#endif + +/* undefined our utlity macro to avoid conflicts */ +#undef DEFAULT + +#endif /* __MP4_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4array.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4array.h @@ -0,0 +1,130 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MP4_ARRAY_INCLUDED__ +#define __MP4_ARRAY_INCLUDED__ + +typedef u_int32_t MP4ArrayIndex; + +class MP4Array { +public: + MP4Array() { + m_numElements = 0; + m_maxNumElements = 0; + } + + inline bool ValidIndex(MP4ArrayIndex index) { + if (m_numElements == 0 || index > m_numElements - 1) { + return false; + } + return true; + } + + inline MP4ArrayIndex Size(void) { + return m_numElements; + } + + inline MP4ArrayIndex MaxSize(void) { + return m_maxNumElements; + } + +protected: + MP4ArrayIndex m_numElements; + MP4ArrayIndex m_maxNumElements; +}; + +// macro to generate subclasses +// we use this as an alternative to templates +// due to the excessive compile time price of extensive template usage + +#define MP4ARRAY_DECL(name, type) \ + class name##Array : public MP4Array { \ + public: \ + name##Array() { \ + m_elements = NULL; \ + } \ + \ + ~name##Array() { \ + MP4Free(m_elements); \ + } \ + \ + inline void Add(type newElement) { \ + Insert(newElement, m_numElements); \ + } \ + \ + void Insert(type newElement, MP4ArrayIndex newIndex) { \ + if (newIndex > m_numElements) { \ + throw new MP4Error(ERANGE, "MP4Array::Insert"); \ + } \ + if (m_numElements == m_maxNumElements) { \ + m_maxNumElements = MAX(m_maxNumElements, 1) * 2; \ + m_elements = (type*)MP4Realloc(m_elements, \ + m_maxNumElements * sizeof(type)); \ + } \ + memmove(&m_elements[newIndex + 1], &m_elements[newIndex], \ + (m_numElements - newIndex) * sizeof(type)); \ + m_elements[newIndex] = newElement; \ + m_numElements++; \ + } \ + \ + void Delete(MP4ArrayIndex index) { \ + if (!ValidIndex(index)) { \ + throw new MP4Error(ERANGE, "MP4Array::Delete"); \ + } \ + memmove(&m_elements[index], &m_elements[index + 1], \ + (m_numElements - index) * sizeof(type)); \ + m_numElements--; \ + } \ + void Resize(MP4ArrayIndex newSize) { \ + m_numElements = newSize; \ + m_maxNumElements = newSize; \ + m_elements = (type*)MP4Realloc(m_elements, \ + m_maxNumElements * sizeof(type)); \ + } \ + \ + type& operator[](MP4ArrayIndex index) { \ + if (!ValidIndex(index)) { \ + throw new MP4Error(ERANGE, "MP4Array::[]"); \ + } \ + return m_elements[index]; \ + } \ + \ + protected: \ + type* m_elements; \ + }; + +MP4ARRAY_DECL(MP4Integer8, u_int8_t) + +MP4ARRAY_DECL(MP4Integer16, u_int16_t) + +MP4ARRAY_DECL(MP4Integer32, u_int32_t) + +MP4ARRAY_DECL(MP4Integer64, u_int64_t) + +MP4ARRAY_DECL(MP4Float32, float) + +MP4ARRAY_DECL(MP4Float64, double) + +MP4ARRAY_DECL(MP4String, char*) + +MP4ARRAY_DECL(MP4Bytes, u_int8_t*) + +#endif /* __MP4_ARRAY_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4atom.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4atom.cpp @@ -0,0 +1,884 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +#include "mp4common.h" +#include "atoms.h" + +MP4AtomInfo::MP4AtomInfo(const char* name, bool mandatory, bool onlyOne) +{ + m_name = name; + m_mandatory = mandatory; + m_onlyOne = onlyOne; + m_count = 0; +} + +MP4Atom::MP4Atom(const char* type) +{ + SetType(type); + m_unknownType = FALSE; + m_pFile = NULL; + m_start = 0; + m_end = 0; + m_size = 0; + m_pParentAtom = NULL; + m_depth = 0xFF; +} + +MP4Atom::~MP4Atom() +{ + u_int32_t i; + + for (i = 0; i < m_pProperties.Size(); i++) { + delete m_pProperties[i]; + } + for (i = 0; i < m_pChildAtomInfos.Size(); i++) { + delete m_pChildAtomInfos[i]; + } + for (i = 0; i < m_pChildAtoms.Size(); i++) { + delete m_pChildAtoms[i]; + } +} + +MP4Atom* MP4Atom::CreateAtom(const char* type) +{ + MP4Atom* pAtom = NULL; + + if (type == NULL) { + pAtom = new MP4RootAtom(); + } else { + switch(type[0]) { + case 'c': + if (ATOMID(type) == ATOMID("ctts")) { + pAtom = new MP4CttsAtom(); + } else if (ATOMID(type) == ATOMID("co64")) { + pAtom = new MP4Co64Atom(); + } else if (ATOMID(type) == ATOMID("cprt")) { + pAtom = new MP4CprtAtom(); + } else if (ATOMID(type) == ATOMID("cpil")) { /* Apple iTunes */ + pAtom = new MP4CpilAtom(); + } else if (ATOMID(type) == ATOMID("covr")) { /* Apple iTunes */ + pAtom = new MP4CovrAtom(); + } + break; + case 'd': + if (ATOMID(type) == ATOMID("dinf")) { + pAtom = new MP4DinfAtom(); + } else if (ATOMID(type) == ATOMID("dref")) { + pAtom = new MP4DrefAtom(); + } else if (ATOMID(type) == ATOMID("dpnd")) { + pAtom = new MP4TrefTypeAtom(type); + } else if (ATOMID(type) == ATOMID("dmed")) { + pAtom = new MP4DmedAtom(); + } else if (ATOMID(type) == ATOMID("dimm")) { + pAtom = new MP4DimmAtom(); + } else if (ATOMID(type) == ATOMID("drep")) { + pAtom = new MP4DrepAtom(); + } else if (ATOMID(type) == ATOMID("dmax")) { + pAtom = new MP4DmaxAtom(); + } else if (ATOMID(type) == ATOMID("data")) { /* Apple iTunes */ + pAtom = new MP4DataAtom(); + } else if (ATOMID(type) == ATOMID("disk")) { /* Apple iTunes */ + pAtom = new MP4DiskAtom(); + } + break; + case 'e': + if (ATOMID(type) == ATOMID("esds")) { + pAtom = new MP4EsdsAtom(); + } else if (ATOMID(type) == ATOMID("edts")) { + pAtom = new MP4EdtsAtom(); + } else if (ATOMID(type) == ATOMID("elst")) { + pAtom = new MP4ElstAtom(); + } else if (ATOMID(type) == ATOMID("enca")) { + pAtom = new MP4EncaAtom(); + } else if (ATOMID(type) == ATOMID("encv")) { + pAtom = new MP4EncvAtom(); + } + break; + case 'f': + if (ATOMID(type) == ATOMID("free")) { + pAtom = new MP4FreeAtom(); + } else if (ATOMID(type) == ATOMID("frma")) { + pAtom = new MP4FrmaAtom(); + } else if (ATOMID(type) == ATOMID("ftyp")) { + pAtom = new MP4FtypAtom(); + } + break; + case 'g': + if (ATOMID(type) == ATOMID("gnre")) { /* Apple iTunes */ + pAtom = new MP4GnreAtom(); + } + break; + case 'h': + if (ATOMID(type) == ATOMID("hdlr")) { + pAtom = new MP4HdlrAtom(); + } else if (ATOMID(type) == ATOMID("hmhd")) { + pAtom = new MP4HmhdAtom(); + } else if (ATOMID(type) == ATOMID("hint")) { + pAtom = new MP4TrefTypeAtom(type); + } else if (ATOMID(type) == ATOMID("hnti")) { + pAtom = new MP4HntiAtom(); + } else if (ATOMID(type) == ATOMID("hinf")) { + pAtom = new MP4HinfAtom(); + } + break; + case 'i': + if (ATOMID(type) == ATOMID("iKMS")) { + pAtom = new MP4IKMSAtom(); + } else if (ATOMID(type) == ATOMID("iSFM")) { + pAtom = new MP4ISFMAtom(); + } else if (ATOMID(type) == ATOMID("iods")) { + pAtom = new MP4IodsAtom(); + } else if (ATOMID(type) == ATOMID("ipir")) { + pAtom = new MP4TrefTypeAtom(type); + } else if (ATOMID(type) == ATOMID("ilst")) { /* Apple iTunes */ + pAtom = new MP4IlstAtom(); + } + break; + case 'm': + if (ATOMID(type) == ATOMID("mdia")) { + pAtom = new MP4MdiaAtom(); + } else if (ATOMID(type) == ATOMID("minf")) { + pAtom = new MP4MinfAtom(); + } else if (ATOMID(type) == ATOMID("mdhd")) { + pAtom = new MP4MdhdAtom(); + } else if (ATOMID(type) == ATOMID("mdat")) { + pAtom = new MP4MdatAtom(); + } else if (ATOMID(type) == ATOMID("moov")) { + pAtom = new MP4MoovAtom(); + } else if (ATOMID(type) == ATOMID("mvhd")) { + pAtom = new MP4MvhdAtom(); + } else if (ATOMID(type) == ATOMID("mpod")) { + pAtom = new MP4TrefTypeAtom(type); + } else if (ATOMID(type) == ATOMID("mp4a")) { + pAtom = new MP4Mp4aAtom(); + } else if (ATOMID(type) == ATOMID("mp4s")) { + pAtom = new MP4Mp4sAtom(); + } else if (ATOMID(type) == ATOMID("mp4v")) { + pAtom = new MP4Mp4vAtom(); + } else if (ATOMID(type) == ATOMID("moof")) { + pAtom = new MP4MoofAtom(); + } else if (ATOMID(type) == ATOMID("mfhd")) { + pAtom = new MP4MfhdAtom(); + } else if (ATOMID(type) == ATOMID("mvex")) { + pAtom = new MP4MvexAtom(); + } else if (ATOMID(type) == ATOMID("maxr")) { + pAtom = new MP4MaxrAtom(); + } else if (ATOMID(type) == ATOMID("meta")) { /* Apple iTunes */ + pAtom = new MP4MetaAtom(); + } else if (ATOMID(type) == ATOMID("mean")) { /* Apple iTunes */ + pAtom = new MP4MeanAtom(); + } + break; + case 'n': + if (ATOMID(type) == ATOMID("nmhd")) { + pAtom = new MP4NmhdAtom(); + } else if (ATOMID(type) == ATOMID("nump")) { + pAtom = new MP4NumpAtom(); + } else if (ATOMID(type) == ATOMID("name")) { + pAtom = new MP4NameAtom(); + } + break; + case 'p': + if (ATOMID(type) == ATOMID("pmax")) { + pAtom = new MP4PmaxAtom(); + } else if (ATOMID(type) == ATOMID("payt")) { + pAtom = new MP4PaytAtom(); + } + break; + case 'r': + if (ATOMID(type) == ATOMID("rtp ")) { + pAtom = new MP4RtpAtom(); + } + break; + case 's': + if (ATOMID(type) == ATOMID("schi")) { + pAtom = new MP4SchiAtom(); + } else if (ATOMID(type) == ATOMID("schm")) { + pAtom = new MP4SchmAtom(); + } else if (ATOMID(type) == ATOMID("sinf")) { + pAtom = new MP4SinfAtom(); + } else if (ATOMID(type) == ATOMID("stbl")) { + pAtom = new MP4StblAtom(); + } else if (ATOMID(type) == ATOMID("stsd")) { + pAtom = new MP4StsdAtom(); + } else if (ATOMID(type) == ATOMID("stts")) { + pAtom = new MP4SttsAtom(); + } else if (ATOMID(type) == ATOMID("stsz")) { + pAtom = new MP4StszAtom(); + } else if (ATOMID(type) == ATOMID("stsc")) { + pAtom = new MP4StscAtom(); + } else if (ATOMID(type) == ATOMID("stco")) { + pAtom = new MP4StcoAtom(); + } else if (ATOMID(type) == ATOMID("stss")) { + pAtom = new MP4StssAtom(); + } else if (ATOMID(type) == ATOMID("stsh")) { + pAtom = new MP4StshAtom(); + } else if (ATOMID(type) == ATOMID("stdp")) { + pAtom = new MP4StdpAtom(); + } else if (ATOMID(type) == ATOMID("smhd")) { + pAtom = new MP4SmhdAtom(); + } else if (ATOMID(type) == ATOMID("sdp ")) { + pAtom = new MP4SdpAtom(); + } else if (ATOMID(type) == ATOMID("snro")) { + pAtom = new MP4SnroAtom(); + } else if (ATOMID(type) == ATOMID("sync")) { + pAtom = new MP4TrefTypeAtom(type); + } else if (ATOMID(type) == ATOMID("skip")) { + pAtom = new MP4FreeAtom(); + pAtom->SetType("skip"); + } + break; + case 't': + if (ATOMID(type) == ATOMID("trak")) { + pAtom = new MP4TrakAtom(); + } else if (ATOMID(type) == ATOMID("tkhd")) { + pAtom = new MP4TkhdAtom(); + } else if (ATOMID(type) == ATOMID("tref")) { + pAtom = new MP4TrefAtom(); + } else if (ATOMID(type) == ATOMID("traf")) { + pAtom = new MP4TrafAtom(); + } else if (ATOMID(type) == ATOMID("tfhd")) { + pAtom = new MP4TfhdAtom(); + } else if (ATOMID(type) == ATOMID("trex")) { + pAtom = new MP4TrexAtom(); + } else if (ATOMID(type) == ATOMID("trun")) { + pAtom = new MP4TrunAtom(); + } else if (ATOMID(type) == ATOMID("tmin")) { + pAtom = new MP4TminAtom(); + } else if (ATOMID(type) == ATOMID("tmax")) { + pAtom = new MP4TmaxAtom(); + } else if (ATOMID(type) == ATOMID("trpy")) { + pAtom = new MP4TrpyAtom(); + } else if (ATOMID(type) == ATOMID("tpyl")) { + pAtom = new MP4TpylAtom(); + } else if (ATOMID(type) == ATOMID("tims")) { + pAtom = new MP4TimsAtom(); + } else if (ATOMID(type) == ATOMID("tsro")) { + pAtom = new MP4TsroAtom(); + } else if (ATOMID(type) == ATOMID("trkn")) { /* Apple iTunes */ + pAtom = new MP4TrknAtom(); + } else if (ATOMID(type) == ATOMID("tmpo")) { /* Apple iTunes */ + pAtom = new MP4TmpoAtom(); + } + break; + case 'u': + if (ATOMID(type) == ATOMID("udta")) { + pAtom = new MP4UdtaAtom(); + } else if (ATOMID(type) == ATOMID("url ")) { + pAtom = new MP4UrlAtom(); + } else if (ATOMID(type) == ATOMID("urn ")) { + pAtom = new MP4UrnAtom(); + } + break; + case 'v': + if (ATOMID(type) == ATOMID("vmhd")) { + pAtom = new MP4VmhdAtom(); + } + break; + case '©': + if (ATOMID(type) == ATOMID("©nam")) { + pAtom = new MP4NamAtom(); + } else if (ATOMID(type) == ATOMID("©ART")) { /* Apple iTunes */ + pAtom = new MP4ArtAtom(); + } else if (ATOMID(type) == ATOMID("©wrt")) { /* Apple iTunes */ + pAtom = new MP4WrtAtom(); + } else if (ATOMID(type) == ATOMID("©alb")) { /* Apple iTunes */ + pAtom = new MP4AlbAtom(); + } else if (ATOMID(type) == ATOMID("©day")) { /* Apple iTunes */ + pAtom = new MP4DayAtom(); + } else if (ATOMID(type) == ATOMID("©too")) { /* Apple iTunes */ + pAtom = new MP4TooAtom(); + } else if (ATOMID(type) == ATOMID("©cmt")) { /* Apple iTunes */ + pAtom = new MP4CmtAtom(); + } else if (ATOMID(type) == ATOMID("©gen")) { /* Apple iTunes */ + pAtom = new MP4GenAtom(); + } + break; + case '-': + if (ATOMID(type) == ATOMID("----")) { /* Apple iTunes */ + pAtom = new MP4DashAtom(); + } + } + } + + if (pAtom == NULL) { + pAtom = new MP4Atom(type); + pAtom->SetUnknownType(true); + } + + ASSERT(pAtom); + return pAtom; +} + +// generate a skeletal self + +void MP4Atom::Generate() +{ + u_int32_t i; + + // for all properties + for (i = 0; i < m_pProperties.Size(); i++) { + // ask it to self generate + m_pProperties[i]->Generate(); + } + + // for all mandatory, single child atom types + for (i = 0; i < m_pChildAtomInfos.Size(); i++) { + if (m_pChildAtomInfos[i]->m_mandatory + && m_pChildAtomInfos[i]->m_onlyOne) { + + // create the mandatory, single child atom + MP4Atom* pChildAtom = + CreateAtom(m_pChildAtomInfos[i]->m_name); + + AddChildAtom(pChildAtom); + + // and ask it to self generate + pChildAtom->Generate(); + } + } +} + +MP4Atom* MP4Atom::ReadAtom(MP4File* pFile, MP4Atom* pParentAtom) +{ + u_int8_t hdrSize = 8; + u_int8_t extendedType[16]; + + u_int64_t pos = pFile->GetPosition(); + + VERBOSE_READ(pFile->GetVerbosity(), + printf("ReadAtom: pos = 0x"LLX"\n", pos)); + + u_int64_t dataSize = pFile->ReadUInt32(); + + char type[5]; + pFile->ReadBytes((u_int8_t*)&type[0], 4); + type[4] = '\0'; + + // extended size + if (dataSize == 1) { + dataSize = pFile->ReadUInt64(); + hdrSize += 8; + } + + // extended type + if (ATOMID(type) == ATOMID("uuid")) { + pFile->ReadBytes(extendedType, sizeof(extendedType)); + hdrSize += sizeof(extendedType); + } + + if (dataSize == 0) { + // extends to EOF + dataSize = pFile->GetSize() - pos; + } + + dataSize -= hdrSize; + + VERBOSE_READ(pFile->GetVerbosity(), + printf("ReadAtom: type = %s data-size = "LLU" (0x"LLX")\n", + type, dataSize, dataSize)); + + if (pos + hdrSize + dataSize > pParentAtom->GetEnd()) { + VERBOSE_READ(pFile->GetVerbosity(), + printf("ReadAtom: invalid atom size, extends outside parent atom\n")); + throw new MP4Error("invalid atom size", "ReadAtom"); + } + + + MP4Atom* pAtom = CreateAtom(type); + pAtom->SetFile(pFile); + pAtom->SetStart(pos); + pAtom->SetEnd(pos + hdrSize + dataSize); + pAtom->SetSize(dataSize); + if (ATOMID(type) == ATOMID("uuid")) { + pAtom->SetExtendedType(extendedType); + } + if (pAtom->IsUnknownType()) { + if (!IsReasonableType(pAtom->GetType())) { + VERBOSE_READ(pFile->GetVerbosity(), + printf("Warning: atom type %s is suspect\n", pAtom->GetType())); + } else { + VERBOSE_READ(pFile->GetVerbosity(), + printf("Info: atom type %s is unknown\n", pAtom->GetType())); + } + + if (dataSize > 0) { + pAtom->AddProperty( + new MP4BytesProperty("data", dataSize)); + } + } + + pAtom->SetParentAtom(pParentAtom); + + pAtom->Read(); + + return pAtom; +} + +bool MP4Atom::IsReasonableType(const char* type) +{ + for (u_int8_t i = 0; i < 4; i++) { + if (isalnum(type[i])) { + continue; + } + if (i == 3 && type[i] == ' ') { + continue; + } + return false; + } + return true; +} + +// generic read +void MP4Atom::Read() +{ + ASSERT(m_pFile); + + if (ATOMID(m_type) != 0 && m_size > 1000000) { + VERBOSE_READ(GetVerbosity(), + printf("Warning: %s atom size "LLU" is suspect\n", + m_type, m_size)); + } + + ReadProperties(); + + // read child atoms, if we expect there to be some + if (m_pChildAtomInfos.Size() > 0) { + ReadChildAtoms(); + } + + Skip(); // to end of atom +} + +void MP4Atom::Skip() +{ + if (m_pFile->GetPosition() != m_end) { + VERBOSE_READ(m_pFile->GetVerbosity(), + printf("Skip: "LLU" bytes\n", m_end - m_pFile->GetPosition())); + } + m_pFile->SetPosition(m_end); +} + +MP4Atom* MP4Atom::FindAtom(const char* name) +{ + if (!IsMe(name)) { + return NULL; + } + + if (!IsRootAtom()) { + VERBOSE_FIND(m_pFile->GetVerbosity(), + printf("FindAtom: matched %s\n", name)); + + name = MP4NameAfterFirst(name); + + // I'm the sought after atom + if (name == NULL) { + return this; + } + } + + // else it's one of my children + return FindChildAtom(name); +} + +bool MP4Atom::FindProperty(const char *name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (!IsMe(name)) { + return false; + } + + if (!IsRootAtom()) { + VERBOSE_FIND(m_pFile->GetVerbosity(), + printf("FindProperty: matched %s\n", name)); + + name = MP4NameAfterFirst(name); + + // no property name given + if (name == NULL) { + return false; + } + } + + return FindContainedProperty(name, ppProperty, pIndex); +} + +bool MP4Atom::IsMe(const char* name) +{ + if (name == NULL) { + return false; + } + + // root atom always matches + if (!strcmp(m_type, "")) { + return true; + } + + // check if our atom name is specified as the first component + if (!MP4NameFirstMatches(m_type, name)) { + return false; + } + + return true; +} + +MP4Atom* MP4Atom::FindChildAtom(const char* name) +{ + u_int32_t atomIndex = 0; + + // get the index if we have one, e.g. moov.trak[2].mdia... + MP4NameFirstIndex(name, &atomIndex); + + // need to get to the index'th child atom of the right type + for (u_int32_t i = 0; i < m_pChildAtoms.Size(); i++) { + if (MP4NameFirstMatches(m_pChildAtoms[i]->GetType(), name)) { + if (atomIndex == 0) { + // this is the one, ask it to match + return m_pChildAtoms[i]->FindAtom(name); + } + atomIndex--; + } + } + + return NULL; +} + +bool MP4Atom::FindContainedProperty(const char *name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + u_int32_t numProperties = m_pProperties.Size(); + u_int32_t i; + // check all of our properties + for (i = 0; i < numProperties; i++) { + if (m_pProperties[i]->FindProperty(name, ppProperty, pIndex)) { + return true; + } + } + + // not one of our properties, + // presumably one of our children's properties + // check child atoms... + + // check if we have an index, e.g. trak[2].mdia... + u_int32_t atomIndex = 0; + MP4NameFirstIndex(name, &atomIndex); + + // need to get to the index'th child atom of the right type + for (i = 0; i < m_pChildAtoms.Size(); i++) { + if (MP4NameFirstMatches(m_pChildAtoms[i]->GetType(), name)) { + if (atomIndex == 0) { + // this is the one, ask it to match + return m_pChildAtoms[i]->FindProperty(name, ppProperty, pIndex); + } + atomIndex--; + } + } + + VERBOSE_FIND(m_pFile->GetVerbosity(), + printf("FindProperty: no match for %s\n", name)); + return false; +} + +void MP4Atom::ReadProperties(u_int32_t startIndex, u_int32_t count) +{ + u_int32_t numProperties = MIN(count, m_pProperties.Size() - startIndex); + + // read any properties of the atom + for (u_int32_t i = startIndex; i < startIndex + numProperties; i++) { + + m_pProperties[i]->Read(m_pFile); + + if (m_pFile->GetPosition() > m_end) { + VERBOSE_READ(GetVerbosity(), + printf("ReadProperties: insufficient data for property: %s pos 0x"LLX" atom end 0x"LLX"\n", + m_pProperties[i]->GetName(), + m_pFile->GetPosition(), m_end)); + + throw new MP4Error("atom is too small", "Atom ReadProperties"); + } + + if (m_pProperties[i]->GetType() == TableProperty) { + VERBOSE_READ_TABLE(GetVerbosity(), + printf("Read: "); m_pProperties[i]->Dump(stdout, 0, true)); + } else if (m_pProperties[i]->GetType() != DescriptorProperty) { + VERBOSE_READ(GetVerbosity(), + printf("Read: "); m_pProperties[i]->Dump(stdout, 0, true)); + } + } +} + +void MP4Atom::ReadChildAtoms() +{ + VERBOSE_READ(GetVerbosity(), + printf("ReadChildAtoms: of %s\n", m_type[0] ? m_type : "root")); + + // read any child atoms + while (m_pFile->GetPosition() < m_end) { + MP4Atom* pChildAtom = MP4Atom::ReadAtom(m_pFile, this); + + AddChildAtom(pChildAtom); + + MP4AtomInfo* pChildAtomInfo = FindAtomInfo(pChildAtom->GetType()); + + // if child atom is of known type + // but not expected here print warning + if (pChildAtomInfo == NULL && !pChildAtom->IsUnknownType()) { + VERBOSE_READ(GetVerbosity(), + printf("Warning: In atom %s unexpected child atom %s\n", + GetType(), pChildAtom->GetType())); + } + + // if child atoms should have just one instance + // and this is more than one, print warning + if (pChildAtomInfo) { + pChildAtomInfo->m_count++; + + if (pChildAtomInfo->m_onlyOne && pChildAtomInfo->m_count > 1) { + VERBOSE_READ(GetVerbosity(), + printf("Warning: In atom %s multiple child atoms %s\n", + GetType(), pChildAtom->GetType())); + } + } + } + + // if mandatory child atom doesn't exist, print warning + u_int32_t numAtomInfo = m_pChildAtomInfos.Size(); + for (u_int32_t i = 0; i < numAtomInfo; i++) { + if (m_pChildAtomInfos[i]->m_mandatory + && m_pChildAtomInfos[i]->m_count == 0) { + VERBOSE_READ(GetVerbosity(), + printf("Warning: In atom %s missing child atom %s\n", + GetType(), m_pChildAtomInfos[i]->m_name)); + } + } + + VERBOSE_READ(GetVerbosity(), + printf("ReadChildAtoms: finished %s\n", m_type)); +} + +MP4AtomInfo* MP4Atom::FindAtomInfo(const char* name) +{ + u_int32_t numAtomInfo = m_pChildAtomInfos.Size(); + for (u_int32_t i = 0; i < numAtomInfo; i++) { + if (ATOMID(m_pChildAtomInfos[i]->m_name) == ATOMID(name)) { + return m_pChildAtomInfos[i]; + } + } + return NULL; +} + +// generic write +void MP4Atom::Write() +{ + ASSERT(m_pFile); + + BeginWrite(); + + WriteProperties(); + + WriteChildAtoms(); + + FinishWrite(); +} + +void MP4Atom::BeginWrite(bool use64) +{ + m_start = m_pFile->GetPosition(); + //use64 = m_pFile->Use64Bits(); + if (use64) { + m_pFile->WriteUInt32(1); + } else { + m_pFile->WriteUInt32(0); + } + m_pFile->WriteBytes((u_int8_t*)&m_type[0], 4); + if (use64) { + m_pFile->WriteUInt64(0); + } + if (ATOMID(m_type) == ATOMID("uuid")) { + m_pFile->WriteBytes(m_extendedType, sizeof(m_extendedType)); + } +} + +void MP4Atom::FinishWrite(bool use64) +{ + m_end = m_pFile->GetPosition(); + m_size = (m_end - m_start); + //use64 = m_pFile->Use64Bits(); + if (use64) { + m_pFile->SetPosition(m_start + 8); + m_pFile->WriteUInt64(m_size); + } else { + ASSERT(m_size <= (u_int64_t)0xFFFFFFFF); + m_pFile->SetPosition(m_start); + m_pFile->WriteUInt32(m_size); + } + m_pFile->SetPosition(m_end); + + // adjust size to just reflect data portion of atom + m_size -= (use64 ? 16 : 8); + if (ATOMID(m_type) == ATOMID("uuid")) { + m_size -= sizeof(m_extendedType); + } +} + +void MP4Atom::WriteProperties(u_int32_t startIndex, u_int32_t count) +{ + u_int32_t numProperties = MIN(count, m_pProperties.Size() - startIndex); + + VERBOSE_WRITE(GetVerbosity(), + printf("Write: type %s\n", m_type)); + + for (u_int32_t i = startIndex; i < startIndex + numProperties; i++) { + m_pProperties[i]->Write(m_pFile); + + if (m_pProperties[i]->GetType() == TableProperty) { + VERBOSE_WRITE_TABLE(GetVerbosity(), + printf("Write: "); m_pProperties[i]->Dump(stdout, 0, false)); + } else { + VERBOSE_WRITE(GetVerbosity(), + printf("Write: "); m_pProperties[i]->Dump(stdout, 0, false)); + } + } +} + +void MP4Atom::WriteChildAtoms() +{ + u_int32_t size = m_pChildAtoms.Size(); + for (u_int32_t i = 0; i < size; i++) { + m_pChildAtoms[i]->Write(); + } + + VERBOSE_WRITE(GetVerbosity(), + printf("Write: finished %s\n", m_type)); +} + +void MP4Atom::AddProperty(MP4Property* pProperty) +{ + ASSERT(pProperty); + m_pProperties.Add(pProperty); + pProperty->SetParentAtom(this); +} + +void MP4Atom::AddVersionAndFlags() +{ + AddProperty(new MP4Integer8Property("version")); + AddProperty(new MP4Integer24Property("flags")); +} + +void MP4Atom::AddReserved(char* name, u_int32_t size) +{ + MP4BytesProperty* pReserved = new MP4BytesProperty(name, size); + pReserved->SetReadOnly(); + AddProperty(pReserved); +} + +void MP4Atom::ExpectChildAtom(const char* name, bool mandatory, bool onlyOne) +{ + m_pChildAtomInfos.Add(new MP4AtomInfo(name, mandatory, onlyOne)); +} + +u_int8_t MP4Atom::GetVersion() +{ + if (strcmp("version", m_pProperties[0]->GetName())) { + return 0; + } + return ((MP4Integer8Property*)m_pProperties[0])->GetValue(); +} + +void MP4Atom::SetVersion(u_int8_t version) +{ + if (strcmp("version", m_pProperties[0]->GetName())) { + return; + } + ((MP4Integer8Property*)m_pProperties[0])->SetValue(version); +} + +u_int32_t MP4Atom::GetFlags() +{ + if (strcmp("flags", m_pProperties[1]->GetName())) { + return 0; + } + return ((MP4Integer24Property*)m_pProperties[1])->GetValue(); +} + +void MP4Atom::SetFlags(u_int32_t flags) +{ + if (strcmp("flags", m_pProperties[1]->GetName())) { + return; + } + ((MP4Integer24Property*)m_pProperties[1])->SetValue(flags); +} + +void MP4Atom::Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits) +{ + if (m_type[0] != '\0') { + Indent(pFile, indent); + fprintf(pFile, "type %s\n", m_type); + } + + u_int32_t i; + u_int32_t size; + + // dump our properties + size = m_pProperties.Size(); + for (i = 0; i < size; i++) { + + /* skip details of tables unless we're told to be verbose */ + if (m_pProperties[i]->GetType() == TableProperty + && !(GetVerbosity() & MP4_DETAILS_TABLE)) { + Indent(pFile, indent + 1); + fprintf(pFile, "\n"); + continue; + } + + m_pProperties[i]->Dump(pFile, indent + 1, dumpImplicits); + } + + // dump our children + size = m_pChildAtoms.Size(); + for (i = 0; i < size; i++) { + m_pChildAtoms[i]->Dump(pFile, indent + 1, dumpImplicits); + } +} + +u_int32_t MP4Atom::GetVerbosity() +{ + ASSERT(m_pFile); + return m_pFile->GetVerbosity(); +} + +u_int8_t MP4Atom::GetDepth() +{ + if (m_depth < 0xFF) { + return m_depth; + } + + MP4Atom *pAtom = this; + m_depth = 0; + + while ((pAtom = pAtom->GetParentAtom()) != NULL) { + m_depth++; + ASSERT(m_depth < 255); + } + return m_depth; +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4atom.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4atom.h @@ -0,0 +1,231 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MP4_ATOM_INCLUDED__ +#define __MP4_ATOM_INCLUDED__ + +class MP4Atom; +MP4ARRAY_DECL(MP4Atom, MP4Atom*); + +#define Required true +#define Optional false +#define OnlyOne true +#define Many false +#define Counted true + +/* helper class */ +class MP4AtomInfo { +public: + MP4AtomInfo() { + m_name = NULL; + } + MP4AtomInfo(const char* name, bool mandatory, bool onlyOne); + + const char* m_name; + bool m_mandatory; + bool m_onlyOne; + u_int32_t m_count; +}; + +MP4ARRAY_DECL(MP4AtomInfo, MP4AtomInfo*); + +class MP4Atom { +public: + MP4Atom(const char* type = NULL); + virtual ~MP4Atom(); + + static MP4Atom* ReadAtom(MP4File* pFile, MP4Atom* pParentAtom); + static MP4Atom* CreateAtom(const char* type); + static bool IsReasonableType(const char* type); + + MP4File* GetFile() { + return m_pFile; + }; + void SetFile(MP4File* pFile) { + m_pFile = pFile; + }; + + u_int64_t GetStart() { + return m_start; + }; + void SetStart(u_int64_t pos) { + m_start = pos; + }; + + u_int64_t GetEnd() { + return m_end; + }; + void SetEnd(u_int64_t pos) { + m_end = pos; + }; + + u_int64_t GetSize() { + return m_size; + } + void SetSize(u_int64_t size) { + m_size = size; + } + + const char* GetType() { + return m_type; + }; + void SetType(const char* type) { + if (type) { + ASSERT(strlen(type) == 4); + memcpy(m_type, type, 4); + m_type[4] = '\0'; + } else { + memset(m_type, 0, 5); + } + } + + void GetExtendedType(u_int8_t* pExtendedType) { + memcpy(pExtendedType, m_extendedType, sizeof(m_extendedType)); + }; + void SetExtendedType(u_int8_t* pExtendedType) { + memcpy(m_extendedType, pExtendedType, sizeof(m_extendedType)); + }; + + bool IsUnknownType() { + return m_unknownType; + } + void SetUnknownType(bool unknownType = true) { + m_unknownType = unknownType; + } + + bool IsRootAtom() { + return m_type[0] == '\0'; + } + + MP4Atom* GetParentAtom() { + return m_pParentAtom; + } + void SetParentAtom(MP4Atom* pParentAtom) { + m_pParentAtom = pParentAtom; + } + + void AddChildAtom(MP4Atom* pChildAtom) { + pChildAtom->SetFile(m_pFile); + pChildAtom->SetParentAtom(this); + m_pChildAtoms.Add(pChildAtom); + } + + void InsertChildAtom(MP4Atom* pChildAtom, u_int32_t index) { + pChildAtom->SetFile(m_pFile); + pChildAtom->SetParentAtom(this); + m_pChildAtoms.Insert(pChildAtom, index); + } + + void DeleteChildAtom(MP4Atom* pChildAtom) { + for (MP4ArrayIndex i = 0; i < m_pChildAtoms.Size(); i++) { + if (m_pChildAtoms[i] == pChildAtom) { + m_pChildAtoms.Delete(i); + return; + } + } + } + + u_int32_t GetNumberOfChildAtoms() { + return m_pChildAtoms.Size(); + } + + MP4Atom* GetChildAtom(u_int32_t index) { + return m_pChildAtoms[index]; + } + + MP4Property* GetProperty(u_int32_t index) { + return m_pProperties[index]; + } + + MP4Atom* FindAtom(const char* name); + + MP4Atom* FindChildAtom(const char* name); + + bool FindProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + + u_int32_t GetFlags(); + void SetFlags(u_int32_t flags); + + u_int8_t GetDepth(); + + void Skip(); + + virtual void Generate(); + virtual void Read(); + virtual void BeginWrite(bool use64 = false); + virtual void Write(); + virtual void FinishWrite(bool use64 = false); + virtual void Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits); + +protected: + void AddProperty(MP4Property* pProperty); + + void AddVersionAndFlags(); + + void AddReserved(char* name, u_int32_t size); + + void ExpectChildAtom(const char* name, + bool mandatory, bool onlyOne = true); + + MP4AtomInfo* FindAtomInfo(const char* name); + + bool IsMe(const char* name); + + bool FindContainedProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex); + + void ReadProperties( + u_int32_t startIndex = 0, u_int32_t count = 0xFFFFFFFF); + void ReadChildAtoms(); + + void WriteProperties( + u_int32_t startIndex = 0, u_int32_t count = 0xFFFFFFFF); + void WriteChildAtoms(); + + u_int8_t GetVersion(); + void SetVersion(u_int8_t version); + + /* debugging aid */ + u_int32_t GetVerbosity(); + +protected: + MP4File* m_pFile; + u_int64_t m_start; + u_int64_t m_end; + u_int64_t m_size; + char m_type[5]; + bool m_unknownType; + u_int8_t m_extendedType[16]; + + MP4Atom* m_pParentAtom; + u_int8_t m_depth; + + MP4PropertyArray m_pProperties; + MP4AtomInfoArray m_pChildAtomInfos; + MP4AtomArray m_pChildAtoms; +}; + +inline u_int32_t ATOMID(const char* type) { + return STRTOINT32(type); +} + +#endif /* __MP4_ATOM_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4common.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4common.h @@ -0,0 +1,50 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MP4_COMMON_INCLUDED__ +#define __MP4_COMMON_INCLUDED__ + +// common includes for everything +// with an internal view of the library +// i.e. all the .cpp's just #include "mp4common.h" + +#include "mpeg4ip.h" + +#include "mp4.h" +#include "mp4util.h" +#include "mp4array.h" +#include "mp4track.h" +#include "mp4file.h" +#include "mp4property.h" +#include "mp4container.h" +#include "mp4descriptor.h" +#include "mp4atom.h" + +#include "atoms.h" +#include "descriptors.h" +#include "ocidescriptors.h" +#include "qosqualifiers.h" + +#include "odcommands.h" + +#include "rtphint.h" + +#endif /* __MP4_COMMON_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4container.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4container.cpp @@ -0,0 +1,227 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4Container::~MP4Container() +{ + for (u_int32_t i = 0; i < m_pProperties.Size(); i++) { + delete m_pProperties[i]; + } +} + +void MP4Container::AddProperty(MP4Property* pProperty) +{ + ASSERT(pProperty); + m_pProperties.Add(pProperty); +} + +bool MP4Container::FindProperty(const char *name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (pIndex) { + *pIndex = 0; // set the default answer for index + } + + u_int32_t numProperties = m_pProperties.Size(); + + for (u_int32_t i = 0; i < numProperties; i++) { + if (m_pProperties[i]->FindProperty(name, ppProperty, pIndex)) { + return true; + } + } + return false; +} + +void MP4Container::FindIntegerProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (!FindProperty(name, ppProperty, pIndex)) { + throw new MP4Error("no such property", + "MP4Container::FindIntegerProperty"); + } + + switch ((*ppProperty)->GetType()) { + case Integer8Property: + case Integer16Property: + case Integer24Property: + case Integer32Property: + case Integer64Property: + break; + default: + throw new MP4Error("type mismatch", + "MP4Container::FindIntegerProperty"); + } +} + +u_int64_t MP4Container::GetIntegerProperty(const char* name) +{ + MP4Property* pProperty; + u_int32_t index; + + FindIntegerProperty(name, &pProperty, &index); + + return ((MP4IntegerProperty*)pProperty)->GetValue(index); +} + +void MP4Container::SetIntegerProperty(const char* name, u_int64_t value) +{ + MP4Property* pProperty = NULL; + u_int32_t index = 0; + + FindIntegerProperty(name, &pProperty, &index); + + ((MP4IntegerProperty*)pProperty)->SetValue(value, index); +} + +void MP4Container::FindFloatProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (!FindProperty(name, ppProperty, pIndex)) { + throw new MP4Error("no such property", + "MP4Container::FindFloatProperty"); + } + if ((*ppProperty)->GetType() != Float32Property) { + throw new MP4Error("type mismatch", + "MP4Container::FindFloatProperty"); + } +} + +float MP4Container::GetFloatProperty(const char* name) +{ + MP4Property* pProperty; + u_int32_t index; + + FindFloatProperty(name, &pProperty, &index); + + return ((MP4Float32Property*)pProperty)->GetValue(index); +} + +void MP4Container::SetFloatProperty(const char* name, float value) +{ + MP4Property* pProperty; + u_int32_t index; + + FindFloatProperty(name, &pProperty, &index); + + ((MP4Float32Property*)pProperty)->SetValue(value, index); +} + +void MP4Container::FindStringProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (!FindProperty(name, ppProperty, pIndex)) { + throw new MP4Error("no such property", + "MP4Container::FindStringProperty"); + } + if ((*ppProperty)->GetType() != StringProperty) { + throw new MP4Error("type mismatch", + "MP4Container::FindStringProperty"); + } +} + +const char* MP4Container::GetStringProperty(const char* name) +{ + MP4Property* pProperty; + u_int32_t index; + + FindStringProperty(name, &pProperty, &index); + + return ((MP4StringProperty*)pProperty)->GetValue(index); +} + +void MP4Container::SetStringProperty(const char* name, const char* value) +{ + MP4Property* pProperty; + u_int32_t index; + + FindStringProperty(name, &pProperty, &index); + + ((MP4StringProperty*)pProperty)->SetValue(value, index); +} + +void MP4Container::FindBytesProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (!FindProperty(name, ppProperty, pIndex)) { + throw new MP4Error("no such property", + "MP4Container::FindBytesProperty"); + } + if ((*ppProperty)->GetType() != BytesProperty) { + throw new MP4Error("type mismatch", + "MP4Container::FindBytesProperty"); + } +} + +void MP4Container::GetBytesProperty(const char* name, + u_int8_t** ppValue, u_int32_t* pValueSize) +{ + MP4Property* pProperty; + u_int32_t index; + + FindBytesProperty(name, &pProperty, &index); + + ((MP4BytesProperty*)pProperty)->GetValue(ppValue, pValueSize, index); +} + +void MP4Container::SetBytesProperty(const char* name, + const u_int8_t* pValue, u_int32_t valueSize) +{ + MP4Property* pProperty; + u_int32_t index; + + FindBytesProperty(name, &pProperty, &index); + + ((MP4BytesProperty*)pProperty)->SetValue(pValue, valueSize, index); +} + +void MP4Container::Read(MP4File* pFile) +{ + u_int32_t numProperties = m_pProperties.Size(); + + for (u_int32_t i = 0; i < numProperties; i++) { + m_pProperties[i]->Read(pFile); + } +} + +void MP4Container::Write(MP4File* pFile) +{ + u_int32_t numProperties = m_pProperties.Size(); + + if (numProperties == 0) { + WARNING(numProperties == 0); + return; + } + + for (u_int32_t i = 0; i < numProperties; i++) { + m_pProperties[i]->Write(pFile); + } +} + +void MP4Container::Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits) +{ + u_int32_t numProperties = m_pProperties.Size(); + + for (u_int32_t i = 0; i < numProperties; i++) { + m_pProperties[i]->Dump(pFile, indent, dumpImplicits); + } +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4container.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4container.h @@ -0,0 +1,84 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MP4_CONTAINER_INCLUDED__ +#define __MP4_CONTAINER_INCLUDED__ + +// base class - container of mp4 properties +class MP4Container { +public: + MP4Container() { } + + virtual ~MP4Container(); + + void AddProperty(MP4Property* pProperty); + + virtual void Read(MP4File* pFile); + + virtual void Write(MP4File* pFile); + + virtual void Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits); + + MP4Property* GetProperty(u_int32_t index) { + return m_pProperties[index]; + } + + // LATER MP4Property* GetProperty(const char* name); throw on error + // LATER MP4Property* FindProperty(const char* name, u_int32_t* pIndex = NULL); returns NULL on error + + bool FindProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + + void FindIntegerProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + + u_int64_t GetIntegerProperty(const char* name); + + void SetIntegerProperty(const char* name, u_int64_t value); + + void FindFloatProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + + float GetFloatProperty(const char* name); + + void SetFloatProperty(const char* name, float value); + + void FindStringProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + + const char* GetStringProperty(const char* name); + + void SetStringProperty(const char* name, const char* value); + + void FindBytesProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + + void GetBytesProperty(const char* name, + u_int8_t** ppValue, u_int32_t* pValueSize); + + void SetBytesProperty(const char* name, + const u_int8_t* pValue, u_int32_t valueSize); + +protected: + MP4PropertyArray m_pProperties; +}; + +#endif /* __MP4_CONTAINER_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4descriptor.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4descriptor.cpp @@ -0,0 +1,211 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4Descriptor::MP4Descriptor(u_int8_t tag) { + m_tag = tag; + m_pParentAtom = NULL; + m_start = 0; + m_size = 0; + m_readMutatePoint = 0; +} + +MP4Descriptor::~MP4Descriptor() +{ + for (u_int32_t i = 0; i < m_pProperties.Size(); i++) { + delete m_pProperties[i]; + } +} + +void MP4Descriptor::AddProperty(MP4Property* pProperty) +{ + ASSERT(pProperty); + m_pProperties.Add(pProperty); + pProperty->SetParentAtom(m_pParentAtom); +} + +bool MP4Descriptor::FindContainedProperty(const char *name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + u_int32_t numProperties = m_pProperties.Size(); + + for (u_int32_t i = 0; i < numProperties; i++) { + if (m_pProperties[i]->FindProperty(name, ppProperty, pIndex)) { + return true; + } + } + return false; +} + +void MP4Descriptor::Generate() +{ + // generate properties + for (u_int32_t i = 0; i < m_pProperties.Size(); i++) { + m_pProperties[i]->Generate(); + } +} + +void MP4Descriptor::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + ReadProperties(pFile, 0, m_readMutatePoint); + + Mutate(); + + ReadProperties(pFile, m_readMutatePoint); + + // flush any leftover read bits + pFile->FlushReadBits(); +} + +void MP4Descriptor::ReadHeader(MP4File* pFile) +{ + VERBOSE_READ(pFile->GetVerbosity(), + printf("ReadDescriptor: pos = 0x%llx\n", + pFile->GetPosition())); + + // read tag and length + u_int8_t tag = pFile->ReadUInt8(); + if (m_tag) { + ASSERT(tag == m_tag); + } else { + m_tag = tag; + } + m_size = pFile->ReadMpegLength(); + m_start = pFile->GetPosition(); + + VERBOSE_READ(pFile->GetVerbosity(), + printf("ReadDescriptor: tag 0x%02x data size %u (0x%x)\n", + m_tag, m_size, m_size)); +} + +void MP4Descriptor::ReadProperties(MP4File* pFile, + u_int32_t propStartIndex, u_int32_t propCount) +{ + u_int32_t numProperties = MIN(propCount, + m_pProperties.Size() - propStartIndex); + + for (u_int32_t i = propStartIndex; + i < propStartIndex + numProperties; i++) { + + MP4Property* pProperty = m_pProperties[i]; + + int32_t remaining = m_size - (pFile->GetPosition() - m_start); + + if (pProperty->GetType() == DescriptorProperty) { + if (remaining > 0) { + // place a limit on how far this sub-descriptor looks + ((MP4DescriptorProperty*)pProperty)->SetSizeLimit(remaining); + pProperty->Read(pFile); + } // else do nothing, empty descriptor + } else { + // non-descriptor property + if (remaining >= 0) { + pProperty->Read(pFile); + + if (pProperty->GetType() == TableProperty) { + VERBOSE_READ_TABLE(pFile->GetVerbosity(), + printf("Read: "); pProperty->Dump(stdout, 0, true)); + } else { + VERBOSE_READ(pFile->GetVerbosity(), + printf("Read: "); pProperty->Dump(stdout, 0, true)); + } + } else { + VERBOSE_ERROR(pFile->GetVerbosity(), + printf("Overran descriptor, tag %u data size %u property %u\n", + m_tag, m_size, i)); + throw new MP4Error("overran descriptor", + "MP4Descriptor::ReadProperties"); + } + } + } +} + +void MP4Descriptor::Write(MP4File* pFile) +{ + // call virtual function to adapt properties before writing + Mutate(); + + u_int32_t numProperties = m_pProperties.Size(); + + if (numProperties == 0) { + WARNING(numProperties == 0); + return; + } + + // write tag and length placeholder + pFile->WriteUInt8(m_tag); + u_int64_t lengthPos = pFile->GetPosition(); + pFile->WriteMpegLength(0); + u_int64_t startPos = pFile->GetPosition(); + + for (u_int32_t i = 0; i < numProperties; i++) { + m_pProperties[i]->Write(pFile); + } + + // align with byte boundary (rarely necessary) + pFile->PadWriteBits(); + + // go back and write correct length + u_int64_t endPos = pFile->GetPosition(); + pFile->SetPosition(lengthPos); + pFile->WriteMpegLength(endPos - startPos); + pFile->SetPosition(endPos); +} + +void MP4Descriptor::WriteToMemory(MP4File* pFile, + u_int8_t** ppBytes, u_int64_t* pNumBytes) +{ + // use memory buffer to save descriptor in memory + // instead of going directly to disk + + pFile->EnableMemoryBuffer(); + + Write(pFile); + + pFile->DisableMemoryBuffer(ppBytes, pNumBytes); +} + +void MP4Descriptor::Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits) +{ + // call virtual function to adapt properties before dumping + Mutate(); + + u_int32_t numProperties = m_pProperties.Size(); + + if (numProperties == 0) { + WARNING(numProperties == 0); + return; + } + for (u_int32_t i = 0; i < numProperties; i++) { + m_pProperties[i]->Dump(pFile, indent, dumpImplicits); + } +} + +u_int8_t MP4Descriptor::GetDepth() +{ + if (m_pParentAtom) { + return m_pParentAtom->GetDepth(); + } + return 0; +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4descriptor.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4descriptor.h @@ -0,0 +1,96 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MP4_DESCRIPTOR_INCLUDED__ +#define __MP4_DESCRIPTOR_INCLUDED__ + +class MP4Descriptor { +public: + MP4Descriptor(u_int8_t tag = 0); + + virtual ~MP4Descriptor(); + + u_int8_t GetTag() { + return m_tag; + } + void SetTag(u_int8_t tag) { + m_tag = tag; + } + + void SetParentAtom(MP4Atom* pParentAtom) { + m_pParentAtom = pParentAtom; + for (u_int32_t i = 0; i < m_pProperties.Size(); i++) { + m_pProperties[i]->SetParentAtom(pParentAtom); + } + } + + void AddProperty(MP4Property* pProperty); + + virtual void Generate(); + virtual void Read(MP4File* pFile); + virtual void Write(MP4File* pFile); + virtual void Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits); + + MP4Property* GetProperty(u_int32_t index) { + return m_pProperties[index]; + } + + // use with extreme caution + void SetProperty(u_int32_t index, MP4Property* pProperty) { + m_pProperties[index] = pProperty; + } + + bool FindProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL) { + return FindContainedProperty(name, ppProperty, pIndex); + } + + void WriteToMemory(MP4File* pFile, + u_int8_t** ppBytes, u_int64_t* pNumBytes); + +protected: + void SetReadMutate(u_int32_t propIndex) { + m_readMutatePoint = propIndex; + } + + void ReadHeader(MP4File* pFile); + void ReadProperties(MP4File* pFile, + u_int32_t startIndex = 0, u_int32_t count = 0xFFFFFFFF); + + virtual void Mutate() { + // default is a no-op + }; + + bool FindContainedProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex); + + u_int8_t GetDepth(); + +protected: + MP4Atom* m_pParentAtom; + u_int8_t m_tag; + u_int64_t m_start; + u_int32_t m_size; + MP4PropertyArray m_pProperties; + u_int32_t m_readMutatePoint; +}; + +#endif /* __MP4_DESCRIPTOR_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4file.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4file.cpp @@ -0,0 +1,2458 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +#include "mp4common.h" + +MP4File::MP4File(u_int32_t verbosity) +{ + m_fileName = NULL; + m_pFile = NULL; + m_orgFileSize = 0; + m_fileSize = 0; + m_pRootAtom = NULL; + m_odTrackId = MP4_INVALID_TRACK_ID; + + m_verbosity = verbosity; + m_mode = 0; + m_use64bits = false; + m_useIsma = false; + + m_pModificationProperty = NULL; + m_pTimeScaleProperty = NULL; + m_pDurationProperty = NULL; + + m_memoryBuffer = NULL; + m_memoryBufferSize = 0; + m_memoryBufferPosition = 0; + + m_numReadBits = 0; + m_bufReadBits = 0; + m_numWriteBits = 0; + m_bufWriteBits = 0; + +#ifdef USE_FILE_CALLBACKS + // These are the default for when no callbacks are specified + m_userData = (void*)this; + m_MP4fopen = MP4fopen_cb; + m_MP4fclose = MP4fclose_cb; + m_MP4fread = MP4fread_cb; + m_MP4fwrite = MP4fwrite_cb; + m_MP4fgetpos = MP4fgetpos_cb; + m_MP4fsetpos = MP4fsetpos_cb; + m_MP4filesize = MP4filesize_cb; +#endif +} + +MP4File::~MP4File() +{ + MP4Free(m_fileName); + delete m_pRootAtom; + for (u_int32_t i = 0; i < m_pTracks.Size(); i++) { + delete m_pTracks[i]; + } + MP4Free(m_memoryBuffer); // just in case +} + +void MP4File::Read(const char* fileName) +{ + m_fileName = MP4Stralloc(fileName); + m_mode = 'r'; + + Open("rb"); + + ReadFromFile(); + + CacheProperties(); +} + +void MP4File::Create(const char* fileName, bool use64bits) +{ + m_fileName = MP4Stralloc(fileName); + m_mode = 'w'; + m_use64bits = use64bits; + + Open("wb+"); + + // generate a skeletal atom tree + m_pRootAtom = MP4Atom::CreateAtom(NULL); + m_pRootAtom->SetFile(this); + m_pRootAtom->Generate(); + + CacheProperties(); + + // create mdat, and insert it after ftyp, and before moov + InsertChildAtom(m_pRootAtom, "mdat", 1); + + // start writing + m_pRootAtom->BeginWrite(); +} + +void MP4File::Modify(const char* fileName) +{ + m_fileName = MP4Stralloc(fileName); + m_mode = 'r'; + + Open("rb+"); + ReadFromFile(); + + m_mode = 'w'; + + // find the moov atom + MP4Atom* pMoovAtom = m_pRootAtom->FindAtom("moov"); + u_int32_t numAtoms; + + if (pMoovAtom == NULL) { + // there isn't one, odd but we can still proceed + pMoovAtom = AddChildAtom(m_pRootAtom, "moov"); + } else { + numAtoms = m_pRootAtom->GetNumberOfChildAtoms(); + + // work backwards thru the top level atoms + int32_t i; + bool lastAtomIsMoov = true; + MP4Atom* pLastAtom = NULL; + + for (i = numAtoms - 1; i >= 0; i--) { + MP4Atom* pAtom = m_pRootAtom->GetChildAtom(i); + const char* type = pAtom->GetType(); + + // get rid of any trailing free or skips + if (!strcmp(type, "free") || !strcmp(type, "skip")) { + m_pRootAtom->DeleteChildAtom(pAtom); + continue; + } + + if (strcmp(type, "moov")) { + if (pLastAtom == NULL) { + pLastAtom = pAtom; + lastAtomIsMoov = false; + } + continue; + } + + // now at moov atom + + // multiple moov atoms?!? + if (pAtom != pMoovAtom) { + throw new MP4Error( + "Badly formed mp4 file, multiple moov atoms", + "MP4Modify"); + } + + if (lastAtomIsMoov) { + // position to start of moov atom, + // effectively truncating file + // prior to adding new mdat + SetPosition(pMoovAtom->GetStart()); + + } else { // last atom isn't moov + // need to place a free atom + MP4Atom* pFreeAtom = MP4Atom::CreateAtom("free"); + + // in existing position of the moov atom + m_pRootAtom->InsertChildAtom(pFreeAtom, i); + m_pRootAtom->DeleteChildAtom(pMoovAtom); + m_pRootAtom->AddChildAtom(pMoovAtom); + + // write free atom to disk + SetPosition(pMoovAtom->GetStart()); + pFreeAtom->SetSize(pMoovAtom->GetSize()); + pFreeAtom->Write(); + + // finally set our file position to the end of the last atom + SetPosition(pLastAtom->GetEnd()); + } + + break; + } + ASSERT(i != -1); + } + + CacheProperties(); // of moov atom + + numAtoms = m_pRootAtom->GetNumberOfChildAtoms(); + + // insert another mdat prior to moov atom (the last atom) + MP4Atom* pMdatAtom = InsertChildAtom(m_pRootAtom, "mdat", numAtoms - 1); + + // start writing new mdat + pMdatAtom->BeginWrite(); +} + +void MP4File::Optimize(const char* orgFileName, const char* newFileName) +{ +#if 1//ndef USE_FILE_CALLBACKS + m_fileName = MP4Stralloc(orgFileName); + m_mode = 'r'; + + // first load meta-info into memory + Open("rb"); + ReadFromFile(); + + CacheProperties(); // of moov atom + + // now switch over to writing the new file + MP4Free(m_fileName); + + // create a temporary file if necessary + if (newFileName == NULL) { + m_fileName = MP4Stralloc(TempFileName()); + } else { + m_fileName = MP4Stralloc(newFileName); + } + + FILE* pReadFile = m_pFile; + m_pFile = NULL; + m_mode = 'w'; + + Open("wb"); + + SetIntegerProperty("moov.mvhd.modificationTime", + MP4GetAbsTimestamp()); + + // writing meta info in the optimal order + ((MP4RootAtom*)m_pRootAtom)->BeginOptimalWrite(); + + // write data in optimal order + RewriteMdat(pReadFile, m_pFile); + + // finish writing + ((MP4RootAtom*)m_pRootAtom)->FinishOptimalWrite(); + + // cleanup + fclose(m_pFile); + m_pFile = NULL; + fclose(pReadFile); + + // move temporary file into place + if (newFileName == NULL) { + Rename(m_fileName, orgFileName); + } +#else + throw new MP4Error(errno, "Function not supported when using callbacks", "MP4Optimize"); +#endif +} + +void MP4File::RewriteMdat(FILE* pReadFile, FILE* pWriteFile) +{ + u_int32_t numTracks = m_pTracks.Size(); + + MP4ChunkId* chunkIds = new MP4ChunkId[numTracks]; + MP4ChunkId* maxChunkIds = new MP4ChunkId[numTracks]; + MP4Timestamp* nextChunkTimes = new MP4Timestamp[numTracks]; + + for (u_int32_t i = 0; i < numTracks; i++) { + chunkIds[i] = 1; + maxChunkIds[i] = m_pTracks[i]->GetNumberOfChunks(); + nextChunkTimes[i] = MP4_INVALID_TIMESTAMP; + } + + while (true) { + u_int32_t nextTrackIndex = (u_int32_t)-1; + MP4Timestamp nextTime = MP4_INVALID_TIMESTAMP; + + for (u_int32_t i = 0; i < numTracks; i++) { + if (chunkIds[i] > maxChunkIds[i]) { + continue; + } + + if (nextChunkTimes[i] == MP4_INVALID_TIMESTAMP) { + MP4Timestamp chunkTime = + m_pTracks[i]->GetChunkTime(chunkIds[i]); + + nextChunkTimes[i] = MP4ConvertTime(chunkTime, + m_pTracks[i]->GetTimeScale(), GetTimeScale()); + } + + // time is not earliest so far + if (nextChunkTimes[i] > nextTime) { + continue; + } + + // prefer hint tracks to media tracks if times are equal + if (nextChunkTimes[i] == nextTime + && strcmp(m_pTracks[i]->GetType(), MP4_HINT_TRACK_TYPE)) { + continue; + } + + // this is our current choice of tracks + nextTime = nextChunkTimes[i]; + nextTrackIndex = i; + } + + if (nextTrackIndex == (u_int32_t)-1) { + break; + } + + // point into original mp4 file for read chunk call + m_pFile = pReadFile; + m_mode = 'r'; + + u_int8_t* pChunk; + u_int32_t chunkSize; + + m_pTracks[nextTrackIndex]-> + ReadChunk(chunkIds[nextTrackIndex], &pChunk, &chunkSize); + + // point back at the new mp4 file for write chunk + m_pFile = pWriteFile; + m_mode = 'w'; + + m_pTracks[nextTrackIndex]-> + RewriteChunk(chunkIds[nextTrackIndex], pChunk, chunkSize); + + MP4Free(pChunk); + + chunkIds[nextTrackIndex]++; + nextChunkTimes[nextTrackIndex] = MP4_INVALID_TIMESTAMP; + } + + delete [] chunkIds; + delete [] maxChunkIds; + delete [] nextChunkTimes; +} + +void MP4File::Open(const char* fmode) +{ + ASSERT(m_pFile == NULL); + +#ifndef USE_FILE_CALLBACKS +#ifdef O_LARGEFILE + // UGH! fopen doesn't open a file in 64-bit mode, period. + // So we need to use open() and then fdopen() + int fd; + int flags = O_LARGEFILE; + + if (strchr(fmode, '+')) { + flags |= O_CREAT | O_RDWR; + if (fmode[0] == 'w') { + flags |= O_TRUNC; + } + } else { + if (fmode[0] == 'w') { + flags |= O_CREAT | O_TRUNC | O_WRONLY; + } else { + flags |= O_RDONLY; + } + } + fd = open(m_fileName, flags, 0666); + + if (fd >= 0) { + m_pFile = fdopen(fd, fmode); + } +#else + m_pFile = fopen(m_fileName, fmode); +#endif + if (m_pFile == NULL) { + throw new MP4Error(errno, "failed", "MP4Open"); + } +#else + u_int32_t rc = m_MP4fopen(m_fileName, fmode, m_userData); + if (rc == 0) { + throw new MP4Error(errno, "failed", "MP4Open"); + } +#endif + + if (m_mode == 'r') { +#ifndef USE_FILE_CALLBACKS + struct stat s; + if (fstat(fileno(m_pFile), &s) < 0) { + throw new MP4Error(errno, "stat failed", "MP4Open"); + } + m_orgFileSize = m_fileSize = s.st_size; +#else + int64_t s = m_MP4filesize(m_userData); + if (s < 0) { + throw new MP4Error(errno, "retreiving filesize failed", "MP4Open"); + } + m_orgFileSize = m_fileSize = (u_int64_t)s; +#endif + } else { + m_orgFileSize = m_fileSize = 0; + } +} + +void MP4File::ReadFromFile() +{ + // ensure we start at beginning of file + SetPosition(0); + + // create a new root atom + ASSERT(m_pRootAtom == NULL); + m_pRootAtom = MP4Atom::CreateAtom(NULL); + + u_int64_t fileSize = GetSize(); + + m_pRootAtom->SetFile(this); + m_pRootAtom->SetStart(0); + m_pRootAtom->SetSize(fileSize); + m_pRootAtom->SetEnd(fileSize); + + m_pRootAtom->Read(); + + // create MP4Track's for any tracks in the file + GenerateTracks(); +} + +void MP4File::GenerateTracks() +{ + u_int32_t trackIndex = 0; + + while (true) { + char trackName[32]; + snprintf(trackName, sizeof(trackName), "moov.trak[%u]", trackIndex); + + // find next trak atom + MP4Atom* pTrakAtom = m_pRootAtom->FindAtom(trackName); + + // done, no more trak atoms + if (pTrakAtom == NULL) { + break; + } + + // find track id property + MP4Integer32Property* pTrackIdProperty = NULL; + pTrakAtom->FindProperty( + "trak.tkhd.trackId", + (MP4Property**)&pTrackIdProperty); + + // find track type property + MP4StringProperty* pTypeProperty = NULL; + pTrakAtom->FindProperty( + "trak.mdia.hdlr.handlerType", + (MP4Property**)&pTypeProperty); + + // ensure we have the basics properties + if (pTrackIdProperty && pTypeProperty) { + + m_trakIds.Add(pTrackIdProperty->GetValue()); + + MP4Track* pTrack = NULL; + try { + if (!strcmp(pTypeProperty->GetValue(), MP4_HINT_TRACK_TYPE)) { + pTrack = new MP4RtpHintTrack(this, pTrakAtom); + } else { + pTrack = new MP4Track(this, pTrakAtom); + } + m_pTracks.Add(pTrack); + } + catch (MP4Error* e) { + VERBOSE_ERROR(m_verbosity, e->Print()); + delete e; + } + + // remember when we encounter the OD track + if (pTrack && !strcmp(pTrack->GetType(), MP4_OD_TRACK_TYPE)) { + if (m_odTrackId == MP4_INVALID_TRACK_ID) { + m_odTrackId = pTrackIdProperty->GetValue(); + } else { + VERBOSE_READ(GetVerbosity(), + printf("Warning: multiple OD tracks present\n")); + } + } + } else { + m_trakIds.Add(0); + } + + trackIndex++; + } +} + +void MP4File::CacheProperties() +{ + FindIntegerProperty("moov.mvhd.modificationTime", + (MP4Property**)&m_pModificationProperty); + + FindIntegerProperty("moov.mvhd.timeScale", + (MP4Property**)&m_pTimeScaleProperty); + + FindIntegerProperty("moov.mvhd.duration", + (MP4Property**)&m_pDurationProperty); +} + +void MP4File::BeginWrite() +{ + m_pRootAtom->BeginWrite(); +} + +void MP4File::FinishWrite() +{ + // for all tracks, flush chunking buffers + for (u_int32_t i = 0; i < m_pTracks.Size(); i++) { + ASSERT(m_pTracks[i]); + m_pTracks[i]->FinishWrite(); + } + + // ask root atom to write + m_pRootAtom->FinishWrite(); + + // check if file shrunk, e.g. we deleted a track + if (GetSize() < m_orgFileSize) { + // just use a free atom to mark unused space + // MP4Optimize() should be used to clean up this space + MP4Atom* pFreeAtom = MP4Atom::CreateAtom("free"); + ASSERT(pFreeAtom); + pFreeAtom->SetFile(this); + pFreeAtom->SetSize((u_int64_t)MAX((int64_t)m_orgFileSize - ((int64_t)m_fileSize + 8), 0)); + pFreeAtom->Write(); + delete pFreeAtom; + } +} + +MP4Duration MP4File::UpdateDuration(MP4Duration duration) +{ + MP4Duration currentDuration = GetDuration(); + if (duration > currentDuration) { + SetDuration(duration); + return duration; + } + return currentDuration; +} + +void MP4File::Dump(FILE* pDumpFile, bool dumpImplicits) +{ + if (pDumpFile == NULL) { + pDumpFile = stdout; + } + + fprintf(pDumpFile, "Dumping %s meta-information...\n", m_fileName); + m_pRootAtom->Dump(pDumpFile, 0, dumpImplicits); +} + +void MP4File::Close() +{ + if (m_mode == 'w') { + SetIntegerProperty("moov.mvhd.modificationTime", + MP4GetAbsTimestamp()); + + FinishWrite(); + } + +#ifndef USE_FILE_CALLBACKS + fclose(m_pFile); + m_pFile = NULL; +#else + m_MP4fclose(m_userData); +#endif +} + +const char* MP4File::TempFileName() +{ + // there are so many attempts in libc to get this right + // that for portablity reasons, it's best just to roll our own +#ifndef _WIN32 + static char tempFileName[64]; + u_int32_t i; + for (i = getpid(); i < 0xFFFFFFFF; i++) { + sprintf(tempFileName, "./tmp%u.mp4", i); + if (access(tempFileName, F_OK) != 0) { + break; + } + } + if (i == 0xFFFFFFFF) { + throw new MP4Error("can't create temporary file", "TempFileName"); + } +#else + static char tempFileName[MAX_PATH + 3]; + GetTempFileName(".", // dir. for temp. files + "mp4", // temp. filename prefix + 0, // create unique name + tempFileName); // buffer for name +#endif + + return tempFileName; +} + +void MP4File::Rename(const char* oldFileName, const char* newFileName) +{ + int rc; + +#ifdef _WIN32 + rc = remove(newFileName); + if (rc == 0) { + rc = rename(oldFileName, newFileName); + } + else + remove(oldFileName); + +#else + rc = rename(oldFileName, newFileName); +#endif + if (rc != 0) { + throw new MP4Error(errno, "can't overwrite existing file", "Rename"); + } +} + +void MP4File::ProtectWriteOperation(char* where) +{ + if (m_mode == 'r') { + throw new MP4Error("operation not permitted in read mode", where); + } +} + +MP4Track* MP4File::GetTrack(MP4TrackId trackId) +{ + return m_pTracks[FindTrackIndex(trackId)]; +} + +MP4Atom* MP4File::FindAtom(const char* name) +{ + MP4Atom* pAtom = NULL; + if (!name || !strcmp(name, "")) { + pAtom = m_pRootAtom; + } else { + pAtom = m_pRootAtom->FindAtom(name); + } + return pAtom; +} + +MP4Atom* MP4File::AddChildAtom( + const char* parentName, + const char* childName) +{ + return AddChildAtom(FindAtom(parentName), childName); +} + +MP4Atom* MP4File::AddChildAtom( + MP4Atom* pParentAtom, + const char* childName) +{ + return InsertChildAtom(pParentAtom, childName, + pParentAtom->GetNumberOfChildAtoms()); +} + +MP4Atom* MP4File::InsertChildAtom( + const char* parentName, + const char* childName, + u_int32_t index) +{ + return InsertChildAtom(FindAtom(parentName), childName, index); +} + +MP4Atom* MP4File::InsertChildAtom( + MP4Atom* pParentAtom, + const char* childName, + u_int32_t index) +{ + MP4Atom* pChildAtom = MP4Atom::CreateAtom(childName); + + ASSERT(pParentAtom); + pParentAtom->InsertChildAtom(pChildAtom, index); + + pChildAtom->Generate(); + + return pChildAtom; +} + +MP4Atom* MP4File::AddDescendantAtoms( + const char* ancestorName, + const char* descendantNames) +{ + return AddDescendantAtoms(FindAtom(ancestorName), descendantNames); +} + +MP4Atom* MP4File::AddDescendantAtoms( + MP4Atom* pAncestorAtom, const char* descendantNames) +{ + ASSERT(pAncestorAtom); + + MP4Atom* pParentAtom = pAncestorAtom; + MP4Atom* pChildAtom = NULL; + + while (true) { + char* childName = MP4NameFirst(descendantNames); + + if (childName == NULL) { + break; + } + + descendantNames = MP4NameAfterFirst(descendantNames); + + pChildAtom = pParentAtom->FindChildAtom(childName); + + if (pChildAtom == NULL) { + pChildAtom = AddChildAtom(pParentAtom, childName); + } + + pParentAtom = pChildAtom; + + MP4Free(childName); + } + + return pChildAtom; +} + +bool MP4File::FindProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (pIndex) { + *pIndex = 0; // set the default answer for index + } + + return m_pRootAtom->FindProperty(name, ppProperty, pIndex); +} + +void MP4File::FindIntegerProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (!FindProperty(name, ppProperty, pIndex)) { + throw new MP4Error("no such property - %s", "MP4File::FindIntegerProperty", name); + } + + switch ((*ppProperty)->GetType()) { + case Integer8Property: + case Integer16Property: + case Integer24Property: + case Integer32Property: + case Integer64Property: + break; + default: + throw new MP4Error("type mismatch - property %s type %d", "MP4File::FindIntegerProperty", name, (*ppProperty)->GetType()); + } +} + +u_int64_t MP4File::GetIntegerProperty(const char* name) +{ + MP4Property* pProperty; + u_int32_t index; + + FindIntegerProperty(name, &pProperty, &index); + + return ((MP4IntegerProperty*)pProperty)->GetValue(index); +} + +void MP4File::SetIntegerProperty(const char* name, u_int64_t value) +{ + ProtectWriteOperation("SetIntegerProperty"); + + MP4Property* pProperty = NULL; + u_int32_t index = 0; + + FindIntegerProperty(name, &pProperty, &index); + + ((MP4IntegerProperty*)pProperty)->SetValue(value, index); +} + +void MP4File::FindFloatProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (!FindProperty(name, ppProperty, pIndex)) { + throw new MP4Error("no such property - %s", "MP4File::FindFloatProperty", name); + } + if ((*ppProperty)->GetType() != Float32Property) { + throw new MP4Error("type mismatch - property %s type %d", + "MP4File::FindFloatProperty", + name, + (*ppProperty)->GetType()); + } +} + +float MP4File::GetFloatProperty(const char* name) +{ + MP4Property* pProperty; + u_int32_t index; + + FindFloatProperty(name, &pProperty, &index); + + return ((MP4Float32Property*)pProperty)->GetValue(index); +} + +void MP4File::SetFloatProperty(const char* name, float value) +{ + ProtectWriteOperation("SetFloatProperty"); + + MP4Property* pProperty; + u_int32_t index; + + FindFloatProperty(name, &pProperty, &index); + + ((MP4Float32Property*)pProperty)->SetValue(value, index); +} + +void MP4File::FindStringProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (!FindProperty(name, ppProperty, pIndex)) { + throw new MP4Error("no such property - %s", "MP4File::FindStringProperty", name); + } + if ((*ppProperty)->GetType() != StringProperty) { + throw new MP4Error("type mismatch - property %s type %d", "MP4File::FindStringProperty", + name, (*ppProperty)->GetType()); + } +} + +const char* MP4File::GetStringProperty(const char* name) +{ + MP4Property* pProperty; + u_int32_t index; + + FindStringProperty(name, &pProperty, &index); + + return ((MP4StringProperty*)pProperty)->GetValue(index); +} + +void MP4File::SetStringProperty(const char* name, const char* value) +{ + ProtectWriteOperation("SetStringProperty"); + + MP4Property* pProperty; + u_int32_t index; + + FindStringProperty(name, &pProperty, &index); + + ((MP4StringProperty*)pProperty)->SetValue(value, index); +} + +void MP4File::FindBytesProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (!FindProperty(name, ppProperty, pIndex)) { + throw new MP4Error("no such property %s", "MP4File::FindBytesProperty", name); + } + if ((*ppProperty)->GetType() != BytesProperty) { + throw new MP4Error("type mismatch - property %s - type %d", "MP4File::FindBytesProperty", name, (*ppProperty)->GetType()); + } +} + +void MP4File::GetBytesProperty(const char* name, + u_int8_t** ppValue, u_int32_t* pValueSize) +{ + MP4Property* pProperty; + u_int32_t index; + + FindBytesProperty(name, &pProperty, &index); + + ((MP4BytesProperty*)pProperty)->GetValue(ppValue, pValueSize, index); +} + +void MP4File::SetBytesProperty(const char* name, + const u_int8_t* pValue, u_int32_t valueSize) +{ + ProtectWriteOperation("SetBytesProperty"); + + MP4Property* pProperty; + u_int32_t index; + + FindBytesProperty(name, &pProperty, &index); + + ((MP4BytesProperty*)pProperty)->SetValue(pValue, valueSize, index); +} + + +// track functions + +MP4TrackId MP4File::AddTrack(const char* type, u_int32_t timeScale) +{ + ProtectWriteOperation("AddTrack"); + + // create and add new trak atom + MP4Atom* pTrakAtom = AddChildAtom("moov", "trak"); + + // allocate a new track id + MP4TrackId trackId = AllocTrackId(); + + m_trakIds.Add(trackId); + + // set track id + MP4Integer32Property* pInteger32Property = NULL; + pTrakAtom->FindProperty( + "trak.tkhd.trackId", (MP4Property**)&pInteger32Property); + ASSERT(pInteger32Property); + pInteger32Property->SetValue(trackId); + + // set track type + const char* normType = MP4Track::NormalizeTrackType(type); + + // sanity check for user defined types + if (strlen(normType) > 4) { + VERBOSE_WARNING(m_verbosity, + printf("AddTrack: type truncated to four characters\n")); + // StringProperty::SetValue() will do the actual truncation + } + + MP4StringProperty* pStringProperty = NULL; + pTrakAtom->FindProperty( + "trak.mdia.hdlr.handlerType", (MP4Property**)&pStringProperty); + ASSERT(pStringProperty); + pStringProperty->SetValue(normType); + + // set track time scale + pInteger32Property = NULL; + pTrakAtom->FindProperty( + "trak.mdia.mdhd.timeScale", (MP4Property**)&pInteger32Property); + ASSERT(pInteger32Property); + pInteger32Property->SetValue(timeScale ? timeScale : 1000); + + // now have enough to create MP4Track object + MP4Track* pTrack = NULL; + if (!strcmp(normType, MP4_HINT_TRACK_TYPE)) { + pTrack = new MP4RtpHintTrack(this, pTrakAtom); + } else { + pTrack = new MP4Track(this, pTrakAtom); + } + m_pTracks.Add(pTrack); + + // mark non-hint tracks as enabled + if (strcmp(normType, MP4_HINT_TRACK_TYPE)) { + SetTrackIntegerProperty(trackId, "tkhd.flags", 1); + } + + // mark track as contained in this file + // LATER will provide option for external data references + AddDataReference(trackId, NULL); + + return trackId; +} + +void MP4File::AddTrackToIod(MP4TrackId trackId) +{ + MP4DescriptorProperty* pDescriptorProperty = NULL; + m_pRootAtom->FindProperty("moov.iods.esIds", + (MP4Property**)&pDescriptorProperty); + ASSERT(pDescriptorProperty); + + MP4Descriptor* pDescriptor = + pDescriptorProperty->AddDescriptor(MP4ESIDIncDescrTag); + ASSERT(pDescriptor); + + MP4Integer32Property* pIdProperty = NULL; + pDescriptor->FindProperty("id", + (MP4Property**)&pIdProperty); + ASSERT(pIdProperty); + + pIdProperty->SetValue(trackId); +} + +void MP4File::RemoveTrackFromIod(MP4TrackId trackId) +{ + MP4DescriptorProperty* pDescriptorProperty = NULL; + m_pRootAtom->FindProperty("moov.iods.esIds", + (MP4Property**)&pDescriptorProperty); + ASSERT(pDescriptorProperty); + + for (u_int32_t i = 0; i < pDescriptorProperty->GetCount(); i++) { + static char name[32]; + snprintf(name, sizeof(name), "esIds[%u].id", i); + + MP4Integer32Property* pIdProperty = NULL; + pDescriptorProperty->FindProperty(name, + (MP4Property**)&pIdProperty); + ASSERT(pIdProperty); + + if (pIdProperty->GetValue() == trackId) { + pDescriptorProperty->DeleteDescriptor(i); + break; + } + } +} + +void MP4File::AddTrackToOd(MP4TrackId trackId) +{ + if (!m_odTrackId) { + return; + } + + AddTrackReference(MakeTrackName(m_odTrackId, "tref.mpod"), trackId); +} + +void MP4File::RemoveTrackFromOd(MP4TrackId trackId) +{ + if (!m_odTrackId) { + return; + } + + RemoveTrackReference(MakeTrackName(m_odTrackId, "tref.mpod"), trackId); +} + +void MP4File::GetTrackReferenceProperties(const char* trefName, + MP4Property** ppCountProperty, MP4Property** ppTrackIdProperty) +{ + char propName[1024]; + + snprintf(propName, sizeof(propName), "%s.%s", trefName, "entryCount"); + m_pRootAtom->FindProperty(propName, ppCountProperty); + ASSERT(*ppCountProperty); + + snprintf(propName, sizeof(propName), "%s.%s", trefName, "entries.trackId"); + m_pRootAtom->FindProperty(propName, ppTrackIdProperty); + ASSERT(*ppTrackIdProperty); +} + +void MP4File::AddTrackReference(const char* trefName, MP4TrackId refTrackId) +{ + MP4Integer32Property* pCountProperty = NULL; + MP4Integer32Property* pTrackIdProperty = NULL; + + GetTrackReferenceProperties(trefName, + (MP4Property**)&pCountProperty, + (MP4Property**)&pTrackIdProperty); + + pTrackIdProperty->AddValue(refTrackId); + pCountProperty->IncrementValue(); +} + +u_int32_t MP4File::FindTrackReference(const char* trefName, + MP4TrackId refTrackId) +{ + MP4Integer32Property* pCountProperty = NULL; + MP4Integer32Property* pTrackIdProperty = NULL; + + GetTrackReferenceProperties(trefName, + (MP4Property**)&pCountProperty, + (MP4Property**)&pTrackIdProperty); + + for (u_int32_t i = 0; i < pCountProperty->GetValue(); i++) { + if (refTrackId == pTrackIdProperty->GetValue(i)) { + return i + 1; // N.B. 1 not 0 based index + } + } + return 0; +} + +void MP4File::RemoveTrackReference(const char* trefName, MP4TrackId refTrackId) +{ + MP4Integer32Property* pCountProperty = NULL; + MP4Integer32Property* pTrackIdProperty = NULL; + + GetTrackReferenceProperties(trefName, + (MP4Property**)&pCountProperty, + (MP4Property**)&pTrackIdProperty); + + for (u_int32_t i = 0; i < pCountProperty->GetValue(); i++) { + if (refTrackId == pTrackIdProperty->GetValue(i)) { + pTrackIdProperty->DeleteValue(i); + pCountProperty->IncrementValue(-1); + } + } +} + +void MP4File::AddDataReference(MP4TrackId trackId, const char* url) +{ + MP4Atom* pDrefAtom = + FindAtom(MakeTrackName(trackId, "mdia.minf.dinf.dref")); + ASSERT(pDrefAtom); + + MP4Integer32Property* pCountProperty = NULL; + pDrefAtom->FindProperty("dref.entryCount", + (MP4Property**)&pCountProperty); + ASSERT(pCountProperty); + pCountProperty->IncrementValue(); + + MP4Atom* pUrlAtom = AddChildAtom(pDrefAtom, "url "); + + if (url && url[0] != '\0') { + pUrlAtom->SetFlags(pUrlAtom->GetFlags() & 0xFFFFFE); + + MP4StringProperty* pUrlProperty = NULL; + pUrlAtom->FindProperty("url .location", + (MP4Property**)&pUrlProperty); + ASSERT(pUrlProperty); + pUrlProperty->SetValue(url); + } else { + pUrlAtom->SetFlags(pUrlAtom->GetFlags() | 1); + } +} + +MP4TrackId MP4File::AddSystemsTrack(const char* type) +{ + const char* normType = MP4Track::NormalizeTrackType(type); + + // TBD if user type, fix name to four chars, and warn + + MP4TrackId trackId = AddTrack(type, MP4_MSECS_TIME_SCALE); + + InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "nmhd", 0); + + AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "mp4s"); + + // stsd is a unique beast in that it has a count of the number + // of child atoms that needs to be incremented after we add the mp4s atom + MP4Integer32Property* pStsdCountProperty; + FindIntegerProperty( + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), + (MP4Property**)&pStsdCountProperty); + pStsdCountProperty->IncrementValue(); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4s.esds.ESID", +#if 0 + // note - for a file, these values need to + // be 0 - wmay - 04/16/2003 + trackId +#else + 0 +#endif + ); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4s.esds.decConfigDescr.objectTypeId", + MP4SystemsV1ObjectType); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4s.esds.decConfigDescr.streamType", + ConvertTrackTypeToStreamType(normType)); + + return trackId; +} + +MP4TrackId MP4File::AddODTrack() +{ + // until a demonstrated need emerges + // we limit ourselves to one object description track + if (m_odTrackId != MP4_INVALID_TRACK_ID) { + throw new MP4Error("object description track already exists", + "AddObjectDescriptionTrack"); + } + + m_odTrackId = AddSystemsTrack(MP4_OD_TRACK_TYPE); + + AddTrackToIod(m_odTrackId); + + AddDescendantAtoms(MakeTrackName(m_odTrackId, NULL), "tref.mpod"); + + return m_odTrackId; +} + +MP4TrackId MP4File::AddSceneTrack() +{ + MP4TrackId trackId = AddSystemsTrack(MP4_SCENE_TRACK_TYPE); + + AddTrackToIod(trackId); + AddTrackToOd(trackId); + + return trackId; +} + +MP4TrackId MP4File::AddAudioTrack( + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int8_t audioType) +{ + MP4TrackId trackId = AddTrack(MP4_AUDIO_TRACK_TYPE, timeScale); + + AddTrackToOd(trackId); + + SetTrackFloatProperty(trackId, "tkhd.volume", 1.0); + + InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "smhd", 0); + + AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "mp4a"); + + // stsd is a unique beast in that it has a count of the number + // of child atoms that needs to be incremented after we add the mp4a atom + MP4Integer32Property* pStsdCountProperty; + FindIntegerProperty( + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), + (MP4Property**)&pStsdCountProperty); + pStsdCountProperty->IncrementValue(); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4a.timeScale", timeScale); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4a.esds.ESID", +#if 0 + // note - for a file, these values need to + // be 0 - wmay - 04/16/2003 + trackId +#else + 0 +#endif + ); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4a.esds.decConfigDescr.objectTypeId", + audioType); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4a.esds.decConfigDescr.streamType", + MP4AudioStreamType); + + m_pTracks[FindTrackIndex(trackId)]-> + SetFixedSampleDuration(sampleDuration); + + return trackId; +} + +MP4TrackId MP4File::AddEncAudioTrack(u_int32_t timeScale, + MP4Duration sampleDuration, + u_int8_t audioType) +{ + MP4TrackId trackId = AddTrack(MP4_AUDIO_TRACK_TYPE, timeScale); + + AddTrackToOd(trackId); + + SetTrackFloatProperty(trackId, "tkhd.volume", 1.0); + + InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "smhd", 0); + + AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "enca"); + + // stsd is a unique beast in that it has a count of the number + // of child atoms that needs to be incremented after we add the enca atom + MP4Integer32Property* pStsdCountProperty; + FindIntegerProperty( + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), + (MP4Property**)&pStsdCountProperty); + pStsdCountProperty->IncrementValue(); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.enca.timeScale", timeScale); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.enca.esds.ESID", +#if 0 + // note - for a file, these values need to + // be 0 - wmay - 04/16/2003 + trackId +#else + 0 +#endif + ); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.enca.esds.decConfigDescr.objectTypeId", + audioType); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.enca.esds.decConfigDescr.streamType", + MP4AudioStreamType); + + m_pTracks[FindTrackIndex(trackId)]-> + SetFixedSampleDuration(sampleDuration); + + return trackId; +} + +MP4TrackId MP4File::AddVideoTrack( + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + u_int8_t videoType) +{ + MP4TrackId trackId = AddTrack(MP4_VIDEO_TRACK_TYPE, timeScale); + + AddTrackToOd(trackId); + + SetTrackFloatProperty(trackId, "tkhd.width", width); + SetTrackFloatProperty(trackId, "tkhd.height", height); + + InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "vmhd", 0); + + AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "mp4v"); + + // stsd is a unique beast in that it has a count of the number + // of child atoms that needs to be incremented after we add the mp4v atom + MP4Integer32Property* pStsdCountProperty; + FindIntegerProperty( + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), + (MP4Property**)&pStsdCountProperty); + pStsdCountProperty->IncrementValue(); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4v.width", width); + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4v.height", height); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4v.esds.ESID", +#if 0 + // note - for a file, these values need to + // be 0 - wmay - 04/16/2003 + trackId +#else + 0 +#endif + ); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4v.esds.decConfigDescr.objectTypeId", + videoType); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4v.esds.decConfigDescr.streamType", + MP4VisualStreamType); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsz.sampleSize", sampleDuration); + + m_pTracks[FindTrackIndex(trackId)]-> + SetFixedSampleDuration(sampleDuration); + + return trackId; +} + +MP4TrackId MP4File::AddEncVideoTrack(u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + u_int8_t videoType) +{ + MP4TrackId trackId = AddTrack(MP4_VIDEO_TRACK_TYPE, timeScale); + + AddTrackToOd(trackId); + + SetTrackFloatProperty(trackId, "tkhd.width", width); + SetTrackFloatProperty(trackId, "tkhd.height", height); + + InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "vmhd", 0); + + AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "encv"); + + // stsd is a unique beast in that it has a count of the number + // of child atoms that needs to be incremented after we add the encv atom + MP4Integer32Property* pStsdCountProperty; + FindIntegerProperty( + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), + (MP4Property**)&pStsdCountProperty); + pStsdCountProperty->IncrementValue(); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.width", width); + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.height", height); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.esds.ESID", +#if 0 + // note - for a file, these values need to + // be 0 - wmay - 04/16/2003 + trackId +#else + 0 +#endif + ); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.esds.decConfigDescr.objectTypeId", + videoType); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.esds.decConfigDescr.streamType", + MP4VisualStreamType); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsz.sampleSize", sampleDuration); + + m_pTracks[FindTrackIndex(trackId)]-> + SetFixedSampleDuration(sampleDuration); + + return trackId; +} + +MP4TrackId MP4File::AddHintTrack(MP4TrackId refTrackId) +{ + // validate reference track id + FindTrackIndex(refTrackId); + + MP4TrackId trackId = + AddTrack(MP4_HINT_TRACK_TYPE, GetTrackTimeScale(refTrackId)); + + InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "hmhd", 0); + + AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "rtp "); + + // stsd is a unique beast in that it has a count of the number + // of child atoms that needs to be incremented after we add the rtp atom + MP4Integer32Property* pStsdCountProperty; + FindIntegerProperty( + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), + (MP4Property**)&pStsdCountProperty); + pStsdCountProperty->IncrementValue(); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.rtp .tims.timeScale", + GetTrackTimeScale(trackId)); + + AddDescendantAtoms(MakeTrackName(trackId, NULL), "tref.hint"); + + AddTrackReference(MakeTrackName(trackId, "tref.hint"), refTrackId); + + AddDescendantAtoms(MakeTrackName(trackId, NULL), "udta.hnti.sdp "); + + AddDescendantAtoms(MakeTrackName(trackId, NULL), "udta.hinf"); + + return trackId; +} + +void MP4File::DeleteTrack(MP4TrackId trackId) +{ + ProtectWriteOperation("MP4DeleteTrack"); + + u_int32_t trakIndex = FindTrakAtomIndex(trackId); + u_int16_t trackIndex = FindTrackIndex(trackId); + MP4Track* pTrack = m_pTracks[trackIndex]; + + MP4Atom* pTrakAtom = pTrack->GetTrakAtom(); + ASSERT(pTrakAtom); + + MP4Atom* pMoovAtom = FindAtom("moov"); + ASSERT(pMoovAtom); + + RemoveTrackFromIod(trackId); + RemoveTrackFromOd(trackId); + + if (trackId == m_odTrackId) { + m_odTrackId = 0; + } + + pMoovAtom->DeleteChildAtom(pTrakAtom); + + m_trakIds.Delete(trakIndex); + + m_pTracks.Delete(trackIndex); + + delete pTrack; + delete pTrakAtom; +} + +u_int32_t MP4File::GetNumberOfTracks(const char* type, u_int8_t subType) +{ + if (type == NULL) { + return m_pTracks.Size(); + } + + u_int32_t typeSeen = 0; + const char* normType = MP4Track::NormalizeTrackType(type); + + for (u_int32_t i = 0; i < m_pTracks.Size(); i++) { + if (!strcmp(normType, m_pTracks[i]->GetType())) { + if (subType) { + if (normType == MP4_AUDIO_TRACK_TYPE) { + if (subType != GetTrackEsdsObjectTypeId(m_pTracks[i]->GetId())) { + continue; + } + } else if (normType == MP4_VIDEO_TRACK_TYPE) { + if (subType != GetTrackEsdsObjectTypeId(m_pTracks[i]->GetId())) { + continue; + } + } + // else unknown subtype, ignore it + } + typeSeen++; + } + } + return typeSeen; +} + +MP4TrackId MP4File::AllocTrackId() +{ + MP4TrackId trackId = + GetIntegerProperty("moov.mvhd.nextTrackId"); + + if (trackId <= 0xFFFF) { + // check that nextTrackid is correct + try { + FindTrackIndex(trackId); + // ERROR, this trackId is in use + } + catch (MP4Error* e) { + // OK, this trackId is not in use, proceed + delete e; + SetIntegerProperty("moov.mvhd.nextTrackId", trackId + 1); + return trackId; + } + } + + // we need to search for a track id + for (trackId = 1; trackId <= 0xFFFF; trackId++) { + try { + FindTrackIndex(trackId); + // KEEP LOOKING, this trackId is in use + } + catch (MP4Error* e) { + // OK, this trackId is not in use, proceed + delete e; + return trackId; + } + } + + // extreme case where mp4 file has 2^16 tracks in it + throw new MP4Error("too many existing tracks", "AddTrack"); + return MP4_INVALID_TRACK_ID; // to keep MSVC happy +} + +MP4TrackId MP4File::FindTrackId(u_int16_t trackIndex, + const char* type, u_int8_t subType) +{ + if (type == NULL) { + return m_pTracks[trackIndex]->GetId(); + } + + u_int32_t typeSeen = 0; + const char* normType = MP4Track::NormalizeTrackType(type); + + for (u_int32_t i = 0; i < m_pTracks.Size(); i++) { + if (!strcmp(normType, m_pTracks[i]->GetType())) { + if (subType) { + if (normType == MP4_AUDIO_TRACK_TYPE) { + if (subType != GetTrackEsdsObjectTypeId(m_pTracks[i]->GetId())) { + continue; + } + } else if (normType == MP4_VIDEO_TRACK_TYPE) { + if (subType != GetTrackEsdsObjectTypeId(m_pTracks[i]->GetId())) { + continue; + } + } + // else unknown subtype, ignore it + } + + if (trackIndex == typeSeen) { + return m_pTracks[i]->GetId(); + } + + typeSeen++; + } + } + + throw new MP4Error("Track index doesn't exist - track %d type %s", + "FindTrackId", + trackIndex, type); + return MP4_INVALID_TRACK_ID; // satisfy MS compiler +} + +u_int16_t MP4File::FindTrackIndex(MP4TrackId trackId) +{ + for (u_int32_t i = 0; i < m_pTracks.Size() && i <= 0xFFFF; i++) { + if (m_pTracks[i]->GetId() == trackId) { + return (u_int16_t)i; + } + } + + throw new MP4Error("Track id %d doesn't exist", "FindTrackIndex", trackId); + return (u_int16_t)-1; // satisfy MS compiler +} + +u_int16_t MP4File::FindTrakAtomIndex(MP4TrackId trackId) +{ + if (trackId) { + for (u_int32_t i = 0; i < m_trakIds.Size(); i++) { + if (m_trakIds[i] == trackId) { + return i; + } + } + } + + throw new MP4Error("Track id %d doesn't exist", "FindTrakAtomIndex", + trackId); + return (u_int16_t)-1; // satisfy MS compiler +} + +u_int32_t MP4File::GetSampleSize(MP4TrackId trackId, MP4SampleId sampleId) +{ + return m_pTracks[FindTrackIndex(trackId)]->GetSampleSize(sampleId); +} + +u_int32_t MP4File::GetTrackMaxSampleSize(MP4TrackId trackId) +{ + return m_pTracks[FindTrackIndex(trackId)]->GetMaxSampleSize(); +} + +MP4SampleId MP4File::GetSampleIdFromTime(MP4TrackId trackId, + MP4Timestamp when, bool wantSyncSample) +{ + return m_pTracks[FindTrackIndex(trackId)]-> + GetSampleIdFromTime(when, wantSyncSample); +} + +MP4Timestamp MP4File::GetSampleTime( + MP4TrackId trackId, MP4SampleId sampleId) +{ + MP4Timestamp timestamp; + m_pTracks[FindTrackIndex(trackId)]-> + GetSampleTimes(sampleId, ×tamp, NULL); + return timestamp; +} + +MP4Duration MP4File::GetSampleDuration( + MP4TrackId trackId, MP4SampleId sampleId) +{ + MP4Duration duration; + m_pTracks[FindTrackIndex(trackId)]-> + GetSampleTimes(sampleId, NULL, &duration); + return duration; +} + +MP4Duration MP4File::GetSampleRenderingOffset( + MP4TrackId trackId, MP4SampleId sampleId) +{ + return m_pTracks[FindTrackIndex(trackId)]-> + GetSampleRenderingOffset(sampleId); +} + +bool MP4File::GetSampleSync(MP4TrackId trackId, MP4SampleId sampleId) +{ + return m_pTracks[FindTrackIndex(trackId)]->IsSyncSample(sampleId); +} + +void MP4File::ReadSample(MP4TrackId trackId, MP4SampleId sampleId, + u_int8_t** ppBytes, u_int32_t* pNumBytes, + MP4Timestamp* pStartTime, MP4Duration* pDuration, + MP4Duration* pRenderingOffset, bool* pIsSyncSample) +{ + m_pTracks[FindTrackIndex(trackId)]-> + ReadSample(sampleId, ppBytes, pNumBytes, + pStartTime, pDuration, pRenderingOffset, pIsSyncSample); +} + +void MP4File::WriteSample(MP4TrackId trackId, + const u_int8_t* pBytes, u_int32_t numBytes, + MP4Duration duration, MP4Duration renderingOffset, bool isSyncSample) +{ + ProtectWriteOperation("MP4WriteSample"); + + m_pTracks[FindTrackIndex(trackId)]-> + WriteSample(pBytes, numBytes, duration, renderingOffset, isSyncSample); + + m_pModificationProperty->SetValue(MP4GetAbsTimestamp()); +} + +void MP4File::SetSampleRenderingOffset(MP4TrackId trackId, + MP4SampleId sampleId, MP4Duration renderingOffset) +{ + ProtectWriteOperation("MP4SetSampleRenderingOffset"); + + m_pTracks[FindTrackIndex(trackId)]-> + SetSampleRenderingOffset(sampleId, renderingOffset); + + m_pModificationProperty->SetValue(MP4GetAbsTimestamp()); +} + +char* MP4File::MakeTrackName(MP4TrackId trackId, const char* name) +{ + u_int16_t trakIndex = FindTrakAtomIndex(trackId); + + static char trakName[1024]; + if (name == NULL || name[0] == '\0') { + snprintf(trakName, sizeof(trakName), + "moov.trak[%u]", trakIndex); + } else { + snprintf(trakName, sizeof(trakName), + "moov.trak[%u].%s", trakIndex, name); + } + return trakName; +} + +u_int64_t MP4File::GetTrackIntegerProperty(MP4TrackId trackId, const char* name) +{ + return GetIntegerProperty(MakeTrackName(trackId, name)); +} + +void MP4File::SetTrackIntegerProperty(MP4TrackId trackId, const char* name, + int64_t value) +{ + SetIntegerProperty(MakeTrackName(trackId, name), value); +} + +float MP4File::GetTrackFloatProperty(MP4TrackId trackId, const char* name) +{ + return GetFloatProperty(MakeTrackName(trackId, name)); +} + +void MP4File::SetTrackFloatProperty(MP4TrackId trackId, const char* name, + float value) +{ + SetFloatProperty(MakeTrackName(trackId, name), value); +} + +const char* MP4File::GetTrackStringProperty(MP4TrackId trackId, const char* name) +{ + return GetStringProperty(MakeTrackName(trackId, name)); +} + +void MP4File::SetTrackStringProperty(MP4TrackId trackId, const char* name, + const char* value) +{ + SetStringProperty(MakeTrackName(trackId, name), value); +} + +void MP4File::GetTrackBytesProperty(MP4TrackId trackId, const char* name, + u_int8_t** ppValue, u_int32_t* pValueSize) +{ + GetBytesProperty(MakeTrackName(trackId, name), ppValue, pValueSize); +} + +void MP4File::SetTrackBytesProperty(MP4TrackId trackId, const char* name, + const u_int8_t* pValue, u_int32_t valueSize) +{ + SetBytesProperty(MakeTrackName(trackId, name), pValue, valueSize); +} + + +// file level convenience functions + +MP4Duration MP4File::GetDuration() +{ + return m_pDurationProperty->GetValue(); +} + +void MP4File::SetDuration(MP4Duration value) +{ + m_pDurationProperty->SetValue(value); +} + +u_int32_t MP4File::GetTimeScale() +{ + return m_pTimeScaleProperty->GetValue(); +} + +void MP4File::SetTimeScale(u_int32_t value) +{ + if (value == 0) { + throw new MP4Error("invalid value", "SetTimeScale"); + } + m_pTimeScaleProperty->SetValue(value); +} + +u_int8_t MP4File::GetODProfileLevel() +{ + return GetIntegerProperty("moov.iods.ODProfileLevelId"); +} + +void MP4File::SetODProfileLevel(u_int8_t value) +{ + SetIntegerProperty("moov.iods.ODProfileLevelId", value); +} + +u_int8_t MP4File::GetSceneProfileLevel() +{ + return GetIntegerProperty("moov.iods.sceneProfileLevelId"); +} + +void MP4File::SetSceneProfileLevel(u_int8_t value) +{ + SetIntegerProperty("moov.iods.sceneProfileLevelId", value); +} + +u_int8_t MP4File::GetVideoProfileLevel() +{ + return GetIntegerProperty("moov.iods.visualProfileLevelId"); +} + +void MP4File::SetVideoProfileLevel(u_int8_t value) +{ + SetIntegerProperty("moov.iods.visualProfileLevelId", value); +} + +u_int8_t MP4File::GetAudioProfileLevel() +{ + return GetIntegerProperty("moov.iods.audioProfileLevelId"); +} + +void MP4File::SetAudioProfileLevel(u_int8_t value) +{ + SetIntegerProperty("moov.iods.audioProfileLevelId", value); +} + +u_int8_t MP4File::GetGraphicsProfileLevel() +{ + return GetIntegerProperty("moov.iods.graphicsProfileLevelId"); +} + +void MP4File::SetGraphicsProfileLevel(u_int8_t value) +{ + SetIntegerProperty("moov.iods.graphicsProfileLevelId", value); +} + +const char* MP4File::GetSessionSdp() +{ + return GetStringProperty("moov.udta.hnti.rtp .sdpText"); +} + +void MP4File::SetSessionSdp(const char* sdpString) +{ + AddDescendantAtoms("moov", "udta.hnti.rtp "); + + SetStringProperty("moov.udta.hnti.rtp .sdpText", sdpString); +} + +void MP4File::AppendSessionSdp(const char* sdpFragment) +{ + const char* oldSdpString = NULL; + try { + oldSdpString = GetSessionSdp(); + } + catch (MP4Error* e) { + delete e; + SetSessionSdp(sdpFragment); + return; + } + + char* newSdpString = + (char*)MP4Malloc(strlen(oldSdpString) + strlen(sdpFragment) + 1); + strcpy(newSdpString, oldSdpString); + strcat(newSdpString, sdpFragment); + SetSessionSdp(newSdpString); + MP4Free(newSdpString); +} + + +// track level convenience functions + +MP4SampleId MP4File::GetTrackNumberOfSamples(MP4TrackId trackId) +{ + return m_pTracks[FindTrackIndex(trackId)]->GetNumberOfSamples(); +} + +const char* MP4File::GetTrackType(MP4TrackId trackId) +{ + return m_pTracks[FindTrackIndex(trackId)]->GetType(); +} + +u_int32_t MP4File::GetTrackTimeScale(MP4TrackId trackId) +{ + return m_pTracks[FindTrackIndex(trackId)]->GetTimeScale(); +} + +void MP4File::SetTrackTimeScale(MP4TrackId trackId, u_int32_t value) +{ + if (value == 0) { + throw new MP4Error("invalid value", "SetTrackTimeScale"); + } + SetTrackIntegerProperty(trackId, "mdia.mdhd.timeScale", value); +} + +MP4Duration MP4File::GetTrackDuration(MP4TrackId trackId) +{ + return GetTrackIntegerProperty(trackId, "mdia.mdhd.duration"); +} + +// now GetTrackEsdsObjectTypeId +u_int8_t MP4File::GetTrackAudioType(MP4TrackId trackId) +{ + return GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4a.esds.decConfigDescr.objectTypeId"); +} + +u_int8_t MP4File::GetTrackEsdsObjectTypeId(MP4TrackId trackId) +{ + // changed mp4a to * to handle enca case + return GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId"); +} + +u_int8_t MP4File::GetTrackAudioMpeg4Type(MP4TrackId trackId) +{ + // verify that track is an MPEG-4 audio track + if (GetTrackEsdsObjectTypeId(trackId) != MP4_MPEG4_AUDIO_TYPE) { + return MP4_MPEG4_INVALID_AUDIO_TYPE; + } + + u_int8_t* pEsConfig = NULL; + u_int32_t esConfigSize; + + // The Mpeg4 audio type (AAC, CELP, HXVC, ...) + // is the first 5 bits of the ES configuration + + GetTrackESConfiguration(trackId, &pEsConfig, &esConfigSize); + + if (esConfigSize < 1) { + return MP4_MPEG4_INVALID_AUDIO_TYPE; + } + + u_int8_t mpeg4Type = (pEsConfig[0] >> 3); + + free(pEsConfig); + + return mpeg4Type; +} + +// replaced with GetTrackEsdsObjectTypeId +u_int8_t MP4File::GetTrackVideoType(MP4TrackId trackId) +{ + return GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.mp4v.esds.decConfigDescr.objectTypeId"); +} + +MP4Duration MP4File::GetTrackFixedSampleDuration(MP4TrackId trackId) +{ + return m_pTracks[FindTrackIndex(trackId)]->GetFixedSampleDuration(); +} + +float MP4File::GetTrackVideoFrameRate(MP4TrackId trackId) +{ + MP4SampleId numSamples = + GetTrackNumberOfSamples(trackId); + u_int64_t + msDuration = + ConvertFromTrackDuration(trackId, + GetTrackDuration(trackId), MP4_MSECS_TIME_SCALE); + + if (msDuration == 0) { + return 0.0; + } + + return ((double)numSamples / UINT64_TO_DOUBLE(msDuration)) * MP4_MSECS_TIME_SCALE; +} + +void MP4File::GetTrackESConfiguration(MP4TrackId trackId, + u_int8_t** ppConfig, u_int32_t* pConfigSize) +{ + GetTrackBytesProperty(trackId, + "mdia.minf.stbl.stsd.*[0].esds.decConfigDescr.decSpecificInfo[0].info", + ppConfig, pConfigSize); +} + +void MP4File::SetTrackESConfiguration(MP4TrackId trackId, + const u_int8_t* pConfig, u_int32_t configSize) +{ + // get a handle on the track decoder config descriptor + MP4DescriptorProperty* pConfigDescrProperty = NULL; + FindProperty(MakeTrackName(trackId, + "mdia.minf.stbl.stsd.*[0].esds.decConfigDescr.decSpecificInfo"), + (MP4Property**)&pConfigDescrProperty); + + if (pConfigDescrProperty == NULL) { + // probably trackId refers to a hint track + throw new MP4Error("no such property", "MP4SetTrackESConfiguration"); + } + + // lookup the property to store the configuration + MP4BytesProperty* pInfoProperty = NULL; + pConfigDescrProperty->FindProperty("decSpecificInfo[0].info", + (MP4Property**)&pInfoProperty); + + // configuration being set for the first time + if (pInfoProperty == NULL) { + // need to create a new descriptor to hold it + MP4Descriptor* pConfigDescr = + pConfigDescrProperty->AddDescriptor(MP4DecSpecificDescrTag); + pConfigDescr->Generate(); + + pConfigDescrProperty->FindProperty( + "decSpecificInfo[0].info", + (MP4Property**)&pInfoProperty); + ASSERT(pInfoProperty); + } + + // set the value + pInfoProperty->SetValue(pConfig, configSize); +} + +const char* MP4File::GetHintTrackSdp(MP4TrackId hintTrackId) +{ + return GetTrackStringProperty(hintTrackId, "udta.hnti.sdp .sdpText"); +} + +void MP4File::SetHintTrackSdp(MP4TrackId hintTrackId, const char* sdpString) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4SetHintTrackSdp"); + } + + AddDescendantAtoms( + MakeTrackName(hintTrackId, NULL), "udta.hnti.sdp "); + + SetTrackStringProperty(hintTrackId, "udta.hnti.sdp .sdpText", sdpString); +} + +void MP4File::AppendHintTrackSdp(MP4TrackId hintTrackId, + const char* sdpFragment) +{ + const char* oldSdpString = NULL; + try { + oldSdpString = GetHintTrackSdp(hintTrackId); + } + catch (MP4Error* e) { + delete e; + SetHintTrackSdp(hintTrackId, sdpFragment); + return; + } + + char* newSdpString = + (char*)MP4Malloc(strlen(oldSdpString) + strlen(sdpFragment) + 1); + strcpy(newSdpString, oldSdpString); + strcat(newSdpString, sdpFragment); + SetHintTrackSdp(hintTrackId, newSdpString); + MP4Free(newSdpString); +} + +void MP4File::GetHintTrackRtpPayload( + MP4TrackId hintTrackId, + char** ppPayloadName, + u_int8_t* pPayloadNumber, + u_int16_t* pMaxPayloadSize, + char **ppEncodingParams) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4GetHintTrackRtpPayload"); + } + + ((MP4RtpHintTrack*)pTrack)->GetPayload( + ppPayloadName, pPayloadNumber, pMaxPayloadSize, ppEncodingParams); +} + +void MP4File::SetHintTrackRtpPayload(MP4TrackId hintTrackId, + const char* payloadName, u_int8_t* pPayloadNumber, u_int16_t maxPayloadSize, + const char *encoding_params, + bool include_rtp_map, + bool include_mpeg4_esid) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4SetHintTrackRtpPayload"); + } + + u_int8_t payloadNumber; + if (pPayloadNumber && *pPayloadNumber != MP4_SET_DYNAMIC_PAYLOAD) { + payloadNumber = *pPayloadNumber; + } else { + payloadNumber = AllocRtpPayloadNumber(); + if (pPayloadNumber) { + *pPayloadNumber = payloadNumber; + } + } + + ((MP4RtpHintTrack*)pTrack)->SetPayload( + payloadName, payloadNumber, maxPayloadSize, encoding_params, + include_rtp_map, include_mpeg4_esid); +} + +u_int8_t MP4File::AllocRtpPayloadNumber() +{ + MP4Integer32Array usedPayloads; + u_int32_t i; + + // collect rtp payload numbers in use by existing tracks + for (i = 0; i < m_pTracks.Size(); i++) { + MP4Atom* pTrakAtom = m_pTracks[i]->GetTrakAtom(); + + MP4Integer32Property* pPayloadProperty = NULL; + pTrakAtom->FindProperty("trak.udta.hinf.payt.payloadNumber", + (MP4Property**)&pPayloadProperty); + + if (pPayloadProperty) { + usedPayloads.Add(pPayloadProperty->GetValue()); + } + } + + // search dynamic payload range for an available slot + u_int8_t payload; + for (payload = 96; payload < 128; payload++) { + for (i = 0; i < usedPayloads.Size(); i++) { + if (payload == usedPayloads[i]) { + break; + } + } + if (i == usedPayloads.Size()) { + break; + } + } + + if (payload >= 128) { + throw new MP4Error("no more available rtp payload numbers", + "AllocRtpPayloadNumber"); + } + + return payload; +} + +MP4TrackId MP4File::GetHintTrackReferenceTrackId( + MP4TrackId hintTrackId) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4GetHintTrackReferenceTrackId"); + } + + MP4Track* pRefTrack = ((MP4RtpHintTrack*)pTrack)->GetRefTrack(); + + if (pRefTrack == NULL) { + return MP4_INVALID_TRACK_ID; + } + return pRefTrack->GetId(); +} + +void MP4File::ReadRtpHint( + MP4TrackId hintTrackId, + MP4SampleId hintSampleId, + u_int16_t* pNumPackets) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", "MP4ReadRtpHint"); + } + ((MP4RtpHintTrack*)pTrack)-> + ReadHint(hintSampleId, pNumPackets); +} + +u_int16_t MP4File::GetRtpHintNumberOfPackets( + MP4TrackId hintTrackId) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4GetRtpHintNumberOfPackets"); + } + return ((MP4RtpHintTrack*)pTrack)->GetHintNumberOfPackets(); +} + +int8_t MP4File::GetRtpPacketBFrame( + MP4TrackId hintTrackId, + u_int16_t packetIndex) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4GetRtpHintBFrame"); + } + return ((MP4RtpHintTrack*)pTrack)->GetPacketBFrame(packetIndex); +} + +int32_t MP4File::GetRtpPacketTransmitOffset( + MP4TrackId hintTrackId, + u_int16_t packetIndex) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4GetRtpPacketTransmitOffset"); + } + return ((MP4RtpHintTrack*)pTrack)->GetPacketTransmitOffset(packetIndex); +} + +void MP4File::ReadRtpPacket( + MP4TrackId hintTrackId, + u_int16_t packetIndex, + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + u_int32_t ssrc, + bool includeHeader, + bool includePayload) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", "MP4ReadPacket"); + } + ((MP4RtpHintTrack*)pTrack)->ReadPacket( + packetIndex, ppBytes, pNumBytes, + ssrc, includeHeader, includePayload); +} + +MP4Timestamp MP4File::GetRtpTimestampStart( + MP4TrackId hintTrackId) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4GetRtpTimestampStart"); + } + return ((MP4RtpHintTrack*)pTrack)->GetRtpTimestampStart(); +} + +void MP4File::SetRtpTimestampStart( + MP4TrackId hintTrackId, + MP4Timestamp rtpStart) +{ + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4SetRtpTimestampStart"); + } + ((MP4RtpHintTrack*)pTrack)->SetRtpTimestampStart(rtpStart); +} + +void MP4File::AddRtpHint(MP4TrackId hintTrackId, + bool isBframe, u_int32_t timestampOffset) +{ + ProtectWriteOperation("MP4AddRtpHint"); + + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", "MP4AddRtpHint"); + } + ((MP4RtpHintTrack*)pTrack)->AddHint(isBframe, timestampOffset); +} + +void MP4File::AddRtpPacket( + MP4TrackId hintTrackId, bool setMbit, int32_t transmitOffset) +{ + ProtectWriteOperation("MP4AddRtpPacket"); + + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", "MP4AddRtpPacket"); + } + ((MP4RtpHintTrack*)pTrack)->AddPacket(setMbit, transmitOffset); +} + +void MP4File::AddRtpImmediateData(MP4TrackId hintTrackId, + const u_int8_t* pBytes, u_int32_t numBytes) +{ + ProtectWriteOperation("MP4AddRtpImmediateData"); + + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4AddRtpImmediateData"); + } + ((MP4RtpHintTrack*)pTrack)->AddImmediateData(pBytes, numBytes); +} + +void MP4File::AddRtpSampleData(MP4TrackId hintTrackId, + MP4SampleId sampleId, u_int32_t dataOffset, u_int32_t dataLength) +{ + ProtectWriteOperation("MP4AddRtpSampleData"); + + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4AddRtpSampleData"); + } + ((MP4RtpHintTrack*)pTrack)->AddSampleData( + sampleId, dataOffset, dataLength); +} + +void MP4File::AddRtpESConfigurationPacket(MP4TrackId hintTrackId) +{ + ProtectWriteOperation("MP4AddRtpESConfigurationPacket"); + + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4AddRtpESConfigurationPacket"); + } + ((MP4RtpHintTrack*)pTrack)->AddESConfigurationPacket(); +} + +void MP4File::WriteRtpHint(MP4TrackId hintTrackId, + MP4Duration duration, bool isSyncSample) +{ + ProtectWriteOperation("MP4WriteRtpHint"); + + MP4Track* pTrack = m_pTracks[FindTrackIndex(hintTrackId)]; + + if (strcmp(pTrack->GetType(), MP4_HINT_TRACK_TYPE)) { + throw new MP4Error("track is not a hint track", + "MP4WriteRtpHint"); + } + ((MP4RtpHintTrack*)pTrack)->WriteHint(duration, isSyncSample); +} + +u_int64_t MP4File::ConvertFromMovieDuration( + MP4Duration duration, + u_int32_t timeScale) +{ + return MP4ConvertTime((u_int64_t)duration, + GetTimeScale(), timeScale); +} + +u_int64_t MP4File::ConvertFromTrackTimestamp( + MP4TrackId trackId, + MP4Timestamp timeStamp, + u_int32_t timeScale) +{ + return MP4ConvertTime(timeStamp, + GetTrackTimeScale(trackId), timeScale); +} + +MP4Timestamp MP4File::ConvertToTrackTimestamp( + MP4TrackId trackId, + u_int64_t timeStamp, + u_int32_t timeScale) +{ + return (MP4Timestamp)MP4ConvertTime(timeStamp, + timeScale, GetTrackTimeScale(trackId)); +} + +u_int64_t MP4File::ConvertFromTrackDuration( + MP4TrackId trackId, + MP4Duration duration, + u_int32_t timeScale) +{ + return MP4ConvertTime((u_int64_t)duration, + GetTrackTimeScale(trackId), timeScale); +} + +MP4Duration MP4File::ConvertToTrackDuration( + MP4TrackId trackId, + u_int64_t duration, + u_int32_t timeScale) +{ + return (MP4Duration)MP4ConvertTime(duration, + timeScale, GetTrackTimeScale(trackId)); +} + +u_int8_t MP4File::ConvertTrackTypeToStreamType(const char* trackType) +{ + u_int8_t streamType; + + if (!strcmp(trackType, MP4_OD_TRACK_TYPE)) { + streamType = MP4ObjectDescriptionStreamType; + } else if (!strcmp(trackType, MP4_SCENE_TRACK_TYPE)) { + streamType = MP4SceneDescriptionStreamType; + } else if (!strcmp(trackType, MP4_CLOCK_TRACK_TYPE)) { + streamType = MP4ClockReferenceStreamType; + } else if (!strcmp(trackType, MP4_MPEG7_TRACK_TYPE)) { + streamType = MP4Mpeg7StreamType; + } else if (!strcmp(trackType, MP4_OCI_TRACK_TYPE)) { + streamType = MP4OCIStreamType; + } else if (!strcmp(trackType, MP4_IPMP_TRACK_TYPE)) { + streamType = MP4IPMPStreamType; + } else if (!strcmp(trackType, MP4_MPEGJ_TRACK_TYPE)) { + streamType = MP4MPEGJStreamType; + } else { + streamType = MP4UserPrivateStreamType; + } + + return streamType; +} + +// edit list + +char* MP4File::MakeTrackEditName( + MP4TrackId trackId, + MP4EditId editId, + const char* name) +{ + char* trakName = MakeTrackName(trackId, NULL); + + static char editName[1024]; + snprintf(editName, sizeof(editName), + "%s.edts.elst.entries[%u].%s", + trakName, editId - 1, name); + return editName; +} + +MP4EditId MP4File::AddTrackEdit( + MP4TrackId trackId, + MP4EditId editId) +{ + ProtectWriteOperation("AddTrackEdit"); + return m_pTracks[FindTrackIndex(trackId)]->AddEdit(editId); +} + +void MP4File::DeleteTrackEdit( + MP4TrackId trackId, + MP4EditId editId) +{ + ProtectWriteOperation("DeleteTrackEdit"); + m_pTracks[FindTrackIndex(trackId)]->DeleteEdit(editId); +} + +u_int32_t MP4File::GetTrackNumberOfEdits( + MP4TrackId trackId) +{ + return GetTrackIntegerProperty(trackId, "edts.elst.entryCount"); +} + +MP4Duration MP4File::GetTrackEditTotalDuration( + MP4TrackId trackId, + MP4EditId editId) +{ + return m_pTracks[FindTrackIndex(trackId)]->GetEditTotalDuration(editId); +} + +MP4Timestamp MP4File::GetTrackEditStart( + MP4TrackId trackId, + MP4EditId editId) +{ + return m_pTracks[FindTrackIndex(trackId)]->GetEditStart(editId); +} + +MP4Timestamp MP4File::GetTrackEditMediaStart( + MP4TrackId trackId, + MP4EditId editId) +{ + return GetIntegerProperty( + MakeTrackEditName(trackId, editId, "mediaTime")); +} + +void MP4File::SetTrackEditMediaStart( + MP4TrackId trackId, + MP4EditId editId, + MP4Timestamp startTime) +{ + SetIntegerProperty( + MakeTrackEditName(trackId, editId, "mediaTime"), + startTime); +} + +MP4Duration MP4File::GetTrackEditDuration( + MP4TrackId trackId, + MP4EditId editId) +{ + return GetIntegerProperty( + MakeTrackEditName(trackId, editId, "segmentDuration")); +} + +void MP4File::SetTrackEditDuration( + MP4TrackId trackId, + MP4EditId editId, + MP4Duration duration) +{ + SetIntegerProperty( + MakeTrackEditName(trackId, editId, "segmentDuration"), + duration); +} + +bool MP4File::GetTrackEditDwell( + MP4TrackId trackId, + MP4EditId editId) +{ + return (GetIntegerProperty( + MakeTrackEditName(trackId, editId, "mediaRate")) == 0); +} + +void MP4File::SetTrackEditDwell( + MP4TrackId trackId, + MP4EditId editId, + bool dwell) +{ + SetIntegerProperty( + MakeTrackEditName(trackId, editId, "mediaRate"), + (dwell ? 0 : 1)); +} + +MP4SampleId MP4File::GetSampleIdFromEditTime( + MP4TrackId trackId, + MP4Timestamp when, + MP4Timestamp* pStartTime, + MP4Duration* pDuration) +{ + return m_pTracks[FindTrackIndex(trackId)]->GetSampleIdFromEditTime( + when, pStartTime, pDuration); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4file.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4file.h @@ -0,0 +1,719 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +#ifndef __MP4_FILE_INCLUDED__ +#define __MP4_FILE_INCLUDED__ + +// forward declarations +class MP4Atom; +class MP4Property; +class MP4Float32Property; +class MP4StringProperty; +class MP4BytesProperty; +class MP4Descriptor; +class MP4DescriptorProperty; + + +#ifdef USE_FILE_CALLBACKS +typedef u_int32_t (*MP4OpenCallback)(const char *pName, const char *mode, void *userData); +typedef void (*MP4CloseCallback)(void *userData); +typedef u_int32_t (*MP4ReadCallback)(void *pBuffer, unsigned int nBytesToRead, void *userData); +typedef u_int32_t (*MP4WriteCallback)(void *pBuffer, unsigned int nBytesToWrite, void *userData); +typedef int32_t (*MP4SetposCallback)(u_int32_t pos, void *userData); +typedef int64_t (*MP4GetposCallback)(void *userData); +typedef int64_t (*MP4FilesizeCallback)(void *userData); +#endif + + +class MP4File { +public: /* equivalent to MP4 library API */ + MP4File(u_int32_t verbosity = 0); + ~MP4File(); + + /* file operations */ + void Read(const char* fileName); + void Create(const char* fileName, bool use64bits); + void Modify(const char* fileName); + void Optimize(const char* orgFileName, + const char* newFileName = NULL); + void Dump(FILE* pDumpFile = NULL, bool dumpImplicits = false); + void Close(); + + /* library property per file */ + + u_int32_t GetVerbosity() { + return m_verbosity; + } + void SetVerbosity(u_int32_t verbosity) { + m_verbosity = verbosity; + } + + bool Use64Bits() { + return m_use64bits; + } + + /* file properties */ + + u_int64_t GetIntegerProperty(const char* name); + float GetFloatProperty(const char* name); + const char* GetStringProperty(const char* name); + void GetBytesProperty(const char* name, + u_int8_t** ppValue, u_int32_t* pValueSize); + + void SetIntegerProperty(const char* name, u_int64_t value); + void SetFloatProperty(const char* name, float value); + void SetStringProperty(const char* name, const char* value); + void SetBytesProperty(const char* name, + const u_int8_t* pValue, u_int32_t valueSize); + + // file level convenience functions + + MP4Duration GetDuration(); + void SetDuration(MP4Duration value); + + u_int32_t GetTimeScale(); + void SetTimeScale(u_int32_t value); + + u_int8_t GetODProfileLevel(); + void SetODProfileLevel(u_int8_t value); + + u_int8_t GetSceneProfileLevel(); + void SetSceneProfileLevel(u_int8_t value); + + u_int8_t GetVideoProfileLevel(); + void SetVideoProfileLevel(u_int8_t value); + + u_int8_t GetAudioProfileLevel(); + void SetAudioProfileLevel(u_int8_t value); + + u_int8_t GetGraphicsProfileLevel(); + void SetGraphicsProfileLevel(u_int8_t value); + + const char* GetSessionSdp(); + void SetSessionSdp(const char* sdpString); + void AppendSessionSdp(const char* sdpString); + + /* track operations */ + + MP4TrackId AddTrack(const char* type, u_int32_t timeScale = 1000); + void DeleteTrack(MP4TrackId trackId); + + u_int32_t GetNumberOfTracks(const char* type = NULL, u_int8_t subType = 0); + + MP4TrackId AllocTrackId(); + MP4TrackId FindTrackId(u_int16_t trackIndex, + const char* type = NULL, u_int8_t subType = 0); + u_int16_t FindTrackIndex(MP4TrackId trackId); + u_int16_t FindTrakAtomIndex(MP4TrackId trackId); + + /* track properties */ + + u_int64_t GetTrackIntegerProperty( + MP4TrackId trackId, const char* name); + float GetTrackFloatProperty( + MP4TrackId trackId, const char* name); + const char* GetTrackStringProperty( + MP4TrackId trackId, const char* name); + void GetTrackBytesProperty( + MP4TrackId trackId, const char* name, + u_int8_t** ppValue, u_int32_t* pValueSize); + + void SetTrackIntegerProperty( + MP4TrackId trackId, const char* name, int64_t value); + void SetTrackFloatProperty( + MP4TrackId trackId, const char* name, float value); + void SetTrackStringProperty( + MP4TrackId trackId, const char* name, const char* value); + void SetTrackBytesProperty( + MP4TrackId trackId, const char* name, + const u_int8_t* pValue, u_int32_t valueSize); + + /* sample operations */ + + u_int32_t GetSampleSize(MP4TrackId trackId, MP4SampleId sampleId); + + u_int32_t GetTrackMaxSampleSize(MP4TrackId trackId); + + MP4SampleId GetSampleIdFromTime(MP4TrackId trackId, + MP4Timestamp when, bool wantSyncSample = false); + + MP4Timestamp GetSampleTime( + MP4TrackId trackId, MP4SampleId sampleId); + + MP4Duration GetSampleDuration( + MP4TrackId trackId, MP4SampleId sampleId); + + MP4Duration GetSampleRenderingOffset( + MP4TrackId trackId, MP4SampleId sampleId); + + bool GetSampleSync( + MP4TrackId trackId, MP4SampleId sampleId); + + void ReadSample( + // input parameters + MP4TrackId trackId, + MP4SampleId sampleId, + // output parameters + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + MP4Timestamp* pStartTime = NULL, + MP4Duration* pDuration = NULL, + MP4Duration* pRenderingOffset = NULL, + bool* pIsSyncSample = NULL); + + void WriteSample( + MP4TrackId trackId, + const u_int8_t* pBytes, + u_int32_t numBytes, + MP4Duration duration = 0, + MP4Duration renderingOffset = 0, + bool isSyncSample = true); + + void SetSampleRenderingOffset( + MP4TrackId trackId, + MP4SampleId sampleId, + MP4Duration renderingOffset); + + /* track level convenience functions */ + + MP4TrackId AddSystemsTrack(const char* type); + + MP4TrackId AddODTrack(); + + MP4TrackId AddSceneTrack(); + + MP4TrackId AddAudioTrack( + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int8_t audioType); + + MP4TrackId AddEncAudioTrack( // ismacrypt + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int8_t audioType); + + MP4TrackId AddVideoTrack( + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + u_int8_t videoType); + + MP4TrackId AddEncVideoTrack( // ismacrypt + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + u_int8_t videoType); + + MP4TrackId AddHintTrack(MP4TrackId refTrackId); + + MP4SampleId GetTrackNumberOfSamples(MP4TrackId trackId); + + const char* GetTrackType(MP4TrackId trackId); + + MP4Duration GetTrackDuration(MP4TrackId trackId); + + u_int32_t GetTrackTimeScale(MP4TrackId trackId); + void SetTrackTimeScale(MP4TrackId trackId, u_int32_t value); + + // replacement to GetTrackAudioType and GetTrackVideoType + u_int8_t GetTrackEsdsObjectTypeId(MP4TrackId trackId); + + u_int8_t GetTrackAudioType(MP4TrackId trackId); + u_int8_t GetTrackAudioMpeg4Type(MP4TrackId trackId); + u_int8_t GetTrackVideoType(MP4TrackId trackId); + + MP4Duration GetTrackFixedSampleDuration(MP4TrackId trackId); + + float GetTrackVideoFrameRate(MP4TrackId trackId); + + void GetTrackESConfiguration(MP4TrackId trackId, + u_int8_t** ppConfig, u_int32_t* pConfigSize); + void SetTrackESConfiguration(MP4TrackId trackId, + const u_int8_t* pConfig, u_int32_t configSize); + + const char* GetHintTrackSdp(MP4TrackId hintTrackId); + void SetHintTrackSdp(MP4TrackId hintTrackId, const char* sdpString); + void AppendHintTrackSdp(MP4TrackId hintTrackId, const char* sdpString); + + // ISMA specific functions + + void MakeIsmaCompliant(bool addIsmaComplianceSdp = true); + + void CreateIsmaIodFromParams( + u_int8_t videoProfile, + u_int32_t videoBitrate, + u_int8_t* videoConfig, + u_int32_t videoConfigLength, + u_int8_t audioProfile, + u_int32_t audioBitrate, + u_int8_t* audioConfig, + u_int32_t audioConfigLength, + u_int8_t** ppBytes, + u_int64_t* pNumBytes); + + // time convenience functions + + u_int64_t ConvertFromMovieDuration( + MP4Duration duration, + u_int32_t timeScale); + + u_int64_t ConvertFromTrackTimestamp( + MP4TrackId trackId, + MP4Timestamp timeStamp, + u_int32_t timeScale); + + MP4Timestamp ConvertToTrackTimestamp( + MP4TrackId trackId, + u_int64_t timeStamp, + u_int32_t timeScale); + + u_int64_t ConvertFromTrackDuration( + MP4TrackId trackId, + MP4Duration duration, + u_int32_t timeScale); + + MP4Duration ConvertToTrackDuration( + MP4TrackId trackId, + u_int64_t duration, + u_int32_t timeScale); + + // specialized operations + + void GetHintTrackRtpPayload( + MP4TrackId hintTrackId, + char** ppPayloadName = NULL, + u_int8_t* pPayloadNumber = NULL, + u_int16_t* pMaxPayloadSize = NULL, + char **ppEncodingParams = NULL); + + void SetHintTrackRtpPayload( + MP4TrackId hintTrackId, + const char* payloadName, + u_int8_t* pPayloadNumber, + u_int16_t maxPayloadSize, + const char *encoding_params, + bool include_rtp_map, + bool include_mpeg4_esid); + + MP4TrackId GetHintTrackReferenceTrackId( + MP4TrackId hintTrackId); + + void ReadRtpHint( + MP4TrackId hintTrackId, + MP4SampleId hintSampleId, + u_int16_t* pNumPackets = NULL); + + u_int16_t GetRtpHintNumberOfPackets( + MP4TrackId hintTrackId); + + int8_t GetRtpPacketBFrame( + MP4TrackId hintTrackId, + u_int16_t packetIndex); + + int32_t GetRtpPacketTransmitOffset( + MP4TrackId hintTrackId, + u_int16_t packetIndex); + + void ReadRtpPacket( + MP4TrackId hintTrackId, + u_int16_t packetIndex, + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + u_int32_t ssrc = 0, + bool includeHeader = true, + bool includePayload = true); + + MP4Timestamp GetRtpTimestampStart( + MP4TrackId hintTrackId); + + void SetRtpTimestampStart( + MP4TrackId hintTrackId, + MP4Timestamp rtpStart); + + void AddRtpHint( + MP4TrackId hintTrackId, + bool isBframe, + u_int32_t timestampOffset); + + void AddRtpPacket( + MP4TrackId hintTrackId, + bool setMbit, + int32_t transmitOffset); + + void AddRtpImmediateData( + MP4TrackId hintTrackId, + const u_int8_t* pBytes, + u_int32_t numBytes); + + void AddRtpSampleData( + MP4TrackId hintTrackId, + MP4SampleId sampleId, + u_int32_t dataOffset, + u_int32_t dataLength); + + void AddRtpESConfigurationPacket( + MP4TrackId hintTrackId); + + void WriteRtpHint( + MP4TrackId hintTrackId, + MP4Duration duration, + bool isSyncSample); + + u_int8_t AllocRtpPayloadNumber(); + + // edit list related + + char* MakeTrackEditName( + MP4TrackId trackId, + MP4EditId editId, + const char* name); + + MP4EditId AddTrackEdit( + MP4TrackId trackId, + MP4EditId editId = MP4_INVALID_EDIT_ID); + + void DeleteTrackEdit( + MP4TrackId trackId, + MP4EditId editId); + + u_int32_t GetTrackNumberOfEdits( + MP4TrackId trackId); + + MP4Timestamp GetTrackEditStart( + MP4TrackId trackId, + MP4EditId editId); + + MP4Duration GetTrackEditTotalDuration( + MP4TrackId trackId, + MP4EditId editId); + + MP4Timestamp GetTrackEditMediaStart( + MP4TrackId trackId, + MP4EditId editId); + + void SetTrackEditMediaStart( + MP4TrackId trackId, + MP4EditId editId, + MP4Timestamp startTime); + + MP4Duration GetTrackEditDuration( + MP4TrackId trackId, + MP4EditId editId); + + void SetTrackEditDuration( + MP4TrackId trackId, + MP4EditId editId, + MP4Duration duration); + + bool GetTrackEditDwell( + MP4TrackId trackId, + MP4EditId editId); + + void SetTrackEditDwell( + MP4TrackId trackId, + MP4EditId editId, + bool dwell); + + MP4SampleId GetSampleIdFromEditTime( + MP4TrackId trackId, + MP4Timestamp when, + MP4Timestamp* pStartTime = NULL, + MP4Duration* pDuration = NULL); + + /* iTunes metadata handling */ + bool CreateMetadataAtom(const char* name); + bool MetadataDelete(); + + /* set metadata */ + bool SetMetadataName(const char* value); + bool SetMetadataWriter(const char* value); + bool SetMetadataAlbum(const char* value); + bool SetMetadataArtist(const char* value); + bool SetMetadataTool(const char* value); + bool SetMetadataComment(const char* value); + bool SetMetadataYear(const char* value); + bool SetMetadataTrack(u_int16_t track, u_int16_t totalTracks); + bool SetMetadataDisk(u_int16_t disk, u_int16_t totalDisks); + bool SetMetadataGenre(const char* genreIndex); + bool SetMetadataTempo(u_int16_t tempo); + bool SetMetadataCompilation(u_int8_t compilation); + bool SetMetadataCoverArt(u_int8_t *coverArt, u_int32_t size); + bool SetMetadataFreeForm(char *name, u_int8_t* pValue, u_int32_t valueSize); + + /* get metadata */ + bool GetMetadataByIndex(u_int32_t index, + const char** ppName, + u_int8_t** ppValue, u_int32_t* pValueSize); + bool GetMetadataName(char** value); + bool GetMetadataWriter(char** value); + bool GetMetadataAlbum(char** value); + bool GetMetadataArtist(char** value); + bool GetMetadataTool(char** value); + bool GetMetadataComment(char** value); + bool GetMetadataYear(char** value); + bool GetMetadataTrack(u_int16_t* track, u_int16_t* totalTracks); + bool GetMetadataDisk(u_int16_t* disk, u_int16_t* totalDisks); + bool GetMetadataGenre(char** genre); + bool GetMetadataTempo(u_int16_t* tempo); + bool GetMetadataCompilation(u_int8_t* compilation); + bool GetMetadataCoverArt(u_int8_t **coverArt, u_int32_t* size); + bool GetMetadataFreeForm(char *name, u_int8_t** pValue, u_int32_t* valueSize); + + + /* end of MP4 API */ + + /* "protected" interface to be used only by friends in library */ + + u_int64_t GetPosition(FILE* pFile = NULL); + void SetPosition(u_int64_t pos, FILE* pFile = NULL); + + u_int64_t GetSize(); + + u_int32_t ReadBytes( + u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile = NULL); + u_int64_t ReadUInt(u_int8_t size); + u_int8_t ReadUInt8(); + u_int16_t ReadUInt16(); + u_int32_t ReadUInt24(); + u_int32_t ReadUInt32(); + u_int64_t ReadUInt64(); + float ReadFixed16(); + float ReadFixed32(); + float ReadFloat(); + char* ReadString(); + char* ReadCountedString( + u_int8_t charSize = 1, bool allowExpandedCount = false); + u_int64_t ReadBits(u_int8_t numBits); + void FlushReadBits(); + u_int32_t ReadMpegLength(); + + u_int32_t PeekBytes( + u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile = NULL); + + void WriteBytes(u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile = NULL); + void WriteUInt(u_int64_t value, u_int8_t size); + void WriteUInt8(u_int8_t value); + void WriteUInt16(u_int16_t value); + void WriteUInt24(u_int32_t value); + void WriteUInt32(u_int32_t value); + void WriteUInt64(u_int64_t value); + void WriteFixed16(float value); + void WriteFixed32(float value); + void WriteFloat(float value); + void WriteString(char* string); + void WriteCountedString(char* string, + u_int8_t charSize = 1, bool allowExpandedCount = false); + void WriteBits(u_int64_t bits, u_int8_t numBits); + void PadWriteBits(u_int8_t pad = 0); + void FlushWriteBits(); + void WriteMpegLength(u_int32_t value, bool compact = false); + + void EnableMemoryBuffer( + u_int8_t* pBytes = NULL, u_int64_t numBytes = 0); + void DisableMemoryBuffer( + u_int8_t** ppBytes = NULL, u_int64_t* pNumBytes = NULL); + + char GetMode() { + return m_mode; + } + + MP4Track* GetTrack(MP4TrackId trackId); + + MP4Duration UpdateDuration(MP4Duration duration); + + MP4Atom* FindAtom(const char* name); + + MP4Atom* AddChildAtom( + const char* parentName, + const char* childName); + + MP4Atom* AddChildAtom( + MP4Atom* pParentAtom, + const char* childName); + + MP4Atom* InsertChildAtom( + const char* parentName, + const char* childName, + u_int32_t index); + + MP4Atom* InsertChildAtom( + MP4Atom* pParentAtom, + const char* childName, + u_int32_t index); + + MP4Atom* AddDescendantAtoms( + const char* ancestorName, + const char* childName); + + MP4Atom* AddDescendantAtoms( + MP4Atom* pAncestorAtom, + const char* childName); + +#ifdef USE_FILE_CALLBACKS + MP4OpenCallback m_MP4fopen; + MP4CloseCallback m_MP4fclose; + MP4ReadCallback m_MP4fread; + MP4WriteCallback m_MP4fwrite; + MP4SetposCallback m_MP4fsetpos; + MP4GetposCallback m_MP4fgetpos; + MP4FilesizeCallback m_MP4filesize; + + void *m_userData; +#endif + +protected: + void Open(const char* fmode); + void ReadFromFile(); + void GenerateTracks(); + void BeginWrite(); + void FinishWrite(); + void CacheProperties(); + void RewriteMdat(FILE* pReadFile, FILE* pWriteFile); + + const char* TempFileName(); + void Rename(const char* existingFileName, const char* newFileName); + + void ProtectWriteOperation(char* where); + + void FindIntegerProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + void FindFloatProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + void FindStringProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + void FindBytesProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + + bool FindProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + + void AddTrackToIod(MP4TrackId trackId); + + void RemoveTrackFromIod(MP4TrackId trackId); + + void AddTrackToOd(MP4TrackId trackId); + + void RemoveTrackFromOd(MP4TrackId trackId); + + void GetTrackReferenceProperties(const char* trefName, + MP4Property** ppCountProperty, MP4Property** ppTrackIdProperty); + + void AddTrackReference(const char* trefName, MP4TrackId refTrackId); + + u_int32_t FindTrackReference(const char* trefName, MP4TrackId refTrackId); + + void RemoveTrackReference(const char* trefName, MP4TrackId refTrackId); + + void AddDataReference(MP4TrackId trackId, const char* url); + + char* MakeTrackName(MP4TrackId trackId, const char* name); + + u_int8_t ConvertTrackTypeToStreamType(const char* trackType); + + void CreateIsmaIodFromFile( + MP4TrackId odTrackId, + MP4TrackId sceneTrackId, + MP4TrackId audioTrackId, + MP4TrackId videoTrackId, + u_int8_t** ppBytes, + u_int64_t* pNumBytes); + + MP4Descriptor* CreateESD( + MP4DescriptorProperty* pEsProperty, + u_int32_t esid, + u_int8_t objectType, + u_int8_t streamType, + u_int32_t bufferSize, + u_int32_t bitrate, + u_int8_t* pConfig, + u_int32_t configLength, + char* url); + + void CreateIsmaODUpdateCommandFromFileForFile( + MP4TrackId odTrackId, + MP4TrackId audioTrackId, + MP4TrackId videoTrackId, + u_int8_t** ppBytes, + u_int64_t* pNumBytes); + + void CreateIsmaODUpdateCommandFromFileForStream( + MP4TrackId audioTrackId, + MP4TrackId videoTrackId, + u_int8_t** ppBytes, + u_int64_t* pNumBytes); + + void CreateIsmaODUpdateCommandForStream( + MP4DescriptorProperty* pAudioEsdProperty, + MP4DescriptorProperty* pVideoEsdProperty, + u_int8_t** ppBytes, + u_int64_t* pNumBytes); + + void CreateIsmaSceneCommand( + bool hasAudio, + bool hasVideo, + u_int8_t** ppBytes, + u_int64_t* pNumBytes); + +protected: + char* m_fileName; + FILE* m_pFile; + u_int64_t m_orgFileSize; + u_int64_t m_fileSize; + MP4Atom* m_pRootAtom; + MP4Integer32Array m_trakIds; + MP4TrackArray m_pTracks; + MP4TrackId m_odTrackId; + u_int32_t m_verbosity; + char m_mode; + bool m_use64bits; + bool m_useIsma; + + // cached properties + MP4IntegerProperty* m_pModificationProperty; + MP4Integer32Property* m_pTimeScaleProperty; + MP4IntegerProperty* m_pDurationProperty; + + // read/write in memory + u_int8_t* m_memoryBuffer; + u_int64_t m_memoryBufferPosition; + u_int64_t m_memoryBufferSize; + + // bit read/write buffering + u_int8_t m_numReadBits; + u_int8_t m_bufReadBits; + u_int8_t m_numWriteBits; + u_int8_t m_bufWriteBits; + +#ifdef USE_FILE_CALLBACKS + static u_int32_t MP4fopen_cb(const char *pName, const char *mode, void *userData); + static void MP4fclose_cb(void *userData); + static u_int32_t MP4fread_cb(void *pBuffer, unsigned int nBytesToRead, void *userData); + static u_int32_t MP4fwrite_cb(void *pBuffer, unsigned int nBytesToWrite, void *userData); + static int32_t MP4fsetpos_cb(u_int32_t pos, void *userData); + static int64_t MP4fgetpos_cb(void *userData); + static int64_t MP4filesize_cb(void *userData); +#endif +}; + +#endif /* __MP4_FILE_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4file_io.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4file_io.cpp @@ -0,0 +1,655 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +#ifdef HAVE_FPOS_T_POS +#define FPOS_TO_UINT64(x) ((u_int64_t)((x).__pos)) +#define UINT64_TO_FPOS(x, y) ((x).__pos = (y)) +#else +#define FPOS_TO_UINT64(x) ((u_int64_t)(x)) +#define UINT64_TO_FPOS(x, y) ((x) = (fpos)(y)) +#endif + +// MP4File low level IO support + +u_int64_t MP4File::GetPosition(FILE* pFile) +{ + if (m_memoryBuffer == NULL) { +#ifndef USE_FILE_CALLBACKS + fpos_t fpos; + if (pFile == NULL) { + ASSERT(m_pFile); + pFile = m_pFile; + } + + if (fgetpos(pFile, &fpos) < 0) { + throw new MP4Error(errno, "MP4GetPosition"); + } + return FPOS_TO_UINT64(fpos); +#else + + u_int64_t pos; + if ((pos = m_MP4fgetpos(m_userData)) < 0) { + throw new MP4Error(errno, "MP4GetPosition"); + } + return (u_int64_t)pos; +#endif + } else { + return m_memoryBufferPosition; + } +} + +void MP4File::SetPosition(u_int64_t pos, FILE* pFile) +{ + if (m_memoryBuffer == NULL) { +#ifndef USE_FILE_CALLBACKS + if (pFile == NULL) { + ASSERT(m_pFile); + pFile = m_pFile; + } + + fpos_t fpos; + VAR_TO_FPOS(fpos, pos); + if (fsetpos(pFile, &fpos) < 0) { + throw new MP4Error(errno, "MP4SetPosition"); + } +#else + if (m_MP4fsetpos(pos, m_userData) < 0) { + throw new MP4Error(errno, "MP4SetPosition"); + } +#endif + } else { + if (pos >= m_memoryBufferSize) { + // abort(); + throw new MP4Error("position out of range", "MP4SetPosition"); + } + m_memoryBufferPosition = pos; + } +} + +u_int64_t MP4File::GetSize() +{ + if (m_mode == 'w') { + // we're always positioned at the end of file in write mode + // except for short intervals in ReadSample and FinishWrite routines + // so we rely on the faster approach of GetPosition() + // instead of flushing to disk, and then stat'ing the file + m_fileSize = GetPosition(); + } // else read mode, fileSize was determined at Open() + + return m_fileSize; +} + +u_int32_t MP4File::ReadBytes(u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile) +{ + // handle degenerate cases + if (numBytes == 0) { + return 0; + } + + ASSERT(pBytes); + WARNING(m_numReadBits > 0); + +#ifndef USE_FILE_CALLBACKS + if (pFile == NULL) { + pFile = m_pFile; + } + ASSERT(pFile); +#endif + + if (m_memoryBuffer == NULL) { +#ifndef USE_FILE_CALLBACKS + if (fread(pBytes, 1, numBytes, pFile) != numBytes) { + if (feof(pFile)) { + throw new MP4Error( + "not enough bytes, reached end-of-file", + "MP4ReadBytes"); + } else { +#else + if (m_MP4fread(pBytes, numBytes, m_userData) != numBytes) { + { +#endif + throw new MP4Error(errno, "MP4ReadBytes"); + } + } + } else { + if (m_memoryBufferPosition + numBytes > m_memoryBufferSize) { + throw new MP4Error( + "not enough bytes, reached end-of-memory", + "MP4ReadBytes"); + } + memcpy(pBytes, &m_memoryBuffer[m_memoryBufferPosition], numBytes); + m_memoryBufferPosition += numBytes; + } + return numBytes; +} + +u_int32_t MP4File::PeekBytes(u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile) +{ + u_int64_t pos = GetPosition(pFile); + ReadBytes(pBytes, numBytes, pFile); + SetPosition(pos, pFile); + return numBytes; +} + +void MP4File::EnableMemoryBuffer(u_int8_t* pBytes, u_int64_t numBytes) +{ + ASSERT(m_memoryBuffer == NULL); + + if (pBytes) { + m_memoryBuffer = pBytes; + m_memoryBufferSize = numBytes; + } else { + if (numBytes) { + m_memoryBufferSize = numBytes; + } else { + m_memoryBufferSize = 4096; + } + m_memoryBuffer = (u_int8_t*)MP4Malloc(m_memoryBufferSize); + } + m_memoryBufferPosition = 0; +} + +void MP4File::DisableMemoryBuffer(u_int8_t** ppBytes, u_int64_t* pNumBytes) +{ + ASSERT(m_memoryBuffer != NULL); + + if (ppBytes) { + *ppBytes = m_memoryBuffer; + } + if (pNumBytes) { + *pNumBytes = m_memoryBufferPosition; + } + + m_memoryBuffer = NULL; + m_memoryBufferSize = 0; + m_memoryBufferPosition = 0; +} + +void MP4File::WriteBytes(u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile) +{ + ASSERT(m_numWriteBits == 0 || m_numWriteBits >= 8); + + if (pBytes == NULL || numBytes == 0) { + return; + } + + if (m_memoryBuffer == NULL) { +#ifndef USE_FILE_CALLBACKS + if (pFile == NULL) { + ASSERT(m_pFile); + pFile = m_pFile; + } + + u_int32_t rc = fwrite(pBytes, 1, numBytes, pFile); +#else + u_int32_t rc = m_MP4fwrite(pBytes, numBytes, m_userData); +#endif + if (rc != numBytes) { + throw new MP4Error(errno, "MP4WriteBytes"); + } + } else { + if (m_memoryBufferPosition + numBytes > m_memoryBufferSize) { + m_memoryBufferSize = 2 * (m_memoryBufferSize + numBytes); + m_memoryBuffer = (u_int8_t*) + MP4Realloc(m_memoryBuffer, m_memoryBufferSize); + } + memcpy(&m_memoryBuffer[m_memoryBufferPosition], pBytes, numBytes); + m_memoryBufferPosition += numBytes; + } +} + +u_int64_t MP4File::ReadUInt(u_int8_t size) +{ + switch (size) { + case 1: + return ReadUInt8(); + case 2: + return ReadUInt16(); + case 3: + return ReadUInt24(); + case 4: + return ReadUInt32(); + case 8: + return ReadUInt64(); + default: + ASSERT(false); + return 0; + } +} + +void MP4File::WriteUInt(u_int64_t value, u_int8_t size) +{ + switch (size) { + case 1: + WriteUInt8(value); + case 2: + WriteUInt16(value); + case 3: + WriteUInt24(value); + case 4: + WriteUInt32(value); + case 8: + WriteUInt64(value); + default: + ASSERT(false); + } +} + +u_int8_t MP4File::ReadUInt8() +{ + u_int8_t data; + ReadBytes(&data, 1); + return data; +} + +void MP4File::WriteUInt8(u_int8_t value) +{ + WriteBytes(&value, 1); +} + +u_int16_t MP4File::ReadUInt16() +{ + u_int8_t data[2]; + ReadBytes(&data[0], 2); + return ((data[0] << 8) | data[1]); +} + +void MP4File::WriteUInt16(u_int16_t value) +{ + u_int8_t data[2]; + data[0] = (value >> 8) & 0xFF; + data[1] = value & 0xFF; + WriteBytes(data, 2); +} + +u_int32_t MP4File::ReadUInt24() +{ + u_int8_t data[3]; + ReadBytes(&data[0], 3); + return ((data[0] << 16) | (data[1] << 8) | data[2]); +} + +void MP4File::WriteUInt24(u_int32_t value) +{ + u_int8_t data[3]; + data[0] = (value >> 16) & 0xFF; + data[1] = (value >> 8) & 0xFF; + data[2] = value & 0xFF; + WriteBytes(data, 3); +} + +u_int32_t MP4File::ReadUInt32() +{ + u_int8_t data[4]; + ReadBytes(&data[0], 4); + return ((data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]); +} + +void MP4File::WriteUInt32(u_int32_t value) +{ + u_int8_t data[4]; + data[0] = (value >> 24) & 0xFF; + data[1] = (value >> 16) & 0xFF; + data[2] = (value >> 8) & 0xFF; + data[3] = value & 0xFF; + WriteBytes(data, 4); +} + +u_int64_t MP4File::ReadUInt64() +{ + u_int8_t data[8]; + u_int64_t result = 0; + u_int64_t temp; + + ReadBytes(&data[0], 8); + + for (int i = 0; i < 8; i++) { + temp = data[i]; + result |= temp << ((7 - i) * 8); + } + return result; +} + +void MP4File::WriteUInt64(u_int64_t value) +{ + u_int8_t data[8]; + + for (int i = 7; i >= 0; i--) { + data[i] = value & 0xFF; + value >>= 8; + } + WriteBytes(data, 8); +} + +float MP4File::ReadFixed16() +{ + u_int8_t iPart = ReadUInt8(); + u_int8_t fPart = ReadUInt8(); + + return iPart + (((float)fPart) / 0x100); +} + +void MP4File::WriteFixed16(float value) +{ + if (value >= 0x100) { + throw new MP4Error(ERANGE, "MP4WriteFixed16"); + } + + u_int8_t iPart = (u_int8_t)value; + u_int8_t fPart = (u_int8_t)((value - iPart) * 0x100); + + WriteUInt8(iPart); + WriteUInt8(fPart); +} + +float MP4File::ReadFixed32() +{ + u_int16_t iPart = ReadUInt16(); + u_int16_t fPart = ReadUInt16(); + + return iPart + (((float)fPart) / 0x10000); +} + +void MP4File::WriteFixed32(float value) +{ + if (value >= 0x10000) { + throw new MP4Error(ERANGE, "MP4WriteFixed32"); + } + + u_int16_t iPart = (u_int16_t)value; + u_int16_t fPart = (u_int16_t)((value - iPart) * 0x10000); + + WriteUInt16(iPart); + WriteUInt16(fPart); +} + +float MP4File::ReadFloat() +{ + union { + float f; + u_int32_t i; + } u; + + u.i = ReadUInt32(); + return u.f; +} + +void MP4File::WriteFloat(float value) +{ + union { + float f; + u_int32_t i; + } u; + + u.f = value; + WriteUInt32(u.i); +} + +char* MP4File::ReadString() +{ + u_int32_t length = 0; + u_int32_t alloced = 64; + char* data = (char*)MP4Malloc(alloced); + + do { + if (length == alloced) { + data = (char*)MP4Realloc(data, alloced * 2); + } + ReadBytes((u_int8_t*)&data[length], 1); + length++; + } while (data[length - 1] != 0); + + data = (char*)MP4Realloc(data, length); + return data; +} + +void MP4File::WriteString(char* string) +{ + if (string == NULL) { + static u_int8_t zero = 0; + WriteBytes(&zero, 1); + } else { + WriteBytes((u_int8_t*)string, strlen(string) + 1); + } +} + +char* MP4File::ReadCountedString(u_int8_t charSize, bool allowExpandedCount) +{ + u_int32_t charLength; + if (allowExpandedCount) { + u_int8_t b; + charLength = 0; + do { + b = ReadUInt8(); + charLength += b; + } while (b == 255); + } else { + charLength = ReadUInt8(); + } + + u_int32_t byteLength = charLength * charSize; + char* data = (char*)MP4Malloc(byteLength + 1); + if (byteLength > 0) { + ReadBytes((u_int8_t*)data, byteLength); + } + data[byteLength] = '\0'; + return data; +} + +void MP4File::WriteCountedString(char* string, + u_int8_t charSize, bool allowExpandedCount) +{ + u_int32_t byteLength; + if (string) { + byteLength = strlen(string); + } else { + byteLength = 0; + } + u_int32_t charLength = byteLength / charSize; + + if (allowExpandedCount) { + while (charLength >= 0xFF) { + WriteUInt8(0xFF); + charLength -= 0xFF; + } + WriteUInt8(charLength); + } else { + if (charLength > 255) { + throw new MP4Error(ERANGE, "Length is %d", "MP4WriteCountedString", charLength); + } + WriteUInt8(charLength); + } + + if (byteLength > 0) { + WriteBytes((u_int8_t*)string, byteLength); + } +} + +u_int64_t MP4File::ReadBits(u_int8_t numBits) +{ + ASSERT(numBits > 0); + ASSERT(numBits <= 64); + + u_int64_t bits = 0; + + for (u_int8_t i = numBits; i > 0; i--) { + if (m_numReadBits == 0) { + ReadBytes(&m_bufReadBits, 1); + m_numReadBits = 8; + } + bits = (bits << 1) | ((m_bufReadBits >> (--m_numReadBits)) & 1); + } + + return bits; +} + +void MP4File::FlushReadBits() +{ + // eat any remaining bits in the read buffer + m_numReadBits = 0; +} + +void MP4File::WriteBits(u_int64_t bits, u_int8_t numBits) +{ + ASSERT(numBits <= 64); + + for (u_int8_t i = numBits; i > 0; i--) { + m_bufWriteBits |= + (((bits >> (i - 1)) & 1) << (8 - ++m_numWriteBits)); + + if (m_numWriteBits == 8) { + FlushWriteBits(); + } + } +} + +void MP4File::PadWriteBits(u_int8_t pad) +{ + if (m_numWriteBits) { + WriteBits(pad ? 0xFF : 0x00, 8 - m_numWriteBits); + } +} + +void MP4File::FlushWriteBits() +{ + if (m_numWriteBits > 0) { + WriteBytes(&m_bufWriteBits, 1); + m_numWriteBits = 0; + m_bufWriteBits = 0; + } +} + +u_int32_t MP4File::ReadMpegLength() +{ + u_int32_t length = 0; + u_int8_t numBytes = 0; + u_int8_t b; + + do { + b = ReadUInt8(); + length = (length << 7) | (b & 0x7F); + numBytes++; + } while ((b & 0x80) && numBytes < 4); + + return length; +} + +void MP4File::WriteMpegLength(u_int32_t value, bool compact) +{ + if (value > 0x0FFFFFFF) { + throw new MP4Error(ERANGE, "MP4WriteMpegLength"); + } + + int8_t numBytes; + + if (compact) { + if (value <= 0x7F) { + numBytes = 1; + } else if (value <= 0x3FFF) { + numBytes = 2; + } else if (value <= 0x1FFFFF) { + numBytes = 3; + } else { + numBytes = 4; + } + } else { + numBytes = 4; + } + + int8_t i = numBytes; + do { + i--; + u_int8_t b = (value >> (i * 7)) & 0x7F; + if (i > 0) { + b |= 0x80; + } + WriteUInt8(b); + } while (i > 0); +} + +#ifdef USE_FILE_CALLBACKS +u_int32_t MP4File::MP4fopen_cb(const char *pName, + const char *mode, void *userData) +{ + MP4File *myFile = (MP4File*)userData; + + myFile->m_pFile = fopen(pName, mode); + if (myFile->m_pFile == NULL) + return 0; + + return 1; +} + +void MP4File::MP4fclose_cb(void *userData) +{ + MP4File *myFile = (MP4File*)userData; + + fclose(myFile->m_pFile); + myFile->m_pFile = NULL; +} + +u_int32_t MP4File::MP4fread_cb(void *pBuffer, unsigned int nBytesToRead, + void *userData) +{ + MP4File *myFile = (MP4File*)userData; + + return fread(pBuffer, 1, nBytesToRead, myFile->m_pFile); +} + +u_int32_t MP4File::MP4fwrite_cb(void *pBuffer, unsigned int nBytesToWrite, + void *userData) +{ + MP4File *myFile = (MP4File*)userData; + + return fwrite(pBuffer, 1, nBytesToWrite, myFile->m_pFile); +} + +int64_t MP4File::MP4fgetpos_cb(void *userData) +{ + fpos_t fpos; + MP4File *myFile = (MP4File*)userData; + + if (fgetpos(myFile->m_pFile, &fpos) < 0) + return -1; + return FPOS_TO_UINT64(fpos); +} + +int32_t MP4File::MP4fsetpos_cb(u_int32_t pos, void *userData) +{ + fpos_t fpos; + MP4File *myFile = (MP4File*)userData; + + VAR_TO_FPOS(fpos, pos); + return fsetpos(myFile->m_pFile, &fpos); +} + +int64_t MP4File::MP4filesize_cb(void *userData) +{ + struct stat s; + MP4File *myFile = (MP4File*)userData; + + if (fstat(fileno(myFile->m_pFile), &s) < 0) + return -1; + return s.st_size; +} +#endif --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4info.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4info.cpp @@ -0,0 +1,341 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001-2002. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +#include "mp4common.h" + +static char* PrintAudioInfo( + MP4FileHandle mp4File, + MP4TrackId trackId) +{ + static const char* mpeg4AudioNames[] = { + "MPEG-4 Main @ L1", + "MPEG-4 Main @ L2", + "MPEG-4 Main @ L3", + "MPEG-4 Main @ L4", + "MPEG-4 Scalable @ L1", + "MPEG-4 Scalable @ L2", + "MPEG-4 Scalable @ L3", + "MPEG-4 Scalable @ L4", + "MPEG-4 Speech @ L1", + "MPEG-4 Speech @ L2", + "MPEG-4 Synthesis @ L1", + "MPEG-4 Synthesis @ L2", + "MPEG-4 Synthesis @ L3", + }; + static u_int8_t numMpeg4AudioTypes = + sizeof(mpeg4AudioNames) / sizeof(char*); + + static u_int8_t mpegAudioTypes[] = { + MP4_MPEG2_AAC_MAIN_AUDIO_TYPE, // 0x66 + MP4_MPEG2_AAC_LC_AUDIO_TYPE, // 0x67 + MP4_MPEG2_AAC_SSR_AUDIO_TYPE, // 0x68 + MP4_MPEG2_AUDIO_TYPE, // 0x69 + MP4_MPEG1_AUDIO_TYPE, // 0x6B + MP4_PCM16_LITTLE_ENDIAN_AUDIO_TYPE, + MP4_VORBIS_AUDIO_TYPE, + MP4_ALAW_AUDIO_TYPE, + MP4_ULAW_AUDIO_TYPE, + MP4_G723_AUDIO_TYPE, + MP4_PCM16_BIG_ENDIAN_AUDIO_TYPE, + }; + static const char* mpegAudioNames[] = { + "MPEG-2 AAC Main", + "MPEG-2 AAC LC", + "MPEG-2 AAC SSR", + "MPEG-2 (MP3)", + "MPEG-1 (MP3)", + "PCM16 (little endian)", + "Vorbis", + "G.711 aLaw", + "G.711 uLaw", + "G.723.1", + "PCM16 (big endian)", + }; + static u_int8_t numMpegAudioTypes = + sizeof(mpegAudioTypes) / sizeof(u_int8_t); + + u_int8_t type = + MP4GetTrackEsdsObjectTypeId(mp4File, trackId); + const char* typeName = "Unknown"; + + if (type == MP4_MPEG4_AUDIO_TYPE) { + type = MP4GetAudioProfileLevel(mp4File); + if (type > 0 && type <= numMpeg4AudioTypes) { + typeName = mpeg4AudioNames[type - 1]; + } else { + typeName = "MPEG-4"; + } + } else { + for (u_int8_t i = 0; i < numMpegAudioTypes; i++) { + if (type == mpegAudioTypes[i]) { + typeName = mpegAudioNames[i]; + break; + } + } + } + + u_int32_t timeScale = + MP4GetTrackTimeScale(mp4File, trackId); + + MP4Duration trackDuration = + MP4GetTrackDuration(mp4File, trackId); + + double msDuration = + UINT64_TO_DOUBLE(MP4ConvertFromTrackDuration(mp4File, trackId, + trackDuration, MP4_MSECS_TIME_SCALE)); + + u_int32_t avgBitRate = + MP4GetTrackBitRate(mp4File, trackId); + + char *sInfo = (char*)MP4Malloc(256); + + // type duration avgBitrate samplingFrequency + sprintf(sInfo, + "%u\taudio\t%s, %.3f secs, %u kbps, %u Hz\n", + trackId, + typeName, + msDuration / 1000.0, + (avgBitRate + 500) / 1000, + timeScale); + + return sInfo; +} + +static char* PrintVideoInfo( + MP4FileHandle mp4File, + MP4TrackId trackId) +{ + static const char* mpeg4VideoNames[] = { + "MPEG-4 Simple @ L3", + "MPEG-4 Simple @ L2", + "MPEG-4 Simple @ L1", + "MPEG-4 Simple Scalable @ L2", + "MPEG-4 Simple Scalable @ L1", + "MPEG-4 Core @ L2", + "MPEG-4 Core @ L1", + "MPEG-4 Main @ L4", + "MPEG-4 Main @ L3", + "MPEG-4 Main @ L2", + "MPEG-4 Main @ L1", + "MPEG-4 N-Bit @ L2", + "MPEG-4 Hybrid @ L2", + "MPEG-4 Hybrid @ L1", + "MPEG-4 Hybrid @ L1", + }; + static u_int8_t numMpeg4VideoTypes = + sizeof(mpeg4VideoNames) / sizeof(char*); + + static u_int8_t mpegVideoTypes[] = { + MP4_MPEG2_SIMPLE_VIDEO_TYPE, // 0x60 + MP4_MPEG2_MAIN_VIDEO_TYPE, // 0x61 + MP4_MPEG2_SNR_VIDEO_TYPE, // 0x62 + MP4_MPEG2_SPATIAL_VIDEO_TYPE, // 0x63 + MP4_MPEG2_HIGH_VIDEO_TYPE, // 0x64 + MP4_MPEG2_442_VIDEO_TYPE, // 0x65 + MP4_MPEG1_VIDEO_TYPE, // 0x6A + MP4_JPEG_VIDEO_TYPE, // 0x6C + MP4_YUV12_VIDEO_TYPE, + MP4_H264_VIDEO_TYPE, + MP4_H263_VIDEO_TYPE, + MP4_H261_VIDEO_TYPE, + }; + static const char* mpegVideoNames[] = { + "MPEG-2 Simple", + "MPEG-2 Main", + "MPEG-2 SNR", + "MPEG-2 Spatial", + "MPEG-2 High", + "MPEG-2 4:2:2", + "MPEG-1", + "JPEG", + "YUV12", + "H.264", + "H.263", + "H.261", + }; + static u_int8_t numMpegVideoTypes = + sizeof(mpegVideoTypes) / sizeof(u_int8_t); + + u_int8_t type = + MP4GetTrackEsdsObjectTypeId(mp4File, trackId); + const char* typeName = "Unknown"; + + if (type == MP4_MPEG4_VIDEO_TYPE) { + type = MP4GetVideoProfileLevel(mp4File); + if (type > 0 && type <= numMpeg4VideoTypes) { + typeName = mpeg4VideoNames[type - 1]; + } else { + typeName = "MPEG-4"; + } + } else { + for (u_int8_t i = 0; i < numMpegVideoTypes; i++) { + if (type == mpegVideoTypes[i]) { + typeName = mpegVideoNames[i]; + break; + } + } + } + + MP4Duration trackDuration = + MP4GetTrackDuration(mp4File, trackId); + + double msDuration = + UINT64_TO_DOUBLE(MP4ConvertFromTrackDuration(mp4File, trackId, + trackDuration, MP4_MSECS_TIME_SCALE)); + + u_int32_t avgBitRate = + MP4GetTrackBitRate(mp4File, trackId); + + // Note not all mp4 implementations set width and height correctly + // The real answer can be buried inside the ES configuration info + u_int16_t width = MP4GetTrackVideoWidth(mp4File, trackId); + + u_int16_t height = MP4GetTrackVideoHeight(mp4File, trackId); + + float fps = MP4GetTrackVideoFrameRate(mp4File, trackId); + + char *sInfo = (char*)MP4Malloc(256); + + // type duration avgBitrate frameSize frameRate + sprintf(sInfo, + "%u\tvideo\t%s, %.3f secs, %u kbps, %ux%u @ %.2f fps\n", + trackId, + typeName, + msDuration / 1000.0, + (avgBitRate + 500) / 1000, + width, + height, + fps + ); + + return sInfo; +} + +static char* PrintHintInfo( + MP4FileHandle mp4File, + MP4TrackId trackId) +{ + MP4TrackId referenceTrackId = + MP4GetHintTrackReferenceTrackId(mp4File, trackId); + + char* payloadName = NULL; + MP4GetHintTrackRtpPayload(mp4File, trackId, &payloadName); + + char *sInfo = (char*)MP4Malloc(256); + + sprintf(sInfo, + "%u\thint\tPayload %s for track %u\n", + trackId, + payloadName, + referenceTrackId); + + free(payloadName); + + return sInfo; +} + +static char* PrintTrackInfo( + MP4FileHandle mp4File, + MP4TrackId trackId) +{ + char* trackInfo = NULL; + + const char* trackType = + MP4GetTrackType(mp4File, trackId); + + if (!strcmp(trackType, MP4_AUDIO_TRACK_TYPE)) { + trackInfo = PrintAudioInfo(mp4File, trackId); + } else if (!strcmp(trackType, MP4_VIDEO_TRACK_TYPE)) { + trackInfo = PrintVideoInfo(mp4File, trackId); + } else if (!strcmp(trackType, MP4_HINT_TRACK_TYPE)) { + trackInfo = PrintHintInfo(mp4File, trackId); + } else { + trackInfo = (char*)MP4Malloc(256); + if (!strcmp(trackType, MP4_OD_TRACK_TYPE)) { + sprintf(trackInfo, + "%u\tod\tObject Descriptors\n", + trackId); + } else if (!strcmp(trackType, MP4_SCENE_TRACK_TYPE)) { + sprintf(trackInfo, + "%u\tscene\tBIFS\n", + trackId); + } else { + sprintf(trackInfo, + "%u\t%s\n", + trackId, trackType); + } + } + + return trackInfo; +} + +extern "C" char* MP4Info( + MP4FileHandle mp4File, + MP4TrackId trackId) +{ + char* info = NULL; + + if (MP4_IS_VALID_FILE_HANDLE(mp4File)) { + try { + if (trackId == MP4_INVALID_TRACK_ID) { + info = (char*)MP4Calloc(4*1024); + + sprintf(info, "Track\tType\tInfo\n"); + + u_int32_t numTracks = MP4GetNumberOfTracks(mp4File); + + for (u_int32_t i = 0; i < numTracks; i++) { + trackId = MP4FindTrackId(mp4File, i); + char* trackInfo = PrintTrackInfo(mp4File, trackId); + strcat(info, trackInfo); + MP4Free(trackInfo); + } + } else { + info = PrintTrackInfo(mp4File, trackId); + } + } + catch (MP4Error* e) { + delete e; + } + } + + return info; +} + +extern "C" char* MP4FileInfo( + const char* fileName, + MP4TrackId trackId) +{ + MP4FileHandle mp4File = + MP4Read(fileName); + + if (!mp4File) { + return NULL; + } + + char* info = MP4Info(mp4File, trackId); + + MP4Close(mp4File); + + return info; // caller should free this +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4meta.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4meta.cpp @@ -0,0 +1,987 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * M. Bakker mbakker at nero.com + * + * Apple iTunes Metadata handling + */ + +/** + + The iTunes tagging seems to support any tag field name + but there are some predefined fields, also known from the QuickTime format + + predefined fields (the ones I know of until now): + - ©nam : Name of the song/movie (string) + - ©ART : Name of the artist/performer (string) + - ©wrt : Name of the writer (string) + - ©alb : Name of the album (string) + - ©day : Year (4 bytes, e.g. "2003") (string) + - ©too : Tool(s) used to create the file (string) + - ©cmt : Comment (string) + - ©gen : Custom genre (string) + - trkn : Tracknumber (8 byte string) + 16 bit: empty + 16 bit: tracknumber + 16 bit: total tracks on album + 16 bit: empty + - disk : Disknumber (8 byte string) + 16 bit: empty + 16 bit: disknumber + 16 bit: total number of disks + 16 bit: empty + - gnre : Genre (16 bit genre) (ID3v1 index + 1) + - cpil : Part of a compilation (1 byte, 1 or 0) + - tmpo : Tempo in BPM (16 bit) + - covr : Cover art (xx bytes binary data) + - ---- : Free form metadata, can have any name and any data + +**/ + +#include "mp4common.h" + +bool MP4File::GetMetadataByIndex(u_int32_t index, + const char** ppName, + u_int8_t** ppValue, u_int32_t* pValueSize) +{ + char s[256]; + + sprintf(s, "moov.udta.meta.ilst.*[%u].data.metadata", index); + GetBytesProperty(s, ppValue, pValueSize); + + sprintf(s, "moov.udta.meta.ilst.*[%u]", index); + MP4Atom* pParent = m_pRootAtom->FindAtom(s); + *ppName = pParent->GetType(); + + /* check for free form tagfield */ + if (memcmp(*ppName, "----", 4) == 0) + { + u_int8_t* pV; + u_int32_t VSize = 0; + char *pN; + + sprintf(s, "moov.udta.meta.ilst.*[%u].name.metadata", index); + GetBytesProperty(s, &pV, &VSize); + + pN = (char*)malloc((VSize+1)*sizeof(char)); + memset(pN, 0, (VSize+1)*sizeof(char)); + memcpy(pN, pV, VSize*sizeof(char)); + + *ppName = pN; + } + + return true; +} + +bool MP4File::CreateMetadataAtom(const char* name) +{ + char s[256]; + char t[256]; + + sprintf(t, "udta.meta.ilst.%s.data", name); + sprintf(s, "moov.udta.meta.ilst.%s.data", name); + AddDescendantAtoms("moov", t); + MP4Atom *pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + return false; + + /* some fields need special flags set */ + if (name[0] == '©') + { + pMetaAtom->SetFlags(0x1); + } else if ((memcmp(name, "cpil", 4) == 0) || (memcmp(name, "tmpo", 4) == 0)) { + pMetaAtom->SetFlags(0xF); + } + + MP4Atom *pHdlrAtom = m_pRootAtom->FindAtom("moov.udta.meta.hdlr"); + MP4StringProperty *pStringProperty = NULL; + MP4BytesProperty *pBytesProperty = NULL; + ASSERT(pHdlrAtom); + + pHdlrAtom->FindProperty( + "hdlr.handlerType", (MP4Property**)&pStringProperty); + ASSERT(pStringProperty); + pStringProperty->SetValue("mdir"); + + u_int8_t val[12]; + memset(val, 0, 12*sizeof(u_int8_t)); + val[0] = 0x61; + val[1] = 0x70; + val[2] = 0x70; + val[3] = 0x6c; + pHdlrAtom->FindProperty( + "hdlr.reserved2", (MP4Property**)&pBytesProperty); + ASSERT(pBytesProperty); + pBytesProperty->SetReadOnly(false); + pBytesProperty->SetValue(val, 12); + pBytesProperty->SetReadOnly(true); + + return true; +} + +bool MP4File::SetMetadataName(const char* value) +{ + const char *s = "moov.udta.meta.ilst.©nam.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("©nam")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); + + return true; +} + +bool MP4File::GetMetadataName(char** value) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.©nam.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + if (valSize > 0) + { + *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); + memset(*value, 0, (valSize+1)*sizeof(unsigned char)); + memcpy(*value, val, valSize*sizeof(unsigned char)); + return true; + } else { + *value = NULL; + return false; + } +} + +bool MP4File::SetMetadataWriter(const char* value) +{ + const char *s = "moov.udta.meta.ilst.©wrt.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("©wrt")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); + + return true; +} + +bool MP4File::GetMetadataWriter(char** value) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.©wrt.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + if (valSize > 0) + { + *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); + memset(*value, 0, (valSize+1)*sizeof(unsigned char)); + memcpy(*value, val, valSize*sizeof(unsigned char)); + return true; + } else { + *value = NULL; + return false; + } +} + +bool MP4File::SetMetadataAlbum(const char* value) +{ + const char *s = "moov.udta.meta.ilst.©alb.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("©alb")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); + + return true; +} + +bool MP4File::GetMetadataAlbum(char** value) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.©alb.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + if (valSize > 0) + { + *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); + memset(*value, 0, (valSize+1)*sizeof(unsigned char)); + memcpy(*value, val, valSize*sizeof(unsigned char)); + return true; + } else { + *value = NULL; + return false; + } +} + +bool MP4File::SetMetadataArtist(const char* value) +{ + const char *s = "moov.udta.meta.ilst.©ART.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("©ART")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); + + return true; +} + +bool MP4File::GetMetadataArtist(char** value) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.©ART.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + if (valSize > 0) + { + *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); + memset(*value, 0, (valSize+1)*sizeof(unsigned char)); + memcpy(*value, val, valSize*sizeof(unsigned char)); + return true; + } else { + *value = NULL; + return false; + } +} + +bool MP4File::SetMetadataTool(const char* value) +{ + const char *s = "moov.udta.meta.ilst.©too.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("©too")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); + + return true; +} + +bool MP4File::GetMetadataTool(char** value) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.©too.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + if (valSize > 0) + { + *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); + memset(*value, 0, (valSize+1)*sizeof(unsigned char)); + memcpy(*value, val, valSize*sizeof(unsigned char)); + return true; + } else { + *value = NULL; + return false; + } +} + +bool MP4File::SetMetadataComment(const char* value) +{ + const char *s = "moov.udta.meta.ilst.©cmt.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("©cmt")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); + + return true; +} + +bool MP4File::GetMetadataComment(char** value) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.©cmt.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + if (valSize > 0) + { + *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); + memset(*value, 0, (valSize+1)*sizeof(unsigned char)); + memcpy(*value, val, valSize*sizeof(unsigned char)); + return true; + } else { + *value = NULL; + return false; + } +} + +bool MP4File::SetMetadataYear(const char* value) +{ + const char *s = "moov.udta.meta.ilst.©day.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("©day")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + if (strlen(value) < 4) + return false; + + pMetadataProperty->SetValue((u_int8_t*)value, 4); + + return true; +} + +bool MP4File::GetMetadataYear(char** value) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.©day.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + if (valSize > 0) + { + *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); + memset(*value, 0, (valSize+1)*sizeof(unsigned char)); + memcpy(*value, val, valSize*sizeof(unsigned char)); + return true; + } else { + *value = NULL; + return false; + } +} + +bool MP4File::SetMetadataTrack(u_int16_t track, u_int16_t totalTracks) +{ + unsigned char t[9]; + const char *s = "moov.udta.meta.ilst.trkn.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("trkn")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + memset(t, 0, 9*sizeof(unsigned char)); + t[2] = (unsigned char)(track>>8)&0xFF; + t[3] = (unsigned char)(track)&0xFF; + t[4] = (unsigned char)(totalTracks>>8)&0xFF; + t[5] = (unsigned char)(totalTracks)&0xFF; + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)t, 8); + + return true; +} + +bool MP4File::GetMetadataTrack(u_int16_t* track, u_int16_t* totalTracks) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.trkn.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + *track = 0; + *totalTracks = 0; + + if (valSize != 8) + return false; + + *track = (u_int16_t)(val[3]); + *track += (u_int16_t)(val[2]<<8); + *totalTracks = (u_int16_t)(val[5]); + *totalTracks += (u_int16_t)(val[4]<<8); + + return true; +} + +bool MP4File::SetMetadataDisk(u_int16_t disk, u_int16_t totalDisks) +{ + unsigned char t[9]; + const char *s = "moov.udta.meta.ilst.disk.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("disk")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + memset(t, 0, 9*sizeof(unsigned char)); + t[2] = (unsigned char)(disk>>8)&0xFF; + t[3] = (unsigned char)(disk)&0xFF; + t[4] = (unsigned char)(totalDisks>>8)&0xFF; + t[5] = (unsigned char)(totalDisks)&0xFF; + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)t, 8); + + return true; +} + +bool MP4File::GetMetadataDisk(u_int16_t* disk, u_int16_t* totalDisks) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.disk.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + *disk = 0; + *totalDisks = 0; + + if (valSize != 8) + return false; + + *disk = (u_int16_t)(val[3]); + *disk += (u_int16_t)(val[2]<<8); + *totalDisks = (u_int16_t)(val[5]); + *totalDisks += (u_int16_t)(val[4]<<8); + + return true; +} + +static const char* ID3v1GenreList[] = { + "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", + "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", + "Other", "Pop", "R&B", "Rap", "Reggae", "Rock", + "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks", + "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk", + "Fusion", "Trance", "Classical", "Instrumental", "Acid", "House", + "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", "Bass", + "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", + "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", + "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta", + "Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", + "New Wave", "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", + "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", + "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", + "Fast-Fusion", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", + "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", + "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson", + "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus", + "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", + "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", + "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall", + "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror", + "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat", + "Christian Gangsta", "Heavy Metal", "Black Metal", "Crossover", "Contemporary C", + "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop", + "SynthPop", +}; + +int GenreToString(char** GenreStr, const int genre) +{ + if (genre > 0 && genre <= sizeof(ID3v1GenreList)/sizeof(*ID3v1GenreList)) + { + *GenreStr = (char*)malloc((strlen(ID3v1GenreList[genre-1])+1)*sizeof(char)); + memset(*GenreStr, 0, (strlen(ID3v1GenreList[genre-1])+1)*sizeof(char)); + strcpy(*GenreStr, ID3v1GenreList[genre-1]); + return 0; + } else { + *GenreStr = (char*)malloc(2*sizeof(char)); + memset(*GenreStr, 0, 2*sizeof(char)); + return 1; + } +} + +int StringToGenre(const char* GenreStr) +{ + int i; + + for (i = 0; i < sizeof(ID3v1GenreList)/sizeof(*ID3v1GenreList); i++) + { + if (strcasecmp(GenreStr, ID3v1GenreList[i]) == 0) + return i+1; + } + return 0; +} + +bool MP4File::SetMetadataGenre(const char* value) +{ + u_int16_t genreIndex = 0; + unsigned char t[3]; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + genreIndex = StringToGenre(value); + + if (genreIndex != 0) + { + const char *s = "moov.udta.meta.ilst.gnre.data"; + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("gnre")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + memset(t, 0, 3*sizeof(unsigned char)); + t[0] = (unsigned char)(genreIndex>>8)&0xFF; + t[1] = (unsigned char)(genreIndex)&0xFF; + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)t, 2); + + return true; + } else { + const char *s2 = "moov.udta.meta.ilst.©gen.data"; + pMetaAtom = m_pRootAtom->FindAtom(s2); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("©gen")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s2); + } + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); + + return true; + } + + return false; +} + +bool MP4File::GetMetadataGenre(char** value) +{ + u_int16_t genreIndex = 0; + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *t = "moov.udta.meta.ilst.gnre"; + const char *s = "moov.udta.meta.ilst.gnre.data.metadata"; + + MP4Atom *gnre = FindAtom(t); + + if (gnre) + { + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + if (valSize != 2) + return false; + + genreIndex = (u_int16_t)(val[1]); + genreIndex += (u_int16_t)(val[0]<<8); + + GenreToString(value, genreIndex); + + return true; + } else { + const char *s2 = "moov.udta.meta.ilst.©gen.data.metadata"; + + val = NULL; + valSize = 0; + + GetBytesProperty(s2, (u_int8_t**)&val, &valSize); + + if (valSize > 0) + { + *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); + memset(*value, 0, (valSize+1)*sizeof(unsigned char)); + memcpy(*value, val, valSize*sizeof(unsigned char)); + return true; + } else { + *value = NULL; + return false; + } + } + + return false; +} + +bool MP4File::SetMetadataTempo(u_int16_t tempo) +{ + unsigned char t[3]; + const char *s = "moov.udta.meta.ilst.tmpo.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("tmpo")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + memset(t, 0, 3*sizeof(unsigned char)); + t[0] = (unsigned char)(tempo>>8)&0xFF; + t[1] = (unsigned char)(tempo)&0xFF; + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)t, 2); + + return true; +} + +bool MP4File::GetMetadataTempo(u_int16_t* tempo) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.tmpo.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + *tempo = 0; + + if (valSize != 2) + return false; + + *tempo = (u_int16_t)(val[1]); + *tempo += (u_int16_t)(val[0]<<8); + + return true; +} + +bool MP4File::SetMetadataCompilation(u_int8_t compilation) +{ + const char *s = "moov.udta.meta.ilst.cpil.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("cpil")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + compilation &= 0x1; + pMetadataProperty->SetValue((u_int8_t*)&compilation, 1); + + return true; +} + +bool MP4File::GetMetadataCompilation(u_int8_t* compilation) +{ + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.cpil.data.metadata"; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + + *compilation = 0; + + if (valSize != 1) + return false; + + *compilation = (u_int16_t)(val[0]); + + return true; +} + +bool MP4File::SetMetadataCoverArt(u_int8_t *coverArt, u_int32_t size) +{ + const char *s = "moov.udta.meta.ilst.covr.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + { + if (!CreateMetadataAtom("covr")) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(s); + } + + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue(coverArt, size); + + return true; +} + +bool MP4File::GetMetadataCoverArt(u_int8_t **coverArt, u_int32_t *size) +{ + const char *s = "moov.udta.meta.ilst.covr.data.metadata"; + GetBytesProperty(s, coverArt, size); + + if (size == 0) + return false; + + return true; +} + +bool MP4File::SetMetadataFreeForm(char *name, u_int8_t* pValue, u_int32_t valueSize) +{ + MP4Atom *pMetaAtom = NULL; + MP4BytesProperty *pMetadataProperty = NULL; + char s[256]; + int i = 0; + bool nameExists = false; + + while (1) + { + MP4BytesProperty *pMetadataProperty; + + sprintf(s, "moov.udta.meta.ilst.----[%u].name", i); + + MP4Atom *pTagAtom = m_pRootAtom->FindAtom(s); + + if (!pTagAtom) + break; + + pTagAtom->FindProperty("name.metadata", (MP4Property**)&pMetadataProperty); + if (pMetadataProperty) + { + u_int8_t* pV; + u_int32_t VSize = 0; + + pMetadataProperty->GetValue(&pV, &VSize); + + if (VSize != 0) + { + if (memcmp(pV, name, VSize) == 0) + { + sprintf(s, "moov.udta.meta.ilst.----[%u].data.metadata", i); + SetBytesProperty(s, pValue, valueSize); + + return true; + } + } + } + + i++; + } + + /* doesn't exist yet, create it */ + char t[256]; + + sprintf(t, "udta.meta.ilst.----[%u]", i); + sprintf(s, "moov.udta.meta.ilst.----[%u].data", i); + AddDescendantAtoms("moov", t); + + pMetaAtom = m_pRootAtom->FindAtom(s); + + if (!pMetaAtom) + return false; + + pMetaAtom->SetFlags(0x1); + + MP4Atom *pHdlrAtom = m_pRootAtom->FindAtom("moov.udta.meta.hdlr"); + MP4StringProperty *pStringProperty = NULL; + MP4BytesProperty *pBytesProperty = NULL; + ASSERT(pHdlrAtom); + + pHdlrAtom->FindProperty( + "hdlr.handlerType", (MP4Property**)&pStringProperty); + ASSERT(pStringProperty); + pStringProperty->SetValue("mdir"); + + u_int8_t val[12]; + memset(val, 0, 12*sizeof(u_int8_t)); + val[0] = 0x61; + val[1] = 0x70; + val[2] = 0x70; + val[3] = 0x6c; + pHdlrAtom->FindProperty( + "hdlr.reserved2", (MP4Property**)&pBytesProperty); + ASSERT(pBytesProperty); + pBytesProperty->SetReadOnly(false); + pBytesProperty->SetValue(val, 12); + pBytesProperty->SetReadOnly(true); + + pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + pMetadataProperty->SetValue(pValue, valueSize); + + sprintf(s, "moov.udta.meta.ilst.----[%u].name", i); + pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom->FindProperty("name.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + pMetadataProperty->SetValue((u_int8_t*)name, strlen(name)); + + sprintf(s, "moov.udta.meta.ilst.----[%u].mean", i); + pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom->FindProperty("mean.metadata", (MP4Property**)&pMetadataProperty); + ASSERT(pMetadataProperty); + pMetadataProperty->SetValue((u_int8_t*)"com.apple.iTunes", 16); /* ?? */ + + return true; +} + +bool MP4File::GetMetadataFreeForm(char *name, u_int8_t** ppValue, u_int32_t *pValueSize) +{ + char s[256]; + int i = 0; + + while (1) + { + MP4BytesProperty *pMetadataProperty; + + sprintf(s, "moov.udta.meta.ilst.----[%u].name", i); + + MP4Atom *pTagAtom = m_pRootAtom->FindAtom(s); + + if (!pTagAtom) + return false; + + pTagAtom->FindProperty("name.metadata", (MP4Property**)&pMetadataProperty); + if (pMetadataProperty) + { + u_int8_t* pV; + u_int32_t VSize = 0; + + pMetadataProperty->GetValue(&pV, &VSize); + + if (VSize != 0) + { + if (memcmp(pV, name, VSize) == 0) + { + sprintf(s, "moov.udta.meta.ilst.----[%u].data.metadata", i); + GetBytesProperty(s, ppValue, pValueSize); + + return true; + } + } + } + + i++; + } +} + +bool MP4File::MetadataDelete() +{ + MP4Atom *pMetaAtom = NULL; + char s[256]; + + sprintf(s, "moov.udta.meta"); + pMetaAtom = m_pRootAtom->FindAtom(s); + + /* if it exists, delete it */ + if (pMetaAtom) + { + MP4Atom *pParent = pMetaAtom->GetParentAtom(); + + pParent->DeleteChildAtom(pMetaAtom); + + delete pMetaAtom; + + return true; + } + + return false; +} --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4property.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4property.cpp @@ -0,0 +1,875 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4Property::MP4Property(const char* name) +{ + m_name = name; + m_pParentAtom = NULL; + m_readOnly = false; + m_implicit = false; +} + +bool MP4Property::FindProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + if (name == NULL) { + return false; + } + + if (!strcasecmp(m_name, name)) { + if (m_pParentAtom) { + VERBOSE_FIND(m_pParentAtom->GetFile()->GetVerbosity(), + printf("FindProperty: matched %s\n", name)); + } + + *ppProperty = this; + return true; + } + return false; +} + +// Integer Property + +u_int64_t MP4IntegerProperty::GetValue(u_int32_t index) +{ + switch (this->GetType()) { + case Integer8Property: + return ((MP4Integer8Property*)this)->GetValue(index); + case Integer16Property: + return ((MP4Integer16Property*)this)->GetValue(index); + case Integer24Property: + return ((MP4Integer24Property*)this)->GetValue(index); + case Integer32Property: + return ((MP4Integer32Property*)this)->GetValue(index); + case Integer64Property: + return ((MP4Integer64Property*)this)->GetValue(index); + default: + ASSERT(FALSE); + } + return (0); +} + +void MP4IntegerProperty::SetValue(u_int64_t value, u_int32_t index) +{ + switch (this->GetType()) { + case Integer8Property: + ((MP4Integer8Property*)this)->SetValue(value, index); + break; + case Integer16Property: + ((MP4Integer16Property*)this)->SetValue(value, index); + break; + case Integer24Property: + ((MP4Integer24Property*)this)->SetValue(value, index); + break; + case Integer32Property: + ((MP4Integer32Property*)this)->SetValue(value, index); + break; + case Integer64Property: + ((MP4Integer64Property*)this)->SetValue(value, index); + break; + default: + ASSERT(FALSE); + } +} + +void MP4IntegerProperty::InsertValue(u_int64_t value, u_int32_t index) +{ + switch (this->GetType()) { + case Integer8Property: + ((MP4Integer8Property*)this)->InsertValue(value, index); + break; + case Integer16Property: + ((MP4Integer16Property*)this)->InsertValue(value, index); + break; + case Integer24Property: + ((MP4Integer24Property*)this)->InsertValue(value, index); + break; + case Integer32Property: + ((MP4Integer32Property*)this)->InsertValue(value, index); + break; + case Integer64Property: + ((MP4Integer64Property*)this)->InsertValue(value, index); + break; + default: + ASSERT(FALSE); + } +} + +void MP4IntegerProperty::DeleteValue(u_int32_t index) +{ + switch (this->GetType()) { + case Integer8Property: + ((MP4Integer8Property*)this)->DeleteValue(index); + break; + case Integer16Property: + ((MP4Integer16Property*)this)->DeleteValue(index); + break; + case Integer24Property: + ((MP4Integer24Property*)this)->DeleteValue(index); + break; + case Integer32Property: + ((MP4Integer32Property*)this)->DeleteValue(index); + break; + case Integer64Property: + ((MP4Integer64Property*)this)->DeleteValue(index); + break; + default: + ASSERT(FALSE); + } +} + +void MP4IntegerProperty::IncrementValue(int32_t increment, u_int32_t index) +{ + SetValue(GetValue() + increment); +} + +void MP4Integer8Property::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + if (m_implicit && !dumpImplicits) { + return; + } + Indent(pFile, indent); + fprintf(pFile, "%s = %u (0x%02x)\n", + m_name, m_values[index], m_values[index]); +} + +void MP4Integer16Property::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + if (m_implicit && !dumpImplicits) { + return; + } + Indent(pFile, indent); + fprintf(pFile, "%s = %u (0x%04x)\n", + m_name, m_values[index], m_values[index]); +} + +void MP4Integer24Property::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + if (m_implicit && !dumpImplicits) { + return; + } + Indent(pFile, indent); + fprintf(pFile, "%s = %u (0x%06x)\n", + m_name, m_values[index], m_values[index]); +} + +void MP4Integer32Property::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + if (m_implicit && !dumpImplicits) { + return; + } + Indent(pFile, indent); + fprintf(pFile, "%s = %u (0x%08x)\n", + m_name, m_values[index], m_values[index]); +} + +void MP4Integer64Property::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + if (m_implicit && !dumpImplicits) { + return; + } + Indent(pFile, indent); + fprintf(pFile, +#ifdef _WIN32 + "%s = "LLU" (0x%016I64x)\n", +#else + "%s = "LLU" (0x%016llx)\n", +#endif + m_name, m_values[index], m_values[index]); +} + +// MP4BitfieldProperty + +void MP4BitfieldProperty::Read(MP4File* pFile, u_int32_t index) +{ + if (m_implicit) { + return; + } + m_values[index] = pFile->ReadBits(m_numBits); +} + +void MP4BitfieldProperty::Write(MP4File* pFile, u_int32_t index) +{ + if (m_implicit) { + return; + } + pFile->WriteBits(m_values[index], m_numBits); +} + +void MP4BitfieldProperty::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + if (m_implicit && !dumpImplicits) { + return; + } + Indent(pFile, indent); + + u_int8_t hexWidth = m_numBits / 4; + if (hexWidth == 0 || (m_numBits % 4)) { + hexWidth++; + } + fprintf(pFile, +#ifdef _WIN32 + "%s = "LLU" (0x%0*I64x) <%u bits>\n", +#else + "%s = "LLU" (0x%0*llx) <%u bits>\n", +#endif + m_name, m_values[index], (int)hexWidth, m_values[index], m_numBits); +} + +// MP4Float32Property + +void MP4Float32Property::Read(MP4File* pFile, u_int32_t index) +{ + if (m_implicit) { + return; + } + if (m_useFixed16Format) { + m_values[index] = pFile->ReadFixed16(); + } else if (m_useFixed32Format) { + m_values[index] = pFile->ReadFixed32(); + } else { + m_values[index] = pFile->ReadFloat(); + } +} + +void MP4Float32Property::Write(MP4File* pFile, u_int32_t index) +{ + if (m_implicit) { + return; + } + if (m_useFixed16Format) { + pFile->WriteFixed16(m_values[index]); + } else if (m_useFixed32Format) { + pFile->WriteFixed32(m_values[index]); + } else { + pFile->WriteFloat(m_values[index]); + } +} + +void MP4Float32Property::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + if (m_implicit && !dumpImplicits) { + return; + } + Indent(pFile, indent); + fprintf(pFile, "%s = %f\n", + m_name, m_values[index]); +} + +// MP4StringProperty + +MP4StringProperty::MP4StringProperty(char* name, + bool useCountedFormat, bool useUnicode) + : MP4Property(name) +{ + SetCount(1); + m_values[0] = NULL; + m_useCountedFormat = useCountedFormat; + m_useExpandedCount = false; + m_useUnicode = useUnicode; + m_fixedLength = 0; // length not fixed +} + +MP4StringProperty::~MP4StringProperty() +{ + u_int32_t count = GetCount(); + for (u_int32_t i = 0; i < count; i++) { + MP4Free(m_values[i]); + } +} + +void MP4StringProperty::SetCount(u_int32_t count) +{ + u_int32_t oldCount = m_values.Size(); + + m_values.Resize(count); + + for (u_int32_t i = oldCount; i < count; i++) { + m_values[i] = NULL; + } +} + +void MP4StringProperty::SetValue(const char* value, u_int32_t index) +{ + if (m_readOnly) { + throw new MP4Error(EACCES, "property is read-only", m_name); + } + + MP4Free(m_values[index]); + + if (m_fixedLength) { + m_values[index] = (char*)MP4Calloc(m_fixedLength + 1); + if (value) { + strncpy(m_values[index], value, m_fixedLength); + } + } else { + if (value) { + m_values[index] = MP4Stralloc(value); + } else { + m_values[index] = NULL; + } + } +} + +void MP4StringProperty::Read(MP4File* pFile, u_int32_t index) +{ + if (m_implicit) { + return; + } + if (m_useCountedFormat) { + m_values[index] = pFile->ReadCountedString( + (m_useUnicode ? 2 : 1), m_useExpandedCount); + } else if (m_fixedLength) { + MP4Free(m_values[index]); + m_values[index] = (char*)MP4Calloc(m_fixedLength + 1); + pFile->ReadBytes((u_int8_t*)m_values[index], m_fixedLength); + } else { + m_values[index] = pFile->ReadString(); + } +} + +void MP4StringProperty::Write(MP4File* pFile, u_int32_t index) +{ + if (m_implicit) { + return; + } + if (m_useCountedFormat) { + pFile->WriteCountedString(m_values[index], + (m_useUnicode ? 2 : 1), m_useExpandedCount); + } else if (m_fixedLength) { + pFile->WriteBytes((u_int8_t*)m_values[index], m_fixedLength); + } else { + pFile->WriteString(m_values[index]); + } +} + +void MP4StringProperty::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + if (m_implicit && !dumpImplicits) { + return; + } + Indent(pFile, indent); + if (m_useUnicode) { + fprintf(pFile, "%s = %ls\n", m_name, (wchar_t*)m_values[index]); + } else { + fprintf(pFile, "%s = %s\n", m_name, m_values[index]); + } +} + +// MP4BytesProperty + +MP4BytesProperty::MP4BytesProperty(char* name, u_int32_t valueSize) + : MP4Property(name) +{ + SetCount(1); + m_values[0] = (u_int8_t*)MP4Calloc(valueSize); + m_valueSizes[0] = valueSize; + m_fixedValueSize = 0; +} + +MP4BytesProperty::~MP4BytesProperty() +{ + u_int32_t count = GetCount(); + for (u_int32_t i = 0; i < count; i++) { + MP4Free(m_values[i]); + } +} + +void MP4BytesProperty::SetCount(u_int32_t count) +{ + u_int32_t oldCount = m_values.Size(); + + m_values.Resize(count); + m_valueSizes.Resize(count); + + for (u_int32_t i = oldCount; i < count; i++) { + m_values[i] = NULL; + m_valueSizes[i] = 0; + } +} + +void MP4BytesProperty::SetValue(const u_int8_t* pValue, u_int32_t valueSize, + u_int32_t index) +{ + if (m_readOnly) { + throw new MP4Error(EACCES, "property is read-only", m_name); + } + if (m_fixedValueSize) { + if (valueSize > m_fixedValueSize) { + throw new MP4Error("value size exceeds fixed value size", + "MP4BytesProperty::SetValue"); + } + if (m_values[index] == NULL) { + m_values[index] = (u_int8_t*)MP4Calloc(m_fixedValueSize); + m_valueSizes[index] = m_fixedValueSize; + } + if (pValue) { + memcpy(m_values[index], pValue, valueSize); + } + } else { + MP4Free(m_values[index]); + if (pValue) { + m_values[index] = (u_int8_t*)MP4Malloc(valueSize); + memcpy(m_values[index], pValue, valueSize); + m_valueSizes[index] = valueSize; + } else { + m_values[index] = NULL; + m_valueSizes[index] = 0; + } + } +} + +void MP4BytesProperty::SetValueSize(u_int32_t valueSize, u_int32_t index) +{ + if (m_fixedValueSize) { + throw new MP4Error("can't change size of fixed sized property", + "MP4BytesProperty::SetValueSize"); + } + if (m_values[index] != NULL) { + m_values[index] = (u_int8_t*)MP4Realloc(m_values[index], valueSize); + } + m_valueSizes[index] = valueSize; +} + +void MP4BytesProperty::SetFixedSize(u_int32_t fixedSize) +{ + m_fixedValueSize = 0; + for (u_int32_t i = 0; i < GetCount(); i++) { + SetValueSize(fixedSize, i); + } + m_fixedValueSize = fixedSize; +} + +void MP4BytesProperty::Read(MP4File* pFile, u_int32_t index) +{ + if (m_implicit) { + return; + } + MP4Free(m_values[index]); + m_values[index] = (u_int8_t*)MP4Malloc(m_valueSizes[index]); + pFile->ReadBytes(m_values[index], m_valueSizes[index]); +} + +void MP4BytesProperty::Write(MP4File* pFile, u_int32_t index) +{ + if (m_implicit) { + return; + } + pFile->WriteBytes(m_values[index], m_valueSizes[index]); +} + +void MP4BytesProperty::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + if (m_implicit && !dumpImplicits) { + return; + } + Indent(pFile, indent); + fprintf(pFile, "%s = <%u bytes> ", m_name, m_valueSizes[index]); + for (u_int32_t i = 0; i < m_valueSizes[index]; i++) { + if ((i % 16) == 0 && m_valueSizes[index] > 16) { + fprintf(pFile, "\n"); + Indent(pFile, indent); + } + fprintf(pFile, "%02x ", m_values[index][i]); + } + fprintf(pFile, "\n"); +} + +// MP4TableProperty + +MP4TableProperty::MP4TableProperty(char* name, MP4Property* pCountProperty) + : MP4Property(name) +{ + ASSERT(pCountProperty->GetType() == Integer8Property + || pCountProperty->GetType() == Integer32Property); + m_pCountProperty = pCountProperty; + m_pCountProperty->SetReadOnly(); +} + +MP4TableProperty::~MP4TableProperty() +{ + for (u_int32_t i = 0; i < m_pProperties.Size(); i++) { + delete m_pProperties[i]; + } +} + +void MP4TableProperty::AddProperty(MP4Property* pProperty) +{ + ASSERT(pProperty); + ASSERT(pProperty->GetType() != TableProperty); + ASSERT(pProperty->GetType() != DescriptorProperty); + m_pProperties.Add(pProperty); + pProperty->SetParentAtom(m_pParentAtom); + pProperty->SetCount(0); +} + +bool MP4TableProperty::FindProperty(const char *name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + ASSERT(m_name); + + // check if first component of name matches ourselves + if (!MP4NameFirstMatches(m_name, name)) { + return false; + } + + // check if the specified table entry exists + u_int32_t index; + bool haveIndex = MP4NameFirstIndex(name, &index); + if (haveIndex) { + if (index >= GetCount()) { + return false; + } + if (pIndex) { + *pIndex = index; + } + } + + VERBOSE_FIND(m_pParentAtom->GetFile()->GetVerbosity(), + printf("FindProperty: matched %s\n", name)); + + // get name of table property + const char *tablePropName = MP4NameAfterFirst(name); + if (tablePropName == NULL) { + if (!haveIndex) { + *ppProperty = this; + return true; + } + return false; + } + + // check if this table property exists + return FindContainedProperty(tablePropName, ppProperty, pIndex); +} + +bool MP4TableProperty::FindContainedProperty(const char *name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + u_int32_t numProperties = m_pProperties.Size(); + + for (u_int32_t i = 0; i < numProperties; i++) { + if (m_pProperties[i]->FindProperty(name, ppProperty, pIndex)) { + return true; + } + } + return false; +} + +void MP4TableProperty::Read(MP4File* pFile, u_int32_t index) +{ + ASSERT(index == 0); + + if (m_implicit) { + return; + } + + u_int32_t numProperties = m_pProperties.Size(); + + if (numProperties == 0) { + WARNING(numProperties == 0); + return; + } + + u_int32_t numEntries = GetCount(); + + /* for each property set size */ + for (u_int32_t j = 0; j < numProperties; j++) { + m_pProperties[j]->SetCount(numEntries); + } + + for (u_int32_t i = 0; i < numEntries; i++) { + ReadEntry(pFile, i); + } +} + +void MP4TableProperty::ReadEntry(MP4File* pFile, u_int32_t index) +{ + for (u_int32_t j = 0; j < m_pProperties.Size(); j++) { + m_pProperties[j]->Read(pFile, index); + } +} + +void MP4TableProperty::Write(MP4File* pFile, u_int32_t index) +{ + ASSERT(index == 0); + + if (m_implicit) { + return; + } + + u_int32_t numProperties = m_pProperties.Size(); + + if (numProperties == 0) { + WARNING(numProperties == 0); + return; + } + + u_int32_t numEntries = GetCount(); + + ASSERT(m_pProperties[0]->GetCount() == numEntries); + + for (u_int32_t i = 0; i < numEntries; i++) { + WriteEntry(pFile, i); + } +} + +void MP4TableProperty::WriteEntry(MP4File* pFile, u_int32_t index) +{ + for (u_int32_t j = 0; j < m_pProperties.Size(); j++) { + m_pProperties[j]->Write(pFile, index); + } +} + +void MP4TableProperty::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + ASSERT(index == 0); + + // implicit tables just can't be dumped + if (m_implicit) { + return; + } + + u_int32_t numProperties = m_pProperties.Size(); + + if (numProperties == 0) { + WARNING(numProperties == 0); + return; + } + + u_int32_t numEntries = GetCount(); + + for (u_int32_t i = 0; i < numEntries; i++) { + for (u_int32_t j = 0; j < numProperties; j++) { + m_pProperties[j]->Dump(pFile, indent + 1, dumpImplicits, i); + } + } +} + +// MP4DescriptorProperty + +MP4DescriptorProperty::MP4DescriptorProperty(char* name, + u_int8_t tagsStart, u_int8_t tagsEnd, bool mandatory, bool onlyOne) + : MP4Property(name) +{ + SetTags(tagsStart, tagsEnd); + m_sizeLimit = 0; + m_mandatory = mandatory; + m_onlyOne = onlyOne; +} + +MP4DescriptorProperty::~MP4DescriptorProperty() +{ + for (u_int32_t i = 0; i < m_pDescriptors.Size(); i++) { + delete m_pDescriptors[i]; + } +} + +void MP4DescriptorProperty::SetParentAtom(MP4Atom* pParentAtom) { + m_pParentAtom = pParentAtom; + for (u_int32_t i = 0; i < m_pDescriptors.Size(); i++) { + m_pDescriptors[i]->SetParentAtom(pParentAtom); + } +} + +MP4Descriptor* MP4DescriptorProperty::AddDescriptor(u_int8_t tag) +{ + // check that tag is in expected range + ASSERT(tag >= m_tagsStart && tag <= m_tagsEnd); + + MP4Descriptor* pDescriptor = CreateDescriptor(tag); + ASSERT(pDescriptor); + + m_pDescriptors.Add(pDescriptor); + pDescriptor->SetParentAtom(m_pParentAtom); + + return pDescriptor; +} + +void MP4DescriptorProperty::DeleteDescriptor(u_int32_t index) +{ + delete m_pDescriptors[index]; + m_pDescriptors.Delete(index); +} + +void MP4DescriptorProperty::Generate() +{ + // generate a default descriptor + // if it is mandatory, and single + if (m_mandatory && m_onlyOne) { + MP4Descriptor* pDescriptor = + AddDescriptor(m_tagsStart); + pDescriptor->Generate(); + } +} + +bool MP4DescriptorProperty::FindProperty(const char *name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + // we're unnamed, so just check contained properties + if (m_name == NULL || !strcmp(m_name, "")) { + return FindContainedProperty(name, ppProperty, pIndex); + } + + // check if first component of name matches ourselves + if (!MP4NameFirstMatches(m_name, name)) { + return false; + } + + // check if the specific descriptor entry exists + u_int32_t descrIndex; + bool haveDescrIndex = MP4NameFirstIndex(name, &descrIndex); + + if (haveDescrIndex && descrIndex >= GetCount()) { + return false; + } + + if (m_pParentAtom) { + VERBOSE_FIND(m_pParentAtom->GetFile()->GetVerbosity(), + printf("FindProperty: matched %s\n", name)); + } + + // get name of descriptor property + name = MP4NameAfterFirst(name); + if (name == NULL) { + if (!haveDescrIndex) { + *ppProperty = this; + return true; + } + return false; + } + + /* check rest of name */ + if (haveDescrIndex) { + return m_pDescriptors[descrIndex]->FindProperty(name, + ppProperty, pIndex); + } else { + return FindContainedProperty(name, ppProperty, pIndex); + } +} + +bool MP4DescriptorProperty::FindContainedProperty(const char *name, + MP4Property** ppProperty, u_int32_t* pIndex) +{ + for (u_int32_t i = 0; i < m_pDescriptors.Size(); i++) { + if (m_pDescriptors[i]->FindProperty(name, ppProperty, pIndex)) { + return true; + } + } + return false; +} + +void MP4DescriptorProperty::Read(MP4File* pFile, u_int32_t index) +{ + ASSERT(index == 0); + + if (m_implicit) { + return; + } + + u_int64_t start = pFile->GetPosition(); + + while (true) { + // enforce size limitation + if (m_sizeLimit && pFile->GetPosition() >= start + m_sizeLimit) { + break; + } + + u_int8_t tag; + try { + pFile->PeekBytes(&tag, 1); + } + catch (MP4Error* e) { + if (pFile->GetPosition() >= pFile->GetSize()) { + // EOF + delete e; + break; + } + throw e; + } + + // check if tag is in desired range + if (tag < m_tagsStart || tag > m_tagsEnd) { + break; + } + + MP4Descriptor* pDescriptor = + AddDescriptor(tag); + + pDescriptor->Read(pFile); + } + + // warnings + if (m_mandatory && m_pDescriptors.Size() == 0) { + VERBOSE_READ(pFile->GetVerbosity(), + printf("Warning: Mandatory descriptor 0x%02x missing\n", + m_tagsStart)); + } else if (m_onlyOne && m_pDescriptors.Size() > 1) { + VERBOSE_READ(pFile->GetVerbosity(), + printf("Warning: Descriptor 0x%02x has more than one instance\n", + m_tagsStart)); + } +} + +void MP4DescriptorProperty::Write(MP4File* pFile, u_int32_t index) +{ + ASSERT(index == 0); + + if (m_implicit) { + return; + } + + for (u_int32_t i = 0; i < m_pDescriptors.Size(); i++) { + m_pDescriptors[i]->Write(pFile); + } +} + +void MP4DescriptorProperty::Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index) +{ + ASSERT(index == 0); + + if (m_implicit && !dumpImplicits) { + return; + } + + if (m_name) { + Indent(pFile, indent); + fprintf(pFile, "%s\n", m_name); + indent++; + } + + for (u_int32_t i = 0; i < m_pDescriptors.Size(); i++) { + m_pDescriptors[i]->Dump(pFile, indent, dumpImplicits); + } +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4property.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4property.h @@ -0,0 +1,549 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MP4_PROPERTY_INCLUDED__ +#define __MP4_PROPERTY_INCLUDED__ + +// forward declarations +class MP4Atom; + +class MP4Descriptor; +MP4ARRAY_DECL(MP4Descriptor, MP4Descriptor*); + +enum MP4PropertyType { + Integer8Property, + Integer16Property, + Integer24Property, + Integer32Property, + Integer64Property, + Float32Property, + StringProperty, + BytesProperty, + TableProperty, + DescriptorProperty, +}; + +class MP4Property { +public: + MP4Property(const char *name = NULL); + + virtual ~MP4Property() { } + + MP4Atom* GetParentAtom() { + return m_pParentAtom; + } + virtual void SetParentAtom(MP4Atom* pParentAtom) { + m_pParentAtom = pParentAtom; + } + + const char *GetName() { + return m_name; + } + + virtual MP4PropertyType GetType() = NULL; + + bool IsReadOnly() { + return m_readOnly; + } + void SetReadOnly(bool value = true) { + m_readOnly = value; + } + + bool IsImplicit() { + return m_implicit; + } + void SetImplicit(bool value = true) { + m_implicit = value; + } + + virtual u_int32_t GetCount() = NULL; + virtual void SetCount(u_int32_t count) = NULL; + + virtual void Generate() { /* default is a no-op */ }; + + virtual void Read(MP4File* pFile, u_int32_t index = 0) = NULL; + + virtual void Write(MP4File* pFile, u_int32_t index = 0) = NULL; + + virtual void Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index = 0) = NULL; + + virtual bool FindProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + +protected: + MP4Atom* m_pParentAtom; + const char* m_name; + bool m_readOnly; + bool m_implicit; +}; + +MP4ARRAY_DECL(MP4Property, MP4Property*); + +class MP4IntegerProperty : public MP4Property { +protected: + MP4IntegerProperty(char* name) + : MP4Property(name) { }; + +public: + u_int64_t GetValue(u_int32_t index = 0); + + void SetValue(u_int64_t value, u_int32_t index = 0); + + void InsertValue(u_int64_t value, u_int32_t index = 0); + + void DeleteValue(u_int32_t index = 0); + + void IncrementValue(int32_t increment = 1, u_int32_t index = 0); +}; + +#define MP4INTEGER_PROPERTY_DECL2(isize, xsize) \ + class MP4Integer##xsize##Property : public MP4IntegerProperty { \ + public: \ + MP4Integer##xsize##Property(char* name) \ + : MP4IntegerProperty(name) { \ + SetCount(1); \ + m_values[0] = 0; \ + } \ + \ + MP4PropertyType GetType() { \ + return Integer##xsize##Property; \ + } \ + \ + u_int32_t GetCount() { \ + return m_values.Size(); \ + } \ + void SetCount(u_int32_t count) { \ + m_values.Resize(count); \ + } \ + \ + u_int##isize##_t GetValue(u_int32_t index = 0) { \ + return m_values[index]; \ + } \ + \ + void SetValue(u_int##isize##_t value, u_int32_t index = 0) { \ + if (m_readOnly) { \ + throw new MP4Error(EACCES, "property is read-only", m_name); \ + } \ + m_values[index] = value; \ + } \ + void AddValue(u_int##isize##_t value) { \ + m_values.Add(value); \ + } \ + void InsertValue(u_int##isize##_t value, u_int32_t index) { \ + m_values.Insert(value, index); \ + } \ + void DeleteValue(u_int32_t index) { \ + m_values.Delete(index); \ + } \ + void IncrementValue(int32_t increment = 1, u_int32_t index = 0) { \ + m_values[index] += increment; \ + } \ + void Read(MP4File* pFile, u_int32_t index = 0) { \ + if (m_implicit) { \ + return; \ + } \ + m_values[index] = pFile->ReadUInt##xsize(); \ + } \ + \ + void Write(MP4File* pFile, u_int32_t index = 0) { \ + if (m_implicit) { \ + return; \ + } \ + pFile->WriteUInt##xsize(m_values[index]); \ + } \ + void Dump(FILE* pFile, u_int8_t indent, \ + bool dumpImplicits, u_int32_t index = 0); \ + \ + protected: \ + MP4Integer##isize##Array m_values; \ + }; + +#define MP4INTEGER_PROPERTY_DECL(size) \ + MP4INTEGER_PROPERTY_DECL2(size, size) + +MP4INTEGER_PROPERTY_DECL(8); +MP4INTEGER_PROPERTY_DECL(16); +MP4INTEGER_PROPERTY_DECL2(32, 24); +MP4INTEGER_PROPERTY_DECL(32); +MP4INTEGER_PROPERTY_DECL(64); + +class MP4BitfieldProperty : public MP4Integer64Property { +public: + MP4BitfieldProperty(char* name, u_int8_t numBits) + : MP4Integer64Property(name) { + ASSERT(numBits != 0); + ASSERT(numBits <= 64); + m_numBits = numBits; + } + + u_int8_t GetNumBits() { + return m_numBits; + } + void SetNumBits(u_int8_t numBits) { + m_numBits = numBits; + } + + void Read(MP4File* pFile, u_int32_t index = 0); + void Write(MP4File* pFile, u_int32_t index = 0); + void Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index = 0); + +protected: + u_int8_t m_numBits; +}; + +class MP4Float32Property : public MP4Property { +public: + MP4Float32Property(char* name) + : MP4Property(name) { + m_useFixed16Format = false; + m_useFixed32Format = false; + SetCount(1); + m_values[0] = 0.0; + } + + MP4PropertyType GetType() { + return Float32Property; + } + + u_int32_t GetCount() { + return m_values.Size(); + } + void SetCount(u_int32_t count) { + m_values.Resize(count); + } + + float GetValue(u_int32_t index = 0) { + return m_values[index]; + } + + void SetValue(float value, u_int32_t index = 0) { + if (m_readOnly) { + throw new MP4Error(EACCES, "property is read-only", m_name); + } + m_values[index] = value; + } + + void AddValue(float value) { + m_values.Add(value); + } + + void InsertValue(float value, u_int32_t index) { + m_values.Insert(value, index); + } + + bool IsFixed16Format() { + return m_useFixed16Format; + } + + void SetFixed16Format(bool useFixed16Format = true) { + m_useFixed16Format = useFixed16Format; + } + + bool IsFixed32Format() { + return m_useFixed32Format; + } + + void SetFixed32Format(bool useFixed32Format = true) { + m_useFixed32Format = useFixed32Format; + } + + void Read(MP4File* pFile, u_int32_t index = 0); + void Write(MP4File* pFile, u_int32_t index = 0); + void Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index = 0); + +protected: + bool m_useFixed16Format; + bool m_useFixed32Format; + MP4Float32Array m_values; +}; + +class MP4StringProperty : public MP4Property { +public: + MP4StringProperty(char* name, + bool useCountedFormat = false, bool useUnicode = false); + + ~MP4StringProperty(); + + MP4PropertyType GetType() { + return StringProperty; + } + + u_int32_t GetCount() { + return m_values.Size(); + } + + void SetCount(u_int32_t count); + + const char* GetValue(u_int32_t index = 0) { + return m_values[index]; + } + + void SetValue(const char* value, u_int32_t index = 0); + + void AddValue(char* value) { + u_int32_t count = GetCount(); + SetCount(count + 1); + SetValue(value, count); + } + + bool IsCountedFormat() { + return m_useCountedFormat; + } + + void SetCountedFormat(bool useCountedFormat) { + m_useCountedFormat = useCountedFormat; + } + + bool IsExpandedCountedFormat() { + return m_useExpandedCount; + } + + void SetExpandedCountedFormat(bool useExpandedCount) { + m_useExpandedCount = useExpandedCount; + } + + bool IsUnicode() { + return m_useUnicode; + } + + void SetUnicode(bool useUnicode) { + m_useUnicode = useUnicode; + } + + u_int32_t GetFixedLength() { + return m_fixedLength; + } + + void SetFixedLength(u_int32_t fixedLength) { + m_fixedLength = fixedLength; + } + + void Read(MP4File* pFile, u_int32_t index = 0); + void Write(MP4File* pFile, u_int32_t index = 0); + void Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index = 0); + +protected: + bool m_useCountedFormat; + bool m_useExpandedCount; + bool m_useUnicode; + u_int32_t m_fixedLength; + + MP4StringArray m_values; +}; + +class MP4BytesProperty : public MP4Property { +public: + MP4BytesProperty(char* name, u_int32_t valueSize = 0); + + ~MP4BytesProperty(); + + MP4PropertyType GetType() { + return BytesProperty; + } + + u_int32_t GetCount() { + return m_values.Size(); + } + + void SetCount(u_int32_t count); + + void GetValue(u_int8_t** ppValue, u_int32_t* pValueSize, + u_int32_t index = 0) { + // N.B. caller must free memory + *ppValue = (u_int8_t*)MP4Malloc(m_valueSizes[index]); + memcpy(*ppValue, m_values[index], m_valueSizes[index]); + *pValueSize = m_valueSizes[index]; + } + + void CopyValue(u_int8_t* pValue, u_int32_t index = 0) { + // N.B. caller takes responsbility for valid pointer + // and sufficient memory at the destination + memcpy(pValue, m_values[index], m_valueSizes[index]); + } + + void SetValue(const u_int8_t* pValue, u_int32_t valueSize, + u_int32_t index = 0); + + void AddValue(u_int8_t* pValue, u_int32_t valueSize) { + u_int32_t count = GetCount(); + SetCount(count + 1); + SetValue(pValue, valueSize, count); + } + + u_int32_t GetValueSize(u_int32_t valueSize, u_int32_t index = 0) { + return m_valueSizes[index]; + } + + void SetValueSize(u_int32_t valueSize, u_int32_t index = 0); + + u_int32_t GetFixedSize() { + return m_fixedValueSize; + } + + void SetFixedSize(u_int32_t fixedSize); + + void Read(MP4File* pFile, u_int32_t index = 0); + void Write(MP4File* pFile, u_int32_t index = 0); + void Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index = 0); + +protected: + u_int32_t m_fixedValueSize; + MP4Integer32Array m_valueSizes; + MP4BytesArray m_values; +}; + +class MP4TableProperty : public MP4Property { +public: + MP4TableProperty(char* name, MP4Property* pCountProperty); + + ~MP4TableProperty(); + + MP4PropertyType GetType() { + return TableProperty; + } + + void SetParentAtom(MP4Atom* pParentAtom) { + m_pParentAtom = pParentAtom; + for (u_int32_t i = 0; i < m_pProperties.Size(); i++) { + m_pProperties[i]->SetParentAtom(pParentAtom); + } + } + + void AddProperty(MP4Property* pProperty); + + MP4Property* GetProperty(u_int32_t index) { + return m_pProperties[index]; + } + + u_int32_t GetCount() { + if (m_pCountProperty->GetType() == Integer8Property) { + return ((MP4Integer8Property*)m_pCountProperty)->GetValue(); + } else { + return ((MP4Integer32Property*)m_pCountProperty)->GetValue(); + } + } + void SetCount(u_int32_t count) { + if (m_pCountProperty->GetType() == Integer8Property) { + ((MP4Integer8Property*)m_pCountProperty)->SetValue(count); + } else { + ((MP4Integer32Property*)m_pCountProperty)->SetValue(count); + } + } + + void Read(MP4File* pFile, u_int32_t index = 0); + void Write(MP4File* pFile, u_int32_t index = 0); + void Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index = 0); + + bool FindProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + +protected: + virtual void ReadEntry(MP4File* pFile, u_int32_t index); + virtual void WriteEntry(MP4File* pFile, u_int32_t index); + + bool FindContainedProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex); + +protected: + MP4Property* m_pCountProperty; + MP4PropertyArray m_pProperties; +}; + +class MP4DescriptorProperty : public MP4Property { +public: + MP4DescriptorProperty(char* name = NULL, + u_int8_t tagsStart = 0, u_int8_t tagsEnd = 0, + bool mandatory = false, bool onlyOne = false); + + ~MP4DescriptorProperty(); + + MP4PropertyType GetType() { + return DescriptorProperty; + } + + void SetParentAtom(MP4Atom* pParentAtom); + + void SetSizeLimit(u_int64_t sizeLimit) { + m_sizeLimit = sizeLimit; + } + + u_int32_t GetCount() { + return m_pDescriptors.Size(); + } + void SetCount(u_int32_t count) { + m_pDescriptors.Resize(count); + } + + void SetTags(u_int8_t tagsStart, u_int8_t tagsEnd = 0) { + m_tagsStart = tagsStart; + m_tagsEnd = tagsEnd ? tagsEnd : tagsStart; + } + + MP4Descriptor* AddDescriptor(u_int8_t tag); + + void AppendDescriptor(MP4Descriptor* pDescriptor) { + m_pDescriptors.Add(pDescriptor); + } + + void DeleteDescriptor(u_int32_t index); + + void Generate(); + void Read(MP4File* pFile, u_int32_t index = 0); + void Write(MP4File* pFile, u_int32_t index = 0); + void Dump(FILE* pFile, u_int8_t indent, + bool dumpImplicits, u_int32_t index = 0); + + bool FindProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); + +protected: + virtual MP4Descriptor* CreateDescriptor(u_int8_t tag); + + bool FindContainedProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex); + +protected: + u_int8_t m_tagsStart; + u_int8_t m_tagsEnd; + u_int64_t m_sizeLimit; + bool m_mandatory; + bool m_onlyOne; + MP4DescriptorArray m_pDescriptors; +}; + +class MP4QosQualifierProperty : public MP4DescriptorProperty { +public: + MP4QosQualifierProperty(char* name = NULL, + u_int8_t tagsStart = 0, u_int8_t tagsEnd = 0, + bool mandatory = false, bool onlyOne = false) : + MP4DescriptorProperty(name, tagsStart, tagsEnd, mandatory, onlyOne) { } + +protected: + MP4Descriptor* CreateDescriptor(u_int8_t tag); +}; + +#endif /* __MP4_PROPERTY_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4track.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4track.cpp @@ -0,0 +1,1637 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Alix Marchandise-Franquet alix@cisco.com + */ + +#include "mp4common.h" + +MP4Track::MP4Track(MP4File* pFile, MP4Atom* pTrakAtom) +{ + m_pFile = pFile; + m_pTrakAtom = pTrakAtom; + + m_lastStsdIndex = 0; + m_lastSampleFile = NULL; + + m_cachedReadSampleId = MP4_INVALID_SAMPLE_ID; + m_pCachedReadSample = NULL; + m_cachedReadSampleSize = 0; + + m_writeSampleId = 1; + m_fixedSampleDuration = 0; + m_pChunkBuffer = NULL; + m_chunkBufferSize = 0; + m_chunkSamples = 0; + m_chunkDuration = 0; + + m_samplesPerChunk = 0; + m_durationPerChunk = 0; + + bool success = true; + + MP4Integer32Property* pTrackIdProperty; + success &= m_pTrakAtom->FindProperty( + "trak.tkhd.trackId", + (MP4Property**)&pTrackIdProperty); + if (success) { + m_trackId = pTrackIdProperty->GetValue(); + } + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.mdhd.timeScale", + (MP4Property**)&m_pTimeScaleProperty); + if (success) { + // default chunking is 1 second of samples + m_durationPerChunk = m_pTimeScaleProperty->GetValue(); + } + + success &= m_pTrakAtom->FindProperty( + "trak.tkhd.duration", + (MP4Property**)&m_pTrackDurationProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.mdhd.duration", + (MP4Property**)&m_pMediaDurationProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.tkhd.modificationTime", + (MP4Property**)&m_pTrackModificationProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.mdhd.modificationTime", + (MP4Property**)&m_pMediaModificationProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.hdlr.handlerType", + (MP4Property**)&m_pTypeProperty); + + // get handles on sample size information + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsz.sampleSize", + (MP4Property**)&m_pStszFixedSampleSizeProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsz.sampleCount", + (MP4Property**)&m_pStszSampleCountProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsz.entries.sampleSize", + (MP4Property**)&m_pStszSampleSizeProperty); + + // get handles on information needed to map sample id's to file offsets + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsc.entryCount", + (MP4Property**)&m_pStscCountProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsc.entries.firstChunk", + (MP4Property**)&m_pStscFirstChunkProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsc.entries.samplesPerChunk", + (MP4Property**)&m_pStscSamplesPerChunkProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsc.entries.sampleDescriptionIndex", + (MP4Property**)&m_pStscSampleDescrIndexProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsc.entries.firstSample", + (MP4Property**)&m_pStscFirstSampleProperty); + + bool haveStco = m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stco.entryCount", + (MP4Property**)&m_pChunkCountProperty); + + if (haveStco) { + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stco.entries.chunkOffset", + (MP4Property**)&m_pChunkOffsetProperty); + } else { + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.co64.entryCount", + (MP4Property**)&m_pChunkCountProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.co64.entries.chunkOffset", + (MP4Property**)&m_pChunkOffsetProperty); + } + + // get handles on sample timing info + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stts.entryCount", + (MP4Property**)&m_pSttsCountProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stts.entries.sampleCount", + (MP4Property**)&m_pSttsSampleCountProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stts.entries.sampleDelta", + (MP4Property**)&m_pSttsSampleDeltaProperty); + + // get handles on rendering offset info if it exists + + m_pCttsCountProperty = NULL; + m_pCttsSampleCountProperty = NULL; + m_pCttsSampleOffsetProperty = NULL; + + bool haveCtts = m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.ctts.entryCount", + (MP4Property**)&m_pCttsCountProperty); + + if (haveCtts) { + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.ctts.entries.sampleCount", + (MP4Property**)&m_pCttsSampleCountProperty); + + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.ctts.entries.sampleOffset", + (MP4Property**)&m_pCttsSampleOffsetProperty); + } + + // get handles on sync sample info if it exists + + m_pStssCountProperty = NULL; + m_pStssSampleProperty = NULL; + + bool haveStss = m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stss.entryCount", + (MP4Property**)&m_pStssCountProperty); + + if (haveStss) { + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stss.entries.sampleNumber", + (MP4Property**)&m_pStssSampleProperty); + } + + // edit list + InitEditListProperties(); + + // was everything found? + if (!success) { + throw new MP4Error("invalid track", "MP4Track::MP4Track"); + } +} + +MP4Track::~MP4Track() +{ + MP4Free(m_pCachedReadSample); + MP4Free(m_pChunkBuffer); +} + +const char* MP4Track::GetType() +{ + return m_pTypeProperty->GetValue(); +} + +void MP4Track::SetType(const char* type) +{ + m_pTypeProperty->SetValue(NormalizeTrackType(type)); +} + +void MP4Track::ReadSample( + MP4SampleId sampleId, + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + MP4Timestamp* pStartTime, + MP4Duration* pDuration, + MP4Duration* pRenderingOffset, + bool* pIsSyncSample) +{ + if (sampleId == MP4_INVALID_SAMPLE_ID) { + throw new MP4Error("sample id can't be zero", + "MP4Track::ReadSample"); + } + + // handle unusual case of wanting to read a sample + // that is still sitting in the write chunk buffer + if (m_pChunkBuffer && sampleId >= m_writeSampleId - m_chunkSamples) { + WriteChunkBuffer(); + } + + FILE* pFile = GetSampleFile(sampleId); + + if (pFile == (FILE*)-1) { + throw new MP4Error("sample is located in an inaccessible file", + "MP4Track::ReadSample"); + } + + u_int64_t fileOffset = GetSampleFileOffset(sampleId); + + u_int32_t sampleSize = GetSampleSize(sampleId); + if (*ppBytes != NULL && *pNumBytes < sampleSize) { + throw new MP4Error("sample buffer is too small", + "MP4Track::ReadSample"); + } + *pNumBytes = sampleSize; + + VERBOSE_READ_SAMPLE(m_pFile->GetVerbosity(), + printf("ReadSample: track %u id %u offset 0x"LLX" size %u (0x%x)\n", + m_trackId, sampleId, fileOffset, *pNumBytes, *pNumBytes)); + + bool bufferMalloc = false; + if (*ppBytes == NULL) { + *ppBytes = (u_int8_t*)MP4Malloc(*pNumBytes); + bufferMalloc = true; + } + + u_int64_t oldPos = m_pFile->GetPosition(pFile); // only used in mode == 'w' + try { + m_pFile->SetPosition(fileOffset, pFile); + m_pFile->ReadBytes(*ppBytes, *pNumBytes, pFile); + + if (pStartTime || pDuration) { + GetSampleTimes(sampleId, pStartTime, pDuration); + + VERBOSE_READ_SAMPLE(m_pFile->GetVerbosity(), + printf("ReadSample: start "LLU" duration "LLD"\n", + (pStartTime ? *pStartTime : 0), + (pDuration ? *pDuration : 0))); + } + if (pRenderingOffset) { + *pRenderingOffset = GetSampleRenderingOffset(sampleId); + + VERBOSE_READ_SAMPLE(m_pFile->GetVerbosity(), + printf("ReadSample: renderingOffset "LLD"\n", + *pRenderingOffset)); + } + if (pIsSyncSample) { + *pIsSyncSample = IsSyncSample(sampleId); + + VERBOSE_READ_SAMPLE(m_pFile->GetVerbosity(), + printf("ReadSample: isSyncSample %u\n", + *pIsSyncSample)); + } + } + + catch (MP4Error* e) { + if (bufferMalloc) { + // let's not leak memory + MP4Free(*ppBytes); + *ppBytes = NULL; + } + if (m_pFile->GetMode() == 'w') { + m_pFile->SetPosition(oldPos, pFile); + } + throw e; + } + + if (m_pFile->GetMode() == 'w') { + m_pFile->SetPosition(oldPos, pFile); + } +} + +void MP4Track::ReadSampleFragment( + MP4SampleId sampleId, + u_int32_t sampleOffset, + u_int16_t sampleLength, + u_int8_t* pDest) +{ + if (sampleId == MP4_INVALID_SAMPLE_ID) { + throw new MP4Error("invalid sample id", + "MP4Track::ReadSampleFragment"); + } + + if (sampleId != m_cachedReadSampleId) { + MP4Free(m_pCachedReadSample); + m_pCachedReadSample = NULL; + m_cachedReadSampleSize = 0; + m_cachedReadSampleId = MP4_INVALID_SAMPLE_ID; + + ReadSample( + sampleId, + &m_pCachedReadSample, + &m_cachedReadSampleSize); + + m_cachedReadSampleId = sampleId; + } + + if (sampleOffset + sampleLength > m_cachedReadSampleSize) { + throw new MP4Error("offset and/or length are too large", + "MP4Track::ReadSampleFragment"); + } + + memcpy(pDest, &m_pCachedReadSample[sampleOffset], sampleLength); +} + +void MP4Track::WriteSample( + const u_int8_t* pBytes, + u_int32_t numBytes, + MP4Duration duration, + MP4Duration renderingOffset, + bool isSyncSample) +{ + VERBOSE_WRITE_SAMPLE(m_pFile->GetVerbosity(), + printf("WriteSample: track %u id %u size %u (0x%x) ", + m_trackId, m_writeSampleId, numBytes, numBytes)); + + if (pBytes == NULL && numBytes > 0) { + throw new MP4Error("no sample data", "MP4WriteSample"); + } + + if (duration == MP4_INVALID_DURATION) { + duration = GetFixedSampleDuration(); + } + + VERBOSE_WRITE_SAMPLE(m_pFile->GetVerbosity(), + printf("duration "LLU"\n", duration)); + + // append sample bytes to chunk buffer + m_pChunkBuffer = (u_int8_t*)MP4Realloc(m_pChunkBuffer, + m_chunkBufferSize + numBytes); + memcpy(&m_pChunkBuffer[m_chunkBufferSize], pBytes, numBytes); + m_chunkBufferSize += numBytes; + m_chunkSamples++; + m_chunkDuration += duration; + + UpdateSampleSizes(m_writeSampleId, numBytes); + + UpdateSampleTimes(duration); + + UpdateRenderingOffsets(m_writeSampleId, renderingOffset); + + UpdateSyncSamples(m_writeSampleId, isSyncSample); + + if (IsChunkFull(m_writeSampleId)) { + WriteChunkBuffer(); + } + + UpdateDurations(duration); + + UpdateModificationTimes(); + + m_writeSampleId++; +} + +void MP4Track::WriteChunkBuffer() +{ + if (m_chunkBufferSize == 0) { + return; + } + + u_int64_t chunkOffset = m_pFile->GetPosition(); + + // write chunk buffer + m_pFile->WriteBytes(m_pChunkBuffer, m_chunkBufferSize); + + VERBOSE_WRITE_SAMPLE(m_pFile->GetVerbosity(), + printf("WriteChunk: track %u offset 0x"LLX" size %u (0x%x) numSamples %u\n", + m_trackId, chunkOffset, m_chunkBufferSize, + m_chunkBufferSize, m_chunkSamples)); + + UpdateSampleToChunk(m_writeSampleId, + m_pChunkCountProperty->GetValue() + 1, + m_chunkSamples); + + UpdateChunkOffsets(chunkOffset); + + // clean up chunk buffer + MP4Free(m_pChunkBuffer); + m_pChunkBuffer = NULL; + m_chunkBufferSize = 0; + m_chunkSamples = 0; + m_chunkDuration = 0; +} + +void MP4Track::FinishWrite() +{ + // write out any remaining samples in chunk buffer + WriteChunkBuffer(); + + // record buffer size and bitrates + MP4BitfieldProperty* pBufferSizeProperty; + + if (m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsd.*.esds.decConfigDescr.bufferSizeDB", + (MP4Property**)&pBufferSizeProperty)) { + pBufferSizeProperty->SetValue(GetMaxSampleSize()); + } + + MP4Integer32Property* pBitrateProperty; + + if (m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsd.*.esds.decConfigDescr.maxBitrate", + (MP4Property**)&pBitrateProperty)) { + pBitrateProperty->SetValue(GetMaxBitrate()); + } + + if (m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsd.*.esds.decConfigDescr.avgBitrate", + (MP4Property**)&pBitrateProperty)) { + pBitrateProperty->SetValue(GetAvgBitrate()); + } +} + +bool MP4Track::IsChunkFull(MP4SampleId sampleId) +{ + if (m_samplesPerChunk) { + return m_chunkSamples >= m_samplesPerChunk; + } + + ASSERT(m_durationPerChunk); + return m_chunkDuration >= m_durationPerChunk; +} + +u_int32_t MP4Track::GetNumberOfSamples() +{ + return m_pStszSampleCountProperty->GetValue(); +} + +u_int32_t MP4Track::GetSampleSize(MP4SampleId sampleId) +{ + u_int32_t fixedSampleSize = + m_pStszFixedSampleSizeProperty->GetValue(); + + if (fixedSampleSize != 0) { + return fixedSampleSize; + } + return m_pStszSampleSizeProperty->GetValue(sampleId - 1); +} + +u_int32_t MP4Track::GetMaxSampleSize() +{ + u_int32_t fixedSampleSize = + m_pStszFixedSampleSizeProperty->GetValue(); + + if (fixedSampleSize != 0) { + return fixedSampleSize; + } + + u_int32_t maxSampleSize = 0; + u_int32_t numSamples = m_pStszSampleSizeProperty->GetCount(); + for (MP4SampleId sid = 1; sid <= numSamples; sid++) { + u_int32_t sampleSize = + m_pStszSampleSizeProperty->GetValue(sid - 1); + if (sampleSize > maxSampleSize) { + maxSampleSize = sampleSize; + } + } + return maxSampleSize; +} + +u_int64_t MP4Track::GetTotalOfSampleSizes() +{ + u_int32_t fixedSampleSize = + m_pStszFixedSampleSizeProperty->GetValue(); + + // if fixed sample size, just need to multiply by number of samples + if (fixedSampleSize != 0) { + return fixedSampleSize * GetNumberOfSamples(); + } + + // else non-fixed sample size, sum them + u_int64_t totalSampleSizes = 0; + u_int32_t numSamples = m_pStszSampleSizeProperty->GetCount(); + for (MP4SampleId sid = 1; sid <= numSamples; sid++) { + u_int32_t sampleSize = + m_pStszSampleSizeProperty->GetValue(sid - 1); + totalSampleSizes += sampleSize; + } + return totalSampleSizes; +} + +void MP4Track::UpdateSampleSizes(MP4SampleId sampleId, u_int32_t numBytes) +{ + // for first sample + if (sampleId == 1) { + if (numBytes > 0) { + // presume sample size is fixed + m_pStszFixedSampleSizeProperty->SetValue(numBytes); + } else { + // special case of first sample is zero bytes in length + // leave m_pStszFixedSampleSizeProperty at 0 + // start recording variable sample sizes + m_pStszSampleSizeProperty->AddValue(0); + } + + } else { // sampleId > 1 + u_int32_t fixedSampleSize = + m_pStszFixedSampleSizeProperty->GetValue(); + + if (fixedSampleSize == 0 || numBytes != fixedSampleSize) { + // sample size is not fixed + + if (fixedSampleSize) { + // need to clear fixed sample size + m_pStszFixedSampleSizeProperty->SetValue(0); + + // and create sizes for all previous samples + for (MP4SampleId sid = 1; sid < sampleId; sid++) { + m_pStszSampleSizeProperty->AddValue(fixedSampleSize); + } + } + + // add size value for this sample + m_pStszSampleSizeProperty->AddValue(numBytes); + } + } + + m_pStszSampleCountProperty->IncrementValue(); +} + +u_int32_t MP4Track::GetAvgBitrate() +{ + if (GetDuration() == 0) { + return 0; + } + + u_int64_t durationSecs = + MP4ConvertTime(GetDuration(), GetTimeScale(), MP4_SECS_TIME_SCALE); + + if (GetDuration() % GetTimeScale() != 0) { + durationSecs++; + } + + return (GetTotalOfSampleSizes() * 8) / durationSecs; +} + +u_int32_t MP4Track::GetMaxBitrate() +{ + u_int32_t timeScale = GetTimeScale(); + MP4SampleId numSamples = GetNumberOfSamples(); + u_int32_t maxBytesPerSec = 0; + u_int32_t bytesThisSec = 0; + MP4Timestamp thisSec = 0; + + for (MP4SampleId sid = 1; sid <= numSamples; sid++) { + u_int32_t sampleSize; + MP4Timestamp sampleTime; + + sampleSize = GetSampleSize(sid); + + GetSampleTimes(sid, &sampleTime, NULL); + + // sample counts for current second + if (sampleTime < thisSec + timeScale) { + bytesThisSec += sampleSize; + } else { // sample is in a future second + if (bytesThisSec > maxBytesPerSec) { + maxBytesPerSec = bytesThisSec; + } + + thisSec = sampleTime - (sampleTime % timeScale); + bytesThisSec = sampleSize; + } + } + + // last second (or partial second) + if (bytesThisSec > maxBytesPerSec) { + maxBytesPerSec = bytesThisSec; + } + + return maxBytesPerSec * 8; +} + +u_int32_t MP4Track::GetSampleStscIndex(MP4SampleId sampleId) +{ + u_int32_t stscIndex; + u_int32_t numStscs = m_pStscCountProperty->GetValue(); + + if (numStscs == 0) { + throw new MP4Error("No data chunks exist", "GetSampleStscIndex"); + } + + for (stscIndex = 0; stscIndex < numStscs; stscIndex++) { + if (sampleId < m_pStscFirstSampleProperty->GetValue(stscIndex)) { + ASSERT(stscIndex != 0); + stscIndex -= 1; + break; + } + } + if (stscIndex == numStscs) { + ASSERT(stscIndex != 0); + stscIndex -= 1; + } + + return stscIndex; +} + +FILE* MP4Track::GetSampleFile(MP4SampleId sampleId) +{ + u_int32_t stscIndex = + GetSampleStscIndex(sampleId); + + u_int32_t stsdIndex = + m_pStscSampleDescrIndexProperty->GetValue(stscIndex); + + // check if the answer will be the same as last time + if (m_lastStsdIndex && stsdIndex == m_lastStsdIndex) { + return m_lastSampleFile; + } + + MP4Atom* pStsdAtom = + m_pTrakAtom->FindAtom("trak.mdia.minf.stbl.stsd"); + ASSERT(pStsdAtom); + + MP4Atom* pStsdEntryAtom = + pStsdAtom->GetChildAtom(stsdIndex - 1); + ASSERT(pStsdEntryAtom); + + MP4Integer16Property* pDrefIndexProperty = NULL; + pStsdEntryAtom->FindProperty( + "*.dataReferenceIndex", + (MP4Property**)&pDrefIndexProperty); + + if (pDrefIndexProperty == NULL) { + throw new MP4Error("invalid stsd entry", "GetSampleFile"); + } + + u_int32_t drefIndex = + pDrefIndexProperty->GetValue(); + + MP4Atom* pDrefAtom = + m_pTrakAtom->FindAtom("trak.mdia.minf.dinf.dref"); + ASSERT(pDrefAtom); + + MP4Atom* pUrlAtom = + pDrefAtom->GetChildAtom(drefIndex - 1); + ASSERT(pUrlAtom); + + FILE* pFile; + + if (pUrlAtom->GetFlags() & 1) { + pFile = NULL; // self-contained + } else { +#ifndef USE_FILE_CALLBACKS + MP4StringProperty* pLocationProperty = NULL; + pUrlAtom->FindProperty( + "*.location", + (MP4Property**)&pLocationProperty); + ASSERT(pLocationProperty); + + const char* url = pLocationProperty->GetValue(); + + VERBOSE_READ_SAMPLE(m_pFile->GetVerbosity(), + printf("dref url = %s\n", url)); + + pFile = (FILE*)-1; + + // attempt to open url if it's a file url + // currently this is the only thing we understand + if (!strncmp(url, "file:", 5)) { + const char* fileName = url + 5; + if (!strncmp(fileName, "//", 2)) { + fileName = strchr(fileName + 2, '/'); + } + if (fileName) { + pFile = fopen(fileName, "rb"); + if (!pFile) { + pFile = (FILE*)-1; + } + } + } +#else + throw new MP4Error(errno, "Function not supported when using callbacks", "GetSampleFile"); +#endif + } + + if (m_lastSampleFile) { +#ifndef USE_FILE_CALLBACKS + fclose(m_lastSampleFile); +#else + throw new MP4Error(errno, "Function not supported when using callbacks", "GetSampleFile"); +#endif + } + + // cache the answer + m_lastStsdIndex = stsdIndex; + m_lastSampleFile = pFile; + + return pFile; +} + +u_int64_t MP4Track::GetSampleFileOffset(MP4SampleId sampleId) +{ + u_int32_t stscIndex = + GetSampleStscIndex(sampleId); + + u_int32_t firstChunk = + m_pStscFirstChunkProperty->GetValue(stscIndex); + + MP4SampleId firstSample = + m_pStscFirstSampleProperty->GetValue(stscIndex); + + u_int32_t samplesPerChunk = + m_pStscSamplesPerChunkProperty->GetValue(stscIndex); + + MP4ChunkId chunkId = firstChunk + + ((sampleId - firstSample) / samplesPerChunk); + + u_int64_t chunkOffset = m_pChunkOffsetProperty->GetValue(chunkId - 1); + + MP4SampleId firstSampleInChunk = + sampleId - ((sampleId - firstSample) % samplesPerChunk); + + // need cumulative samples sizes from firstSample to sampleId - 1 + u_int32_t sampleOffset = 0; + for (MP4SampleId i = firstSampleInChunk; i < sampleId; i++) { + sampleOffset += GetSampleSize(i); + } + + return chunkOffset + sampleOffset; +} + +void MP4Track::UpdateSampleToChunk(MP4SampleId sampleId, + MP4ChunkId chunkId, u_int32_t samplesPerChunk) +{ + u_int32_t numStsc = m_pStscCountProperty->GetValue(); + + // if samplesPerChunk == samplesPerChunk of last entry + if (numStsc && samplesPerChunk == + m_pStscSamplesPerChunkProperty->GetValue(numStsc-1)) { + + // nothing to do + + } else { + // add stsc entry + m_pStscFirstChunkProperty->AddValue(chunkId); + m_pStscSamplesPerChunkProperty->AddValue(samplesPerChunk); + m_pStscSampleDescrIndexProperty->AddValue(1); + m_pStscFirstSampleProperty->AddValue(sampleId - samplesPerChunk + 1); + + m_pStscCountProperty->IncrementValue(); + } +} + +void MP4Track::UpdateChunkOffsets(u_int64_t chunkOffset) +{ + if (m_pChunkOffsetProperty->GetType() == Integer32Property) { + ((MP4Integer32Property*)m_pChunkOffsetProperty)->AddValue(chunkOffset); + } else { + ((MP4Integer64Property*)m_pChunkOffsetProperty)->AddValue(chunkOffset); + } + m_pChunkCountProperty->IncrementValue(); +} + +MP4Duration MP4Track::GetFixedSampleDuration() +{ + u_int32_t numStts = m_pSttsCountProperty->GetValue(); + + if (numStts == 0) { + return m_fixedSampleDuration; + } + if (numStts != 1) { + return MP4_INVALID_DURATION; // sample duration is not fixed + } + return m_pSttsSampleDeltaProperty->GetValue(0); +} + +bool MP4Track::SetFixedSampleDuration(MP4Duration duration) +{ + u_int32_t numStts = m_pSttsCountProperty->GetValue(); + + // setting this is only allowed before samples have been written + if (numStts != 0) { + return false; + } + m_fixedSampleDuration = duration; + return true; +} + +void MP4Track::GetSampleTimes(MP4SampleId sampleId, + MP4Timestamp* pStartTime, MP4Duration* pDuration) +{ + u_int32_t numStts = m_pSttsCountProperty->GetValue(); + MP4SampleId sid = 1; + MP4Duration elapsed = 0; + + for (u_int32_t sttsIndex = 0; sttsIndex < numStts; sttsIndex++) { + u_int32_t sampleCount = + m_pSttsSampleCountProperty->GetValue(sttsIndex); + u_int32_t sampleDelta = + m_pSttsSampleDeltaProperty->GetValue(sttsIndex); + + if (sampleId <= sid + sampleCount - 1) { + if (pStartTime) { + *pStartTime = (sampleId - sid); + *pStartTime *= sampleDelta; + *pStartTime += elapsed; + } + if (pDuration) { + *pDuration = sampleDelta; + } + return; + } + sid += sampleCount; + elapsed += sampleCount * sampleDelta; + } + + throw new MP4Error("sample id out of range", + "MP4Track::GetSampleTimes"); +} + +MP4SampleId MP4Track::GetSampleIdFromTime( + MP4Timestamp when, + bool wantSyncSample) +{ + u_int32_t numStts = m_pSttsCountProperty->GetValue(); + MP4SampleId sid = 1; + MP4Duration elapsed = 0; + + for (u_int32_t sttsIndex = 0; sttsIndex < numStts; sttsIndex++) { + u_int32_t sampleCount = + m_pSttsSampleCountProperty->GetValue(sttsIndex); + u_int32_t sampleDelta = + m_pSttsSampleDeltaProperty->GetValue(sttsIndex); + + if (sampleDelta == 0 && sttsIndex < numStts - 1) { + VERBOSE_READ(m_pFile->GetVerbosity(), + printf("Warning: Zero sample duration, stts entry %u\n", + sttsIndex)); + } + + MP4Duration d = when - elapsed; + + if (d <= sampleCount * sampleDelta) { + MP4SampleId sampleId = sid; + if (sampleDelta) { + sampleId += (d / sampleDelta); + } + + if (wantSyncSample) { + return GetNextSyncSample(sampleId); + } + return sampleId; + } + + sid += sampleCount; + elapsed += sampleCount * sampleDelta; + } + + throw new MP4Error("time out of range", + "MP4Track::GetSampleIdFromTime"); + + return 0; // satisfy MS compiler +} + +void MP4Track::UpdateSampleTimes(MP4Duration duration) +{ + u_int32_t numStts = m_pSttsCountProperty->GetValue(); + + // if duration == duration of last entry + if (numStts + && duration == m_pSttsSampleDeltaProperty->GetValue(numStts-1)) { + // increment last entry sampleCount + m_pSttsSampleCountProperty->IncrementValue(1, numStts-1); + + } else { + // add stts entry, sampleCount = 1, sampleDuration = duration + m_pSttsSampleCountProperty->AddValue(1); + m_pSttsSampleDeltaProperty->AddValue(duration); + m_pSttsCountProperty->IncrementValue();; + } +} + +u_int32_t MP4Track::GetSampleCttsIndex(MP4SampleId sampleId, + MP4SampleId* pFirstSampleId) +{ + u_int32_t numCtts = m_pCttsCountProperty->GetValue(); + + MP4SampleId sid = 1; + + for (u_int32_t cttsIndex = 0; cttsIndex < numCtts; cttsIndex++) { + u_int32_t sampleCount = + m_pCttsSampleCountProperty->GetValue(cttsIndex); + + if (sampleId <= sid + sampleCount - 1) { + if (pFirstSampleId) { + *pFirstSampleId = sid; + } + return cttsIndex; + } + sid += sampleCount; + } + + throw new MP4Error("sample id out of range", + "MP4Track::GetSampleCttsIndex"); + return 0; // satisfy MS compiler +} + +MP4Duration MP4Track::GetSampleRenderingOffset(MP4SampleId sampleId) +{ + if (m_pCttsCountProperty == NULL) { + return 0; + } + if (m_pCttsCountProperty->GetValue() == 0) { + return 0; + } + + u_int32_t cttsIndex = GetSampleCttsIndex(sampleId); + + return m_pCttsSampleOffsetProperty->GetValue(cttsIndex); +} + +void MP4Track::UpdateRenderingOffsets(MP4SampleId sampleId, + MP4Duration renderingOffset) +{ + // if ctts atom doesn't exist + if (m_pCttsCountProperty == NULL) { + + // no rendering offset, so nothing to do + if (renderingOffset == 0) { + return; + } + + // else create a ctts atom + MP4Atom* pCttsAtom = AddAtom("trak.mdia.minf.stbl", "ctts"); + + // and get handles on the properties + pCttsAtom->FindProperty( + "ctts.entryCount", + (MP4Property**)&m_pCttsCountProperty); + + pCttsAtom->FindProperty( + "ctts.entries.sampleCount", + (MP4Property**)&m_pCttsSampleCountProperty); + + pCttsAtom->FindProperty( + "ctts.entries.sampleOffset", + (MP4Property**)&m_pCttsSampleOffsetProperty); + + // if this is not the first sample + if (sampleId > 1) { + // add a ctts entry for all previous samples + // with rendering offset equal to zero + m_pCttsSampleCountProperty->AddValue(sampleId - 1); + m_pCttsSampleOffsetProperty->AddValue(0); + m_pCttsCountProperty->IncrementValue();; + } + } + + // ctts atom exists (now) + + u_int32_t numCtts = m_pCttsCountProperty->GetValue(); + + // if renderingOffset == renderingOffset of last entry + if (numCtts && renderingOffset + == m_pCttsSampleOffsetProperty->GetValue(numCtts-1)) { + + // increment last entry sampleCount + m_pCttsSampleCountProperty->IncrementValue(1, numCtts-1); + + } else { + // add ctts entry, sampleCount = 1, sampleOffset = renderingOffset + m_pCttsSampleCountProperty->AddValue(1); + m_pCttsSampleOffsetProperty->AddValue(renderingOffset); + m_pCttsCountProperty->IncrementValue(); + } +} + +void MP4Track::SetSampleRenderingOffset(MP4SampleId sampleId, + MP4Duration renderingOffset) +{ + // check if any ctts entries exist + if (m_pCttsCountProperty == NULL + || m_pCttsCountProperty->GetValue() == 0) { + // if not then Update routine can be used + // to create a ctts entry for samples before this one + // and a ctts entry for this sample + UpdateRenderingOffsets(sampleId, renderingOffset); + + // but we also need a ctts entry + // for all samples after this one + u_int32_t afterSamples = GetNumberOfSamples() - sampleId; + + if (afterSamples) { + m_pCttsSampleCountProperty->AddValue(afterSamples); + m_pCttsSampleOffsetProperty->AddValue(0); + m_pCttsCountProperty->IncrementValue();; + } + + return; + } + + MP4SampleId firstSampleId; + u_int32_t cttsIndex = GetSampleCttsIndex(sampleId, &firstSampleId); + + // do nothing in the degenerate case + if (renderingOffset == + m_pCttsSampleOffsetProperty->GetValue(cttsIndex)) { + return; + } + + u_int32_t sampleCount = + m_pCttsSampleCountProperty->GetValue(cttsIndex); + + // if this sample has it's own ctts entry + if (sampleCount == 1) { + // then just set the value, + // note we don't attempt to collapse entries + m_pCttsSampleOffsetProperty->SetValue(renderingOffset, cttsIndex); + return; + } + + MP4SampleId lastSampleId = firstSampleId + sampleCount - 1; + + // else we share this entry with other samples + // we need to insert our own entry + if (sampleId == firstSampleId) { + // our sample is the first one + m_pCttsSampleCountProperty-> + InsertValue(1, cttsIndex); + m_pCttsSampleOffsetProperty-> + InsertValue(renderingOffset, cttsIndex); + + m_pCttsSampleCountProperty-> + SetValue(sampleCount - 1, cttsIndex + 1); + + m_pCttsCountProperty->IncrementValue(); + + } else if (sampleId == lastSampleId) { + // our sample is the last one + m_pCttsSampleCountProperty-> + InsertValue(1, cttsIndex + 1); + m_pCttsSampleOffsetProperty-> + InsertValue(renderingOffset, cttsIndex + 1); + + m_pCttsSampleCountProperty-> + SetValue(sampleCount - 1, cttsIndex); + + m_pCttsCountProperty->IncrementValue(); + + } else { + // our sample is in the middle, UGH! + + // insert our new entry + m_pCttsSampleCountProperty-> + InsertValue(1, cttsIndex + 1); + m_pCttsSampleOffsetProperty-> + InsertValue(renderingOffset, cttsIndex + 1); + + // adjust count of previous entry + m_pCttsSampleCountProperty-> + SetValue(sampleId - firstSampleId, cttsIndex); + + // insert new entry for those samples beyond our sample + m_pCttsSampleCountProperty-> + InsertValue(lastSampleId - sampleId, cttsIndex + 2); + u_int32_t oldRenderingOffset = + m_pCttsSampleOffsetProperty->GetValue(cttsIndex); + m_pCttsSampleOffsetProperty-> + InsertValue(oldRenderingOffset, cttsIndex + 2); + + m_pCttsCountProperty->IncrementValue(2); + } +} + +bool MP4Track::IsSyncSample(MP4SampleId sampleId) +{ + if (m_pStssCountProperty == NULL) { + return true; + } + + u_int32_t numStss = m_pStssCountProperty->GetValue(); + + for (u_int32_t stssIndex = 0; stssIndex < numStss; stssIndex++) { + MP4SampleId syncSampleId = + m_pStssSampleProperty->GetValue(stssIndex); + + if (sampleId == syncSampleId) { + return true; + } + if (sampleId < syncSampleId) { + break; + } + } + + return false; +} + +// N.B. "next" is inclusive of this sample id +MP4SampleId MP4Track::GetNextSyncSample(MP4SampleId sampleId) +{ + if (m_pStssCountProperty == NULL) { + return sampleId; + } + + u_int32_t numStss = m_pStssCountProperty->GetValue(); + + for (u_int32_t stssIndex = 0; stssIndex < numStss; stssIndex++) { + MP4SampleId syncSampleId = + m_pStssSampleProperty->GetValue(stssIndex); + + if (sampleId > syncSampleId) { + continue; + } + return syncSampleId; + } + + // LATER check stsh for alternate sample + + return MP4_INVALID_SAMPLE_ID; +} + +void MP4Track::UpdateSyncSamples(MP4SampleId sampleId, bool isSyncSample) +{ + if (isSyncSample) { + // if stss atom exists, add entry + if (m_pStssCountProperty) { + m_pStssSampleProperty->AddValue(sampleId); + m_pStssCountProperty->IncrementValue(); + } // else nothing to do (yet) + + } else { // !isSyncSample + // if stss atom doesn't exist, create one + if (m_pStssCountProperty == NULL) { + + MP4Atom* pStssAtom = AddAtom("trak.mdia.minf.stbl", "stss"); + + pStssAtom->FindProperty( + "stss.entryCount", + (MP4Property**)&m_pStssCountProperty); + + pStssAtom->FindProperty( + "stss.entries.sampleNumber", + (MP4Property**)&m_pStssSampleProperty); + + // set values for all samples that came before this one + for (MP4SampleId sid = 1; sid < sampleId; sid++) { + m_pStssSampleProperty->AddValue(sid); + m_pStssCountProperty->IncrementValue(); + } + } // else nothing to do + } +} + +MP4Atom* MP4Track::AddAtom(char* parentName, char* childName) +{ + MP4Atom* pChildAtom = MP4Atom::CreateAtom(childName); + + MP4Atom* pParentAtom = m_pTrakAtom->FindAtom(parentName); + ASSERT(pParentAtom); + + pParentAtom->AddChildAtom(pChildAtom); + + pChildAtom->Generate(); + + return pChildAtom; +} + +u_int64_t MP4Track::GetDuration() +{ + return m_pMediaDurationProperty->GetValue(); +} + +u_int32_t MP4Track::GetTimeScale() +{ + return m_pTimeScaleProperty->GetValue(); +} + +void MP4Track::UpdateDurations(MP4Duration duration) +{ + // update media, track, and movie durations + m_pMediaDurationProperty->SetValue( + m_pMediaDurationProperty->GetValue() + duration); + + MP4Duration movieDuration = ToMovieDuration(duration); + m_pTrackDurationProperty->SetValue( + m_pTrackDurationProperty->GetValue() + movieDuration); + + m_pFile->UpdateDuration(m_pTrackDurationProperty->GetValue()); +} + +MP4Duration MP4Track::ToMovieDuration(MP4Duration trackDuration) +{ + return (trackDuration * m_pFile->GetTimeScale()) + / m_pTimeScaleProperty->GetValue(); +} + +void MP4Track::UpdateModificationTimes() +{ + // update media and track modification times + MP4Timestamp now = MP4GetAbsTimestamp(); + m_pMediaModificationProperty->SetValue(now); + m_pTrackModificationProperty->SetValue(now); +} + +u_int32_t MP4Track::GetNumberOfChunks() +{ + return m_pChunkOffsetProperty->GetCount(); +} + +u_int32_t MP4Track::GetChunkStscIndex(MP4ChunkId chunkId) +{ + u_int32_t stscIndex; + u_int32_t numStscs = m_pStscCountProperty->GetValue(); + + ASSERT(chunkId); + ASSERT(numStscs > 0); + + for (stscIndex = 0; stscIndex < numStscs; stscIndex++) { + if (chunkId < m_pStscFirstChunkProperty->GetValue(stscIndex)) { + ASSERT(stscIndex != 0); + break; + } + } + return stscIndex - 1; +} + +MP4Timestamp MP4Track::GetChunkTime(MP4ChunkId chunkId) +{ + u_int32_t stscIndex = GetChunkStscIndex(chunkId); + + MP4ChunkId firstChunkId = + m_pStscFirstChunkProperty->GetValue(stscIndex); + + MP4SampleId firstSample = + m_pStscFirstSampleProperty->GetValue(stscIndex); + + u_int32_t samplesPerChunk = + m_pStscSamplesPerChunkProperty->GetValue(stscIndex); + + MP4SampleId firstSampleInChunk = + firstSample + ((chunkId - firstChunkId) * samplesPerChunk); + + MP4Timestamp chunkTime; + + GetSampleTimes(firstSampleInChunk, &chunkTime, NULL); + + return chunkTime; +} + +u_int32_t MP4Track::GetChunkSize(MP4ChunkId chunkId) +{ + u_int32_t stscIndex = GetChunkStscIndex(chunkId); + + MP4ChunkId firstChunkId = + m_pStscFirstChunkProperty->GetValue(stscIndex); + + MP4SampleId firstSample = + m_pStscFirstSampleProperty->GetValue(stscIndex); + + u_int32_t samplesPerChunk = + m_pStscSamplesPerChunkProperty->GetValue(stscIndex); + + MP4SampleId firstSampleInChunk = + firstSample + ((chunkId - firstChunkId) * samplesPerChunk); + + // need cumulative sizes of samples in chunk + u_int32_t chunkSize = 0; + for (u_int32_t i = 0; i < samplesPerChunk; i++) { + chunkSize += GetSampleSize(firstSampleInChunk + i); + } + + return chunkSize; +} + +void MP4Track::ReadChunk(MP4ChunkId chunkId, + u_int8_t** ppChunk, u_int32_t* pChunkSize) +{ + ASSERT(chunkId); + ASSERT(ppChunk); + ASSERT(pChunkSize); + + u_int64_t chunkOffset = + m_pChunkOffsetProperty->GetValue(chunkId - 1); + + *pChunkSize = GetChunkSize(chunkId); + *ppChunk = (u_int8_t*)MP4Malloc(*pChunkSize); + + VERBOSE_READ_SAMPLE(m_pFile->GetVerbosity(), + printf("ReadChunk: track %u id %u offset 0x"LLX" size %u (0x%x)\n", + m_trackId, chunkId, chunkOffset, *pChunkSize, *pChunkSize)); + + u_int64_t oldPos = m_pFile->GetPosition(); // only used in mode == 'w' + try { + m_pFile->SetPosition(chunkOffset); + m_pFile->ReadBytes(*ppChunk, *pChunkSize); + } + catch (MP4Error* e) { + // let's not leak memory + MP4Free(*ppChunk); + *ppChunk = NULL; + + if (m_pFile->GetMode() == 'w') { + m_pFile->SetPosition(oldPos); + } + throw e; + } + + if (m_pFile->GetMode() == 'w') { + m_pFile->SetPosition(oldPos); + } +} + +void MP4Track::RewriteChunk(MP4ChunkId chunkId, + u_int8_t* pChunk, u_int32_t chunkSize) +{ + u_int64_t chunkOffset = m_pFile->GetPosition(); + + m_pFile->WriteBytes(pChunk, chunkSize); + + m_pChunkOffsetProperty->SetValue(chunkOffset, chunkId - 1); + + VERBOSE_WRITE_SAMPLE(m_pFile->GetVerbosity(), + printf("RewriteChunk: track %u id %u offset 0x"LLX" size %u (0x%x)\n", + m_trackId, chunkId, chunkOffset, chunkSize, chunkSize)); +} + +// map track type name aliases to official names + +const char* MP4Track::NormalizeTrackType(const char* type) +{ + if (!strcasecmp(type, "vide") + || !strcasecmp(type, "video") + || !strcasecmp(type, "mp4v") + || !strcasecmp(type, "encv")) { + return MP4_VIDEO_TRACK_TYPE; + } + + if (!strcasecmp(type, "soun") + || !strcasecmp(type, "sound") + || !strcasecmp(type, "audio") + || !strcasecmp(type, "enca") // ismacrypt + || !strcasecmp(type, "mp4a")) { + return MP4_AUDIO_TRACK_TYPE; + } + + if (!strcasecmp(type, "sdsm") + || !strcasecmp(type, "scene") + || !strcasecmp(type, "bifs")) { + return MP4_SCENE_TRACK_TYPE; + } + + if (!strcasecmp(type, "odsm") + || !strcasecmp(type, "od")) { + return MP4_OD_TRACK_TYPE; + } + + return type; +} + +bool MP4Track::InitEditListProperties() +{ + m_pElstCountProperty = NULL; + m_pElstMediaTimeProperty = NULL; + m_pElstDurationProperty = NULL; + m_pElstRateProperty = NULL; + m_pElstReservedProperty = NULL; + + MP4Atom* pElstAtom = + m_pTrakAtom->FindAtom("trak.edts.elst"); + + if (!pElstAtom) { + return false; + } + + pElstAtom->FindProperty( + "elst.entryCount", + (MP4Property**)&m_pElstCountProperty); + + pElstAtom->FindProperty( + "elst.entries.mediaTime", + (MP4Property**)&m_pElstMediaTimeProperty); + + pElstAtom->FindProperty( + "elst.entries.segmentDuration", + (MP4Property**)&m_pElstDurationProperty); + + pElstAtom->FindProperty( + "elst.entries.mediaRate", + (MP4Property**)&m_pElstRateProperty); + + pElstAtom->FindProperty( + "elst.entries.reserved", + (MP4Property**)&m_pElstReservedProperty); + + return m_pElstCountProperty + && m_pElstMediaTimeProperty + && m_pElstDurationProperty + && m_pElstRateProperty + && m_pElstReservedProperty; +} + +MP4EditId MP4Track::AddEdit(MP4EditId editId) +{ + if (!m_pElstCountProperty) { + m_pFile->AddDescendantAtoms(m_pTrakAtom, "edts.elst"); + InitEditListProperties(); + } + + if (editId == MP4_INVALID_EDIT_ID) { + editId = m_pElstCountProperty->GetValue() + 1; + } + + m_pElstMediaTimeProperty->InsertValue(0, editId - 1); + m_pElstDurationProperty->InsertValue(0, editId - 1); + m_pElstRateProperty->InsertValue(1, editId - 1); + m_pElstReservedProperty->InsertValue(0, editId - 1); + + m_pElstCountProperty->IncrementValue(); + + return editId; +} + +void MP4Track::DeleteEdit(MP4EditId editId) +{ + if (editId == MP4_INVALID_EDIT_ID) { + throw new MP4Error("edit id can't be zero", + "MP4Track::DeleteEdit"); + } + + if (!m_pElstCountProperty + || m_pElstCountProperty->GetValue() == 0) { + throw new MP4Error("no edits exist", + "MP4Track::DeleteEdit"); + } + + m_pElstMediaTimeProperty->DeleteValue(editId - 1); + m_pElstDurationProperty->DeleteValue(editId - 1); + m_pElstRateProperty->DeleteValue(editId - 1); + m_pElstReservedProperty->DeleteValue(editId - 1); + + m_pElstCountProperty->IncrementValue(-1); + + // clean up if last edit is deleted + if (m_pElstCountProperty->GetValue() == 0) { + m_pElstCountProperty = NULL; + m_pElstMediaTimeProperty = NULL; + m_pElstDurationProperty = NULL; + m_pElstRateProperty = NULL; + m_pElstReservedProperty = NULL; + + m_pTrakAtom->DeleteChildAtom( + m_pTrakAtom->FindAtom("trak.edts")); + } +} + +MP4Timestamp MP4Track::GetEditStart( + MP4EditId editId) +{ + if (editId == MP4_INVALID_EDIT_ID) { + return MP4_INVALID_TIMESTAMP; + } else if (editId == 1) { + return 0; + } + return (MP4Timestamp)GetEditTotalDuration(editId - 1); +} + +MP4Duration MP4Track::GetEditTotalDuration( + MP4EditId editId) +{ + u_int32_t numEdits = 0; + + if (m_pElstCountProperty) { + numEdits = m_pElstCountProperty->GetValue(); + } + + if (editId == MP4_INVALID_EDIT_ID) { + editId = numEdits; + } + + if (numEdits == 0 || editId > numEdits) { + return MP4_INVALID_DURATION; + } + + MP4Duration totalDuration = 0; + + for (MP4EditId eid = 1; eid <= editId; eid++) { + totalDuration += + m_pElstDurationProperty->GetValue(eid - 1); + } + + return totalDuration; +} + +MP4SampleId MP4Track::GetSampleIdFromEditTime( + MP4Timestamp editWhen, + MP4Timestamp* pStartTime, + MP4Duration* pDuration) +{ + MP4SampleId sampleId = MP4_INVALID_SAMPLE_ID; + u_int32_t numEdits = 0; + + if (m_pElstCountProperty) { + numEdits = m_pElstCountProperty->GetValue(); + } + + if (numEdits) { + MP4Duration editElapsedDuration = 0; + + for (MP4EditId editId = 1; editId <= numEdits; editId++) { + // remember edit segment's start time (in edit timeline) + MP4Timestamp editStartTime = + (MP4Timestamp)editElapsedDuration; + + // accumulate edit segment's duration + editElapsedDuration += + m_pElstDurationProperty->GetValue(editId - 1); + + // calculate difference between the specified edit time + // and the end of this edit segment + if (editElapsedDuration - editWhen <= 0) { + // the specified time has not yet been reached + continue; + } + + // 'editWhen' is within this edit segment + + // calculate the specified edit time + // relative to just this edit segment + MP4Duration editOffset = + editWhen - editStartTime; + + // calculate the media (track) time that corresponds + // to the specified edit time based on the edit list + MP4Timestamp mediaWhen = + m_pElstMediaTimeProperty->GetValue(editId - 1) + + editOffset; + + // lookup the sample id for the media time + sampleId = GetSampleIdFromTime(mediaWhen, false); + + // lookup the sample's media start time and duration + MP4Timestamp sampleStartTime; + MP4Duration sampleDuration; + + GetSampleTimes(sampleId, &sampleStartTime, &sampleDuration); + + // calculate the difference if any between when the sample + // would naturally start and when it starts in the edit timeline + MP4Duration sampleStartOffset = + mediaWhen - sampleStartTime; + + // calculate the start time for the sample in the edit time line + MP4Timestamp editSampleStartTime = + editWhen - MIN(editOffset, sampleStartOffset); + + MP4Duration editSampleDuration = 0; + + // calculate how long this sample lasts in the edit list timeline + if (m_pElstRateProperty->GetValue(editId - 1) == 0) { + // edit segment is a "dwell" + // so sample duration is that of the edit segment + editSampleDuration = + m_pElstDurationProperty->GetValue(editId - 1); + + } else { + // begin with the natural sample duration + editSampleDuration = sampleDuration; + + // now shorten that if the edit segment starts + // after the sample would naturally start + if (editOffset < sampleStartOffset) { + editSampleDuration -= sampleStartOffset - editOffset; + } + + // now shorten that if the edit segment ends + // before the sample would naturally end + if (editElapsedDuration + < editSampleStartTime + sampleDuration) { + editSampleDuration -= (editSampleStartTime + sampleDuration) + - editElapsedDuration; + } + } + + if (pStartTime) { + *pStartTime = editSampleStartTime; + } + + if (pDuration) { + *pDuration = editSampleDuration; + } + + VERBOSE_EDIT(m_pFile->GetVerbosity(), + printf("GetSampleIdFromEditTime: when %llu " + "sampleId %u start %llu duration %lld\n", + editWhen, sampleId, + editSampleStartTime, editSampleDuration)); + + return sampleId; + } + + throw new MP4Error("time out of range", + "MP4Track::GetSampleIdFromEditTime"); + + } else { // no edit list + sampleId = GetSampleIdFromTime(editWhen, false); + + if (pStartTime || pDuration) { + GetSampleTimes(sampleId, pStartTime, pDuration); + } + } + + return sampleId; +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4track.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4track.h @@ -0,0 +1,240 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MP4_TRACK_INCLUDED__ +#define __MP4_TRACK_INCLUDED__ + +typedef u_int32_t MP4ChunkId; + +// forward declarations +class MP4File; +class MP4Atom; +class MP4Property; +class MP4IntegerProperty; +class MP4Integer16Property; +class MP4Integer32Property; +class MP4Integer64Property; +class MP4StringProperty; + +class MP4Track { +public: + MP4Track(MP4File* pFile, MP4Atom* pTrakAtom); + + virtual ~MP4Track(); + + MP4TrackId GetId() { + return m_trackId; + } + + const char* GetType(); + + void SetType(const char* type); + + MP4File* GetFile() { + return m_pFile; + } + + MP4Atom* GetTrakAtom() { + return m_pTrakAtom; + } + + void ReadSample( + // input parameters + MP4SampleId sampleId, + // output parameters + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + MP4Timestamp* pStartTime = NULL, + MP4Duration* pDuration = NULL, + MP4Duration* pRenderingOffset = NULL, + bool* pIsSyncSample = NULL); + + void WriteSample( + const u_int8_t* pBytes, + u_int32_t numBytes, + MP4Duration duration = 0, + MP4Duration renderingOffset = 0, + bool isSyncSample = true); + + virtual void FinishWrite(); + + u_int64_t GetDuration(); // in track timeScale units + u_int32_t GetTimeScale(); + u_int32_t GetNumberOfSamples(); + u_int32_t GetSampleSize(MP4SampleId sampleId); + u_int32_t GetMaxSampleSize(); + u_int64_t GetTotalOfSampleSizes(); + u_int32_t GetAvgBitrate(); // in bps + u_int32_t GetMaxBitrate(); // in bps + + MP4Duration GetFixedSampleDuration(); + bool SetFixedSampleDuration(MP4Duration duration); + + void GetSampleTimes(MP4SampleId sampleId, + MP4Timestamp* pStartTime, MP4Duration* pDuration); + + bool IsSyncSample(MP4SampleId sampleId); + + MP4SampleId GetSampleIdFromTime( + MP4Timestamp when, + bool wantSyncSample = false); + + MP4Duration GetSampleRenderingOffset(MP4SampleId sampleId); + void SetSampleRenderingOffset(MP4SampleId sampleId, + MP4Duration renderingOffset); + + MP4EditId AddEdit( + MP4EditId editId = MP4_INVALID_EDIT_ID); + + void DeleteEdit( + MP4EditId editId); + + MP4Timestamp GetEditStart( + MP4EditId editId); + + MP4Timestamp GetEditTotalDuration( + MP4EditId editId); + + MP4SampleId GetSampleIdFromEditTime( + MP4Timestamp editWhen, + MP4Timestamp* pStartTime = NULL, + MP4Duration* pDuration = NULL); + + static const char* NormalizeTrackType(const char* type); + + // special operation for use during hint track packet assembly + void ReadSampleFragment( + MP4SampleId sampleId, + u_int32_t sampleOffset, + u_int16_t sampleLength, + u_int8_t* pDest); + + // special operations for use during optimization + + u_int32_t GetNumberOfChunks(); + + MP4Timestamp GetChunkTime(MP4ChunkId chunkId); + + void ReadChunk(MP4ChunkId chunkId, + u_int8_t** ppChunk, u_int32_t* pChunkSize); + + void RewriteChunk(MP4ChunkId chunkId, + u_int8_t* pChunk, u_int32_t chunkSize); + +protected: + bool InitEditListProperties(); + + FILE* GetSampleFile(MP4SampleId sampleId); + u_int64_t GetSampleFileOffset(MP4SampleId sampleId); + u_int32_t GetSampleStscIndex(MP4SampleId sampleId); + u_int32_t GetChunkStscIndex(MP4ChunkId chunkId); + u_int32_t GetChunkSize(MP4ChunkId chunkId); + u_int32_t GetSampleCttsIndex(MP4SampleId sampleId, + MP4SampleId* pFirstSampleId = NULL); + MP4SampleId GetNextSyncSample(MP4SampleId sampleId); + + void UpdateSampleSizes(MP4SampleId sampleId, + u_int32_t numBytes); + bool IsChunkFull(MP4SampleId sampleId); + void UpdateSampleToChunk(MP4SampleId sampleId, + MP4ChunkId chunkId, u_int32_t samplesPerChunk); + void UpdateChunkOffsets(u_int64_t chunkOffset); + void UpdateSampleTimes(MP4Duration duration); + void UpdateRenderingOffsets(MP4SampleId sampleId, + MP4Duration renderingOffset); + void UpdateSyncSamples(MP4SampleId sampleId, + bool isSyncSample); + + MP4Atom* AddAtom(char* parentName, char* childName); + + void UpdateDurations(MP4Duration duration); + MP4Duration ToMovieDuration(MP4Duration trackDuration); + + void UpdateModificationTimes(); + + void WriteChunkBuffer(); + +protected: + MP4File* m_pFile; + MP4Atom* m_pTrakAtom; // moov.trak[] + MP4TrackId m_trackId; // moov.trak[].tkhd.trackId + MP4StringProperty* m_pTypeProperty; // moov.trak[].mdia.hdlr.handlerType + + u_int32_t m_lastStsdIndex; + FILE* m_lastSampleFile; + + // for efficient construction of hint track packets + MP4SampleId m_cachedReadSampleId; + u_int8_t* m_pCachedReadSample; + u_int32_t m_cachedReadSampleSize; + + // for writing + MP4SampleId m_writeSampleId; + MP4Duration m_fixedSampleDuration; + u_int8_t* m_pChunkBuffer; + u_int32_t m_chunkBufferSize; + u_int32_t m_chunkSamples; + MP4Duration m_chunkDuration; + + // controls for chunking + u_int32_t m_samplesPerChunk; + MP4Duration m_durationPerChunk; + + MP4Integer32Property* m_pTimeScaleProperty; + MP4IntegerProperty* m_pTrackDurationProperty; // 32 or 64 bits + MP4IntegerProperty* m_pMediaDurationProperty; // 32 or 64 bits + MP4IntegerProperty* m_pTrackModificationProperty; // 32 or 64 bits + MP4IntegerProperty* m_pMediaModificationProperty; // 32 or 64 bits + + MP4Integer32Property* m_pStszFixedSampleSizeProperty; + MP4Integer32Property* m_pStszSampleCountProperty; + MP4Integer32Property* m_pStszSampleSizeProperty; + + MP4Integer32Property* m_pStscCountProperty; + MP4Integer32Property* m_pStscFirstChunkProperty; + MP4Integer32Property* m_pStscSamplesPerChunkProperty; + MP4Integer32Property* m_pStscSampleDescrIndexProperty; + MP4Integer32Property* m_pStscFirstSampleProperty; + + MP4Integer32Property* m_pChunkCountProperty; + MP4IntegerProperty* m_pChunkOffsetProperty; // 32 or 64 bits + + MP4Integer32Property* m_pSttsCountProperty; + MP4Integer32Property* m_pSttsSampleCountProperty; + MP4Integer32Property* m_pSttsSampleDeltaProperty; + + MP4Integer32Property* m_pCttsCountProperty; + MP4Integer32Property* m_pCttsSampleCountProperty; + MP4Integer32Property* m_pCttsSampleOffsetProperty; + + MP4Integer32Property* m_pStssCountProperty; + MP4Integer32Property* m_pStssSampleProperty; + + MP4Integer32Property* m_pElstCountProperty; + MP4IntegerProperty* m_pElstMediaTimeProperty; // 32 or 64 bits + MP4IntegerProperty* m_pElstDurationProperty; // 32 or 64 bits + MP4Integer16Property* m_pElstRateProperty; + MP4Integer16Property* m_pElstReservedProperty; +}; + +MP4ARRAY_DECL(MP4Track, MP4Track*); + +#endif /* __MP4_TRACK_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4util.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4util.cpp @@ -0,0 +1,238 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +void MP4Error::Print(FILE* pFile) +{ + fprintf(pFile, "MP4ERROR: "); + if (m_where) { + fprintf(pFile, "%s", m_where); + } + if (m_errstring) { + if (m_where) { + fprintf(pFile, ": "); + } + fprintf(pFile, "%s", m_errstring); + } + if (m_errno) { + if (m_where || m_errstring) { + fprintf(pFile, ": "); + } + fprintf(pFile, "%s", strerror(m_errno)); + } + fprintf(pFile, "\n"); +} + +void MP4HexDump( + u_int8_t* pBytes, u_int32_t numBytes, + FILE* pFile, u_int8_t indent) +{ + if (pFile == NULL) { + pFile = stdout; + } + Indent(pFile, indent); + fprintf(pFile, "<%u bytes> ", numBytes); + for (u_int32_t i = 0; i < numBytes; i++) { + if ((i % 16) == 0 && numBytes > 16) { + fprintf(pFile, "\n"); + Indent(pFile, indent); + } + fprintf(pFile, "%02x ", pBytes[i]); + } + fprintf(pFile, "\n"); +} + +bool MP4NameFirstMatches(const char* s1, const char* s2) +{ + if (s1 == NULL || *s1 == '\0' || s2 == NULL || *s2 == '\0') { + return false; + } + + if (*s2 == '*') { + return true; + } + + while (*s1 != '\0') { + if (*s2 == '\0' || strchr("[.", *s2)) { + break; + } + if (tolower(*s1) != tolower(*s2)) { + return false; + } + s1++; + s2++; + } + return true; +} + +bool MP4NameFirstIndex(const char* s, u_int32_t* pIndex) +{ + if (s == NULL) { + return false; + } + + while (*s != '\0' && *s != '.') { + if (*s == '[') { + s++; + ASSERT(pIndex); + if (sscanf(s, "%u", pIndex) != 1) { + return false; + } + return true; + } + s++; + } + return false; +} + +char* MP4NameFirst(const char *s) +{ + if (s == NULL) { + return NULL; + } + + const char* end = s; + + while (*end != '\0' && *end != '.') { + end++; + } + + char* first = (char*)MP4Calloc((end - s) + 1); + + if (first) { + strncpy(first, s, end - s); + } + + return first; +} + +const char* MP4NameAfterFirst(const char *s) +{ + if (s == NULL) { + return NULL; + } + + while (*s != '\0') { + if (*s == '.') { + s++; + if (*s == '\0') { + return NULL; + } + return s; + } + s++; + } + return NULL; +} + +char* MP4ToBase16(const u_int8_t* pData, u_int32_t dataSize) +{ + if (dataSize) { + ASSERT(pData); + } + + char* s = (char*)MP4Calloc((2 * dataSize) + 1); + + u_int32_t i, j; + for (i = 0, j = 0; i < dataSize; i++) { + sprintf(&s[j], "%02x", pData[i]); + j += 2; + } + + return s; /* N.B. caller is responsible for free'ing s */ +} + +char* MP4ToBase64(const u_int8_t* pData, u_int32_t dataSize) +{ + if (dataSize) { + ASSERT(pData); + } + + static char encoding[64] = { + 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P', + 'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f', + 'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v', + 'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/' + }; + + char* s = (char*)MP4Calloc((((dataSize + 2) * 4) / 3) + 1); + + const u_int8_t* src = pData; + char* dest = s; + u_int32_t numGroups = dataSize / 3; + + for (u_int32_t i = 0; i < numGroups; i++) { + *dest++ = encoding[src[0] >> 2]; + *dest++ = encoding[((src[0] & 0x03) << 4) | (src[1] >> 4)]; + *dest++ = encoding[((src[1] & 0x0F) << 2) | (src[2] >> 6)]; + *dest++ = encoding[src[2] & 0x3F]; + src += 3; + } + + if (dataSize % 3 == 1) { + *dest++ = encoding[src[0] >> 2]; + *dest++ = encoding[((src[0] & 0x03) << 4)]; + *dest++ = '='; + *dest++ = '='; + } else if (dataSize % 3 == 2) { + *dest++ = encoding[src[0] >> 2]; + *dest++ = encoding[((src[0] & 0x03) << 4) | (src[1] >> 4)]; + *dest++ = encoding[((src[1] & 0x0F) << 2)]; + *dest++ = '='; + } + + return s; /* N.B. caller is responsible for free'ing s */ +} + +// log2 of value, rounded up +static u_int8_t ilog2(u_int64_t value) +{ + u_int64_t powerOf2 = 1; + for (u_int8_t i = 0; i < 64; i++) { + if (value <= powerOf2) { + return i; + } + powerOf2 <<= 1; + } + return 64; +} + +u_int64_t MP4ConvertTime(u_int64_t t, + u_int32_t oldTimeScale, u_int32_t newTimeScale) +{ + // avoid float point exception + if (oldTimeScale == 0) { + throw new MP4Error("division by zero", "MP4ConvertTime"); + } + + // check if we can safely use integer operations + if (ilog2(t) + ilog2(newTimeScale) <= 64) { + return (t * newTimeScale) / oldTimeScale; + } + + // final resort is to use floating point + double d = ((double)newTimeScale / (double)oldTimeScale) + 0.5; + d *= UINT64_TO_DOUBLE(t); + + return (u_int64_t)d; +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mp4util.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mp4util.h @@ -0,0 +1,235 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MP4_UTIL_INCLUDED__ +#define __MP4_UTIL_INCLUDED__ +#include + +#ifndef ASSERT +#ifdef NDEBUG +#define ASSERT(expr) +#else +#define ASSERT(expr) \ + if (!(expr)) { \ + fflush(stdout); \ + assert((expr)); \ + } +#endif +#endif +#ifdef NDEBUG +#define WARNING(expr) +#else +#define WARNING(expr) \ + if (expr) { \ + fflush(stdout); \ + fprintf(stderr, "Warning (%s) in %s at line %u\n", \ + __STRING(expr), __FILE__, __LINE__); \ + } +#endif + +#define VERBOSE(exprverbosity, verbosity, expr) \ + if (((exprverbosity) & (verbosity)) == (exprverbosity)) { expr; } + +#define VERBOSE_ERROR(verbosity, expr) \ + VERBOSE(MP4_DETAILS_ERROR, verbosity, expr) + +#define VERBOSE_WARNING(verbosity, expr) \ + VERBOSE(MP4_DETAILS_WARNING, verbosity, expr) + +#define VERBOSE_READ(verbosity, expr) \ + VERBOSE(MP4_DETAILS_READ, verbosity, expr) + +#define VERBOSE_READ_TABLE(verbosity, expr) \ + VERBOSE((MP4_DETAILS_READ | MP4_DETAILS_TABLE), verbosity, expr) + +#define VERBOSE_READ_SAMPLE(verbosity, expr) \ + VERBOSE((MP4_DETAILS_READ | MP4_DETAILS_SAMPLE), verbosity, expr) + +#define VERBOSE_READ_HINT(verbosity, expr) \ + VERBOSE((MP4_DETAILS_READ | MP4_DETAILS_HINT), verbosity, expr) + +#define VERBOSE_WRITE(verbosity, expr) \ + VERBOSE(MP4_DETAILS_WRITE, verbosity, expr) + +#define VERBOSE_WRITE_TABLE(verbosity, expr) \ + VERBOSE((MP4_DETAILS_WRITE | MP4_DETAILS_TABLE), verbosity, expr) + +#define VERBOSE_WRITE_SAMPLE(verbosity, expr) \ + VERBOSE((MP4_DETAILS_WRITE | MP4_DETAILS_SAMPLE), verbosity, expr) + +#define VERBOSE_WRITE_HINT(verbosity, expr) \ + VERBOSE((MP4_DETAILS_WRITE | MP4_DETAILS_HINT), verbosity, expr) + +#define VERBOSE_FIND(verbosity, expr) \ + VERBOSE(MP4_DETAILS_FIND, verbosity, expr) + +#define VERBOSE_ISMA(verbosity, expr) \ + VERBOSE(MP4_DETAILS_ISMA, verbosity, expr) + +#define VERBOSE_EDIT(verbosity, expr) \ + VERBOSE(MP4_DETAILS_EDIT, verbosity, expr) + +inline void Indent(FILE* pFile, u_int8_t depth) { + fprintf(pFile, "%*c", depth, ' '); +} + +inline void MP4Printf(const char* fmt, ...) { + va_list ap; + va_start(ap, fmt); + // TBD API call to set error_msg_func instead of just printf + fprintf(stdout, fmt, ap); + va_end(ap); +} + +class MP4Error { +public: + MP4Error() { + m_errno = 0; + m_errstring = NULL; + m_where = NULL; + m_free = 0; + } + ~MP4Error() { + if (m_free != 0) { + free((void *)m_errstring); + } + } + MP4Error(int err, const char* where = NULL) { + m_errno = err; + m_errstring = NULL; + m_where = where; + m_free = 0; + } + MP4Error(const char *format, const char *where, ...) { + char *string; + m_errno = 0; + string = (char *)malloc(512); + m_where = where; + if (string) { + va_list ap; + va_start(ap, where); + vsnprintf(string, 512, format, ap); + va_end(ap); + m_errstring = string; + m_free = 1; + } else { + m_errstring = format; + m_free = 0; + } + } + MP4Error(int err, const char* format, const char* where, ...) { + char *string; + m_errno = err; + string = (char *)malloc(512); + m_where = where; + if (string) { + va_list ap; + va_start(ap, where); + vsnprintf(string, 512, format, ap); + va_end(ap); + m_errstring = string; + m_free = 1; + } else { + m_errstring = format; + m_free = 0; + } + } + + void Print(FILE* pFile = stderr); + int m_free; + int m_errno; + const char* m_errstring; + const char* m_where; +}; + +void MP4HexDump( + u_int8_t* pBytes, u_int32_t numBytes, + FILE* pFile = stdout, u_int8_t indent = 0); + +inline void* MP4Malloc(size_t size) { + void* p = malloc(size); + if (p == NULL && size > 0) { + throw new MP4Error(errno); + } + return p; +} + +inline void* MP4Calloc(size_t size) { + return memset(MP4Malloc(size), 0, size); +} + +inline char* MP4Stralloc(const char* s1) { + char* s2 = (char*)MP4Malloc(strlen(s1) + 1); + strcpy(s2, s1); + return s2; +} + +inline void* MP4Realloc(void* p, u_int32_t newSize) { + // workaround library bug + if (p == NULL && newSize == 0) { + return NULL; + } + p = realloc(p, newSize); + if (p == NULL && newSize > 0) { + throw new MP4Error(errno); + } + return p; +} + +inline void MP4Free(void* p) { + free(p); +} + +inline u_int32_t STRTOINT32(const char* s) { + return (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3]; +} + +inline void INT32TOSTR(u_int32_t i, char* s) { + s[0] = ((i >> 24) & 0xFF); s[1] = ((i >> 16) & 0xFF); + s[2] = ((i >> 8) & 0xFF); s[3] = (i & 0xFF); s[4] = 0; +} + +inline MP4Timestamp MP4GetAbsTimestamp() { + struct timeval tv; + gettimeofday(&tv, NULL); + MP4Timestamp ret; + ret = tv.tv_sec; + ret += 2082844800; + return ret; // MP4 start date is 1/1/1904 + // 208284480 is (((1970 - 1904) * 365) + 17) * 24 * 60 * 60 +} + +u_int64_t MP4ConvertTime(u_int64_t t, + u_int32_t oldTimeScale, u_int32_t newTimeScale); + +bool MP4NameFirstMatches(const char* s1, const char* s2); + +bool MP4NameFirstIndex(const char* s, u_int32_t* pIndex); + +char* MP4NameFirst(const char *s); + +const char* MP4NameAfterFirst(const char *s); + +char* MP4ToBase16(const u_int8_t* pData, u_int32_t dataSize); + +char* MP4ToBase64(const u_int8_t* pData, u_int32_t dataSize); + +#endif /* __MP4_UTIL_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/mpeg4ip.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/mpeg4ip.h @@ -0,0 +1,59 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2000, 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MPEG4IP_INCLUDED__ +#define __MPEG4IP_INCLUDED__ + +/* project wide applicable stuff here */ + +#include +#include + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef __cplusplus +#ifndef bool +typedef unsigned char bool; +#endif +#endif + +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif +#ifndef MAX +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#endif + +#ifndef ROUND +# ifdef HAVE_RINT +# define ROUND(f) rint(f) +# else +# define ROUND(f) (int)(floor((f) + 0.5)) +# endif +#endif + +#endif /* __MPEG4IP_INCLUDED__ */ + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/need_for_win32.c +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/need_for_win32.c @@ -0,0 +1,12 @@ +#include "systems.h" +#include + +int gettimeofday (struct timeval *t, void *foo) +{ + struct _timeb temp; + _ftime(&temp); + t->tv_sec = temp.time; + t->tv_usec = temp.millitm * 1000; + return (0); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/ocidescriptors.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/ocidescriptors.cpp @@ -0,0 +1,307 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4ContentClassDescriptor::MP4ContentClassDescriptor() + : MP4Descriptor() +{ + AddProperty( /* 0 */ + new MP4Integer32Property("classificationEntity")); + AddProperty( /* 1 */ + new MP4Integer16Property("classificationTable")); + AddProperty( /* 2 */ + new MP4BytesProperty("contentClassificationData")); +} + +void MP4ContentClassDescriptor::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + /* byte properties need to know how long they are before reading */ + ((MP4BytesProperty*)m_pProperties[2])->SetValueSize(m_size - 6); + + ReadProperties(pFile); +} + +MP4KeywordDescriptor::MP4KeywordDescriptor() + : MP4Descriptor() +{ + AddProperty( /* 0 */ + new MP4BytesProperty("languageCode", 3)); + AddProperty( /* 1 */ + new MP4BitfieldProperty("isUTF8String", 1)); + AddProperty( /* 2 */ + new MP4BitfieldProperty("reserved", 7)); + MP4Integer8Property* pCount = + new MP4Integer8Property("keywordCount"); + AddProperty(pCount); /* 3 */ + + MP4TableProperty* pTable = new MP4TableProperty("keywords", pCount); + AddProperty(pTable); /* 4 */ + + pTable->AddProperty( /* 4, 0 */ + new MP4StringProperty("string", Counted)); + + SetReadMutate(2); +} + +void MP4KeywordDescriptor::Mutate() +{ + bool utf8Flag = ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(); + MP4Property* pProperty = + ((MP4TableProperty*)m_pProperties[4])->GetProperty(0); + ASSERT(pProperty); + ((MP4StringProperty*)pProperty)->SetUnicode(!utf8Flag); +} + +MP4RatingDescriptor::MP4RatingDescriptor() + : MP4Descriptor() +{ + AddProperty( /* 0 */ + new MP4Integer32Property("ratingEntity")); + AddProperty( /* 1 */ + new MP4Integer16Property("ratingCriteria")); + AddProperty( /* 2 */ + new MP4BytesProperty("ratingInfo")); +} + +void MP4RatingDescriptor::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + /* byte properties need to know how long they are before reading */ + ((MP4BytesProperty*)m_pProperties[2])->SetValueSize(m_size - 6); + + ReadProperties(pFile); +} + +MP4LanguageDescriptor::MP4LanguageDescriptor() + : MP4Descriptor() +{ + AddProperty( /* 0 */ + new MP4BytesProperty("languageCode", 3)); +} + +MP4ShortTextDescriptor::MP4ShortTextDescriptor() + : MP4Descriptor() +{ + AddProperty( /* 0 */ + new MP4BytesProperty("languageCode", 3)); + AddProperty( /* 1 */ + new MP4BitfieldProperty("isUTF8String", 1)); + AddProperty( /* 2 */ + new MP4BitfieldProperty("reserved", 7)); + AddProperty( /* 3 */ + new MP4StringProperty("eventName", Counted)); + AddProperty( /* 4 */ + new MP4StringProperty("eventText", Counted)); + + SetReadMutate(2); +} + +void MP4ShortTextDescriptor::Mutate() +{ + bool utf8Flag = ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(); + ((MP4StringProperty*)m_pProperties[3])->SetUnicode(!utf8Flag); + ((MP4StringProperty*)m_pProperties[4])->SetUnicode(!utf8Flag); +} + +MP4ExpandedTextDescriptor::MP4ExpandedTextDescriptor() + : MP4Descriptor() +{ + AddProperty( /* 0 */ + new MP4BytesProperty("languageCode", 3)); + AddProperty( /* 1 */ + new MP4BitfieldProperty("isUTF8String", 1)); + AddProperty( /* 2 */ + new MP4BitfieldProperty("reserved", 7)); + MP4Integer8Property* pCount = + new MP4Integer8Property("itemCount"); + AddProperty(pCount); /* 3 */ + + MP4TableProperty* pTable = new MP4TableProperty("items", pCount); + AddProperty(pTable); /* 4 */ + + pTable->AddProperty( /* Table 0 */ + new MP4StringProperty("itemDescription", Counted)); + pTable->AddProperty( /* Table 1 */ + new MP4StringProperty("itemText", Counted)); + + AddProperty( /* 5 */ + new MP4StringProperty("nonItemText")); + ((MP4StringProperty*)m_pProperties[5])->SetExpandedCountedFormat(true); + + SetReadMutate(2); +} + +void MP4ExpandedTextDescriptor::Mutate() +{ + bool utf8Flag = ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(); + + MP4Property* pProperty = + ((MP4TableProperty*)m_pProperties[4])->GetProperty(0); + ASSERT(pProperty); + ((MP4StringProperty*)pProperty)->SetUnicode(!utf8Flag); + + pProperty = ((MP4TableProperty*)m_pProperties[4])->GetProperty(1); + ASSERT(pProperty); + ((MP4StringProperty*)pProperty)->SetUnicode(!utf8Flag); + + ((MP4StringProperty*)m_pProperties[5])->SetUnicode(!utf8Flag); +} + +class MP4CreatorTableProperty : public MP4TableProperty { +public: + MP4CreatorTableProperty(char* name, MP4Integer8Property* pCountProperty) : + MP4TableProperty(name, pCountProperty) { + }; +protected: + void ReadEntry(MP4File* pFile, u_int32_t index); + void WriteEntry(MP4File* pFile, u_int32_t index); +}; + +MP4CreatorDescriptor::MP4CreatorDescriptor(u_int8_t tag) + : MP4Descriptor(tag) +{ + MP4Integer8Property* pCount = + new MP4Integer8Property("creatorCount"); + AddProperty(pCount); /* 0 */ + + MP4TableProperty* pTable = new MP4CreatorTableProperty("creators", pCount); + AddProperty(pTable); /* 1 */ + + pTable->AddProperty( /* Table 0 */ + new MP4BytesProperty("languageCode", 3)); + pTable->AddProperty( /* Table 1 */ + new MP4BitfieldProperty("isUTF8String", 1)); + pTable->AddProperty( /* Table 2 */ + new MP4BitfieldProperty("reserved", 7)); + pTable->AddProperty( /* Table 3 */ + new MP4StringProperty("name", Counted)); +} + +void MP4CreatorTableProperty::ReadEntry(MP4File* pFile, u_int32_t index) +{ + m_pProperties[0]->Read(pFile, index); + m_pProperties[1]->Read(pFile, index); + + bool utf8Flag = ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(index); + ((MP4StringProperty*)m_pProperties[3])->SetUnicode(!utf8Flag); + + m_pProperties[2]->Read(pFile, index); + m_pProperties[3]->Read(pFile, index); +} + +void MP4CreatorTableProperty::WriteEntry(MP4File* pFile, u_int32_t index) +{ + bool utf8Flag = ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(index); + ((MP4StringProperty*)m_pProperties[3])->SetUnicode(!utf8Flag); + + MP4TableProperty::WriteEntry(pFile, index); +} + +MP4CreationDescriptor::MP4CreationDescriptor(u_int8_t tag) + : MP4Descriptor(tag) +{ + AddProperty( /* 0 */ + new MP4BitfieldProperty("contentCreationDate", 40)); +} + +MP4SmpteCameraDescriptor::MP4SmpteCameraDescriptor() + : MP4Descriptor() +{ + MP4Integer8Property* pCount = + new MP4Integer8Property("parameterCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("parameters", pCount); + AddProperty(pTable); + + pTable->AddProperty( + new MP4Integer8Property("id")); + pTable->AddProperty( + new MP4Integer32Property("value")); +} + +MP4UnknownOCIDescriptor::MP4UnknownOCIDescriptor() + : MP4Descriptor() +{ + AddProperty( /* 0 */ + new MP4BytesProperty("data")); +} + +void MP4UnknownOCIDescriptor::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + /* byte properties need to know how long they are before reading */ + ((MP4BytesProperty*)m_pProperties[0])->SetValueSize(m_size); + + ReadProperties(pFile); +} + +MP4Descriptor* CreateOCIDescriptor(u_int8_t tag) +{ + MP4Descriptor* pDescriptor = NULL; + + switch (tag) { + case MP4ContentClassDescrTag: + pDescriptor = new MP4ContentClassDescriptor(); + break; + case MP4KeywordDescrTag: + pDescriptor = new MP4KeywordDescriptor(); + break; + case MP4RatingDescrTag: + pDescriptor = new MP4RatingDescriptor(); + break; + case MP4LanguageDescrTag: + pDescriptor = new MP4LanguageDescriptor(); + break; + case MP4ShortTextDescrTag: + pDescriptor = new MP4ShortTextDescriptor(); + break; + case MP4ExpandedTextDescrTag: + pDescriptor = new MP4ExpandedTextDescriptor(); + break; + case MP4ContentCreatorDescrTag: + case MP4OCICreatorDescrTag: + pDescriptor = new MP4CreatorDescriptor(tag); + break; + case MP4ContentCreationDescrTag: + case MP4OCICreationDescrTag: + pDescriptor = new MP4CreationDescriptor(tag); + break; + case MP4SmpteCameraDescrTag: + pDescriptor = new MP4SmpteCameraDescriptor(); + break; + } + + if (pDescriptor == NULL) { + if (tag >= MP4OCIDescrTagsStart && tag <= MP4OCIDescrTagsEnd) { + pDescriptor = new MP4UnknownOCIDescriptor(); + pDescriptor->SetTag(tag); + } + } + + return pDescriptor; +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/ocidescriptors.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/ocidescriptors.h @@ -0,0 +1,101 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __OCIDESCRIPTORS_INCLUDED__ +#define __OCIDESCRIPTORS_INCLUDED__ + +const u_int8_t MP4OCIDescrTagsStart = 0x40; +const u_int8_t MP4ContentClassDescrTag = 0x40; +const u_int8_t MP4KeywordDescrTag = 0x41; +const u_int8_t MP4RatingDescrTag = 0x42; +const u_int8_t MP4LanguageDescrTag = 0x43; +const u_int8_t MP4ShortTextDescrTag = 0x44; +const u_int8_t MP4ExpandedTextDescrTag = 0x45; +const u_int8_t MP4ContentCreatorDescrTag = 0x46; +const u_int8_t MP4ContentCreationDescrTag = 0x47; +const u_int8_t MP4OCICreatorDescrTag = 0x48; +const u_int8_t MP4OCICreationDescrTag = 0x49; +const u_int8_t MP4SmpteCameraDescrTag = 0x4A; +const u_int8_t MP4OCIDescrTagsEnd = 0x5F; + +class MP4ContentClassDescriptor : public MP4Descriptor { +public: + MP4ContentClassDescriptor(); + void Read(MP4File* pFile); +}; + +class MP4KeywordDescriptor : public MP4Descriptor { +public: + MP4KeywordDescriptor(); +protected: + void Mutate(); +}; + +class MP4RatingDescriptor : public MP4Descriptor { +public: + MP4RatingDescriptor(); + void Read(MP4File* pFile); +}; + +class MP4LanguageDescriptor : public MP4Descriptor { +public: + MP4LanguageDescriptor(); +}; + +class MP4ShortTextDescriptor : public MP4Descriptor { +public: + MP4ShortTextDescriptor(); +protected: + void Mutate(); +}; + +class MP4ExpandedTextDescriptor : public MP4Descriptor { +public: + MP4ExpandedTextDescriptor(); +protected: + void Mutate(); +}; + +class MP4CreatorDescriptor : public MP4Descriptor { +public: + MP4CreatorDescriptor(u_int8_t tag); +}; + +class MP4CreationDescriptor : public MP4Descriptor { +public: + MP4CreationDescriptor(u_int8_t tag); +}; + +class MP4SmpteCameraDescriptor : public MP4Descriptor { +public: + MP4SmpteCameraDescriptor(); +}; + +class MP4UnknownOCIDescriptor : public MP4Descriptor { +public: + MP4UnknownOCIDescriptor(); + void Read(MP4File* pFile); +}; + + +extern MP4Descriptor *CreateOCIDescriptor(u_int8_t tag); + +#endif /* __OCIDESCRIPTORS_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/odcommands.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/odcommands.cpp @@ -0,0 +1,104 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4ODUpdateDescriptor::MP4ODUpdateDescriptor() + : MP4Descriptor(MP4ODUpdateODCommandTag) +{ + // just a container for ObjectDescriptors + AddProperty( /* 0 */ + new MP4DescriptorProperty(NULL, + MP4FileODescrTag, 0, Required, Many)); +} + +MP4ODRemoveDescriptor::MP4ODRemoveDescriptor() + : MP4Descriptor(MP4ODRemoveODCommandTag) +{ + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + pCount->SetImplicit(); + AddProperty(pCount); /* 0 */ + + MP4TableProperty* pTable = + new MP4TableProperty("entries", pCount); + AddProperty(pTable); /* 1 */ + + pTable->AddProperty( /* 1, 0 */ + new MP4BitfieldProperty("objectDescriptorId", 10)); +} + +void MP4ODRemoveDescriptor::Read(MP4File* pFile) +{ + // table entry count computed from descriptor size + ((MP4Integer32Property*)m_pProperties[0])->SetReadOnly(false); + ((MP4Integer32Property*)m_pProperties[0])->SetValue((m_size * 8) / 10); + ((MP4Integer32Property*)m_pProperties[0])->SetReadOnly(true); + + MP4Descriptor::Read(pFile); +} + +MP4ESUpdateDescriptor::MP4ESUpdateDescriptor() + : MP4Descriptor(MP4ESUpdateODCommandTag) +{ + AddProperty( /* 0 */ + new MP4BitfieldProperty("objectDescriptorId", 10)); + AddProperty( /* 1 */ + new MP4BitfieldProperty("pad", 6)); + AddProperty( /* 2 */ + new MP4DescriptorProperty("esIdRefs", + MP4ESIDRefDescrTag, 0, Required, Many)); +} + +// LATER might be able to combine with ESUpdateDescriptor +MP4ESRemoveDescriptor::MP4ESRemoveDescriptor() + : MP4Descriptor(MP4ESRemoveODCommandTag) +{ + AddProperty( /* 0 */ + new MP4BitfieldProperty("objectDescriptorId", 10)); + AddProperty( /* 1 */ + new MP4BitfieldProperty("pad", 6)); + AddProperty( /* 2 */ + new MP4DescriptorProperty("esIdRefs", + MP4ESIDRefDescrTag, 0, Required, Many)); +} + +MP4Descriptor* CreateODCommand(u_int8_t tag) +{ + MP4Descriptor* pDescriptor = NULL; + + switch (tag) { + case MP4ODUpdateODCommandTag: + pDescriptor = new MP4ODUpdateDescriptor(); + break; + case MP4ODRemoveODCommandTag: + pDescriptor = new MP4ODRemoveDescriptor(); + break; + case MP4ESUpdateODCommandTag: + pDescriptor = new MP4ESUpdateDescriptor(); + break; + case MP4ESRemoveODCommandTag: + pDescriptor = new MP4ESRemoveDescriptor(); + break; + } + return pDescriptor; +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/odcommands.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/odcommands.h @@ -0,0 +1,58 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __ODCOMMANDS_INCLUDED__ +#define __ODCOMMANDS_INCLUDED__ + +// OD stream command descriptors +const u_int8_t MP4ODUpdateODCommandTag = 0x01; +const u_int8_t MP4ODRemoveODCommandTag = 0x02; +const u_int8_t MP4ESUpdateODCommandTag = 0x03; +const u_int8_t MP4ESRemoveODCommandTag = 0x04; +const u_int8_t MP4IPMPUpdateODCommandTag = 0x05; +const u_int8_t MP4IPMPRemoveODCommandTag = 0x06; +const u_int8_t MP4ESRemoveRefODCommandTag = 0x07; + +class MP4ODUpdateDescriptor : public MP4Descriptor { +public: + MP4ODUpdateDescriptor(); +}; + +class MP4ODRemoveDescriptor : public MP4Descriptor { +public: + MP4ODRemoveDescriptor(); + void Read(MP4File* pFile); +}; + +class MP4ESUpdateDescriptor : public MP4Descriptor { +public: + MP4ESUpdateDescriptor(); +}; + +class MP4ESRemoveDescriptor : public MP4Descriptor { +public: + MP4ESRemoveDescriptor(); +}; + +MP4Descriptor* CreateODCommand(u_int8_t tag); + +#endif /* __ODCOMMANDS_INCLUDED__ */ + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/qosqualifiers.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/qosqualifiers.cpp @@ -0,0 +1,133 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +MP4QosDescriptor::MP4QosDescriptor() + : MP4Descriptor(MP4QosDescrTag) +{ + AddProperty( /* 0 */ + new MP4Integer8Property("predefined")); + AddProperty( /* 1 */ + new MP4QosQualifierProperty("qualifiers", + MP4QosTagsStart, MP4QosTagsEnd, Optional, Many)); +} + +MP4MaxDelayQosQualifier::MP4MaxDelayQosQualifier() + : MP4QosQualifier(MP4MaxDelayQosTag) +{ + AddProperty( /* 0 */ + new MP4Integer32Property("maxDelay")); +} + +MP4PrefMaxDelayQosQualifier::MP4PrefMaxDelayQosQualifier() + : MP4QosQualifier(MP4PrefMaxDelayQosTag) +{ + AddProperty( /* 0 */ + new MP4Integer32Property("prefMaxDelay")); +} + +MP4LossProbQosQualifier::MP4LossProbQosQualifier() + : MP4QosQualifier(MP4LossProbQosTag) +{ + AddProperty( /* 0 */ + new MP4Float32Property("lossProb")); +} + +MP4MaxGapLossQosQualifier::MP4MaxGapLossQosQualifier() + : MP4QosQualifier(MP4MaxGapLossQosTag) +{ + AddProperty( /* 0 */ + new MP4Integer32Property("maxGapLoss")); +} + +MP4MaxAUSizeQosQualifier::MP4MaxAUSizeQosQualifier() + : MP4QosQualifier(MP4MaxAUSizeQosTag) +{ + AddProperty( /* 0 */ + new MP4Integer32Property("maxAUSize")); +} + +MP4AvgAUSizeQosQualifier::MP4AvgAUSizeQosQualifier() + : MP4QosQualifier(MP4AvgAUSizeQosTag) +{ + AddProperty( /* 0 */ + new MP4Integer32Property("avgAUSize")); +} + +MP4MaxAURateQosQualifier::MP4MaxAURateQosQualifier() + : MP4QosQualifier(MP4MaxAURateQosTag) +{ + AddProperty( /* 0 */ + new MP4Integer32Property("maxAURate")); +} + +MP4UnknownQosQualifier::MP4UnknownQosQualifier() + : MP4QosQualifier() +{ + AddProperty( /* 0 */ + new MP4BytesProperty("data")); +} + +void MP4UnknownQosQualifier::Read(MP4File* pFile) +{ + ReadHeader(pFile); + + /* byte properties need to know how long they are before reading */ + ((MP4BytesProperty*)m_pProperties[0])->SetValueSize(m_size); + + ReadProperties(pFile); +} + +MP4Descriptor* MP4QosQualifierProperty::CreateDescriptor(u_int8_t tag) +{ + MP4Descriptor* pDescriptor = NULL; + + switch (tag) { + case MP4MaxDelayQosTag: + pDescriptor = new MP4MaxDelayQosQualifier(); + break; + case MP4PrefMaxDelayQosTag: + pDescriptor = new MP4PrefMaxDelayQosQualifier(); + break; + case MP4LossProbQosTag: + pDescriptor = new MP4LossProbQosQualifier(); + break; + case MP4MaxGapLossQosTag: + pDescriptor = new MP4MaxGapLossQosQualifier(); + break; + case MP4MaxAUSizeQosTag: + pDescriptor = new MP4MaxAUSizeQosQualifier(); + break; + case MP4AvgAUSizeQosTag: + pDescriptor = new MP4AvgAUSizeQosQualifier(); + break; + case MP4MaxAURateQosTag: + pDescriptor = new MP4MaxAURateQosQualifier(); + break; + default: + pDescriptor = new MP4UnknownQosQualifier(); + pDescriptor->SetTag(tag); + } + + return pDescriptor; +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/qosqualifiers.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/qosqualifiers.h @@ -0,0 +1,85 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __QOSQUALIFIERS_INCLUDED__ +#define __QOSQUALIFIERS_INCLUDED__ + +const u_int8_t MP4QosDescrTag = 0x0C; + +class MP4QosDescriptor : public MP4Descriptor { +public: + MP4QosDescriptor(); +}; + +typedef MP4Descriptor MP4QosQualifier; + +const u_int8_t MP4QosTagsStart = 0x01; +const u_int8_t MP4MaxDelayQosTag = 0x01; +const u_int8_t MP4PrefMaxDelayQosTag = 0x02; +const u_int8_t MP4LossProbQosTag = 0x03; +const u_int8_t MP4MaxGapLossQosTag = 0x04; +const u_int8_t MP4MaxAUSizeQosTag = 0x41; +const u_int8_t MP4AvgAUSizeQosTag = 0x42; +const u_int8_t MP4MaxAURateQosTag = 0x43; +const u_int8_t MP4QosTagsEnd = 0xFF; + +class MP4MaxDelayQosQualifier : public MP4QosQualifier { +public: + MP4MaxDelayQosQualifier(); +}; + +class MP4PrefMaxDelayQosQualifier : public MP4QosQualifier { +public: + MP4PrefMaxDelayQosQualifier(); +}; + +class MP4LossProbQosQualifier : public MP4QosQualifier { +public: + MP4LossProbQosQualifier(); +}; + +class MP4MaxGapLossQosQualifier : public MP4QosQualifier { +public: + MP4MaxGapLossQosQualifier(); +}; + +class MP4MaxAUSizeQosQualifier : public MP4QosQualifier { +public: + MP4MaxAUSizeQosQualifier(); +}; + +class MP4AvgAUSizeQosQualifier : public MP4QosQualifier { +public: + MP4AvgAUSizeQosQualifier(); +}; + +class MP4MaxAURateQosQualifier : public MP4QosQualifier { +public: + MP4MaxAURateQosQualifier(); +}; + +class MP4UnknownQosQualifier : public MP4QosQualifier { +public: + MP4UnknownQosQualifier(); + void Read(MP4File* pFile); +}; + +#endif /* __QOSQUALIFIERS_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/rtphint.cpp +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/rtphint.cpp @@ -0,0 +1,1357 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +/* rtp hint track operations */ + +MP4RtpHintTrack::MP4RtpHintTrack(MP4File* pFile, MP4Atom* pTrakAtom) + : MP4Track(pFile, pTrakAtom) +{ + m_pRefTrack = NULL; + + m_pRtpMapProperty = NULL; + m_pPayloadNumberProperty = NULL; + m_pMaxPacketSizeProperty = NULL; + m_pSnroProperty = NULL; + m_pTsroProperty = NULL; + + m_pReadHint = NULL; + m_pReadHintSample = NULL; + m_readHintSampleSize = 0; + + m_pWriteHint = NULL; + m_writeHintId = MP4_INVALID_SAMPLE_ID; + m_writePacketId = 0; + + m_pTrpy = NULL; + m_pNump = NULL; + m_pTpyl = NULL; + m_pMaxr = NULL; + m_pDmed = NULL; + m_pDimm = NULL; + m_pPmax = NULL; + m_pDmax = NULL; + + m_pMaxPdu = NULL; + m_pAvgPdu = NULL; + m_pMaxBitRate = NULL; + m_pAvgBitRate = NULL; + + m_thisSec = 0; + m_bytesThisSec = 0; + m_bytesThisHint = 0; + m_bytesThisPacket = 0; +} + +MP4RtpHintTrack::~MP4RtpHintTrack() +{ + delete m_pReadHint; + delete m_pReadHintSample; + delete m_pWriteHint; +} + +void MP4RtpHintTrack::InitRefTrack() +{ + if (m_pRefTrack == NULL) { + MP4Integer32Property* pRefTrackIdProperty = NULL; + m_pTrakAtom->FindProperty( + "trak.tref.hint.entries[0].trackId", + (MP4Property**)&pRefTrackIdProperty); + ASSERT(pRefTrackIdProperty); + + m_pRefTrack = m_pFile->GetTrack(pRefTrackIdProperty->GetValue()); + } +} + +void MP4RtpHintTrack::InitRtpStart() +{ + struct timeval tv; + gettimeofday(&tv, NULL); + srandom((tv.tv_usec << 12) | (tv.tv_sec & 0xFFF)); + + ASSERT(m_pTrakAtom); + + m_pTrakAtom->FindProperty( + "trak.udta.hnti.rtp .snro.offset", + (MP4Property**)&m_pSnroProperty); + + if (m_pSnroProperty) { + m_rtpSequenceStart = m_pSnroProperty->GetValue(); + } else { + m_rtpSequenceStart = random(); + } + + m_pTrakAtom->FindProperty( + "trak.udta.hnti.rtp .tsro.offset", + (MP4Property**)&m_pTsroProperty); + + if (m_pTsroProperty) { + m_rtpTimestampStart = m_pTsroProperty->GetValue(); + } else { + m_rtpTimestampStart = random(); + } +} + +void MP4RtpHintTrack::ReadHint( + MP4SampleId hintSampleId, + u_int16_t* pNumPackets) +{ + if (m_pRefTrack == NULL) { + InitRefTrack(); + InitRtpStart(); + } + + // dispose of any old hint + delete m_pReadHint; + m_pReadHint = NULL; + delete m_pReadHintSample; + m_pReadHintSample = NULL; + m_readHintSampleSize = 0; + + // read the desired hint sample into memory + ReadSample( + hintSampleId, + &m_pReadHintSample, + &m_readHintSampleSize, + &m_readHintTimestamp); + + m_pFile->EnableMemoryBuffer(m_pReadHintSample, m_readHintSampleSize); + + m_pReadHint = new MP4RtpHint(this); + m_pReadHint->Read(m_pFile); + + m_pFile->DisableMemoryBuffer(); + + if (pNumPackets) { + *pNumPackets = GetHintNumberOfPackets(); + } +} + +u_int16_t MP4RtpHintTrack::GetHintNumberOfPackets() +{ + if (m_pReadHint == NULL) { + throw new MP4Error("no hint has been read", + "MP4GetRtpHintNumberOfPackets"); + } + return m_pReadHint->GetNumberOfPackets(); +} + +bool MP4RtpHintTrack::GetPacketBFrame(u_int16_t packetIndex) +{ + if (m_pReadHint == NULL) { + throw new MP4Error("no hint has been read", + "MP4GetRtpPacketBFrame"); + } + MP4RtpPacket* pPacket = + m_pReadHint->GetPacket(packetIndex); + + return pPacket->IsBFrame(); +} + +u_int16_t MP4RtpHintTrack::GetPacketTransmitOffset(u_int16_t packetIndex) +{ + if (m_pReadHint == NULL) { + throw new MP4Error("no hint has been read", + "MP4GetRtpPacketTransmitOffset"); + } + + MP4RtpPacket* pPacket = + m_pReadHint->GetPacket(packetIndex); + + return pPacket->GetTransmitOffset(); +} + +void MP4RtpHintTrack::ReadPacket( + u_int16_t packetIndex, + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + u_int32_t ssrc, + bool addHeader, + bool addPayload) +{ + if (m_pReadHint == NULL) { + throw new MP4Error("no hint has been read", + "MP4ReadRtpPacket"); + } + if (!addHeader && !addPayload) { + throw new MP4Error("no data requested", + "MP4ReadRtpPacket"); + } + + MP4RtpPacket* pPacket = + m_pReadHint->GetPacket(packetIndex); + + *pNumBytes = 0; + if (addHeader) { + *pNumBytes += 12; + } + if (addPayload) { + *pNumBytes += pPacket->GetDataSize(); + } + + // if needed, allocate the packet memory + bool buffer_malloc = false; + + if (*ppBytes == NULL) { + *ppBytes = (u_int8_t*)MP4Malloc(*pNumBytes); + buffer_malloc = true; + } + + try { + u_int8_t* pDest = *ppBytes; + + if (addHeader) { + *pDest++ = + 0x80 | (pPacket->GetPBit() << 5) | (pPacket->GetXBit() << 4); + + *pDest++ = + (pPacket->GetMBit() << 7) | pPacket->GetPayload(); + + *((u_int16_t*)pDest) = + htons(m_rtpSequenceStart + pPacket->GetSequenceNumber()); + pDest += 2; + + *((u_int32_t*)pDest) = + htonl(m_rtpTimestampStart + (u_int32_t)m_readHintTimestamp); + pDest += 4; + + *((u_int32_t*)pDest) = + htonl(ssrc); + pDest += 4; + } + + if (addPayload) { + pPacket->GetData(pDest); + } + } + catch (MP4Error* e) { + if (buffer_malloc) { + MP4Free(*ppBytes); + *ppBytes = NULL; + } + throw e; + } + + VERBOSE_READ_HINT(m_pFile->GetVerbosity(), + printf("ReadPacket: %u ", packetIndex); + MP4HexDump(*ppBytes, *pNumBytes);); +} + +MP4Timestamp MP4RtpHintTrack::GetRtpTimestampStart() +{ + if (m_pRefTrack == NULL) { + InitRefTrack(); + InitRtpStart(); + } + + return m_rtpTimestampStart; +} + +void MP4RtpHintTrack::SetRtpTimestampStart(MP4Timestamp start) +{ + if (!m_pTsroProperty) { + MP4Atom* pTsroAtom = + m_pFile->AddDescendantAtoms(m_pTrakAtom, "udta.hnti.rtp .tsro"); + + ASSERT(pTsroAtom); + + pTsroAtom->FindProperty("offset", + (MP4Property**)&m_pTsroProperty); + + ASSERT(m_pTsroProperty); + } + + m_pTsroProperty->SetValue(start); + m_rtpTimestampStart = start; +} + +void MP4RtpHintTrack::InitPayload() +{ + ASSERT(m_pTrakAtom); + + if (m_pRtpMapProperty == NULL) { + m_pTrakAtom->FindProperty( + "trak.udta.hinf.payt.rtpMap", + (MP4Property**)&m_pRtpMapProperty); + } + + if (m_pPayloadNumberProperty == NULL) { + m_pTrakAtom->FindProperty( + "trak.udta.hinf.payt.payloadNumber", + (MP4Property**)&m_pPayloadNumberProperty); + } + + if (m_pMaxPacketSizeProperty == NULL) { + m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsd.rtp .maxPacketSize", + (MP4Property**)&m_pMaxPacketSizeProperty); + } +} + +void MP4RtpHintTrack::GetPayload( + char** ppPayloadName, + u_int8_t* pPayloadNumber, + u_int16_t* pMaxPayloadSize, + char **ppEncodingParams) +{ + InitPayload(); + + if (ppPayloadName || ppEncodingParams) { + if (ppPayloadName) + *ppPayloadName = NULL; + if (ppEncodingParams) + *ppEncodingParams = NULL; + if (m_pRtpMapProperty) { + const char* pRtpMap = m_pRtpMapProperty->GetValue(); + char* pSlash = strchr(pRtpMap, '/'); + + u_int32_t length; + if (pSlash) { + length = pSlash - pRtpMap; + } else { + length = strlen(pRtpMap); + } + + if (ppPayloadName) { + *ppPayloadName = (char*)MP4Calloc(length + 1); + strncpy(*ppPayloadName, pRtpMap, length); + } + if (pSlash && ppEncodingParams) { + pSlash = strchr(pSlash, '/'); + if (pSlash != NULL) { + pSlash++; + if (pSlash != '\0') { + length = strlen(pRtpMap) - (pSlash - pRtpMap); + *ppEncodingParams = (char *)MP4Calloc(length + 1); + strncpy(*ppEncodingParams, pSlash, length); + } + } + } + } + } + + if (pPayloadNumber) { + if (m_pPayloadNumberProperty) { + *pPayloadNumber = m_pPayloadNumberProperty->GetValue(); + } else { + *pPayloadNumber = 0; + } + } + + if (pMaxPayloadSize) { + if (m_pMaxPacketSizeProperty) { + *pMaxPayloadSize = m_pMaxPacketSizeProperty->GetValue(); + } else { + *pMaxPayloadSize = 0; + } + } +} + +void MP4RtpHintTrack::SetPayload( + const char* payloadName, + u_int8_t payloadNumber, + u_int16_t maxPayloadSize, + const char *encoding_parms, + bool include_rtp_map, + bool include_mpeg4_esid) +{ + InitRefTrack(); + InitPayload(); + + ASSERT(m_pRtpMapProperty); + ASSERT(m_pPayloadNumberProperty); + ASSERT(m_pMaxPacketSizeProperty); + + size_t len = strlen(payloadName) + 16; + if (encoding_parms != NULL) { + size_t temp = strlen(encoding_parms); + if (temp == 0) { + encoding_parms = NULL; + } else { + len += temp; + } + } + + char* rtpMapBuf = (char*)MP4Malloc(len); + sprintf(rtpMapBuf, "%s/%u%c%s", + payloadName, + GetTimeScale(), + encoding_parms != NULL ? '/' : '\0', + encoding_parms == NULL ? "" : encoding_parms); + m_pRtpMapProperty->SetValue(rtpMapBuf); + + m_pPayloadNumberProperty->SetValue(payloadNumber); + + if (maxPayloadSize == 0) { + maxPayloadSize = 1460; + } + m_pMaxPacketSizeProperty->SetValue(maxPayloadSize); + + // set sdp media type + const char* sdpMediaType; + if (!strcmp(m_pRefTrack->GetType(), MP4_AUDIO_TRACK_TYPE)) { + sdpMediaType = "audio"; + } else if (!strcmp(m_pRefTrack->GetType(), MP4_VIDEO_TRACK_TYPE)) { + sdpMediaType = "video"; + } else { + sdpMediaType = "application"; + } + + char* sdpBuf = (char*)MP4Malloc( + strlen(sdpMediaType) + strlen(rtpMapBuf) + 256); + uint32_t buflen; + buflen = sprintf(sdpBuf, + "m=%s 0 RTP/AVP %u\015\012" + "a=control:trackID=%u\015\012", + sdpMediaType, payloadNumber, + m_trackId); + if (include_rtp_map) { + buflen += sprintf(sdpBuf + buflen, + "a=rtpmap:%u %s\015\012", + payloadNumber, rtpMapBuf); + } + if (include_mpeg4_esid) { + sprintf(sdpBuf + buflen, + "a=mpeg4-esid:%u\015\012", + m_pRefTrack->GetId()); + } + + MP4StringProperty* pSdpProperty = NULL; + m_pTrakAtom->FindProperty("trak.udta.hnti.sdp .sdpText", + (MP4Property**)&pSdpProperty); + ASSERT(pSdpProperty); + pSdpProperty->SetValue(sdpBuf); + + // cleanup + MP4Free(rtpMapBuf); + MP4Free(sdpBuf); +} + +void MP4RtpHintTrack::AddHint(bool isBFrame, u_int32_t timestampOffset) +{ + // on first hint, need to lookup the reference track + if (m_writeHintId == MP4_INVALID_SAMPLE_ID) { + InitRefTrack(); + InitStats(); + } + + if (m_pWriteHint) { + throw new MP4Error("unwritten hint is still pending", "MP4AddRtpHint"); + } + + m_pWriteHint = new MP4RtpHint(this); + m_pWriteHint->SetBFrame(isBFrame); + m_pWriteHint->SetTimestampOffset(timestampOffset); + + m_bytesThisHint = 0; + m_writeHintId++; +} + +void MP4RtpHintTrack::AddPacket(bool setMbit, int32_t transmitOffset) +{ + if (m_pWriteHint == NULL) { + throw new MP4Error("no hint pending", "MP4RtpAddPacket"); + } + + MP4RtpPacket* pPacket = m_pWriteHint->AddPacket(); + + ASSERT(m_pPayloadNumberProperty); + + pPacket->Set( + m_pPayloadNumberProperty->GetValue(), + m_writePacketId++, + setMbit); + pPacket->SetTransmitOffset(transmitOffset); + + m_bytesThisHint += 12; + if (m_bytesThisPacket > m_pPmax->GetValue()) { + m_pPmax->SetValue(m_bytesThisPacket); + } + m_bytesThisPacket = 12; + m_pNump->IncrementValue(); + m_pTrpy->IncrementValue(12); // RTP packet header size +} + +void MP4RtpHintTrack::AddImmediateData( + const u_int8_t* pBytes, + u_int32_t numBytes) +{ + if (m_pWriteHint == NULL) { + throw new MP4Error("no hint pending", "MP4RtpAddImmediateData"); + } + + MP4RtpPacket* pPacket = m_pWriteHint->GetCurrentPacket(); + if (pPacket == NULL) { + throw new MP4Error("no packet pending", "MP4RtpAddImmediateData"); + } + + if (pBytes == NULL || numBytes == 0) { + throw new MP4Error("no data", + "AddImmediateData"); + } + if (numBytes > 14) { + throw new MP4Error("data size is larger than 14 bytes", + "AddImmediateData"); + } + + MP4RtpImmediateData* pData = new MP4RtpImmediateData(pPacket); + pData->Set(pBytes, numBytes); + + pPacket->AddData(pData); + + m_bytesThisHint += numBytes; + m_bytesThisPacket += numBytes; + m_pDimm->IncrementValue(numBytes); + m_pTpyl->IncrementValue(numBytes); + m_pTrpy->IncrementValue(numBytes); +} + +void MP4RtpHintTrack::AddSampleData( + MP4SampleId sampleId, + u_int32_t dataOffset, + u_int32_t dataLength) +{ + if (m_pWriteHint == NULL) { + throw new MP4Error("no hint pending", "MP4RtpAddSampleData"); + } + + MP4RtpPacket* pPacket = m_pWriteHint->GetCurrentPacket(); + if (pPacket == NULL) { + throw new MP4Error("no packet pending", "MP4RtpAddSampleData"); + } + + MP4RtpSampleData* pData = new MP4RtpSampleData(pPacket); + + pData->SetReferenceSample(sampleId, dataOffset, dataLength); + + pPacket->AddData(pData); + + m_bytesThisHint += dataLength; + m_bytesThisPacket += dataLength; + m_pDmed->IncrementValue(dataLength); + m_pTpyl->IncrementValue(dataLength); + m_pTrpy->IncrementValue(dataLength); +} + +void MP4RtpHintTrack::AddESConfigurationPacket() +{ + if (m_pWriteHint == NULL) { + throw new MP4Error("no hint pending", + "MP4RtpAddESConfigurationPacket"); + } + + u_int8_t* pConfig = NULL; + u_int32_t configSize = 0; + + m_pFile->GetTrackESConfiguration(m_pRefTrack->GetId(), + &pConfig, &configSize); + + if (pConfig == NULL) { + return; + } + + ASSERT(m_pMaxPacketSizeProperty); + + if (configSize > m_pMaxPacketSizeProperty->GetValue()) { + throw new MP4Error("ES configuration is too large for RTP payload", + "MP4RtpAddESConfigurationPacket"); + } + + AddPacket(false); + + MP4RtpPacket* pPacket = m_pWriteHint->GetCurrentPacket(); + ASSERT(pPacket); + + // This is ugly! + // To get the ES configuration data somewhere known + // we create a sample data reference that points to + // this hint track (not the media track) + // and this sample of the hint track + // the offset into this sample is filled in during the write process + MP4RtpSampleData* pData = new MP4RtpSampleData(pPacket); + + pData->SetEmbeddedImmediate(m_writeSampleId, pConfig, configSize); + + pPacket->AddData(pData); + + m_bytesThisHint += configSize; + m_bytesThisPacket += configSize; + m_pTpyl->IncrementValue(configSize); + m_pTrpy->IncrementValue(configSize); +} + +void MP4RtpHintTrack::WriteHint(MP4Duration duration, bool isSyncSample) +{ + if (m_pWriteHint == NULL) { + throw new MP4Error("no hint pending", "MP4WriteRtpHint"); + } + + u_int8_t* pBytes; + u_int64_t numBytes; + + m_pFile->EnableMemoryBuffer(); + + m_pWriteHint->Write(m_pFile); + + m_pFile->DisableMemoryBuffer(&pBytes, &numBytes); + + WriteSample(pBytes, numBytes, duration, 0, isSyncSample); + + MP4Free(pBytes); + + // update statistics + if (m_bytesThisPacket > m_pPmax->GetValue()) { + m_pPmax->SetValue(m_bytesThisPacket); + } + + if (duration > m_pDmax->GetValue()) { + m_pDmax->SetValue(duration); + } + + MP4Timestamp startTime; + + GetSampleTimes(m_writeHintId, &startTime, NULL); + + if (startTime < m_thisSec + GetTimeScale()) { + m_bytesThisSec += m_bytesThisHint; + } else { + if (m_bytesThisSec > m_pMaxr->GetValue()) { + m_pMaxr->SetValue(m_bytesThisSec); + } + m_thisSec = startTime - (startTime % GetTimeScale()); + m_bytesThisSec = m_bytesThisHint; + } + + // cleanup + delete m_pWriteHint; + m_pWriteHint = NULL; +} + +void MP4RtpHintTrack::FinishWrite() +{ + if (m_writeHintId != MP4_INVALID_SAMPLE_ID) { + m_pMaxPdu->SetValue(m_pPmax->GetValue()); + if (m_pNump->GetValue()) { + m_pAvgPdu->SetValue(m_pTrpy->GetValue() / m_pNump->GetValue()); + } + + m_pMaxBitRate->SetValue(m_pMaxr->GetValue() * 8); + if (GetDuration()) { + m_pAvgBitRate->SetValue( + m_pTrpy->GetValue() * 8 * GetTimeScale() / GetDuration()); + } + } + + MP4Track::FinishWrite(); +} + +void MP4RtpHintTrack::InitStats() +{ + MP4Atom* pHinfAtom = m_pTrakAtom->FindAtom("trak.udta.hinf"); + + ASSERT(pHinfAtom); + + pHinfAtom->FindProperty("hinf.trpy.bytes", (MP4Property**)&m_pTrpy); + pHinfAtom->FindProperty("hinf.nump.packets", (MP4Property**)&m_pNump); + pHinfAtom->FindProperty("hinf.tpyl.bytes", (MP4Property**)&m_pTpyl); + pHinfAtom->FindProperty("hinf.maxr.bytes", (MP4Property**)&m_pMaxr); + pHinfAtom->FindProperty("hinf.dmed.bytes", (MP4Property**)&m_pDmed); + pHinfAtom->FindProperty("hinf.dimm.bytes", (MP4Property**)&m_pDimm); + pHinfAtom->FindProperty("hinf.pmax.bytes", (MP4Property**)&m_pPmax); + pHinfAtom->FindProperty("hinf.dmax.milliSecs", (MP4Property**)&m_pDmax); + + MP4Atom* pHmhdAtom = m_pTrakAtom->FindAtom("trak.mdia.minf.hmhd"); + + ASSERT(pHmhdAtom); + + pHmhdAtom->FindProperty("hmhd.maxPduSize", (MP4Property**)&m_pMaxPdu); + pHmhdAtom->FindProperty("hmhd.avgPduSize", (MP4Property**)&m_pAvgPdu); + pHmhdAtom->FindProperty("hmhd.maxBitRate", (MP4Property**)&m_pMaxBitRate); + pHmhdAtom->FindProperty("hmhd.avgBitRate", (MP4Property**)&m_pAvgBitRate); + + MP4Integer32Property* pMaxrPeriod = NULL; + pHinfAtom->FindProperty("hinf.maxr.granularity", + (MP4Property**)&pMaxrPeriod); + if (pMaxrPeriod) { + pMaxrPeriod->SetValue(1000); // 1 second + } +} + + +MP4RtpHint::MP4RtpHint(MP4RtpHintTrack* pTrack) +{ + m_pTrack = pTrack; + + AddProperty( /* 0 */ + new MP4Integer16Property("packetCount")); + AddProperty( /* 1 */ + new MP4Integer16Property("reserved")); +} + +MP4RtpHint::~MP4RtpHint() +{ + for (u_int32_t i = 0; i < m_rtpPackets.Size(); i++) { + delete m_rtpPackets[i]; + } +} + +MP4RtpPacket* MP4RtpHint::AddPacket() +{ + MP4RtpPacket* pPacket = new MP4RtpPacket(this); + m_rtpPackets.Add(pPacket); + + // packetCount property + ((MP4Integer16Property*)m_pProperties[0])->IncrementValue(); + + pPacket->SetBFrame(m_isBFrame); + pPacket->SetTimestampOffset(m_timestampOffset); + + return pPacket; +} + +void MP4RtpHint::Read(MP4File* pFile) +{ + // call base class Read for required properties + MP4Container::Read(pFile); + + u_int16_t numPackets = + ((MP4Integer16Property*)m_pProperties[0])->GetValue(); + + for (u_int16_t i = 0; i < numPackets; i++) { + MP4RtpPacket* pPacket = new MP4RtpPacket(this); + + m_rtpPackets.Add(pPacket); + + pPacket->Read(pFile); + } + + VERBOSE_READ_HINT(pFile->GetVerbosity(), + printf("ReadHint:\n"); Dump(stdout, 10, false);); +} + +void MP4RtpHint::Write(MP4File* pFile) +{ + u_int64_t hintStartPos = pFile->GetPosition(); + + MP4Container::Write(pFile); + + u_int64_t packetStartPos = pFile->GetPosition(); + + u_int32_t i; + + // first write out packet (and data) entries + for (i = 0; i < m_rtpPackets.Size(); i++) { + m_rtpPackets[i]->Write(pFile); + } + + // now let packets write their extra data into the hint sample + for (i = 0; i < m_rtpPackets.Size(); i++) { + m_rtpPackets[i]->WriteEmbeddedData(pFile, hintStartPos); + } + + u_int64_t endPos = pFile->GetPosition(); + + pFile->SetPosition(packetStartPos); + + // finally rewrite the packet and data entries + // which now contain the correct offsets for the embedded data + for (i = 0; i < m_rtpPackets.Size(); i++) { + m_rtpPackets[i]->Write(pFile); + } + + pFile->SetPosition(endPos); + + VERBOSE_WRITE_HINT(pFile->GetVerbosity(), + printf("WriteRtpHint:\n"); Dump(stdout, 14, false)); +} + +void MP4RtpHint::Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits) +{ + MP4Container::Dump(pFile, indent, dumpImplicits); + + for (u_int32_t i = 0; i < m_rtpPackets.Size(); i++) { + Indent(pFile, indent); + fprintf(pFile, "RtpPacket: %u\n", i); + m_rtpPackets[i]->Dump(pFile, indent + 1, dumpImplicits); + } +} + +MP4RtpPacket::MP4RtpPacket(MP4RtpHint* pHint) +{ + m_pHint = pHint; + + AddProperty( /* 0 */ + new MP4Integer32Property("relativeXmitTime")); + AddProperty( /* 1 */ + new MP4BitfieldProperty("reserved1", 2)); + AddProperty( /* 2 */ + new MP4BitfieldProperty("Pbit", 1)); + AddProperty( /* 3 */ + new MP4BitfieldProperty("Xbit", 1)); + AddProperty( /* 4 */ + new MP4BitfieldProperty("reserved2", 4)); + AddProperty( /* 5 */ + new MP4BitfieldProperty("Mbit", 1)); + AddProperty( /* 6 */ + new MP4BitfieldProperty("payloadType", 7)); + AddProperty( /* 7 */ + new MP4Integer16Property("sequenceNumber")); + AddProperty( /* 8 */ + new MP4BitfieldProperty("reserved3", 13)); + AddProperty( /* 9 */ + new MP4BitfieldProperty("extraFlag", 1)); + AddProperty( /* 10 */ + new MP4BitfieldProperty("bFrameFlag", 1)); + AddProperty( /* 11 */ + new MP4BitfieldProperty("repeatFlag", 1)); + AddProperty( /* 12 */ + new MP4Integer16Property("entryCount")); +} + +MP4RtpPacket::~MP4RtpPacket() +{ + for (u_int32_t i = 0; i < m_rtpData.Size(); i++) { + delete m_rtpData[i]; + } +} + +void MP4RtpPacket::AddExtraProperties() +{ + AddProperty( /* 13 */ + new MP4Integer32Property("extraInformationLength")); + + // This is a bit of a hack, since the tlv entries are really defined + // as atoms but there is only one type defined now, rtpo, and getting + // our atom code hooked up here would be a major pain with little gain + + AddProperty( /* 14 */ + new MP4Integer32Property("tlvLength")); + AddProperty( /* 15 */ + new MP4StringProperty("tlvType")); + AddProperty( /* 16 */ + new MP4Integer32Property("timestampOffset")); + + ((MP4Integer32Property*)m_pProperties[13])->SetValue(16); + ((MP4Integer32Property*)m_pProperties[14])->SetValue(12); + ((MP4StringProperty*)m_pProperties[15])->SetFixedLength(4); + ((MP4StringProperty*)m_pProperties[15])->SetValue("rtpo"); +} + +void MP4RtpPacket::Read(MP4File* pFile) +{ + // call base class Read for required properties + MP4Container::Read(pFile); + + // read extra info if present + // we only support the rtpo field! + if (((MP4BitfieldProperty*)m_pProperties[9])->GetValue() == 1) { + ReadExtra(pFile); + } + + u_int16_t numDataEntries = + ((MP4Integer16Property*)m_pProperties[12])->GetValue(); + + // read data entries + for (u_int16_t i = 0; i < numDataEntries; i++) { + u_int8_t dataType; + pFile->PeekBytes(&dataType, 1); + + MP4RtpData* pData; + + switch (dataType) { + case 0: + pData = new MP4RtpNullData(this); + break; + case 1: + pData = new MP4RtpImmediateData(this); + break; + case 2: + pData = new MP4RtpSampleData(this); + break; + case 3: + pData = new MP4RtpSampleDescriptionData(this); + break; + default: + throw new MP4Error("unknown packet data entry type", + "MP4ReadHint"); + } + + m_rtpData.Add(pData); + + // read data entry's properties + pData->Read(pFile); + } +} + +void MP4RtpPacket::ReadExtra(MP4File* pFile) +{ + AddExtraProperties(); + + int32_t extraLength = (int32_t)pFile->ReadUInt32(); + + if (extraLength < 4) { + throw new MP4Error("bad packet extra info length", + "MP4RtpPacket::ReadExtra"); + } + extraLength -= 4; + + while (extraLength > 0) { + u_int32_t entryLength = pFile->ReadUInt32(); + u_int32_t entryTag = pFile->ReadUInt32(); + + if (entryLength < 8) { + throw new MP4Error("bad packet extra info entry length", + "MP4RtpPacket::ReadExtra"); + } + + if (entryTag == STRTOINT32("rtpo") && entryLength == 12) { + // read the rtp timestamp offset + m_pProperties[16]->Read(pFile); + } else { + // ignore it, LATER carry it along + pFile->SetPosition(pFile->GetPosition() + entryLength - 8); + } + + extraLength -= entryLength; + } + + if (extraLength < 0) { + throw new MP4Error("invalid packet extra info length", + "MP4RtpPacket::ReadExtra"); + } +} + +void MP4RtpPacket::Set(u_int8_t payloadNumber, + u_int32_t packetId, bool setMbit) +{ + ((MP4BitfieldProperty*)m_pProperties[5])->SetValue(setMbit); + ((MP4BitfieldProperty*)m_pProperties[6])->SetValue(payloadNumber); + ((MP4Integer16Property*)m_pProperties[7])->SetValue(packetId); +} + +int32_t MP4RtpPacket::GetTransmitOffset() +{ + return ((MP4Integer32Property*)m_pProperties[0])->GetValue(); +} + +void MP4RtpPacket::SetTransmitOffset(int32_t transmitOffset) +{ + ((MP4Integer32Property*)m_pProperties[0])->SetValue(transmitOffset); +} + +bool MP4RtpPacket::GetPBit() +{ + return ((MP4BitfieldProperty*)m_pProperties[2])->GetValue(); +} + +bool MP4RtpPacket::GetXBit() +{ + return ((MP4BitfieldProperty*)m_pProperties[3])->GetValue(); +} + +bool MP4RtpPacket::GetMBit() +{ + return ((MP4BitfieldProperty*)m_pProperties[5])->GetValue(); +} + +u_int8_t MP4RtpPacket::GetPayload() +{ + return ((MP4BitfieldProperty*)m_pProperties[6])->GetValue(); +} + +u_int16_t MP4RtpPacket::GetSequenceNumber() +{ + return ((MP4Integer16Property*)m_pProperties[7])->GetValue(); +} + +bool MP4RtpPacket::IsBFrame() +{ + return ((MP4BitfieldProperty*)m_pProperties[10])->GetValue(); +} + +void MP4RtpPacket::SetBFrame(bool isBFrame) +{ + ((MP4BitfieldProperty*)m_pProperties[10])->SetValue(isBFrame); +} + +void MP4RtpPacket::SetTimestampOffset(u_int32_t timestampOffset) +{ + if (timestampOffset == 0) { + return; + } + + ASSERT(((MP4BitfieldProperty*)m_pProperties[9])->GetValue() == 0); + + // set X bit + ((MP4BitfieldProperty*)m_pProperties[9])->SetValue(1); + + AddExtraProperties(); + + ((MP4Integer32Property*)m_pProperties[16])->SetValue(timestampOffset); +} + +void MP4RtpPacket::AddData(MP4RtpData* pData) +{ + m_rtpData.Add(pData); + + // increment entry count property + ((MP4Integer16Property*)m_pProperties[12])->IncrementValue(); +} + +u_int32_t MP4RtpPacket::GetDataSize() +{ + u_int32_t totalDataSize = 0; + + for (u_int32_t i = 0; i < m_rtpData.Size(); i++) { + totalDataSize += m_rtpData[i]->GetDataSize(); + } + + return totalDataSize; +} + +void MP4RtpPacket::GetData(u_int8_t* pDest) +{ + for (u_int32_t i = 0; i < m_rtpData.Size(); i++) { + m_rtpData[i]->GetData(pDest); + pDest += m_rtpData[i]->GetDataSize(); + } +} + +void MP4RtpPacket::Write(MP4File* pFile) +{ + MP4Container::Write(pFile); + + for (u_int32_t i = 0; i < m_rtpData.Size(); i++) { + m_rtpData[i]->Write(pFile); + } +} + +void MP4RtpPacket::WriteEmbeddedData(MP4File* pFile, u_int64_t startPos) +{ + for (u_int32_t i = 0; i < m_rtpData.Size(); i++) { + m_rtpData[i]->WriteEmbeddedData(pFile, startPos); + } +} + +void MP4RtpPacket::Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits) +{ + MP4Container::Dump(pFile, indent, dumpImplicits); + + for (u_int32_t i = 0; i < m_rtpData.Size(); i++) { + Indent(pFile, indent); + fprintf(pFile, "RtpData: %u\n", i); + m_rtpData[i]->Dump(pFile, indent + 1, dumpImplicits); + } +} + +MP4RtpData::MP4RtpData(MP4RtpPacket* pPacket) +{ + m_pPacket = pPacket; + + AddProperty( /* 0 */ + new MP4Integer8Property("type")); +} + +MP4Track* MP4RtpData::FindTrackFromRefIndex(u_int8_t refIndex) +{ + MP4Track* pTrack; + + if (refIndex == (u_int8_t)-1) { + // ourselves + pTrack = GetPacket()->GetHint()->GetTrack(); + } else if (refIndex == 0) { + // our reference track + pTrack = GetPacket()->GetHint()->GetTrack()->GetRefTrack(); + } else { + // some other track + MP4RtpHintTrack* pHintTrack = + GetPacket()->GetHint()->GetTrack(); + + MP4Atom* pTrakAtom = pHintTrack->GetTrakAtom(); + ASSERT(pTrakAtom); + + MP4Integer32Property* pTrackIdProperty = NULL; + pTrakAtom->FindProperty( + "trak.tref.hint.entries", + (MP4Property**)&pTrackIdProperty); + ASSERT(pTrackIdProperty); + + u_int32_t refTrackId = + pTrackIdProperty->GetValue(refIndex - 1); + + pTrack = pHintTrack->GetFile()->GetTrack(refTrackId); + } + + return pTrack; +} + +MP4RtpNullData::MP4RtpNullData(MP4RtpPacket* pPacket) + : MP4RtpData(pPacket) +{ + ((MP4Integer8Property*)m_pProperties[0])->SetValue(0); + + AddProperty( /* 1 */ + new MP4BytesProperty("pad", 15)); + + ((MP4BytesProperty*)m_pProperties[1])->SetFixedSize(15); +} + +MP4RtpImmediateData::MP4RtpImmediateData(MP4RtpPacket* pPacket) + : MP4RtpData(pPacket) +{ + ((MP4Integer8Property*)m_pProperties[0])->SetValue(1); + + AddProperty( /* 1 */ + new MP4Integer8Property("count")); + AddProperty( /* 2 */ + new MP4BytesProperty("data", 14)); + + ((MP4BytesProperty*)m_pProperties[2])->SetFixedSize(14); +} + +void MP4RtpImmediateData::Set(const u_int8_t* pBytes, u_int8_t numBytes) +{ + ((MP4Integer8Property*)m_pProperties[1])->SetValue(numBytes); + ((MP4BytesProperty*)m_pProperties[2])->SetValue(pBytes, numBytes); +} + +u_int16_t MP4RtpImmediateData::GetDataSize() +{ + return ((MP4Integer8Property*)m_pProperties[1])->GetValue(); +} + +void MP4RtpImmediateData::GetData(u_int8_t* pDest) +{ + u_int8_t* pValue; + u_int32_t valueSize; + ((MP4BytesProperty*)m_pProperties[2])->GetValue(&pValue, &valueSize); + + memcpy(pDest, pValue, GetDataSize()); + MP4Free(pValue); +} + +MP4RtpSampleData::MP4RtpSampleData(MP4RtpPacket* pPacket) + : MP4RtpData(pPacket) +{ + ((MP4Integer8Property*)m_pProperties[0])->SetValue(2); + + AddProperty( /* 1 */ + new MP4Integer8Property("trackRefIndex")); + AddProperty( /* 2 */ + new MP4Integer16Property("length")); + AddProperty( /* 3 */ + new MP4Integer32Property("sampleNumber")); + AddProperty( /* 4 */ + new MP4Integer32Property("sampleOffset")); + AddProperty( /* 5 */ + new MP4Integer16Property("bytesPerBlock")); + AddProperty( /* 6 */ + new MP4Integer16Property("samplesPerBlock")); + + ((MP4Integer16Property*)m_pProperties[5])->SetValue(1); + ((MP4Integer16Property*)m_pProperties[6])->SetValue(1); + + m_pRefData = NULL; + m_pRefTrack = NULL; + m_refSampleId = MP4_INVALID_SAMPLE_ID; + m_refSampleOffset = 0; +} + +void MP4RtpSampleData::SetEmbeddedImmediate(MP4SampleId sampleId, + u_int8_t* pData, u_int16_t dataLength) +{ + ((MP4Integer8Property*)m_pProperties[1])->SetValue((u_int8_t)-1); + ((MP4Integer16Property*)m_pProperties[2])->SetValue(dataLength); + ((MP4Integer32Property*)m_pProperties[3])->SetValue(sampleId); + ((MP4Integer32Property*)m_pProperties[4])->SetValue(0); + m_pRefData = pData; +} + +void MP4RtpSampleData::SetReferenceSample( + MP4SampleId refSampleId, u_int32_t refSampleOffset, + u_int16_t sampleLength) +{ + ((MP4Integer8Property*)m_pProperties[1])->SetValue(0); + ((MP4Integer16Property*)m_pProperties[2])->SetValue(sampleLength); + ((MP4Integer32Property*)m_pProperties[3])->SetValue(refSampleId); + ((MP4Integer32Property*)m_pProperties[4])->SetValue(refSampleOffset); +} + +void MP4RtpSampleData::SetEmbeddedSample( + MP4SampleId sampleId, MP4Track* pRefTrack, + MP4SampleId refSampleId, u_int32_t refSampleOffset, + u_int16_t sampleLength) +{ + ((MP4Integer8Property*)m_pProperties[1])->SetValue((u_int8_t)-1); + ((MP4Integer16Property*)m_pProperties[2])->SetValue(sampleLength); + ((MP4Integer32Property*)m_pProperties[3])->SetValue(sampleId); + ((MP4Integer32Property*)m_pProperties[4])->SetValue(0); + m_pRefTrack = pRefTrack; + m_refSampleId = refSampleId; + m_refSampleOffset = refSampleOffset; +} + +u_int16_t MP4RtpSampleData::GetDataSize() +{ + return ((MP4Integer16Property*)m_pProperties[2])->GetValue(); +} + +void MP4RtpSampleData::GetData(u_int8_t* pDest) +{ + u_int8_t trackRefIndex = + ((MP4Integer8Property*)m_pProperties[1])->GetValue(); + + MP4Track* pSampleTrack = + FindTrackFromRefIndex(trackRefIndex); + + pSampleTrack->ReadSampleFragment( + ((MP4Integer32Property*)m_pProperties[3])->GetValue(), // sampleId + ((MP4Integer32Property*)m_pProperties[4])->GetValue(), // sampleOffset + ((MP4Integer16Property*)m_pProperties[2])->GetValue(), // sampleLength + pDest); +} + +void MP4RtpSampleData::WriteEmbeddedData(MP4File* pFile, u_int64_t startPos) +{ + // if not using embedded data, nothing to do + if (((MP4Integer8Property*)m_pProperties[1])->GetValue() != (u_int8_t)-1) { + return; + } + + // figure out the offset within this hint sample for this embedded data + u_int64_t offset = pFile->GetPosition() - startPos; + ASSERT(offset <= 0xFFFFFFFF); + ((MP4Integer32Property*)m_pProperties[4])->SetValue((u_int32_t)offset); + + u_int16_t length = ((MP4Integer16Property*)m_pProperties[2])->GetValue(); + + if (m_pRefData) { + pFile->WriteBytes(m_pRefData, length); + return; + } + + if (m_refSampleId != MP4_INVALID_SAMPLE_ID) { + u_int8_t* pSample = NULL; + u_int32_t sampleSize = 0; + + ASSERT(m_pRefTrack); + m_pRefTrack->ReadSample(m_refSampleId, &pSample, &sampleSize); + + ASSERT(m_refSampleOffset + length <= sampleSize); + + pFile->WriteBytes(&pSample[m_refSampleOffset], length); + + MP4Free(pSample); + return; + } +} + +MP4RtpSampleDescriptionData::MP4RtpSampleDescriptionData(MP4RtpPacket* pPacket) + : MP4RtpData(pPacket) +{ + ((MP4Integer8Property*)m_pProperties[0])->SetValue(3); + + AddProperty( /* 1 */ + new MP4Integer8Property("trackRefIndex")); + AddProperty( /* 2 */ + new MP4Integer16Property("length")); + AddProperty( /* 3 */ + new MP4Integer32Property("sampleDescriptionIndex")); + AddProperty( /* 4 */ + new MP4Integer32Property("sampleDescriptionOffset")); + AddProperty( /* 5 */ + new MP4Integer32Property("reserved")); +} + +void MP4RtpSampleDescriptionData::Set(u_int32_t sampleDescrIndex, + u_int32_t offset, u_int16_t length) +{ + ((MP4Integer16Property*)m_pProperties[2])->SetValue(length); + ((MP4Integer32Property*)m_pProperties[3])->SetValue(sampleDescrIndex); + ((MP4Integer32Property*)m_pProperties[4])->SetValue(offset); +} + +u_int16_t MP4RtpSampleDescriptionData::GetDataSize() +{ + return ((MP4Integer16Property*)m_pProperties[2])->GetValue(); +} + +void MP4RtpSampleDescriptionData::GetData(u_int8_t* pDest) +{ + // we start with the index into our track references + u_int8_t trackRefIndex = + ((MP4Integer8Property*)m_pProperties[1])->GetValue(); + + // from which we can find the track structure + MP4Track* pSampleTrack = + FindTrackFromRefIndex(trackRefIndex); + + // next find the desired atom in the track's sample description table + u_int32_t sampleDescrIndex = + ((MP4Integer32Property*)m_pProperties[3])->GetValue(); + + MP4Atom* pTrakAtom = + pSampleTrack->GetTrakAtom(); + + char sdName[64]; + sprintf(sdName, "trak.mdia.minf.stbl.stsd.*[%u]", sampleDescrIndex); + + MP4Atom* pSdAtom = + pTrakAtom->FindAtom(sdName); + + // bad reference + if (pSdAtom == NULL) { + throw new MP4Error("invalid sample description index", + "MP4RtpSampleDescriptionData::GetData"); + } + + // check validity of the upcoming copy + u_int16_t length = + ((MP4Integer16Property*)m_pProperties[2])->GetValue(); + u_int32_t offset = + ((MP4Integer32Property*)m_pProperties[4])->GetValue(); + + if (offset + length > pSdAtom->GetSize()) { + throw new MP4Error("offset and/or length are too large", + "MP4RtpSampleDescriptionData::GetData"); + } + + // now we use the raw file to get the desired bytes + + MP4File* pFile = GetPacket()->GetHint()->GetTrack()->GetFile(); + + u_int64_t orgPos = pFile->GetPosition(); + + // It's not entirely clear from the spec whether the offset is from + // the start of the sample descirption atom, or the start of the atom's + // data. I believe it is the former, but the commented out code will + // realize the latter interpretation if I turn out to be wrong. + u_int64_t dataPos = pSdAtom->GetStart(); + //u_int64_t dataPos = pSdAtom->GetEnd() - pSdAtom->GetSize(); + + pFile->SetPosition(dataPos + offset); + + pFile->ReadBytes(pDest, length); + + pFile->SetPosition(orgPos); +} + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/rtphint.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/rtphint.h @@ -0,0 +1,348 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __RTPHINT_INCLUDED__ +#define __RTPHINT_INCLUDED__ + +// forward declarations +class MP4RtpHintTrack; +class MP4RtpHint; +class MP4RtpPacket; + +class MP4RtpData : public MP4Container { +public: + MP4RtpData(MP4RtpPacket* pPacket); + + MP4RtpPacket* GetPacket() { + return m_pPacket; + } + + virtual u_int16_t GetDataSize() = NULL; + virtual void GetData(u_int8_t* pDest) = NULL; + + MP4Track* FindTrackFromRefIndex(u_int8_t refIndex); + + virtual void WriteEmbeddedData(MP4File* pFile, u_int64_t startPos) { + // default is no-op + } + +protected: + MP4RtpPacket* m_pPacket; +}; + +MP4ARRAY_DECL(MP4RtpData, MP4RtpData*) + +class MP4RtpNullData : public MP4RtpData { +public: + MP4RtpNullData(MP4RtpPacket* pPacket); + + u_int16_t GetDataSize() { + return 0; + } + + void GetData(u_int8_t* pDest) { + // no-op + } +}; + +class MP4RtpImmediateData : public MP4RtpData { +public: + MP4RtpImmediateData(MP4RtpPacket* pPacket); + + void Set(const u_int8_t* pBytes, u_int8_t numBytes); + + u_int16_t GetDataSize(); + + void GetData(u_int8_t* pDest); +}; + +class MP4RtpSampleData : public MP4RtpData { +public: + MP4RtpSampleData(MP4RtpPacket* pPacket); + + void SetEmbeddedImmediate( + MP4SampleId sampleId, + u_int8_t* pData, u_int16_t dataLength); + + void SetReferenceSample( + MP4SampleId refSampleId, u_int32_t refSampleOffset, + u_int16_t sampleLength); + + void SetEmbeddedSample( + MP4SampleId sampleId, MP4Track* pRefTrack, + MP4SampleId refSampleId, u_int32_t refSampleOffset, + u_int16_t sampleLength); + + u_int16_t GetDataSize(); + + void GetData(u_int8_t* pDest); + + void WriteEmbeddedData(MP4File* pFile, u_int64_t startPos); + +protected: + u_int8_t* m_pRefData; + + MP4Track* m_pRefTrack; + MP4SampleId m_refSampleId; + u_int32_t m_refSampleOffset; +}; + +class MP4RtpSampleDescriptionData : public MP4RtpData { +public: + MP4RtpSampleDescriptionData(MP4RtpPacket* pPacket); + + void Set(u_int32_t sampleDescrIndex, + u_int32_t offset, u_int16_t length); + + u_int16_t GetDataSize(); + + void GetData(u_int8_t* pDest); +}; + +class MP4RtpPacket : public MP4Container { +public: + MP4RtpPacket(MP4RtpHint* pHint); + + ~MP4RtpPacket(); + + void AddExtraProperties(); + + MP4RtpHint* GetHint() { + return m_pHint; + } + + void Set(u_int8_t payloadNumber, u_int32_t packetId, bool setMbit); + + int32_t GetTransmitOffset(); + + bool GetPBit(); + + bool GetXBit(); + + bool GetMBit(); + + u_int8_t GetPayload(); + + u_int16_t GetSequenceNumber(); + + void SetTransmitOffset(int32_t transmitOffset); + + bool IsBFrame(); + + void SetBFrame(bool isBFrame); + + void SetTimestampOffset(u_int32_t timestampOffset); + + void AddData(MP4RtpData* pData); + + u_int32_t GetDataSize(); + + void GetData(u_int8_t* pDest); + + void Read(MP4File* pFile); + + void ReadExtra(MP4File* pFile); + + void Write(MP4File* pFile); + + void WriteEmbeddedData(MP4File* pFile, u_int64_t startPos); + + void Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits); + +protected: + MP4RtpHint* m_pHint; + MP4RtpDataArray m_rtpData; +}; + +MP4ARRAY_DECL(MP4RtpPacket, MP4RtpPacket*) + +class MP4RtpHint : public MP4Container { +public: + MP4RtpHint(MP4RtpHintTrack* pTrack); + + ~MP4RtpHint(); + + MP4RtpHintTrack* GetTrack() { + return m_pTrack; + } + + u_int16_t GetNumberOfPackets() { + return m_rtpPackets.Size(); + } + + bool IsBFrame() { + return m_isBFrame; + } + void SetBFrame(bool isBFrame) { + m_isBFrame = isBFrame; + } + + u_int32_t GetTimestampOffset() { + return m_timestampOffset; + } + void SetTimestampOffset(u_int32_t timestampOffset) { + m_timestampOffset = timestampOffset; + } + + MP4RtpPacket* AddPacket(); + + MP4RtpPacket* GetPacket(u_int16_t index) { + return m_rtpPackets[index]; + } + + MP4RtpPacket* GetCurrentPacket() { + if (m_rtpPackets.Size() == 0) { + return NULL; + } + return m_rtpPackets[m_rtpPackets.Size() - 1]; + } + + void Read(MP4File* pFile); + + void Write(MP4File* pFile); + + void Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits); + +protected: + MP4RtpHintTrack* m_pTrack; + MP4RtpPacketArray m_rtpPackets; + + // values when adding packets to a hint (write mode) + bool m_isBFrame; + u_int32_t m_timestampOffset; +}; + +class MP4RtpHintTrack : public MP4Track { +public: + MP4RtpHintTrack(MP4File* pFile, MP4Atom* pTrakAtom); + + ~MP4RtpHintTrack(); + + void InitRefTrack(); + + void InitPayload(); + + void InitRtpStart(); + + void InitStats(); + + MP4Track* GetRefTrack() { + InitRefTrack(); + return m_pRefTrack; + } + + void GetPayload( + char** ppPayloadName = NULL, + u_int8_t* pPayloadNumber = NULL, + u_int16_t* pMaxPayloadSize = NULL, + char **ppEncodingParams = NULL); + + void SetPayload( + const char* payloadName, + u_int8_t payloadNumber, + u_int16_t maxPayloadSize, + const char *encoding_parms, + bool add_rtpmap, + bool add_mpeg4_esid); + + void ReadHint( + MP4SampleId hintSampleId, + u_int16_t* pNumPackets = NULL); + + u_int16_t GetHintNumberOfPackets(); + + bool GetPacketBFrame(u_int16_t packetIndex); + + u_int16_t GetPacketTransmitOffset(u_int16_t packetIndex); + + void ReadPacket( + u_int16_t packetIndex, + u_int8_t** ppBytes, + u_int32_t* pNumBytes, + u_int32_t ssrc, + bool includeHeader = true, + bool includePayload = true); + + MP4Timestamp GetRtpTimestampStart(); + + void SetRtpTimestampStart(MP4Timestamp start); + + void AddHint(bool isBFrame, u_int32_t timestampOffset); + + void AddPacket(bool setMbit, int32_t transmitOffset = 0); + + void AddImmediateData(const u_int8_t* pBytes, u_int32_t numBytes); + + void AddSampleData(MP4SampleId sampleId, + u_int32_t dataOffset, u_int32_t dataLength); + + void AddESConfigurationPacket(); + + void WriteHint(MP4Duration duration, bool isSyncSample); + + void FinishWrite(); + +protected: + MP4Track* m_pRefTrack; + + MP4StringProperty* m_pRtpMapProperty; + MP4Integer32Property* m_pPayloadNumberProperty; + MP4Integer32Property* m_pMaxPacketSizeProperty; + MP4Integer32Property* m_pSnroProperty; + MP4Integer32Property* m_pTsroProperty; + u_int32_t m_rtpSequenceStart; + u_int32_t m_rtpTimestampStart; + + // reading + MP4RtpHint* m_pReadHint; + u_int8_t* m_pReadHintSample; + u_int32_t m_readHintSampleSize; + MP4Timestamp m_readHintTimestamp; + + // writing + MP4RtpHint* m_pWriteHint; + MP4SampleId m_writeHintId; + u_int32_t m_writePacketId; + + // statistics + // in trak.udta.hinf + MP4Integer64Property* m_pTrpy; + MP4Integer64Property* m_pNump; + MP4Integer64Property* m_pTpyl; + MP4Integer32Property* m_pMaxr; + MP4Integer64Property* m_pDmed; + MP4Integer64Property* m_pDimm; + MP4Integer32Property* m_pPmax; + MP4Integer32Property* m_pDmax; + + // in trak.mdia.minf.hmhd + MP4Integer16Property* m_pMaxPdu; + MP4Integer16Property* m_pAvgPdu; + MP4Integer32Property* m_pMaxBitRate; + MP4Integer32Property* m_pAvgBitRate; + + MP4Timestamp m_thisSec; + u_int32_t m_bytesThisSec; + u_int32_t m_bytesThisHint; + u_int32_t m_bytesThisPacket; +}; + +#endif /* __RTPHINT_INCLUDED__ */ --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/systems.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/systems.h @@ -0,0 +1,312 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2000, 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + * Bill May wmay@cisco.com + */ + +#ifndef __SYSTEMS_H__ +#define __SYSTEMS_H__ + +#ifdef WIN32 +#define HAVE_IN_PORT_T +#define HAVE_SOCKLEN_T +#include +#define NEED_SDL_VIDEO_IN_MAIN_THREAD +#else +#undef PACKAGE +#undef VERSION +#include +#endif + + + + +#ifdef WIN32 + +#define _WIN32_WINNT 0x0400 +#define _WINSOCKAPI_ +#include +#include +#include +#include +#include +#include +#include + +typedef unsigned __int64 uint64_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int8 uint8_t; +typedef unsigned __int64 u_int64_t; +typedef unsigned __int32 u_int32_t; +typedef unsigned __int16 u_int16_t; +typedef unsigned __int8 u_int8_t; +typedef __int64 int64_t; +typedef __int32 int32_t; +typedef __int16 int16_t; +typedef __int8 int8_t; +typedef unsigned short in_port_t; +typedef int socklen_t; +typedef int ssize_t; +#define snprintf _snprintf +#define strncasecmp _strnicmp +#define strcasecmp _stricmp + +#include +#include +#include +#include +#define write _write +#define lseek _lseek +#define close _close +#define open _open +#define access _access +#define vsnprintf _vsnprintf +#define F_OK 0 +#define OPEN_RDWR (_O_RDWR | _O_BINARY) +#define OPEN_CREAT (_O_CREAT | _O_BINARY) +#define OPEN_RDONLY (_O_RDONLY | _O_BINARY) +#define srandom srand +#define random rand + +#define IOSBINARY ios::binary + +#ifdef __cplusplus +extern "C" { +#endif +int gettimeofday(struct timeval *t, void *); +#ifdef __cplusplus +} +#endif + +#define PATH_MAX MAX_PATH +#define MAX_UINT64 -1 +#define LLD "%I64d" +#define LLU "%I64u" +#define LLX "%I64x" +#define LLX16 "%016I64x" +#define M_LLU 1000i64 +#define C_LLU 100i64 +#define I_LLU 1i64 + +#define LOG_EMERG 0 +#define LOG_ALERT 1 +#define LOG_CRIT 2 +#define LOG_ERR 3 +#define LOG_WARNING 4 +#define LOG_NOTICE 5 +#define LOG_INFO 6 +#define LOG_DEBUG 7 + +#if !__STDC__ && _INTEGRAL_MAX_BITS >= 64 +#define VAR_TO_FPOS(fpos, var) (fpos) = (var) +#define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)(_FPOSOFF(fpos)) +#else +#define VAR_TO_FPOS(fpos, var) (fpos).lopart = ((var) & UINT_MAX); (fpos).hipart = ((var) >> 32) +#define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)((uint64_t)((fpos).hipart ) << 32 | (fpos).lopart) +#endif + +#define __STRING(expr) #expr + +#define FOPEN_READ_BINARY "rb" +#define FOPEN_WRITE_BINARY "wb" + +#define UINT64_TO_DOUBLE(a) ((double)((int64_t)(a))) +#else /* UNIX */ +/***************************************************************************** + * UNIX LIKE DEFINES BELOW THIS POINT + *****************************************************************************/ +#ifdef sun +#include +#endif + +#ifndef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 64 +#else +#if _FILE_OFFSET_BITS < 64 +#error File offset bits is already set to non-64 value +#endif +#endif + +#ifndef _LARGEFILE_SOURCE +#define _LARGEFILE_SOURCE +#endif +#include +#include +#include + +#ifdef HAVE_INTTYPES_H +#include +#else +#ifdef HAVE_STDINT_H +#include +#else +#error "Don't have stdint.h or inttypes.h - no way to get uint8_t" +#endif +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef TIME_WITH_SYS_TIME +#include +#include +#else +#ifdef HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif +#include + +#define OPEN_RDWR O_RDWR +#define OPEN_CREAT O_CREAT +#define OPEN_RDONLY O_RDONLY + +#define closesocket close +#define IOSBINARY ios::bin +#define MAX_UINT64 -1LLU +#define LLD "%lld" +#define LLU "%llu" +#define LLX "%llx" +#define LLX16 "%016llx" +#define M_LLU 1000LLU +#define C_LLU 100LLU +#define I_LLU 1LLU +#ifdef HAVE_FPOS_T_POS +#define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)((fpos).__pos) +#define VAR_TO_FPOS(fpos, var) (fpos).__pos = (var) +#else +#define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)(fpos) +#define VAR_TO_FPOS(fpos, var) (fpos) = (var) +#endif + +#define FOPEN_READ_BINARY "r" +#define FOPEN_WRITE_BINARY "w" +#define UINT64_TO_DOUBLE(a) ((double)(a)) +#endif /* define unix */ + +/***************************************************************************** + * Generic type includes used in the whole package * + *****************************************************************************/ +#include +typedef void (*error_msg_func_t)(int loglevel, + const char *lib, + const char *fmt, + va_list ap); +typedef void (*lib_message_func_t)(int loglevel, + const char *lib, + const char *fmt, + ...); +#ifndef HAVE_IN_PORT_T +typedef uint16_t in_port_t; +#endif + +#ifndef HAVE_SOCKLEN_T +typedef unsigned int socklen_t; +#endif + +#ifdef sun +#include +#define u_int8_t uint8_t +#define u_int16_t uint16_t +#define u_int32_t uint32_t +#define u_int64_t uint64_t +#define __STRING(expr) #expr +#endif + +#ifndef HAVE_STRSEP +#ifdef __cplusplus +extern "C" { +#endif +char *strsep(char **strp, const char *delim); +#ifdef __cplusplus +} +#endif +#endif + +#ifndef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif + +#ifndef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#endif + +#ifndef INADDR_NONE +#define INADDR_NONE (-1) +#endif + +#define MALLOC_STRUCTURE(a) ((a *)malloc(sizeof(a))) + +#define CHECK_AND_FREE(a) if ((a) != NULL) { free((void *)(a)); (a) = NULL;} + +#define NUM_ELEMENTS_IN_ARRAY(name) ((sizeof((name))) / (sizeof(*(name)))) + +#ifndef HAVE_GLIB_H +typedef char gchar; +typedef unsigned char guchar; + +typedef int gint; +typedef unsigned int guint; + +typedef long glong; +typedef unsigned long gulong; + +typedef double gdouble; + +typedef int gboolean; + +typedef int16_t gint16; +typedef uint16_t guint16; + +typedef int32_t gint32; +typedef uint32_t guint32; + +typedef int64_t gint64; +typedef uint64_t guint64; + +typedef uint8_t guint8; +typedef int8_t gint8; + +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#endif /* __SYSTEMS_H__ */ + + + + --- vlc-0.8.4.debian.orig/extras/faad2/common/mp4v2/win32_ver.h +++ vlc-0.8.4.debian/extras/faad2/common/mp4v2/win32_ver.h @@ -0,0 +1,2 @@ +#define PACKAGE "mpeg4ip" +#define VERSION "0.9.8.6" --- vlc-0.8.4.debian.orig/extras/faad2/compile +++ vlc-0.8.4.debian/extras/faad2/compile @@ -1,8 +1,9 @@ #! /bin/sh - # Wrapper for compilers which do not understand `-c -o'. -# Copyright 1999, 2000 Free Software Foundation, Inc. +scriptversion=2003-11-09.00 + +# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -24,17 +25,36 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Usage: -# compile PROGRAM [ARGS]... -# `-o FOO.o' is removed from the args passed to the actual compile. - -# Usage statement added by Billy Biggs . -if [ -z $1 ]; then - echo "Wrapper for compilers which do not understand '-c -o'." - echo "usage: compile PROGRAM [ARGS]..." - echo "'-o FOO.o' is removed from the args passed to the actual compile." - exit 1 -fi +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit 0 + ;; + -v | --v*) + echo "compile $scriptversion" + exit 0 + ;; +esac + prog=$1 shift @@ -43,39 +63,39 @@ cfile= args= while test $# -gt 0; do - case "$1" in + case "$1" in -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we do something ugly here. - ofile=$2 - shift - case "$ofile" in + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we do something ugly here. + ofile=$2 + shift + case "$ofile" in *.o | *.obj) - ;; + ;; *) - args="$args -o $ofile" - ofile= - ;; - esac + args="$args -o $ofile" + ofile= + ;; + esac ;; *.c) - cfile=$1 - args="$args $1" - ;; + cfile=$1 + args="$args $1" + ;; *) - args="$args $1" - ;; - esac - shift + args="$args $1" + ;; + esac + shift done if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also - # ok. - exec "$prog" $args + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$prog" $args fi # Name of file we expect compiler to create. @@ -87,10 +107,10 @@ # object file name, since that is what matters with a parallel build. lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d while true; do - if mkdir $lockdir > /dev/null 2>&1; then - break - fi - sleep 1 + if mkdir $lockdir > /dev/null 2>&1; then + break + fi + sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir $lockdir; exit 1" 1 2 15 @@ -100,8 +120,17 @@ status=$? if test -f "$cofile"; then - mv "$cofile" "$ofile" + mv "$cofile" "$ofile" fi rmdir $lockdir exit $status + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: --- vlc-0.8.4.debian.orig/extras/faad2/config.guess +++ vlc-0.8.4.debian/extras/faad2/config.guess @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2005-08-03' +timestamp='2005-04-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,15 +17,13 @@ # # 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. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. - # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. @@ -68,11 +66,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; + echo "$timestamp" ; exit 0 ;; --version | -v ) - echo "$version" ; exit ;; + echo "$version" ; exit 0 ;; --help | --h* | -h ) - echo "$usage"; exit ;; + echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -125,7 +123,7 @@ ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -198,20 +196,55 @@ # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit ;; + exit 0 ;; + amd64:OpenBSD:*:*) + echo x86_64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + cats:OpenBSD:*:*) + echo arm-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + luna88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; + exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit ;; + exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; + exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -264,43 +297,40 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix - exit ;; + exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit ;; + exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit ;; + exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; + exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit ;; + exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition - exit ;; + exit 0 ;; *:z/VM:*:*) echo s390-ibm-zvmoe - exit ;; + exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 - exit ;; + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp - exit ;; + exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then @@ -308,32 +338,32 @@ else echo pyramid-pyramid-bsd fi - exit ;; + exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit ;; + exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit ;; + exit 0 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; + sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -342,10 +372,10 @@ esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; + exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; + exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 @@ -357,10 +387,10 @@ echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit ;; + exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; + exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -371,40 +401,40 @@ # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} - exit ;; + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; + exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit ;; + exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; + exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; + exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; + exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -428,33 +458,32 @@ exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 echo mips-mips-riscos${UNAME_RELEASE} - exit ;; + exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit ;; + exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit ;; + exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit ;; + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit ;; + exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit ;; + exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit ;; + exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit ;; + exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` @@ -470,29 +499,29 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit ;; + exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit ;; + exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit ;; + exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit ;; + exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; + exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix - exit ;; + exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -500,7 +529,7 @@ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; + exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -515,18 +544,14 @@ exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi - exit ;; + exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then @@ -540,28 +565,28 @@ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; + exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix - exit ;; + exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit ;; + exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx - exit ;; + exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit ;; + exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit ;; + exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit ;; + exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -623,19 +648,9 @@ esac if [ ${HP_ARCH} = "hppa2.0w" ] then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else @@ -643,11 +658,11 @@ fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; + exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit ;; + exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -675,166 +690,161 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 - exit ;; + exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit ;; + exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit ;; + exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit ;; + exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit ;; + exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit ;; + exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit ;; + exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit ;; + exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; + exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; + exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; + exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; + exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin - exit ;; + exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; + exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit ;; + exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit ;; + exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks - exit ;; + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix - exit ;; + exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + exit 0 ;; + amd64:CYGWIN*:*:*) echo x86_64-unknown-cygwin - exit ;; + exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit ;; + exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; + exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix - exit ;; + exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu - exit ;; + exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu - exit ;; + exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu - exit ;; + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -852,7 +862,7 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -871,17 +881,14 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu - exit ;; + exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu - exit ;; + exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -895,7 +902,7 @@ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; + exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -903,25 +910,25 @@ PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac - exit ;; + exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu - exit ;; + exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux - exit ;; + exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu - exit ;; + exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -939,15 +946,15 @@ ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; + exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; + exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; + exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -975,18 +982,15 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 - exit ;; + exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... @@ -994,27 +998,27 @@ # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; + exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; + exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit ;; + exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) + exit 0 ;; + i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable - exit ;; + exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; + exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -1022,16 +1026,15 @@ else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + exit 0 ;; + i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; + exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi - exit ;; + exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit ;; + exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit ;; + exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit ;; + exit 0 ;; M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit ;; + exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit ;; + exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit ;; + exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit ;; + exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1123,65 +1126,65 @@ else echo ns32k-sni-sysv fi - exit ;; + exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 - exit ;; + exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit ;; + exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit ;; + exit 0 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos - exit ;; + exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos - exit ;; + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit ;; + exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit ;; + exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit ;; + exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit ;; + exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit ;; + exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit ;; + exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit ;; + exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; + exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; + exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in @@ -1189,7 +1192,7 @@ unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1197,25 +1200,25 @@ UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; + exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx - exit ;; + exit 0 ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; + exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; + exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit ;; + exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit ;; + exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; + exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1226,44 +1229,41 @@ UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; + exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit ;; + exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit ;; + exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit ;; + exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit ;; + exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit ;; + exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its - exit ;; + exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} - exit ;; + exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; + exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + A*) echo alpha-dec-vms && exit 0 ;; + I*) echo ia64-dec-vms && exit 0 ;; + V*) echo vax-dec-vms && exit 0 ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1295,7 +1295,7 @@ #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); + printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1384,12 +1384,11 @@ } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) @@ -1398,22 +1397,22 @@ case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit ;; + exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit 0 ;; c34*) echo c34-convex-bsd - exit ;; + exit 0 ;; c38*) echo c38-convex-bsd - exit ;; + exit 0 ;; c4*) echo c4-convex-bsd - exit ;; + exit 0 ;; esac fi --- vlc-0.8.4.debian.orig/extras/faad2/config.h.in +++ vlc-0.8.4.debian/extras/faad2/config.h.in @@ -20,15 +20,24 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H +/* Define if needed */ +#undef HAVE_FPOS_T_POS + /* Define to 1 if you have the `getpwuid' function. */ #undef HAVE_GETPWUID /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define if needed */ +#undef HAVE_IN_PORT_T + /* Define if you have the IOKit API */ #undef HAVE_IOKIT_IOKITLIB_H +/* Define to 1 if you have the `mp4v2' library (-lmp4v2). */ +#undef HAVE_LIBMP4V2 + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H @@ -41,6 +50,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define if needed */ +#undef HAVE_SOCKLEN_T + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H --- vlc-0.8.4.debian.orig/extras/faad2/config.sub +++ vlc-0.8.4.debian/extras/faad2/config.sub @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2005-07-08' +timestamp='2005-04-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,15 +21,14 @@ # # 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. -# +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. - # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # @@ -84,11 +83,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; + echo "$timestamp" ; exit 0 ;; --version | -v ) - echo "$version" ; exit ;; + echo "$version" ; exit 0 ;; --help | --h* | -h ) - echo "$usage"; exit ;; + echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -100,7 +99,7 @@ *local*) # First pass through any local machine types. echo $1 - exit ;; + exit 0;; * ) break ;; @@ -248,7 +247,6 @@ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ @@ -257,14 +255,13 @@ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ - | ms1 \ | msp430 \ | ns16k | ns32k \ - | or32 \ + | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ @@ -276,9 +273,6 @@ | z8k) basic_machine=$basic_machine-unknown ;; - m32c) - basic_machine=$basic_machine-unknown - ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown @@ -327,7 +321,6 @@ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ @@ -336,7 +329,6 @@ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ - | ms1-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ @@ -344,7 +336,7 @@ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ @@ -359,8 +351,6 @@ | ymp-* \ | z8k-*) ;; - m32c-*) - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) @@ -771,8 +761,9 @@ basic_machine=hppa1.1-oki os=-proelf ;; - openrisc | openrisc-*) + or32 | or32-*) basic_machine=or32-unknown + os=-coff ;; os400) basic_machine=powerpc-ibm @@ -1098,9 +1089,12 @@ we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; + sh64) + basic_machine=sh64-unknown + ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; @@ -1187,8 +1181,7 @@ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1206,7 +1199,7 @@ os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) @@ -1395,9 +1388,6 @@ *-be) os=-beos ;; - *-haiku) - os=-haiku - ;; *-ibm) os=-aix ;; @@ -1569,7 +1559,7 @@ esac echo $basic_machine$os -exit +exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) --- vlc-0.8.4.debian.orig/extras/faad2/configure +++ vlc-0.8.4.debian/extras/faad2/configure @@ -462,7 +462,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_DEPS RPMBUILD MP4FF_LIBS external_mp4v2 HAVE_MPEG4IP_PLUG_TRUE HAVE_MPEG4IP_PLUG_FALSE XMMS_CONFIG GTK_CONFIG HAVE_XMMS_TRUE HAVE_XMMS_FALSE LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_DEPS RPMBUILD MP4FF_LIBS WITH_MP4V2_TRUE WITH_MP4V2_FALSE HAVE_MPEG4IP_PLUG_TRUE HAVE_MPEG4IP_PLUG_FALSE XMMS_CONFIG GTK_CONFIG HAVE_XMMS_TRUE HAVE_XMMS_FALSE PKG_CONFIG ac_pt_PKG_CONFIG BMP_CFLAGS BMP_LIBS HAVE_BMP_TRUE HAVE_BMP_FALSE LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -943,6 +943,18 @@ ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS +ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_env_PKG_CONFIG_value=$PKG_CONFIG +ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG +ac_env_BMP_CFLAGS_set=${BMP_CFLAGS+set} +ac_env_BMP_CFLAGS_value=$BMP_CFLAGS +ac_cv_env_BMP_CFLAGS_set=${BMP_CFLAGS+set} +ac_cv_env_BMP_CFLAGS_value=$BMP_CFLAGS +ac_env_BMP_LIBS_set=${BMP_LIBS+set} +ac_env_BMP_LIBS_value=$BMP_LIBS +ac_cv_env_BMP_LIBS_set=${BMP_LIBS+set} +ac_cv_env_BMP_LIBS_value=$BMP_LIBS # # Report the --help message. @@ -1028,8 +1040,8 @@ build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] - --disable-dependency-tracking Speeds up one-time builds - --enable-dependency-tracking Do not reject slow dependency extractors + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: @@ -1041,7 +1053,9 @@ --with-tags[=TAGS] include additional configurations [automatic] --with-xmms compile XMMS-1 plugin + --with-bmp compile BMP plugins --with-drm compile libfaad with DRM support + --with-mp4v2 compile libmp4v2 --with-mpeg4ip compile mpeg4ip plugin Some influential environment variables: @@ -1057,6 +1071,9 @@ CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags + PKG_CONFIG path to pkg-config utility + BMP_CFLAGS C compiler flags for BMP, overriding pkg-config + BMP_LIBS linker flags for BMP, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1521,7 +1538,7 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. -am__api_version="1.7" +am__api_version="1.8" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -1659,7 +1676,6 @@ program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed - # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` @@ -1673,6 +1689,31 @@ echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + mkdir_p='mkdir -p -- .' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -1751,7 +1792,7 @@ fi rmdir .tst 2>/dev/null - # test to see if srcdir already configured +# test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 @@ -3054,7 +3095,9 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - : > sub/conftst$i.h + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf @@ -3082,9 +3125,14 @@ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings - # (even with -Werror). So we grep stderr for any message - # that says an option was ignored. - if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi @@ -3588,7 +3636,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3591 "configure"' > conftest.$ac_ext + echo '#line 3639 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4761,7 +4809,9 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - : > sub/conftst$i.h + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf @@ -4789,9 +4839,14 @@ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings - # (even with -Werror). So we grep stderr for any message - # that says an option was ignored. - if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi @@ -5145,7 +5200,7 @@ # Provide some information about the compiler. -echo "$as_me:5148:" \ +echo "$as_me:5203:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -6177,11 +6232,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6180: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6235: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6184: \$? = $ac_status" >&5 + echo "$as_me:6239: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6410,11 +6465,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6413: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6468: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6417: \$? = $ac_status" >&5 + echo "$as_me:6472: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6470,11 +6525,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6473: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6528: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6477: \$? = $ac_status" >&5 + echo "$as_me:6532: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8658,7 +8713,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10991: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10940: \$? = $ac_status" >&5 + echo "$as_me:10995: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10993,11 +11048,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10996: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11051: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11000: \$? = $ac_status" >&5 + echo "$as_me:11055: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12362,7 +12417,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13345: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13294: \$? = $ac_status" >&5 + echo "$as_me:13349: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13347,11 +13402,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13350: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13405: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13354: \$? = $ac_status" >&5 + echo "$as_me:13409: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15392,11 +15447,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15395: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15450: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15399: \$? = $ac_status" >&5 + echo "$as_me:15454: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15625,11 +15680,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15628: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15683: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15632: \$? = $ac_status" >&5 + echo "$as_me:15687: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15685,11 +15740,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15688: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15743: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15692: \$? = $ac_status" >&5 + echo "$as_me:15747: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17873,7 +17928,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - : > sub/conftst$i.h + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf @@ -19779,9 +19836,14 @@ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings - # (even with -Werror). So we grep stderr for any message - # that says an option was ignored. - if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi @@ -20219,6 +20281,14 @@ WITHXMMS=no fi; +# Check whether --with-bmp or --without-bmp was given. +if test "${with_bmp+set}" = set; then + withval="$with_bmp" + WITHBMP=$withval +else + WITHBMP=no +fi; + # Check whether --with-drm or --without-drm was given. if test "${with_drm+set}" = set; then @@ -20229,6 +20299,14 @@ fi; +# Check whether --with-mp4v2 or --without-mp4v2 was given. +if test "${with_mp4v2+set}" = set; then + withval="$with_mp4v2" + WITHMP4V2=$withval +else + WITHMP4V2=no +fi; + # Check whether --with-mpeg4ip or --without-mpeg4ip was given. if test "${with_mpeg4ip+set}" = set; then withval="$with_mpeg4ip" @@ -22315,139 +22393,24 @@ done -# Extract the first word of "mpeg4ip-config", so it can be a program name with args. -set dummy mpeg4ip-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_external_mp4v2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$external_mp4v2"; then - ac_cv_prog_external_mp4v2="$external_mp4v2" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_external_mp4v2="yes" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_external_mp4v2" && ac_cv_prog_external_mp4v2="no" -fi -fi -external_mp4v2=$ac_cv_prog_external_mp4v2 -if test -n "$external_mp4v2"; then - echo "$as_me:$LINENO: result: $external_mp4v2" >&5 -echo "${ECHO_T}$external_mp4v2" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - - -if false; then - HAVE_MPEG4IP_PLUG_TRUE= - HAVE_MPEG4IP_PLUG_FALSE='#' -else - HAVE_MPEG4IP_PLUG_TRUE='#' - HAVE_MPEG4IP_PLUG_FALSE= -fi - -if test x$WITHMPEG4IP = xyes; then - if test x$external_mp4v2 = xyes; then - - -if true; then - HAVE_MPEG4IP_PLUG_TRUE= - HAVE_MPEG4IP_PLUG_FALSE='#' -else - HAVE_MPEG4IP_PLUG_TRUE='#' - HAVE_MPEG4IP_PLUG_FALSE= -fi - - { echo "$as_me:$LINENO: \"Building MPEG4IP plugin\"" >&5 -echo "$as_me: \"Building MPEG4IP plugin\"" >&6;} - else - { echo "$as_me:$LINENO: \"MPEG4IP libmp4v2 is required for MPEG4IP plugin\"" >&5 -echo "$as_me: \"MPEG4IP libmp4v2 is required for MPEG4IP plugin\"" >&6;} - fi -fi - -if test x$WITHXMMS = xyes; then - for ac_prog in xmms-config -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_XMMS_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$XMMS_CONFIG"; then - ac_cv_prog_XMMS_CONFIG="$XMMS_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_XMMS_CONFIG="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -XMMS_CONFIG=$ac_cv_prog_XMMS_CONFIG -if test -n "$XMMS_CONFIG"; then - echo "$as_me:$LINENO: result: $XMMS_CONFIG" >&5 -echo "${ECHO_T}$XMMS_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$XMMS_CONFIG" && break -done -test -n "$XMMS_CONFIG" || XMMS_CONFIG=""not_found"" - if test "$XMMS_CONFIG" = "not_found"; then - { { echo "$as_me:$LINENO: error: \"*** xmms-config not found - xmms plugin can't be build\"" >&5 -echo "$as_me: error: \"*** xmms-config not found - xmms plugin can't be build\"" >&2;} - { (exit 1); exit 1; }; } - fi - if test "${ac_cv_header_pthread_h+set}" = set; then - echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 -if test "${ac_cv_header_pthread_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking pthread.h usability" >&5 -echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF + echo "$as_me:$LINENO: checking for in_port_t temp" >&5 +echo $ECHO_N "checking for in_port_t temp... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include +#include + #include +int +main () +{ +in_port_t temp; + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -22470,129 +22433,45 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + libfaad_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no +libfaad_ok=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + if test $libfaad_ok = yes; then -# Is the header present? -echo "$as_me:$LINENO: checking pthread.h presence" >&5 -echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include +cat >>confdefs.h <<\_ACEOF +#define HAVE_IN_PORT_T 1 _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 -if test "${ac_cv_header_pthread_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_pthread_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 -fi -if test $ac_cv_header_pthread_h = yes; then - : -else - { { echo "$as_me:$LINENO: error: *** pthread headers support not installed or not found" >&5 -echo "$as_me: error: *** pthread headers support not installed or not found" >&2;} - { (exit 1); exit 1; }; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "${ac_cv_header_id3_h+set}" = set; then - echo "$as_me:$LINENO: checking for id3.h" >&5 -echo $ECHO_N "checking for id3.h... $ECHO_C" >&6 -if test "${ac_cv_header_id3_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_id3_h" >&5 -echo "${ECHO_T}$ac_cv_header_id3_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking id3.h usability" >&5 -echo $ECHO_N "checking id3.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF + echo "$as_me:$LINENO: checking for socklen_t temp" >&5 +echo $ECHO_N "checking for socklen_t temp... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include +#include + #include +int +main () +{ +socklen_t temp; + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -22615,7 +22494,1221 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + libfaad_ok=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +libfaad_ok=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + if test $libfaad_ok = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SOCKLEN_T 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + echo "$as_me:$LINENO: checking for fpos_t foo; foo.__pos = 0;" >&5 +echo $ECHO_N "checking for fpos_t foo; foo.__pos = 0;... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +fpos_t foo; foo.__pos = 0;; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + libfaad_ok=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +libfaad_ok=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + if test $libfaad_ok = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FPOS_T_POS 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + +external_mp4v2=yes + +echo "$as_me:$LINENO: checking for MP4Create in -lmp4v2" >&5 +echo $ECHO_N "checking for MP4Create in -lmp4v2... $ECHO_C" >&6 +if test "${ac_cv_lib_mp4v2_MP4Create+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmp4v2 -lstdc++ $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char MP4Create (); +int +main () +{ +MP4Create (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_mp4v2_MP4Create=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_mp4v2_MP4Create=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_mp4v2_MP4Create" >&5 +echo "${ECHO_T}$ac_cv_lib_mp4v2_MP4Create" >&6 +if test $ac_cv_lib_mp4v2_MP4Create = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMP4V2 1 +_ACEOF + + LIBS="-lmp4v2 $LIBS" + +else + external_mp4v2=no +fi + + +echo "$as_me:$LINENO: checking for MP4MetadataDelete in -lmp4v2" >&5 +echo $ECHO_N "checking for MP4MetadataDelete in -lmp4v2... $ECHO_C" >&6 +if test "${ac_cv_lib_mp4v2_MP4MetadataDelete+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmp4v2 -lstdc++ $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char MP4MetadataDelete (); +int +main () +{ +MP4MetadataDelete (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_mp4v2_MP4MetadataDelete=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_mp4v2_MP4MetadataDelete=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_mp4v2_MP4MetadataDelete" >&5 +echo "${ECHO_T}$ac_cv_lib_mp4v2_MP4MetadataDelete" >&6 +if test $ac_cv_lib_mp4v2_MP4MetadataDelete = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMP4V2 1 +_ACEOF + + LIBS="-lmp4v2 $LIBS" + +else + external_mp4v2=no +fi + +if test "${ac_cv_header_mp4_h+set}" = set; then + echo "$as_me:$LINENO: checking for mp4.h" >&5 +echo $ECHO_N "checking for mp4.h... $ECHO_C" >&6 +if test "${ac_cv_header_mp4_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_mp4_h" >&5 +echo "${ECHO_T}$ac_cv_header_mp4_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking mp4.h usability" >&5 +echo $ECHO_N "checking mp4.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking mp4.h presence" >&5 +echo $ECHO_N "checking mp4.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: mp4.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: mp4.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: mp4.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: mp4.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: mp4.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: mp4.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: mp4.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: mp4.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: mp4.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: mp4.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: mp4.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: mp4.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: mp4.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: mp4.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: mp4.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: mp4.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for mp4.h" >&5 +echo $ECHO_N "checking for mp4.h... $ECHO_C" >&6 +if test "${ac_cv_header_mp4_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_mp4_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_mp4_h" >&5 +echo "${ECHO_T}$ac_cv_header_mp4_h" >&6 + +fi +if test $ac_cv_header_mp4_h = yes; then + : +else + external_mp4v2=no +fi + + + + + +if false; then + WITH_MP4V2_TRUE= + WITH_MP4V2_FALSE='#' +else + WITH_MP4V2_TRUE='#' + WITH_MP4V2_FALSE= +fi + + +if test x$external_mp4v2 = xyes; then + + +if true; then + HAVE_MPEG4IP_PLUG_TRUE= + HAVE_MPEG4IP_PLUG_FALSE='#' +else + HAVE_MPEG4IP_PLUG_TRUE='#' + HAVE_MPEG4IP_PLUG_FALSE= +fi + + { echo "$as_me:$LINENO: *** Building with external mp4v2 ***" >&5 +echo "$as_me: *** Building with external mp4v2 ***" >&6;} +else + { echo "$as_me:$LINENO: *** Building with internal mp4v2 ***" >&5 +echo "$as_me: *** Building with internal mp4v2 ***" >&6;} + + +if false; then + HAVE_MPEG4IP_PLUG_TRUE= + HAVE_MPEG4IP_PLUG_FALSE='#' +else + HAVE_MPEG4IP_PLUG_TRUE='#' + HAVE_MPEG4IP_PLUG_FALSE= +fi + + if test x$WITHMP4V2 = xyes; then + + +if true; then + WITH_MP4V2_TRUE= + WITH_MP4V2_FALSE='#' +else + WITH_MP4V2_TRUE='#' + WITH_MP4V2_FALSE= +fi + + fi +fi + +if test x$WITHXMMS = xyes; then + for ac_prog in xmms-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_XMMS_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$XMMS_CONFIG"; then + ac_cv_prog_XMMS_CONFIG="$XMMS_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_XMMS_CONFIG="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +XMMS_CONFIG=$ac_cv_prog_XMMS_CONFIG +if test -n "$XMMS_CONFIG"; then + echo "$as_me:$LINENO: result: $XMMS_CONFIG" >&5 +echo "${ECHO_T}$XMMS_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$XMMS_CONFIG" && break +done +test -n "$XMMS_CONFIG" || XMMS_CONFIG=""not_found"" + + if test "$XMMS_CONFIG" = "not_found"; then + { { echo "$as_me:$LINENO: error: \"*** xmms-config not found - xmms plugin can't be build\"" >&5 +echo "$as_me: error: \"*** xmms-config not found - xmms plugin can't be build\"" >&2;} + { (exit 1); exit 1; }; } + fi + if test "${ac_cv_header_pthread_h+set}" = set; then + echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 +if test "${ac_cv_header_pthread_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking pthread.h usability" >&5 +echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking pthread.h presence" >&5 +echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 +if test "${ac_cv_header_pthread_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_pthread_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 + +fi +if test $ac_cv_header_pthread_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: *** pthread headers support not installed or not found" >&5 +echo "$as_me: error: *** pthread headers support not installed or not found" >&2;} + { (exit 1); exit 1; }; } +fi + + + if test "${ac_cv_header_id3_h+set}" = set; then + echo "$as_me:$LINENO: checking for id3.h" >&5 +echo $ECHO_N "checking for id3.h... $ECHO_C" >&6 +if test "${ac_cv_header_id3_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_id3_h" >&5 +echo "${ECHO_T}$ac_cv_header_id3_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking id3.h usability" >&5 +echo $ECHO_N "checking id3.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking id3.h presence" >&5 +echo $ECHO_N "checking id3.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: id3.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: id3.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: id3.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: id3.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: id3.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: id3.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: id3.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: id3.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: id3.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: id3.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: id3.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: id3.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: id3.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: id3.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: id3.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: id3.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for id3.h" >&5 +echo $ECHO_N "checking for id3.h... $ECHO_C" >&6 +if test "${ac_cv_header_id3_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_id3_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_id3_h" >&5 +echo "${ECHO_T}$ac_cv_header_id3_h" >&6 + +fi +if test $ac_cv_header_id3_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: *** id3lib headers support not installed or not found" >&5 +echo "$as_me: error: *** id3lib headers support not installed or not found" >&2;} + { (exit 1); exit 1; }; } +fi + + + for ac_prog in gtk-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GTK_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GTK_CONFIG"; then + ac_cv_prog_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GTK_CONFIG="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +GTK_CONFIG=$ac_cv_prog_GTK_CONFIG +if test -n "$GTK_CONFIG"; then + echo "$as_me:$LINENO: result: $GTK_CONFIG" >&5 +echo "${ECHO_T}$GTK_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$GTK_CONFIG" && break +done +test -n "$GTK_CONFIG" || GTK_CONFIG=""not_found"" + + if test "$XGTK_CONFIG" = "not_found"; then + { { echo "$as_me:$LINENO: error: \"*** gtk-config not found - xmms plugin can't be build without\"" >&5 +echo "$as_me: error: \"*** gtk-config not found - xmms plugin can't be build without\"" >&2;} + { (exit 1); exit 1; }; } + fi + + + +if true; then + HAVE_XMMS_TRUE= + HAVE_XMMS_FALSE='#' +else + HAVE_XMMS_TRUE='#' + HAVE_XMMS_FALSE= +fi + +else + { echo "$as_me:$LINENO: no xmms build configured" >&5 +echo "$as_me: no xmms build configured" >&6;} + + +if false; then + HAVE_XMMS_TRUE= + HAVE_XMMS_FALSE='#' +else + HAVE_XMMS_TRUE='#' + HAVE_XMMS_FALSE= +fi + +fi + +if test x$WITHBMP = xyes; then + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + PKG_CONFIG="" + fi + +fi + +pkg_failed=no +echo "$as_me:$LINENO: checking for BMP" >&5 +echo $ECHO_N "checking for BMP... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"bmp\"") >&5 + ($PKG_CONFIG --exists --print-errors "bmp") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_BMP_CFLAGS=`$PKG_CONFIG --cflags "bmp" 2>/dev/null` +else + pkg_failed=yes +fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"bmp\"") >&5 + ($PKG_CONFIG --exists --print-errors "bmp") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_BMP_LIBS=`$PKG_CONFIG --libs "bmp" 2>/dev/null` +else + pkg_failed=yes +fi +else + pkg_failed=untried +fi + +if test $pkg_failed = yes; then + BMP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "bmp"` + # Put the nasty error message in config.log where it belongs + echo "$BMP_PKG_ERRORS" 1>&5 + + { { echo "$as_me:$LINENO: error: Package requirements (bmp) were not met. +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively you may set the BMP_CFLAGS and BMP_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details." >&5 +echo "$as_me: error: Package requirements (bmp) were not met. +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively you may set the BMP_CFLAGS and BMP_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details." >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively you may set the BMP_CFLAGS and BMP_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively you may set the BMP_CFLAGS and BMP_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + BMP_CFLAGS=$pkg_cv_BMP_CFLAGS + BMP_LIBS=$pkg_cv_BMP_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + : +fi + if test "${ac_cv_header_pthread_h+set}" = set; then + echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 +if test "${ac_cv_header_pthread_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking pthread.h usability" >&5 +echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking pthread.h presence" >&5 +echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 +if test "${ac_cv_header_pthread_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_pthread_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 + +fi +if test $ac_cv_header_pthread_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: *** pthread headers support not installed or not found" >&5 +echo "$as_me: error: *** pthread headers support not installed or not found" >&2;} + { (exit 1); exit 1; }; } +fi + + + if test "${ac_cv_header_id3_h+set}" = set; then + echo "$as_me:$LINENO: checking for id3.h" >&5 +echo $ECHO_N "checking for id3.h... $ECHO_C" >&6 +if test "${ac_cv_header_id3_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_id3_h" >&5 +echo "${ECHO_T}$ac_cv_header_id3_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking id3.h usability" >&5 +echo $ECHO_N "checking id3.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -22718,74 +23811,27 @@ fi - for ac_prog in gtk-config -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_GTK_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$GTK_CONFIG"; then - ac_cv_prog_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GTK_CONFIG="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -GTK_CONFIG=$ac_cv_prog_GTK_CONFIG -if test -n "$GTK_CONFIG"; then - echo "$as_me:$LINENO: result: $GTK_CONFIG" >&5 -echo "${ECHO_T}$GTK_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$GTK_CONFIG" && break -done -test -n "$GTK_CONFIG" || GTK_CONFIG=""not_found"" - - if test "$XGTK_CONFIG" = "not_found"; then - { { echo "$as_me:$LINENO: error: \"*** gtk-config not found - xmms plugin can't be build without\"" >&5 -echo "$as_me: error: \"*** gtk-config not found - xmms plugin can't be build without\"" >&2;} - { (exit 1); exit 1; }; } - fi - if true; then - HAVE_XMMS_TRUE= - HAVE_XMMS_FALSE='#' + HAVE_BMP_TRUE= + HAVE_BMP_FALSE='#' else - HAVE_XMMS_TRUE='#' - HAVE_XMMS_FALSE= + HAVE_BMP_TRUE='#' + HAVE_BMP_FALSE= fi else - { echo "$as_me:$LINENO: no xmms build configured" >&5 -echo "$as_me: no xmms build configured" >&6;} + { echo "$as_me:$LINENO: no bmp build configured" >&5 +echo "$as_me: no bmp build configured" >&6;} if false; then - HAVE_XMMS_TRUE= - HAVE_XMMS_FALSE='#' + HAVE_BMP_TRUE= + HAVE_BMP_FALSE='#' else - HAVE_XMMS_TRUE='#' - HAVE_XMMS_FALSE= + HAVE_BMP_TRUE='#' + HAVE_BMP_FALSE= fi fi @@ -22809,12 +23855,18 @@ ac_config_files="$ac_config_files common/mp4ff/Makefile" + ac_config_files="$ac_config_files common/mp4v2/Makefile" + ac_config_files="$ac_config_files plugins/Makefile" ac_config_files="$ac_config_files plugins/xmms/Makefile" ac_config_files="$ac_config_files plugins/xmms/src/Makefile" + ac_config_files="$ac_config_files plugins/bmp/Makefile" + + ac_config_files="$ac_config_files plugins/bmp/src/Makefile" + ac_config_files="$ac_config_files plugins/mpeg4ip/Makefile" ac_config_files="$ac_config_files faad2.spec" @@ -22943,6 +23995,13 @@ Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${WITH_MP4V2_TRUE}" && test -z "${WITH_MP4V2_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WITH_MP4V2\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WITH_MP4V2\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${HAVE_MPEG4IP_PLUG_TRUE}" && test -z "${HAVE_MPEG4IP_PLUG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_MPEG4IP_PLUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -22957,6 +24016,13 @@ Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${WITH_MP4V2_TRUE}" && test -z "${WITH_MP4V2_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WITH_MP4V2\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WITH_MP4V2\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${HAVE_XMMS_TRUE}" && test -z "${HAVE_XMMS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_XMMS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -22971,6 +24037,20 @@ Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${HAVE_BMP_TRUE}" && test -z "${HAVE_BMP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_BMP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_BMP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_BMP_TRUE}" && test -z "${HAVE_BMP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_BMP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_BMP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -23418,9 +24498,12 @@ "libfaad/Makefile" ) CONFIG_FILES="$CONFIG_FILES libfaad/Makefile" ;; "common/Makefile" ) CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; "common/mp4ff/Makefile" ) CONFIG_FILES="$CONFIG_FILES common/mp4ff/Makefile" ;; + "common/mp4v2/Makefile" ) CONFIG_FILES="$CONFIG_FILES common/mp4v2/Makefile" ;; "plugins/Makefile" ) CONFIG_FILES="$CONFIG_FILES plugins/Makefile" ;; "plugins/xmms/Makefile" ) CONFIG_FILES="$CONFIG_FILES plugins/xmms/Makefile" ;; "plugins/xmms/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES plugins/xmms/src/Makefile" ;; + "plugins/bmp/Makefile" ) CONFIG_FILES="$CONFIG_FILES plugins/bmp/Makefile" ;; + "plugins/bmp/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES plugins/bmp/src/Makefile" ;; "plugins/mpeg4ip/Makefile" ) CONFIG_FILES="$CONFIG_FILES plugins/mpeg4ip/Makefile" ;; "faad2.spec" ) CONFIG_FILES="$CONFIG_FILES faad2.spec" ;; "frontend/Makefile" ) CONFIG_FILES="$CONFIG_FILES frontend/Makefile" ;; @@ -23528,6 +24611,7 @@ s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t @@ -23577,13 +24661,20 @@ s,@LIBTOOL_DEPS@,$LIBTOOL_DEPS,;t t s,@RPMBUILD@,$RPMBUILD,;t t s,@MP4FF_LIBS@,$MP4FF_LIBS,;t t -s,@external_mp4v2@,$external_mp4v2,;t t +s,@WITH_MP4V2_TRUE@,$WITH_MP4V2_TRUE,;t t +s,@WITH_MP4V2_FALSE@,$WITH_MP4V2_FALSE,;t t s,@HAVE_MPEG4IP_PLUG_TRUE@,$HAVE_MPEG4IP_PLUG_TRUE,;t t s,@HAVE_MPEG4IP_PLUG_FALSE@,$HAVE_MPEG4IP_PLUG_FALSE,;t t s,@XMMS_CONFIG@,$XMMS_CONFIG,;t t s,@GTK_CONFIG@,$GTK_CONFIG,;t t s,@HAVE_XMMS_TRUE@,$HAVE_XMMS_TRUE,;t t s,@HAVE_XMMS_FALSE@,$HAVE_XMMS_FALSE,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@BMP_CFLAGS@,$BMP_CFLAGS,;t t +s,@BMP_LIBS@,$BMP_LIBS,;t t +s,@HAVE_BMP_TRUE@,$HAVE_BMP_TRUE,;t t +s,@HAVE_BMP_FALSE@,$HAVE_BMP_FALSE,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF @@ -24212,14 +25303,14 @@ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. - DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n -e '/^U = / s///p' < "$mf"` + U=`sed -n 's/^U = //p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n -e ' + for file in `sed -n ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop --- vlc-0.8.4.debian.orig/extras/faad2/configure.in +++ vlc-0.8.4.debian/extras/faad2/configure.in @@ -28,10 +28,12 @@ AC_ARG_WITH(xmms,[ --with-xmms compile XMMS-1 plugin], WITHXMMS=$withval, WITHXMMS=no) +AC_ARG_WITH( bmp, [ --with-bmp compile BMP plugins],WITHBMP=$withval, WITHBMP=no) AC_ARG_WITH(drm,[ --with-drm compile libfaad with DRM support], WITHDRM=$withval, WITHDRM=no) +AC_ARG_WITH(mp4v2, [ --with-mp4v2 compile libmp4v2],WITHMP4V2=$withval, WITHMP4V2=no) AC_ARG_WITH(mpeg4ip, [ --with-mpeg4ip compile mpeg4ip plugin], WITHMPEG4IP=$withval, WITHMPEG4IP=no) @@ -80,15 +82,33 @@ AC_CHECK_FUNCS(strsep) -AC_CHECK_PROG(external_mp4v2, mpeg4ip-config, yes, no) -AM_CONDITIONAL(HAVE_MPEG4IP_PLUG, false) -if test x$WITHMPEG4IP = xyes; then - if test x$external_mp4v2 = xyes; then - AM_CONDITIONAL(HAVE_MPEG4IP_PLUG, true) - AC_MSG_NOTICE("Building MPEG4IP plugin") - else - AC_MSG_NOTICE("MPEG4IP libmp4v2 is required for MPEG4IP plugin") - fi +MY_CHECK_TYPEDEF_FROM_INCLUDE([in_port_t temp], + [#include + #include ], [HAVE_IN_PORT_T]) +MY_CHECK_TYPEDEF_FROM_INCLUDE([socklen_t temp], + [#include + #include ], HAVE_SOCKLEN_T) +MY_CHECK_TYPEDEF_FROM_INCLUDE([fpos_t foo; foo.__pos = 0;], + [#include ], + [HAVE_FPOS_T_POS]) + + +external_mp4v2=yes +AC_CHECK_LIB(mp4v2, MP4Create, , external_mp4v2=no, -lstdc++) +AC_CHECK_LIB(mp4v2, MP4MetadataDelete, , external_mp4v2=no, -lstdc++) +AC_CHECK_HEADER(mp4.h, , external_mp4v2=no) + +AM_CONDITIONAL(WITH_MP4V2, false) + +if test x$external_mp4v2 = xyes; then + AM_CONDITIONAL(HAVE_MPEG4IP_PLUG, true) + AC_MSG_NOTICE([*** Building with external mp4v2 ***]) +else + AC_MSG_NOTICE([*** Building with internal mp4v2 ***]) + AM_CONDITIONAL(HAVE_MPEG4IP_PLUG, false) + if test x$WITHMP4V2 = xyes; then + AM_CONDITIONAL(WITH_MP4V2, true) + fi fi if test x$WITHXMMS = xyes; then @@ -111,6 +131,18 @@ AM_CONDITIONAL(HAVE_XMMS, false) fi +if test x$WITHBMP = xyes; then + PKG_CHECK_MODULES(BMP, bmp) + AC_CHECK_HEADER(pthread.h,, + AC_MSG_ERROR(*** pthread headers support not installed or not found)) + AC_CHECK_HEADER(id3.h,, + AC_MSG_ERROR(*** id3lib headers support not installed or not found)) + AM_CONDITIONAL(HAVE_BMP, true) +else + AC_MSG_NOTICE(no bmp build configured) + AM_CONDITIONAL(HAVE_BMP, false) +fi + if test x$WITHDRM = xyes; then AC_DEFINE(DRM, 1, [Define if you want to use libfaad together with Digital Radio Mondiale (DRM)]) AC_DEFINE(DRM_PS, 1, [Define if you want support for Digital Radio Mondiale (DRM) parametric stereo]) @@ -119,9 +151,12 @@ AC_CONFIG_FILES(libfaad/Makefile) AC_CONFIG_FILES(common/Makefile) AC_CONFIG_FILES(common/mp4ff/Makefile) +AC_CONFIG_FILES(common/mp4v2/Makefile) AC_CONFIG_FILES(plugins/Makefile) AC_CONFIG_FILES(plugins/xmms/Makefile) AC_CONFIG_FILES(plugins/xmms/src/Makefile) +AC_CONFIG_FILES(plugins/bmp/Makefile) +AC_CONFIG_FILES(plugins/bmp/src/Makefile) AC_CONFIG_FILES(plugins/mpeg4ip/Makefile) AC_CONFIG_FILES(faad2.spec) AC_CONFIG_FILES(frontend/Makefile) --- vlc-0.8.4.debian.orig/extras/faad2/depcomp +++ vlc-0.8.4.debian/extras/faad2/depcomp @@ -1,7 +1,9 @@ #! /bin/sh - # depcomp - compile a program generating dependencies as side-effects -# Copyright 1999, 2000, 2003 Free Software Foundation, Inc. + +scriptversion=2004-04-25.13 + +# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # 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 @@ -25,6 +27,36 @@ # Originally written by Alexandre Oliva . +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit 0 + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit 0 + ;; +esac + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -262,26 +294,32 @@ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then + # Dependencies are output in .lo.d with libtool 1.4. + # They are output in .o.d with libtool 1.5. tmpdepfile1="$dir.libs/$base.lo.d" - tmpdepfile2="$dir.libs/$base.d" + tmpdepfile2="$dir.libs/$base.o.d" + tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" + tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else - rm -f "$tmpdepfile1" "$tmpdepfile2" + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" - else + elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" + else + tmpdepfile="$tmpdepfile3" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" @@ -477,3 +515,12 @@ esac exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: --- vlc-0.8.4.debian.orig/extras/faad2/faad2.spec.in +++ vlc-0.8.4.debian/extras/faad2/faad2.spec.in @@ -104,7 +104,7 @@ %{_libdir}/libfaad.a %{_libdir}/libfaad.la %{_includedir}/faad.h -%{_includedir}/neaacdec.h +%{_includedir}/faad.h %files xmms %defattr(-,root,root) --- vlc-0.8.4.debian.orig/extras/faad2/frontend/Makefile.am +++ vlc-0.8.4.debian/extras/faad2/frontend/Makefile.am @@ -4,7 +4,7 @@ -I$(top_srcdir)/common/mp4ff faad_LDADD = $(top_builddir)/libfaad/libfaad.la \ - $(top_builddir)/common/mp4ff/libmp4ff.a + $(top_builddir)/common/mp4ff/libmp4ff.la faad_SOURCES = main.c \ audio.c audio.h \ --- vlc-0.8.4.debian.orig/extras/faad2/frontend/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/frontend/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.8.5 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,6 +14,8 @@ @SET_MAKE@ +SOURCES = $(faad_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -21,7 +23,6 @@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,6 +37,41 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ +bin_PROGRAMS = faad$(EXEEXT) +subdir = frontend +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_faad_OBJECTS = main.$(OBJEXT) audio.$(OBJEXT) getopt.$(OBJEXT) +faad_OBJECTS = $(am_faad_OBJECTS) +faad_DEPENDENCIES = $(top_builddir)/libfaad/libfaad.la \ + $(top_builddir)/common/mp4ff/libmp4ff.la +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/audio.Po ./$(DEPDIR)/getopt.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/main.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(faad_SOURCES) +DIST_SOURCES = $(faad_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -45,6 +81,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -66,6 +104,8 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ @@ -91,12 +131,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ XMMS_CONFIG = @XMMS_CONFIG@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ @@ -104,6 +147,7 @@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -119,7 +163,6 @@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ -external_mp4v2 = @external_mp4v2@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -132,6 +175,7 @@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -139,71 +183,60 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -bin_PROGRAMS = faad - INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/common/faad \ -I$(top_srcdir)/common/mp4ff - faad_LDADD = $(top_builddir)/libfaad/libfaad.la \ - $(top_builddir)/common/mp4ff/libmp4ff.a - + $(top_builddir)/common/mp4ff/libmp4ff.la faad_SOURCES = main.c \ audio.c audio.h \ $(top_srcdir)/common/faad/getopt.c -subdir = frontend -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = faad$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -am_faad_OBJECTS = main.$(OBJEXT) audio.$(OBJEXT) getopt.$(OBJEXT) -faad_OBJECTS = $(am_faad_OBJECTS) -faad_DEPENDENCIES = $(top_builddir)/libfaad/libfaad.la \ - $(top_builddir)/common/mp4ff/libmp4ff.a -faad_LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/audio.Po ./$(DEPDIR)/getopt.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/main.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(faad_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(faad_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu frontend/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu frontend/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done @@ -211,8 +244,8 @@ @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @@ -226,7 +259,7 @@ $(LINK) $(faad_LDFLAGS) $(faad_OBJECTS) $(faad_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -236,66 +269,48 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< getopt.o: $(top_srcdir)/common/faad/getopt.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt.o -MD -MP -MF "$(DEPDIR)/getopt.Tpo" \ -@am__fastdepCC_TRUE@ -c -o getopt.o `test -f '$(top_srcdir)/common/faad/getopt.c' || echo '$(srcdir)/'`$(top_srcdir)/common/faad/getopt.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getopt.Tpo" "$(DEPDIR)/getopt.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/getopt.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt.o -MD -MP -MF "$(DEPDIR)/getopt.Tpo" -c -o getopt.o `test -f '$(top_srcdir)/common/faad/getopt.c' || echo '$(srcdir)/'`$(top_srcdir)/common/faad/getopt.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getopt.Tpo" "$(DEPDIR)/getopt.Po"; else rm -f "$(DEPDIR)/getopt.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/common/faad/getopt.c' object='getopt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/getopt.Po' tmpdepfile='$(DEPDIR)/getopt.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.o `test -f '$(top_srcdir)/common/faad/getopt.c' || echo '$(srcdir)/'`$(top_srcdir)/common/faad/getopt.c getopt.obj: $(top_srcdir)/common/faad/getopt.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt.obj -MD -MP -MF "$(DEPDIR)/getopt.Tpo" \ -@am__fastdepCC_TRUE@ -c -o getopt.obj `if test -f '$(top_srcdir)/common/faad/getopt.c'; then $(CYGPATH_W) '$(top_srcdir)/common/faad/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/common/faad/getopt.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getopt.Tpo" "$(DEPDIR)/getopt.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/getopt.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt.obj -MD -MP -MF "$(DEPDIR)/getopt.Tpo" -c -o getopt.obj `if test -f '$(top_srcdir)/common/faad/getopt.c'; then $(CYGPATH_W) '$(top_srcdir)/common/faad/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/common/faad/getopt.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getopt.Tpo" "$(DEPDIR)/getopt.Po"; else rm -f "$(DEPDIR)/getopt.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/common/faad/getopt.c' object='getopt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/getopt.Po' tmpdepfile='$(DEPDIR)/getopt.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.obj `if test -f '$(top_srcdir)/common/faad/getopt.c'; then $(CYGPATH_W) '$(top_srcdir)/common/faad/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/common/faad/getopt.c'; fi` getopt.lo: $(top_srcdir)/common/faad/getopt.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt.lo -MD -MP -MF "$(DEPDIR)/getopt.Tpo" \ -@am__fastdepCC_TRUE@ -c -o getopt.lo `test -f '$(top_srcdir)/common/faad/getopt.c' || echo '$(srcdir)/'`$(top_srcdir)/common/faad/getopt.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getopt.Tpo" "$(DEPDIR)/getopt.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/getopt.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt.lo -MD -MP -MF "$(DEPDIR)/getopt.Tpo" -c -o getopt.lo `test -f '$(top_srcdir)/common/faad/getopt.c' || echo '$(srcdir)/'`$(top_srcdir)/common/faad/getopt.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/getopt.Tpo" "$(DEPDIR)/getopt.Plo"; else rm -f "$(DEPDIR)/getopt.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/common/faad/getopt.c' object='getopt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/getopt.Plo' tmpdepfile='$(DEPDIR)/getopt.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @@ -311,14 +326,6 @@ -rm -f libtool uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -327,6 +334,7 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -338,10 +346,11 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -364,10 +373,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -381,7 +386,7 @@ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -399,9 +404,10 @@ check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) - installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -440,6 +446,8 @@ dvi-am: +html: html-am + info: info-am info-am: @@ -477,14 +485,14 @@ .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-info-am + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. --- vlc-0.8.4.debian.orig/extras/faad2/frontend/audio.c +++ vlc-0.8.4.debian/extras/faad2/frontend/audio.c @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: audio.c,v 1.25 2005/02/01 13:15:56 menno Exp $ +** $Id: audio.c,v 1.24 2004/03/10 19:45:40 menno Exp $ **/ #ifdef _WIN32 @@ -37,7 +32,7 @@ #include #include #include -#include +#include #include "audio.h" --- vlc-0.8.4.debian.orig/extras/faad2/frontend/audio.h +++ vlc-0.8.4.debian/extras/faad2/frontend/audio.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: audio.h,v 1.16 2005/02/01 13:15:56 menno Exp $ +** $Id: audio.h,v 1.15 2004/03/10 19:45:40 menno Exp $ **/ #ifndef AUDIO_H_INCLUDED --- vlc-0.8.4.debian.orig/extras/faad2/frontend/faad.dsp +++ vlc-0.8.4.debian/extras/faad2/frontend/faad.dsp @@ -0,0 +1,143 @@ +# Microsoft Developer Studio Project File - Name="faad" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=faad - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "faad.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "faad.mak" CFG="faad - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "faad - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "faad - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "faad - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /I "../include" /I "../common/mp4ff" /I "../common/faad" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x413 /d "NDEBUG" +# ADD RSC /l 0x413 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Advapi32.lib /nologo /subsystem:console /machine:I386 +# SUBTRACT LINK32 /profile + +!ELSEIF "$(CFG)" == "faad - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "../include" /I "../common/mp4ff" /I "../common/faad" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x413 /d "_DEBUG" +# ADD RSC /l 0x413 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 Advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "faad - Win32 Release" +# Name "faad - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\audio.c +# End Source File +# Begin Source File + +SOURCE=..\common\faad\getopt.c +# End Source File +# Begin Source File + +SOURCE=.\main.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\audio.h +# End Source File +# Begin Source File + +SOURCE=..\common\faad\getopt.h +# End Source File +# Begin Source File + +SOURCE=..\common\mp4v2\mp4.h +# End Source File +# Begin Source File + +SOURCE=..\common\mp4ff\mp4ff.h +# End Source File +# Begin Source File + +SOURCE=..\common\mp4ff\mp4ff_int_types.h +# End Source File +# Begin Source File + +SOURCE=..\common\mp4v2\mpeg4ip.h +# End Source File +# Begin Source File + +SOURCE=..\include\faad.h +# End Source File +# Begin Source File + +SOURCE=..\common\mp4v2\systems.h +# End Source File +# Begin Source File + +SOURCE=..\common\mp4v2\win32_ver.h +# End Source File +# End Group +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/frontend/faad.dsw +++ vlc-0.8.4.debian/extras/faad2/frontend/faad.dsw @@ -0,0 +1,59 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "faad"=.\faad.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libfaad + End Project Dependency + Begin Project Dependency + Project_Dep_Name mp4ff + End Project Dependency +}}} + +############################################################################### + +Project: "libfaad"=..\libfaad\libfaad.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "mp4ff"=..\common\mp4ff\mp4ff.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + --- vlc-0.8.4.debian.orig/extras/faad2/frontend/faad.sln +++ vlc-0.8.4.debian/extras/faad2/frontend/faad.sln @@ -0,0 +1,39 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "faad", "faad.vcproj", "{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}" + ProjectSection(ProjectDependencies) = postProject + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114} = {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114} + {F470BB4A-7675-4D6A-B310-41F33AC6F987} = {F470BB4A-7675-4D6A-B310-41F33AC6F987} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "..\libfaad\libfaad.vcproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mp4ff", "..\common\mp4ff\mp4ff.vcproj", "{F470BB4A-7675-4D6A-B310-41F33AC6F987}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug.ActiveCfg = Debug|Win32 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug.Build.0 = Debug|Win32 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release.ActiveCfg = Release|Win32 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release.Build.0 = Release|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug.ActiveCfg = Debug|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug.Build.0 = Debug|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release.ActiveCfg = Release|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release.Build.0 = Release|Win32 + {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Debug.ActiveCfg = Debug|Win32 + {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Debug.Build.0 = Debug|Win32 + {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Release.ActiveCfg = Release|Win32 + {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal --- vlc-0.8.4.debian.orig/extras/faad2/frontend/faad.vcproj +++ vlc-0.8.4.debian/extras/faad2/frontend/faad.vcproj @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- vlc-0.8.4.debian.orig/extras/faad2/frontend/main.c +++ vlc-0.8.4.debian/extras/faad2/frontend/main.c @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: main.c,v 1.77 2005/02/01 13:15:56 menno Exp $ +** $Id: main.c,v 1.76 2004/03/27 11:14:49 menno Exp $ **/ #ifdef _WIN32 @@ -43,7 +38,7 @@ #include #include -#include +#include #include #include "audio.h" @@ -55,23 +50,6 @@ #define MAX_CHANNELS 6 /* make this higher to support files with more channels */ - -static int quiet = 0; - -void faad_fprintf(FILE *stream, const char *fmt, ...) -{ - va_list ap; - - if (!quiet) - { - va_start(ap, fmt); - - vfprintf(stream, fmt, ap); - - va_end(ap); - } -} - /* FAAD file buffering routines */ typedef struct { long bytes_into_buffer; @@ -219,7 +197,7 @@ #define SPEAKER_TOP_BACK_RIGHT 0x20000 #define SPEAKER_RESERVED 0x80000000 -long aacChannelConfig2wavexChannelMask(NeAACDecFrameInfo *hInfo) +long aacChannelConfig2wavexChannelMask(faacDecFrameInfo *hInfo) { if (hInfo->channels == 6 && hInfo->num_lfe_channels) { @@ -251,36 +229,36 @@ return ""; } -void print_channel_info(NeAACDecFrameInfo *frameInfo) +void print_channel_info(faacDecFrameInfo *frameInfo) { /* print some channel info */ int i; long channelMask = aacChannelConfig2wavexChannelMask(frameInfo); - faad_fprintf(stderr, " ---------------------\n"); + fprintf(stderr, " ---------------------\n"); if (frameInfo->num_lfe_channels > 0) { - faad_fprintf(stderr, " | Config: %2d.%d Ch |", frameInfo->channels-frameInfo->num_lfe_channels, frameInfo->num_lfe_channels); + fprintf(stderr, " | Config: %2d.%d Ch |", frameInfo->channels-frameInfo->num_lfe_channels, frameInfo->num_lfe_channels); } else { - faad_fprintf(stderr, " | Config: %2d Ch |", frameInfo->channels); + fprintf(stderr, " | Config: %2d Ch |", frameInfo->channels); } if (channelMask) - faad_fprintf(stderr, " WARNING: channels are reordered according to\n"); + fprintf(stderr, " WARNING: channels are reordered according to\n"); else - faad_fprintf(stderr, "\n"); - faad_fprintf(stderr, " ---------------------"); + fprintf(stderr, "\n"); + fprintf(stderr, " ---------------------"); if (channelMask) - faad_fprintf(stderr, " MS defaults defined in WAVE_FORMAT_EXTENSIBLE\n"); + fprintf(stderr, " MS defaults defined in WAVE_FORMAT_EXTENSIBLE\n"); else - faad_fprintf(stderr, "\n"); - faad_fprintf(stderr, " | Ch | Position |\n"); - faad_fprintf(stderr, " ---------------------\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " | Ch | Position |\n"); + fprintf(stderr, " ---------------------\n"); for (i = 0; i < frameInfo->channels; i++) { - faad_fprintf(stderr, " | %.2d | %-14s |\n", i, position2string((int)frameInfo->channel_position[i])); + fprintf(stderr, " | %.2d | %-14s |\n", i, position2string((int)frameInfo->channel_position[i])); } - faad_fprintf(stderr, " ---------------------\n"); - faad_fprintf(stderr, "\n"); + fprintf(stderr, " ---------------------\n"); + fprintf(stderr, "\n"); } int FindAdtsSRIndex(int sr) @@ -295,7 +273,7 @@ return 16 - 1; } -unsigned char *MakeAdtsHeader(int *dataSize, NeAACDecFrameInfo *hInfo, int old_format) +unsigned char *MakeAdtsHeader(int *dataSize, faacDecFrameInfo *hInfo, int old_format) { unsigned char *data; int profile = (hInfo->object_type - 1) & 0x3; @@ -358,39 +336,38 @@ void usage(void) { - faad_fprintf(stdout, "\nUsage:\n"); - faad_fprintf(stdout, "%s [options] infile.aac\n", progName); - faad_fprintf(stdout, "Options:\n"); - faad_fprintf(stdout, " -h Shows this help screen.\n"); - faad_fprintf(stdout, " -i Shows info about the input file.\n"); - faad_fprintf(stdout, " -a X Write MPEG-4 AAC ADTS output file.\n"); - faad_fprintf(stdout, " -t Assume old ADTS format.\n"); - faad_fprintf(stdout, " -o X Set output filename.\n"); - faad_fprintf(stdout, " -f X Set output format. Valid values for X are:\n"); - faad_fprintf(stdout, " 1: Microsoft WAV format (default).\n"); - faad_fprintf(stdout, " 2: RAW PCM data.\n"); - faad_fprintf(stdout, " -b X Set output sample format. Valid values for X are:\n"); - faad_fprintf(stdout, " 1: 16 bit PCM data (default).\n"); - faad_fprintf(stdout, " 2: 24 bit PCM data.\n"); - faad_fprintf(stdout, " 3: 32 bit PCM data.\n"); - faad_fprintf(stdout, " 4: 32 bit floating point data.\n"); - faad_fprintf(stdout, " 5: 64 bit floating point data.\n"); - faad_fprintf(stdout, " -s X Force the samplerate to X (for RAW files).\n"); - faad_fprintf(stdout, " -l X Set object type. Supported object types:\n"); - faad_fprintf(stdout, " 1: Main object type.\n"); - faad_fprintf(stdout, " 2: LC (Low Complexity) object type.\n"); - faad_fprintf(stdout, " 4: LTP (Long Term Prediction) object type.\n"); - faad_fprintf(stdout, " 23: LD (Low Delay) object type.\n"); - faad_fprintf(stdout, " -d Down matrix 5.1 to 2 channels\n"); - faad_fprintf(stdout, " -w Write output to stdio instead of a file.\n"); - faad_fprintf(stdout, " -g Disable gapless decoding.\n"); - faad_fprintf(stdout, " -q Quiet - suppresses status messages.\n"); - faad_fprintf(stdout, "Example:\n"); - faad_fprintf(stdout, " %s infile.aac\n", progName); - faad_fprintf(stdout, " %s infile.mp4\n", progName); - faad_fprintf(stdout, " %s -o outfile.wav infile.aac\n", progName); - faad_fprintf(stdout, " %s -w infile.aac > outfile.wav\n", progName); - faad_fprintf(stdout, " %s -a outfile.aac infile.aac\n", progName); + fprintf(stdout, "\nUsage:\n"); + fprintf(stdout, "%s [options] infile.aac\n", progName); + fprintf(stdout, "Options:\n"); + fprintf(stdout, " -h Shows this help screen.\n"); + fprintf(stdout, " -i Shows info about the input file.\n"); + fprintf(stdout, " -a X Write MPEG-4 AAC ADTS output file.\n"); + fprintf(stdout, " -t Assume old ADTS format.\n"); + fprintf(stdout, " -o X Set output filename.\n"); + fprintf(stdout, " -f X Set output format. Valid values for X are:\n"); + fprintf(stdout, " 1: Microsoft WAV format (default).\n"); + fprintf(stdout, " 2: RAW PCM data.\n"); + fprintf(stdout, " -b X Set output sample format. Valid values for X are:\n"); + fprintf(stdout, " 1: 16 bit PCM data (default).\n"); + fprintf(stdout, " 2: 24 bit PCM data.\n"); + fprintf(stdout, " 3: 32 bit PCM data.\n"); + fprintf(stdout, " 4: 32 bit floating point data.\n"); + fprintf(stdout, " 5: 64 bit floating point data.\n"); + fprintf(stdout, " -s X Force the samplerate to X (for RAW files).\n"); + fprintf(stdout, " -l X Set object type. Supported object types:\n"); + fprintf(stdout, " 1: Main object type.\n"); + fprintf(stdout, " 2: LC (Low Complexity) object type.\n"); + fprintf(stdout, " 4: LTP (Long Term Prediction) object type.\n"); + fprintf(stdout, " 23: LD (Low Delay) object type.\n"); + fprintf(stdout, " -d Down matrix 5.1 to 2 channels\n"); + fprintf(stdout, " -w Write output to stdio instead of a file.\n"); + fprintf(stdout, " -g Disable gapless decoding.\n"); + fprintf(stdout, "Example:\n"); + fprintf(stdout, " %s infile.aac\n", progName); + fprintf(stdout, " %s infile.mp4\n", progName); + fprintf(stdout, " %s -o outfile.wav infile.aac\n", progName); + fprintf(stdout, " %s -w infile.aac > outfile.wav\n", progName); + fprintf(stdout, " %s -a outfile.aac infile.aac\n", progName); return; } @@ -410,9 +387,9 @@ unsigned char *adtsData; int adtsDataSize; - NeAACDecHandle hDecoder; - NeAACDecFrameInfo frameInfo; - NeAACDecConfigurationPtr config; + faacDecHandle hDecoder; + faacDecFrameInfo frameInfo; + faacDecConfigurationPtr config; char percents[200]; int percent, old_percent = -1; @@ -432,7 +409,7 @@ adtsFile = fopen(adts_fn, "wb"); if (adtsFile == NULL) { - faad_fprintf(stderr, "Error opening file: %s\n", adts_fn); + fprintf(stderr, "Error opening file: %s\n", adts_fn); return 1; } } @@ -441,7 +418,7 @@ if (b.infile == NULL) { /* unable to open file */ - faad_fprintf(stderr, "Error opening file: %s\n", aacfile); + fprintf(stderr, "Error opening file: %s\n", aacfile); return 1; } @@ -451,7 +428,7 @@ if (!(b.buffer = (unsigned char*)malloc(FAAD_MIN_STREAMSIZE*MAX_CHANNELS))) { - faad_fprintf(stderr, "Memory allocation error\n"); + fprintf(stderr, "Memory allocation error\n"); return 0; } memset(b.buffer, 0, FAAD_MIN_STREAMSIZE*MAX_CHANNELS); @@ -476,11 +453,11 @@ fill_buffer(&b); } - hDecoder = NeAACDecOpen(); + hDecoder = faacDecOpen(); /* Set the default object type and samplerate */ /* This is useful for RAW AAC files */ - config = NeAACDecGetCurrentConfiguration(hDecoder); + config = faacDecGetCurrentConfiguration(hDecoder); if (def_srate) config->defSampleRate = def_srate; config->defObjectType = object_type; @@ -488,7 +465,7 @@ config->downMatrix = downMatrix; config->useOldADTSFormat = old_format; //config->dontUpSampleImplicitSBR = 1; - NeAACDecSetConfiguration(hDecoder, config); + faacDecSetConfiguration(hDecoder, config); /* get AAC infos for printing */ header_type = 0; @@ -528,14 +505,14 @@ *song_length = length; fill_buffer(&b); - if ((bread = NeAACDecInit(hDecoder, b.buffer, + if ((bread = faacDecInit(hDecoder, b.buffer, b.bytes_into_buffer, &samplerate, &channels)) < 0) { /* If some error initializing occured, skip the file */ - faad_fprintf(stderr, "Error initializing decoder library.\n"); + fprintf(stderr, "Error initializing decoder library.\n"); if (b.buffer) free(b.buffer); - NeAACDecClose(hDecoder); + faacDecClose(hDecoder); fclose(b.infile); return 1; } @@ -543,25 +520,25 @@ fill_buffer(&b); /* print AAC file info */ - faad_fprintf(stderr, "%s file info:\n", aacfile); + fprintf(stderr, "%s file info:\n", aacfile); switch (header_type) { case 0: - faad_fprintf(stderr, "RAW\n\n"); + fprintf(stderr, "RAW\n\n"); break; case 1: - faad_fprintf(stderr, "ADTS, %.3f sec, %d kbps, %d Hz\n\n", + fprintf(stderr, "ADTS, %.3f sec, %d kbps, %d Hz\n\n", length, bitrate, samplerate); break; case 2: - faad_fprintf(stderr, "ADIF, %.3f sec, %d kbps, %d Hz\n\n", + fprintf(stderr, "ADIF, %.3f sec, %d kbps, %d Hz\n\n", length, bitrate, samplerate); break; } if (infoOnly) { - NeAACDecClose(hDecoder); + faacDecClose(hDecoder); fclose(b.infile); if (b.buffer) free(b.buffer); @@ -570,7 +547,7 @@ do { - sample_buffer = NeAACDecDecode(hDecoder, &frameInfo, + sample_buffer = faacDecDecode(hDecoder, &frameInfo, b.buffer, b.bytes_into_buffer); if (adts_out == 1) @@ -593,8 +570,8 @@ if (frameInfo.error > 0) { - faad_fprintf(stderr, "Error: %s\n", - NeAACDecGetErrorMessage(frameInfo.error)); + fprintf(stderr, "Error: %s\n", + faacDecGetErrorMessage(frameInfo.error)); } /* open the sound file now that the number of channels are known */ @@ -618,12 +595,12 @@ { if (b.buffer) free(b.buffer); - NeAACDecClose(hDecoder); + faacDecClose(hDecoder); fclose(b.infile); return 0; } } else { - faad_fprintf(stderr, "Writing output MPEG-4 AAC ADTS file.\n\n"); + fprintf(stderr, "Writing output MPEG-4 AAC ADTS file.\n\n"); } first_time = 0; } @@ -633,7 +610,7 @@ { old_percent = percent; sprintf(percents, "%d%% decoding %s.", percent, aacfile); - faad_fprintf(stderr, "%s\r", percents); + fprintf(stderr, "%s\r", percents); #ifdef _WIN32 SetConsoleTitle(percents); #endif @@ -652,7 +629,7 @@ } while (sample_buffer != NULL); - NeAACDecClose(hDecoder); + faacDecClose(hDecoder); if (adts_out == 1) { @@ -686,7 +663,7 @@ if (buff) { - rc = NeAACDecAudioSpecificConfig(buff, buff_size, &mp4ASC); + rc = faacDecAudioSpecificConfig(buff, buff_size, &mp4ASC); free(buff); if (rc < 0) @@ -724,9 +701,9 @@ unsigned char *adtsData; int adtsDataSize; - NeAACDecHandle hDecoder; - NeAACDecConfigurationPtr config; - NeAACDecFrameInfo frameInfo; + faacDecHandle hDecoder; + faacDecConfigurationPtr config; + faacDecFrameInfo frameInfo; mp4AudioSpecificConfig mp4ASC; unsigned char *buffer; @@ -753,21 +730,21 @@ mp4cb->user_data = mp4File; - hDecoder = NeAACDecOpen(); + hDecoder = faacDecOpen(); /* Set configuration */ - config = NeAACDecGetCurrentConfiguration(hDecoder); + config = faacDecGetCurrentConfiguration(hDecoder); config->outputFormat = outputFormat; config->downMatrix = downMatrix; //config->dontUpSampleImplicitSBR = 1; - NeAACDecSetConfiguration(hDecoder, config); + faacDecSetConfiguration(hDecoder, config); if (adts_out) { adtsFile = fopen(adts_fn, "wb"); if (adtsFile == NULL) { - faad_fprintf(stderr, "Error opening file: %s\n", adts_fn); + fprintf(stderr, "Error opening file: %s\n", adts_fn); return 1; } } @@ -776,14 +753,14 @@ if (!infile) { /* unable to open file */ - faad_fprintf(stderr, "Error opening file: %s\n", mp4file); + fprintf(stderr, "Error opening file: %s\n", mp4file); return 1; } if ((track = GetAACTrack(infile)) < 0) { - faad_fprintf(stderr, "Unable to find correct AAC sound track in the MP4 file.\n"); - NeAACDecClose(hDecoder); + fprintf(stderr, "Unable to find correct AAC sound track in the MP4 file.\n"); + faacDecClose(hDecoder); mp4ff_close(infile); free(mp4cb); fclose(mp4File); @@ -794,12 +771,12 @@ buffer_size = 0; mp4ff_get_decoder_config(infile, track, &buffer, &buffer_size); - if(NeAACDecInit2(hDecoder, buffer, buffer_size, + if(faacDecInit2(hDecoder, buffer, buffer_size, &samplerate, &channels) < 0) { /* If some error initializing occured, skip the file */ - faad_fprintf(stderr, "Error initializing decoder library.\n"); - NeAACDecClose(hDecoder); + fprintf(stderr, "Error initializing decoder library.\n"); + faacDecClose(hDecoder); mp4ff_close(infile); free(mp4cb); fclose(mp4File); @@ -812,7 +789,7 @@ if (buffer) { - if (NeAACDecAudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0) + if (faacDecAudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0) { if (mp4ASC.frameLengthFlag == 1) framesize = 960; if (mp4ASC.sbr_present_flag == 1) framesize *= 2; @@ -821,7 +798,7 @@ } /* print some mp4 file info */ - faad_fprintf(stderr, "%s file info:\n\n", mp4file); + fprintf(stderr, "%s file info:\n\n", mp4file); { char *tag = NULL, *item = NULL; int k, j; @@ -837,7 +814,7 @@ *song_length = seconds; - faad_fprintf(stderr, "%s\t%.3f secs, %d ch, %d Hz\n\n", ot[(mp4ASC.objectTypeIndex > 5)?0:mp4ASC.objectTypeIndex], + fprintf(stderr, "%s\t%.3f secs, %d ch, %d Hz\n\n", ot[(mp4ASC.objectTypeIndex > 5)?0:mp4ASC.objectTypeIndex], seconds, mp4ASC.channelsConfiguration, mp4ASC.samplingFrequency); #define PRINT_MP4_METADATA @@ -849,19 +826,19 @@ { if (item != NULL && tag != NULL) { - faad_fprintf(stderr, "%s: %s\n", item, tag); + fprintf(stderr, "%s: %s\n", item, tag); free(item); item = NULL; free(tag); tag = NULL; } } } - if (j > 0) faad_fprintf(stderr, "\n"); + if (j > 0) fprintf(stderr, "\n"); #endif } if (infoOnly) { - NeAACDecClose(hDecoder); + faacDecClose(hDecoder); mp4ff_close(infile); free(mp4cb); fclose(mp4File); @@ -885,15 +862,15 @@ rc = mp4ff_read_sample(infile, track, sampleId, &buffer, &buffer_size); if (rc == 0) { - faad_fprintf(stderr, "Reading from MP4 file failed.\n"); - NeAACDecClose(hDecoder); + fprintf(stderr, "Reading from MP4 file failed.\n"); + faacDecClose(hDecoder); mp4ff_close(infile); free(mp4cb); fclose(mp4File); return 1; } - sample_buffer = NeAACDecDecode(hDecoder, &frameInfo, buffer, buffer_size); + sample_buffer = faacDecDecode(hDecoder, &frameInfo, buffer, buffer_size); if (adts_out == 1) { @@ -918,7 +895,7 @@ if (!useAacLength && !initial && (sampleId < numSamples/2) && (sample_count != frameInfo.samples)) { - faad_fprintf(stderr, "MP4 seems to have incorrect frame duration, using values from AAC data.\n"); + fprintf(stderr, "MP4 seems to have incorrect frame duration, using values from AAC data.\n"); useAacLength = 1; sample_count = frameInfo.samples; } @@ -952,7 +929,7 @@ } if (aufile == NULL) { - NeAACDecClose(hDecoder); + faacDecClose(hDecoder); mp4ff_close(infile); free(mp4cb); fclose(mp4File); @@ -969,7 +946,7 @@ { old_percent = percent; sprintf(percents, "%d%% decoding %s.", percent, mp4file); - faad_fprintf(stderr, "%s\r", percents); + fprintf(stderr, "%s\r", percents); #ifdef _WIN32 SetConsoleTitle(percents); #endif @@ -982,12 +959,12 @@ if (frameInfo.error > 0) { - faad_fprintf(stderr, "Warning: %s\n", - NeAACDecGetErrorMessage(frameInfo.error)); + fprintf(stderr, "Warning: %s\n", + faacDecGetErrorMessage(frameInfo.error)); } } - NeAACDecClose(hDecoder); + faacDecClose(hDecoder); if (adts_out == 1) { @@ -1036,8 +1013,21 @@ clock_t begin; #endif - unsigned long cap = NeAACDecGetCapabilities(); + unsigned long cap = faacDecGetCapabilities(); + fprintf(stderr, " *********** Ahead Software MPEG-4 AAC Decoder V%s ******************\n\n", FAAD2_VERSION); + fprintf(stderr, " Build: %s\n", __DATE__); + fprintf(stderr, " Copyright 2002-2004: Ahead Software AG\n"); + fprintf(stderr, " http://www.audiocoding.com\n"); + if (cap & FIXED_POINT_CAP) + fprintf(stderr, " Fixed point version\n"); + else + fprintf(stderr, " Floating point version\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " This program is free software; you can redistribute it and/or modify\n"); + fprintf(stderr, " it under the terms of the GNU General Public License.\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " **************************************************************************\n\n"); /* begin process command line */ progName = argv[0]; @@ -1045,7 +1035,6 @@ int c = -1; int option_index = 0; static struct option long_options[] = { - { "quiet", 0, 0, 'q' }, { "outfile", 0, 0, 'o' }, { "adtsout", 0, 0, 'a' }, { "oldformat", 0, 0, 't' }, @@ -1060,7 +1049,7 @@ { "help", 0, 0, 'h' } }; - c = getopt_long(argc, argv, "o:a:s:f:b:l:wgdhitq", + c = getopt_long(argc, argv, "o:a:s:f:b:l:wgdhit", long_options, &option_index); if (c == -1) @@ -1157,30 +1146,11 @@ case 'h': showHelp = 1; break; - case 'q': - quiet = 1; - break; default: break; } } - - faad_fprintf(stderr, " *********** Ahead Software MPEG-4 AAC Decoder V%s ******************\n\n", FAAD2_VERSION); - faad_fprintf(stderr, " Build: %s\n", __DATE__); - faad_fprintf(stderr, " Copyright 2002-2004: Ahead Software AG\n"); - faad_fprintf(stderr, " http://www.audiocoding.com\n"); - if (cap & FIXED_POINT_CAP) - faad_fprintf(stderr, " Fixed point version\n"); - else - faad_fprintf(stderr, " Floating point version\n"); - faad_fprintf(stderr, "\n"); - faad_fprintf(stderr, " This program is free software; you can redistribute it and/or modify\n"); - faad_fprintf(stderr, " it under the terms of the GNU General Public License.\n"); - faad_fprintf(stderr, "\n"); - faad_fprintf(stderr, " **************************************************************************\n\n"); - - /* check that we have at least two non-option arguments */ /* Print help if requested */ if (((argc - optind) < 1) || showHelp) @@ -1224,7 +1194,7 @@ hMP4File = fopen(aacFileName, "rb"); if (!hMP4File) { - faad_fprintf(stderr, "Error opening file: %s\n", aacFileName); + fprintf(stderr, "Error opening file: %s\n", aacFileName); return 1; } fread(header, 1, 8, hMP4File); @@ -1253,7 +1223,7 @@ */ float dec_length = (float)(clock() - begin)/(float)CLOCKS_PER_SEC; #endif - faad_fprintf(stderr, "Decoding %s took: %5.2f sec. %5.2fx real-time.\n", aacFileName, + fprintf(stderr, "Decoding %s took: %5.2f sec. %5.2fx real-time.\n", aacFileName, dec_length, length/dec_length); } --- vlc-0.8.4.debian.orig/extras/faad2/include/faad.h +++ vlc-0.8.4.debian/extras/faad2/include/faad.h @@ -1,37 +1,252 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: faad.h,v 1.48 2005/02/01 13:15:56 menno Exp $ +** $Id: faad.h,v 1.5 2004/09/04 14:56:27 menno Exp $ **/ -/* warn people for update */ -#pragma message("please update faad2 include filename and function names!") +#ifndef __FAAD_H__ +#define __FAAD_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#if 1 +/* MACROS FOR BACKWARDS COMPATIBILITY */ +/* structs */ +#define faacDecHandle faacDecHandle +#define faacDecConfiguration faacDecConfiguration +#define faacDecConfigurationPtr faacDecConfigurationPtr +#define faacDecFrameInfo faacDecFrameInfo +/* functions */ +#define faacDecGetErrorMessage faacDecGetErrorMessage +#define faacDecSetConfiguration faacDecSetConfiguration +#define faacDecGetCurrentConfiguration faacDecGetCurrentConfiguration +#define faacDecInit faacDecInit +#define faacDecInit2 faacDecInit2 +#define faacDecInitDRM faacDecInitDRM +#define faacDecPostSeekReset faacDecPostSeekReset +#define faacDecOpen faacDecOpen +#define faacDecClose faacDecClose +#define faacDecDecode faacDecDecode +#define AudioSpecificConfig faacDecAudioSpecificConfig +#endif + + +#ifdef _WIN32 + #pragma pack(push, 8) + #ifndef FAADAPI + #define FAADAPI __cdecl + #endif +#else + #ifndef FAADAPI + #define FAADAPI + #endif +#endif + +#define FAAD2_VERSION "2.0" + +/* object types for AAC */ +#define MAIN 1 +#define LC 2 +#define SSR 3 +#define LTP 4 +#define HE_AAC 5 +#define ER_LC 17 +#define ER_LTP 19 +#define LD 23 +#define DRM_ER_LC 27 /* special object type for DRM */ + +/* header types */ +#define RAW 0 +#define ADIF 1 +#define ADTS 2 + +/* SBR signalling */ +#define NO_SBR 0 +#define SBR_UPSAMPLED 1 +#define SBR_DOWNSAMPLED 2 +#define NO_SBR_UPSAMPLED 3 + +/* library output formats */ +#define FAAD_FMT_16BIT 1 +#define FAAD_FMT_24BIT 2 +#define FAAD_FMT_32BIT 3 +#define FAAD_FMT_FLOAT 4 +#define FAAD_FMT_FIXED FAAD_FMT_FLOAT +#define FAAD_FMT_DOUBLE 5 + +/* Capabilities */ +#define LC_DEC_CAP (1<<0) /* Can decode LC */ +#define MAIN_DEC_CAP (1<<1) /* Can decode MAIN */ +#define LTP_DEC_CAP (1<<2) /* Can decode LTP */ +#define LD_DEC_CAP (1<<3) /* Can decode LD */ +#define ERROR_RESILIENCE_CAP (1<<4) /* Can decode ER */ +#define FIXED_POINT_CAP (1<<5) /* Fixed point */ + +/* Channel definitions */ +#define FRONT_CHANNEL_CENTER (1) +#define FRONT_CHANNEL_LEFT (2) +#define FRONT_CHANNEL_RIGHT (3) +#define SIDE_CHANNEL_LEFT (4) +#define SIDE_CHANNEL_RIGHT (5) +#define BACK_CHANNEL_LEFT (6) +#define BACK_CHANNEL_RIGHT (7) +#define BACK_CHANNEL_CENTER (8) +#define LFE_CHANNEL (9) +#define UNKNOWN_CHANNEL (0) + +/* DRM channel definitions */ +#define DRMCH_MONO 1 +#define DRMCH_STEREO 2 +#define DRMCH_SBR_MONO 3 +#define DRMCH_SBR_STEREO 4 +#define DRMCH_SBR_PS_STEREO 5 + + +/* A decode call can eat up to FAAD_MIN_STREAMSIZE bytes per decoded channel, + so at least so much bytes per channel should be available in this stream */ +#define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */ + + +typedef void *faacDecHandle; + +typedef struct mp4AudioSpecificConfig +{ + /* Audio Specific Info */ + unsigned char objectTypeIndex; + unsigned char samplingFrequencyIndex; + unsigned long samplingFrequency; + unsigned char channelsConfiguration; + + /* GA Specific Info */ + unsigned char frameLengthFlag; + unsigned char dependsOnCoreCoder; + unsigned short coreCoderDelay; + unsigned char extensionFlag; + unsigned char aacSectionDataResilienceFlag; + unsigned char aacScalefactorDataResilienceFlag; + unsigned char aacSpectralDataResilienceFlag; + unsigned char epConfig; + + char sbr_present_flag; + char forceUpSampling; + char downSampledSBR; +} mp4AudioSpecificConfig; + +typedef struct faacDecConfiguration +{ + unsigned char defObjectType; + unsigned long defSampleRate; + unsigned char outputFormat; + unsigned char downMatrix; + unsigned char useOldADTSFormat; + unsigned char dontUpSampleImplicitSBR; +} faacDecConfiguration, *faacDecConfigurationPtr; + +typedef struct faacDecFrameInfo +{ + unsigned long bytesconsumed; + unsigned long samples; + unsigned char channels; + unsigned char error; + unsigned long samplerate; + + /* SBR: 0: off, 1: on; upsample, 2: on; downsampled, 3: off; upsampled */ + unsigned char sbr; + + /* MPEG-4 ObjectType */ + unsigned char object_type; + + /* AAC header type; MP4 will be signalled as RAW also */ + unsigned char header_type; + + /* multichannel configuration */ + unsigned char num_front_channels; + unsigned char num_side_channels; + unsigned char num_back_channels; + unsigned char num_lfe_channels; + unsigned char channel_position[64]; + + /* PS: 0: off, 1: on */ + unsigned char ps; +} faacDecFrameInfo; + +char* FAADAPI faacDecGetErrorMessage(unsigned char errcode); + +unsigned long FAADAPI faacDecGetCapabilities(void); + +faacDecHandle FAADAPI faacDecOpen(void); + +faacDecConfigurationPtr FAADAPI faacDecGetCurrentConfiguration(faacDecHandle hDecoder); + +unsigned char FAADAPI faacDecSetConfiguration(faacDecHandle hDecoder, + faacDecConfigurationPtr config); + +/* Init the library based on info from the AAC file (ADTS/ADIF) */ +long FAADAPI faacDecInit(faacDecHandle hDecoder, + unsigned char *buffer, + unsigned long buffer_size, + unsigned long *samplerate, + unsigned char *channels); + +/* Init the library using a DecoderSpecificInfo */ +char FAADAPI faacDecInit2(faacDecHandle hDecoder, unsigned char *pBuffer, + unsigned long SizeOfDecoderSpecificInfo, + unsigned long *samplerate, unsigned char *channels); + +/* Init the library for DRM */ +char FAADAPI faacDecInitDRM(faacDecHandle *hDecoder, unsigned long samplerate, + unsigned char channels); + +void FAADAPI faacDecPostSeekReset(faacDecHandle hDecoder, long frame); + +void FAADAPI faacDecClose(faacDecHandle hDecoder); + +void* FAADAPI faacDecDecode(faacDecHandle hDecoder, + faacDecFrameInfo *hInfo, + unsigned char *buffer, + unsigned long buffer_size); + +void* FAADAPI faacDecDecode2(faacDecHandle hDecoder, + faacDecFrameInfo *hInfo, + unsigned char *buffer, + unsigned long buffer_size, + void **sample_buffer, + unsigned long sample_buffer_size); + +char FAADAPI faacDecAudioSpecificConfig(unsigned char *pBuffer, + unsigned long buffer_size, + mp4AudioSpecificConfig *mp4ASC); + +#ifdef _WIN32 + #pragma pack(pop) +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ -/* Backwards compatible link */ -#include "neaacdec.h" +#endif --- vlc-0.8.4.debian.orig/extras/faad2/install-sh +++ vlc-0.8.4.debian/extras/faad2/install-sh @@ -1,7 +1,8 @@ #!/bin/sh -# # install - install a program, script, or datafile -# + +scriptversion=2004-04-01.17 + # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. @@ -41,13 +42,11 @@ # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. - # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" - # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" @@ -59,236 +58,268 @@ rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" -transformbasename="" -transform_arg="" +transformbasename= +transform_arg= instcmd="$mvprog" chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" +chowncmd= +chgrpcmd= +stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd=$cpprog - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac +src= +dst= +dir_arg= + +usage="Usage: $0 [OPTION]... SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 -d DIRECTORIES... + +In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. +In the second, create the directory path DIR. + +Options: +-b=TRANSFORMBASENAME +-c copy source (using $cpprog) instead of moving (using $mvprog). +-d create directories instead of installing files. +-g GROUP $chgrp installed files to GROUP. +-m MODE $chmod installed files to MODE. +-o USER $chown installed files to USER. +-s strip installed files (using $stripprog). +-t=TRANSFORM +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + -c) instcmd=$cpprog + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit 0;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + --version) echo "$0 $scriptversion"; exit 0;; + + *) # When -d is used, all remaining arguments are directories to create. + test -n "$dir_arg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac done -if [ x"$src" = x ] -then - echo "$0: no input file specified" >&2 - exit 1 -else - : -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d "$dst" ]; then - instcmd=: - chmodcmd="" - else - instcmd=$mkdirprog - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f "$src" ] || [ -d "$src" ] - then - : - else - echo "$0: $src does not exist" >&2 - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "$0: no destination specified" >&2 - exit 1 - else - : - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d "$dst" ] - then - dst=$dst/`basename "$src"` - else - : - fi +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 fi -## this sed command emulates the dirname command -dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' -IFS="${IFS-$defaultIFS}" - -oIFS=$IFS -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS=$oIFS - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp=$pathcomp$1 - shift - - if [ ! -d "$pathcomp" ] ; - then - $mkdirprog "$pathcomp" - else - : - fi +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + instcmd=: + chmodcmd= + else + instcmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$instcmd $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac - pathcomp=$pathcomp/ + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" || lasterr=$? + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; } + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $instcmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + # If we're going to rename the final executable, determine the name now. + if test -z "$transformarg"; then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename \ + | sed $transformarg`$transformbasename + fi + + # don't allow the sed command to completely eliminate the filename. + test -z "$dstfile" && dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Move or copy the file name to the temp name + $doit $instcmd "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $instcmd $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit; } done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd "$dst" && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename "$dst"` - else - dstfile=`basename "$dst" $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename "$dst"` - else - : - fi - -# Make a couple of temp file names in the proper directory. - - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - -# Trap to clean up temp files at exit. - - trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 - trap '(exit $?); exit' 1 2 13 15 - -# Move or copy the file name to the temp name - - $doit $instcmd "$src" "$dsttmp" && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && - -# Now remove or move aside any old file at destination location. We try this -# two ways since rm can't unlink itself on some systems and the destination -# file might be busy for other reasons. In this case, the final cleanup -# might fail but the new file should still install successfully. - -{ - if [ -f "$dstdir/$dstfile" ] - then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || - $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || - { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit - } - else - : - fi -} && - -# Now rename the file to the real destination. - - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - -fi && # The final little trick to "correctly" pass the exit status to the exit trap. - { - (exit 0); exit + (exit 0); exit } + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/Makefile.am +++ vlc-0.8.4.debian/extras/faad2/libfaad/Makefile.am @@ -1,7 +1,7 @@ lib_LTLIBRARIES = libfaad.la include_HEADERS = $(top_srcdir)/include/faad.h \ - $(top_srcdir)/include/neaacdec.h + $(top_srcdir)/include/faad.h libfaad_la_LDFLAGS = -lm --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/libfaad/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.8.5 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,6 +14,9 @@ @SET_MAKE@ + +SOURCES = $(libfaad_la_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -21,7 +24,6 @@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,6 +38,66 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ +subdir = libfaad +DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libfaad_la_LIBADD = +am_libfaad_la_OBJECTS = bits.lo cfft.lo decoder.lo drc.lo drm_dec.lo \ + error.lo filtbank.lo ic_predict.lo is.lo lt_predict.lo mdct.lo \ + mp4.lo ms.lo output.lo pns.lo ps_dec.lo ps_syntax.lo pulse.lo \ + specrec.lo syntax.lo tns.lo hcr.lo huffman.lo rvlc.lo ssr.lo \ + ssr_fb.lo ssr_ipqf.lo common.lo sbr_dct.lo sbr_e_nf.lo \ + sbr_fbt.lo sbr_hfadj.lo sbr_hfgen.lo sbr_huff.lo sbr_qmf.lo \ + sbr_syntax.lo sbr_tf_grid.lo sbr_dec.lo +libfaad_la_OBJECTS = $(am_libfaad_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bits.Plo ./$(DEPDIR)/cfft.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/common.Plo ./$(DEPDIR)/decoder.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/drc.Plo ./$(DEPDIR)/drm_dec.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/error.Plo ./$(DEPDIR)/filtbank.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/hcr.Plo ./$(DEPDIR)/huffman.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/ic_predict.Plo ./$(DEPDIR)/is.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/lt_predict.Plo ./$(DEPDIR)/mdct.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mp4.Plo ./$(DEPDIR)/ms.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/output.Plo ./$(DEPDIR)/pns.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/ps_dec.Plo ./$(DEPDIR)/ps_syntax.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/pulse.Plo ./$(DEPDIR)/rvlc.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/sbr_dct.Plo ./$(DEPDIR)/sbr_dec.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/sbr_e_nf.Plo ./$(DEPDIR)/sbr_fbt.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/sbr_hfadj.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/sbr_hfgen.Plo ./$(DEPDIR)/sbr_huff.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/sbr_qmf.Plo ./$(DEPDIR)/sbr_syntax.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/sbr_tf_grid.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/specrec.Plo ./$(DEPDIR)/ssr.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/ssr_fb.Plo ./$(DEPDIR)/ssr_ipqf.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/syntax.Plo ./$(DEPDIR)/tns.Plo +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libfaad_la_SOURCES) +DIST_SOURCES = $(libfaad_la_SOURCES) +includeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(include_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -45,6 +107,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -66,6 +130,8 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ @@ -91,12 +157,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ XMMS_CONFIG = @XMMS_CONFIG@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ @@ -104,6 +173,7 @@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -119,7 +189,6 @@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ -external_mp4v2 = @external_mp4v2@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -132,6 +201,7 @@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -140,13 +210,10 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ lib_LTLIBRARIES = libfaad.la - include_HEADERS = $(top_srcdir)/include/faad.h \ - $(top_srcdir)/include/neaacdec.h - + $(top_srcdir)/include/faad.h libfaad_la_LDFLAGS = -lm - libfaad_la_SOURCES = bits.c cfft.c decoder.c drc.c \ drm_dec.c error.c filtbank.c \ ic_predict.c is.c lt_predict.c mdct.c mp4.c ms.c output.c pns.c \ @@ -169,77 +236,47 @@ codebook/hcb_5.h codebook/hcb_6.h codebook/hcb_7.h codebook/hcb_8.h \ codebook/hcb_9.h codebook/hcb_10.h codebook/hcb_11.h codebook/hcb_sf.h -subdir = libfaad -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(lib_LTLIBRARIES) - -libfaad_la_LIBADD = -am_libfaad_la_OBJECTS = bits.lo cfft.lo decoder.lo drc.lo drm_dec.lo \ - error.lo filtbank.lo ic_predict.lo is.lo lt_predict.lo mdct.lo \ - mp4.lo ms.lo output.lo pns.lo ps_dec.lo ps_syntax.lo pulse.lo \ - specrec.lo syntax.lo tns.lo hcr.lo huffman.lo rvlc.lo ssr.lo \ - ssr_fb.lo ssr_ipqf.lo common.lo sbr_dct.lo sbr_e_nf.lo \ - sbr_fbt.lo sbr_hfadj.lo sbr_hfgen.lo sbr_huff.lo sbr_qmf.lo \ - sbr_syntax.lo sbr_tf_grid.lo sbr_dec.lo -libfaad_la_OBJECTS = $(am_libfaad_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bits.Plo ./$(DEPDIR)/cfft.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/common.Plo ./$(DEPDIR)/decoder.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/drc.Plo ./$(DEPDIR)/drm_dec.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/error.Plo ./$(DEPDIR)/filtbank.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/hcr.Plo ./$(DEPDIR)/huffman.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/ic_predict.Plo ./$(DEPDIR)/is.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/lt_predict.Plo ./$(DEPDIR)/mdct.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/mp4.Plo ./$(DEPDIR)/ms.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/output.Plo ./$(DEPDIR)/pns.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/ps_dec.Plo ./$(DEPDIR)/ps_syntax.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/pulse.Plo ./$(DEPDIR)/rvlc.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/sbr_dct.Plo ./$(DEPDIR)/sbr_dec.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/sbr_e_nf.Plo ./$(DEPDIR)/sbr_fbt.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/sbr_hfadj.Plo ./$(DEPDIR)/sbr_hfgen.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/sbr_huff.Plo ./$(DEPDIR)/sbr_qmf.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/sbr_syntax.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/sbr_tf_grid.Plo ./$(DEPDIR)/specrec.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/ssr.Plo ./$(DEPDIR)/ssr_fb.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/ssr_ipqf.Plo ./$(DEPDIR)/syntax.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/tns.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libfaad_la_SOURCES) -HEADERS = $(include_HEADERS) - -DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libfaad_la_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libfaad/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu libfaad/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -libLTLIBRARIES_INSTALL = $(INSTALL) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libdir) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done @@ -247,15 +284,15 @@ @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ + test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done @@ -263,7 +300,7 @@ $(LINK) -rpath $(libdir) $(libfaad_la_LDFLAGS) $(libfaad_la_OBJECTS) $(libfaad_la_LIBADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -308,37 +345,28 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tns.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -349,33 +377,24 @@ distclean-libtool: -rm -f libtool uninstall-info-am: -includeHEADERS_INSTALL = $(INSTALL_HEADER) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(includedir) + test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \ - $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \ + echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ + $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(includedir)/$$f"; \ - rm -f $(DESTDIR)$(includedir)/$$f; \ + echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ + rm -f "$(DESTDIR)$(includedir)/$$f"; \ done -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -384,6 +403,7 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -395,10 +415,11 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -421,13 +442,9 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) - $(mkinstalldirs) $(distdir)/../include + $(mkdir_p) $(distdir)/../include @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ @@ -439,7 +456,7 @@ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -457,9 +474,10 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) - installdirs: - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -499,6 +517,8 @@ dvi-am: +html: html-am + info: info-am info-am: @@ -537,14 +557,14 @@ .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includeHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/analysis.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/analysis.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: analysis.h,v 1.15 2005/02/01 13:15:56 menno Exp $ +** $Id: analysis.h,v 1.14 2004/09/04 14:56:27 menno Exp $ **/ #ifndef __ANALYSIS_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/bits.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/bits.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: bits.c,v 1.40 2005/02/01 13:15:56 menno Exp $ +** $Id: bits.c,v 1.39 2004/09/04 14:56:27 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/bits.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/bits.h @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: bits.h,v 1.41 2005/02/01 13:15:56 menno Exp $ +** $Id: bits.h,v 1.40 2004/09/04 14:56:27 menno Exp $ **/ #ifndef __BITS_H__ @@ -286,9 +281,8 @@ } if (r != CRC) - // if (0) { - return 28; + return 8; } else { return 0; } --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/cfft.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/cfft.c @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: cfft.c,v 1.31 2005/02/01 13:28:51 menno Exp $ +** $Id: cfft.c,v 1.30 2004/09/08 09:43:11 gcp Exp $ **/ /* --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/cfft.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/cfft.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: cfft.h,v 1.21 2005/02/01 13:28:51 menno Exp $ +** $Id: cfft.h,v 1.20 2004/09/08 09:43:11 gcp Exp $ **/ #ifndef __CFFT_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/cfft_tab.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/cfft_tab.h @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: cfft_tab.h,v 1.18 2005/02/01 13:15:56 menno Exp $ +** $Id: cfft_tab.h,v 1.17 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __CFFT_TAB_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/common.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/common.c @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: common.c,v 1.23 2005/02/01 13:23:34 menno Exp $ +** $Id: common.c,v 1.22 2004/09/08 09:43:11 gcp Exp $ **/ /* just some common functions that could be used anywhere */ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/common.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/common.h @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: common.h,v 1.66 2005/02/01 13:23:35 menno Exp $ +** $Id: common.h,v 1.65 2004/09/08 09:43:11 gcp Exp $ **/ #ifndef __COMMON_H__ @@ -41,12 +36,7 @@ # include "../config.h" #endif -#if 1 #define INLINE __inline -#else -#define INLINE inline -#endif - #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) #define ALIGN __declspec(align(16)) #else @@ -75,6 +65,7 @@ #define FIXED_POINT #endif + #define ERROR_RESILIENCE @@ -86,6 +77,8 @@ #define LTP_DEC /* Allow decoding of LD profile AAC */ #define LD_DEC +/* Allow decoding of scalable profiles */ +//#define SCALABLE_DEC /* Allow decoding of Digital Radio Mondiale (DRM) */ //#define DRM //#define DRM_PS @@ -119,10 +112,6 @@ //#define SBR_LOW_POWER #define PS_DEC -#ifdef SBR_LOW_POWER -#undef PS_DEC -#endif - /* FIXED POINT: No MAIN decoding */ #ifdef FIXED_POINT # ifdef MAIN_DEC @@ -131,13 +120,9 @@ #endif // FIXED_POINT #ifdef DRM -# ifndef ALLOW_SMALL_FRAMELENGTH -# define ALLOW_SMALL_FRAMELENGTH +# ifndef SCALABLE_DEC +# define SCALABLE_DEC # endif -# undef LD_DEC -# undef LTP_DEC -# undef MAIN_DEC -# undef SSR_DEC #endif @@ -210,23 +195,18 @@ # include # else /* we need these... */ -#ifndef __TCS__ typedef unsigned long long uint64_t; -typedef long long int64_t; -#else -typedef unsigned long uint64_t; -typedef long int64_t; -#endif typedef unsigned long uint32_t; typedef unsigned short uint16_t; typedef unsigned char uint8_t; +typedef long long int64_t; typedef long int32_t; typedef short int16_t; typedef char int8_t; # endif #endif #if HAVE_UNISTD_H -//# include +# include #endif #ifndef HAVE_FLOAT32_T --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/decoder.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/decoder.c @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: decoder.c,v 1.108 2005/02/01 13:28:51 menno Exp $ +** $Id: decoder.c,v 1.107 2004/09/08 09:43:11 gcp Exp $ **/ #include "common.h" @@ -56,20 +51,20 @@ #endif /* static function declarations */ -static void* aac_frame_decode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, +static void* aac_frame_decode(faacDecHandle hDecoder, faacDecFrameInfo *hInfo, uint8_t *buffer, uint32_t buffer_size, void **sample_buffer, uint32_t sample_buffer_size); -static void create_channel_config(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo); +static void create_channel_config(faacDecHandle hDecoder, faacDecFrameInfo *hInfo); -char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode) +char* FAADAPI faacDecGetErrorMessage(uint8_t errcode) { if (errcode >= NUM_ERROR_MESSAGES) return NULL; return err_msg[errcode]; } -uint32_t NEAACDECAPI NeAACDecGetCapabilities(void) +uint32_t FAADAPI faacDecGetCapabilities(void) { uint32_t cap = 0; @@ -95,15 +90,15 @@ return cap; } -NeAACDecHandle NEAACDECAPI NeAACDecOpen(void) +faacDecHandle FAADAPI faacDecOpen(void) { uint8_t i; - NeAACDecHandle hDecoder = NULL; + faacDecHandle hDecoder = NULL; - if ((hDecoder = (NeAACDecHandle)faad_malloc(sizeof(NeAACDecStruct))) == NULL) + if ((hDecoder = (faacDecHandle)faad_malloc(sizeof(faacDecStruct))) == NULL) return NULL; - memset(hDecoder, 0, sizeof(NeAACDecStruct)); + memset(hDecoder, 0, sizeof(faacDecStruct)); hDecoder->config.outputFormat = FAAD_FMT_16BIT; hDecoder->config.defObjectType = MAIN; @@ -151,11 +146,11 @@ return hDecoder; } -NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder) +faacDecConfigurationPtr FAADAPI faacDecGetCurrentConfiguration(faacDecHandle hDecoder) { if (hDecoder) { - NeAACDecConfigurationPtr config = &(hDecoder->config); + faacDecConfigurationPtr config = &(hDecoder->config); return config; } @@ -163,8 +158,8 @@ return NULL; } -uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder, - NeAACDecConfigurationPtr config) +uint8_t FAADAPI faacDecSetConfiguration(faacDecHandle hDecoder, + faacDecConfigurationPtr config) { if (hDecoder && config) { @@ -199,7 +194,7 @@ return 0; } -int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder, uint8_t *buffer, +int32_t FAADAPI faacDecInit(faacDecHandle hDecoder, uint8_t *buffer, uint32_t buffer_size, uint32_t *samplerate, uint8_t *channels) { @@ -304,7 +299,7 @@ } /* Init the library using a DecoderSpecificInfo */ -int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, uint8_t *pBuffer, +int8_t FAADAPI faacDecInit2(faacDecHandle hDecoder, uint8_t *pBuffer, uint32_t SizeOfDecoderSpecificInfo, uint32_t *samplerate, uint8_t *channels) { @@ -395,15 +390,15 @@ } #ifdef DRM -int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate, +int8_t FAADAPI faacDecInitDRM(faacDecHandle *hDecoder, uint32_t samplerate, uint8_t channels) { if (hDecoder == NULL) return 1; /* error */ - NeAACDecClose(*hDecoder); + faacDecClose(*hDecoder); - *hDecoder = NeAACDecOpen(); + *hDecoder = faacDecOpen(); /* Special object type defined for DRM */ (*hDecoder)->config.defObjectType = DRM_ER_LC; @@ -436,7 +431,7 @@ } #endif -void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder) +void FAADAPI faacDecClose(faacDecHandle hDecoder) { uint8_t i; @@ -489,7 +484,7 @@ if (hDecoder) faad_free(hDecoder); } -void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame) +void FAADAPI faacDecPostSeekReset(faacDecHandle hDecoder, int32_t frame) { if (hDecoder) { @@ -500,7 +495,7 @@ } } -static void create_channel_config(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo) +static void create_channel_config(faacDecHandle hDecoder, faacDecFrameInfo *hInfo) { hInfo->num_front_channels = 0; hInfo->num_side_channels = 0; @@ -705,15 +700,15 @@ } } -void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder, - NeAACDecFrameInfo *hInfo, +void* FAADAPI faacDecDecode(faacDecHandle hDecoder, + faacDecFrameInfo *hInfo, uint8_t *buffer, uint32_t buffer_size) { return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size, NULL, 0); } -void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder, - NeAACDecFrameInfo *hInfo, +void* FAADAPI faacDecDecode2(faacDecHandle hDecoder, + faacDecFrameInfo *hInfo, uint8_t *buffer, uint32_t buffer_size, void **sample_buffer, uint32_t sample_buffer_size) { @@ -727,74 +722,10 @@ sample_buffer, sample_buffer_size); } -#ifdef DRM - -#define ERROR_STATE_INIT 6 - -static void conceal_output(NeAACDecHandle hDecoder, uint16_t frame_len, - uint8_t out_ch, void *sample_buffer) -{ - uint16_t i; - int16_t *short_sample_buffer = (int16_t*)sample_buffer; - int32_t *int_sample_buffer = (int32_t*)sample_buffer; -#ifndef FIXED_POINT - float32_t *float_sample_buffer = (float32_t*)sample_buffer; - double *double_sample_buffer = (double*)sample_buffer; -#endif - - static const int8_t mute_tab[ERROR_STATE_INIT+1] = { 0, 1, 1, 2, 2, 3, 3 }; - - if (hDecoder->error_state > 0) - { - switch (hDecoder->config.outputFormat) - { - case FAAD_FMT_16BIT: - for (i = 0; i < out_ch*frame_len; i++) - { - short_sample_buffer[i] >>= mute_tab[hDecoder->error_state]; - //short_sample_buffer[i] = 0; - } - - break; - case FAAD_FMT_24BIT: - case FAAD_FMT_32BIT: -#ifdef FIXED_POINT - case FAAD_FMT_FIXED: -#endif - for (i = 0; i < out_ch*frame_len; i++) - { - int_sample_buffer[i] >>= mute_tab[hDecoder->error_state]; - //int_sample_buffer[i] = 0; - } - break; -#ifndef FIXED_POINT - case FAAD_FMT_FLOAT: - for (i = 0; i < out_ch*frame_len; i++) - { - float_sample_buffer[i] /= (float)(1<error_state]); - //float_sample_buffer[i] = 0; - } - break; - case FAAD_FMT_DOUBLE: - for (i = 0; i < out_ch*frame_len; i++) - { - double_sample_buffer[i] /= (float)(1<error_state]); - //double_sample_buffer[i] = 0; - } - break; -#endif - } - - hDecoder->error_state--; - } -} -#endif - -static void* aac_frame_decode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, +static void* aac_frame_decode(faacDecHandle hDecoder, faacDecFrameInfo *hInfo, uint8_t *buffer, uint32_t buffer_size, void **sample_buffer2, uint32_t sample_buffer_size) { - uint16_t i; uint8_t channels = 0; uint8_t output_channels = 0; bitfile ld; @@ -819,26 +750,9 @@ frame_len = hDecoder->frameLength; - memset(hInfo, 0, sizeof(NeAACDecFrameInfo)); + memset(hInfo, 0, sizeof(faacDecFrameInfo)); memset(hDecoder->internal_channel, 0, MAX_CHANNELS*sizeof(hDecoder->internal_channel[0])); - - /* check for some common metadata tag types in the bitstream - * No need to return an error - */ - /* ID3 */ - if (buffer_size >= 128) - { - if (memcmp(buffer, "TAG", 3) == 0) - { - /* found it */ - hInfo->bytesconsumed = 128; /* 128 bytes fixed size */ - /* no error, but no output either */ - return NULL; - } - } - - /* initialize the bitstream */ faad_initbits(&ld, buffer, buffer_size); @@ -866,12 +780,12 @@ /* We do not support stereo right now */ if (0) //(hDecoder->channelConfiguration == 2) { - hInfo->error = 28; // Throw CRC error + hInfo->error = 8; // Throw CRC error goto error; } faad_getbits(&ld, 8 - DEBUGVAR(1,1,"NeAACDecDecode(): skip CRC")); + DEBUGVAR(1,1,"faacDecDecode(): skip CRC")); } #endif @@ -894,14 +808,14 @@ #endif /* decode the complete bitstream */ -#ifdef DRM - if (/*(hDecoder->object_type == 6) ||*/ (hDecoder->object_type == DRM_ER_LC)) +#ifdef SCALABLE_DEC + if ((hDecoder->object_type == 6) || (hDecoder->object_type == DRM_ER_LC)) { - DRM_aac_scalable_main_element(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc); + aac_scalable_main_element(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc); } else { #endif raw_data_block(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc); -#ifdef DRM +#ifdef SCALABLE_DEC } #endif @@ -1064,16 +978,10 @@ } #endif - sample_buffer = output_to_PCM(hDecoder, hDecoder->time_out, sample_buffer, output_channels, frame_len, hDecoder->config.outputFormat); -#ifdef DRM - //conceal_output(hDecoder, frame_len, output_channels, sample_buffer); -#endif - - hDecoder->postSeekResetFlag = 0; hDecoder->frame++; @@ -1105,30 +1013,6 @@ error: - -#ifdef DRM - hDecoder->error_state = ERROR_STATE_INIT; -#endif - - /* reset filterbank state */ - for (i = 0; i < MAX_CHANNELS; i++) - { - if (hDecoder->fb_intermed[i] != NULL) - { - memset(hDecoder->fb_intermed[i], 0, hDecoder->frameLength*sizeof(real_t)); - } - } -#ifdef SBR_DEC - for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++) - { - if (hDecoder->sbr[i] != NULL) - { - sbrReset(hDecoder->sbr[i]); - } - } -#endif - - faad_endbits(&ld); /* cleanup */ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/decoder.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/decoder.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: decoder.h,v 1.45 2005/02/01 13:15:57 menno Exp $ +** $Id: decoder.h,v 1.44 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __DECODER_H__ @@ -39,12 +34,12 @@ #ifdef _WIN32 #pragma pack(push, 8) - #ifndef NEAACDECAPI - #define NEAACDECAPI __cdecl + #ifndef FAADAPI + #define FAADAPI __cdecl #endif #else - #ifndef NEAACDECAPI - #define NEAACDECAPI + #ifndef FAADAPI + #define FAADAPI #endif #endif @@ -75,44 +70,44 @@ #define LFE_CHANNEL (9) #define UNKNOWN_CHANNEL (0) -char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode); +char* FAADAPI faacDecGetErrorMessage(uint8_t errcode); -uint32_t NEAACDECAPI NeAACDecGetCapabilities(void); +uint32_t FAADAPI faacDecGetCapabilities(void); -NeAACDecHandle NEAACDECAPI NeAACDecOpen(void); +faacDecHandle FAADAPI faacDecOpen(void); -NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder); +faacDecConfigurationPtr FAADAPI faacDecGetCurrentConfiguration(faacDecHandle hDecoder); -uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder, - NeAACDecConfigurationPtr config); +uint8_t FAADAPI faacDecSetConfiguration(faacDecHandle hDecoder, + faacDecConfigurationPtr config); /* Init the library based on info from the AAC file (ADTS/ADIF) */ -int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder, +int32_t FAADAPI faacDecInit(faacDecHandle hDecoder, uint8_t *buffer, uint32_t buffer_size, uint32_t *samplerate, uint8_t *channels); /* Init the library using a DecoderSpecificInfo */ -int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, uint8_t *pBuffer, +int8_t FAADAPI faacDecInit2(faacDecHandle hDecoder, uint8_t *pBuffer, uint32_t SizeOfDecoderSpecificInfo, uint32_t *samplerate, uint8_t *channels); /* Init the library for DRM */ -int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate, +int8_t FAADAPI faacDecInitDRM(faacDecHandle *hDecoder, uint32_t samplerate, uint8_t channels); -void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder); +void FAADAPI faacDecClose(faacDecHandle hDecoder); -void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame); +void FAADAPI faacDecPostSeekReset(faacDecHandle hDecoder, int32_t frame); -void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder, - NeAACDecFrameInfo *hInfo, +void* FAADAPI faacDecDecode(faacDecHandle hDecoder, + faacDecFrameInfo *hInfo, uint8_t *buffer, uint32_t buffer_size); -void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder, - NeAACDecFrameInfo *hInfo, +void* FAADAPI faacDecDecode2(faacDecHandle hDecoder, + faacDecFrameInfo *hInfo, uint8_t *buffer, uint32_t buffer_size, void **sample_buffer, uint32_t sample_buffer_size); --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/drc.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/drc.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: drc.c,v 1.25 2005/02/01 13:15:57 menno Exp $ +** $Id: drc.c,v 1.24 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/drc.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/drc.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: drc.h,v 1.19 2005/02/01 13:15:57 menno Exp $ +** $Id: drc.h,v 1.18 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __DRC_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/drm_dec.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/drm_dec.c @@ -1,33 +1,28 @@ /* -** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR and PS decoding +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: drm_dec.c,v 1.6 2005/02/01 13:15:57 menno Exp $ +** $Id: drm_dec.c,v 1.5 2004/09/04 14:56:28 menno Exp $ **/ #include @@ -248,9 +243,17 @@ { FRAC_CONST(0.929071574), FRAC_CONST(0) } }; -static const uint8_t sa_freq_scale[9] = +static const uint8_t sa_freq_scale[9][2] = { - 0, 1, 2, 3, 5, 7, 10, 13, 23 + { 0, 0}, + { 1, 1}, + { 2, 2}, + { 3, 3}, + { 5, 5}, + { 7, 7}, + {10,10}, + {13,13}, + {46,23} }; static const uint8_t pan_freq_scale[21] = @@ -287,9 +290,9 @@ FRAC_CONST(0.48954165955695) }; -static const uint8_t delay_length[3] = +static const uint8_t delay_length[][2] = { - 3, 4, 5 + { 1, 3 }, { 2, 4 }, { 3, 5 } }; static const real_t delay_fraction[] = @@ -297,9 +300,15 @@ FRAC_CONST(0.43), FRAC_CONST(0.75), FRAC_CONST(0.347) }; -static const real_t peak_decay = FRAC_CONST(0.76592833836465); +static const real_t peak_decay[2] = +{ + FRAC_CONST(0.58664621951003), FRAC_CONST(0.76592833836465) +}; -static const real_t smooth_coeff = FRAC_CONST(0.25); +static const real_t smooth_coeff[2] = +{ + FRAC_CONST(0.6), FRAC_CONST(0.25) +}; /* Please note that these are the same tables as in plain PS */ static const complex_t Q_Fract_allpass_Qmf[][3] = { @@ -557,22 +566,25 @@ { if (ps->bs_sa_dt_flag && !ps->g_last_had_sa) { - /* wait until we get a DT frame */ - ps->bs_enable_sa = 0; - } else if (ps->bs_sa_dt_flag) { - /* DT frame, we have a last frame, so we can decode */ + for (band = 0; band < DRM_NUM_SA_BANDS; band++) + { + ps->g_prev_sa_index[band] = 0; + } + } + if (ps->bs_sa_dt_flag) + { ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]); + } else { - /* DF always decodable */ ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]); } for (band = 1; band < DRM_NUM_SA_BANDS; band++) { - if (ps->bs_sa_dt_flag && ps->g_last_had_sa) + if (ps->bs_sa_dt_flag) { ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_prev_sa_index[band] + ps->bs_sa_data[band]); - } else if (!ps->bs_sa_dt_flag) { + } else { ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]); } } @@ -606,19 +618,28 @@ { if (ps->bs_pan_dt_flag && !ps->g_last_had_pan) { - ps->bs_enable_pan = 0; - } else if (ps->bs_pan_dt_flag) { - ps->g_pan_index[0] = pan_delta_clip(ps, ps->g_prev_pan_index[0]+ps->bs_pan_data[0]); +/* The DRM PS spec doesn't say anything about this case. (deltacoded in time without a previous frame) + AAC PS spec you must tread previous frame as 0, so that's what we try. +*/ + for (band = 0; band < DRM_NUM_PAN_BANDS; band++) + { + ps->g_prev_pan_index[band] = 0; + } + } + + if (ps->bs_pan_dt_flag) + { + ps->g_pan_index[0] = pan_delta_clip(ps, ps->g_prev_pan_index[0]+ps->bs_pan_data[0]); } else { - ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]); + ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]); } for (band = 1; band < DRM_NUM_PAN_BANDS; band++) { - if (ps->bs_pan_dt_flag && ps->g_last_had_pan) + if (ps->bs_pan_dt_flag) { ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_prev_pan_index[band] + ps->bs_pan_data[band]); - } else if (!ps->bs_pan_dt_flag) { + } else { ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_pan_index[band-1] + ps->bs_pan_data[band]); } } @@ -637,7 +658,7 @@ } } -static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64]) +static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t rateselect) { uint8_t s, b, k; complex_t qfrac, tmp0, tmp, in, R0; @@ -652,7 +673,7 @@ uint32_t in_re, in_im; #endif - for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++) + for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b++) { /* set delay indices */ for (k = 0; k < NUM_OF_LINKS; k++) @@ -680,16 +701,16 @@ power = MUL_R(RE(in),RE(in)) + MUL_R(IM(in),IM(in)); #endif - ps->peakdecay_fast[b] = MUL_F(ps->peakdecay_fast[b], peak_decay); + ps->peakdecay_fast[b] = MUL_F(ps->peakdecay_fast[b], peak_decay[rateselect]); if (ps->peakdecay_fast[b] < power) ps->peakdecay_fast[b] = power; peakdiff = ps->prev_peakdiff[b]; - peakdiff += MUL_F((ps->peakdecay_fast[b] - power - ps->prev_peakdiff[b]), smooth_coeff); + peakdiff += MUL_F((ps->peakdecay_fast[b] - power - ps->prev_peakdiff[b]), smooth_coeff[rateselect]); ps->prev_peakdiff[b] = peakdiff; nrg = ps->prev_nrg[b]; - nrg += MUL_F((power - ps->prev_nrg[b]), smooth_coeff); + nrg += MUL_F((power - ps->prev_nrg[b]), smooth_coeff[rateselect]); ps->prev_nrg[b] = nrg; if (MUL_R(peakdiff, gamma) <= nrg) { @@ -742,7 +763,7 @@ for (k = 0; k < NUM_OF_LINKS; k++) { - if (++temp_delay_ser[k] >= delay_length[k]) + if (++temp_delay_ser[k] >= delay_length[k][rateselect]) temp_delay_ser[k] = 0; } } @@ -752,7 +773,7 @@ ps->delay_buf_index_ser[k] = temp_delay_ser[k]; } -static void drm_add_ambiance(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) +static void drm_add_ambiance(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64]) { uint8_t s, b, ifreq, qclass; real_t sa_map[MAX_SA_BAND], sa_dir_map[MAX_SA_BAND], k_sa_map[MAX_SA_BAND], k_sa_dir_map[MAX_SA_BAND]; @@ -762,7 +783,7 @@ { /* Instead of dequantization and mapping, we use an inverse mapping to look up all the values we need */ - for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++) + for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b++) { const real_t inv_f_num_of_subsamples = FRAC_CONST(0.03333333333); @@ -783,7 +804,7 @@ for (s = 0; s < NUM_OF_SUBSAMPLES; s++) { - for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++) + for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b++) { QMF_RE(X_right[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]); QMF_IM(X_right[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]); @@ -793,7 +814,7 @@ sa_map[b] += k_sa_map[b]; sa_dir_map[b] += k_sa_dir_map[b]; } - for (b = sa_freq_scale[DRM_NUM_SA_BANDS]; b < NUM_OF_QMF_CHANNELS; b++) + for (b = sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b < NUM_OF_QMF_CHANNELS; b++) { QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]); QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]); @@ -812,7 +833,7 @@ } } -static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) +static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64]) { uint8_t s, b, qclass, ifreq; real_t tmp, coeff1, coeff2; @@ -903,8 +924,10 @@ } /* main DRM PS decoding function */ -uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, qmf_t X_left[38][64], qmf_t X_right[38][64]) -{ +uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, uint32_t samplerate, qmf_t X_left[38][64], qmf_t X_right[38][64]) +{ + uint8_t rateselect = (samplerate >= 24000); + if (ps == NULL) { memcpy(X_right, X_left, sizeof(qmf_t)*30*64); @@ -935,8 +958,8 @@ ps->drm_ps_data_available = 0; - drm_calc_sa_side_signal(ps, X_left); - drm_add_ambiance(ps, X_left, X_right); + drm_calc_sa_side_signal(ps, X_left, rateselect); + drm_add_ambiance(ps, rateselect, X_left, X_right); if (ps->bs_enable_sa) { @@ -950,7 +973,7 @@ if (ps->bs_enable_pan) { - drm_add_pan(ps, X_left, X_right); + drm_add_pan(ps, rateselect, X_left, X_right); ps->g_last_had_pan = 1; --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/drm_dec.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/drm_dec.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: drm_dec.h,v 1.5 2005/02/01 13:15:57 menno Exp $ +** $Id: drm_dec.h,v 1.4 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __DRM_DEC_H__ @@ -93,7 +88,7 @@ drm_ps_info *drm_ps_init(void); void drm_ps_free(drm_ps_info *ps); -uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, qmf_t X_left[38][64], qmf_t X_right[38][64]); +uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, uint32_t samplerate, qmf_t X_left[38][64], qmf_t X_right[38][64]); #ifdef __cplusplus } --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/error.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/error.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: error.c,v 1.29 2005/02/01 13:15:57 menno Exp $ +** $Id: error.c,v 1.28 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" @@ -61,11 +56,6 @@ "Unexpected fill element with SBR data", "Not all elements were provided with SBR data", "LTP decoding not available", - "Output data buffer too small", - "CRC error in DRM data", - "PNS not allowed in DRM data stream", - "No standard extension payload allowed in DRM", - "PCE shall be the first element in a frame", - "Bitstream value not allowed by specification" + "Output data buffer too small" }; --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/error.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/error.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: error.h,v 1.23 2005/02/01 13:15:57 menno Exp $ +** $Id: error.h,v 1.22 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __ERROR_H__ @@ -37,7 +32,7 @@ extern "C" { #endif -#define NUM_ERROR_MESSAGES 33 +#define NUM_ERROR_MESSAGES 28 extern char *err_msg[]; #ifdef __cplusplus --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/filtbank.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/filtbank.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: filtbank.c,v 1.42 2005/02/01 13:28:56 menno Exp $ +** $Id: filtbank.c,v 1.41 2004/09/08 09:43:11 gcp Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/filtbank.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/filtbank.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: filtbank.h,v 1.24 2005/02/01 13:28:56 menno Exp $ +** $Id: filtbank.h,v 1.23 2004/09/08 09:43:11 gcp Exp $ **/ #ifndef __FILTBANK_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/fixed.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/fixed.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: fixed.h,v 1.27 2005/02/01 13:15:57 menno Exp $ +** $Id: fixed.h,v 1.26 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __FIXED_H__ @@ -41,7 +36,6 @@ #include #endif - #define COEF_BITS 28 #define COEF_PRECISION (1 << COEF_BITS) #define REAL_BITS 14 // MAXIMUM OF 14 FOR FIXED POINT SBR --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/hcr.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/hcr.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2004 G.C. Pascutto, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: hcr.c,v 1.19 2005/02/01 13:15:57 menno Exp $ +** $Id: hcr.c,v 1.18 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" @@ -216,7 +211,7 @@ codeword[index].bits.len = 0; } -uint8_t reordered_spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, +uint8_t reordered_spectral_data(faacDecHandle hDecoder, ic_stream *ics, bitfile *ld, int16_t *spectral_data) { uint16_t PCWs_done; @@ -227,7 +222,6 @@ uint16_t sp_offset[8]; uint16_t g, i, sortloop, set, bitsread; - uint16_t bitsleft, codewordsleft; uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB; const uint16_t nshort = hDecoder->frameLength/8; @@ -242,7 +236,7 @@ /* since there is spectral data, at least one codeword has nonzero length */ if (ics->length_of_longest_codeword == 0) return 10; - + if (sp_data_len < ics->length_of_longest_codeword) return 10; @@ -410,22 +404,6 @@ rewrev_bits(&segment[i]); } - bitsleft = 0; - - for (i = 0; i < numberOfSegments && !bitsleft; i++) - bitsleft += segment[i].len; - - if (bitsleft) return 10; - - codewordsleft = 0; - - for (i = 0; (i < numberOfCodewords - numberOfSegments) && (!codewordsleft); i++) - if (!codeword[i].decoded) - codewordsleft++; - - if (codewordsleft) return 10; - return 0; - } #endif --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/huffman.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/huffman.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: huffman.c,v 1.23 2005/02/01 13:15:57 menno Exp $ +** $Id: huffman.c,v 1.22 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/huffman.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/huffman.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: huffman.h,v 1.25 2005/02/01 13:15:57 menno Exp $ +** $Id: huffman.h,v 1.24 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __HUFFMAN_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ic_predict.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/ic_predict.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ic_predict.c,v 1.24 2005/02/01 13:15:57 menno Exp $ +** $Id: ic_predict.c,v 1.23 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ic_predict.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/ic_predict.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ic_predict.h,v 1.20 2005/02/01 13:15:57 menno Exp $ +** $Id: ic_predict.h,v 1.19 2004/09/04 14:56:28 menno Exp $ **/ #ifdef MAIN_DEC --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/iq_table.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/iq_table.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: iq_table.h,v 1.17 2005/02/01 13:15:57 menno Exp $ +** $Id: iq_table.h,v 1.16 2004/09/04 14:56:28 menno Exp $ **/ #ifndef IQ_TABLE_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/is.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/is.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: is.c,v 1.25 2005/02/01 13:15:57 menno Exp $ +** $Id: is.c,v 1.24 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/is.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/is.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: is.h,v 1.17 2005/02/01 13:15:57 menno Exp $ +** $Id: is.h,v 1.16 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __IS_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/kbd_win.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/kbd_win.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: kbd_win.h,v 1.18 2005/02/01 13:15:57 menno Exp $ +** $Id: kbd_win.h,v 1.17 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __KBD_WIN_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad.dsp +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad.dsp @@ -0,0 +1,484 @@ +# Microsoft Developer Studio Project File - Name="libfaad" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libfaad - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libfaad.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libfaad.mak" CFG="libfaad - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libfaad - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libfaad - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "libfaad - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +MTL=midl.exe +F90=df.exe +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x413 /d "NDEBUG" +# ADD RSC /l 0x413 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libfaad - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +MTL=midl.exe +F90=df.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x413 /d "_DEBUG" +# ADD RSC /l 0x413 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libfaad - Win32 Release" +# Name "libfaad - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\bits.c +# End Source File +# Begin Source File + +SOURCE=.\cfft.c +# End Source File +# Begin Source File + +SOURCE=.\common.c +# End Source File +# Begin Source File + +SOURCE=.\decoder.c +# End Source File +# Begin Source File + +SOURCE=.\drc.c +# End Source File +# Begin Source File + +SOURCE=.\drm_dec.c +# End Source File +# Begin Source File + +SOURCE=.\error.c +# End Source File +# Begin Source File + +SOURCE=.\filtbank.c +# End Source File +# Begin Source File + +SOURCE=.\hcr.c +# End Source File +# Begin Source File + +SOURCE=.\huffman.c +# End Source File +# Begin Source File + +SOURCE=.\ic_predict.c +# End Source File +# Begin Source File + +SOURCE=.\is.c +# End Source File +# Begin Source File + +SOURCE=.\lt_predict.c +# End Source File +# Begin Source File + +SOURCE=.\mdct.c +# End Source File +# Begin Source File + +SOURCE=.\mp4.c +# End Source File +# Begin Source File + +SOURCE=.\ms.c +# End Source File +# Begin Source File + +SOURCE=.\output.c +# End Source File +# Begin Source File + +SOURCE=.\pns.c +# End Source File +# Begin Source File + +SOURCE=.\ps_dec.c +# End Source File +# Begin Source File + +SOURCE=.\ps_syntax.c +# End Source File +# Begin Source File + +SOURCE=.\pulse.c +# End Source File +# Begin Source File + +SOURCE=.\rvlc.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_dct.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_dec.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_e_nf.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_fbt.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_hfadj.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_hfgen.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_huff.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_qmf.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_syntax.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_tf_grid.c +# End Source File +# Begin Source File + +SOURCE=.\specrec.c +# End Source File +# Begin Source File + +SOURCE=.\ssr.c +# End Source File +# Begin Source File + +SOURCE=.\ssr_fb.c +# End Source File +# Begin Source File + +SOURCE=.\ssr_ipqf.c +# End Source File +# Begin Source File + +SOURCE=.\syntax.c +# End Source File +# Begin Source File + +SOURCE=.\tns.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Group "codebook" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\codebook\hcb_1.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_10.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_11.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_2.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_3.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_4.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_5.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_6.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_7.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_8.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_9.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_sf.h +# End Source File +# End Group +# Begin Source File + +SOURCE=.\analysis.h +# End Source File +# Begin Source File + +SOURCE=.\bits.h +# End Source File +# Begin Source File + +SOURCE=.\cfft.h +# End Source File +# Begin Source File + +SOURCE=.\cfft_tab.h +# End Source File +# Begin Source File + +SOURCE=.\common.h +# End Source File +# Begin Source File + +SOURCE=.\decoder.h +# End Source File +# Begin Source File + +SOURCE=.\drc.h +# End Source File +# Begin Source File + +SOURCE=.\drm_dec.h +# End Source File +# Begin Source File + +SOURCE=.\error.h +# End Source File +# Begin Source File + +SOURCE=.\filtbank.h +# End Source File +# Begin Source File + +SOURCE=.\fixed.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb.h +# End Source File +# Begin Source File + +SOURCE=.\huffman.h +# End Source File +# Begin Source File + +SOURCE=.\ic_predict.h +# End Source File +# Begin Source File + +SOURCE=.\iq_table.h +# End Source File +# Begin Source File + +SOURCE=.\is.h +# End Source File +# Begin Source File + +SOURCE=.\kbd_win.h +# End Source File +# Begin Source File + +SOURCE=.\lt_predict.h +# End Source File +# Begin Source File + +SOURCE=.\mdct.h +# End Source File +# Begin Source File + +SOURCE=.\mdct_tab.h +# End Source File +# Begin Source File + +SOURCE=.\mp4.h +# End Source File +# Begin Source File + +SOURCE=.\ms.h +# End Source File +# Begin Source File + +SOURCE=.\output.h +# End Source File +# Begin Source File + +SOURCE=.\pns.h +# End Source File +# Begin Source File + +SOURCE=.\ps_dec.h +# End Source File +# Begin Source File + +SOURCE=.\ps_tables.h +# End Source File +# Begin Source File + +SOURCE=.\pulse.h +# End Source File +# Begin Source File + +SOURCE=.\rvlc.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_dct.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_dec.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_e_nf.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_fbt.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_hfadj.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_hfgen.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_huff.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_noise.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_qmf.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_qmf_c.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_syntax.h +# End Source File +# Begin Source File + +SOURCE=.\sbr_tf_grid.h +# End Source File +# Begin Source File + +SOURCE=.\sine_win.h +# End Source File +# Begin Source File + +SOURCE=.\specrec.h +# End Source File +# Begin Source File + +SOURCE=.\ssr.h +# End Source File +# Begin Source File + +SOURCE=.\structs.h +# End Source File +# Begin Source File + +SOURCE=.\syntax.h +# End Source File +# Begin Source File + +SOURCE=.\tns.h +# End Source File +# End Group +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad.dsw +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "libfaad"=.\libfaad.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad.sln +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "libfaad.vcproj", "{4274723E-6B9D-4B3E-A8BE-7566165AA169}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(DPCodeReviewSolutionGUID) = preSolution + DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} + EndGlobalSection + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {4274723E-6B9D-4B3E-A8BE-7566165AA169}.Debug.ActiveCfg = Debug|Win32 + {4274723E-6B9D-4B3E-A8BE-7566165AA169}.Debug.Build.0 = Debug|Win32 + {4274723E-6B9D-4B3E-A8BE-7566165AA169}.Release.ActiveCfg = Release|Win32 + {4274723E-6B9D-4B3E-A8BE-7566165AA169}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad.vcproj +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad.vcproj @@ -0,0 +1,1015 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad2.def +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad2.def @@ -0,0 +1,14 @@ +LIBRARY libfaad2.dll +EXPORTS +; +; libfaad exports +; +faacDecOpen @1 +faacDecGetCurrentConfiguration @2 +faacDecSetConfiguration @3 +faacDecInit @4 +faacDecInit2 @5 +faacDecDecode @6 +faacDecClose @7 +faacDecGetErrorMessage @8 +AudioSpecificConfig @9 --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad2.vcp +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad2.vcp @@ -0,0 +1,2091 @@ +# Microsoft eMbedded Visual Tools Project File - Name="libfaad2" - Package Owner=<4> +# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (WCE x86) Static Library" 0x8304 +# TARGTYPE "Win32 (WCE ARM) Static Library" 0x8504 + +CFG=libfaad2 - Win32 (WCE ARM) Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libfaad2.vcn". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libfaad2.vcn" CFG="libfaad2 - Win32 (WCE ARM) Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libfaad2 - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Static Library") +!MESSAGE "libfaad2 - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Static Library") +!MESSAGE "libfaad2 - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Static Library") +!MESSAGE "libfaad2 - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +# PROP ATL_Project 2 + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ARMRel" +# PROP BASE Intermediate_Dir "ARMRel" +# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ARMRel" +# PROP Intermediate_Dir "ARMRel" +# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "ARMDbg" +# PROP BASE Intermediate_Dir "ARMDbg" +# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "ARMDbg" +# PROP Intermediate_Dir "ARMDbg" +# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "X86Rel" +# PROP BASE Intermediate_Dir "X86Rel" +# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "X86Rel" +# PROP Intermediate_Dir "X86Rel" +# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /Oxs /c +# ADD CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /Oxs /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "X86Dbg" +# PROP BASE Intermediate_Dir "X86Dbg" +# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "X86Dbg" +# PROP Intermediate_Dir "X86Dbg" +# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c +# ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ENDIF + +# Begin Target + +# Name "libfaad2 - Win32 (WCE ARM) Release" +# Name "libfaad2 - Win32 (WCE ARM) Debug" +# Name "libfaad2 - Win32 (WCE x86) Release" +# Name "libfaad2 - Win32 (WCE x86) Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Group "codebook" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\codebook\hcb_1.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_1=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_1=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_1=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_1=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_10.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_10=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_10=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_10=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_10=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_11.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_11=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_11=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_11=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_11=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_2.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_2=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_2=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_2=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_2=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_3.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_3=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_3=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_3=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_3=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_4.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_4=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_4=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_4=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_4=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_5.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_5=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_5=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_5=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_5=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_6.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_6=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_6=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_6=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_6=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_7.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_7=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_7=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_7=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_7=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_8.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_8=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_8=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_8=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_8=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_9.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_9=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_9=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_9=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_9=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb_sf.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_HCB_S=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_HCB_S=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_HCB_S=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_HCB_S=\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# End Group +# Begin Source File + +SOURCE=.\bits.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_BITS_=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_BITS_=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_BITS_=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_BITS_=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\cfft.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_CFFT_=\ + ".\cfft.h"\ + ".\cfft_tab.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_CFFT_=\ + ".\cfft.h"\ + ".\cfft_tab.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_CFFT_=\ + ".\cfft.h"\ + ".\cfft_tab.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_CFFT_=\ + ".\cfft.h"\ + ".\cfft_tab.h"\ + ".\common.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\common.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_COMMO=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_COMMO=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_COMMO=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_COMMO=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\data.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_DATA_=\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_DATA_=\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_DATA_=\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_DATA_=\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\decoder.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_DECOD=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\dither.h"\ + ".\drc.h"\ + ".\error.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\is.h"\ + ".\lt_predict.h"\ + ".\mdct.h"\ + ".\mp4.h"\ + ".\ms.h"\ + ".\output.h"\ + ".\pns.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_DECOD=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\dither.h"\ + ".\drc.h"\ + ".\error.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\is.h"\ + ".\lt_predict.h"\ + ".\mdct.h"\ + ".\mp4.h"\ + ".\ms.h"\ + ".\output.h"\ + ".\pns.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_DECOD=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\dither.h"\ + ".\drc.h"\ + ".\error.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\is.h"\ + ".\lt_predict.h"\ + ".\mdct.h"\ + ".\mp4.h"\ + ".\ms.h"\ + ".\output.h"\ + ".\pns.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_DECOD=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\dither.h"\ + ".\drc.h"\ + ".\error.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\is.h"\ + ".\lt_predict.h"\ + ".\mdct.h"\ + ".\mp4.h"\ + ".\ms.h"\ + ".\output.h"\ + ".\pns.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\dither.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_DITHE=\ + ".\common.h"\ + ".\dither.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_DITHE=\ + ".\common.h"\ + ".\dither.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_DITHE=\ + ".\common.h"\ + ".\dither.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_DITHE=\ + ".\common.h"\ + ".\dither.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\drc.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_DRC_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\drc.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_DRC_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\drc.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_DRC_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\drc.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_DRC_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\drc.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\error.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_ERROR=\ + ".\common.h"\ + ".\error.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_ERROR=\ + ".\common.h"\ + ".\error.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_ERROR=\ + ".\common.h"\ + ".\error.h"\ + ".\fixed.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_ERROR=\ + ".\common.h"\ + ".\error.h"\ + ".\fixed.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\filtbank.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_FILTB=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\kbd_win.h"\ + ".\mdct.h"\ + ".\sine_win.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_FILTB=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\kbd_win.h"\ + ".\mdct.h"\ + ".\sine_win.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_FILTB=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\kbd_win.h"\ + ".\mdct.h"\ + ".\sine_win.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_FILTB=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\kbd_win.h"\ + ".\mdct.h"\ + ".\sine_win.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\ic_predict.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_IC_PR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_IC_PR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_IC_PR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_IC_PR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\is.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_IS_C2c=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\is.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_IS_C2c=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\is.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_IS_C2c=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\is.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_IS_C2c=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\is.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\lt_predict.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_LT_PR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\lt_predict.h"\ + ".\mdct.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_LT_PR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\lt_predict.h"\ + ".\mdct.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_LT_PR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\lt_predict.h"\ + ".\mdct.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_LT_PR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\lt_predict.h"\ + ".\mdct.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\mdct.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_MDCT_=\ + ".\cfft.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\mdct.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_MDCT_=\ + ".\cfft.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\mdct.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_MDCT_=\ + ".\cfft.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\mdct.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_MDCT_=\ + ".\cfft.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\mdct.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\mp4.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_MP4_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\mp4.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_MP4_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\mp4.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_MP4_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\mp4.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_MP4_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\mp4.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\ms.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_MS_C34=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\is.h"\ + ".\ms.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_MS_C34=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\is.h"\ + ".\ms.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_MS_C34=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\is.h"\ + ".\ms.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_MS_C34=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\is.h"\ + ".\ms.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\output.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_OUTPU=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\decoder.h"\ + ".\dither.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\output.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_OUTPU=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\decoder.h"\ + ".\dither.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\output.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_OUTPU=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\decoder.h"\ + ".\dither.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\output.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_OUTPU=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\common.h"\ + ".\decoder.h"\ + ".\dither.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\output.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\pns.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_PNS_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_PNS_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_PNS_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_PNS_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\pns.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\pulse.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_PULSE=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\pulse.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_PULSE=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\pulse.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_PULSE=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\pulse.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_PULSE=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\pulse.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\reordered_spectral_data.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_REORD=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + ".\pulse.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_REORD=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + ".\pulse.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_REORD=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + ".\pulse.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_REORD=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + ".\pulse.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\rvlc_scale_factors.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_RVLC_=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\rvlc_scale_factors.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_RVLC_=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\rvlc_scale_factors.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_RVLC_=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\rvlc_scale_factors.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_RVLC_=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\rvlc_scale_factors.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\specrec.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_SPECR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + ".\iq_table.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_SPECR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + ".\iq_table.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_SPECR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + ".\iq_table.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_SPECR=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\data.h"\ + ".\fixed.h"\ + ".\iq_table.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\syntax.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_SYNTA=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\huffman.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\pulse.h"\ + ".\rvlc_scale_factors.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_SYNTA=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\huffman.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\pulse.h"\ + ".\rvlc_scale_factors.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_SYNTA=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\huffman.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\pulse.h"\ + ".\rvlc_scale_factors.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_SYNTA=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\cfft.h"\ + ".\codebook\hcb.h"\ + ".\common.h"\ + ".\data.h"\ + ".\decoder.h"\ + ".\filtbank.h"\ + ".\fixed.h"\ + ".\huffman.h"\ + ".\ic_predict.h"\ + ".\mdct.h"\ + ".\pulse.h"\ + ".\rvlc_scale_factors.h"\ + ".\specrec.h"\ + ".\syntax.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\tns.c + +!IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release" + +DEP_CPP_TNS_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug" + +DEP_CPP_TNS_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release" + +DEP_CPP_TNS_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug" + +DEP_CPP_TNS_C=\ + ".\analysis.h"\ + ".\bits.h"\ + ".\common.h"\ + ".\fixed.h"\ + ".\syntax.h"\ + ".\tns.h"\ + + +!ENDIF + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\analysis.h +# End Source File +# Begin Source File + +SOURCE=.\bits.h +# End Source File +# Begin Source File + +SOURCE=.\cfft.h +# End Source File +# Begin Source File + +SOURCE=.\cfft_tab.h +# End Source File +# Begin Source File + +SOURCE=.\common.h +# End Source File +# Begin Source File + +SOURCE=.\data.h +# End Source File +# Begin Source File + +SOURCE=.\decoder.h +# End Source File +# Begin Source File + +SOURCE=.\dither.h +# End Source File +# Begin Source File + +SOURCE=.\drc.h +# End Source File +# Begin Source File + +SOURCE=.\error.h +# End Source File +# Begin Source File + +SOURCE=.\filtbank.h +# End Source File +# Begin Source File + +SOURCE=.\fixed.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb.h +# End Source File +# Begin Source File + +SOURCE=.\huffman.h +# End Source File +# Begin Source File + +SOURCE=.\ic_predict.h +# End Source File +# Begin Source File + +SOURCE=.\iq_table.h +# End Source File +# Begin Source File + +SOURCE=.\is.h +# End Source File +# Begin Source File + +SOURCE=.\kbd_win.h +# End Source File +# Begin Source File + +SOURCE=.\lt_predict.h +# End Source File +# Begin Source File + +SOURCE=.\mdct.h +# End Source File +# Begin Source File + +SOURCE=.\mp4.h +# End Source File +# Begin Source File + +SOURCE=.\ms.h +# End Source File +# Begin Source File + +SOURCE=.\output.h +# End Source File +# Begin Source File + +SOURCE=.\pns.h +# End Source File +# Begin Source File + +SOURCE=.\pulse.h +# End Source File +# Begin Source File + +SOURCE=.\rvlc_scale_factors.h +# End Source File +# Begin Source File + +SOURCE=.\sine_win.h +# End Source File +# Begin Source File + +SOURCE=.\specrec.h +# End Source File +# Begin Source File + +SOURCE=.\syntax.h +# End Source File +# Begin Source File + +SOURCE=.\tns.h +# End Source File +# End Group +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad2.vcw +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad2.vcw @@ -0,0 +1,29 @@ +Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "libfaad2"=".\libfaad2.vcp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad2_dll.dsp +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad2_dll.dsp @@ -0,0 +1,355 @@ +# Microsoft Developer Studio Project File - Name="libfaad2_dll" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=libfaad2_dll - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libfaad2_dll.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libfaad2_dll.mak" CFG="libfaad2_dll - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libfaad2_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libfaad2_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libfaad2_dll - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "libfaad2_dll___Win32_Release" +# PROP BASE Intermediate_Dir "libfaad2_dll___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseDLL" +# PROP Intermediate_Dir "ReleaseDLL" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "libfaad2_dll_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "fftw" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "libfaad2_dll_EXPORTS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 /nologo /dll /machine:I386 /out:"ReleaseDLL/libfaad2.dll" + +!ELSEIF "$(CFG)" == "libfaad2_dll - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "libfaad2_dll___Win32_Debug" +# PROP BASE Intermediate_Dir "libfaad2_dll___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "DebugDLL" +# PROP Intermediate_Dir "DebugDLL" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "libfaad2_dll_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "fftw" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "libfaad2_dll_EXPORTS" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"DebugDLL/libfaad2.dll" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "libfaad2_dll - Win32 Release" +# Name "libfaad2_dll - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\bits.c +# End Source File +# Begin Source File + +SOURCE=.\cfft.c +# End Source File +# Begin Source File + +SOURCE=.\common.c +# End Source File +# Begin Source File + +SOURCE=.\decoder.c +# End Source File +# Begin Source File + +SOURCE=.\dither.c +# End Source File +# Begin Source File + +SOURCE=.\drc.c +# End Source File +# Begin Source File + +SOURCE=.\error.c +# End Source File +# Begin Source File + +SOURCE=.\filtbank.c +# End Source File +# Begin Source File + +SOURCE=.\hcr.c +# End Source File +# Begin Source File + +SOURCE=.\huffman.c +# End Source File +# Begin Source File + +SOURCE=.\ic_predict.c +# End Source File +# Begin Source File + +SOURCE=.\is.c +# End Source File +# Begin Source File + +SOURCE=.\lt_predict.c +# End Source File +# Begin Source File + +SOURCE=.\mdct.c +# End Source File +# Begin Source File + +SOURCE=.\mp4.c +# End Source File +# Begin Source File + +SOURCE=.\ms.c +# End Source File +# Begin Source File + +SOURCE=.\output.c +# End Source File +# Begin Source File + +SOURCE=.\pns.c +# End Source File +# Begin Source File + +SOURCE=.\pulse.c +# End Source File +# Begin Source File + +SOURCE=.\rvlc.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_dct.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_dec.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_e_nf.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_fbt.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_hfadj.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_hfgen.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_huff.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_qmf.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_syntax.c +# End Source File +# Begin Source File + +SOURCE=.\sbr_tf_grid.c +# End Source File +# Begin Source File + +SOURCE=.\specrec.c +# End Source File +# Begin Source File + +SOURCE=.\ssr.c +# End Source File +# Begin Source File + +SOURCE=.\ssr_fb.c +# End Source File +# Begin Source File + +SOURCE=.\ssr_ipqf.c +# End Source File +# Begin Source File + +SOURCE=.\syntax.c +# End Source File +# Begin Source File + +SOURCE=.\tns.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\analysis.h +# End Source File +# Begin Source File + +SOURCE=.\bits.h +# End Source File +# Begin Source File + +SOURCE=.\cfft.h +# End Source File +# Begin Source File + +SOURCE=.\common.h +# End Source File +# Begin Source File + +SOURCE=.\data.h +# End Source File +# Begin Source File + +SOURCE=.\decoder.h +# End Source File +# Begin Source File + +SOURCE=.\dither.h +# End Source File +# Begin Source File + +SOURCE=.\drc.h +# End Source File +# Begin Source File + +SOURCE=.\error.h +# End Source File +# Begin Source File + +SOURCE=.\filtbank.h +# End Source File +# Begin Source File + +SOURCE=.\codebook\hcb.h +# End Source File +# Begin Source File + +SOURCE=.\huffman.h +# End Source File +# Begin Source File + +SOURCE=.\ic_predict.h +# End Source File +# Begin Source File + +SOURCE=.\is.h +# End Source File +# Begin Source File + +SOURCE=.\kbd_win.h +# End Source File +# Begin Source File + +SOURCE=.\lt_predict.h +# End Source File +# Begin Source File + +SOURCE=.\mdct.h +# End Source File +# Begin Source File + +SOURCE=.\mp4.h +# End Source File +# Begin Source File + +SOURCE=.\ms.h +# End Source File +# Begin Source File + +SOURCE=.\output.h +# End Source File +# Begin Source File + +SOURCE=.\pns.h +# End Source File +# Begin Source File + +SOURCE=.\pulse.h +# End Source File +# Begin Source File + +SOURCE=.\rvlc.h +# End Source File +# Begin Source File + +SOURCE=.\specrec.h +# End Source File +# Begin Source File + +SOURCE=.\ssr.h +# End Source File +# Begin Source File + +SOURCE=.\syntax.h +# End Source File +# Begin Source File + +SOURCE=.\Tns.h +# End Source File +# End Group +# Begin Source File + +SOURCE=.\libfaad2.def +# End Source File +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad2_dll.dsw +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad2_dll.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "libfaad2_dll"=.\libfaad2_dll.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad2_dll.sln +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad2_dll.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad2_dll", "libfaad2_dll.vcproj", "{482DA264-EE88-4575-B208-87C4CB80CD08}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug.ActiveCfg = Debug|Win32 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug.Build.0 = Debug|Win32 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Release.ActiveCfg = Release|Win32 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/libfaad2_dll.vcproj +++ vlc-0.8.4.debian/extras/faad2/libfaad/libfaad2_dll.vcproj @@ -0,0 +1,307 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/lt_predict.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/lt_predict.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: lt_predict.c,v 1.24 2005/02/01 13:15:57 menno Exp $ +** $Id: lt_predict.c,v 1.23 2004/09/04 14:56:28 menno Exp $ **/ @@ -58,6 +53,9 @@ #ifdef LD_DEC || (object_type == LD) #endif +#ifdef SCALABLE_DEC + || (object_type == 6) /* TODO */ +#endif ) { return 1; --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/lt_predict.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/lt_predict.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: lt_predict.h,v 1.17 2005/02/01 13:15:57 menno Exp $ +** $Id: lt_predict.h,v 1.16 2004/09/04 14:56:28 menno Exp $ **/ #ifdef LTP_DEC --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/mdct.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/mdct.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mdct.c,v 1.44 2005/02/01 13:15:57 menno Exp $ +** $Id: mdct.c,v 1.43 2004/09/04 14:56:28 menno Exp $ **/ /* --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/mdct.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/mdct.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mdct.h,v 1.27 2005/02/01 13:28:56 menno Exp $ +** $Id: mdct.h,v 1.26 2004/09/08 09:43:11 gcp Exp $ **/ #ifndef __MDCT_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/mdct_tab.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/mdct_tab.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mdct_tab.h,v 1.4 2005/02/01 13:15:57 menno Exp $ +** $Id: mdct_tab.h,v 1.3 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __MDCT_TAB_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/mp4.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/mp4.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mp4.c,v 1.33 2005/02/01 13:15:57 menno Exp $ +** $Id: mp4.c,v 1.32 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" @@ -63,7 +58,11 @@ #else 0, /* 5 SBR */ #endif +#ifdef SCALABLE_DEC + 1, /* 6 AAC Scalable */ +#else 0, /* 6 AAC Scalable */ +#endif 0, /* 7 TwinVQ */ 0, /* 8 CELP */ 0, /* 9 HVXC */ @@ -84,7 +83,11 @@ #else 0, /* 19 ER AAC LTP */ #endif +#ifdef SCALABLE_DEC + 1, /* 20 ER AAC scalable */ +#else 0, /* 20 ER AAC scalable */ +#endif 0, /* 21 ER TwinVQ */ 0, /* 22 ER BSAC */ #ifdef LD_DEC @@ -116,7 +119,7 @@ }; /* Table 1.6.1 */ -int8_t NEAACDECAPI NeAACDecAudioSpecificConfig(uint8_t *pBuffer, +int8_t FAADAPI faacDecAudioSpecificConfig(uint8_t *pBuffer, uint32_t buffer_size, mp4AudioSpecificConfig *mp4ASC) { --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/mp4.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/mp4.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: mp4.h,v 1.22 2005/02/01 13:15:57 menno Exp $ +** $Id: mp4.h,v 1.21 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __MP4_H__ @@ -39,7 +34,7 @@ #include "decoder.h" -int8_t NEAACDECAPI NeAACDecAudioSpecificConfig(uint8_t *pBuffer, +int8_t FAADAPI faacDecAudioSpecificConfig(uint8_t *pBuffer, uint32_t buffer_size, mp4AudioSpecificConfig *mp4ASC); --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ms.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/ms.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ms.c,v 1.18 2005/02/01 13:15:58 menno Exp $ +** $Id: ms.c,v 1.17 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ms.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/ms.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ms.h,v 1.16 2005/02/01 13:15:58 menno Exp $ +** $Id: ms.h,v 1.15 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __MS_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/output.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/output.c @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: output.c,v 1.43 2005/02/01 13:15:58 menno Exp $ +** $Id: output.c,v 1.42 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" @@ -89,7 +84,7 @@ #define CONV(a,b) ((a<<1)|(b&0x1)) -static void to_PCM_16bit(NeAACDecHandle hDecoder, real_t **input, +static void to_PCM_16bit(faacDecHandle hDecoder, real_t **input, uint8_t channels, uint16_t frame_len, int16_t **sample_buffer) { @@ -154,7 +149,7 @@ } } -static void to_PCM_24bit(NeAACDecHandle hDecoder, real_t **input, +static void to_PCM_24bit(faacDecHandle hDecoder, real_t **input, uint8_t channels, uint16_t frame_len, int32_t **sample_buffer) { @@ -224,7 +219,7 @@ } } -static void to_PCM_32bit(NeAACDecHandle hDecoder, real_t **input, +static void to_PCM_32bit(faacDecHandle hDecoder, real_t **input, uint8_t channels, uint16_t frame_len, int32_t **sample_buffer) { @@ -294,7 +289,7 @@ } } -static void to_PCM_float(NeAACDecHandle hDecoder, real_t **input, +static void to_PCM_float(faacDecHandle hDecoder, real_t **input, uint8_t channels, uint16_t frame_len, float32_t **sample_buffer) { @@ -346,7 +341,7 @@ } } -static void to_PCM_double(NeAACDecHandle hDecoder, real_t **input, +static void to_PCM_double(faacDecHandle hDecoder, real_t **input, uint8_t channels, uint16_t frame_len, double **sample_buffer) { @@ -398,7 +393,7 @@ } } -void *output_to_PCM(NeAACDecHandle hDecoder, +void *output_to_PCM(faacDecHandle hDecoder, real_t **input, void *sample_buffer, uint8_t channels, uint16_t frame_len, uint8_t format) { @@ -468,7 +463,7 @@ } } -void* output_to_PCM(NeAACDecHandle hDecoder, +void* output_to_PCM(faacDecHandle hDecoder, real_t **input, void *sample_buffer, uint8_t channels, uint16_t frame_len, uint8_t format) { --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/output.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/output.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: output.h,v 1.22 2005/02/01 13:15:58 menno Exp $ +** $Id: output.h,v 1.21 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __OUTPUT_H__ @@ -37,7 +32,7 @@ extern "C" { #endif -void* output_to_PCM(NeAACDecHandle hDecoder, +void* output_to_PCM(faacDecHandle hDecoder, real_t **input, void *samplebuffer, uint8_t channels, --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/pns.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/pns.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: pns.c,v 1.35 2005/02/01 13:15:58 menno Exp $ +** $Id: pns.c,v 1.34 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/pns.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/pns.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: pns.h,v 1.24 2005/02/01 13:15:58 menno Exp $ +** $Id: pns.h,v 1.23 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __PNS_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ps_dec.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/ps_dec.c @@ -1,33 +1,28 @@ /* -** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR and PS decoding +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ps_dec.c,v 1.11 2005/02/01 13:15:58 menno Exp $ +** $Id: ps_dec.c,v 1.10 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" @@ -180,7 +175,7 @@ int8_t min_index, int8_t max_index); static void delta_modulo_decode(uint8_t enable, int8_t *index, int8_t *index_prev, uint8_t dt_flag, uint8_t nr_par, uint8_t stride, - int8_t and_modulo); + int8_t log2modulo); static void map20indexto34(int8_t *index, uint8_t bins); #ifdef PS_LOW_POWER static void map34indexto20(int8_t *index, uint8_t bins); @@ -679,7 +674,7 @@ /* in: log2 value of the modulo value to allow using AND instead of MOD */ static void delta_modulo_decode(uint8_t enable, int8_t *index, int8_t *index_prev, uint8_t dt_flag, uint8_t nr_par, uint8_t stride, - int8_t and_modulo) + int8_t log2modulo) { int8_t i; @@ -689,19 +684,19 @@ { /* delta coded in frequency direction */ index[0] = 0 + index[0]; - index[0] &= and_modulo; + index[0] &= log2modulo; for (i = 1; i < nr_par; i++) { index[i] = index[i-1] + index[i]; - index[i] &= and_modulo; + index[i] &= log2modulo; } } else { /* delta coded in time direction */ for (i = 0; i < nr_par; i++) { index[i] = index_prev[i*stride] + index[i]; - index[i] &= and_modulo; + index[i] &= log2modulo; } } } else { @@ -846,11 +841,11 @@ /* delta modulo decode ipd parameters */ delta_modulo_decode(ps->enable_ipdopd, ps->ipd_index[env], ipd_index_prev, - ps->ipd_dt[env], ps->nr_ipdopd_par, 1, 7); + ps->ipd_dt[env], ps->nr_ipdopd_par, 1, /*log2(8)*/ 3); /* delta modulo decode opd parameters */ delta_modulo_decode(ps->enable_ipdopd, ps->opd_index[env], opd_index_prev, - ps->opd_dt[env], ps->nr_ipdopd_par, 1, 7); + ps->opd_dt[env], ps->nr_ipdopd_par, 1, /*log2(8)*/ 3); } /* handle error case */ @@ -1423,26 +1418,6 @@ FRAC_CONST(-0.000000000000000) }; -static real_t magnitude_c(complex_t c) -{ -#ifdef FIXED_POINT -#define ps_abs(A) (((A) > 0) ? (A) : (-(A))) -#define ALPHA FRAC_CONST(0.948059448969) -#define BETA FRAC_CONST(0.392699081699) - - real_t abs_inphase = ps_abs(RE(c)); - real_t abs_quadrature = ps_abs(IM(c)); - - if (abs_inphase > abs_quadrature) { - return MUL_F(abs_inphase, ALPHA) + MUL_F(abs_quadrature, BETA); - } else { - return MUL_F(abs_quadrature, ALPHA) + MUL_F(abs_inphase, BETA); - } -#else - return sqrt(RE(c)*RE(c) + IM(c)*IM(c)); -#endif -} - static void ps_mix_phase(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64], qmf_t X_hybrid_left[32][32], qmf_t X_hybrid_right[32][32]) { @@ -1613,7 +1588,8 @@ if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par)) { int8_t i; - real_t xy, pq, xypq; + real_t xxyy, ppqq; + real_t yq, xp, xq, py, tmp; /* ringbuffer index */ i = ps->phase_hist; @@ -1646,7 +1622,7 @@ /* ringbuffer index */ if (i == 0) - { + { i = 2; } i--; @@ -1676,54 +1652,53 @@ RE(phaseRight) = (float)cos(opd); IM(phaseRight) = (float)sin(opd); #else - // x = IM(tempLeft) // y = RE(tempLeft) // p = IM(tempRight) // q = RE(tempRight) - // cos(atan2(x,y)) = y/sqrt((x*x) + (y*y)) - // sin(atan2(x,y)) = x/sqrt((x*x) + (y*y)) - // cos(atan2(x,y)-atan2(p,q)) = (y*q + x*p) / ( sqrt((x*x) + (y*y)) * sqrt((p*p) + (q*q)) ); - // sin(atan2(x,y)-atan2(p,q)) = (x*q - y*p) / ( sqrt((x*x) + (y*y)) * sqrt((p*p) + (q*q)) ); - - xy = magnitude_c(tempRight); - pq = magnitude_c(tempLeft); - - if (xy != 0) - { - RE(phaseLeft) = DIV_R(RE(tempRight), xy); - IM(phaseLeft) = DIV_R(IM(tempRight), xy); - } else { - RE(phaseLeft) = 0; - IM(phaseLeft) = 0; - } - - xypq = MUL_R(xy, pq); - - if (xypq != 0) - { - real_t tmp1 = MUL_R(RE(tempRight), RE(tempLeft)) + MUL_R(IM(tempRight), IM(tempLeft)); - real_t tmp2 = MUL_R(IM(tempRight), RE(tempLeft)) - MUL_R(RE(tempRight), IM(tempLeft)); - - RE(phaseRight) = DIV_R(tmp1, xypq); - IM(phaseRight) = DIV_R(tmp2, xypq); - } else { - RE(phaseRight) = 0; - IM(phaseRight) = 0; - } - + // cos(atan2(x,y)) = 1/sqrt(1 + (x*x)/(y*y)) + // sin(atan2(x,y)) = x/(y*sqrt(1 + (x*x)/(y*y))) + // cos(atan2(x,y)-atan2(p,q)) = (y*q+x*p)/(y*q * sqrt(1 + (x*x)/(y*y)) * sqrt(1 + (p*p)/(q*q))); + // sin(atan2(x,y)-atan2(p,q)) = (x*q-p*y)/(y*q * sqrt(1 + (x*x)/(y*y)) * sqrt(1 + (p*p)/(q*q))); + + /* (x*x)/(y*y) (REAL > 0) */ + xxyy = DIV_R(MUL_C(IM(tempLeft),IM(tempLeft)), MUL_C(RE(tempLeft),RE(tempLeft))); + ppqq = DIV_R(MUL_C(IM(tempRight),IM(tempRight)), MUL_C(RE(tempRight),RE(tempRight))); + + /* 1 + (x*x)/(y*y) (REAL > 1) */ + xxyy += REAL_CONST(1); + ppqq += REAL_CONST(1); + + /* 1 / sqrt(1 + (x*x)/(y*y)) (FRAC <= 1) */ + xxyy = DIV_R(FRAC_CONST(1), ps_sqrt(xxyy)); + ppqq = DIV_R(FRAC_CONST(1), ps_sqrt(ppqq)); + + /* COEF */ + yq = MUL_C(RE(tempLeft), RE(tempRight)); + xp = MUL_C(IM(tempLeft), IM(tempRight)); + xq = MUL_C(IM(tempLeft), RE(tempRight)); + py = MUL_C(RE(tempLeft), IM(tempRight)); + + RE(phaseLeft) = xxyy; + IM(phaseLeft) = MUL_R(xxyy, (DIV_R(IM(tempLeft), RE(tempLeft)))); + + tmp = DIV_C(MUL_F(xxyy, ppqq), yq); + + /* MUL_C(FRAC,COEF) = FRAC */ + RE(phaseRight) = MUL_C(tmp, (yq+xp)); + IM(phaseRight) = MUL_C(tmp, (xq-py)); #endif - /* MUL_F(COEF, REAL) = COEF */ - IM(h11) = MUL_R(RE(h11), IM(phaseLeft)); - IM(h12) = MUL_R(RE(h12), IM(phaseRight)); - IM(h21) = MUL_R(RE(h21), IM(phaseLeft)); - IM(h22) = MUL_R(RE(h22), IM(phaseRight)); - - RE(h11) = MUL_R(RE(h11), RE(phaseLeft)); - RE(h12) = MUL_R(RE(h12), RE(phaseRight)); - RE(h21) = MUL_R(RE(h21), RE(phaseLeft)); - RE(h22) = MUL_R(RE(h22), RE(phaseRight)); + /* MUL_F(COEF, FRAC) = COEF */ + IM(h11) = MUL_F(RE(h11), IM(phaseLeft)); + IM(h12) = MUL_F(RE(h12), IM(phaseRight)); + IM(h21) = MUL_F(RE(h21), IM(phaseLeft)); + IM(h22) = MUL_F(RE(h22), IM(phaseRight)); + + RE(h11) = MUL_F(RE(h11), RE(phaseLeft)); + RE(h12) = MUL_F(RE(h12), RE(phaseRight)); + RE(h21) = MUL_F(RE(h21), RE(phaseLeft)); + RE(h22) = MUL_F(RE(h22), RE(phaseRight)); } /* length of the envelope n_e+1 - n_e (in time samples) */ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ps_dec.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/ps_dec.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ps_dec.h,v 1.9 2005/02/01 13:15:58 menno Exp $ +** $Id: ps_dec.h,v 1.8 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __PS_DEC_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ps_syntax.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/ps_syntax.c @@ -1,33 +1,28 @@ /* -** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR and PS decoding +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ps_syntax.c,v 1.7 2005/02/01 13:15:58 menno Exp $ +** $Id: ps_syntax.c,v 1.6 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" @@ -313,9 +308,9 @@ { 2, 3 }, /* index 1: 2 bits: 0x */ { 4, 5 }, /* index 2: 3 bits: 00x */ { /*1*/ -30, /*7*/ -24 }, /* index 3: 3 bits: 01x */ - { /*5*/ -26, /*2*/ -29 }, /* index 4: 4 bits: 000x */ - { /*6*/ -25, 6 }, /* index 5: 4 bits: 001x */ - { /*4*/ -27, /*3*/ -28 } /* index 6: 5 bits: 0011x */ + { /*5*/ -26, 6 }, /* index 4: 4 bits: 000x */ + { /*2*/ -29, /*6*/ -25 }, /* index 5: 4 bits: 001x */ + { /*4*/ -27, /*3*/ -28 } /* index 6: 5 bits: 0001x */ }; /* static function declarations */ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ps_tables.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/ps_tables.h @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ps_tables.h,v 1.4 2005/02/01 13:15:58 menno Exp $ +** $Id: ps_tables.h,v 1.3 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __PS_TABLES_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/pulse.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/pulse.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,16 +19,12 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: pulse.c,v 1.18 2005/02/01 13:15:58 menno Exp $ +** $Id: pulse.c,v 1.17 2004/09/04 14:56:28 menno Exp $ **/ + #include "common.h" #include "structs.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/pulse.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/pulse.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: pulse.h,v 1.17 2005/02/01 13:15:58 menno Exp $ +** $Id: pulse.h,v 1.16 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __PULSE_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/rvlc.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/rvlc.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: rvlc.c,v 1.18 2005/02/01 13:15:58 menno Exp $ +** $Id: rvlc.c,v 1.17 2004/09/04 14:56:28 menno Exp $ **/ /* RVLC scalefactor decoding --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/rvlc.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/rvlc.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: rvlc.h,v 1.14 2005/02/01 13:15:58 menno Exp $ +** $Id: rvlc.h,v 1.13 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __RVLC_SCF_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_dct.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_dct.c @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_dct.c,v 1.16 2005/02/01 13:15:58 menno Exp $ +** $Id: sbr_dct.c,v 1.15 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" @@ -1816,7 +1811,7 @@ { // Tables with bit reverse values for 5 bits, bit reverse of i at i-th position const uint8_t bit_rev_tab[32] = { 0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31 }; - uint32_t i, i_rev; + uint16_t i, i_rev; /* Step 2: modulate */ // 3*32=96 multiplications --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_dct.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_dct.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_dct.h,v 1.16 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_dct.h,v 1.15 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_DCT_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_dec.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_dec.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_dec.c,v 1.40 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_dec.c,v 1.39 2004/09/04 14:56:28 menno Exp $ **/ @@ -181,72 +176,6 @@ } } -void sbrReset(sbr_info *sbr) -{ - uint8_t j; - if (sbr->qmfa[0] != NULL) - memset(sbr->qmfa[0]->x, 0, 2 * sbr->qmfa[0]->channels * 10 * sizeof(real_t)); - if (sbr->qmfa[1] != NULL) - memset(sbr->qmfa[1]->x, 0, 2 * sbr->qmfa[1]->channels * 10 * sizeof(real_t)); - if (sbr->qmfs[0] != NULL) - memset(sbr->qmfs[0]->v, 0, 2 * sbr->qmfs[0]->channels * 20 * sizeof(real_t)); - if (sbr->qmfs[1] != NULL) - memset(sbr->qmfs[1]->v, 0, 2 * sbr->qmfs[1]->channels * 20 * sizeof(real_t)); - - for (j = 0; j < 5; j++) - { - if (sbr->G_temp_prev[0][j] != NULL) - memset(sbr->G_temp_prev[0][j], 0, 64*sizeof(real_t)); - if (sbr->G_temp_prev[1][j] != NULL) - memset(sbr->G_temp_prev[1][j], 0, 64*sizeof(real_t)); - if (sbr->Q_temp_prev[0][j] != NULL) - memset(sbr->Q_temp_prev[0][j], 0, 64*sizeof(real_t)); - if (sbr->Q_temp_prev[1][j] != NULL) - memset(sbr->Q_temp_prev[1][j], 0, 64*sizeof(real_t)); - } - - memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t)); - memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t)); - - sbr->GQ_ringbuf_index[0] = 0; - sbr->GQ_ringbuf_index[1] = 0; - sbr->header_count = 0; - sbr->Reset = 1; - - sbr->L_E_prev[0] = 0; - sbr->L_E_prev[1] = 0; - sbr->bs_freq_scale = 2; - sbr->bs_alter_scale = 1; - sbr->bs_noise_bands = 2; - sbr->bs_limiter_bands = 2; - sbr->bs_limiter_gains = 2; - sbr->bs_interpol_freq = 1; - sbr->bs_smoothing_mode = 1; - sbr->bs_start_freq = 5; - sbr->bs_amp_res = 1; - sbr->bs_samplerate_mode = 1; - sbr->prevEnvIsShort[0] = -1; - sbr->prevEnvIsShort[1] = -1; - sbr->bsco = 0; - sbr->bsco_prev = 0; - sbr->M_prev = 0; - sbr->bs_start_freq_prev = -1; - - sbr->f_prev[0] = 0; - sbr->f_prev[1] = 0; - for (j = 0; j < MAX_M; j++) - { - sbr->E_prev[0][j] = 0; - sbr->Q_prev[0][j] = 0; - sbr->E_prev[1][j] = 0; - sbr->Q_prev[1][j] = 0; - sbr->bs_add_harmonic_prev[0][j] = 0; - sbr->bs_add_harmonic_prev[1][j] = 0; - } - sbr->bs_add_harmonic_flag_prev[0] = 0; - sbr->bs_add_harmonic_flag_prev[1] = 0; -} - static uint8_t sbr_save_prev_data(sbr_info *sbr, uint8_t ch) { uint8_t i; @@ -297,12 +226,11 @@ } } -static uint8_t sbr_process_channel(sbr_info *sbr, real_t *channel_buf, qmf_t X[MAX_NTSR][64], - uint8_t ch, uint8_t dont_process, - const uint8_t downSampledSBR) +static void sbr_process_channel(sbr_info *sbr, real_t *channel_buf, qmf_t X[MAX_NTSR][64], + uint8_t ch, uint8_t dont_process, + const uint8_t downSampledSBR) { int16_t k, l; - uint8_t ret = 0; #ifdef SBR_LOW_POWER ALIGN real_t deg[64]; @@ -350,7 +278,7 @@ ,ch); #endif -#if 0 //def SBR_LOW_POWER +#ifdef SBR_LOW_POWER for (l = sbr->t_E[ch][0]; l < sbr->t_E[ch][sbr->L_E[ch]]; l++) { for (k = 0; k < sbr->kx; k++) @@ -362,16 +290,12 @@ #if 1 /* hf adjustment */ - ret = hf_adjustment(sbr, sbr->Xsbr[ch] + hf_adjustment(sbr, sbr->Xsbr[ch] #ifdef SBR_LOW_POWER ,deg #endif ,ch); #endif - if (ret > 0) - { - dont_process = 1; - } } if ((sbr->just_seeked != 0) || dont_process) @@ -443,8 +367,6 @@ #endif } } - - return ret; } uint8_t sbrDecodeCoupleFrame(sbr_info *sbr, real_t *left_chan, real_t *right_chan, @@ -478,7 +400,7 @@ sbr->just_seeked = 0; } - sbr->ret += sbr_process_channel(sbr, left_chan, X, 0, dont_process, downSampledSBR); + sbr_process_channel(sbr, left_chan, X, 0, dont_process, downSampledSBR); /* subband synthesis */ if (downSampledSBR) { @@ -487,7 +409,7 @@ sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X, left_chan); } - sbr->ret += sbr_process_channel(sbr, right_chan, X, 1, dont_process, downSampledSBR); + sbr_process_channel(sbr, right_chan, X, 1, dont_process, downSampledSBR); /* subband synthesis */ if (downSampledSBR) { @@ -561,7 +483,7 @@ sbr->just_seeked = 0; } - sbr->ret += sbr_process_channel(sbr, channel, X, 0, dont_process, downSampledSBR); + sbr_process_channel(sbr, channel, X, 0, dont_process, downSampledSBR); /* subband synthesis */ if (downSampledSBR) { @@ -636,7 +558,7 @@ sbr->qmfs[1] = qmfs_init((downSampledSBR)?32:64); } - sbr->ret += sbr_process_channel(sbr, left_channel, X_left, 0, dont_process, downSampledSBR); + sbr_process_channel(sbr, left_channel, X_left, 0, dont_process, downSampledSBR); /* copy some extra data for PS */ for (l = 32; l < 38; l++) @@ -652,7 +574,7 @@ #ifdef DRM_PS if (sbr->Is_DRM_SBR) { - drm_ps_decode(sbr->drm_ps, (sbr->ret > 0), X_left, X_right); + drm_ps_decode(sbr->drm_ps, (sbr->ret > 0), sbr->sample_rate, X_left, X_right); } else { #endif #ifdef PS_DEC --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_dec.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_dec.h @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_dec.h,v 1.36 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_dec.h,v 1.35 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_DEC_H__ @@ -236,7 +231,6 @@ #endif ); void sbrDecodeEnd(sbr_info *sbr); -void sbrReset(sbr_info *sbr); uint8_t sbrDecodeCoupleFrame(sbr_info *sbr, real_t *left_chan, real_t *right_chan, const uint8_t just_seeked, const uint8_t downSampledSBR); --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_e_nf.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_e_nf.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_e_nf.c,v 1.18 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_e_nf.c,v 1.17 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_e_nf.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_e_nf.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_e_nf.h,v 1.15 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_e_nf.h,v 1.14 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_E_NF_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_fbt.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_fbt.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_fbt.c,v 1.18 2005/02/01 13:28:56 menno Exp $ +** $Id: sbr_fbt.c,v 1.17 2004/09/08 09:43:11 gcp Exp $ **/ /* Calculate frequency band tables */ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_fbt.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_fbt.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_fbt.h,v 1.15 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_fbt.h,v 1.14 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_FBT_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_hfadj.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_hfadj.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_hfadj.c,v 1.19 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_hfadj.c,v 1.18 2004/09/04 14:56:28 menno Exp $ **/ /* High Frequency adjustment */ @@ -44,8 +39,8 @@ /* static function declarations */ -static uint8_t estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj, - qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch); +static void estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj, + qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch); static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch); #ifdef SBR_LOW_POWER static void calc_gain_groups(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch); @@ -54,14 +49,13 @@ static void hf_assembly(sbr_info *sbr, sbr_hfadj_info *adj, qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch); -uint8_t hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64] +void hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64] #ifdef SBR_LOW_POWER - ,real_t *deg /* aliasing degree */ + ,real_t *deg /* aliasing degree */ #endif - ,uint8_t ch) + ,uint8_t ch) { ALIGN sbr_hfadj_info adj = {{{0}}}; - uint8_t ret = 0; if (sbr->bs_frame_class[ch] == FIXFIX) { @@ -78,9 +72,7 @@ sbr->l_A[ch] = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch]; } - ret = estimate_current_envelope(sbr, &adj, Xsbr, ch); - if (ret > 0) - return 1; + estimate_current_envelope(sbr, &adj, Xsbr, ch); calculate_gain(sbr, &adj, ch); @@ -90,8 +82,6 @@ #endif hf_assembly(sbr, &adj, Xsbr, ch); - - return 0; } static uint8_t get_S_mapped(sbr_info *sbr, uint8_t ch, uint8_t l, uint8_t current_band) @@ -135,8 +125,8 @@ return 0; } -static uint8_t estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj, - qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch) +static void estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj, + qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch) { uint8_t m, l, j, k, k_l, k_h, p; real_t nrg, div; @@ -152,9 +142,6 @@ div = (real_t)(u_i - l_i); - if (div == 0) - div = 1; - for (m = 0; m < sbr->M; m++) { nrg = 0; @@ -205,9 +192,6 @@ div = (real_t)((u_i - l_i)*(k_h - k_l)); - if (div == 0) - div = 1; - for (i = l_i + sbr->tHFAdj; i < u_i + sbr->tHFAdj; i++) { for (j = k_l; j < k_h; j++) @@ -241,8 +225,6 @@ } } } - - return 0; } #ifdef FIXED_POINT @@ -1360,27 +1342,15 @@ { uint8_t l, k, i; uint8_t grouping; - uint8_t S_mapped; for (l = 0; l < sbr->L_E[ch]; l++) { - uint8_t current_res_band = 0; i = 0; grouping = 0; - S_mapped = get_S_mapped(sbr, ch, l, current_res_band); - for (k = sbr->kx; k < sbr->kx + sbr->M - 1; k++) { - if (k == sbr->f_table_res[sbr->f[ch][l]][current_res_band+1]) - { - /* step to next resolution band */ - current_res_band++; - - S_mapped = get_S_mapped(sbr, ch, l, current_res_band); - } - - if (deg[k + 1] && S_mapped == 0) + if (deg[k + 1] && adj->S_mapped[l][k-sbr->kx] == 0) { if (grouping == 0) { @@ -1391,7 +1361,7 @@ } else { if (grouping) { - if (S_mapped) + if (adj->S_mapped[l][k-sbr->kx]) { sbr->f_group[l][i] = k; } else { --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_hfadj.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_hfadj.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_hfadj.h,v 1.16 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_hfadj.h,v 1.15 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_HFADJ_H__ @@ -45,11 +40,11 @@ } sbr_hfadj_info; -uint8_t hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64] +void hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64] #ifdef SBR_LOW_POWER - ,real_t *deg + ,real_t *deg #endif - ,uint8_t ch); + ,uint8_t ch); #ifdef __cplusplus --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_hfgen.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_hfgen.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_hfgen.c,v 1.23 2005/02/01 13:28:56 menno Exp $ +** $Id: sbr_hfgen.c,v 1.22 2004/09/08 09:43:11 gcp Exp $ **/ /* High Frequency generation */ @@ -41,6 +36,7 @@ #include "sbr_hfgen.h" #include "sbr_fbt.h" + /* static function declarations */ #ifdef SBR_LOW_POWER static void calc_prediction_coef_lp(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64], --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_hfgen.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_hfgen.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_hfgen.h,v 1.17 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_hfgen.h,v 1.16 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_HFGEN_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_huff.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_huff.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_huff.c,v 1.18 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_huff.c,v 1.17 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_huff.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_huff.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_huff.h,v 1.18 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_huff.h,v 1.17 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_HUFF_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_noise.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_noise.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_noise.h,v 1.14 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_noise.h,v 1.13 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_NOISE_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_qmf.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_qmf.c @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_qmf.c,v 1.28 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_qmf.c,v 1.27 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" @@ -77,7 +72,7 @@ #else ALIGN real_t y[32]; #endif - uint32_t in = 0; + uint16_t in = 0; uint8_t l; /* qmf subsample l */ @@ -256,7 +251,7 @@ { ALIGN real_t x[16]; ALIGN real_t y[16]; - int32_t n, k, out = 0; + int16_t n, k, out = 0; uint8_t l; /* qmf subsample l */ @@ -325,7 +320,7 @@ { ALIGN real_t x[64]; ALIGN real_t y[64]; - int32_t n, k, out = 0; + int16_t n, k, out = 0; uint8_t l; @@ -397,7 +392,7 @@ #ifndef FIXED_POINT real_t scale = 1.f/64.f; #endif - int32_t n, k, out = 0; + int16_t n, k, out = 0; uint8_t l; @@ -480,7 +475,7 @@ #ifndef FIXED_POINT real_t scale = 1.f/64.f; #endif - int32_t n, k, out = 0; + int16_t n, k, out = 0; uint8_t l; --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_qmf.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_qmf.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_qmf.h,v 1.22 2005/02/01 13:28:56 menno Exp $ +** $Id: sbr_qmf.h,v 1.21 2004/09/08 09:43:11 gcp Exp $ **/ #ifndef __SBR_QMF_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_qmf_c.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_qmf_c.h @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_qmf_c.h,v 1.14 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_qmf_c.h,v 1.13 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_QMF_C_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_syntax.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_syntax.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_syntax.c,v 1.35 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_syntax.c,v 1.34 2004/09/04 14:56:28 menno Exp $ **/ #include "common.h" @@ -211,28 +206,26 @@ { calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq, saved_samplerate_mode, saved_freq_scale, - saved_alter_scale, saved_xover_band); + saved_alter_scale, saved_xover_band); } - /* we should be able to safely set result to 0 now, */ - /* but practise indicates this doesn't work well */ + /* we should be able to safely set result to 0 now */ + result = 0; } } else { result = 1; - } - - - num_sbr_bits = (uint16_t)faad_get_processed_bits(ld) - num_sbr_bits; - - /* check if we read more bits then were available for sbr */ - if (8*cnt < num_sbr_bits) { - return 1; } #ifdef DRM if (!sbr->Is_DRM_SBR) #endif - { + { + num_sbr_bits = (uint16_t)faad_get_processed_bits(ld) - num_sbr_bits; + + /* check if we read more bits then were available for sbr */ + if (8*cnt < num_sbr_bits) + return 1; + /* -4 does not apply, bs_extension_type is re-read in this function */ num_align_bits = 8*cnt /*- 4*/ - num_sbr_bits; @@ -371,14 +364,11 @@ #ifdef DRM /* bs_coupling, from sbr_channel_pair_base_element(bs_amp_res) */ if (sbr->Is_DRM_SBR) - { faad_get1bit(ld); - } #endif if ((result = sbr_grid(ld, sbr, 0)) > 0) return result; - sbr_dtdf(ld, sbr, 0); invf_mode(ld, sbr, 0); sbr_envelope(ld, sbr, 0); @@ -441,11 +431,7 @@ } else { /* to be safe make it 3, will switch to "default" * in sbr_extension() */ -#ifdef DRM - return 1; -#else sbr->bs_extension_id = 3; -#endif } } #endif --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_syntax.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_syntax.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_syntax.h,v 1.20 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_syntax.h,v 1.19 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_SYNTAX_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_tf_grid.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_tf_grid.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_tf_grid.c,v 1.16 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_tf_grid.c,v 1.15 2004/09/04 14:56:28 menno Exp $ **/ /* Time/Frequency grid */ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sbr_tf_grid.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sbr_tf_grid.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sbr_tf_grid.h,v 1.14 2005/02/01 13:15:59 menno Exp $ +** $Id: sbr_tf_grid.h,v 1.13 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SBR_TF_GRID_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/sine_win.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/sine_win.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: sine_win.h,v 1.16 2005/02/01 13:15:59 menno Exp $ +** $Id: sine_win.h,v 1.15 2004/09/04 14:56:28 menno Exp $ **/ #ifndef __SINE_WIN_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/specrec.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/specrec.c @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: specrec.c,v 1.57 2005/02/01 13:28:56 menno Exp $ +** $Id: specrec.c,v 1.56 2004/09/08 09:43:11 gcp Exp $ **/ /* @@ -60,7 +55,7 @@ /* static function declarations */ -static uint8_t quant_to_spec(NeAACDecHandle hDecoder, +static uint8_t quant_to_spec(faacDecHandle hDecoder, ic_stream *ics, int16_t *quant_data, real_t *spec_data, uint16_t frame_len); @@ -302,7 +297,7 @@ in section named section. This offset depends on window_sequence and scale_factor_grouping and is needed to decode the spectral_data(). */ -uint8_t window_grouping_info(NeAACDecHandle hDecoder, ic_stream *ics) +uint8_t window_grouping_info(faacDecHandle hDecoder, ic_stream *ics) { uint8_t i, g; @@ -332,11 +327,6 @@ } #endif - if (ics->max_sfb > ics->num_swb) - { - return 32; - } - /* preparation of sect_sfb_offset for long blocks */ /* also copy the last value! */ #ifdef LD_DEC @@ -377,11 +367,6 @@ ics->window_group_length[ics->num_window_groups-1] = 1; ics->num_swb = num_swb_128_window[sf_index]; - if (ics->max_sfb > ics->num_swb) - { - return 32; - } - for (i = 0; i < ics->num_swb; i++) ics->swb_offset[i] = swb_offset_128_window[sf_index][i]; ics->swb_offset[ics->num_swb] = hDecoder->frameLength/8; @@ -420,7 +405,7 @@ } return 0; default: - return 32; + return 1; } } @@ -545,7 +530,7 @@ - Within a scalefactor window band, the coefficients are in ascending spectral order. */ -static uint8_t quant_to_spec(NeAACDecHandle hDecoder, +static uint8_t quant_to_spec(faacDecHandle hDecoder, ic_stream *ics, int16_t *quant_data, real_t *spec_data, uint16_t frame_len) { @@ -679,7 +664,7 @@ return error; } -static uint8_t allocate_single_channel(NeAACDecHandle hDecoder, uint8_t channel, +static uint8_t allocate_single_channel(faacDecHandle hDecoder, uint8_t channel, uint8_t output_channels) { uint8_t mul = 1; @@ -689,14 +674,11 @@ if (hDecoder->object_type == MAIN) { /* allocate the state only when needed */ - if (hDecoder->pred_stat[channel] != NULL) + if (hDecoder->pred_stat[channel] == NULL) { - faad_free(hDecoder->pred_stat[channel]); - hDecoder->pred_stat[channel] = NULL; + hDecoder->pred_stat[channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state)); + reset_all_predictors(hDecoder->pred_stat[channel], hDecoder->frameLength); } - - hDecoder->pred_stat[channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state)); - reset_all_predictors(hDecoder->pred_stat[channel], hDecoder->frameLength); } #endif @@ -704,23 +686,15 @@ if (is_ltp_ot(hDecoder->object_type)) { /* allocate the state only when needed */ - if (hDecoder->lt_pred_stat[channel] != NULL) + if (hDecoder->lt_pred_stat[channel] == NULL) { - faad_free(hDecoder->lt_pred_stat[channel]); - hDecoder->lt_pred_stat[channel] = NULL; + hDecoder->lt_pred_stat[channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t)); + memset(hDecoder->lt_pred_stat[channel], 0, hDecoder->frameLength*4 * sizeof(int16_t)); } - - hDecoder->lt_pred_stat[channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t)); - memset(hDecoder->lt_pred_stat[channel], 0, hDecoder->frameLength*4 * sizeof(int16_t)); } #endif - if (hDecoder->time_out[channel] != NULL) - { - faad_free(hDecoder->time_out[channel]); - hDecoder->time_out[channel] = NULL; - } - + if (hDecoder->time_out[channel] == NULL) { mul = 1; #ifdef SBR_DEC @@ -735,30 +709,23 @@ hDecoder->time_out[channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t)); memset(hDecoder->time_out[channel], 0, mul*hDecoder->frameLength*sizeof(real_t)); } - #if (defined(PS_DEC) || defined(DRM_PS)) if (output_channels == 2) { - if (hDecoder->time_out[channel+1] != NULL) + if (hDecoder->time_out[channel+1] == NULL) { - faad_free(hDecoder->time_out[channel+1]); - hDecoder->time_out[channel+1] = NULL; + hDecoder->time_out[channel+1] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t)); + memset(hDecoder->time_out[channel+1], 0, mul*hDecoder->frameLength*sizeof(real_t)); } - - hDecoder->time_out[channel+1] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t)); - memset(hDecoder->time_out[channel+1], 0, mul*hDecoder->frameLength*sizeof(real_t)); } #endif - if (hDecoder->fb_intermed[channel] != NULL) + if (hDecoder->fb_intermed[channel] == NULL) { - faad_free(hDecoder->fb_intermed[channel]); - hDecoder->fb_intermed[channel] = NULL; + hDecoder->fb_intermed[channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t)); + memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t)); } - hDecoder->fb_intermed[channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t)); - memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t)); - #ifdef SSR_DEC if (hDecoder->object_type == SSR) { @@ -780,7 +747,7 @@ return 0; } -static uint8_t allocate_channel_pair(NeAACDecHandle hDecoder, +static uint8_t allocate_channel_pair(faacDecHandle hDecoder, uint8_t channel, uint8_t paired_channel) { uint8_t mul = 1; @@ -885,7 +852,7 @@ return 0; } -uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics, +uint8_t reconstruct_single_channel(faacDecHandle hDecoder, ic_stream *ics, element *sce, int16_t *spec_data) { uint8_t retval, output_channels; @@ -897,13 +864,10 @@ /* always allocate 2 channels, PS can always "suddenly" turn up */ -#if ( (defined(DRM) && defined(DRM_PS)) ) +#if (defined(PS_DEC) || defined(DRM_PS)) output_channels = 2; -#elif defined(PS_DEC) - if (hDecoder->ps_used[hDecoder->fr_ch_ele]) - output_channels = 2; - else - output_channels = 1; +#else + output_channels = 1; #endif if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0) @@ -912,17 +876,7 @@ hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels; } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != output_channels) { /* element inconsistency */ - - /* this only happens if PS is actually found but not in the first frame - * this means that there is only 1 bitstream element! - */ - - /* reset the allocation */ - hDecoder->element_alloced[hDecoder->fr_ch_ele] = 0; - - hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels; - - //return 21; + return 21; } if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0) @@ -1076,8 +1030,7 @@ /* copy L to R when no PS is used */ #if (defined(PS_DEC) || defined(DRM_PS)) - if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0) && - (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2)) + if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0)) { uint8_t ele = hDecoder->fr_ch_ele; uint8_t ch = sce->channel; @@ -1091,7 +1044,7 @@ return 0; } -uint8_t reconstruct_channel_pair(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2, +uint8_t reconstruct_channel_pair(faacDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2, element *cpe, int16_t *spec_data1, int16_t *spec_data2) { uint8_t retval; --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/specrec.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/specrec.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: specrec.h,v 1.29 2005/02/01 13:15:59 menno Exp $ +** $Id: specrec.h,v 1.28 2004/09/04 14:56:29 menno Exp $ **/ #ifndef __SPECREC_H__ @@ -39,10 +34,10 @@ #include "syntax.h" -uint8_t window_grouping_info(NeAACDecHandle hDecoder, ic_stream *ics); -uint8_t reconstruct_channel_pair(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2, +uint8_t window_grouping_info(faacDecHandle hDecoder, ic_stream *ics); +uint8_t reconstruct_channel_pair(faacDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2, element *cpe, int16_t *spec_data1, int16_t *spec_data2); -uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics, element *sce, +uint8_t reconstruct_single_channel(faacDecHandle hDecoder, ic_stream *ics, element *sce, int16_t *spec_data); #ifdef __cplusplus --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ssr.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/ssr.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ssr.c,v 1.16 2005/02/01 13:15:59 menno Exp $ +** $Id: ssr.c,v 1.15 2004/09/04 14:56:29 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ssr.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/ssr.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ssr.h,v 1.16 2005/02/01 13:15:59 menno Exp $ +** $Id: ssr.h,v 1.15 2004/09/04 14:56:29 menno Exp $ **/ #ifndef __SSR_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ssr_fb.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/ssr_fb.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ssr_fb.c,v 1.14 2005/02/01 13:15:59 menno Exp $ +** $Id: ssr_fb.c,v 1.13 2004/09/04 14:56:29 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ssr_fb.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/ssr_fb.h @@ -1,6 +1,6 @@ /* -** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** FAAD - Freeware Advanced Audio Decoder +** Copyright (C) 2002 M. Bakker ** ** 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 @@ -16,18 +16,7 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** -** Any non-GPL usage of this software or parts of this software is strictly -** forbidden. -** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** -** Commercial non-GPL licensing of this software is possible. -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. -** -** $Id: ssr_fb.h,v 1.14 2005/02/01 13:15:59 menno Exp $ +** $Id: ssr_fb.h,v 1.13 2004/09/04 14:56:29 menno Exp $ **/ #ifndef __SSR_FB_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ssr_ipqf.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/ssr_ipqf.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: ssr_ipqf.c,v 1.15 2005/02/01 13:15:59 menno Exp $ +** $Id: ssr_ipqf.c,v 1.14 2004/09/04 14:56:29 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ssr_ipqf.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/ssr_ipqf.h @@ -1,6 +1,6 @@ /* -** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** FAAD - Freeware Advanced Audio Decoder +** Copyright (C) 2002 M. Bakker ** ** 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 @@ -16,18 +16,7 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** -** Any non-GPL usage of this software or parts of this software is strictly -** forbidden. -** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** -** Commercial non-GPL licensing of this software is possible. -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. -** -** $Id: ssr_ipqf.h,v 1.15 2005/02/01 13:15:59 menno Exp $ +** $Id: ssr_ipqf.h,v 1.14 2004/09/04 14:56:29 menno Exp $ **/ #ifndef __SSR_IPQF_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/ssr_win.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/ssr_win.h @@ -1,6 +1,6 @@ /* -** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** FAAD - Freeware Advanced Audio Decoder +** Copyright (C) 2002 M. Bakker ** ** 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 @@ -16,18 +16,7 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** -** Any non-GPL usage of this software or parts of this software is strictly -** forbidden. -** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** -** Commercial non-GPL licensing of this software is possible. -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. -** -** $Id: ssr_win.h,v 1.14 2005/02/01 13:15:59 menno Exp $ +** $Id: ssr_win.h,v 1.13 2004/09/04 14:56:29 menno Exp $ **/ #ifndef __SSR_WIN_H__ --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/structs.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/structs.h @@ -1,33 +1,28 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com -** +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: structs.h,v 1.43 2005/02/01 13:28:56 menno Exp $ +** $Id: structs.h,v 1.42 2004/09/08 09:43:11 gcp Exp $ **/ #ifndef __STRUCTS_H__ @@ -266,7 +261,6 @@ uint8_t ms_used[MAX_WINDOW_GROUPS][MAX_SFB]; uint8_t noise_used; - uint8_t is_used; uint8_t pulse_data_present; uint8_t tns_data_present; @@ -336,7 +330,7 @@ /*uint8_t*/ char downSampledSBR; } mp4AudioSpecificConfig; -typedef struct NeAACDecConfiguration +typedef struct faacDecConfiguration { /*uint8_t*/ unsigned char defObjectType; /*uint32_t*/ unsigned long defSampleRate; @@ -344,9 +338,9 @@ /*uint8_t*/ unsigned char downMatrix; /*uint8_t*/ unsigned char useOldADTSFormat; /*uint8_t*/ unsigned char dontUpSampleImplicitSBR; -} NeAACDecConfiguration, *NeAACDecConfigurationPtr; +} faacDecConfiguration, *faacDecConfigurationPtr; -typedef struct NeAACDecFrameInfo +typedef struct faacDecFrameInfo { /*uint32_t*/ unsigned long bytesconsumed; /*uint32_t*/ unsigned long samples; @@ -372,7 +366,7 @@ /* PS: 0: off, 1: on */ /*uint8_t*/ unsigned char ps; -} NeAACDecFrameInfo; +} faacDecFrameInfo; typedef struct { @@ -453,10 +447,6 @@ int16_t *lt_pred_stat[MAX_CHANNELS]; #endif -#ifdef DRM - uint8_t error_state; -#endif - /* Program Config Element */ uint8_t pce_set; program_config pce; @@ -464,7 +454,7 @@ uint8_t internal_channel[MAX_CHANNELS]; /* Configuration data */ - NeAACDecConfiguration config; + faacDecConfiguration config; #ifdef PROFILE int64_t cycles; @@ -473,7 +463,7 @@ int64_t scalefac_cycles; int64_t requant_cycles; #endif -} NeAACDecStruct, *NeAACDecHandle; +} faacDecStruct, *faacDecHandle; --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/syntax.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/syntax.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: syntax.c,v 1.83 2005/02/01 13:15:59 menno Exp $ +** $Id: syntax.c,v 1.82 2004/09/04 14:56:29 menno Exp $ **/ /* @@ -57,52 +52,50 @@ /* static function declarations */ -static void decode_sce_lfe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld, +static void decode_sce_lfe(faacDecHandle hDecoder, faacDecFrameInfo *hInfo, bitfile *ld, uint8_t id_syn_ele); -static void decode_cpe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld, +static void decode_cpe(faacDecHandle hDecoder, faacDecFrameInfo *hInfo, bitfile *ld, uint8_t id_syn_ele); -static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld, +static uint8_t single_lfe_channel_element(faacDecHandle hDecoder, bitfile *ld, uint8_t channel, uint8_t *tag); -static uint8_t channel_pair_element(NeAACDecHandle hDecoder, bitfile *ld, +static uint8_t channel_pair_element(faacDecHandle hDecoder, bitfile *ld, uint8_t channel, uint8_t *tag); #ifdef COUPLING_DEC -static uint8_t coupling_channel_element(NeAACDecHandle hDecoder, bitfile *ld); +static uint8_t coupling_channel_element(faacDecHandle hDecoder, bitfile *ld); #endif -static uint16_t data_stream_element(NeAACDecHandle hDecoder, bitfile *ld); +static uint16_t data_stream_element(faacDecHandle hDecoder, bitfile *ld); static uint8_t program_config_element(program_config *pce, bitfile *ld); -static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc +static uint8_t fill_element(faacDecHandle hDecoder, bitfile *ld, drc_info *drc #ifdef SBR_DEC ,uint8_t sbr_ele #endif ); -static uint8_t individual_channel_stream(NeAACDecHandle hDecoder, element *ele, +static uint8_t individual_channel_stream(faacDecHandle hDecoder, element *ele, bitfile *ld, ic_stream *ics, uint8_t scal_flag, int16_t *spec_data); -static uint8_t ics_info(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld, +static uint8_t ics_info(faacDecHandle hDecoder, ic_stream *ics, bitfile *ld, uint8_t common_window); -static uint8_t section_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld); -static uint8_t scale_factor_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld); +static uint8_t section_data(faacDecHandle hDecoder, ic_stream *ics, bitfile *ld); +static uint8_t scale_factor_data(faacDecHandle hDecoder, ic_stream *ics, bitfile *ld); #ifdef SSR_DEC static void gain_control_data(bitfile *ld, ic_stream *ics); #endif -static uint8_t spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld, +static uint8_t spectral_data(faacDecHandle hDecoder, ic_stream *ics, bitfile *ld, int16_t *spectral_data); static uint16_t extension_payload(bitfile *ld, drc_info *drc, uint16_t count); static uint8_t pulse_data(ic_stream *ics, pulse_info *pul, bitfile *ld); static void tns_data(ic_stream *ics, tns_info *tns, bitfile *ld); #ifdef LTP_DEC -static uint8_t ltp_data(NeAACDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld); +static uint8_t ltp_data(faacDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld); #endif static uint8_t adts_fixed_header(adts_header *adts, bitfile *ld); static void adts_variable_header(adts_header *adts, bitfile *ld); static void adts_error_check(adts_header *adts, bitfile *ld); static uint8_t dynamic_range_info(bitfile *ld, drc_info *drc); static uint8_t excluded_channels(bitfile *ld, drc_info *drc); -static uint8_t side_info(NeAACDecHandle hDecoder, element *ele, - bitfile *ld, ic_stream *ics, uint8_t scal_flag); -#ifdef DRM -static int8_t DRM_aac_scalable_main_header(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2, - bitfile *ld, uint8_t this_layer_stereo); +#ifdef SCALABLE_DEC +static int8_t aac_scalable_main_header(faacDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2, + bitfile *ld, uint8_t this_layer_stereo); #endif @@ -323,8 +316,8 @@ return 0; } -static void decode_sce_lfe(NeAACDecHandle hDecoder, - NeAACDecFrameInfo *hInfo, bitfile *ld, +static void decode_sce_lfe(faacDecHandle hDecoder, + faacDecFrameInfo *hInfo, bitfile *ld, uint8_t id_syn_ele) { uint8_t channels = hDecoder->fr_channels; @@ -368,7 +361,7 @@ hDecoder->fr_ch_ele++; } -static void decode_cpe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld, +static void decode_cpe(faacDecHandle hDecoder, faacDecFrameInfo *hInfo, bitfile *ld, uint8_t id_syn_ele) { uint8_t channels = hDecoder->fr_channels; @@ -416,11 +409,10 @@ hDecoder->fr_ch_ele++; } -void raw_data_block(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, +void raw_data_block(faacDecHandle hDecoder, faacDecFrameInfo *hInfo, bitfile *ld, program_config *pce, drc_info *drc) { uint8_t id_syn_ele; - uint8_t ele_this_frame = 0; hDecoder->fr_channels = 0; hDecoder->fr_ch_ele = 0; @@ -433,59 +425,40 @@ #endif /* Table 4.4.3: raw_data_block() */ while ((id_syn_ele = (uint8_t)faad_getbits(ld, LEN_SE_ID - DEBUGVAR(1,4,"NeAACDecDecode(): id_syn_ele"))) != ID_END) + DEBUGVAR(1,4,"faacDecDecode(): id_syn_ele"))) != ID_END) { switch (id_syn_ele) { case ID_SCE: - ele_this_frame++; if (hDecoder->first_syn_ele == 25) hDecoder->first_syn_ele = id_syn_ele; decode_sce_lfe(hDecoder, hInfo, ld, id_syn_ele); if (hInfo->error > 0) return; break; case ID_CPE: - ele_this_frame++; if (hDecoder->first_syn_ele == 25) hDecoder->first_syn_ele = id_syn_ele; decode_cpe(hDecoder, hInfo, ld, id_syn_ele); if (hInfo->error > 0) return; break; case ID_LFE: -#ifdef DRM - hInfo->error = 32; -#else - ele_this_frame++; hDecoder->has_lfe++; decode_sce_lfe(hDecoder, hInfo, ld, id_syn_ele); -#endif if (hInfo->error > 0) return; break; case ID_CCE: /* not implemented yet, but skip the bits */ -#ifdef DRM - hInfo->error = 32; -#else - ele_this_frame++; #ifdef COUPLING_DEC hInfo->error = coupling_channel_element(hDecoder, ld); #else hInfo->error = 6; #endif -#endif if (hInfo->error > 0) return; break; case ID_DSE: - ele_this_frame++; data_stream_element(hDecoder, ld); break; case ID_PCE: - if (ele_this_frame != 0) - { - hInfo->error = 31; - return; - } - ele_this_frame++; /* 14496-4: 5.6.4.1.2.1.3: */ /* program_configuration_element()'s in access units shall be ignored */ program_config_element(pce, ld); @@ -494,7 +467,6 @@ //hDecoder->pce_set = 1; break; case ID_FIL: - ele_this_frame++; /* one sbr_info describes a channel_element not a channel! */ /* if we encounter SBR data here: error */ /* SBR data will be read directly in the SCE/LFE/CPE element */ @@ -586,7 +558,7 @@ /* Table 4.4.4 and */ /* Table 4.4.9 */ -static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld, +static uint8_t single_lfe_channel_element(faacDecHandle hDecoder, bitfile *ld, uint8_t channel, uint8_t *tag) { uint8_t retval = 0; @@ -605,10 +577,6 @@ if (retval > 0) return retval; - /* IS not allowed in single channel */ - if (ics->is_used) - return 32; - #ifdef SBR_DEC /* check if next bitstream element is a fill element */ /* if so, read it now so SBR decoding can be done in case of a file with SBR */ @@ -633,7 +601,7 @@ } /* Table 4.4.5 */ -static uint8_t channel_pair_element(NeAACDecHandle hDecoder, bitfile *ld, +static uint8_t channel_pair_element(faacDecHandle hDecoder, bitfile *ld, uint8_t channels, uint8_t *tag) { ALIGN int16_t spec_data1[1024] = {0}; @@ -659,11 +627,6 @@ ics1->ms_mask_present = (uint8_t)faad_getbits(ld, 2 DEBUGVAR(1,41,"channel_pair_element(): ms_mask_present")); - if (ics1->ms_mask_present == 3) - { - /* bitstream error */ - return 32; - } if (ics1->ms_mask_present == 1) { uint8_t g, sfb; @@ -763,27 +726,18 @@ } /* Table 4.4.6 */ -static uint8_t ics_info(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld, +static uint8_t ics_info(faacDecHandle hDecoder, ic_stream *ics, bitfile *ld, uint8_t common_window) { uint8_t retval = 0; - uint8_t ics_reserved_bit; - ics_reserved_bit = faad_get1bit(ld + /* ics->ics_reserved_bit = */ faad_get1bit(ld DEBUGVAR(1,43,"ics_info(): ics_reserved_bit")); - if (ics_reserved_bit != 0) - return 32; ics->window_sequence = (uint8_t)faad_getbits(ld, 2 DEBUGVAR(1,44,"ics_info(): window_sequence")); ics->window_shape = faad_get1bit(ld DEBUGVAR(1,45,"ics_info(): window_shape")); -#ifdef LD_DEC - /* No block switching in LD */ - if ((hDecoder->object_type == LD) && (ics->window_sequence != ONLY_LONG_SEQUENCE)) - return 32; -#endif - if (ics->window_sequence == EIGHT_SHORT_SEQUENCE) { ics->max_sfb = (uint8_t)faad_getbits(ld, 4 @@ -799,7 +753,6 @@ if ((retval = window_grouping_info(hDecoder, ics)) > 0) return retval; - /* should be an error */ /* check the range of max_sfb */ if (ics->max_sfb > ics->num_swb) @@ -914,7 +867,7 @@ #ifdef COUPLING_DEC /* Table 4.4.8: Currently just for skipping the bits... */ -static uint8_t coupling_channel_element(NeAACDecHandle hDecoder, bitfile *ld) +static uint8_t coupling_channel_element(faacDecHandle hDecoder, bitfile *ld) { uint8_t c, result = 0; uint8_t ind_sw_cce_flag = 0; @@ -969,10 +922,6 @@ return result; } - /* IS not allowed in single channel */ - if (ics->is_used) - return 32; - for (c = 1; c < num_gain_element_lists; c++) { uint8_t cge; @@ -1007,7 +956,7 @@ #endif /* Table 4.4.10 */ -static uint16_t data_stream_element(NeAACDecHandle hDecoder, bitfile *ld) +static uint16_t data_stream_element(faacDecHandle hDecoder, bitfile *ld) { uint8_t byte_aligned; uint16_t i, count; @@ -1036,7 +985,7 @@ } /* Table 4.4.11 */ -static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc +static uint8_t fill_element(faacDecHandle hDecoder, bitfile *ld, drc_info *drc #ifdef SBR_DEC ,uint8_t sbr_ele #endif @@ -1085,7 +1034,7 @@ #if 0 if (hDecoder->sbr[sbr_ele]->ret > 0) { - printf("%s\n", NeAACDecGetErrorMessage(hDecoder->sbr[sbr_ele]->ret)); + printf("%s\n", faacDecGetErrorMessage(hDecoder->sbr[sbr_ele]->ret)); } #endif @@ -1100,14 +1049,10 @@ #endif } else { #endif -#ifndef DRM while (count > 0) { count -= extension_payload(ld, drc, count); } -#else - return 30; -#endif #ifdef SBR_DEC } #endif @@ -1212,10 +1157,10 @@ } #endif -#ifdef DRM +#ifdef SCALABLE_DEC /* Table 4.4.13 ASME */ -void DRM_aac_scalable_main_element(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, - bitfile *ld, program_config *pce, drc_info *drc) +void aac_scalable_main_element(faacDecHandle hDecoder, faacDecFrameInfo *hInfo, + bitfile *ld, program_config *pce, drc_info *drc) { uint8_t retval = 0; uint8_t channels = hDecoder->fr_channels = 0; @@ -1230,7 +1175,7 @@ hDecoder->fr_ch_ele = 0; - hInfo->error = DRM_aac_scalable_main_header(hDecoder, ics1, ics2, ld, this_layer_stereo); + hInfo->error = aac_scalable_main_header(hDecoder, ics1, ics2, ld, this_layer_stereo); if (hInfo->error > 0) return; @@ -1244,77 +1189,22 @@ hDecoder->element_id[0] = ID_SCE; } - if (this_layer_stereo) + for (ch = 0; ch < (this_layer_stereo ? 2 : 1); ch++) { - cpe.channel = 0; - cpe.paired_channel = 1; - } - - - /* Stereo2 / Mono1 */ - ics1->tns_data_present = faad_get1bit(ld); - -#if defined(LTP_DEC) - ics1->ltp.data_present = faad_get1bit(ld); -#elif defined (DRM) - if(faad_get1bit(ld)) { - hInfo->error = 26; - return; - } -#else - faad_get1bit(ld); -#endif + ic_stream *ics; + if (ch == 0) + { + ics = ics1; + spec_data = spec_data1; + } else { + ics = ics2; + spec_data = spec_data2; + } - hInfo->error = side_info(hDecoder, &cpe, ld, ics1, 1); - if (hInfo->error > 0) - return; - if (this_layer_stereo) - { - /* Stereo3 */ - ics2->tns_data_present = faad_get1bit(ld); -#ifdef LTP_DEC - ics1->ltp.data_present = -#endif - faad_get1bit(ld); - hInfo->error = side_info(hDecoder, &cpe, ld, ics2, 1); + hInfo->error = individual_channel_stream(hDecoder, &cpe, ld, ics, 1, spec_data); if (hInfo->error > 0) return; } - /* Stereo4 / Mono2 */ - if (ics1->tns_data_present) - tns_data(ics1, &(ics1->tns), ld); - if (this_layer_stereo) - { - /* Stereo5 */ - if (ics2->tns_data_present) - tns_data(ics2, &(ics2->tns), ld); - } - -#ifdef DRM - /* CRC check */ - if (hDecoder->object_type == DRM_ER_LC) - { - if ((hInfo->error = (uint8_t)faad_check_CRC(ld, (uint16_t)faad_get_processed_bits(ld) - 8)) > 0) - return; - } -#endif - - /* Stereo6 / Mono3 */ - /* error resilient spectral data decoding */ - if ((hInfo->error = reordered_spectral_data(hDecoder, ics1, ld, spec_data1)) > 0) - { - return; - } - if (this_layer_stereo) - { - /* Stereo7 */ - /* error resilient spectral data decoding */ - if ((hInfo->error = reordered_spectral_data(hDecoder, ics2, ld, spec_data2)) > 0) - { - return; - } - } - #ifdef DRM #ifdef SBR_DEC @@ -1354,7 +1244,6 @@ /* Set SBR data */ /* consider 8 bits from AAC-CRC */ - /* SBR buffer size is original buffer size minus AAC buffer size */ count = (uint16_t)bit2byte(buffer_size*8 - bitsconsumed); faad_initbits(&ld_sbr, revbuffer, count); @@ -1372,11 +1261,6 @@ } #endif - if (ld_sbr.error) - { - hDecoder->sbr[0]->ret = 1; - } - /* check CRC */ /* no need to check it if there was already an error */ if (hDecoder->sbr[0]->ret == 0) @@ -1385,7 +1269,7 @@ /* SBR data was corrupted, disable it until the next header */ if (hDecoder->sbr[0]->ret != 0) { - hDecoder->sbr[0]->header_count = 0; + hDecoder->sbr[0]->header_count = 0; } faad_endbits(&ld_sbr); @@ -1424,18 +1308,15 @@ } /* Table 4.4.15 */ -static int8_t DRM_aac_scalable_main_header(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2, - bitfile *ld, uint8_t this_layer_stereo) +static int8_t aac_scalable_main_header(faacDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2, + bitfile *ld, uint8_t this_layer_stereo) { uint8_t retval = 0; uint8_t ch; ic_stream *ics; - uint8_t ics_reserved_bit; - ics_reserved_bit = faad_get1bit(ld + /* ics1->ics_reserved_bit = */ faad_get1bit(ld DEBUGVAR(1,300,"aac_scalable_main_header(): ics_reserved_bits")); - if (ics_reserved_bit != 0) - return 32; ics1->window_sequence = (uint8_t)faad_getbits(ld, 2 DEBUGVAR(1,301,"aac_scalable_main_header(): window_sequence")); ics1->window_shape = faad_get1bit(ld @@ -1465,11 +1346,6 @@ { ics1->ms_mask_present = (uint8_t)faad_getbits(ld, 2 DEBUGVAR(1,306,"aac_scalable_main_header(): ms_mask_present")); - if (ics1->ms_mask_present == 3) - { - /* bitstream error */ - return 32; - } if (ics1->ms_mask_present == 1) { uint8_t g, sfb; @@ -1488,12 +1364,70 @@ ics1->ms_mask_present = 0; } + if (0) + { + faad_get1bit(ld + DEBUGVAR(1,308,"aac_scalable_main_header(): tns_channel_mono_layer")); + } + + for (ch = 0; ch < (this_layer_stereo ? 2 : 1); ch++) + { + if (ch == 0) + ics = ics1; + else + ics = ics2; + + if ( 1 /*!tvq_layer_pesent || (tns_aac_tvq_en[ch] == 1)*/) + { + if ((ics->tns_data_present = faad_get1bit(ld + DEBUGVAR(1,309,"aac_scalable_main_header(): tns_data_present"))) & 1) + { +#ifdef DRM + /* different order of data units in DRM */ + if (hDecoder->object_type != DRM_ER_LC) +#endif + { + tns_data(ics, &(ics->tns), ld); + } + } + } +#if 0 + if (0 /*core_flag || tvq_layer_pesent*/) + { + if ((ch==0) || ((ch==1) && (core_stereo || tvq_stereo)) + diff_control_data(); + if (mono_stereo_flag) + diff_control_data_lr(); + } else { +#endif + if (( +#ifdef LTP_DEC + ics->ltp.data_present = +#endif + faad_get1bit(ld DEBUGVAR(1,310,"aac_scalable_main_header(): ltp.data_present"))) & 1) + { +#ifdef LTP_DEC + if ((retval = ltp_data(hDecoder, ics, &(ics->ltp), ld)) > 0) + { + return retval; + } +#else + return 26; +#endif + } +#if 0 + } +#endif + } + return 0; } #endif -static uint8_t side_info(NeAACDecHandle hDecoder, element *ele, - bitfile *ld, ic_stream *ics, uint8_t scal_flag) +/* Table 4.4.24 */ +static uint8_t individual_channel_stream(faacDecHandle hDecoder, element *ele, + bitfile *ld, ic_stream *ics, uint8_t scal_flag, + int16_t *spec_data) { uint8_t result; @@ -1579,21 +1513,6 @@ if ((result = rvlc_decode_scale_factors(ics, ld)) > 0) return result; } -#endif - - return 0; -} - -/* Table 4.4.24 */ -static uint8_t individual_channel_stream(NeAACDecHandle hDecoder, element *ele, - bitfile *ld, ic_stream *ics, uint8_t scal_flag, - int16_t *spec_data) -{ - uint8_t result; - - result = side_info(hDecoder, ele, ld, ics, scal_flag); - if (result > 0) - return result; if (hDecoder->object_type >= ER_OBJECT_START) { @@ -1604,13 +1523,10 @@ #ifdef DRM /* CRC check */ if (hDecoder->object_type == DRM_ER_LC) - { if ((result = (uint8_t)faad_check_CRC(ld, (uint16_t)faad_get_processed_bits(ld) - 8)) > 0) return result; - } #endif -#ifdef ERROR_RESILIENCE if (hDecoder->aacSpectralDataResilienceFlag) { /* error resilient spectral data decoding */ @@ -1645,7 +1561,7 @@ } /* Table 4.4.25 */ -static uint8_t section_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld) +static uint8_t section_data(faacDecHandle hDecoder, ic_stream *ics, bitfile *ld) { uint8_t g; uint8_t sect_esc_val, sect_bits; @@ -1689,23 +1605,12 @@ ics->sect_cb[g][i] = (uint8_t)faad_getbits(ld, sect_cb_bits DEBUGVAR(1,71,"section_data(): sect_cb")); - if (ics->sect_cb[g][i] == 12) - return 32; - #if 0 printf("%d\n", ics->sect_cb[g][i]); #endif -#ifndef DRM if (ics->sect_cb[g][i] == NOISE_HCB) ics->noise_used = 1; -#else - /* PNS not allowed in DRM */ - if (ics->sect_cb[g][i] == NOISE_HCB) - return 29; -#endif - if (ics->sect_cb[g][i] == INTENSITY_HCB2 || ics->sect_cb[g][i] == INTENSITY_HCB) - ics->is_used = 1; #ifdef ERROR_RESILIENCE if (hDecoder->aacSectionDataResilienceFlag) @@ -1746,18 +1651,10 @@ printf("%d\n", ics->sect_end[g][i]); #endif - if (ics->window_sequence == EIGHT_SHORT_SEQUENCE) - { - if (k + sect_len >= 8*15) - return 15; - if (i >= 8*15) - return 15; - } else { - if (k + sect_len >= MAX_SFB) - return 15; - if (i >= MAX_SFB) - return 15; - } + if (k + sect_len >= 8*15) + return 15; + if (i >= 8*15) + return 15; for (sfb = k; sfb < k + sect_len; sfb++) { @@ -1778,13 +1675,6 @@ i++; } ics->num_sec[g] = i; - - /* the sum of all sect_len_incr elements for a given window - * group shall equal max_sfb */ - if (k != ics->max_sfb) - { - return 32; - } #if 0 printf("%d\n", ics->num_sec[g]); #endif @@ -1845,7 +1735,6 @@ break; case NOISE_HCB: /* noise books */ -#ifndef DRM /* decode noise energy */ if (noise_pcm_flag) { @@ -1861,10 +1750,6 @@ #ifdef SF_PRINT printf("%d\n", ics->scale_factors[g][sfb]); #endif -#else - /* PNS not allowed in DRM */ - return 29; -#endif break; default: /* spectral books */ @@ -1892,7 +1777,7 @@ } /* Table 4.4.26 */ -static uint8_t scale_factor_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld) +static uint8_t scale_factor_data(faacDecHandle hDecoder, ic_stream *ics, bitfile *ld) { uint8_t ret = 0; #ifdef PROFILE @@ -2000,7 +1885,7 @@ #ifdef LTP_DEC /* Table 4.4.28 */ -static uint8_t ltp_data(NeAACDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld) +static uint8_t ltp_data(faacDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld) { uint8_t sfb, w; @@ -2063,7 +1948,7 @@ #endif /* Table 4.4.29 */ -static uint8_t spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld, +static uint8_t spectral_data(faacDecHandle hDecoder, ic_stream *ics, bitfile *ld, int16_t *spectral_data) { int8_t i; --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/syntax.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/syntax.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: syntax.h,v 1.55 2005/02/01 13:15:59 menno Exp $ +** $Id: syntax.h,v 1.54 2004/09/04 14:56:29 menno Exp $ **/ #ifndef __SYNTAX_H__ @@ -115,14 +110,13 @@ uint8_t adts_frame(adts_header *adts, bitfile *ld); void get_adif_header(adif_header *adif, bitfile *ld); -void raw_data_block(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, +void raw_data_block(faacDecHandle hDecoder, faacDecFrameInfo *hInfo, bitfile *ld, program_config *pce, drc_info *drc); -uint8_t reordered_spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld, +uint8_t reordered_spectral_data(faacDecHandle hDecoder, ic_stream *ics, bitfile *ld, int16_t *spectral_data); -#ifdef DRM -void DRM_aac_scalable_main_element(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, - bitfile *ld, program_config *pce, drc_info *drc); -#endif +void aac_scalable_main_element(faacDecHandle hDecoder, faacDecFrameInfo *hInfo, + bitfile *ld, program_config *pce, drc_info *drc); + #ifdef __cplusplus } --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/tns.c +++ vlc-0.8.4.debian/extras/faad2/libfaad/tns.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: tns.c,v 1.36 2005/02/01 13:16:00 menno Exp $ +** $Id: tns.c,v 1.35 2004/09/04 14:56:29 menno Exp $ **/ #include "common.h" --- vlc-0.8.4.debian.orig/extras/faad2/libfaad/tns.h +++ vlc-0.8.4.debian/extras/faad2/libfaad/tns.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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 @@ -19,15 +19,10 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** -** Software using this code must display the following message visibly in the -** software: -** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com" -** in, for example, the about-box or help/startup screen. -** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** -** $Id: tns.h,v 1.20 2005/02/01 13:16:00 menno Exp $ +** $Id: tns.h,v 1.19 2004/09/04 14:56:29 menno Exp $ **/ #ifndef __TNS_H__ --- vlc-0.8.4.debian.orig/extras/faad2/missing +++ vlc-0.8.4.debian/extras/faad2/missing @@ -1,6 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. + +scriptversion=2003-09-02.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 +# Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -38,12 +42,23 @@ configure_ac=configure.in fi +msg="missing on your system" + case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi ;; esac @@ -74,11 +89,13 @@ lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing 0.4 - GNU automake" + echo "missing $scriptversion (GNU Automake)" ;; -*) @@ -94,7 +111,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." @@ -108,7 +125,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." @@ -122,7 +139,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." @@ -146,7 +163,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." @@ -162,8 +179,8 @@ fi echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." @@ -185,7 +202,7 @@ bison|yacc) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." @@ -215,7 +232,7 @@ lex|flex) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." @@ -243,7 +260,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." @@ -268,7 +285,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, @@ -323,8 +340,8 @@ *) echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case @@ -334,3 +351,10 @@ esac exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: --- vlc-0.8.4.debian.orig/extras/faad2/plugins/Makefile.am +++ vlc-0.8.4.debian/extras/faad2/plugins/Makefile.am @@ -1,14 +1,11 @@ +SUBDIRS = if HAVE_MPEG4IP_PLUG -if HAVE_XMMS -SUBDIRS = xmms mpeg4ip -else -SUBDIRS = mpeg4ip +SUBDIRS += mpeg4ip endif -else if HAVE_XMMS -SUBDIRS = xmms -else -SUBDIRS = +SUBDIRS += xmms endif +if HAVE_BMP +SUBDIRS += bmp endif --- vlc-0.8.4.debian.orig/extras/faad2/plugins/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/plugins/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.8.5 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -21,7 +20,6 @@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,6 +34,30 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ +@HAVE_MPEG4IP_PLUG_TRUE@am__append_1 = mpeg4ip +@HAVE_XMMS_TRUE@am__append_2 = xmms +@HAVE_BMP_TRUE@am__append_3 = bmp +subdir = plugins +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = mpeg4ip xmms bmp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -45,6 +67,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -66,6 +90,8 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ @@ -91,12 +117,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ XMMS_CONFIG = @XMMS_CONFIG@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ @@ -104,6 +133,7 @@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -119,7 +149,6 @@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ -external_mp4v2 = @external_mp4v2@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -132,6 +161,7 @@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -139,32 +169,39 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -@HAVE_MPEG4IP_PLUG_FALSE@@HAVE_XMMS_FALSE@SUBDIRS = -@HAVE_MPEG4IP_PLUG_TRUE@@HAVE_XMMS_FALSE@SUBDIRS = mpeg4ip -@HAVE_MPEG4IP_PLUG_FALSE@@HAVE_XMMS_TRUE@SUBDIRS = xmms -@HAVE_MPEG4IP_PLUG_TRUE@@HAVE_XMMS_TRUE@SUBDIRS = xmms mpeg4ip -subdir = plugins -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = mpeg4ip xmms +SUBDIRS = $(am__append_1) $(am__append_2) $(am__append_3) all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu plugins/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo @@ -235,14 +272,6 @@ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -251,19 +280,22 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ + empty_fix=.; \ else \ include_option=--include; \ + empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ + test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -273,10 +305,11 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -299,10 +332,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -316,7 +345,7 @@ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -333,13 +362,13 @@ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ + test -d "$(distdir)/$$subdir" \ + || mkdir "$(distdir)/$$subdir" \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ + top_distdir="../$(top_distdir)" \ + distdir="../$(distdir)/$$subdir" \ distdir) \ || exit 1; \ fi; \ @@ -349,7 +378,6 @@ all-am: Makefile installdirs: installdirs-recursive installdirs-am: - install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -387,6 +415,8 @@ dvi-am: +html: html-recursive + info: info-recursive info-am: @@ -421,22 +451,18 @@ uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCD/QCDFAAD.c +++ vlc-0.8.4.debian/extras/faad2/plugins/QCD/QCDFAAD.c @@ -0,0 +1,1030 @@ +/* +** FAAD - Freeware Advanced Audio Decoder +** Copyright (C) 2002 M. Bakker +** +** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** $Id: QCDFAAD.c,v 1.2 2003/04/28 19:04:35 menno Exp $ +** based on menno's in_faad.dll plugin for Winamp +** +** The tag function has been removed because QCD supports ID3v1 & ID3v2 very well +** About how to tagging: Please read the "ReadMe.txt" first +**/ + +#define WIN32_LEAN_AND_MEAN + +#include +#include +#include +#include +#include +#include +#include "QCDInputDLL.h" + +#include "resource.h" + +#include +#include +#include +//#include + +static char app_name[] = "QCDFAAD"; + +faadAACInfo file_info; + +faacDecHandle hDecoder; +faacDecFrameInfo frameInfo; + +HINSTANCE hInstance; +HWND hwndPlayer, hwndConfig, hwndAbout; +QCDModInitIn sQCDCallbacks, *QCDCallbacks; +BOOL oldAPIs = 0; +static char lastfn[MAX_PATH]; // currently playing file (used for getting info on the current file) +int file_length; // file length, in bytes +int paused; // are we paused? +int seek_needed; // if != -1, it is the point that the decode thread should seek to, in ms. + +char *sample_buffer; // sample buffer +unsigned char *buffer; // input buffer +unsigned char *memmap_buffer; // input buffer for whole file +long memmap_index; + +long buffercount, fileread, bytecount; + +// seek table for ADTS header files +unsigned long *seek_table = NULL; +int seek_table_length=0; + +int killPlayThread = 0; // the kill switch for the decode thread +HANDLE play_thread_handle = INVALID_HANDLE_VALUE; // the handle to the decode thread +FILE_STREAM *infile; + +/* Function definitions */ +int id3v2_tag(unsigned char *buffer); +DWORD WINAPI PlayThread(void *b); // the decode thread procedure + +// general funcz +static void show_error(const char *message,...) +{ + char foo[512]; + va_list args; + va_start(args, message); + vsprintf(foo, message, args); + va_end(args); + MessageBox(hwndPlayer, foo, "FAAD Plug-in Error", MB_ICONSTOP); +} + + +// 1= use vbr display, 0 = use average bitrate. This value only controls what shows up in the +// configuration form. Also- Streaming uses an on-the-fly bitrate display regardless of this value. +long m_variable_bitrate_display=0; +long m_priority = 5; +long m_memmap_file = 0; +static char INI_FILE[MAX_PATH]; + +char *priority_text[] = { "", + "Decode Thread Priority: Lowest", + "Decode Thread Priority: Lower", + "Decode Thread Priority: Normal", + "Decode Thread Priority: Higher", + "Decode Thread Priority: Highest (default)" + }; + +long priority_table[] = {0, THREAD_PRIORITY_LOWEST, THREAD_PRIORITY_BELOW_NORMAL, THREAD_PRIORITY_NORMAL, THREAD_PRIORITY_ABOVE_NORMAL, THREAD_PRIORITY_HIGHEST}; + +long current_file_mode = 0; + +int PlayThread_memmap(); +int PlayThread_file(); + +static void _r_s(char *name,char *data, int mlen) +{ + char buf[10]; + strcpy(buf,data); + GetPrivateProfileString(app_name,name,buf,data,mlen,INI_FILE); +} + +#define RS(x) (_r_s(#x,x,sizeof(x))) +#define WS(x) (WritePrivateProfileString(app_name,#x,x,INI_FILE)) + +void config_read() +{ + char variable_bitrate_display[10]; + char priority[10]; + char memmap_file[10]; + char local_buffer_size[10]; + char stream_buffer_size[10]; + + strcpy(variable_bitrate_display, "1"); + strcpy(priority, "5"); + strcpy(memmap_file, "0"); + strcpy(local_buffer_size, "128"); + strcpy(stream_buffer_size, "64"); + + RS(variable_bitrate_display); + RS(priority); + RS(memmap_file); + RS(local_buffer_size); + RS(stream_buffer_size); + + m_priority = atoi(priority); + m_variable_bitrate_display = atoi(variable_bitrate_display); + m_memmap_file = atoi(memmap_file); + m_local_buffer_size = atoi(local_buffer_size); + m_stream_buffer_size = atoi(stream_buffer_size); +} + +void config_write() +{ + char variable_bitrate_display[10]; + char priority[10]; + char memmap_file[10]; + char local_buffer_size[10]; + char stream_buffer_size[10]; + + itoa(m_priority, priority, 10); + itoa(m_variable_bitrate_display, variable_bitrate_display, 10); + itoa(m_memmap_file, memmap_file, 10); + itoa(m_local_buffer_size, local_buffer_size, 10); + itoa(m_stream_buffer_size, stream_buffer_size, 10); + + WS(variable_bitrate_display); + WS(priority); + WS(memmap_file); + WS(local_buffer_size); + WS(stream_buffer_size); +} + +//----------------------------------------------------------------------------- + +BOOL WINAPI DllMain(HINSTANCE hInst, DWORD fdwReason, LPVOID pRes) +{ + if (fdwReason == DLL_PROCESS_ATTACH) + hInstance = hInst; + return TRUE; +} + +//----------------------------------------------------------------------------- +//old entrypoint api +PLUGIN_API BOOL QInputModule(QCDModInitIn *ModInit, QCDModInfo *ModInfo) +{ + ModInit->version = PLUGIN_API_VERSION; + ModInit->toModule.ShutDown = ShutDown; + ModInit->toModule.GetTrackExtents = GetTrackExtents; + ModInit->toModule.GetMediaSupported = GetMediaSupported; + ModInit->toModule.GetCurrentPosition= GetCurrentPosition; + ModInit->toModule.Play = Play; + ModInit->toModule.Pause = Pause; + ModInit->toModule.Stop = Stop; + ModInit->toModule.SetVolume = SetVolume; + ModInit->toModule.About = About; + ModInit->toModule.Configure = Configure; + QCDCallbacks = ModInit; + + ModInfo->moduleString = "FAAD Plugin v1.0b"; + /* read config */ + QCDCallbacks->Service(opGetPluginSettingsFile, INI_FILE, MAX_PATH, 0); + + config_read(); + ModInfo->moduleExtensions = "AAC"; + + hwndPlayer = (HWND)ModInit->Service(opGetParentWnd, 0, 0, 0); + lastfn[0] = 0; + play_thread_handle = INVALID_HANDLE_VALUE; + + oldAPIs = 1; + + return TRUE; +} + +//----------------------------------------------------------------------------- + +PLUGIN_API QCDModInitIn* INPUTDLL_ENTRY_POINT() +{ + sQCDCallbacks.version = PLUGIN_API_VERSION; + sQCDCallbacks.toModule.Initialize = Initialize; + sQCDCallbacks.toModule.ShutDown = ShutDown; + sQCDCallbacks.toModule.GetTrackExtents = GetTrackExtents; + sQCDCallbacks.toModule.GetMediaSupported = GetMediaSupported; + sQCDCallbacks.toModule.GetCurrentPosition = GetCurrentPosition; + sQCDCallbacks.toModule.Play = Play; + sQCDCallbacks.toModule.Pause = Pause; + sQCDCallbacks.toModule.Stop = Stop; + sQCDCallbacks.toModule.SetVolume = SetVolume; + sQCDCallbacks.toModule.About = About; + sQCDCallbacks.toModule.Configure = Configure; + + QCDCallbacks = &sQCDCallbacks; + return &sQCDCallbacks; +} + +//---------------------------------------------------------------------------- + +BOOL CALLBACK config_dialog_proc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + char tmp[10]; + + switch (message) + { + case WM_INITDIALOG: + /* Set priority slider range and previous position */ + SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(1, 5)); + SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETPOS, TRUE, m_priority); + SetDlgItemText(hwndDlg, IDC_STATIC2, priority_text[m_priority]); + + /* Put a limit to the amount of characters allowed in the buffer boxes */ + SendMessage(GetDlgItem(hwndDlg, LOCAL_BUFFER_TXT), EM_LIMITTEXT, 4, 0); + SendMessage(GetDlgItem(hwndDlg, STREAM_BUFFER_TXT), EM_LIMITTEXT, 4, 0); + + if(m_variable_bitrate_display) + SendMessage(GetDlgItem(hwndDlg, VARBITRATE_CHK), BM_SETCHECK, BST_CHECKED, 0); + if(m_memmap_file) + SendMessage(GetDlgItem(hwndDlg, IDC_MEMMAP), BM_SETCHECK, BST_CHECKED, 0); + + itoa(m_local_buffer_size, tmp, 10); + SetDlgItemText(hwndDlg, LOCAL_BUFFER_TXT, tmp); + + itoa(m_stream_buffer_size, tmp, 10); + SetDlgItemText(hwndDlg, STREAM_BUFFER_TXT, tmp); + + return TRUE; + + case WM_HSCROLL: + + /* Thread priority slider moved */ + if(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER) == (HWND) lParam) + { + int tmp; + tmp = SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_GETPOS, 0, 0); + + if(tmp > 0) + { + m_priority = tmp; + + SetDlgItemText(hwndDlg, IDC_STATIC2, priority_text[m_priority]); + + if(play_thread_handle) + SetThreadPriority(play_thread_handle, priority_table[m_priority]); + } + } + + return TRUE; + + case WM_COMMAND: + + if(HIWORD(wParam) == BN_CLICKED) + { + if(GetDlgItem(hwndDlg, VARBITRATE_CHK) == (HWND) lParam) + { + /* Variable Bitrate checkbox hit */ + m_variable_bitrate_display = SendMessage(GetDlgItem(hwndDlg, VARBITRATE_CHK), BM_GETCHECK, 0, 0); + } + if(GetDlgItem(hwndDlg, IDC_MEMMAP) == (HWND) lParam) + { + /* Variable Bitrate checkbox hit */ + m_memmap_file = SendMessage(GetDlgItem(hwndDlg, IDC_MEMMAP), BM_GETCHECK, 0, 0); + } + } + + switch (LOWORD(wParam)) + { + case OK_BTN: + /* User hit OK, save buffer settings (all others are set on command) */ + GetDlgItemText(hwndDlg, LOCAL_BUFFER_TXT, tmp, 5); + m_local_buffer_size = atol(tmp); + + GetDlgItemText(hwndDlg, STREAM_BUFFER_TXT, tmp, 5); + m_stream_buffer_size = atol(tmp); + + config_write(); + + EndDialog(hwndDlg, wParam); + return TRUE; + case RESET_BTN: + SendMessage(GetDlgItem(hwndDlg, VARBITRATE_CHK), BM_SETCHECK, BST_CHECKED, 0); + m_variable_bitrate_display = 1; + SendMessage(GetDlgItem(hwndDlg, IDC_MEMMAP), BM_SETCHECK, BST_UNCHECKED, 0); + m_memmap_file = 0; + SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETPOS, TRUE, 5); + m_priority = 5; + SetDlgItemText(hwndDlg, IDC_STATIC2, priority_text[5]); + SetDlgItemText(hwndDlg, LOCAL_BUFFER_TXT, "128"); + m_local_buffer_size = 128; + SetDlgItemText(hwndDlg, STREAM_BUFFER_TXT, "64"); + m_stream_buffer_size = 64; + return TRUE; + case IDCANCEL: + case CANCEL_BTN: + /* User hit Cancel or the X, just close without saving buffer settings */ + DestroyWindow(hwndDlg); + return TRUE; + } + } + return FALSE; +} + + +void Configure(int flags) +{ + if(!IsWindow(hwndConfig)) + hwndConfig = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_CONFIG), hwndPlayer, config_dialog_proc); + ShowWindow(hwndConfig, SW_NORMAL); +} + +//----------------------------------------------------------------------------- +// proc of "About Dialog" +INT_PTR CALLBACK about_dialog_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + static RECT rcLOGO, rcMail1, rcMail2/*, rcMail3*/; + POINT ptMouse; + static char szPluginVer[] = "QCD FAAD Input Plug-in v1.0b\nCompiled on " __TIME__ ", " __DATE__; + static char szFLACVer[] = "Using: FAAD2 v "FAAD2_VERSION" by"; + + switch (uMsg) + { + case WM_INITDIALOG: + case WM_MOVE: + GetWindowRect(GetDlgItem(hwndDlg, IDC_LOGO), &rcLOGO); + GetWindowRect(GetDlgItem(hwndDlg, IDC_MAIL1), &rcMail1); + GetWindowRect(GetDlgItem(hwndDlg, IDC_MAIL2), &rcMail2); +// GetWindowRect(GetDlgItem(hwndDlg, IDC_MAIL2), &rcMail3); + + SetDlgItemText(hwndDlg, IDC_PLUGINVER, szPluginVer); + SetDlgItemText(hwndDlg, IDC_FAADVER, szFLACVer); + + return TRUE; + case WM_MOUSEMOVE: + ptMouse.x = LOWORD(lParam); + ptMouse.y = HIWORD(lParam); + ClientToScreen(hwndDlg, &ptMouse); + if( (ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right && + ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom) + || + (ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right && + ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom) + || + (ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right && + ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom) +/* || + (ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right && + ptMouse.y >= rcMail3.top && ptMouse.y<= rcMail3.bottom)*/ ) + SetCursor(LoadCursor(NULL, MAKEINTRESOURCE(32649))); + else + SetCursor(LoadCursor(NULL, IDC_ARROW)); + + return TRUE; + case WM_LBUTTONDOWN: + ptMouse.x = LOWORD(lParam); + ptMouse.y = HIWORD(lParam); + ClientToScreen(hwndDlg, &ptMouse); + if(ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right && + ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom) + ShellExecute(0, NULL, "http://www.audiocoding.com", NULL,NULL, SW_NORMAL); + else if(ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right && + ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom) + ShellExecute(0, NULL, "mailto:shaohao@elong.com", NULL,NULL, SW_NORMAL); + else if(ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right && + ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom) + ShellExecute(0, NULL, "mailto:menno@audiocoding.com", NULL,NULL, SW_NORMAL); +/* else if(ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right && + ptMouse.y >= rcMail3.top && ptMouse.y<= rcMail3.bottom) + ShellExecute(0, NULL, "I don't know", NULL,NULL, SW_NORMAL); +*/ + return TRUE; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDOK: + default: + DestroyWindow(hwndDlg); + return TRUE; + } + } + return FALSE; +} + +void About(int flags) +{ + if(!IsWindow(hwndAbout)) + hwndAbout = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_ABOUT), hwndPlayer, about_dialog_proc); + ShowWindow(hwndAbout, SW_SHOW); +} + +//----------------------------------------------------------------------------- + +BOOL Initialize(QCDModInfo *ModInfo, int flags) +{ + hwndPlayer = (HWND)QCDCallbacks->Service(opGetParentWnd, 0, 0, 0); + + lastfn[0] = 0; + seek_needed = -1; + paused = 0; + play_thread_handle = INVALID_HANDLE_VALUE; + + /* read config */ + QCDCallbacks->Service(opGetPluginSettingsFile, INI_FILE, MAX_PATH, 0); + config_read(); + + ModInfo->moduleString = "FAAD Plugin v1.0b"; + ModInfo->moduleExtensions = "AAC"; + + /* Initialize winsock, necessary for streaming */ + WinsockInit(); + + // insert menu item into plugin menu +// QCDCallbacks->Service(opSetPluginMenuItem, hInstance, IDD_CONFIG, (long)"FAAD Plug-in"); + + return TRUE; +} + +//---------------------------------------------------------------------------- + +void ShutDown(int flags) +{ + Stop(lastfn, STOPFLAG_FORCESTOP); + + if(buffer) + LocalFree(buffer); + + /* Deallocate winsock */ + WinsockDeInit(); + + // delete the inserted plugin menu +// QCDCallbacks->Service(opSetPluginMenuItem, hInstance, 0, 0); +} + +//----------------------------------------------------------------------------- + +BOOL GetMediaSupported(LPCSTR medianame, MediaInfo *mediaInfo) +{ + FILE_STREAM *in; + faadAACInfo tmp; + char *ch = strrchr(medianame, '.'); + + if (!medianame || !*medianame) + return FALSE; + + if(!ch) + return (lstrlen(medianame) > 2); // no extension defaults to me (if not drive letter) + + /* Finally fixed */ + if(StringComp(ch, ".aac", 4) == 0) + { + in = open_filestream((char *)medianame); + + if(in != NULL && mediaInfo) + { + if(in->http) + { + /* No seeking in http streams */ + mediaInfo->mediaType = DIGITAL_STREAM_MEDIA; + mediaInfo->op_canSeek = FALSE; + } + else + { + mediaInfo->mediaType = DIGITAL_FILE_MEDIA; + get_AAC_format((char *)medianame, &tmp, NULL, NULL, 1); + if(tmp.headertype == 2) /* ADTS header - seekable */ + mediaInfo->op_canSeek = TRUE; + else + mediaInfo->op_canSeek = FALSE; /* ADIF or Headerless - not seekable */ + } + + close_filestream(in); + return TRUE; + } + else + { + close_filestream(in); + return FALSE; + } + } + else + return FALSE; +} + +unsigned long samplerate, channels; + +int play_memmap(char *fn) +{ + int tagsize = 0; + + infile = open_filestream(fn); + + if (infile == NULL) + return 1; + + fileread = filelength_filestream(infile); + + memmap_buffer = (char*)LocalAlloc(LPTR, fileread); + read_buffer_filestream(infile, memmap_buffer, fileread); + + /* skip id3v2 tag */ + memmap_index = id3v2_tag(memmap_buffer); + + hDecoder = faacDecOpen(); + + /* Copy the configuration dialog setting and use it as the default */ + /* initialize the decoder, and get samplerate and channel info */ + + if( (buffercount = faacDecInit(hDecoder, memmap_buffer + memmap_index, + fileread - memmap_index - 1, &samplerate, &channels)) < 0 ) + { + show_error("Error opening input file"); + return 1; + } + + memmap_index += buffercount; + + PlayThread_memmap(); + + return 0; +} + +int play_file(char *fn) +{ + int k; + int tagsize; + + ZeroMemory(buffer, 768*2); + + infile = open_filestream(fn); + + if (infile == NULL) + return 1; + + fileread = filelength_filestream(infile); + + buffercount = bytecount = 0; + read_buffer_filestream(infile, buffer, 768*2); + + tagsize = id3v2_tag(buffer); + + /* If we find a tag, run right over it */ + if(tagsize) + { + if(infile->http) + { + int i; + /* Crude way of doing this, but I believe its fast enough to not make a big difference */ + close_filestream(infile); + infile = open_filestream(fn); + + for(i=0; i < tagsize; i++) + read_byte_filestream(infile); + } + else + seek_filestream(infile, tagsize, FILE_BEGIN); + + bytecount = tagsize; + buffercount = 0; + read_buffer_filestream(infile, buffer, 768*2); + } + + hDecoder = faacDecOpen(); + + /* Copy the configuration dialog setting and use it as the default */ + /* initialize the decoder, and get samplerate and channel info */ + + if((buffercount = faacDecInit(hDecoder, buffer, 768*2, &samplerate, &channels)) < 0) + { + show_error("Error opening input file"); + return 1; + } + + if(buffercount > 0) + { + bytecount += buffercount; + + for (k = 0; k < (768*2 - buffercount); k++) + buffer[k] = buffer[k + buffercount]; + + read_buffer_filestream(infile, buffer + (768*2) - buffercount, buffercount); + buffercount = 0; + } + + PlayThread_file(); + + return 0; +} + + +//----------------------------------------------------------------------------- + +BOOL Play(LPCSTR medianame, int playfrom, int playto, int flags) +{ + if(stricmp(lastfn, medianame) != 0) + { + sQCDCallbacks.toPlayer.OutputStop(STOPFLAG_PLAYDONE); + Stop(lastfn, STOPFLAG_PLAYDONE); + } + + if(paused) + { + // Update the player controls to reflect the new unpaused state + sQCDCallbacks.toPlayer.OutputPause(0); + + Pause(medianame, PAUSE_DISABLED); + + if (playfrom >= 0) + seek_needed = playfrom; + } + else if(play_thread_handle != INVALID_HANDLE_VALUE) + { + seek_needed = playfrom; + return TRUE; + } + else + { + int thread_id; + + // alloc the input buffer + buffer = (unsigned char*)LocalAlloc(LPTR, 768*2); + + current_file_mode = m_memmap_file; + + if(current_file_mode) + { + if(play_memmap((char *)medianame)) + return FALSE; + } + else + { + if(play_file((char *)medianame)) + return FALSE; + } + + if(seek_table) + { + free(seek_table); + seek_table = NULL; + seek_table_length = 0; + } + + get_AAC_format((char *)medianame, &file_info, &seek_table, &seek_table_length, 0); + + seek_needed = playfrom > 0 ? playfrom : -1; + killPlayThread = 0; + strcpy(lastfn,medianame); + + /* + To RageAmp: This is really needed, because aacinfo isn't very accurate on ADIF files yet. + Can be fixed though :-) + */ + file_info.sampling_rate = samplerate; + file_info.channels = frameInfo.channels; + + play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) PlayThread, (void *) &killPlayThread, 0, &thread_id); + if(!play_thread_handle) + return FALSE; + + // Note: This line seriously slows down start up time + if(m_priority != 3) // if the priority in config window is set to normal, there is nothing to reset! + SetThreadPriority(play_thread_handle, priority_table[m_priority]); + + } + + return TRUE; +} + +//----------------------------------------------------------------------------- + +BOOL Pause(LPCSTR medianame, int flags) +{ + if(QCDCallbacks->toPlayer.OutputPause(flags)) + { + // send back pause/unpause notification + QCDCallbacks->toPlayer.PlayPaused(medianame, flags); + paused = flags; + return TRUE; + } + return FALSE; +} + +//----------------------------------------------------------------------------- + +BOOL Stop(LPCSTR medianame, int flags) +{ + if(medianame && *medianame && stricmp(lastfn, medianame) == 0) + { + sQCDCallbacks.toPlayer.OutputStop(flags); + + killPlayThread = 1; + if(play_thread_handle != INVALID_HANDLE_VALUE) + { + if(WaitForSingleObject(play_thread_handle, INFINITE) == WAIT_TIMEOUT) + { +// MessageBox(hwndPlayer, "FAAD thread kill timeout", "debug", 0); + TerminateThread(play_thread_handle,0); + } + CloseHandle(play_thread_handle); + play_thread_handle = INVALID_HANDLE_VALUE; + } + + if (oldAPIs) + QCDCallbacks->toPlayer.PlayStopped(lastfn); + + lastfn[0] = 0; + } + + return TRUE; +} + +int aac_seek(int pos_ms, int *sktable) +{ + double offset_sec; + + offset_sec = pos_ms / 1000.0; + if(!current_file_mode) + { + seek_filestream(infile, sktable[(int)(offset_sec+0.5)], FILE_BEGIN); + + bytecount = sktable[(int)(offset_sec+0.5)]; + buffercount = 0; + read_buffer_filestream(infile, buffer, 768*2); + } + else + { + memmap_index = sktable[(int)(offset_sec+0.5)]; + } + + return 0; +} + +//----------------------------------------------------------------------------- + +void SetVolume(int levelleft, int levelright, int flags) +{ + QCDCallbacks->toPlayer.OutputSetVol(levelleft, levelright, flags); +} + +//----------------------------------------------------------------------------- + +BOOL GetCurrentPosition(LPCSTR medianame, long *track, long *offset) +{ + return QCDCallbacks->toPlayer.OutputGetCurrentPosition((UINT*)offset, 0); +} + +//----------------------------------------------------------------------------- + +BOOL GetTrackExtents(LPCSTR medianame, TrackExtents *ext, int flags) +{ + faadAACInfo tmp; + + if(get_AAC_format((char*)medianame, &tmp, NULL, NULL, 1)) + return FALSE; + + ext->track = 1; + ext->start = 0; + ext->end = tmp.length; + ext->bytesize = tmp.bitrate * tmp.length; + ext->unitpersec = 1000; + + return TRUE; +} + +//--------------------------for play thread------------------------------------- + +int last_frame; + +DWORD WINAPI PlayThread(void *b) +{ + BOOL done = FALSE, updatePos = FALSE; + int decode_pos_ms = 0; // current decoding position, in milliseconds + int l; + int decoded_frames=0; + int br_calc_frames=0; + int br_bytes_consumed=0; + unsigned long bytesconsumed; + + last_frame = 0; + + if(!done) + { + // open outputdevice + WAVEFORMATEX wf; + wf.wFormatTag = WAVE_FORMAT_PCM; + wf.cbSize = 0; + wf.nChannels = file_info.channels; + wf.wBitsPerSample = 16; + wf.nSamplesPerSec = file_info.sampling_rate; + wf.nBlockAlign = wf.nChannels * wf.wBitsPerSample / 8; + wf.nAvgBytesPerSec = wf.nSamplesPerSec * wf.nBlockAlign; + if (!QCDCallbacks->toPlayer.OutputOpen(lastfn, &wf)) + { + show_error("Error: Failed openning output plugin!"); + done = TRUE; // cannot open sound device + } + } + + while (! *((int *)b) ) + { + /********************** SEEK ************************/ + if (!done && seek_needed >= 0) + { + int seconds; + + // Round off to a second + seconds = seek_needed - (seek_needed%1000); + QCDCallbacks->toPlayer.OutputFlush(decode_pos_ms); + aac_seek(seconds, seek_table); + decode_pos_ms = seconds; + decoded_frames = 0; + br_calc_frames = 0; + br_bytes_consumed = 0; + + seek_needed = -1; + updatePos = 1; + } + + /********************* QUIT *************************/ + if (done) + { + if (QCDCallbacks->toPlayer.OutputDrain(0) && !(seek_needed >= 0)) + { + play_thread_handle = INVALID_HANDLE_VALUE; + QCDCallbacks->toPlayer.OutputStop(STOPFLAG_PLAYDONE); + QCDCallbacks->toPlayer.PlayDone(lastfn); + } + else if (seek_needed >= 0) + { + done = FALSE; + continue; + } + break; + } + + /******************* DECODE TO BUFFER ****************/ + else + { + if (current_file_mode) + bytesconsumed = PlayThread_memmap(); + else + bytesconsumed = PlayThread_file(); + + if(last_frame) + done = TRUE; + else + { + + decoded_frames++; + br_calc_frames++; + br_bytes_consumed += bytesconsumed; + + /* Update the variable bitrate about every second */ + if(m_variable_bitrate_display && br_calc_frames == 43) + { + AudioInfo vai; + vai.struct_size = sizeof(AudioInfo); + vai.frequency = file_info.sampling_rate; + vai.bitrate = (int)((br_bytes_consumed * 8) / (decoded_frames / 43.07)); + vai.mode = (channels == 2) ? 0 : 3; + vai.layer = 0; + vai.level = file_info.version; + QCDCallbacks->Service(opSetAudioInfo, &vai, sizeof(AudioInfo), 0); + + br_calc_frames = 0; + } + + if (!killPlayThread && (frameInfo.samples > 0)) + { + //update the time display + if (updatePos) + { + QCDCallbacks->toPlayer.PositionUpdate(decode_pos_ms); + updatePos = 0; + } + + { + WriteDataStruct wd; + + l = frameInfo.samples * sizeof(short); + + decode_pos_ms += (1024*1000)/file_info.sampling_rate; + + wd.bytelen = l; + wd.data = sample_buffer; + wd.markerend = 0; + wd.markerstart = decode_pos_ms; + wd.bps = 16; + wd.nch = frameInfo.channels; + wd.numsamples =l/file_info.channels/(16/8); + wd.srate = file_info.sampling_rate; + + if (!QCDCallbacks->toPlayer.OutputWrite(&wd)) + done = TRUE; + } + } + } + } + Sleep(10); + } + + // close up + play_thread_handle = INVALID_HANDLE_VALUE; + + faacDecClose(hDecoder); + hDecoder = INVALID_HANDLE_VALUE; + close_filestream(infile); + infile = NULL; + + if(seek_table) + { + free(seek_table); + seek_table = NULL; + seek_table_length = 0; + } + + if(buffer) + { + LocalFree(buffer); + buffer = NULL; + } + if(memmap_buffer) + { + LocalFree(memmap_buffer); + memmap_buffer = NULL; + } + + return 0; +} + +// thread play funcs +int PlayThread_memmap() +{ + sample_buffer = (char*)faacDecDecode(hDecoder, &frameInfo, + memmap_buffer + memmap_index, fileread - memmap_index - 1); + if (frameInfo.error) + { +// show_error(faacDecGetErrorMessage(frameInfo.error)); + last_frame = 1; + } + + memmap_index += frameInfo.bytesconsumed; + if (memmap_index >= fileread) + last_frame = 1; + + return frameInfo.bytesconsumed; +} + +int PlayThread_file() +{ + int k; + + if (buffercount > 0) + { + for (k = 0; k < (768*2 - buffercount); k++) + buffer[k] = buffer[k + buffercount]; + + read_buffer_filestream(infile, buffer + (768*2) - buffercount, buffercount); + buffercount = 0; + } + + sample_buffer = (char*)faacDecDecode(hDecoder, &frameInfo, buffer, 768*2); + if (frameInfo.error) + { +// show_error(faacDecGetErrorMessage(frameInfo.error)); + last_frame = 1; + } + + buffercount += frameInfo.bytesconsumed; + + bytecount += frameInfo.bytesconsumed; + if (bytecount >= fileread) + last_frame = 1; + + return frameInfo.bytesconsumed; +} + +// tag +int id3v2_tag(unsigned char *buffer) +{ + if (StringComp(buffer, "ID3", 3) == 0) + { + unsigned long tagsize; + + /* high bit is not used */ + tagsize = (buffer[6] << 21) | (buffer[7] << 14) | + (buffer[8] << 7) | (buffer[9] << 0); + + tagsize += 10; + + return tagsize; + } + else + { + return 0; + } +} \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCD/QCDFAAD.dsp +++ vlc-0.8.4.debian/extras/faad2/plugins/QCD/QCDFAAD.dsp @@ -0,0 +1,152 @@ +# Microsoft Developer Studio Project File - Name="QCDFAAD" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=QCDFAAD - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "QCDFAAD.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "QCDFAAD.mak" CFG="QCDFAAD - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "QCDFAAD - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "QCDFAAD - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "QCDFAAD - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\..\common\faad" /I "..\..\plugins\winamp" /I "..\..\common\id3lib\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ID3LIB_COMPILATION" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x413 /d "NDEBUG" +# ADD RSC /l 0x413 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 + +!ELSEIF "$(CFG)" == "QCDFAAD - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\common\faad" /I "..\..\plugins\winamp" /I "..\..\common\id3lib\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ID3LIB_COMPILATION" /FR /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x413 /d "_DEBUG" +# ADD RSC /l 0x413 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# SUBTRACT LINK32 /force + +!ENDIF + +# Begin Target + +# Name "QCDFAAD - Win32 Release" +# Name "QCDFAAD - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\common\faad\aacinfo.c +# End Source File +# Begin Source File + +SOURCE=..\..\common\faad\filestream.c +# End Source File +# Begin Source File + +SOURCE=.\QCDFAAD.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\common\faad\aacinfo.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\faad.h +# End Source File +# Begin Source File + +SOURCE=..\..\common\faad\filestream.h +# End Source File +# Begin Source File + +SOURCE=.\QCDInputDLL.h +# End Source File +# Begin Source File + +SOURCE=.\QCDModDefs.h +# End Source File +# Begin Source File + +SOURCE=.\QCDModInput.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\hand.cur +# End Source File +# Begin Source File + +SOURCE=.\logo.bmp +# End Source File +# Begin Source File + +SOURCE=.\plugin_dlg.rc +# End Source File +# End Group +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCD/QCDFAAD.dsw +++ vlc-0.8.4.debian/extras/faad2/plugins/QCD/QCDFAAD.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "QCDFAAD"=".\QCDFAAD.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libfaad + End Project Dependency +}}} + +############################################################################### + +Project: "libfaad"="..\..\libfaad\libfaad.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCD/QCDInputDLL.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCD/QCDInputDLL.h @@ -0,0 +1,50 @@ +//----------------------------------------------------------------------------- +// +// File: QCDInputDLL.h +// +// About: QCD Player Input module DLL interface. For more documentation, see +// QCDModInput.h. +// +// Authors: Written by Paul Quinn and Richard Carlson. +// +// QCD multimedia player application Software Development Kit Release 1.0. +// +// Copyright (C) 1997-2002 Quinnware +// +// This code is free. If you redistribute it in any form, leave this notice +// here. +// +// 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. +// +//----------------------------------------------------------------------------- + +#ifndef QCDInputDLL_H +#define QCDInputDLL_H + +#include "QCDModInput.h" + +extern HINSTANCE hInstance; +extern HWND hwndPlayer; +extern QCDModInitIn sQCDCallbacks, *QCDCallbacks; + +// Calls from the Player +int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo); +int GetTrackExtents(const char* medianame, TrackExtents *ext, int flags); +int GetCurrentPosition(const char* medianame, long *track, long *offset); + +void SetEQ(EQInfo*); +void SetVolume(int levelleft, int levelright, int flags); + +int Play(const char* medianame, int framefrom, int frameto, int flags); +int Pause(const char* medianame, int flags); +int Stop(const char* medianame, int flags); +int Eject(const char* medianame, int flags); + +int Initialize(QCDModInfo *ModInfo, int flags); +void ShutDown(int flags); +void Configure(int flags); +void About(int flags); + +#endif //QCDInputDLL_H \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCD/QCDModDefs.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCD/QCDModDefs.h @@ -0,0 +1,340 @@ +//----------------------------------------------------------------------------- +// +// File: QCDModDefs.h +// +// About: Module definitions file. Miscellanious definitions used by different +// module types. This file is published with the plugin SDKs. +// +// Authors: Written by Paul Quinn and Richard Carlson. +// +// Copyright: +// +// QCD multimedia player application Software Development Kit Release 1.0. +// +// Copyright (C) 1997-2002 Quinnware +// +// This code is free. If you redistribute it in any form, leave this notice +// here. +// +// 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. +// +//----------------------------------------------------------------------------- + +#ifndef QCDMODDEFS_H +#define QCDMODDEFS_H + +#include + +#ifdef __cplusplus +#define PLUGIN_API extern "C" __declspec(dllexport) +#else +#define PLUGIN_API __declspec(dllexport) +#endif + +// Current plugin version +#define PLUGIN_API_VERSION 250 + +//----------------------------------------------------------------------------- + +typedef struct { + char *moduleString; + char *moduleExtensions; + +} QCDModInfo; + +//----------------------------------------------------------------------------- +// Services (ops) provided by the Player +//----------------------------------------------------------------------------- +typedef enum +{ //*** below returns numeric info (*buffer not used) + + opGetPlayerVersion = 0, // high-order word = major version (eg 3.01 is 3), low-order word = minor (eg 3.01 = 1) + opGetParentWnd = 1, // handle to player window + opGetPlayerInstance = 2, // HINSTANCE to player executable + + opGetPlayerState = 9, // get current state of the player (returns: 1 = stopped, 2 = playing, 3 = paused, 0 = failed) + opGetNumTracks = 10, // number of tracks in playlist + opGetCurrentIndex = 11, // index of current track in playlist (0 based) + opGetNextIndex = 12, // get index of next track to play (0 based), param1 = index start index. -1 for after current + opGetTrackNum = 13, // get track number of index, param1 = index of track in playlist, -1 for current + // - 'track number' is the number of the track in it's respective album, as opposed to playlist number + // - the 'track number' for digital files will be 1, unless they are tagged with the CDDB identifier + + opGetTrackLength = 14, // get track length, param1 = index of track in playlist, -1 for current + // param2 = 0 for seconds, 1 for milliseconds + opGetTime = 15, // get time on player, param1 = 0 for time displayed, 1 for track time, 2 for playlist time + // param2 = 0 for elapsed, 1 for remaining + opGetTrackState = 16, // get whether track is marked, param1 = index of track, -1 for current + opGetPlaylistNum = 17, // get playlist number of index, param1 = index of track in playlist, -1 for current + opGetMediaType = 18, // get media type of track, param1 = index if track in playlist, -1 for current + // - see MediaTypes below for return values + + opGetAudioInfo = 19, // get format info about currently playing track + // - param1 = 0 for samplerate, 1 for bitrate, 2 for num channels + + opGetOffline = 20, // true if client is in Offline Mode + opGetVisTarget = 21, // where is vis being drawn > 0 - internal to skin, 1 - external window, 2 - full screen + opGetAlwaysOnTop = 22, // true if player is set to 'Always on Top' + opGetRepeatState = 23, // returns: 0 - repeat off, 1 - repeat track, 2 - repeat all + opGetShuffleState = 27, // returns: 0 - shuffle off, 1 - shuffle enabled + + opGetTimerState = 24, // low-order word: 0 - track ascend, 1 - playlist ascend, 2 - track descend, 3 - playlist descend + // hi-order word: 1 if 'show hours' is set, else 0 + + opGetVolume = 25, // get master volume level (0 - 100), param1: 0 = combined, 1 = left, 2 = right + opSetVolume = 26, // set master volume level, param1: vol level 0 - 100, param2: balance (-100 left, 0 center, 100 right) + + opGetIndexFromPLNum = 28, // get index from playlist number, param1 = playlist number + + opGetChildWnd = 30, // handle to the draggable window extension (only available on some skins) + opGetExtVisWnd = 31, // handle to the external visual window + opGetMusicBrowserWnd = 32, // handle to the music browser window + opGetSkinPreviewWnd = 33, // handle to the skin preview window + opGetPropertiesWnd = 34, // handle to the player properties window + opGetExtInfoWnd = 35, // handle to the extended information window + opGetAboutWnd = 36, // handle to the about window + opGetSegmentsWnd = 37, // handle to the segments window + opGetEQPresetsWnd = 38, // handle to the EQ presets window + + opGetVisDimensions = 50, // gets the width and height of visual window (param1 = -1 current vis window, 0 internal vis, 1 external vis, 2 full screen) + // returns: HEIGHT in high word, WIDTH in low word + + opGetQueriesComplete = 60, // get status on whether all tracks in playlist have been queryied for their info + + // playlist manipulation + opDeleteIndex = 90, // delete index from playlist (param1 = index) + opSelectIndex = 91, // mark index as selected (param1 = index, param2 = 1 - set, 0 - unset) + opBlockIndex = 92, // mark index as blocked (param1 = index, param2 = 1 - set, 0 - unset) + + opGetMediaInfo = 99, // get the CddbDisc object for the index specified, param1 = index of track, -1 for current + // param2 = pointer to integer that receives track value + // returns: pointer to CddbDisc object. Do not release or deallocate this pointer + + + //*** below returns string info in buffer, param1 = size of buffer + //*** returns 1 on success, 0 on failure + + opGetTrackName = 100, // get track name, param2 = index of track in playlist, -1 for current + opGetArtistName = 101, // get artist name, param2 = index of track in playlist, -1 for current + opGetDiscName = 102, // get disc name, param2 = index of track in playlist, -1 for current + + opGetTrackFile = 103, // file name of track in playlist, param2 = index of track in playlist, -1 for current + opGetSkinName = 104, // get current skin name + + opGetPluginFolder = 105, // get current plugin folder + opGetPluginSettingsFile = 106, // get settings file (plugins.ini) that plugin should save settings to + opGetPluginCacheFile = 107, // get file that describes plugin validity, functions and names + opGetPlayerSettingsFile = 108, // get settings file (qcd.ini) that player saves it settings to (should use for read-only) + + opGetMusicFolder = 110, // get current music folder + opGetPlaylistFolder = 111, // get current playlist folder + opGetSkinFolder = 112, // get current skin folder + opGetCDDBCacheFolder = 113, // get current folder for CDDB cached info + + opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded + + opGetMediaID = 115, // get media identifier, param2 = index of track in playlist, -1 for current + // - for CD's it's the TOC - for anything else, right now it's 0 + + opGetSupportedExtensions = 116, // get file extensions supported by the player, param2 = 0 - get all extensions, 1 - get registered extensions + // - returned extensions will be colon delimited + + + //*** below buffer points to struct or other object + //*** returns 1 on success, 0 on failure + + opShowMainMenu = 120, // Display Main QCD Menu (buffer = POINT* - location to display menu) + opGetMainMenu = 121, // Returns copy of HMENU handle to QCD Menu (must use DestroyMenu on handle when complete) + + opShowQuickTrack = 125, // Display QuickTrack Menu (buffer = POINT* - location to display menu) + + opGetEQVals = 200, // get current EQ levels/on/off (buffer = EQInfo*) + opSetEQVals = 201, // set EQ levels/on/off (buffer = EQInfo*) + + opGetProxyInfo = 202, // get proxy info (buffer = ProxyInfo*), returns 0 if proxy not in use + + + //*** below returns numeric info, buffer used + + opGetIndexFromFilename = 210, // get the index of a file that exists in current playlist (buffer = full path of file), + // param1 = startindex (index to start searching on) + // returns -1 if file not in playlist + + + //*** below send information to player + //*** returns 1 on success, 0 on failure + + opSetStatusMessage = 1000, // display message in status area (buffer = msg buffer (null term), param1 = text flags (see below)) + + opSetBrowserUrl = 1001, // set music browser URL (buffer = url (null term)) + // null url buffer - closes browser + // param1 = 0 - normal, 1 - force open + + opSetAudioInfo = 1002, // set the current music bitrate/khz (buffer = AudioInfo*, param1 = size of AudioInfo) + + opSetTrackAlbum = 1003, // update track ablum name (buffer = album (null term), param1 = (string ptr)file name), param2 = MediaTypes + opSetTrackTitle = 1004, // update track title (buffer = title (null term), param1 = (string ptr)file name), param2 = MediaTypes + opSetTrackArtist = 1005, // update track artist name (buffer = artist (null term), param1 = (string ptr)file name), param2 = MediaTypes + + opSetPlaylist = 1006, // add files to or reset playlist with new files (buffer = file list (null term), param1 = (string ptr)originating path (can be NULL), param2 = 1 - clear playlist flag, 2 - enqueue to top + + opSetTrackExtents = 1007, // update track TrackExtents info (buffer = &TrackExtents), param1 = (string ptr)file name) + opSetTrackSeekable = 1008, // update track seekable flag (buffer = (string ptr)file name), param1 = TRUE/FALSE + opSetPlayNext = 1009, // set the next index to be played (buffer = NULL, param1 = index, index = -1 unsets playnext) + opSetIndexFilename = 1010, // updates the filename (or stream) that an index in the current playlist refers to, buffer = new filename, param1 = index + + opSetSeekPosition = 1100, // seek to position during playback (buffer = NULL, param1 = position, param2 = 0 - position is in seconds, 1 - position is in milliseconds, 2 - position is in percent (use (float)param1)) + + + //*** below configures custom plugin menu items for the 'plugin menu' + //*** Player will call plugin's configure routine with menu value when menu item selected + //*** returns 1 on success, 0 on failure + + opSetPluginMenuItem = 2000, // buffer = HINSTANCE of plugin, param1 = item id, param2 = (string ptr)string to display + // - set param2 = 0 to remove item id from menu + // - set param1 = 0 and param2 = 0 to remove whole menu + opSetPluginMenuState = 2001, // buffer = HINSTANCE of plugin, param1 = item id, param2 = menu flags (same as windows menu flags - eg: MF_CHECKED) + + + //*** other services + + opSafeWait = 10000 // plugin's can use this to wait on an object without worrying about deadlocking the player. + // this should only be called by the thread that enters the plugin, not by any plugin-created threads + +} PluginServiceOp; + +//----------------------------------------------------------------------------- +// Info services api provided by the Player, called by Plugin. +//----------------------------------------------------------------------------- +typedef long (*PluginServiceFunc)(PluginServiceOp op, void *buffer, long param1, long param2); + + +//----------------------------------------------------------------------------- +typedef struct // for Output Plugin Write callback +{ + void *data; // pointer to valid data + int bytelen; // length of data pointed to by 'data' in bytes + UINT numsamples; // number of samples represented by 'data' + UINT bps; // bits per sample + UINT nch; // number of channels + UINT srate; // sample rate + + UINT markerstart; // Marker position at start of data (marker is time value of data) + // (set to WAVE_VIS_DATA_ONLY to not have data sent to output plugins) + UINT markerend; // Marker position at end of data (not currently used, set to 0) +} WriteDataStruct; + +//----------------------------------------------------------------------------- +typedef struct // for GetTrackExtents Input Plugin callback +{ + UINT track; // for CD's, set the track number. Otherwise set to 1. + UINT start; // for CD's or media that doesn't start at the beginning + // of the file, set to start position. Otherwise set to 0. + UINT end; // set to end position of media. + UINT unitpersec; // whatever units are being used for this media, how many + // of them per second. + // (Note: ((end - start) / unitpersecond) = file length + UINT bytesize; // size of file in bytes (if applicable, otherwise 0). +} TrackExtents; + +//----------------------------------------------------------------------------- +typedef struct // for opSetAudioInfo service +{ + long struct_size; // sizeof(AudioInfo) + long level; // MPEG level (1 for MPEG1, 2 for MPEG2, 3 for MPEG2.5, 7 for MPEGpro) + long layer; // and layer (1, 2 or 3) + long bitrate; // audio bitrate in bits per second + long frequency; // audio freq in Hz + long mode; // 0 for stereo, 1 for joint-stereo, 2 for dual-channel, 3 for mono, 4 for multi-channel +} AudioInfo; + +//----------------------------------------------------------------------------- +// Equalizer Info +//----------------------------------------------------------------------------- +typedef struct // for coming QCD version +{ + long struct_size; // sizeof(EQInfo) + char enabled; + char preamp; // -128 to 127, 0 is even + char bands[10]; // -128 to 127, 0 is even +} EQInfo; + +//----------------------------------------------------------------------------- +typedef struct +{ + long struct_size; // sizeof(ProxyInfo) + char hostname[200]; + long port; + char username[100]; + char password[100]; +} ProxyInfo; + +//----------------------------------------------------------------------------- +typedef enum // for MediaInfo.mediaType +{ + UNKNOWN_MEDIA = 0, + CD_AUDIO_MEDIA = 1, + DIGITAL_FILE_MEDIA = 2, + DIGITAL_STREAM_MEDIA = 3 +} MediaTypes; + +//----------------------------------------------------------------------------- +#define MAX_TOC_LEN 2048 +typedef struct +{ + // media descriptors + CHAR mediaFile[MAX_PATH]; + MediaTypes mediaType; + + // cd audio media info + CHAR cd_mediaTOC[MAX_TOC_LEN]; + int cd_numTracks; + int cd_hasAudio; + + // operation info + int op_canSeek; + + // not used + int reserved[4]; + +} MediaInfo; + + +//----------------------------------------------------------------------------- +// When subclassing the parent window, a plugin can watch for these messages +// to react to events going on between plugins and player +// DO NOT SEND THESE MESSAGES - can only watch for them + +// Plugin to Player Notifiers +#define WM_PN_POSITIONUPDATE (WM_USER + 100) // playback progress updated +#define WM_PN_PLAYSTARTED (WM_USER + 101) // playback has started +#define WM_PN_PLAYSTOPPED (WM_USER + 102) // playback has stopped by user +#define WM_PN_PLAYPAUSED (WM_USER + 103) // playback has been paused +#define WM_PN_PLAYDONE (WM_USER + 104) // playback has finished (track completed) +#define WM_PN_MEDIAEJECTED (WM_USER + 105) // a CD was ejected (lParam = (LPCSTR)medianame) +#define WM_PN_MEDIAINSERTED (WM_USER + 106) // a CD was inserted (lParam = (LPCSTR)medianame) +#define WM_PN_INFOCHANGED (WM_USER + 107) // track information was updated (lParam = (LPCSTR)medianame) +#define WM_PN_TRACKCHANGED (WM_USER + 109) // current track playing has changed (relevant from CD plugin) (lParam = (LPCSTR)medianame) + +// Player to Plugin Notifiers +#define WM_PN_PLAYLISTCHANGED (WM_USER + 200) // playlist has changed in some way (add, delete, sort, shuffle, drag-n-drop, etc...) + +// For intercepting main menu display +// (so you can get handle, modify, and display your own) +#define WM_SHOWMAINMENU (WM_USER + 20) + +//----------------------------------------------------------------------------- +// To shutdown player, send this command +#define WM_SHUTDOWN (WM_USER + 5) + +//----------------------------------------------------------------------------- +// opSetStatusMessage textflags +#define TEXT_DEFAULT 0x0 // message scrolls by in status window +#define TEXT_TOOLTIP 0x1 // message acts as tooltip in status window +#define TEXT_URGENT 0x2 // forces message to appear even if no status window (using msg box) +#define TEXT_HOLD 0x4 // tooltip message stays up (no fade out) + + +#endif //QCDMODDEFS_H \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCD/QCDModInput.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCD/QCDModInput.h @@ -0,0 +1,117 @@ +//----------------------------------------------------------------------------- +// +// File: QCDModInput.h +// +// About: Input plugin module interface. This file is published with the +// Input plugin SDK. +// +// Authors: Written by Paul Quinn and Richard Carlson. +// +// Copyright: +// +// QCD multimedia player application Software Development Kit Release 1.0. +// +// Copyright (C) 1997-2002 Quinnware +// +// This code is free. If you redistribute it in any form, leave this notice +// here. +// +// 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. +// +//----------------------------------------------------------------------------- + +#ifndef QCDMODINPUT_H +#define QCDMODINPUT_H + +#include "QCDModDefs.h" + +// name of the DLL export for input plugins +#define INPUTDLL_ENTRY_POINT QInputModule2 // (updated plugin api version 240+) + +// media insert flags +#define MEDIAINSERT_PLAY 0x1 +#define MEDIAINSERT_ADDTRACKS 0x2 +#define MEDIAINSERT_ADDSEGMENTS 0x4 +#define MEDIAINSERT_CLEARPLAYLIST 0x8 + +// Stop will receive one of these flags (pass to output plugin's stop()) +#define STOPFLAG_FORCESTOP 0 // stop occuring due to user action or other event +#define STOPFLAG_PLAYDONE 1 // stop occuring due to playlist completion + +// play flags +#define PLAYFLAG_PLAYBACK 0x0 +#define PLAYFLAG_ENCODING 0x1 +#define PLAYFLAG_SEEKING 0x2 + +// Wave Marker flags +#define WAVE_VIS_DATA_ONLY -1 // set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis + // and not to output plugin +// pause flags +#define PAUSE_DISABLED 0 // Pause() call is to unpause playback +#define PAUSE_ENABLED 1 // Pause() call is to pause playback + +//----------------------------------------------------------------------------- +// Input Module +//----------------------------------------------------------------------------- +typedef struct +{ + unsigned int size; // size of init structure + unsigned int version; // plugin structure version (set to PLUGIN_API_VERSION) + PluginServiceFunc Service; // player supplied services callback + + struct + { + void (*PositionUpdate)(unsigned int position); + void (*PlayStopped)(const char* medianame); // notify player of play stop + void (*PlayStarted)(const char* medianame); // notify player of play start + void (*PlayPaused)(const char* medianame, int flags); // notify player of play pause + void (*PlayDone)(const char* medianame); // notify player when play done + void (*PlayTrackChanged)(const char* medianame); // notify player when playing track changes (cd audio relevant only) + void (*MediaEjected)(const char* medianame); // notify player of media eject (cd audio relevant) + void (*MediaInserted)(const char* medianame, int flags); // notify player of media insert (cd audio relevant) + + // output plugin calls + int (*OutputOpen)(const char* medianame, WAVEFORMATEX*); // open output for wave data + int (*OutputWrite)(WriteDataStruct*); // send PCM audio data to output + // (blocks until write completes, thus if output is paused can + // block until unpaused) + int (*OutputDrain)(int flags); // wait for all output to complete (blocking) + int (*OutputDrainCancel)(int flags); // break a drain in progress + int (*OutputFlush)(unsigned int marker); // flush output upto marker + int (*OutputStop)(int flags); // stop output + int (*OutputPause)(int flags); // pause output + + int (*OutputSetVol)(int levelleft, int levelright, int flags); + int (*OutputGetCurrentPosition)(unsigned int *position, int flags); + + void *Reserved[10]; + } toPlayer; + + struct + { + int (*Initialize)(QCDModInfo *modInfo, int flags); // initialize plugin + void (*ShutDown)(int flags); // shutdown plugin + + int (*Play)(const char* medianame, int playfrom, int playto, int flags); // start playing playfrom->playto + int (*Stop)(const char* medianame, int flags); // stop playing + int (*Pause)(const char* medianame, int flags); // pause playback + int (*Eject)(const char* medianame, int flags); // eject media + void (*SetEQ)(EQInfo*); // update EQ settings + + int (*GetMediaSupported)(const char* medianame, MediaInfo *mediaInfo); // does plugin support medianame (and provides info for media) + int (*GetTrackExtents)(const char* medianame, TrackExtents *ext, int flags); // get media start, end & units + int (*GetCurrentPosition)(const char* medianame, long *track, long *offset); // get playing media's position + + void (*Configure)(int flags); // launch configuration + void (*About)(int flags); // launch about info + + void (*SetVolume)(int levelleft, int levelright, int flags); // level 0 - 100 + + void *Reserved[10]; + } toModule; + +} QCDModInitIn; + +#endif //QCDMODINPUT_H --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCD/ReadMe.txt +++ vlc-0.8.4.debian/extras/faad2/plugins/QCD/ReadMe.txt @@ -0,0 +1,11 @@ +QCDFAAD.dll input Plugin for Quintessential Player (QCD) +Please goto http://www.quinnware.com to download the latest version of QCD. + +About Tagging music file: + +Because QCD support ID3v1 & ID3v2 functions. So you can add a string -- ":AAC" +in the configuration dialog box of QCDcddb.dll Libarary Plugin. +(I think you will find it and will know how to do it, +otherwise you can visite the message forum on the web site.) + +Have a good time:) \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCD/plugin_dlg.rc +++ vlc-0.8.4.debian/extras/faad2/plugins/QCD/plugin_dlg.rc @@ -0,0 +1,141 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_CONFIG DIALOGEX 0, 0, 179, 133 +STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "FAAC Decoder Configuration" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + CONTROL "Enable variable bitrate display",VARBITRATE_CHK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,7,140,10 + EDITTEXT STREAM_BUFFER_TXT,87,21,21,12,ES_AUTOHSCROLL | ES_NUMBER + EDITTEXT LOCAL_BUFFER_TXT,87,38,21,12,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Buffer entire files into memory",IDC_MEMMAP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,60,140,10 + CONTROL "Slider1",THREAD_PRIORITY_SLIDER,"msctls_trackbar32", + TBS_AUTOTICKS | WS_TABSTOP,7,89,165,11,WS_EX_TRANSPARENT + PUSHBUTTON "OK",OK_BTN,64,112,50,14 + PUSHBUTTON "Cancel",CANCEL_BTN,121,112,50,14 + LTEXT "HTTP stream buffer:",IDC_STATIC,7,22,77,8 + LTEXT "Decode Thread Priority: Highest (default)",IDC_STATIC2, + 7,78,165,8 + LTEXT "Local file buffer: ",IDC_STATIC,7,40,77,8 + PUSHBUTTON "Reset",RESET_BTN,7,112,50,14 +END + +IDD_ABOUT DIALOG DISCARDABLE 0, 0, 191, 168 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About FAAD Plug-in" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,70,147,50,14 + CTEXT "",IDC_PLUGINVER,29,73,133,16 + CTEXT "",IDC_FAADVER,40,123,111,8 + LTEXT "QCD Input Plug-in by",IDC_STATIC,62,97,67,8 + CONTROL 107,IDC_LOGO,"Static",SS_BITMAP | SS_CENTERIMAGE | + SS_REALSIZEIMAGE,7,0,177,68 + LTEXT "Shao Hao",IDC_MAIL1,79,111,33,8 + LTEXT "M. Bakker",IDC_MAIL3,59,134,34,8 + LTEXT "menno",IDC_MAIL2,109,134,22,8 + LTEXT "&&",IDC_STATIC,97,134,8,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_CONFIG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 172 + TOPMARGIN, 7 + BOTTOMMARGIN, 126 + END + + IDD_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 184 + BOTTOMMARGIN, 161 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_LOGO BITMAP DISCARDABLE "logo.bmp" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCD/resource.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCD/resource.h @@ -0,0 +1,33 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by plugin_dlg.rc +// +#define IDD_CONFIG 101 +#define IDD_ABOUT 106 +#define IDB_LOGO 107 +#define VARBITRATE_CHK 1004 +#define THREAD_PRIORITY_SLIDER 1007 +#define IDC_STATIC2 1034 +#define LOCAL_BUFFER_TXT 1035 +#define STREAM_BUFFER_TXT 1036 +#define IDC_MEMMAP 1037 +#define OK_BTN 1038 +#define CANCEL_BTN 1039 +#define RESET_BTN 1047 +#define IDC_LOGO 1048 +#define IDC_PLUGINVER 1050 +#define IDC_FAADVER 1051 +#define IDC_MAIL1 1052 +#define IDC_MAIL2 1053 +#define IDC_MAIL3 1054 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 109 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1055 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDInputDLL.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDInputDLL.h @@ -0,0 +1,46 @@ +//----------------------------------------------------------------------------- +// +// File: QCDInputDLL.h +// +// About: QCD Player Input module DLL interface. For more documentation, see +// QCDModInput.h. +// +// Authors: Written by Paul Quinn and Richard Carlson. +// +// QCD multimedia player application Software Development Kit Release 1.0. +// +// Copyright (C) 1997-2002 Quinnware +// +// This code is free. If you redistribute it in any form, leave this notice +// here. +// +// 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. +// +//----------------------------------------------------------------------------- + +#ifndef QCDInputDLL_H +#define QCDInputDLL_H + +#include "QCDModInput.h" + +// Calls from the Player +int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo); +int GetTrackExtents(const char* medianame, TrackExtents *ext, int flags); +int GetCurrentPosition(const char* medianame, long *track, long *offset); + +void SetEQ(EQInfo*); +void SetVolume(int levelleft, int levelright, int flags); + +int Play(const char* medianame, int framefrom, int frameto, int flags); +int Pause(const char* medianame, int flags); +int Stop(const char* medianame, int flags); +int Eject(const char* medianame, int flags); + +int Initialize(QCDModInfo *ModInfo, int flags); +void ShutDown(int flags); +void Configure(int flags); +void About(int flags); + +#endif //QCDInputDLL_H \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDModDefs.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDModDefs.h @@ -0,0 +1,413 @@ +//----------------------------------------------------------------------------- +// +// File: QCDModDefs.h +// +// About: Module definitions file. Miscellanious definitions used by different +// module types. This file is published with the plugin SDKs. +// +// Authors: Written by Paul Quinn and Richard Carlson. +// +// Copyright: +// +// QCD multimedia player application Software Development Kit Release 1.0. +// +// Copyright (C) 1997-2002 Quinnware +// +// This code is free. If you redistribute it in any form, leave this notice +// here. +// +// 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. +// +//----------------------------------------------------------------------------- + +#ifndef QCDMODDEFS_H +#define QCDMODDEFS_H + +#include +#include + +#ifdef __cplusplus +#define PLUGIN_API extern "C" __declspec(dllexport) +#else +#define PLUGIN_API __declspec(dllexport) +#endif + +// Current plugin version + +// use this version for old style API calls (all returned text in native encoding) +#define PLUGIN_API_VERSION 250 + +// use this version for new style API calls (all returned text in UTF8 encoding on WinNT/2K/XP (native encoding on Win9x)) +#define PLUGIN_API_VERSION_WANTUTF8 ((PLUGIN_API_WANTUTF8<<16)|PLUGIN_API_VERSION) +#define PLUGIN_API_WANTUTF8 100 + +//----------------------------------------------------------------------------- + +typedef struct +{ + char *moduleString; + char *moduleExtensions; +} QCDModInfo; + +//----------------------------------------------------------------------------- +// Services (ops) provided by the Player +//----------------------------------------------------------------------------- +typedef enum +{ //*** below returns numeric info (*buffer not used) + + opGetPlayerVersion = 0, // high-order word = major version (eg 3.01 is 3), low-order word = minor (eg 3.01 = 1) + opGetParentWnd = 1, // handle to player window + opGetPlayerInstance = 2, // HINSTANCE to player executable + + opGetPlayerState = 9, // get current state of the player (returns: 1 = stopped, 2 = playing, 3 = paused, 0 = failed) + opGetNumTracks = 10, // number of tracks in playlist + opGetCurrentIndex = 11, // index of current track in playlist (0 based) + opGetNextIndex = 12, // get index of next track to play (0 based), param1 = index start index. -1 for after current + opGetTrackNum = 13, // get track number of index, param1 = index of track in playlist, -1 for current + // - 'track number' is the number of the track in it's respective album, as opposed to playlist number + // - the 'track number' for digital files will be 1 if the tag is not set or the file is not identified + + opGetTrackLength = 14, // get track length, param1 = index of track in playlist, -1 for current + // param2 = 0 for seconds, 1 for milliseconds + opGetTime = 15, // get time on player, param1 = 0 for time displayed, 1 for track time, 2 for playlist time + // param2 = 0 for elapsed, 1 for remaining + opGetTrackState = 16, // get whether track is marked, param1 = index of track, -1 for current + opGetPlaylistNum = 17, // get playlist number of index, param1 = index of track in playlist, -1 for current + opGetMediaType = 18, // get media type of track, param1 = index if track in playlist, -1 for current + // - see MediaTypes below for return values + + opGetAudioInfo = 19, // get format info about currently playing track + // - param1 = 0 for samplerate, 1 for bitrate, 2 for num channels + + opGetOffline = 20, // true if client is in Offline Mode + opGetVisTarget = 21, // where is vis being drawn > 0 - internal to skin, 1 - external window, 2 - full screen + opGetAlwaysOnTop = 22, // true if player is set to 'Always on Top' + opGetRepeatState = 23, // returns: 0 - repeat off, 1 - repeat track, 2 - repeat all + opGetShuffleState = 27, // returns: 0 - shuffle off, 1 - shuffle enabled + + opGetTimerState = 24, // low-order word: 0 - track ascend, 1 - playlist ascend, 2 - track descend, 3 - playlist descend + // hi-order word: 1 if 'show hours' is set, else 0 + + opGetVolume = 25, // get master volume level (0 - 100), param1: 0 = combined, 1 = left, 2 = right + opSetVolume = 26, // set master volume level, param1: vol level 0 - 100, param2: balance (-100 left, 0 center, 100 right) + + opGetIndexFromPLNum = 28, // get index from playlist number, param1 = playlist number + + opGetExtensionWnd = 30, // handle to the draggable window extension (only available on some skins), param1 = extension number (0 - 9) + opGetExtVisWnd = 31, // handle to the external visual window + opGetMusicBrowserWnd = 32, // handle to the music browser window + opGetSkinPreviewWnd = 33, // handle to the skin preview window + opGetPropertiesWnd = 34, // handle to the player properties window + opGetExtInfoWnd = 35, // handle to the extended information window + opGetAboutWnd = 36, // handle to the about window + opGetSegmentsWnd = 37, // handle to the segments window + opGetEQPresetsWnd = 38, // handle to the EQ presets window + opGetVideoWnd = 39, // handle to the video window + + opGetVisDimensions = 50, // gets the width and height of visual window (param1 = -1 current vis window, 0 internal vis, 1 external vis, 2 full screen) + // returns: HEIGHT in high word, WIDTH in low word + + opShowVideoWindow = 55, // Show or Close video window (param1 = 1 for create, 2 for create and show, 0 for close) + + opGetQueriesComplete = 60, // get status on whether all tracks in playlist have been queryied for their info + + // playlist manipulation + opDeleteIndex = 90, // delete index from playlist (param1 = index) + opSelectIndex = 91, // mark index as selected (param1 = index, param2 = 1 - set, 0 - unset) + opBlockIndex = 92, // mark index as blocked (param1 = index, param2 = 1 - set, 0 - unset) + + opGetMediaInfo = 99, // get the ICddbDisc object for the index specified, param1 = index of track, -1 for current + // param2 = pointer to integer that receives track value + // returns: pointer to ICddbDisc object. Do not release or deallocate this pointer + + + //*** below returns string info in buffer, param1 = size of buffer + //*** returns 1 on success, 0 on failure + + opGetTrackName = 100, // get track name, param2 = index of track in playlist, -1 for current + opGetArtistName = 101, // get artist name, param2 = index of track in playlist, -1 for current + opGetDiscName = 102, // get disc name, param2 = index of track in playlist, -1 for current + + opGetTrackFile = 103, // file name of track in playlist, param2 = index of track in playlist, -1 for current + opGetSkinName = 104, // get current skin name + + opGetPluginFolder = 105, // get current plugin folder + opGetPluginSettingsFile = 106, // get settings file (plugins.ini) that plugin should save settings to + opGetPluginCacheFile = 107, // get file that describes plugin validity, functions and names + opGetPlayerSettingsFile = 108, // get settings file (qcd.ini) that player saves it settings to (should use for read-only) + + opGetMusicFolder = 110, // get current music folder + opGetPlaylistFolder = 111, // get current playlist folder + opGetSkinFolder = 112, // get current skin folder + opGetCDDBCacheFolder = 113, // get current folder for CDDB cached info + + opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded + + opGetMediaID = 115, // get media identifier, param2 = index of track in playlist, -1 for current + // - for CD's it's the TOC - for anything else, right now it's 0 + + opGetSupportedExtensions = 116, // get file extensions supported by the player, param2 = 0 - get all extensions, 1 - get registered extensions + // - returned extensions will be colon delimited + + opGetPlaylistString = 117, // get string for index as it appears in playlist, param2 = index + + //*** below buffer points to struct or other object + //*** returns 1 on success, 0 on failure + + opShowMainMenu = 120, // Display Main QCD Menu (buffer = POINT* - location to display menu) + opGetMainMenu = 121, // Returns copy of HMENU handle to QCD Menu (must use DestroyMenu on handle when complete) + + opShowQuickTrack = 125, // Display QuickTrack Menu (buffer = POINT* - location to display menu) + opGetQuickTrack = 126, // Returns copy of HMENU handle to QuickTrack menu (must use DestroyMenu on handle when complete) + // To use if QuickTrack item selected: PostMessage(hwndPlayer, WM_COMMAND, menu_id, 0); + + opGetEQVals = 200, // get current EQ levels/on/off (buffer = EQInfo*) + opSetEQVals = 201, // set EQ levels/on/off (buffer = EQInfo*) + + opGetProxyInfo = 202, // get proxy info (buffer = ProxyInfo*), returns 0 if proxy not in use + + + //*** below returns numeric info, buffer used + + opGetIndexFromFilename = 210, // get the index of a file that exists in current playlist (buffer = full path of file), + // param1 = startindex (index to start searching on) + // returns -1 if file not in playlist + + + //*** below send information to player + //*** returns 1 on success, 0 on failure + + opSetStatusMessage = 1000, // display message in status area (buffer = msg buffer (null term), param1 = text flags (see below)) + + opSetBrowserUrl = 1001, // set music browser URL (buffer = url (null term)) + // null url buffer - closes browser + // param1 = 0 - normal, 1 - force open + + opSetAudioInfo = 1002, // set the current music bitrate/khz (buffer = AudioInfo*, param1 = size of AudioInfo) + + opSetTrackAlbum = 1003, // update track ablum name (buffer = album (null term), param1 = (string ptr)file name), param2 = MediaTypes + opSetTrackTitle = 1004, // update track title (buffer = title (null term), param1 = (string ptr)file name), param2 = MediaTypes + opSetTrackArtist = 1005, // update track artist name (buffer = artist (null term), param1 = (string ptr)file name), param2 = MediaTypes + + opSetTrackExtents = 1007, // update track TrackExtents info (buffer = &TrackExtents), param1 = (string ptr)file name) + opSetTrackSeekable = 1008, // update track seekable flag (buffer = (string ptr)file name), param1 = TRUE/FALSE + opSetPlayNext = 1009, // set the next index to be played (buffer = NULL, param1 = index, index = -1 unsets playnext) + opSetIndexFilename = 1010, // updates the filename (or stream) that an index in the current playlist refers to, buffer = new filename, param1 = index + + opSetPlaylist = 1006, // clear playlist, add files to playlist or reset playlist with new files + // buffer = file list (each file in quotes, string null terminated) Eg; buffer="\"file1.mp3\" \"file2.mp3\"\0" - NULL to clear playlist + // param1 = (string ptr)originating path (can be NULL if paths included with files) + // param2 = 1 - clear playlist flag, 2 - enqueue to top + + opInsertPlaylist = 1011, // insert tracks into playlist + // buffer = file list (each file in quotes, string null terminated) Eg; buffer="\"file1.mp3\" \"file2.mp3\"\0" + // param1 = (string ptr)originating path (can be NULL if paths included with files) + // param2 = index location to insert tracks (-1 to insert at end) + + opMovePlaylistTrack = 1012, // param1 = index of track to move, param2 = destination index (move shifts tracks between param1 and param2) + opSwapPlaylistTracks = 1013, // param1 = index of first track, param2 = index of second track (swap only switches indecies param1 and param2) + + opCreateDiscInfo = 1020, // returns: pointer to ICddbDisc object. Do not release or deallocate this pointer + opSetDiscInfo = 1021, // buffer = ICddbDisc*, param1 = MediaInfo*, param2 = track number + + opSetSeekPosition = 1100, // seek to position during playback + // buffer = NULL, param1 = position + // param2 = 0 - position is in seconds, 1 - position is in milliseconds, 2 - position is in percent (use (float)param1)) + + + opSetRepeatState = 1110, // set playlist repeat state, buffer = NULL, param1 = 0 - off, 1 - repeat track, 2 - repeat playlist + opSetShuffleState = 1111, // set playlist shuffle state, buffer = NULL, param1 = 0 - off, 1 - on + + //*** below configures custom plugin menu items for the 'plugin menu' + //*** Player will call plugin's configure routine with menu value when menu item selected + //*** returns 1 on success, 0 on failure + + opSetPluginMenuItem = 2000, // buffer = HINSTANCE of plugin, param1 = item id, param2 = (string ptr)string to display + // - set param2 = 0 to remove item id from menu + // - set param1 = 0 and param2 = 0 to remove whole menu + opSetPluginMenuState = 2001, // buffer = HINSTANCE of plugin, param1 = item id, param2 = menu flags (same as windows menu flags - eg: MF_CHECKED) + + + //*** below are services for using the player's filename template editor + //*** returns 1 on success, 0 on failure + + opShowTemplateEditor = 2100, // displays template editor dialog, param1 = (HWND)parent window, param2 = modal flag + opLoadTemplate = 2101, // loads saved templates, buffer = (char*)string buf, param1 = bufsize, param2 = index of template (index < 0 for default formats, index >= 0 for user made formats) + opRenderTemplate = 2102, // create string based on template, buffer = (char*)template, param1 = FormatMetaInfo*, param2 = (char*)string buffer (min 260 bytes) + + //*** other services + + opUTF8toUCS2 = 9000, // convert UTF8 string to UCS2 (Unicode) string, buffer = null terminated utf8 string, param1 = (WCHAR*)result string buffer, param2 = size of result buffer + opUCS2toUTF8 = 9001, // convert UCS2 (Unicode) string to UTF8 string, buffer = null terminated ucs2 string, param1 = (char*)result string buffer, param2 = size of result buffer + + opSafeWait = 10000 // plugin's can use this to wait on an object without worrying about deadlocking the player. + // this should only be called by the thread that enters the plugin, not by any plugin-created threads + +} PluginServiceOp; + +//----------------------------------------------------------------------------- +// Info services api provided by the Player, called by Plugin. +//----------------------------------------------------------------------------- +typedef long (*PluginServiceFunc)(PluginServiceOp op, void *buffer, long param1, long param2); + +// Use to retrieve service func for DSP plugins (or other inproc process that doesn't have access to PluginServiceFunc) +// Eg: PluginServiceFunc Service = (PluginServiceFunc)SendMessage(hwndPlayer, WM_GETSERVICEFUNC, 0, 0); +// Set WPARAM = PLUGIN_API_WANTUTF8 for UTF8 string parameters +#define WM_GETSERVICEFUNC (WM_USER + 1) + +//----------------------------------------------------------------------------- +typedef struct // for Output Plugin Write callback +{ + void *data; // pointer to valid data + int bytelen; // length of data pointed to by 'data' in bytes + UINT numsamples; // number of samples represented by 'data' + UINT bps; // bits per sample + UINT nch; // number of channels + UINT srate; // sample rate + + UINT markerstart; // Marker position at start of data (marker is time value of data) + // (set to WAVE_VIS_DATA_ONLY to not have data sent to output plugins) + UINT markerend; // Marker position at end of data (not currently used, set to 0) +} WriteDataStruct; + +//----------------------------------------------------------------------------- +typedef struct // for GetTrackExtents Input Plugin callback +{ + UINT track; // for CD's, set the track number. Otherwise set to 1. + UINT start; // for CD's or media that doesn't start at the beginning + // of the file, set to start position. Otherwise set to 0. + UINT end; // set to end position of media. + UINT unitpersec; // whatever units are being used for this media, how many + // of them per second. + // (Note: ((end - start) / unitpersecond) = file length + UINT bytesize; // size of file in bytes (if applicable, otherwise 0). +} TrackExtents; + +//----------------------------------------------------------------------------- +typedef struct // for opSetAudioInfo service +{ + long struct_size; // sizeof(AudioInfo) + long level; // MPEG level (1 for MPEG1, 2 for MPEG2, 3 for MPEG2.5, 7 for MPEGpro) + long layer; // and layer (1, 2 or 3) + long bitrate; // audio bitrate in bits per second + long frequency; // audio freq in Hz + long mode; // 0 for stereo, 1 for joint-stereo, 2 for dual-channel, 3 for mono, 4 for multi-channel + char text[8]; // up to eight characters to identify format (will override level and layer settings) +} AudioInfo; + +//----------------------------------------------------------------------------- +// Equalizer Info +//----------------------------------------------------------------------------- +typedef struct // for coming QCD version +{ + long struct_size; // sizeof(EQInfo) + char enabled; + char preamp; // -128 to 127, 0 is even + char bands[10]; // -128 to 127, 0 is even +} EQInfo; + +//----------------------------------------------------------------------------- +typedef struct +{ + long struct_size; // sizeof(ProxyInfo) + char hostname[200]; + long port; + char username[100]; + char password[100]; +} ProxyInfo; + +//----------------------------------------------------------------------------- +typedef enum // for MediaInfo.mediaType +{ + UNKNOWN_MEDIA = 0, + CD_AUDIO_MEDIA = 1, + DIGITAL_FILE_MEDIA = 2, + DIGITAL_STREAM_MEDIA = 3 +} MediaTypes; + +//----------------------------------------------------------------------------- +#define MAX_TOC_LEN 2048 +typedef struct +{ + // media descriptors + CHAR mediaFile[MAX_PATH]; + MediaTypes mediaType; + + // cd audio media info + CHAR cd_mediaTOC[MAX_TOC_LEN]; + int cd_numTracks; + int cd_hasAudio; + + // operation info + int op_canSeek; + + // not used + int reserved[4]; + +} MediaInfo; + +//----------------------------------------------------------------------------- +typedef struct +{ + long struct_size; + LPCWSTR title; + LPCWSTR artalb; + LPCWSTR album; + LPCWSTR genre; + LPCWSTR year; + LPCWSTR tracknum; + LPCWSTR filename; + LPCWSTR arttrk; + long reserved; + +} FormatMetaInfo; + +//----------------------------------------------------------------------------- +// When subclassing the parent window, a plugin can watch for these messages +// to react to events going on between plugins and player +// DO NOT SEND THESE MESSAGES - can only watch for them + +// Plugin to Player Notifiers +#define WM_PN_POSITIONUPDATE (WM_USER + 100) // playback progress updated +#define WM_PN_PLAYSTARTED (WM_USER + 101) // playback has started +#define WM_PN_PLAYSTOPPED (WM_USER + 102) // playback has stopped by user +#define WM_PN_PLAYPAUSED (WM_USER + 103) // playback has been paused +#define WM_PN_PLAYDONE (WM_USER + 104) // playback has finished (track completed) +#define WM_PN_MEDIAEJECTED (WM_USER + 105) // a CD was ejected (CDRom drive letter= 'A' + lParam) +#define WM_PN_MEDIAINSERTED (WM_USER + 106) // a CD was inserted (CDRom drive letter= 'A' + lParam) +#define WM_PN_INFOCHANGED (WM_USER + 107) // track information was updated (lParam = (LPCSTR)medianame) +#define WM_PN_TRACKCHANGED (WM_USER + 109) // current track playing has changed (relevant from CD plugin) (lParam = (LPCSTR)medianame) + +// Player to Plugin Notifiers +#define WM_PN_PLAYLISTCHANGED (WM_USER + 200) // playlist has changed in some way (add, delete, sort, shuffle, drag-n-drop, etc...) + +// For intercepting main menu display +// (so you can get handle, modify, and display your own) +#define WM_SHOWMAINMENU (WM_USER + 20) + +// For intercepting skinned border window commands +#define WM_BORDERWINDOW (WM_USER + 26) +// WM_BORDERWINDOW wParam's +#define BORDERWINDOW_NORMALSIZE 0x100000 +#define BORDERWINDOW_DOUBLESIZE 0x200000 +#define BORDERWINDOW_FULLSCREEN 0x400000 + +// send to border window to cause resize +// wParam = LPPOINT lpp; // point x-y is CLIENT area size of window +#define WM_SIZEBORDERWINDOW (WM_USER + 1) + +//----------------------------------------------------------------------------- +// To shutdown player, send this command +#define WM_SHUTDOWN (WM_USER + 5) + +//----------------------------------------------------------------------------- +// opSetStatusMessage textflags +#define TEXT_DEFAULT 0x0 // message scrolls by in status window +#define TEXT_TOOLTIP 0x1 // message acts as tooltip in status window +#define TEXT_URGENT 0x2 // forces message to appear even if no status window (using msg box) +#define TEXT_HOLD 0x4 // tooltip message stays up (no fade out) +#define TEXT_UNICODE 0x10 // buffer contains a unicode string (multibyte string otherwise) + +#endif //QCDMODDEFS_H \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDModInput.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDModInput.h @@ -0,0 +1,117 @@ +//----------------------------------------------------------------------------- +// +// File: QCDModInput.h +// +// About: Input plugin module interface. This file is published with the +// Input plugin SDK. +// +// Authors: Written by Paul Quinn and Richard Carlson. +// +// Copyright: +// +// QCD multimedia player application Software Development Kit Release 1.0. +// +// Copyright (C) 1997-2002 Quinnware +// +// This code is free. If you redistribute it in any form, leave this notice +// here. +// +// 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. +// +//----------------------------------------------------------------------------- + +#ifndef QCDMODINPUT_H +#define QCDMODINPUT_H + +#include "QCDModDefs.h" + +// name of the DLL export for input plugins +#define INPUTDLL_ENTRY_POINT QInputModule2 // (updated plugin api version 240+) + +// media insert flags +#define MEDIAINSERT_PLAY 0x1 +#define MEDIAINSERT_ADDTRACKS 0x2 +#define MEDIAINSERT_ADDSEGMENTS 0x4 +#define MEDIAINSERT_CLEARPLAYLIST 0x8 + +// Stop will receive one of these flags (pass to output plugin's stop()) +#define STOPFLAG_FORCESTOP 0 // stop occuring due to user action or other event +#define STOPFLAG_PLAYDONE 1 // stop occuring due to playlist completion + +// play flags +#define PLAYFLAG_PLAYBACK 0x0 +#define PLAYFLAG_ENCODING 0x1 +#define PLAYFLAG_SEEKING 0x2 + +// Wave Marker flags +#define WAVE_VIS_DATA_ONLY -1 // set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis + // and not to output plugin +// pause flags +#define PAUSE_DISABLED 0 // Pause() call is to unpause playback +#define PAUSE_ENABLED 1 // Pause() call is to pause playback + +//----------------------------------------------------------------------------- +// Input Module +//----------------------------------------------------------------------------- +typedef struct +{ + unsigned int size; // size of init structure + unsigned int version; // plugin structure version (set to PLUGIN_API_VERSION) + PluginServiceFunc Service; // player supplied services callback + + struct + { + void (*PositionUpdate)(unsigned int position); + void (*PlayStopped)(const char* medianame); // notify player of play stop + void (*PlayStarted)(const char* medianame); // notify player of play start + void (*PlayPaused)(const char* medianame, int flags); // notify player of play pause + void (*PlayDone)(const char* medianame); // notify player when play done + void (*PlayTrackChanged)(const char* medianame); // notify player when playing track changes (cd audio relevant only) + void (*MediaEjected)(const char* medianame); // notify player of media eject (cd audio relevant) + void (*MediaInserted)(const char* medianame, int flags); // notify player of media insert (cd audio relevant) + + // output plugin calls + int (*OutputOpen)(const char* medianame, WAVEFORMATEX*); // open output for wave data + int (*OutputWrite)(WriteDataStruct*); // send PCM audio data to output + // (blocks until write completes, thus if output is paused can + // block until unpaused) + int (*OutputDrain)(int flags); // wait for all output to complete (blocking) + int (*OutputDrainCancel)(int flags); // break a drain in progress + int (*OutputFlush)(unsigned int marker); // flush output upto marker + int (*OutputStop)(int flags); // stop output + int (*OutputPause)(int flags); // pause output + + int (*OutputSetVol)(int levelleft, int levelright, int flags); + int (*OutputGetCurrentPosition)(unsigned int *position, int flags); + + void *Reserved[10]; + } toPlayer; + + struct + { + int (*Initialize)(QCDModInfo *modInfo, int flags); // initialize plugin + void (*ShutDown)(int flags); // shutdown plugin + + int (*Play)(const char* medianame, int playfrom, int playto, int flags); // start playing playfrom->playto + int (*Stop)(const char* medianame, int flags); // stop playing + int (*Pause)(const char* medianame, int flags); // pause playback + int (*Eject)(const char* medianame, int flags); // eject media + void (*SetEQ)(EQInfo*); // update EQ settings + + int (*GetMediaSupported)(const char* medianame, MediaInfo *mediaInfo); // does plugin support medianame (and provides info for media) + int (*GetTrackExtents)(const char* medianame, TrackExtents *ext, int flags); // get media start, end & units + int (*GetCurrentPosition)(const char* medianame, long *track, long *offset); // get playing media's position + + void (*Configure)(int flags); // launch configuration + void (*About)(int flags); // launch about info + + void (*SetVolume)(int levelleft, int levelright, int flags); // level 0 - 100 + + void *Reserved[10]; + } toModule; + +} QCDModInitIn; + +#endif //QCDMODINPUT_H --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDModTagEditor.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDModTagEditor.h @@ -0,0 +1,84 @@ +//----------------------------------------------------------------------------- +// +// File: QCDModTagEditor +// +// About: Tag Editing plugin module interface. This file is published with the +// QCD plugin SDK. +// +// Authors: Written by Paul Quinn +// +// Copyright: +// +// QCD multimedia player application Software Development Kit Release 1.0. +// +// Copyright (C) 2002 Quinnware +// +// This code is free. If you redistribute it in any form, leave this notice +// here. +// +// 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. +// +//----------------------------------------------------------------------------- + +#ifndef QCDMODTAGEDITOR_H +#define QCDMODTAGEDITOR_H + +#include "QCDModDefs.h" + +// name of the DLL export for output plugins +#define TAGEDITORDLL_ENTRY_POINT QTagEditorModule + +// Tag field ids +typedef enum +{ + TAGFIELD_FIRSTFIELD = 0, + + TAGFIELD_TITLE = 0, + TAGFIELD_ARTIST, + TAGFIELD_ALBUM, + TAGFIELD_GENRE, + TAGFIELD_YEAR, + TAGFIELD_TRACK, + TAGFIELD_COMMENT, + + TAGFIELD_COMPOSER, + TAGFIELD_CONDUCTOR, + TAGFIELD_ORCHESTRA, + TAGFIELD_YEARCOMPOSED, + + TAGFIELD_ORIGARTIST, + TAGFIELD_LABEL, + TAGFIELD_COPYRIGHT, + TAGFIELD_ENCODER, + TAGFIELD_CDDBTAGID, + + TAGFIELD_FIELDCOUNT +}; + +//----------------------------------------------------------------------------- + +typedef struct +{ + UINT size; // size of init structure + UINT version; // plugin structure version (set to PLUGIN_API_VERSION) + + LPCSTR description; + LPCSTR defaultexts; + + bool (*Read)(LPCSTR filename, void* tagHandle); + bool (*Write)(LPCSTR filename, void* tagHandle); + bool (*Strip)(LPCSTR filename); + + void (*ShutDown)(int flags); + + void (*SetFieldA)(void* tagHandle, int fieldId, LPCSTR szNewText); + void (*SetFieldW)(void* tagHandle, int fieldId, LPCWSTR szNewText); + + LPCSTR (*GetFieldA)(void* tagHandle, int fieldId); + LPCWSTR (*GetFieldW)(void* tagHandle, int fieldId); + +} QCDModInitTag; + +#endif //QCDMODTAGEDITOR_H \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDMp4.c +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDMp4.c @@ -0,0 +1,2992 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: QCDMp4.c,v 1.4 2003/12/06 04:24:17 rjamorim Exp $ +**/ + +//#define DEBUG_OUTPUT + +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include +#include +#include +#include + +#include "resource.h" +#include "QCDInputDLL.h" +#include "utils.h" +#include "config.h" +//#include "aacinfo.h" +//#include "aac2mp4.h" +// +//const char *long_ext_list = "MP4\0MPEG-4 Files (*.MP4)\0M4A\0MPEG-4 Files (*.M4A)\0AAC\0AAC Files (*.AAC)\0"; +//const char *short_ext_list = "MP4\0MPEG-4 Files (*.MP4)\0M4A\0MPEG-4 Files (*.M4A)\0"; + +static long priority_table[] = { + 0, + THREAD_PRIORITY_HIGHEST, + THREAD_PRIORITY_ABOVE_NORMAL, + THREAD_PRIORITY_NORMAL, + THREAD_PRIORITY_BELOW_NORMAL, + THREAD_PRIORITY_LOWEST +}; +static int res_id_table[] = { + IDC_16BITS, + IDC_24BITS, + IDC_32BITS, + 0, + 0, + /*IDC_16BITS_DITHERED*/ IDC_16BITS /* temp hack */ +}; +static int res_table[] = { + 16, + 24, + 32, + 0, + 0, + 16 +}; +//static char info_fn[_MAX_PATH]; +// +//// post this to the main window at end of file (after playback has stopped) +//#define WM_WA_AAC_EOF WM_USER+2 + +struct seek_list +{ + struct seek_list *next; + __int64 offset; +}; + +typedef struct state +{ + /* general stuff */ + faacDecHandle hDecoder; + int samplerate; + unsigned char channels; + double decode_pos_ms; // current decoding position, in milliseconds + int paused; // are we paused? + int seek_needed; // if != -1, it is the point that the decode thread should seek to, in ms. + char filename[_MAX_PATH]; + int filetype; /* 0: MP4; 1: AAC */ + int last_frame; + __int64 last_offset; + + /* MP4 stuff */ + MP4FileHandle mp4file; + int mp4track; + MP4SampleId numSamples; + MP4SampleId sampleId; + + /* AAC stuff */ + FILE *aacfile; + long m_aac_bytes_into_buffer; + long m_aac_bytes_consumed; + __int64 m_file_offset; + unsigned char *m_aac_buffer; + int m_at_eof; + double cur_pos_sec; + int m_header_type; + struct seek_list *m_head; + struct seek_list *m_tail; + unsigned long m_length; + + /* for gapless decoding */ + unsigned int useAacLength; + unsigned int framesize; + unsigned int initial; + unsigned long timescale; +} state; + +static state mp4state; + +//static In_Module module; // the output module (declared near the bottom of this file) +struct { + HINSTANCE hDllInstance; + HWND hMainWindow; + QCDModInitIn QCDCallbacks; +} module; +AudioInfo ai; + +static int killPlayThread; +static int PlayThreadAlive = 0; // 1=play thread still running +HANDLE play_thread_handle = INVALID_HANDLE_VALUE; // the handle to the decode thread + +/* Function definitions */ +void *decode_aac_frame(state *st, faacDecFrameInfo *frameInfo); +DWORD WINAPI MP4PlayThread(void *b); // the decode thread procedure +DWORD WINAPI AACPlayThread(void *b); // the decode thread procedure + + +//typedef struct tag +//{ +// char *item; +// char *value; +//} tag; +// +//typedef struct medialib_tags +//{ +// struct tag *tags; +// unsigned int count; +//} medialib_tags; +// +//int tag_add_field(medialib_tags *tags, const char *item, const char *value) +//{ +// void *backup = (void *)tags->tags; +// +// if (!item || (item && !*item) || !value) return 0; +// +// tags->tags = (struct tag *)realloc(tags->tags, (tags->count+1) * sizeof(tag)); +// if (!tags->tags) { +// if (backup) free(backup); +// return 0; +// } +// else +// { +// int i_len = strlen(item); +// int v_len = strlen(value); +// +// tags->tags[tags->count].item = (char *)malloc(i_len+1); +// tags->tags[tags->count].value = (char *)malloc(v_len+1); +// +// if (!tags->tags[tags->count].item || !tags->tags[tags->count].value) +// { +// if (!tags->tags[tags->count].item) free (tags->tags[tags->count].item); +// if (!tags->tags[tags->count].value) free (tags->tags[tags->count].value); +// tags->tags[tags->count].item = NULL; +// tags->tags[tags->count].value = NULL; +// return 0; +// } +// +// memcpy(tags->tags[tags->count].item, item, i_len); +// memcpy(tags->tags[tags->count].value, value, v_len); +// tags->tags[tags->count].item[i_len] = '\0'; +// tags->tags[tags->count].value[v_len] = '\0'; +// +// tags->count++; +// return 1; +// } +//} +// +//int tag_set_field(medialib_tags *tags, const char *item, const char *value) +//{ +// unsigned int i; +// +// if (!item || (item && !*item) || !value) return 0; +// +// for (i = 0; i < tags->count; i++) +// { +// if (!stricmp(tags->tags[i].item, item)) +// { +// void *backup = (void *)tags->tags[i].value; +// int v_len = strlen(value); +// +// tags->tags[i].value = (char *)realloc(tags->tags[i].value, v_len+1); +// if (!tags->tags[i].value) +// { +// if (backup) free(backup); +// return 0; +// } +// +// memcpy(tags->tags[i].value, value, v_len); +// tags->tags[i].value[v_len] = '\0'; +// +// return 1; +// } +// } +// +// return tag_add_field(tags, item, value); +//} +// +//int tag_delete(medialib_tags *tags) +//{ +// unsigned int i; +// +// for (i = 0; i < tags->count; i++) +// { +// if (tags->tags[i].item) free(tags->tags[i].item); +// if (tags->tags[i].value) free(tags->tags[i].value); +// } +// +// if (tags->tags) free(tags->tags); +// +// tags->tags = NULL; +// tags->count = 0; +//} +// +//int ReadMP4Tag(MP4FileHandle file, medialib_tags *tags) +//{ +// unsigned __int32 valueSize; +// unsigned __int8 *pValue; +// char *pName; +// unsigned int i = 0; +// +// do { +// pName = 0; +// pValue = 0; +// valueSize = 0; +// +// MP4GetMetadataByIndex(file, i, (const char **)&pName, &pValue, &valueSize); +// +// if (valueSize > 0) +// { +// char *val = (char *)malloc(valueSize+1); +// if (!val) return 0; +// memcpy(val, pValue, valueSize); +// val[valueSize] = '\0'; +// +// if (pName[0] == '\xa9') +// { +// if (memcmp(pName, "©nam", 4) == 0) +// { +// tag_add_field(tags, "title", val); +// } else if (memcmp(pName, "©ART", 4) == 0) { +// tag_add_field(tags, "artist", val); +// } else if (memcmp(pName, "©wrt", 4) == 0) { +// tag_add_field(tags, "writer", val); +// } else if (memcmp(pName, "©alb", 4) == 0) { +// tag_add_field(tags, "album", val); +// } else if (memcmp(pName, "©day", 4) == 0) { +// tag_add_field(tags, "date", val); +// } else if (memcmp(pName, "©too", 4) == 0) { +// tag_add_field(tags, "tool", val); +// } else if (memcmp(pName, "©cmt", 4) == 0) { +// tag_add_field(tags, "comment", val); +// } else if (memcmp(pName, "©gen", 4) == 0) { +// tag_add_field(tags, "genre", val); +// } else { +// tag_add_field(tags, pName, val); +// } +// } else if (memcmp(pName, "gnre", 4) == 0) { +// char *t=0; +// if (MP4GetMetadataGenre(file, &t)) +// { +// tag_add_field(tags, "genre", t); +// } +// } else if (memcmp(pName, "trkn", 4) == 0) { +// unsigned __int16 trkn = 0, tot = 0; +// char t[200]; +// if (MP4GetMetadataTrack(file, &trkn, &tot)) +// { +// if (tot > 0) +// wsprintf(t, "%d/%d", trkn, tot); +// else +// wsprintf(t, "%d", trkn); +// tag_add_field(tags, "tracknumber", t); +// } +// } else if (memcmp(pName, "disk", 4) == 0) { +// unsigned __int16 disk = 0, tot = 0; +// char t[200]; +// if (MP4GetMetadataDisk(file, &disk, &tot)) +// { +// if (tot > 0) +// wsprintf(t, "%d/%d", disk, tot); +// else +// wsprintf(t, "%d", disk); +// tag_add_field(tags, "disc", t); +// } +// } else if (memcmp(pName, "cpil", 4) == 0) { +// unsigned __int8 cpil = 0; +// char t[200]; +// if (MP4GetMetadataCompilation(file, &cpil)) +// { +// wsprintf(t, "%d", cpil); +// tag_add_field(tags, "compilation", t); +// } +// } else if (memcmp(pName, "tmpo", 4) == 0) { +// unsigned __int16 tempo = 0; +// char t[200]; +// if (MP4GetMetadataTempo(file, &tempo)) +// { +// wsprintf(t, "%d BPM", tempo); +// tag_add_field(tags, "tempo", t); +// } +// } else if (memcmp(pName, "NDFL", 4) == 0) { +// /* Removed */ +// } else { +// tag_add_field(tags, pName, val); +// } +// +// free(val); +// } +// +// i++; +// } while (valueSize > 0); +// +// return 1; +//} +// +//int mp4_set_metadata(MP4FileHandle file, const char *item, const char *val) +//{ +// if (!item || (item && !*item) || !val || (val && !*val)) return 0; +// +// if (!stricmp(item, "track") || !stricmp(item, "tracknumber")) +// { +// unsigned __int16 trkn, tot; +// int t1 = 0, t2 = 0; +// sscanf(val, "%d/%d", &t1, &t2); +// trkn = t1, tot = t2; +// if (!trkn) return 1; +// if (MP4SetMetadataTrack(file, trkn, tot)) return 1; +// } +// else if (!stricmp(item, "disc") || !stricmp(item, "disknumber")) +// { +// unsigned __int16 disk, tot; +// int t1 = 0, t2 = 0; +// sscanf(val, "%d/%d", &t1, &t2); +// disk = t1, tot = t2; +// if (!disk) return 1; +// if (MP4SetMetadataDisk(file, disk, tot)) return 1; +// } +// else if (!stricmp(item, "compilation")) +// { +// unsigned __int8 cpil = atoi(val); +// if (!cpil) return 1; +// if (MP4SetMetadataCompilation(file, cpil)) return 1; +// } +// else if (!stricmp(item, "tempo")) +// { +// unsigned __int16 tempo = atoi(val); +// if (!tempo) return 1; +// if (MP4SetMetadataTempo(file, tempo)) return 1; +// } +// else if (!stricmp(item, "artist")) +// { +// if (MP4SetMetadataArtist(file, val)) return 1; +// } +// else if (!stricmp(item, "writer")) +// { +// if (MP4SetMetadataWriter(file, val)) return 1; +// } +// else if (!stricmp(item, "title")) +// { +// if (MP4SetMetadataName(file, val)) return 1; +// } +// else if (!stricmp(item, "album")) +// { +// if (MP4SetMetadataAlbum(file, val)) return 1; +// } +// else if (!stricmp(item, "date") || !stricmp(item, "year")) +// { +// if (MP4SetMetadataYear(file, val)) return 1; +// } +// else if (!stricmp(item, "comment")) +// { +// if (MP4SetMetadataComment(file, val)) return 1; +// } +// else if (!stricmp(item, "genre")) +// { +// if (MP4SetMetadataGenre(file, val)) return 1; +// } +// else if (!stricmp(item, "tool")) +// { +// if (MP4SetMetadataTool(file, val)) return 1; +// } +// else +// { +// if (MP4SetMetadataFreeForm(file, (char *)item, (u_int8_t *)val, (u_int32_t)strlen(val))) return 1; +// } +// +// return 0; +//} +// +//int WriteMP4Tag(MP4FileHandle file, const medialib_tags *tags) +//{ +// unsigned int i; +// +// for (i = 0; i < tags->count; i++) +// { +// const char *item = tags->tags[i].item; +// const char *value = tags->tags[i].value; +// +// if (value && *value) +// { +// mp4_set_metadata(file, item, value); +// } +// } +//} + + +#ifdef DEBUG_OUTPUT +void in_mp4_DebugOutput(char *message) +{ + char s[1024]; + + sprintf(s, "in_mp4: %s: %s", mp4state.filename, message); + OutputDebugString(s); +} +#endif + +int file_length(FILE *f) +{ + long end = 0; + long cur = ftell(f); + fseek(f, 0, SEEK_END); + end = ftell(f); + fseek(f, cur, SEEK_SET); + + return end; +} + +static void show_error(HWND hwnd, char *message, ...) +{ + if (m_show_errors) + MessageBox(hwnd, message, "Error", MB_OK); +} + +static void config_init() +{ + //char *p=INI_FILE; + //GetModuleFileName(NULL,INI_FILE,_MAX_PATH); + //while (*p) p++; + //while (p >= INI_FILE && *p != '.') p--; + //strcpy(p+1,"ini"); + module.QCDCallbacks.Service(opGetPluginSettingsFile, INI_FILE, MAX_PATH, 0); +} + +void config_read() +{ + char priority[10]; + char resolution[10]; + char show_errors[10]; + char use_for_aac[10]; + char downmix[10]; + char vbr_display[10]; + + config_init(); + + strcpy(show_errors, "1"); + strcpy(priority, "3"); + strcpy(resolution, "0"); + strcpy(use_for_aac, "1"); + strcpy(downmix, "0"); + strcpy(vbr_display, "1"); + //strcpy(titleformat, "%7"); + + RS(priority); + RS(resolution); + RS(show_errors); + RS(use_for_aac); + RS(downmix); + RS(vbr_display); + //RS(titleformat); + + m_priority = atoi(priority); + m_resolution = atoi(resolution); + m_show_errors = atoi(show_errors); + m_use_for_aac = atoi(use_for_aac); + m_downmix = atoi(downmix); + m_vbr_display = atoi(vbr_display); +} + +void config_write() +{ + char priority[10]; + char resolution[10]; + char show_errors[10]; + char use_for_aac[10]; + char downmix[10]; + char vbr_display[10]; + + itoa(m_priority, priority, 10); + itoa(m_resolution, resolution, 10); + itoa(m_show_errors, show_errors, 10); + itoa(m_use_for_aac, use_for_aac, 10); + itoa(m_downmix, downmix, 10); + itoa(m_vbr_display, vbr_display, 10); + + WS(priority); + WS(resolution); + WS(show_errors); + WS(use_for_aac); + WS(downmix); + WS(vbr_display); + //WS(titleformat); +} + +int Initialize(QCDModInfo *ModInfo, int flags) +{ + ModInfo->moduleString = "MP4 Plug-in v" FAAD2_VERSION; + + module.hMainWindow = (HWND)module.QCDCallbacks.Service(opGetParentWnd, 0, 0, 0); + + // read config from config file + config_read(); + + ModInfo->moduleExtensions = !m_use_for_aac ? "MP4:M4A" : "MP4:M4A:AAC"; + + // return TRUE for successful initialization + return 1; +} + +//---------------------------------------------------------------------------- + +void ShutDown(int flags) +{ + Stop(mp4state.filename, STOPFLAG_FORCESTOP); +} + +///* Convert UNICODE to UTF-8 +// Return number of bytes written */ +//int unicodeToUtf8 ( const WCHAR* lpWideCharStr, char* lpMultiByteStr, int cwcChars ) +//{ +// const unsigned short* pwc = (unsigned short *)lpWideCharStr; +// unsigned char* pmb = (unsigned char *)lpMultiByteStr; +// const unsigned short* pwce; +// size_t cBytes = 0; +// +// if ( cwcChars >= 0 ) { +// pwce = pwc + cwcChars; +// } else { +// pwce = (unsigned short *)((size_t)-1); +// } +// +// while ( pwc < pwce ) { +// unsigned short wc = *pwc++; +// +// if ( wc < 0x00000080 ) { +// *pmb++ = (char)wc; +// cBytes++; +// } else +// if ( wc < 0x00000800 ) { +// *pmb++ = (char)(0xC0 | ((wc >> 6) & 0x1F)); +// cBytes++; +// *pmb++ = (char)(0x80 | (wc & 0x3F)); +// cBytes++; +// } else +// if ( wc < 0x00010000 ) { +// *pmb++ = (char)(0xE0 | ((wc >> 12) & 0x0F)); +// cBytes++; +// *pmb++ = (char)(0x80 | ((wc >> 6) & 0x3F)); +// cBytes++; +// *pmb++ = (char)(0x80 | (wc & 0x3F)); +// cBytes++; +// } +// if ( wc == L'\0' ) +// return cBytes; +// } +// +// return cBytes; +//} +// +///* Convert UTF-8 coded string to UNICODE +// Return number of characters converted */ +//int utf8ToUnicode ( const char* lpMultiByteStr, WCHAR* lpWideCharStr, int cmbChars ) +//{ +// const unsigned char* pmb = (unsigned char *)lpMultiByteStr; +// unsigned short* pwc = (unsigned short *)lpWideCharStr; +// const unsigned char* pmbe; +// size_t cwChars = 0; +// +// if ( cmbChars >= 0 ) { +// pmbe = pmb + cmbChars; +// } else { +// pmbe = (unsigned char *)((size_t)-1); +// } +// +// while ( pmb < pmbe ) { +// char mb = *pmb++; +// unsigned int cc = 0; +// unsigned int wc; +// +// while ( (cc < 7) && (mb & (1 << (7 - cc)))) { +// cc++; +// } +// +// if ( cc == 1 || cc > 6 ) // illegal character combination for UTF-8 +// continue; +// +// if ( cc == 0 ) { +// wc = mb; +// } else { +// wc = (mb & ((1 << (7 - cc)) - 1)) << ((cc - 1) * 6); +// while ( --cc > 0 ) { +// if ( pmb == pmbe ) // reached end of the buffer +// return cwChars; +// mb = *pmb++; +// if ( ((mb >> 6) & 0x03) != 2 ) // not part of multibyte character +// return cwChars; +// wc |= (mb & 0x3F) << ((cc - 1) * 6); +// } +// } +// +// if ( wc & 0xFFFF0000 ) +// wc = L'?'; +// *pwc++ = wc; +// cwChars++; +// if ( wc == L'\0' ) +// return cwChars; +// } +// +// return cwChars; +//} +// +///* convert Windows ANSI to UTF-8 */ +//int ConvertANSIToUTF8 ( const char* ansi, char* utf8 ) +//{ +// WCHAR* wszValue; // Unicode value +// size_t ansi_len; +// size_t len; +// +// *utf8 = '\0'; +// if ( ansi == NULL ) +// return 0; +// +// ansi_len = strlen ( ansi ); +// +// if ( (wszValue = (WCHAR *)malloc ( (ansi_len + 1) * 2 )) == NULL ) +// return 0; +// +// /* Convert ANSI value to Unicode */ +// if ( (len = MultiByteToWideChar ( CP_ACP, 0, ansi, ansi_len + 1, wszValue, (ansi_len + 1) * 2 )) == 0 ) { +// free ( wszValue ); +// return 0; +// } +// +// /* Convert Unicode value to UTF-8 */ +// if ( (len = unicodeToUtf8 ( wszValue, utf8, -1 )) == 0 ) { +// free ( wszValue ); +// return 0; +// } +// +// free ( wszValue ); +// +// return len-1; +//} +// +///* convert UTF-8 to Windows ANSI */ +//int ConvertUTF8ToANSI ( const char* utf8, char* ansi ) +//{ +// WCHAR* wszValue; // Unicode value +// size_t utf8_len; +// size_t len; +// +// *ansi = '\0'; +// if ( utf8 == NULL ) +// return 0; +// +// utf8_len = strlen ( utf8 ); +// +// if ( (wszValue = (WCHAR *)malloc ( (utf8_len + 1) * 2 )) == NULL ) +// return 0; +// +// /* Convert UTF-8 value to Unicode */ +// if ( (len = utf8ToUnicode ( utf8, wszValue, utf8_len + 1 )) == 0 ) { +// free ( wszValue ); +// return 0; +// } +// +// /* Convert Unicode value to ANSI */ +// if ( (len = WideCharToMultiByte ( CP_ACP, 0, wszValue, -1, ansi, (utf8_len + 1) * 2, NULL, NULL )) == 0 ) { +// free ( wszValue ); +// return 0; +// } +// +// free ( wszValue ); +// +// return len-1; +//} +// +//BOOL uSetDlgItemText(HWND hwnd, int id, const char *str) +//{ +// char *temp; +// size_t len; +// int r; +// +// if (!str) return FALSE; +// if (!*str) return TRUE; +// len = strlen(str); +// temp = malloc(len+1); +// if (!temp) return FALSE; +// r = ConvertUTF8ToANSI(str, temp); +// if (r > 0) +// SetDlgItemText(hwnd, id, temp); +// free(temp); +// +// return r>0 ? TRUE : FALSE; +//} +// +//UINT uGetDlgItemText(HWND hwnd, int id, char *str, int max) +//{ +// char *temp, *utf8; +// int len; +// HWND w; +// +// if (!str || !max) return 0; +// *str = '\0'; +// w = GetDlgItem(hwnd, id); +// len = GetWindowTextLength(w); +// temp = malloc(len+1); +// if (!temp) return 0; +// utf8 = malloc((len+1)*4); +// if (!utf8) +// { +// free(temp); +// return 0; +// } +// +// len = GetWindowText(w, temp, len+1); +// if (len > 0) +// { +// len = ConvertANSIToUTF8(temp, utf8); +// if (len > max-1) +// { +// len = max-1; +// utf8[max] = '\0'; +// } +// memcpy(str, utf8, len+1); +// } +// +// free(temp); +// free(utf8); +// +// return len; +//} +// +//BOOL CALLBACK mp4_info_dialog_proc(HWND hwndDlg, UINT message, +// WPARAM wParam, LPARAM lParam) +//{ +// char *file_info; +// MP4FileHandle file; +// char *pVal, dummy1[1024], dummy3; +// short dummy, dummy2; +// char temp[1024]; +// struct medialib_tags tags; +// tags.count = 0; +// tags.tags = NULL; +// +//#ifdef DEBUG_OUTPUT +// in_mp4_DebugOutput("mp4_info_dialog_proc"); +//#endif +// +// switch (message) { +// case WM_INITDIALOG: +// EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT), FALSE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT), SW_HIDE); +// EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), FALSE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), SW_HIDE); +// EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), FALSE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), SW_HIDE); +// +// file = MP4Read(info_fn, 0); +// +// if (file == MP4_INVALID_FILE_HANDLE) +// return FALSE; +// +// file_info = MP4Info(file, MP4_INVALID_TRACK_ID); +// SetDlgItemText(hwndDlg, IDC_INFOTEXT, file_info); +// free(file_info); +// +// /* get Metadata */ +// +// pVal = NULL; +// if (MP4GetMetadataName(file, &pVal)) +// uSetDlgItemText(hwndDlg,IDC_METANAME, pVal); +// +// pVal = NULL; +// if (MP4GetMetadataArtist(file, &pVal)) +// uSetDlgItemText(hwndDlg,IDC_METAARTIST, pVal); +// +// pVal = NULL; +// if (MP4GetMetadataWriter(file, &pVal)) +// uSetDlgItemText(hwndDlg,IDC_METAWRITER, pVal); +// +// pVal = NULL; +// if (MP4GetMetadataComment(file, &pVal)) +// uSetDlgItemText(hwndDlg,IDC_METACOMMENTS, pVal); +// +// pVal = NULL; +// if (MP4GetMetadataAlbum(file, &pVal)) +// uSetDlgItemText(hwndDlg,IDC_METAALBUM, pVal); +// +// pVal = NULL; +// if (MP4GetMetadataGenre(file, &pVal)) +// uSetDlgItemText(hwndDlg,IDC_METAGENRE, pVal); +// +// dummy = 0; +// MP4GetMetadataTempo(file, &dummy); +// if (dummy) +// { +// wsprintf(dummy1, "%d", dummy); +// SetDlgItemText(hwndDlg,IDC_METATEMPO, dummy1); +// } +// +// dummy = 0; dummy2 = 0; +// MP4GetMetadataTrack(file, &dummy, &dummy2); +// if (dummy) +// { +// wsprintf(dummy1, "%d", dummy); +// SetDlgItemText(hwndDlg,IDC_METATRACK1, dummy1); +// } +// if (dummy2) +// { +// wsprintf(dummy1, "%d", dummy2); +// SetDlgItemText(hwndDlg,IDC_METATRACK2, dummy1); +// } +// +// dummy = 0; dummy2 = 0; +// MP4GetMetadataDisk(file, &dummy, &dummy2); +// if (dummy) +// { +// wsprintf(dummy1, "%d", dummy); +// SetDlgItemText(hwndDlg,IDC_METADISK1, dummy1); +// } +// if (dummy2) +// { +// wsprintf(dummy1, "%d", dummy2); +// SetDlgItemText(hwndDlg,IDC_METADISK2, dummy1); +// } +// +// pVal = NULL; +// if (MP4GetMetadataYear(file, &pVal)) +// uSetDlgItemText(hwndDlg,IDC_METAYEAR, pVal); +// +// dummy3 = 0; +// MP4GetMetadataCompilation(file, &dummy3); +// if (dummy3) +// SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_SETCHECK, BST_CHECKED, 0); +// +// /* ! Metadata */ +// +// MP4Close(file); +// +// return TRUE; +// +// case WM_COMMAND: +// switch (LOWORD(wParam)) { +// case IDCANCEL: +// EndDialog(hwndDlg, wParam); +// return TRUE; +// case IDOK: +// +// /* save Metadata changes */ +// +// tag_delete(&tags); +// file = MP4Read(info_fn, 0); +// if (file != MP4_INVALID_FILE_HANDLE) +// { +// ReadMP4Tag(file, &tags); +// MP4Close(file); +// +// file = MP4Modify(info_fn, 0, 0); +// if (file != MP4_INVALID_FILE_HANDLE) +// { +// MP4MetadataDelete(file); +// MP4Close(file); +// } +// } +// +// file = MP4Modify(info_fn, 0, 0); +// if (file == MP4_INVALID_FILE_HANDLE) +// { +// tag_delete(&tags); +// EndDialog(hwndDlg, wParam); +// return FALSE; +// } +// +// uGetDlgItemText(hwndDlg, IDC_METANAME, dummy1, 1024); +// tag_set_field(&tags, "title", dummy1); +// +// uGetDlgItemText(hwndDlg, IDC_METAWRITER, dummy1, 1024); +// tag_set_field(&tags, "writer", dummy1); +// +// uGetDlgItemText(hwndDlg, IDC_METAARTIST, dummy1, 1024); +// tag_set_field(&tags, "artist", dummy1); +// +// uGetDlgItemText(hwndDlg, IDC_METAALBUM, dummy1, 1024); +// tag_set_field(&tags, "album", dummy1); +// +// uGetDlgItemText(hwndDlg, IDC_METACOMMENTS, dummy1, 1024); +// tag_set_field(&tags, "comment", dummy1); +// +// uGetDlgItemText(hwndDlg, IDC_METAGENRE, dummy1, 1024); +// tag_set_field(&tags, "genre", dummy1); +// +// uGetDlgItemText(hwndDlg, IDC_METAYEAR, dummy1, 1024); +// tag_set_field(&tags, "year", dummy1); +// +// GetDlgItemText(hwndDlg, IDC_METATRACK1, dummy1, 1024); +// dummy = atoi(dummy1); +// GetDlgItemText(hwndDlg, IDC_METATRACK2, dummy1, 1024); +// dummy2 = atoi(dummy1); +// wsprintf(temp, "%d/%d", dummy, dummy2); +// tag_set_field(&tags, "track", temp); +// +// GetDlgItemText(hwndDlg, IDC_METADISK1, dummy1, 1024); +// dummy = atoi(dummy1); +// GetDlgItemText(hwndDlg, IDC_METADISK2, dummy1, 1024); +// dummy2 = atoi(dummy1); +// wsprintf(temp, "%d/%d", dummy, dummy2); +// tag_set_field(&tags, "disc", temp); +// +// GetDlgItemText(hwndDlg, IDC_METATEMPO, dummy1, 1024); +// tag_set_field(&tags, "tempo", dummy1); +// +// dummy3 = SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_GETCHECK, 0, 0); +// tag_set_field(&tags, "compilation", (dummy3 ? "1" : "0")); +// +// WriteMP4Tag(file, &tags); +// +// MP4Close(file); +// +// MP4Optimize(info_fn, NULL, 0); +// /* ! */ +// +// EndDialog(hwndDlg, wParam); +// return TRUE; +// } +// } +// return FALSE; +//} +// +///* returns the name of the object type */ +//char *get_ot_string(int ot) +//{ +// switch (ot) +// { +// case 0: +// return "Main"; +// case 1: +// return "LC"; +// case 2: +// return "SSR"; +// case 3: +// return "LTP"; +// } +// return NULL; +//} +// +//BOOL CALLBACK aac_info_dialog_proc(HWND hwndDlg, UINT message, +// WPARAM wParam, LPARAM lParam) +//{ +// faadAACInfo aacInfo; +// char *info_text, *header_string; +// +//#ifdef DEBUG_OUTPUT +// in_mp4_DebugOutput("aac_info_dialog_proc"); +//#endif +// +// switch (message) { +// case WM_INITDIALOG: +// EnableWindow(GetDlgItem(hwndDlg,IDC_USERDATA), FALSE) ; +// ShowWindow(GetDlgItem(hwndDlg,IDC_USERDATA), SW_HIDE); +// +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC1), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC2), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC3), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC4), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC5), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC6), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC7), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC8), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC9), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC10), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC11), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC12), SW_HIDE); +// +// ShowWindow(GetDlgItem(hwndDlg,IDC_METANAME), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METAARTIST), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METAWRITER), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METACOMMENTS), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METAALBUM), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METAGENRE), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METATEMPO), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METATRACK1), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METATRACK2), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METADISK1), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METADISK2), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METAYEAR), SW_HIDE); +// ShowWindow(GetDlgItem(hwndDlg,IDC_METACOMPILATION), SW_HIDE); +// +// info_text = malloc(1024*sizeof(char)); +// +// get_AAC_format(info_fn, &aacInfo); +// +// switch (aacInfo.headertype) +// { +// case 0: /* RAW */ +// header_string = " RAW"; +// break; +// case 1: /* ADIF */ +// header_string = " ADIF"; +// break; +// case 2: /* ADTS */ +// header_string = " ADTS"; +// break; +// } +// +// sprintf(info_text, "%s AAC %s%s, %d sec, %d kbps, %d Hz", +// (aacInfo.version==2)?"MPEG-2":"MPEG-4", get_ot_string(aacInfo.object_type), +// header_string, +// (int)((float)aacInfo.length/1000.0), (int)((float)aacInfo.bitrate/1000.0+0.5), +// aacInfo.sampling_rate); +// +// SetDlgItemText(hwndDlg, IDC_INFOTEXT, info_text); +// +// free(info_text); +// +// return TRUE; +// +// case WM_COMMAND: +// switch (LOWORD(wParam)) +// { +// case IDC_CONVERT: +// { +// char mp4FileName[256]; +// char *extension; +// OPENFILENAME ofn; +// +// lstrcpy(mp4FileName, info_fn); +// extension = strrchr(mp4FileName, '.'); +// lstrcpy(extension, ".mp4"); +// +// memset(&ofn, 0, sizeof(OPENFILENAME)); +// ofn.lStructSize = sizeof(OPENFILENAME); +// ofn.hwndOwner = hwndDlg; +// ofn.hInstance = module.hDllInstance; +// ofn.nMaxFileTitle = 31; +// ofn.lpstrFile = (LPSTR)mp4FileName; +// ofn.nMaxFile = _MAX_PATH; +// ofn.lpstrFilter = "MP4 Files (*.mp4)\0*.mp4\0"; +// ofn.lpstrDefExt = "mp4"; +// ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY; +// ofn.lpstrTitle = "Select Output File"; +// +// if (GetSaveFileName(&ofn)) +// { +// if (covert_aac_to_mp4(info_fn, mp4FileName)) +// { +// MessageBox(hwndDlg, "An error occured while converting AAC to MP4!", "An error occured!", MB_OK); +// return FALSE; +// } +// } +// return TRUE; +// } +// case IDCANCEL: +// case IDOK: +// EndDialog(hwndDlg, wParam); +// return TRUE; +// } +// } +// return FALSE; +//} +// +//int infoDlg(char *fn, HWND hwndParent) +//{ +// if(!stricmp(fn + strlen(fn) - 3,"AAC")) +// { +// lstrcpy(info_fn, fn); +// +// DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_INFO), +// hwndParent, aac_info_dialog_proc); +// } else { +// lstrcpy(info_fn, fn); +// +// DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_INFO), +// hwndParent, mp4_info_dialog_proc); +// } +// +// return 0; +//} +// +///* Get the title from the file */ +//void ConstructTitle(MP4FileHandle file, char *filename, char *title, char *format) +//{ +// char temp[4096]; +// int some_info = 0; +// char *in = format; +// char *out = temp;//title; +// char *bound = out + sizeof(temp) - 256; //out + (MAX_PATH - 10 - 1); +// char *pVal, dummy1[1024]; +// short dummy, dummy2; +// +// while (*in && out < bound) +// { +// switch (*in) +// { +// case '%': +// ++in; +// break; +// +// default: +// *out++ = *in++; +// continue; +// } +// +// /* handle % escape sequence */ +// switch (*in++) +// { +// case '0': +// dummy = 0; dummy2 = 0; +// if (MP4GetMetadataTrack(file, &dummy, &dummy2)) +// { +// out += wsprintf(out, "%d", (int)dummy); +// some_info = 1; +// } +// break; +// +// case '1': +// pVal = NULL; +// if (MP4GetMetadataArtist(file, &pVal)) +// { +// out += wsprintf(out, "%s", pVal); +// some_info = 1; +// } +// break; +// +// case '2': +// pVal = NULL; +// if (MP4GetMetadataName(file, &pVal)) +// { +// out += wsprintf(out, "%s", pVal); +// some_info = 1; +// } +// break; +// +// case '3': +// pVal = NULL; +// if (MP4GetMetadataAlbum(file, &pVal)) +// { +// out += wsprintf(out, "%s", pVal); +// some_info = 1; +// } +// break; +// +// case '4': +// pVal = NULL; +// if (MP4GetMetadataYear(file, &pVal)) +// { +// out += wsprintf(out, "%s", pVal); +// some_info = 1; +// } +// break; +// +// case '5': +// pVal = NULL; +// if (MP4GetMetadataComment(file, &pVal)) +// { +// out += wsprintf(out, "%s", pVal); +// some_info = 1; +// } +// break; +// +// case '6': +// pVal = NULL; +// if (MP4GetMetadataGenre(file, &pVal)) +// { +// out += wsprintf(out, "%s", pVal); +// some_info = 1; +// } +// break; +// +// case '7': +// { +// const char *p=strrchr(filename,'\\'); +// if (!p) p=filename; else p++; +// out += ConvertANSIToUTF8(p, out); +// some_info = 1; +// break; +// } +// +// default: +// break; +// } +// } +// +// *out = '\0'; +// +// if (!some_info) +// { +// char *p=filename+lstrlen(filename); +// while (*p != '\\' && p >= filename) p--; +// lstrcpy(title,++p); +// } +// else +// { +// int len = ConvertUTF8ToANSI(temp, dummy1); +// if (len > (MAX_PATH - 10 - 1)) len = (MAX_PATH - 10 - 1); +// memcpy(title, dummy1, len); +// title[len] = '\0'; +// } +//} + +BOOL CALLBACK config_dialog_proc(HWND hwndDlg, UINT message, + WPARAM wParam, LPARAM lParam) +{ + int i; + + switch (message) { + case WM_INITDIALOG: + SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_SETRANGE, TRUE, MAKELONG(1,5)); + SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_SETPOS, TRUE, m_priority); + SendMessage(GetDlgItem(hwndDlg, res_id_table[m_resolution]), BM_SETCHECK, BST_CHECKED, 0); + if (m_show_errors) + SendMessage(GetDlgItem(hwndDlg, IDC_ERROR), BM_SETCHECK, BST_CHECKED, 0); + if (m_use_for_aac) + SendMessage(GetDlgItem(hwndDlg, IDC_USEFORAAC), BM_SETCHECK, BST_CHECKED, 0); + if (m_downmix) + SendMessage(GetDlgItem(hwndDlg, IDC_DOWNMIX), BM_SETCHECK, BST_CHECKED, 0); + if (m_vbr_display) + SendMessage(GetDlgItem(hwndDlg, IDC_VBR), BM_SETCHECK, BST_CHECKED, 0); + SetDlgItemText(hwndDlg, IDC_TITLEFORMAT, titleformat); + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDCANCEL: + EndDialog(hwndDlg, wParam); + return TRUE; + case IDOK: + m_show_errors = SendMessage(GetDlgItem(hwndDlg, IDC_ERROR), BM_GETCHECK, 0, 0); + m_use_for_aac = SendMessage(GetDlgItem(hwndDlg, IDC_USEFORAAC), BM_GETCHECK, 0, 0); + m_downmix = SendMessage(GetDlgItem(hwndDlg, IDC_DOWNMIX), BM_GETCHECK, 0, 0); + m_vbr_display = SendMessage(GetDlgItem(hwndDlg, IDC_VBR), BM_GETCHECK, 0, 0); + GetDlgItemText(hwndDlg, IDC_TITLEFORMAT, titleformat, MAX_PATH); + + m_priority = SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_GETPOS, 0, 0); + for (i = 0; i < 6; i++) + { + if (SendMessage(GetDlgItem(hwndDlg, res_id_table[i]), BM_GETCHECK, 0, 0)) + { + m_resolution = i; + break; + } + } + + /* save config */ + config_write(); + + //if (!m_use_for_aac) + //{ + // module.FileExtensions = short_ext_list; + //} else { + // module.FileExtensions = long_ext_list; + //} + + EndDialog(hwndDlg, wParam); + return TRUE; + } + } + return FALSE; +} + +void Configure(int flags) +{ + DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_CONFIG), + module.hMainWindow, config_dialog_proc); +} + +//----------------------------------------------------------------------------- + +void About(int flags) +{ + MessageBox(module.hMainWindow, + "AudioCoding.com MPEG-4 General Audio player " FAAD2_VERSION " compiled on " __DATE__ ".\n" + "Visit the website for more info.\n" + "Ported to QCD by Shao Hao.\n" + "Copyright 2002-2003 AudioCoding.com", + "About", + MB_OK); +} + +//----------------------------------------------------------------------------- + +int fill_buffer(state *st) +{ + int bread; + + if (st->m_aac_bytes_consumed > 0) + { + if (st->m_aac_bytes_into_buffer) + { + memmove((void*)st->m_aac_buffer, (void*)(st->m_aac_buffer + st->m_aac_bytes_consumed), + st->m_aac_bytes_into_buffer*sizeof(unsigned char)); + } + + if (!st->m_at_eof) + { + bread = fread((void*)(st->m_aac_buffer + st->m_aac_bytes_into_buffer), + 1, st->m_aac_bytes_consumed, st->aacfile); + + if (bread != st->m_aac_bytes_consumed) + st->m_at_eof = 1; + + st->m_aac_bytes_into_buffer += bread; + } + + st->m_aac_bytes_consumed = 0; + + if (st->m_aac_bytes_into_buffer > 3) + { + if (memcmp(st->m_aac_buffer, "TAG", 3) == 0) + st->m_aac_bytes_into_buffer = 0; + } + if (st->m_aac_bytes_into_buffer > 11) + { + if (memcmp(st->m_aac_buffer, "LYRICSBEGIN", 11) == 0) + st->m_aac_bytes_into_buffer = 0; + } + if (st->m_aac_bytes_into_buffer > 8) + { + if (memcmp(st->m_aac_buffer, "APETAGEX", 8) == 0) + st->m_aac_bytes_into_buffer = 0; + } + } + + return 1; +} + +void advance_buffer(state *st, int bytes) +{ + st->m_file_offset += bytes; + st->m_aac_bytes_consumed = bytes; + st->m_aac_bytes_into_buffer -= bytes; +} + +int adts_parse(state *st, __int64 *bitrate, double *length) +{ + static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000}; + int frames, frame_length; + int t_framelength = 0; + int samplerate; + double frames_per_sec, bytes_per_frame; + + /* Read all frames to ensure correct time and bitrate */ + for (frames = 0; /* */; frames++) + { + fill_buffer(st); + + if (st->m_aac_bytes_into_buffer > 7) + { + /* check syncword */ + if (!((st->m_aac_buffer[0] == 0xFF)&&((st->m_aac_buffer[1] & 0xF6) == 0xF0))) + break; + + st->m_tail->offset = st->m_file_offset; + st->m_tail->next = (struct seek_list*)malloc(sizeof(struct seek_list)); + st->m_tail = st->m_tail->next; + st->m_tail->next = NULL; + + if (frames == 0) + samplerate = sample_rates[(st->m_aac_buffer[2]&0x3c)>>2]; + + frame_length = ((((unsigned int)st->m_aac_buffer[3] & 0x3)) << 11) + | (((unsigned int)st->m_aac_buffer[4]) << 3) | (st->m_aac_buffer[5] >> 5); + + t_framelength += frame_length; + + if (frame_length > st->m_aac_bytes_into_buffer) + break; + + advance_buffer(st, frame_length); + } else { + break; + } + } + + frames_per_sec = (double)samplerate/1024.0; + if (frames != 0) + bytes_per_frame = (double)t_framelength/(double)(frames*1000); + else + bytes_per_frame = 0; + *bitrate = (__int64)(8. * bytes_per_frame * frames_per_sec + 0.5); + if (frames_per_sec != 0) + *length = (double)frames/frames_per_sec; + else + *length = 1; + + return 1; +} + +int skip_id3v2_tag() +{ + unsigned char buf[10]; + int bread, tagsize = 0; + + bread = fread(buf, 1, 10, mp4state.aacfile); + if (bread != 10) return -1; + + if (!memcmp(buf, "ID3", 3)) + { + /* high bit is not used */ + tagsize = (buf[6] << 21) | (buf[7] << 14) | (buf[8] << 7) | (buf[9] << 0); + + tagsize += 10; + fseek(mp4state.aacfile, tagsize, SEEK_SET); + } else { + fseek(mp4state.aacfile, 0, SEEK_SET); + } + + return tagsize; +} + +int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo) +{ + int tagsize = 0, init; + + if (!medianame || !*medianame) + return 0; + + if (!stricmp(medianame + strlen(medianame) - 3,"MP4") || !stricmp(medianame + strlen(medianame) - 3,"M4A")) + { + if (mediaInfo) + { + mediaInfo->mediaType = DIGITAL_FILE_MEDIA; + mediaInfo->op_canSeek = 1; + } + return 1; + } + else if (m_use_for_aac && !stricmp(medianame + strlen(medianame) - 3,"AAC")) + { + if (mediaInfo) + { + mediaInfo->mediaType = DIGITAL_FILE_MEDIA; + mediaInfo->op_canSeek = 1; + + memset(&mp4state, 0, sizeof(state)); + lstrcpy(mp4state.filename, medianame); + + if (!(mp4state.aacfile = fopen(mp4state.filename, "rb"))) + { + // error + return 0; + } + + tagsize = skip_id3v2_tag(); + if (tagsize<0) return 0; + + if (!(mp4state.m_aac_buffer = (unsigned char*)malloc(768*6))) + { + show_error(module.hMainWindow, "Memory allocation error."); + return 0; + } + + for (init=0; init<2; init++) + { + memset(mp4state.m_aac_buffer, 0, 768*6); + fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile); + + if (init==0) + fseek(mp4state.aacfile, tagsize, SEEK_SET); + } + + if (memcmp(mp4state.m_aac_buffer, "ADIF", 4) == 0) + mediaInfo->op_canSeek = (double)file_length(mp4state.aacfile) == -1 ? 0 : 1; + + free(mp4state.m_aac_buffer); + + fclose(mp4state.aacfile); + } + return 1; + } + + return 0; +} + +//----------------------------------------------------------------------------- + +int Play(const char* medianame, int playfrom, int playto, int flags) +{ + WAVEFORMATEX wf; + //int maxlatency; + int thread_id; + int avg_bitrate, br, sr; + unsigned char *buffer; + int buffer_size; + faacDecConfigurationPtr config; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("play"); +#endif + + if (stricmp(mp4state.filename, medianame) != 0) + Stop(mp4state.filename, STOPFLAG_PLAYDONE); + + if (mp4state.paused) + { + // Update the player controls to reflect the new unpaused state + module.QCDCallbacks.toPlayer.OutputPause(0); + + Pause(medianame, 0); + + if (playfrom >= 0) + mp4state.seek_needed = playfrom; + } + else if (PlayThreadAlive) // is playing + { + mp4state.seek_needed = playfrom; + return 1; + } + else + { + memset(&mp4state, 0, sizeof(state)); + + lstrcpy(mp4state.filename, medianame); + + if (!(mp4state.mp4file = MP4Read(mp4state.filename, 0))) + { + mp4state.filetype = 1; + } else { + MP4Close(mp4state.mp4file); + mp4state.filetype = 0; + } + + if (mp4state.filetype) + { + int tagsize = 0, tmp = 0, init; + int bread = 0; + double length = 0.; + __int64 bitrate = 128; + + //module.is_seekable = 1; + + if (!(mp4state.aacfile = fopen(mp4state.filename, "rb"))) + { + // error + return -1; + } + + tagsize = skip_id3v2_tag(); + if (tagsize<0) return 0; + + if (!(mp4state.m_aac_buffer = (unsigned char*)malloc(768*6))) + { + show_error(module.hMainWindow, "Memory allocation error."); + return -1; + } + + for (init=0; init<2; init++) + { + mp4state.hDecoder = faacDecOpen(); + if (!mp4state.hDecoder) + { + show_error(module.hMainWindow, "Unable to open decoder library."); + return -1; + } + + config = faacDecGetCurrentConfiguration(mp4state.hDecoder); + config->outputFormat = m_resolution + 1; + config->downMatrix = m_downmix; + faacDecSetConfiguration(mp4state.hDecoder, config); + + memset(mp4state.m_aac_buffer, 0, 768*6); + bread = fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile); + mp4state.m_aac_bytes_into_buffer = bread; + mp4state.m_aac_bytes_consumed = 0; + mp4state.m_file_offset = 0; + mp4state.m_at_eof = (bread != 768*6) ? 1 : 0; + + if (init==0) + { + faacDecFrameInfo frameInfo; + + fill_buffer(&mp4state); + + if ((mp4state.m_aac_bytes_consumed = faacDecInit(mp4state.hDecoder, + mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer, + &mp4state.samplerate, &mp4state.channels)) < 0) + { + show_error(module.hMainWindow, "Can't initialize decoder library."); + return -1; + } + advance_buffer(&mp4state, mp4state.m_aac_bytes_consumed); + + do { + memset(&frameInfo, 0, sizeof(faacDecFrameInfo)); + fill_buffer(&mp4state); + faacDecDecode(mp4state.hDecoder, &frameInfo, mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer); + } while (!frameInfo.samples && !frameInfo.error); + + if (frameInfo.error) + { + show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error)); + return -1; + } + + mp4state.channels = frameInfo.channels; + mp4state.samplerate = frameInfo.samplerate; + mp4state.framesize = (frameInfo.channels != 0) ? frameInfo.samples/frameInfo.channels : 0; + /* + sbr = frameInfo.sbr; + profile = frameInfo.object_type; + header_type = frameInfo.header_type; + */ + + faacDecClose(mp4state.hDecoder); + fseek(mp4state.aacfile, tagsize, SEEK_SET); + } + } + + mp4state.m_head = (struct seek_list*)malloc(sizeof(struct seek_list)); + mp4state.m_tail = mp4state.m_head; + mp4state.m_tail->next = NULL; + + mp4state.m_header_type = 0; + if ((mp4state.m_aac_buffer[0] == 0xFF) && ((mp4state.m_aac_buffer[1] & 0xF6) == 0xF0)) + { + if (1) //(can_seek) + { + adts_parse(&mp4state, &bitrate, &length); + fseek(mp4state.aacfile, tagsize, SEEK_SET); + + bread = fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile); + if (bread != 768*6) + mp4state.m_at_eof = 1; + else + mp4state.m_at_eof = 0; + mp4state.m_aac_bytes_into_buffer = bread; + mp4state.m_aac_bytes_consumed = 0; + + mp4state.m_header_type = 1; + } + } else if (memcmp(mp4state.m_aac_buffer, "ADIF", 4) == 0) { + int skip_size = (mp4state.m_aac_buffer[4] & 0x80) ? 9 : 0; + bitrate = ((unsigned int)(mp4state.m_aac_buffer[4 + skip_size] & 0x0F)<<19) | + ((unsigned int)mp4state.m_aac_buffer[5 + skip_size]<<11) | + ((unsigned int)mp4state.m_aac_buffer[6 + skip_size]<<3) | + ((unsigned int)mp4state.m_aac_buffer[7 + skip_size] & 0xE0); + + length = (double)file_length(mp4state.aacfile); + if (length == -1) + { + //module.is_seekable = 0; + length = 0; + } else { + length = ((double)length*8.)/((double)bitrate) + 0.5; + } + + mp4state.m_header_type = 2; + } else { + length = (double)file_length(mp4state.aacfile); + length = ((double)length*8.)/((double)bitrate*1000.) + 0.5; + + //module.is_seekable = 1; + } + + mp4state.m_length = (int)(length*1000.); + + fill_buffer(&mp4state); + if ((mp4state.m_aac_bytes_consumed = faacDecInit(mp4state.hDecoder, + mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer, + &mp4state.samplerate, &mp4state.channels)) < 0) + { + show_error(module.hMainWindow, "Can't initialize decoder library."); + return -1; + } + advance_buffer(&mp4state, mp4state.m_aac_bytes_consumed); + + if (mp4state.m_header_type == 2) + avg_bitrate = bitrate; + else + avg_bitrate = bitrate*1000; + } else { + mp4state.hDecoder = faacDecOpen(); + if (!mp4state.hDecoder) + { + show_error(module.hMainWindow, "Unable to open decoder library."); + return -1; + } + + config = faacDecGetCurrentConfiguration(mp4state.hDecoder); + config->outputFormat = m_resolution + 1; + config->downMatrix = m_downmix; + faacDecSetConfiguration(mp4state.hDecoder, config); + + mp4state.mp4file = MP4Read(mp4state.filename, 0); + if (!mp4state.mp4file) + { + show_error(module.hMainWindow, "Unable to open file."); + faacDecClose(mp4state.hDecoder); + return -1; + } + + if ((mp4state.mp4track = GetAACTrack(mp4state.mp4file)) < 0) + { + show_error(module.hMainWindow, "Unsupported Audio track type."); + faacDecClose(mp4state.hDecoder); + MP4Close(mp4state.mp4file); + return -1; + } + + buffer = NULL; + buffer_size = 0; + MP4GetTrackESConfiguration(mp4state.mp4file, mp4state.mp4track, + &buffer, &buffer_size); + if (!buffer) + { + faacDecClose(mp4state.hDecoder); + MP4Close(mp4state.mp4file); + return -1; + } + + if(faacDecInit2(mp4state.hDecoder, buffer, buffer_size, + &mp4state.samplerate, &mp4state.channels) < 0) + { + /* If some error initializing occured, skip the file */ + faacDecClose(mp4state.hDecoder); + MP4Close(mp4state.mp4file); + if (buffer) free (buffer); + return -1; + } + + /* for gapless decoding */ + { + mp4AudioSpecificConfig mp4ASC; + + mp4state.timescale = MP4GetTrackTimeScale(mp4state.mp4file, mp4state.mp4track); + mp4state.framesize = 1024; + mp4state.useAacLength = 0; + + if (buffer) + { + if (AudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0) + { + if (mp4ASC.frameLengthFlag == 1) mp4state.framesize = 960; + if (mp4ASC.sbr_present_flag == 1) mp4state.framesize *= 2; + } + } + } + + free(buffer); + + avg_bitrate = MP4GetTrackIntegerProperty(mp4state.mp4file, mp4state.mp4track, + "mdia.minf.stbl.stsd.mp4a.esds.decConfigDescr.avgBitrate"); + + mp4state.numSamples = MP4GetTrackNumberOfSamples(mp4state.mp4file, mp4state.mp4track); + mp4state.sampleId = 1; + + //module.is_seekable = 1; + } + + if (mp4state.channels == 0) + { + show_error(module.hMainWindow, "Number of channels not supported for playback."); + faacDecClose(mp4state.hDecoder); + if (mp4state.filetype) + fclose(mp4state.aacfile); + else + MP4Close(mp4state.mp4file); + return -1; + } + + if (m_downmix && (mp4state.channels == 5 || mp4state.channels == 6)) + mp4state.channels = 2; + + wf.wFormatTag = WAVE_FORMAT_PCM; + wf.cbSize = 0; + wf.nChannels = mp4state.channels; + wf.wBitsPerSample = res_table[m_resolution]; + wf.nSamplesPerSec = mp4state.samplerate; + wf.nBlockAlign = wf.nChannels * wf.wBitsPerSample / 8; + wf.nAvgBytesPerSec = wf.nSamplesPerSec * wf.nBlockAlign; + if (!module.QCDCallbacks.toPlayer.OutputOpen(mp4state.filename, &wf)) // error opening device + { + faacDecClose(mp4state.hDecoder); + if (mp4state.filetype) + fclose(mp4state.aacfile); + else + MP4Close(mp4state.mp4file); + return -1; + } + + mp4state.paused = 0; + mp4state.decode_pos_ms = 0; + mp4state.seek_needed = -1; + + //// initialize vis stuff + //module.SAVSAInit(maxlatency, mp4state.samplerate); + //module.VSASetInfo((int)mp4state.channels, mp4state.samplerate); + + br = (int)floor(((float)avg_bitrate + 500.0)/1000.0 + 0.5); + sr = (int)floor((float)mp4state.samplerate/1000.0 + 0.5); + ai.struct_size = sizeof(AudioInfo); + ai.frequency = sr*1000; + ai.bitrate = br*1000; + ai.mode = (mp4state.channels == 2) ? 0 : 3; + ai.layer = 0; + ai.level = 0; + strcpy(ai.text, mp4state.filetype ? "AAC" : "MP4"); + module.QCDCallbacks.Service(opSetAudioInfo, &ai, sizeof(AudioInfo), 0); + + //module.outMod->SetVolume(-666); // set the output plug-ins default volume + + killPlayThread = 0; + + if (mp4state.filetype) + { + if ((play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AACPlayThread, + (void *)&killPlayThread, 0, &thread_id)) == NULL) + { + show_error(module.hMainWindow, "Cannot create playback thread"); + faacDecClose(mp4state.hDecoder); + fclose(mp4state.aacfile); + return -1; + } + } else { + if ((play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MP4PlayThread, + (void *)&killPlayThread, 0, &thread_id)) == NULL) + { + show_error(module.hMainWindow, "Cannot create playback thread"); + faacDecClose(mp4state.hDecoder); + MP4Close(mp4state.mp4file); + return -1; + } + } + + SetThreadAffinityMask(play_thread_handle, 1); + + SetThreadPriority(play_thread_handle, priority_table[m_priority]); + } + + return 1; +} + +//----------------------------------------------------------------------------- + +int Pause(const char* medianame, int flags) +{ +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("pause"); +#endif + + mp4state.paused = flags; + + if (module.QCDCallbacks.toPlayer.OutputPause(flags)) + return 1; + + mp4state.paused = !flags; + return 0; +} + +//void unpause() +//{ +//#ifdef DEBUG_OUTPUT +// in_mp4_DebugOutput("unpause"); +//#endif +// +// mp4state.paused = 0; +// module.outMod->Pause(0); +//} +// +//int ispaused() +//{ +//#ifdef DEBUG_OUTPUT +// in_mp4_DebugOutput("ispaused"); +//#endif +// +// return mp4state.paused; +//} + +//----------------------------------------------------------------------------- + +void SetVolume(int levelleft, int levelright, int flags) +{ +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("setvolume"); +#endif + + module.QCDCallbacks.toPlayer.OutputSetVol(levelleft, levelright, flags); +} + +//void setpan(int pan) +//{ +//#ifdef DEBUG_OUTPUT +// in_mp4_DebugOutput("setpan"); +//#endif +// +// module.outMod->SetPan(pan); +//} + +//----------------------------------------------------------------------------- + +int Stop(const char* medianame, int flags) +{ + struct seek_list *target = mp4state.m_head; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("stop"); +#endif + + if (medianame && *medianame && stricmp(mp4state.filename, medianame) == 0) + { + module.QCDCallbacks.toPlayer.OutputStop(flags); + killPlayThread = 1; + + if (play_thread_handle != INVALID_HANDLE_VALUE) + { + if (WaitForSingleObject(play_thread_handle, INFINITE) == WAIT_TIMEOUT) + TerminateThread(play_thread_handle,0); + CloseHandle(play_thread_handle); + play_thread_handle = INVALID_HANDLE_VALUE; + } + + + if (mp4state.m_aac_buffer) + free(mp4state.m_aac_buffer); + + while (target) + { + struct seek_list *tmp = target; + target = target->next; + if (tmp) free(tmp); + } + faacDecClose(mp4state.hDecoder); + if (mp4state.filetype) + fclose(mp4state.aacfile); + else + MP4Close(mp4state.mp4file); + + //module.outMod->Close(); + //module.SAVSADeInit(); + mp4state.filename[0] = '\0'; + mp4state.paused = 0; + } + + return 1; +} + +int getsonglength(const char *fn) +{ + long msDuration = 0; + + if(!stricmp(fn + strlen(fn) - 3,"MP4") || !stricmp(fn + strlen(fn) - 3,"M4A")) + { + int track; + MP4Duration length; + MP4FileHandle file; + + file = MP4Read(fn, 0); + if (!file) + return 0; + + if ((track = GetAACTrack(file)) < 0) + { + MP4Close(file); + return -1; + } + + length = MP4GetTrackDuration(file, track); + + msDuration = MP4ConvertFromTrackDuration(file, track, + length, MP4_MSECS_TIME_SCALE); + + MP4Close(file); + + return msDuration; + } else { + int tagsize = 0; + int bread = 0; + double length = 0.; + __int64 bitrate = 128; + struct seek_list *target; + state len_state; + + memset(&len_state, 0, sizeof(state)); + + if (!(len_state.aacfile = fopen(fn, "rb"))) + { + // error + return 0; + } + + len_state.m_at_eof = 0; + + if (!(len_state.m_aac_buffer = (unsigned char*)malloc(768*6))) + { + //console::error("Memory allocation error.", "foo_mp4"); + return 0; + } + memset(len_state.m_aac_buffer, 0, 768*6); + + bread = fread(len_state.m_aac_buffer, 1, 768*6, len_state.aacfile); + len_state.m_aac_bytes_into_buffer = bread; + len_state.m_aac_bytes_consumed = 0; + len_state.m_file_offset = 0; + + if (bread != 768*6) + len_state.m_at_eof = 1; + + if (!memcmp(len_state.m_aac_buffer, "ID3", 3)) + { + /* high bit is not used */ + tagsize = (len_state.m_aac_buffer[6] << 21) | (len_state.m_aac_buffer[7] << 14) | + (len_state.m_aac_buffer[8] << 7) | (len_state.m_aac_buffer[9] << 0); + + tagsize += 10; + advance_buffer(&len_state, tagsize); + } + + len_state.m_head = (struct seek_list*)malloc(sizeof(struct seek_list)); + len_state.m_tail = len_state.m_head; + len_state.m_tail->next = NULL; + + len_state.m_header_type = 0; + if ((len_state.m_aac_buffer[0] == 0xFF) && ((len_state.m_aac_buffer[1] & 0xF6) == 0xF0)) + { + if (1) //(m_reader->can_seek()) + { + adts_parse(&len_state, &bitrate, &length); + fseek(len_state.aacfile, tagsize, SEEK_SET); + + bread = fread(len_state.m_aac_buffer, 1, 768*6, len_state.aacfile); + if (bread != 768*6) + len_state.m_at_eof = 1; + else + len_state.m_at_eof = 0; + len_state.m_aac_bytes_into_buffer = bread; + len_state.m_aac_bytes_consumed = 0; + + len_state.m_header_type = 1; + } + } else if (memcmp(len_state.m_aac_buffer, "ADIF", 4) == 0) { + int skip_size = (len_state.m_aac_buffer[4] & 0x80) ? 9 : 0; + bitrate = ((unsigned int)(len_state.m_aac_buffer[4 + skip_size] & 0x0F)<<19) | + ((unsigned int)len_state.m_aac_buffer[5 + skip_size]<<11) | + ((unsigned int)len_state.m_aac_buffer[6 + skip_size]<<3) | + ((unsigned int)len_state.m_aac_buffer[7 + skip_size] & 0xE0); + + length = (double)file_length(len_state.aacfile); + if (length == -1) + length = 0; + else + length = ((double)length*8.)/((double)bitrate) + 0.5; + + len_state.m_header_type = 2; + } else { + length = (double)file_length(len_state.aacfile); + length = ((double)length*8.)/((double)bitrate*1000.) + 0.5; + + len_state.m_header_type = 0; + } + + if (len_state.m_aac_buffer) + free(len_state.m_aac_buffer); + + target = len_state.m_head; + while (target) + { + struct seek_list *tmp = target; + target = target->next; + if (tmp) free(tmp); + } + + fclose(len_state.aacfile); + + return (int)(length*1000.); + } +} + +//int getlength() +//{ +// if (!mp4state.filetype) +// { +// int track; +// long msDuration; +// MP4Duration length; +// +// if ((track = GetAACTrack(mp4state.mp4file)) < 0) +// { +// return -1; +// } +// +// length = MP4GetTrackDuration(mp4state.mp4file, track); +// +// msDuration = MP4ConvertFromTrackDuration(mp4state.mp4file, track, +// length, MP4_MSECS_TIME_SCALE); +// +// return msDuration; +// } else { +// return mp4state.m_length; +// } +// return 0; +//} + +//----------------------------------------------------------------------------- + +int GetCurrentPosition(const char* medianame, long *track, long *offset) +{ + return module.QCDCallbacks.toPlayer.OutputGetCurrentPosition((UINT*)offset, 0); +} + +//void setoutputtime(int time_in_ms) +//{ +//#ifdef DEBUG_OUTPUT +// in_mp4_DebugOutput("setoutputtime"); +//#endif +// +// mp4state.seek_needed = time_in_ms; +//} + +//----------------------------------------------------------------------------- + +int GetTrackExtents(const char* medianame, TrackExtents *ext, int flags) +{ + int len; + FILE *fh; + + len = getsonglength((char *)medianame); + fh = fopen(medianame, "rb"); + if (len <= 0 || !fh) + return 0; + + ext->track = 1; + ext->start = 0; + ext->end = len; + ext->bytesize = file_length(fh); + fclose(fh); + ext->unitpersec = 1000; + + return 1; +} + +//void eq_set(int on, char data[10], int preamp) +//{ +//} + +static void remap_channels(unsigned char *data, unsigned int samples, unsigned int bps) +{ + unsigned int i; + + switch (bps) + { + case 8: + { + unsigned char r1, r2, r3, r4, r5, r6; + for (i = 0; i < samples; i += 6) + { + r1 = data[i]; + r2 = data[i+1]; + r3 = data[i+2]; + r4 = data[i+3]; + r5 = data[i+4]; + r6 = data[i+5]; + data[i] = r2; + data[i+1] = r3; + data[i+2] = r1; + data[i+3] = r6; + data[i+4] = r4; + data[i+5] = r5; + } + } + break; + + case 16: + default: + { + unsigned short r1, r2, r3, r4, r5, r6; + unsigned short *sample_buffer = (unsigned short *)data; + for (i = 0; i < samples; i += 6) + { + r1 = sample_buffer[i]; + r2 = sample_buffer[i+1]; + r3 = sample_buffer[i+2]; + r4 = sample_buffer[i+3]; + r5 = sample_buffer[i+4]; + r6 = sample_buffer[i+5]; + sample_buffer[i] = r2; + sample_buffer[i+1] = r3; + sample_buffer[i+2] = r1; + sample_buffer[i+3] = r6; + sample_buffer[i+4] = r4; + sample_buffer[i+5] = r5; + } + } + break; + + case 24: + case 32: + { + unsigned int r1, r2, r3, r4, r5, r6; + unsigned int *sample_buffer = (unsigned int *)data; + for (i = 0; i < samples; i += 6) + { + r1 = sample_buffer[i]; + r2 = sample_buffer[i+1]; + r3 = sample_buffer[i+2]; + r4 = sample_buffer[i+3]; + r5 = sample_buffer[i+4]; + r6 = sample_buffer[i+5]; + sample_buffer[i] = r2; + sample_buffer[i+1] = r3; + sample_buffer[i+2] = r1; + sample_buffer[i+3] = r6; + sample_buffer[i+4] = r4; + sample_buffer[i+5] = r5; + } + } + break; + } +} + +DWORD WINAPI MP4PlayThread(void *b) +{ + int done = 0, updatepos = 0; + int l; + int seq_frames = 0; + int seq_bytes = 0; + + void *sample_buffer; + unsigned char *buffer; + int buffer_size; + faacDecFrameInfo frameInfo; + + WriteDataStruct wd; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("MP4PlayThread"); +#endif + + PlayThreadAlive = 1; + mp4state.last_frame = 0; + mp4state.initial = 1; + + while (!*((int *)b)) + { + /* seeking */ + if (mp4state.seek_needed != -1) + { + MP4Duration duration; + + module.QCDCallbacks.toPlayer.OutputFlush((unsigned int)mp4state.decode_pos_ms); + duration = MP4ConvertToTrackDuration(mp4state.mp4file, + mp4state.mp4track, mp4state.seek_needed, MP4_MSECS_TIME_SCALE); + mp4state.sampleId = MP4GetSampleIdFromTime(mp4state.mp4file, + mp4state.mp4track, duration, 0); + + mp4state.decode_pos_ms = mp4state.seek_needed; + mp4state.seek_needed = -1; + updatepos = 1; + } + + if (done) + { + if (module.QCDCallbacks.toPlayer.OutputDrain(0) && !(mp4state.seek_needed >= 0)) + { + module.QCDCallbacks.toPlayer.OutputStop(STOPFLAG_PLAYDONE); + module.QCDCallbacks.toPlayer.PlayDone(mp4state.filename); + PlayThreadAlive = 0; + } + else if (mp4state.seek_needed >= 0) + { + done = 0; + continue; + } + break; + } else/* if (module.outMod->CanWrite() >= (2048*mp4state.channels*sizeof(short)))*/ { + + if (mp4state.last_frame) + { + done = 1; + } else { + int rc; + + /* for gapless decoding */ + char *buf; + MP4Duration dur; + unsigned int sample_count; + unsigned int delay = 0; + + /* get acces unit from MP4 file */ + buffer = NULL; + buffer_size = 0; + + rc = MP4ReadSample(mp4state.mp4file, mp4state.mp4track, + mp4state.sampleId++, &buffer, &buffer_size, + NULL, &dur, NULL, NULL); + if (mp4state.sampleId-1 == 1) dur = 0; + if (rc == 0 || buffer == NULL) + { + mp4state.last_frame = 1; + sample_buffer = NULL; + frameInfo.samples = 0; + } else { + sample_buffer = faacDecDecode(mp4state.hDecoder, &frameInfo, + buffer, buffer_size); + } + if (frameInfo.error > 0) + { + show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error)); + mp4state.last_frame = 1; + } + if (mp4state.sampleId > mp4state.numSamples) + mp4state.last_frame = 1; + + if (buffer) free(buffer); + + if (mp4state.useAacLength || (mp4state.timescale != mp4state.samplerate)) { + sample_count = frameInfo.samples; + } else { + sample_count = (unsigned int)(dur * frameInfo.channels); + + if (!mp4state.useAacLength && !mp4state.initial && (mp4state.sampleId < mp4state.numSamples/2) && (dur*frameInfo.channels != frameInfo.samples)) + { + //fprintf(stderr, "MP4 seems to have incorrect frame duration, using values from AAC data.\n"); + mp4state.useAacLength = 1; + sample_count = frameInfo.samples; + } + } + + if (mp4state.initial && (sample_count < mp4state.framesize*mp4state.channels) && (frameInfo.samples > sample_count)) + { + delay = frameInfo.samples - sample_count; + } + + if (!killPlayThread && (sample_count > 0)) + { + buf = (char *)sample_buffer; + mp4state.initial = 0; + + switch (res_table[m_resolution]) + { + case 8: + buf += delay; + break; + case 16: + default: + buf += delay * 2; + break; + case 24: + case 32: + buf += delay * 4; + break; + case 64: + buf += delay * 8; + } + + if (frameInfo.channels == 6 && frameInfo.num_lfe_channels) + remap_channels(buf, sample_count, res_table[m_resolution]); + + if (res_table[m_resolution] == 24) + { + /* convert libfaad output (3 bytes packed in 4) */ + char *temp_buffer = convert3in4to3in3(buf, sample_count); + memcpy((void*)buf, (void*)temp_buffer, sample_count*3); + free(temp_buffer); + } + + //module.SAAddPCMData(buf, (int)mp4state.channels, res_table[m_resolution], + // mp4state.decode_pos_ms); + //module.VSAAddPCMData(buf, (int)mp4state.channels, res_table[m_resolution], + // mp4state.decode_pos_ms); + mp4state.decode_pos_ms += (double)sample_count * 1000.0 / + ((double)frameInfo.samplerate * (double)frameInfo.channels); + + l = sample_count * res_table[m_resolution] / 8; + + if (updatepos) + { + module.QCDCallbacks.toPlayer.PositionUpdate((unsigned int)mp4state.decode_pos_ms); + updatepos = 0; + } + + wd.bytelen = l; + wd.data = (short*)buf; + wd.markerend = 0; + wd.markerstart = (UINT)mp4state.decode_pos_ms; + wd.bps = res_table[m_resolution]; + wd.nch = frameInfo.channels; + wd.numsamples = sample_count/frameInfo.channels; + wd.srate = frameInfo.samplerate; + + if (!module.QCDCallbacks.toPlayer.OutputWrite(&wd)) + done = 1; + + //if (module.dsp_isactive()) + //{ + // void *dsp_buffer = malloc(l*2); + // memcpy(dsp_buffer, buf, l); + + // l = module.dsp_dosamples((short*)dsp_buffer, + // sample_count/frameInfo.channels, + // res_table[m_resolution], + // frameInfo.channels, + // frameInfo.samplerate) * + // (frameInfo.channels*(res_table[m_resolution]/8)); + + // module.outMod->Write(dsp_buffer, l); + // if (dsp_buffer) free(dsp_buffer); + //} else { + // module.outMod->Write(buf, l); + //} + + /* VBR bitrate display */ + if (m_vbr_display) + { + seq_frames++; + seq_bytes += frameInfo.bytesconsumed; + if (seq_frames == (int)(floor((float)frameInfo.samplerate/(float)(sample_count/frameInfo.channels) + 0.5))) + { + ai.bitrate = (int)floor(((float)seq_bytes*8.)/1000. + 0.5) * 1000; + ai.frequency = (int)floor(frameInfo.samplerate/1000. + 0.5) * 1000; + ai.mode = (mp4state.channels == 2) ? 0 : 3; + module.QCDCallbacks.Service(opSetAudioInfo, &ai, sizeof(AudioInfo), 0); + + seq_frames = 0; + seq_bytes = 0; + } + } + } + } + } + + Sleep(10); + + // catch pause + while (mp4state.paused && !killPlayThread) + Sleep(50); + } + + PlayThreadAlive = 0; + + return 0; +} + +void *decode_aac_frame(state *st, faacDecFrameInfo *frameInfo) +{ + void *sample_buffer = NULL; + + do + { + fill_buffer(st); + + if (st->m_aac_bytes_into_buffer != 0) + { + sample_buffer = faacDecDecode(st->hDecoder, frameInfo, + st->m_aac_buffer, st->m_aac_bytes_into_buffer); + + if (st->m_header_type != 1) + { + if (st->last_offset < st->m_file_offset) + { + st->m_tail->offset = st->m_file_offset; + st->m_tail->next = (struct seek_list*)malloc(sizeof(struct seek_list)); + st->m_tail = st->m_tail->next; + st->m_tail->next = NULL; + st->last_offset = st->m_file_offset; + } + } + + advance_buffer(st, frameInfo->bytesconsumed); + } else { + break; + } + + } while (!frameInfo->samples && !frameInfo->error); + + return sample_buffer; +} + +int aac_seek(state *st, double seconds) +{ + int i, frames; + int bread; + struct seek_list *target = st->m_head; + + if (1 /*can_seek*/ && ((st->m_header_type == 1) || (seconds < st->cur_pos_sec))) + { + frames = (int)(seconds*((double)st->samplerate/(double)st->framesize) + 0.5); + + for (i = 0; i < frames; i++) + { + if (target->next) + target = target->next; + else + return 0; + } + if (target->offset == 0 && frames > 0) + return 0; + fseek(st->aacfile, target->offset, SEEK_SET); + st->m_file_offset = target->offset; + + bread = fread(st->m_aac_buffer, 1, 768*6, st->aacfile); + if (bread != 768*6) + st->m_at_eof = 1; + else + st->m_at_eof = 0; + st->m_aac_bytes_into_buffer = bread; + st->m_aac_bytes_consumed = 0; + st->m_file_offset += bread; + + faacDecPostSeekReset(st->hDecoder, -1); + + return 1; + } else { + if (seconds > st->cur_pos_sec) + { + faacDecFrameInfo frameInfo; + + frames = (int)((seconds - st->cur_pos_sec)*((double)st->samplerate/(double)st->framesize)); + + if (frames > 0) + { + for (i = 0; i < frames; i++) + { + memset(&frameInfo, 0, sizeof(faacDecFrameInfo)); + decode_aac_frame(st, &frameInfo); + + if (frameInfo.error || (st->m_aac_bytes_into_buffer == 0)) + { + if (frameInfo.error) + { + if (faacDecGetErrorMessage(frameInfo.error) != NULL) + show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error)); + } + return 0; + } + } + } + + faacDecPostSeekReset(st->hDecoder, -1); + } + return 1; + } +} + +DWORD WINAPI AACPlayThread(void *b) +{ + int done = 0, updatepos = 0; + int l; + int seq_frames = 0; + int seq_bytes = 0; + + WriteDataStruct wd; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("AACPlayThread"); +#endif + + PlayThreadAlive = 1; + mp4state.last_frame = 0; + + while (!*((int *)b)) + { + /* seeking */ + if (mp4state.seek_needed != -1) + { + double ms; + + ms = mp4state.seek_needed/1000; + if (aac_seek(&mp4state, ms)!=0) + { + module.QCDCallbacks.toPlayer.OutputFlush((unsigned int)mp4state.decode_pos_ms); + mp4state.cur_pos_sec = ms; + mp4state.decode_pos_ms = mp4state.seek_needed; + } + mp4state.seek_needed = -1; + updatepos = 1; + } + + if (done) + { + if (module.QCDCallbacks.toPlayer.OutputDrain(0) && !(mp4state.seek_needed >= 0)) + { + module.QCDCallbacks.toPlayer.OutputStop(STOPFLAG_PLAYDONE); + module.QCDCallbacks.toPlayer.PlayDone(mp4state.filename); + PlayThreadAlive = 0; + } + else if (mp4state.seek_needed >= 0) + { + done = 0; + continue; + } + break; + } else/* if (module.outMod->CanWrite() >= (2048*mp4state.channels*sizeof(short)))*/ { + faacDecFrameInfo frameInfo; + void *sample_buffer; + + memset(&frameInfo, 0, sizeof(faacDecFrameInfo)); + + sample_buffer = decode_aac_frame(&mp4state, &frameInfo); + + if (frameInfo.error || (mp4state.m_aac_bytes_into_buffer == 0)) + { + if (frameInfo.error) + { + if (faacDecGetErrorMessage(frameInfo.error) != NULL) + show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error)); + } + done = 1; + } + + if (!killPlayThread && (frameInfo.samples > 0)) + { + if (frameInfo.channels == 6 && frameInfo.num_lfe_channels) + remap_channels(sample_buffer, frameInfo.samples, res_table[m_resolution]); + + if (res_table[m_resolution] == 24) + { + /* convert libfaad output (3 bytes packed in 4 bytes) */ + char *temp_buffer = convert3in4to3in3(sample_buffer, frameInfo.samples); + memcpy((void*)sample_buffer, (void*)temp_buffer, frameInfo.samples*3); + free(temp_buffer); + } + + //module.SAAddPCMData(sample_buffer, (int)mp4state.channels, res_table[m_resolution], + // mp4state.decode_pos_ms); + //module.VSAAddPCMData(sample_buffer, (int)mp4state.channels, res_table[m_resolution], + // mp4state.decode_pos_ms); + mp4state.decode_pos_ms += (double)frameInfo.samples * 1000.0 / + ((double)frameInfo.samplerate* (double)frameInfo.channels); + + l = frameInfo.samples * res_table[m_resolution] / 8; + + if (updatepos) + { + module.QCDCallbacks.toPlayer.PositionUpdate((unsigned int)mp4state.decode_pos_ms); + updatepos = 0; + } + + wd.bytelen = l; + wd.data = (short*)sample_buffer; + wd.markerend = 0; + wd.markerstart = (UINT)mp4state.decode_pos_ms; + wd.bps = res_table[m_resolution]; + wd.nch = frameInfo.channels; + wd.numsamples = frameInfo.samples/frameInfo.channels; + wd.srate = frameInfo.samplerate; + + if (!module.QCDCallbacks.toPlayer.OutputWrite(&wd)) + done = 1; + + //if (module.dsp_isactive()) + //{ + // void *dsp_buffer = malloc(l*2); + // memcpy(dsp_buffer, sample_buffer, l); + + // l = module.dsp_dosamples((short*)dsp_buffer, + // frameInfo.samples/frameInfo.channels, + // res_table[m_resolution], + // frameInfo.channels, + // frameInfo.samplerate) * + // (frameInfo.channels*(res_table[m_resolution]/8)); + + // module.outMod->Write(dsp_buffer, l); + // if (dsp_buffer) free(dsp_buffer); + //} else { + // module.outMod->Write(sample_buffer, l); + //} + + /* VBR bitrate display */ + if (m_vbr_display) + { + seq_frames++; + seq_bytes += frameInfo.bytesconsumed; + if (seq_frames == (int)(floor((float)frameInfo.samplerate/(float)(frameInfo.samples/frameInfo.channels) + 0.5))) + { + ai.bitrate = (int)floor(((float)seq_bytes*8.)/1000. + 0.5) * 1000; + ai.frequency = (int)floor(frameInfo.samplerate/1000. + 0.5) * 1000; + ai.mode = (mp4state.channels == 2) ? 0 : 3; + module.QCDCallbacks.Service(opSetAudioInfo, &ai, sizeof(AudioInfo), 0); + + seq_frames = 0; + seq_bytes = 0; + } + } + } + + if (frameInfo.channels > 0 && mp4state.samplerate > 0) + mp4state.cur_pos_sec += ((double)(frameInfo.samples/frameInfo.channels))/(double)mp4state.samplerate; + } + + Sleep(10); + + // catch pause + while (mp4state.paused && !killPlayThread) + Sleep(50); + } + + PlayThreadAlive = 0; + + return 0; +} + +//----------------------------------------------------------------------------- + +int WINAPI DllMain(HINSTANCE hInst, DWORD fdwReason, LPVOID pRes) +{ + if (fdwReason == DLL_PROCESS_ATTACH) + { + module.hDllInstance = hInst; + } + return 1; +} + +//----------------------------------------------------------------------------- + +PLUGIN_API QCDModInitIn* INPUTDLL_ENTRY_POINT(QCDModInitIn *ModInit, QCDModInfo *ModInfo) +{ + module.QCDCallbacks.size = sizeof(QCDModInitIn); + module.QCDCallbacks.version = PLUGIN_API_VERSION; + module.QCDCallbacks.toModule.Initialize = Initialize; + module.QCDCallbacks.toModule.ShutDown = ShutDown; + module.QCDCallbacks.toModule.GetTrackExtents = GetTrackExtents; + module.QCDCallbacks.toModule.GetMediaSupported = GetMediaSupported; + module.QCDCallbacks.toModule.Play = Play; + module.QCDCallbacks.toModule.Pause = Pause; + module.QCDCallbacks.toModule.Stop = Stop; + module.QCDCallbacks.toModule.About = About; + module.QCDCallbacks.toModule.Configure = Configure; + module.QCDCallbacks.toModule.SetEQ = NULL; + module.QCDCallbacks.toModule.SetVolume = SetVolume; + + return &module.QCDCallbacks; +} + +///* new Media Library interface */ +// +//int mp4_get_metadata(MP4FileHandle file, const char *item, char *dest, int dlen) +//{ +// char *pVal = NULL, dummy1[4096]; +// short dummy = 0, dummy2 = 0; +// +// if (dlen < 1) return 0; +// +// if (!stricmp(item, "track") || !stricmp(item, "tracknumber")) +// { +// if (MP4GetMetadataTrack(file, &dummy, &dummy2)) +// { +// wsprintf(dummy1, "%d", (int)dummy); +// strncpy(dest, dummy1, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "disc") || !stricmp(item, "disknumber")) +// { +// if (MP4GetMetadataDisk(file, &dummy, &dummy2)) +// { +// wsprintf(dummy1, "%d", (int)dummy); +// strncpy(dest, dummy1, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "compilation")) +// { +// u_int8_t cpil = 0; +// if (MP4GetMetadataCompilation(file, &cpil)) +// { +// wsprintf(dummy1, "%d", (int)cpil); +// strncpy(dest, dummy1, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "tempo")) +// { +// u_int16_t tempo = 0; +// if (MP4GetMetadataTempo(file, &tempo)) +// { +// wsprintf(dummy1, "%d", (int)tempo); +// strncpy(dest, dummy1, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "artist")) +// { +// if (MP4GetMetadataArtist(file, &pVal)) +// { +// strncpy(dest, pVal, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "writer")) +// { +// if (MP4GetMetadataWriter(file, &pVal)) +// { +// strncpy(dest, pVal, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "title")) +// { +// if (MP4GetMetadataName(file, &pVal)) +// { +// strncpy(dest, pVal, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "album")) +// { +// if (MP4GetMetadataAlbum(file, &pVal)) +// { +// strncpy(dest, pVal, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "date") || !stricmp(item, "year")) +// { +// if (MP4GetMetadataYear(file, &pVal)) +// { +// strncpy(dest, pVal, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "comment")) +// { +// if (MP4GetMetadataComment(file, &pVal)) +// { +// strncpy(dest, pVal, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "genre")) +// { +// if (MP4GetMetadataGenre(file, &pVal)) +// { +// strncpy(dest, pVal, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else if (!stricmp(item, "tool")) +// { +// if (MP4GetMetadataTool(file, &pVal)) +// { +// strncpy(dest, pVal, dlen-1); +// dest[dlen-1] = '\0'; +// return 1; +// } +// } +// else +// { +// u_int32_t valueSize = 0; +// u_int8_t *pValue = NULL; +// +// if (MP4GetMetadataFreeForm(file, (char *)item, &pValue, &valueSize)) +// { +// unsigned int len = (valueSize < (unsigned int)(dlen-1)) ? valueSize : (unsigned int)(dlen-1); +// memcpy(dest, pValue, len); +// dest[len] = '\0'; +// return 1; +// } +// } +// +// return 0; +//} +// +//__declspec(dllexport) int winampGetExtendedFileInfo(const char *fn, const char *data, char *dest, int destlen) +//{ +// if (!fn || (fn && !*fn) || !destlen) return 0; +// +// dest[0] = '\0'; +// +// if (!stricmp(data, "length")) +// { +// char temp[32]; +// int len = getsonglength(fn); +// itoa(len, temp, 10); +// strncpy(dest, temp, destlen-1); +// dest[destlen-1] = '\0'; +// } +// else +// { +// char temp[2048], temp2[2048]; +// MP4FileHandle file = MP4Read(fn, 0); +// if (file == MP4_INVALID_FILE_HANDLE) return 0; +// +// if (mp4_get_metadata(file, data, temp, sizeof(temp))) +// { +// int len = ConvertUTF8ToANSI(temp, temp2); +// if (len > destlen-1) len = destlen-1; +// memcpy(dest, temp2, len); +// dest[len] = '\0'; +// } +// +// MP4Close(file); +// } +// +// return 1; +//} +// +//static struct medialib_tags mltags = {0, 0}; +//static BOOL medialib_init = FALSE; +//static char medialib_lastfn[2048] = ""; +// +//__declspec(dllexport) int winampSetExtendedFileInfo(const char *fn, const char *data, char *val) +//{ +// int len, ret = 0; +// char *temp; +// +// if (!medialib_init || (medialib_init && stricmp(fn, medialib_lastfn))) { +// MP4FileHandle file; +// strcpy(medialib_lastfn, fn); +// +// if (medialib_init) tag_delete(&mltags); +// +// file = MP4Read(fn, 0); +// if (file == MP4_INVALID_FILE_HANDLE) return 0; +// ReadMP4Tag(file, &mltags); +// MP4Close(file); +// medialib_init = TRUE; +// } +// +// len = strlen(val); +// temp = (char *)malloc((len+1)*4); +// if (!temp) return 0; +// +// if (ConvertANSIToUTF8(val, temp)) +// { +// ret = 1; +// tag_set_field(&mltags, data, temp); +// } +// +// free(temp); +// +// return ret; +//} +// +//__declspec(dllexport) int winampWriteExtendedFileInfo() +//{ +// if (medialib_init) +// { +// MP4FileHandle file = MP4Modify(medialib_lastfn, 0, 0); +// if (file == MP4_INVALID_FILE_HANDLE) return 0; +// +// MP4MetadataDelete(file); +// MP4Close(file); +// +// file = MP4Modify(medialib_lastfn, 0, 0); +// if (file == MP4_INVALID_FILE_HANDLE) return 0; +// +// WriteMP4Tag(file, &mltags); +// +// MP4Close(file); +// +// return 1; +// } +// else +// { +// return 0; +// } +//} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDMp4.dsp +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDMp4.dsp @@ -0,0 +1,167 @@ +# Microsoft Developer Studio Project File - Name="QCDMp4" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=QCDMp4 - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "QCDMp4.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "QCDMp4.mak" CFG="QCDMp4 - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "QCDMp4 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "QCDMp4 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "QCDMp4 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O1 /I "..\..\include" /I "..\..\common\mp4v2" /I "..\..\common\mp4av" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x413 /d "NDEBUG" +# ADD RSC /l 0x413 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 + +!ELSEIF "$(CFG)" == "QCDMp4 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\common\mp4v2" /I "..\..\common\mp4av" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x413 /d "_DEBUG" +# ADD RSC /l 0x413 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "QCDMp4 - Win32 Release" +# Name "QCDMp4 - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\aac2mp4.cpp +# End Source File +# Begin Source File + +SOURCE=.\aacinfo.c +# End Source File +# Begin Source File + +SOURCE=.\config.c +# End Source File +# Begin Source File + +SOURCE=.\QCDMp4.c +# End Source File +# Begin Source File + +SOURCE=.\QCDMp4Tag.cpp +# End Source File +# Begin Source File + +SOURCE=.\utils.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\aacinfo.h +# End Source File +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\faad.h +# End Source File +# Begin Source File + +SOURCE=.\QCDInputDLL.h +# End Source File +# Begin Source File + +SOURCE=.\QCDModInput.h +# End Source File +# Begin Source File + +SOURCE=.\QCDTagsDLL.h +# End Source File +# Begin Source File + +SOURCE=.\QCDModTagEditor.h +# End Source File +# Begin Source File + +SOURCE=.\QCDModDefs.h +# End Source File +# Begin Source File + +SOURCE=.\utils.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\QCDMp4.rc +# End Source File +# End Group +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDMp4.dsw +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDMp4.dsw @@ -0,0 +1,74 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "QCDMp4"=.\QCDMp4.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libfaad + End Project Dependency + Begin Project Dependency + Project_Dep_Name libmp4v2_st + End Project Dependency + Begin Project Dependency + Project_Dep_Name libmp4av_st + End Project Dependency +}}} + +############################################################################### + +Project: "libfaad"=..\..\libfaad\libfaad.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libmp4av_st"=..\..\common\mp4av\libmp4av_st.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libmp4v2_st"=..\..\common\mp4v2\libmp4v2_st60.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDMp4.rc +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDMp4.rc @@ -0,0 +1,191 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// ÖÐÎÄ(ÖлªÈËÃñ¹²ºÍ¹ú) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +#ifdef _WIN32 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#pragma code_page(936) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_CONFIG DIALOGEX 0, 0, 242, 93 +STYLE DS_SETFONT | DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Configuration" +FONT 9, "ËÎÌå", 400, 0, 0x86 +BEGIN + CONTROL "Slider1",IDC_PRIORITY,"msctls_trackbar32",TBS_VERT | + TBS_NOTICKS | WS_TABSTOP,13,15,18,46 + CONTROL "16 λ",IDC_16BITS,"Button",BS_AUTORADIOBUTTON,77,18,37, + 10 + CONTROL "16 λ¸ßƵ¶¶¶¯",IDC_16BITS_DITHERED,"Button", + BS_AUTORADIOBUTTON | WS_DISABLED,77,29,64,10 + CONTROL "24 λ",IDC_24BITS,"Button",BS_AUTORADIOBUTTON,77,40,37, + 10 + CONTROL "32 λ",IDC_32BITS,"Button",BS_AUTORADIOBUTTON,77,51,37, + 10 + CONTROL "ÏòÏ»ìƵµ½Á¢ÌåÉù",IDC_DOWNMIX,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,13,80,10 + CONTROL "Ö§³Ö AAC ¸ñʽ",IDC_USEFORAAC,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,26,68,10 + CONTROL "ÏÔʾ¿É±ä±ÈÌØÂÊ",IDC_VBR,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,39,72,10 + CONTROL "ÏÔʾ´íÎóÐÅÏ¢",IDC_ERROR,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,52,64,10 + DEFPUSHBUTTON "È·¶¨",IDOK,185,72,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,127,72,50,14 + GROUPBOX "ÓÅÏȼ¶",IDC_STATIC,7,7,57,58 + LTEXT "¸ß",IDC_STATIC,34,18,25,8 + LTEXT "±ê×¼",IDC_STATIC,34,35,23,8 + LTEXT "µÍ",IDC_STATIC,34,52,24,8 + GROUPBOX "½âÎö¶È",IDC_STATIC,71,7,73,58 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_CONFIG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 235 + TOPMARGIN, 7 + BOTTOMMARGIN, 86 + END +END +#endif // APSTUDIO_INVOKED + +#endif // ÖÐÎÄ(ÖлªÈËÃñ¹²ºÍ¹ú) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// ºÉÀ¼Óï(ºÉÀ¼) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD) +#ifdef _WIN32 +LANGUAGE LANG_DUTCH, SUBLANG_DUTCH +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_CONFIG DIALOGEX 0, 0, 233, 93 +STYLE DS_SETFONT | DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Configuration" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + CONTROL "Slider1",IDC_PRIORITY,"msctls_trackbar32",TBS_VERT | + TBS_NOTICKS | WS_TABSTOP,13,15,18,46 + CONTROL "16 bits",IDC_16BITS,"Button",BS_AUTORADIOBUTTON,77,18, + 37,10 + CONTROL "16 bits dithered",IDC_16BITS_DITHERED,"Button", + BS_AUTORADIOBUTTON | WS_DISABLED,77,29,64,10 + CONTROL "24 bits",IDC_24BITS,"Button",BS_AUTORADIOBUTTON,77,40, + 37,10 + CONTROL "32 bits",IDC_32BITS,"Button",BS_AUTORADIOBUTTON,77,51, + 37,10 + CONTROL "Downmix to stereo",IDC_DOWNMIX,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,13,74,10 + CONTROL "Use for AAC",IDC_USEFORAAC,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,26,55,10 + CONTROL "VBR Display",IDC_VBR,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,39,55,10 + CONTROL "Show errors",IDC_ERROR,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,52,53,10 + DEFPUSHBUTTON "OK",IDOK,176,72,50,14 + PUSHBUTTON "Cancel",IDCANCEL,115,72,50,14 + GROUPBOX "Priority",IDC_STATIC,7,7,57,58 + LTEXT "Highest",IDC_STATIC,34,18,25,8 + LTEXT "Normal",IDC_STATIC,34,35,23,8 + LTEXT "Lowest",IDC_STATIC,34,52,24,8 + GROUPBOX "Resolution",IDC_STATIC,71,7,73,58 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_CONFIG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 226 + TOPMARGIN, 7 + BOTTOMMARGIN, 86 + END +END +#endif // APSTUDIO_INVOKED + +#endif // ºÉÀ¼Óï(ºÉÀ¼) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDMp4.sln +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDMp4.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QCDMp4", "QCDMp4.vcproj", "{2D8F479D-A591-4502-9456-398425D5F834}" + ProjectSection(ProjectDependencies) = postProject + {2398BB2F-FFF9-490B-B4CC-863F2D21AE46} = {2398BB2F-FFF9-490B-B4CC-863F2D21AE46} + {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49} = {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49} + {82CAD808-21AF-40A6-92EC-AE01AA67B413} = {82CAD808-21AF-40A6-92EC-AE01AA67B413} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "..\..\libfaad\libfaad.vcproj", "{82CAD808-21AF-40A6-92EC-AE01AA67B413}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4v2_st", "..\..\common\mp4v2\libmp4v2_st60.vcproj", "{2398BB2F-FFF9-490B-B4CC-863F2D21AE46}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4av_st", "..\..\common\mp4av\libmp4av_st.vcproj", "{8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {2D8F479D-A591-4502-9456-398425D5F834}.Debug.ActiveCfg = Debug|Win32 + {2D8F479D-A591-4502-9456-398425D5F834}.Debug.Build.0 = Debug|Win32 + {2D8F479D-A591-4502-9456-398425D5F834}.Release.ActiveCfg = Release|Win32 + {2D8F479D-A591-4502-9456-398425D5F834}.Release.Build.0 = Release|Win32 + {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Debug.ActiveCfg = Debug|Win32 + {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Debug.Build.0 = Debug|Win32 + {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Release.ActiveCfg = Release|Win32 + {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Release.Build.0 = Release|Win32 + {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Debug.ActiveCfg = Debug|Win32 + {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Debug.Build.0 = Debug|Win32 + {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Release.ActiveCfg = Release|Win32 + {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Release.Build.0 = Release|Win32 + {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Debug.ActiveCfg = Debug|Win32 + {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Debug.Build.0 = Debug|Win32 + {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Release.ActiveCfg = Release|Win32 + {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDMp4.vcproj +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDMp4.vcproj @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDMp4Tag.cpp +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDMp4Tag.cpp @@ -0,0 +1,839 @@ +#include +#include +#include "QCDTagsDLL.h" + + +//.............................................................................. +// Global Variables + +typedef struct tag +{ + char *item; + char *value; +} tag; + +typedef struct medialib_tags +{ + struct tag *tags; + unsigned int count; +} medialib_tags; + +int tag_add_field(medialib_tags *tags, const char *item, const char *value) +{ + void *backup = (void *)tags->tags; + + if (!item || (item && !*item) || !value) return 0; + + tags->tags = (struct tag *)realloc(tags->tags, (tags->count+1) * sizeof(tag)); + if (!tags->tags) { + if (backup) free(backup); + return 0; + } + else + { + int i_len = strlen(item); + int v_len = strlen(value); + + tags->tags[tags->count].item = (char *)malloc(i_len+1); + tags->tags[tags->count].value = (char *)malloc(v_len+1); + + if (!tags->tags[tags->count].item || !tags->tags[tags->count].value) + { + if (!tags->tags[tags->count].item) free (tags->tags[tags->count].item); + if (!tags->tags[tags->count].value) free (tags->tags[tags->count].value); + tags->tags[tags->count].item = NULL; + tags->tags[tags->count].value = NULL; + return 0; + } + + memcpy(tags->tags[tags->count].item, item, i_len); + memcpy(tags->tags[tags->count].value, value, v_len); + tags->tags[tags->count].item[i_len] = '\0'; + tags->tags[tags->count].value[v_len] = '\0'; + + tags->count++; + return 1; + } +} + +int tag_set_field(medialib_tags *tags, const char *item, const char *value) +{ + unsigned int i; + + if (!item || (item && !*item) || !value) return 0; + + for (i = 0; i < tags->count; i++) + { + if (!stricmp(tags->tags[i].item, item)) + { + void *backup = (void *)tags->tags[i].value; + int v_len = strlen(value); + + tags->tags[i].value = (char *)realloc(tags->tags[i].value, v_len+1); + if (!tags->tags[i].value) + { + if (backup) free(backup); + return 0; + } + + memcpy(tags->tags[i].value, value, v_len); + tags->tags[i].value[v_len] = '\0'; + + return 1; + } + } + + return tag_add_field(tags, item, value); +} + +void tag_delete(medialib_tags *tags) +{ + unsigned int i; + + for (i = 0; i < tags->count; i++) + { + if (tags->tags[i].item) free(tags->tags[i].item); + if (tags->tags[i].value) free(tags->tags[i].value); + } + + if (tags->tags) free(tags->tags); + + tags->tags = NULL; + tags->count = 0; +} + +int ReadMP4Tag(MP4FileHandle file, medialib_tags *tags) +{ + unsigned __int32 valueSize; + unsigned __int8 *pValue; + char *pName; + unsigned int i = 0; + + do { + pName = 0; + pValue = 0; + valueSize = 0; + + MP4GetMetadataByIndex(file, i, (const char **)&pName, &pValue, &valueSize); + + if (valueSize > 0) + { + char *val = (char *)malloc(valueSize+1); + if (!val) return 0; + memcpy(val, pValue, valueSize); + val[valueSize] = '\0'; + + if (pName[0] == '\xa9') + { + if (memcmp(pName, "©nam", 4) == 0) + { + tag_add_field(tags, "title", val); + } else if (memcmp(pName, "©ART", 4) == 0) { + tag_add_field(tags, "artist", val); + } else if (memcmp(pName, "©wrt", 4) == 0) { + tag_add_field(tags, "writer", val); + } else if (memcmp(pName, "©alb", 4) == 0) { + tag_add_field(tags, "album", val); + } else if (memcmp(pName, "©day", 4) == 0) { + tag_add_field(tags, "date", val); + } else if (memcmp(pName, "©too", 4) == 0) { + tag_add_field(tags, "tool", val); + } else if (memcmp(pName, "©cmt", 4) == 0) { + tag_add_field(tags, "comment", val); + } else if (memcmp(pName, "©gen", 4) == 0) { + tag_add_field(tags, "genre", val); + } else { + tag_add_field(tags, pName, val); + } + } else if (memcmp(pName, "gnre", 4) == 0) { + char *t=0; + if (MP4GetMetadataGenre(file, &t)) + { + tag_add_field(tags, "genre", t); + } + } else if (memcmp(pName, "trkn", 4) == 0) { + unsigned __int16 trkn = 0, tot = 0; + char t[200]; + if (MP4GetMetadataTrack(file, &trkn, &tot)) + { + if (tot > 0) + wsprintf(t, "%d/%d", trkn, tot); + else + wsprintf(t, "%d", trkn); + tag_add_field(tags, "tracknumber", t); + } + } else if (memcmp(pName, "disk", 4) == 0) { + unsigned __int16 disk = 0, tot = 0; + char t[200]; + if (MP4GetMetadataDisk(file, &disk, &tot)) + { + if (tot > 0) + wsprintf(t, "%d/%d", disk, tot); + else + wsprintf(t, "%d", disk); + tag_add_field(tags, "disc", t); + } + } else if (memcmp(pName, "cpil", 4) == 0) { + unsigned __int8 cpil = 0; + char t[200]; + if (MP4GetMetadataCompilation(file, &cpil)) + { + wsprintf(t, "%d", cpil); + tag_add_field(tags, "compilation", t); + } + } else if (memcmp(pName, "tmpo", 4) == 0) { + unsigned __int16 tempo = 0; + char t[200]; + if (MP4GetMetadataTempo(file, &tempo)) + { + wsprintf(t, "%d BPM", tempo); + tag_add_field(tags, "tempo", t); + } + } else if (memcmp(pName, "NDFL", 4) == 0) { + /* Removed */ + } else { + tag_add_field(tags, pName, val); + } + + free(val); + } + + i++; + } while (valueSize > 0); + + return 1; +} + +int mp4_set_metadata(MP4FileHandle file, const char *item, const char *val) +{ + if (!item || (item && !*item) || !val || (val && !*val)) return 0; + + if (!stricmp(item, "track") || !stricmp(item, "tracknumber")) + { + unsigned __int16 trkn, tot; + int t1 = 0, t2 = 0; + sscanf(val, "%d/%d", &t1, &t2); + trkn = t1, tot = t2; + if (!trkn) return 1; + if (MP4SetMetadataTrack(file, trkn, tot)) return 1; + } + else if (!stricmp(item, "disc") || !stricmp(item, "disknumber")) + { + unsigned __int16 disk, tot; + int t1 = 0, t2 = 0; + sscanf(val, "%d/%d", &t1, &t2); + disk = t1, tot = t2; + if (!disk) return 1; + if (MP4SetMetadataDisk(file, disk, tot)) return 1; + } + else if (!stricmp(item, "compilation")) + { + unsigned __int8 cpil = atoi(val); + if (!cpil) return 1; + if (MP4SetMetadataCompilation(file, cpil)) return 1; + } + else if (!stricmp(item, "tempo")) + { + unsigned __int16 tempo = atoi(val); + if (!tempo) return 1; + if (MP4SetMetadataTempo(file, tempo)) return 1; + } + else if (!stricmp(item, "artist")) + { + if (MP4SetMetadataArtist(file, val)) return 1; + } + else if (!stricmp(item, "writer")) + { + if (MP4SetMetadataWriter(file, val)) return 1; + } + else if (!stricmp(item, "title")) + { + if (MP4SetMetadataName(file, val)) return 1; + } + else if (!stricmp(item, "album")) + { + if (MP4SetMetadataAlbum(file, val)) return 1; + } + else if (!stricmp(item, "date") || !stricmp(item, "year")) + { + if (MP4SetMetadataYear(file, val)) return 1; + } + else if (!stricmp(item, "comment")) + { + if (MP4SetMetadataComment(file, val)) return 1; + } + else if (!stricmp(item, "genre")) + { + if (MP4SetMetadataGenre(file, val)) return 1; + } + else if (!stricmp(item, "tool")) + { + if (MP4SetMetadataTool(file, val)) return 1; + } + else + { + if (MP4SetMetadataFreeForm(file, (char *)item, (u_int8_t *)val, (u_int32_t)strlen(val) + 1)) return 1; + } + + return 0; +} + +void WriteMP4Tag(MP4FileHandle file, const medialib_tags *tags) +{ + unsigned int i; + + for (i = 0; i < tags->count; i++) + { + const char *item = tags->tags[i].item; + const char *value = tags->tags[i].value; + + if (value && *value) + { + mp4_set_metadata(file, item, value); + } + } +} + +QCDModInitTag ModInitTag; + +medialib_tags tags; + +BOOL uSetDlgItemText(void *tagHandle, int fieldId, const char *str); +UINT uGetDlgItemText(void *tagHandle, int fieldId, char *str, int max); + +//------------------------------------------------------------------------------ + +PLUGIN_API QCDModInitTag* TAGEDITORDLL_ENTRY_POINT() +{ + ModInitTag.size = sizeof(QCDModInitTag); + ModInitTag.version = PLUGIN_API_VERSION; + ModInitTag.ShutDown = ShutDown_Tag; + + ModInitTag.Read = Read_Tag; + ModInitTag.Write = Write_Tag; // Leave null for operations that plugin does not support + ModInitTag.Strip = Strip_Tag; // ie: if plugin only reads tags, leave Write and Strip null + + ModInitTag.description = "MP4 Tags"; + ModInitTag.defaultexts = "MP4:M4A"; + + return &ModInitTag; +} + +//----------------------------------------------------------------------------- + +void ShutDown_Tag(int flags) +{ + // TODO: + // prepare plugin to be unloaded. All allocations should be freed. + // flags param is unused + tag_delete(&tags); +} + +//----------------------------------------------------------------------------- + +bool Read_Tag(LPCSTR filename, void* tagHandle) +{ + // TODO: + // read metadata from tag and set each field to tagHandle + // only TAGFIELD_* are supported (see QCDModTagEditor.h) + + // example of how to set value to tagHandle + // use SetFieldA for ASCII or MultiBytes strings. + // use SetFieldW for UNICODE strings + // + // ModInitTag.SetFieldW(tagHandle, TAGFIELD_COMPOSER, szwValue); + + // return true for successfull read, false for failure + + MP4FileHandle file = MP4_INVALID_FILE_HANDLE; + char *pVal, dummy1[1024]; + short dummy, dummy2; + u_int32_t valueSize = 0; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("mp4_tag_read"); +#endif + + file = MP4Read(filename, 0); + + if (file == MP4_INVALID_FILE_HANDLE) + return false; + + /* get Metadata */ + + pVal = NULL; + MP4GetMetadataName(file, &pVal); + uSetDlgItemText(tagHandle, TAGFIELD_TITLE, pVal); + + pVal = NULL; + MP4GetMetadataArtist(file, &pVal); + uSetDlgItemText(tagHandle, TAGFIELD_ARTIST, pVal); + + pVal = NULL; + MP4GetMetadataWriter(file, &pVal); + uSetDlgItemText(tagHandle, TAGFIELD_COMPOSER, pVal); + + pVal = NULL; + MP4GetMetadataComment(file, &pVal); + uSetDlgItemText(tagHandle, TAGFIELD_COMMENT, pVal); + + pVal = NULL; + MP4GetMetadataAlbum(file, &pVal); + uSetDlgItemText(tagHandle, TAGFIELD_ALBUM, pVal); + + pVal = NULL; + MP4GetMetadataGenre(file, &pVal); + uSetDlgItemText(tagHandle, TAGFIELD_GENRE, pVal); + + //dummy = 0; + //MP4GetMetadataTempo(file, &dummy); + //if (dummy) + //{ + // wsprintf(dummy1, "%d", dummy); + // SetDlgItemText(hwndDlg,IDC_METATEMPO, dummy1); + //} + + dummy = 0; dummy2 = 0; + MP4GetMetadataTrack(file, (unsigned __int16*)&dummy, (unsigned __int16*)&dummy2); + if (dummy) + { + wsprintf(dummy1, "%d", dummy); + ModInitTag.SetFieldA(tagHandle, TAGFIELD_TRACK, dummy1); + } + //if (dumm2) + //{ + // wsprintf(dummy1, "%d", dummy2); + // SetDlgItemText(hwndDlg,IDC_METATRACK2, dummy1); + //} + + //dummy = 0; dummy2 = 0; + //MP4GetMetadataDisk(file, &dummy, &dummy2); + //if (dummy) + //{ + // wsprintf(dummy1, "%d", dummy); + // SetDlgItemText(hwndDlg,IDC_METADISK1, dummy1); + //} + //if (dummy) + //{ + // wsprintf(dummy1, "%d", dummy2); + // SetDlgItemText(hwndDlg,IDC_METADISK2, dummy1); + //} + + pVal = NULL; + if (MP4GetMetadataYear(file, &pVal)) + uSetDlgItemText(tagHandle, TAGFIELD_YEAR, pVal); + + //dummy3 = 0; + //MP4GetMetadataCompilation(file, &dummy3); + //if (dummy3) + // SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_SETCHECK, BST_CHECKED, 0); + + pVal = NULL; + MP4GetMetadataTool(file, &pVal); + uSetDlgItemText(tagHandle, TAGFIELD_ENCODER, pVal); + + pVal = NULL; + MP4GetMetadataFreeForm(file, "CONDUCTOR", (unsigned __int8**)&pVal, &valueSize); + uSetDlgItemText(tagHandle, TAGFIELD_CONDUCTOR, pVal); + + pVal = NULL; + MP4GetMetadataFreeForm(file, "ORCHESTRA", (unsigned __int8**)&pVal, &valueSize); + uSetDlgItemText(tagHandle, TAGFIELD_ORCHESTRA, pVal); + + pVal = NULL; + MP4GetMetadataFreeForm(file, "YEARCOMPOSED", (unsigned __int8**)&pVal, &valueSize); + uSetDlgItemText(tagHandle, TAGFIELD_YEARCOMPOSED, pVal); + + pVal = NULL; + MP4GetMetadataFreeForm(file, "ORIGARTIST", (unsigned __int8**)&pVal, &valueSize); + uSetDlgItemText(tagHandle, TAGFIELD_ORIGARTIST, pVal); + + pVal = NULL; + MP4GetMetadataFreeForm(file, "LABEL", (unsigned __int8**)&pVal, &valueSize); + uSetDlgItemText(tagHandle, TAGFIELD_LABEL, pVal); + + pVal = NULL; + MP4GetMetadataFreeForm(file, "COPYRIGHT", (unsigned __int8**)&pVal, &valueSize); + uSetDlgItemText(tagHandle, TAGFIELD_COPYRIGHT, pVal); + + pVal = NULL; + MP4GetMetadataFreeForm(file, "CDDBTAGID", (unsigned __int8**)&pVal, &valueSize); + uSetDlgItemText(tagHandle, TAGFIELD_CDDBTAGID, pVal); + + /* ! Metadata */ + + MP4Close(file); + + return true; +} + +//----------------------------------------------------------------------------- + +bool Write_Tag(LPCSTR filename, void* tagHandle) +{ + // TODO: + // read metadata from tagHandle and set each field to supported tag + // only TAGFIELD_* are supported (see QCDModTagEditor.h) + + // example of how to get value from tagHandle + // use SetFieldA for ASCII or MultiBytes strings. + // use SetFieldW for UNICODE strings + // + // szwValue = ModInitTag.GetFieldW(tagHandle, TAGFIELD_ORCHESTRA); + + // write tag to file + + MP4FileHandle file = MP4_INVALID_FILE_HANDLE; + char dummy1[1024]; + char temp[1024]; + short dummy, dummy2; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("mp4_tag_write"); +#endif + + /* save Metadata changes */ + + tag_delete(&tags); + file = MP4Read(filename, 0); + if (file != MP4_INVALID_FILE_HANDLE) + { + ReadMP4Tag(file, &tags); + MP4Close(file); + + file = MP4Modify(filename, 0, 0); + if (file != MP4_INVALID_FILE_HANDLE) + { + MP4MetadataDelete(file); + MP4Close(file); + } + } + + file = MP4Modify(filename, 0, 0); + if (file == MP4_INVALID_FILE_HANDLE) + { + tag_delete(&tags); + //EndDialog(hwndDlg, wParam); + return false; + } + + uGetDlgItemText(tagHandle, TAGFIELD_TITLE, dummy1, 1024); + tag_set_field(&tags, "title", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_COMPOSER, dummy1, 1024); + tag_set_field(&tags, "writer", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_ARTIST, dummy1, 1024); + tag_set_field(&tags, "artist", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_ALBUM, dummy1, 1024); + tag_set_field(&tags, "album", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_COMMENT, dummy1, 1024); + tag_set_field(&tags, "comment", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_GENRE, dummy1, 1024); + tag_set_field(&tags, "genre", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_YEAR, dummy1, 1024); + tag_set_field(&tags, "year", dummy1); + + dummy = 0; + MP4GetMetadataTrack(file, (unsigned __int16*)&dummy, (unsigned __int16*)&dummy2); + memcpy(dummy1, ModInitTag.GetFieldA(tagHandle, TAGFIELD_TRACK), sizeof(dummy1)); + dummy = atoi(dummy1); + wsprintf(temp, "%d/%d", dummy, dummy2); + tag_set_field(&tags, "track", temp); + + //GetDlgItemText(hwndDlg, IDC_METADISK1, dummy1, 1024); + //dummy = atoi(dummy1); + //GetDlgItemText(hwndDlg, IDC_METADISK2, dummy1, 1024); + //dummy2 = atoi(dummy1); + //wsprintf(temp, "%d/%d", dummy, dummy2); + //tag_set_field(&tags, "disc", temp); + + //GetDlgItemText(hwndDlg, IDC_METATEMPO, dummy1, 1024); + //tag_set_field(&tags, "tempo", dummy1); + + //dummy3 = SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_GETCHECK, 0, 0); + //tag_set_field(&tags, "compilation", (dummy3 ? "1" : "0")); + + uGetDlgItemText(tagHandle, TAGFIELD_ENCODER, dummy1, 1024); + tag_set_field(&tags, "tool", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_CONDUCTOR, dummy1, 1024); + tag_set_field(&tags, "CONDUCTOR", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_ORCHESTRA, dummy1, 1024); + tag_set_field(&tags, "ORCHESTRA", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_YEARCOMPOSED, dummy1, 1024); + tag_set_field(&tags, "YEARCOMPOSED", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_ORIGARTIST, dummy1, 1024); + tag_set_field(&tags, "ORIGARTIST", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_LABEL, dummy1, 1024); + tag_set_field(&tags, "LABEL", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_COPYRIGHT, dummy1, 1024); + tag_set_field(&tags, "COPYRIGHT", dummy1); + + uGetDlgItemText(tagHandle, TAGFIELD_CDDBTAGID, dummy1, 1024); + tag_set_field(&tags, "CDDBTAGID", dummy1); + + WriteMP4Tag(file, &tags); + + MP4Close(file); + + MP4Optimize(filename, NULL, 0); + /* ! */ + + return true; +} + +//----------------------------------------------------------------------------- + +bool Strip_Tag(LPCSTR filename) +{ + // TODO: + // remove tag from file. + // do whatever is need to remove the supported tag from filename + + // return true for successfull strip, false for failure + + MP4FileHandle file; + + file = MP4Modify(filename, 0, 0); + if (file == MP4_INVALID_FILE_HANDLE) + return false; + + MP4MetadataDelete(file); + + MP4Close(file); + + return true; +} + +//----------------------------------------------------------------------------- + +/* Convert UNICODE to UTF-8 + Return number of bytes written */ +int unicodeToUtf8 ( const WCHAR* lpWideCharStr, char* lpMultiByteStr, int cwcChars ) +{ + const unsigned short* pwc = (unsigned short *)lpWideCharStr; + unsigned char* pmb = (unsigned char *)lpMultiByteStr; + const unsigned short* pwce; + size_t cBytes = 0; + + if ( cwcChars >= 0 ) { + pwce = pwc + cwcChars; + } else { + pwce = (unsigned short *)((size_t)-1); + } + + while ( pwc < pwce ) { + unsigned short wc = *pwc++; + + if ( wc < 0x00000080 ) { + *pmb++ = (char)wc; + cBytes++; + } else + if ( wc < 0x00000800 ) { + *pmb++ = (char)(0xC0 | ((wc >> 6) & 0x1F)); + cBytes++; + *pmb++ = (char)(0x80 | (wc & 0x3F)); + cBytes++; + } else + if ( wc < 0x00010000 ) { + *pmb++ = (char)(0xE0 | ((wc >> 12) & 0x0F)); + cBytes++; + *pmb++ = (char)(0x80 | ((wc >> 6) & 0x3F)); + cBytes++; + *pmb++ = (char)(0x80 | (wc & 0x3F)); + cBytes++; + } + if ( wc == L'\0' ) + return cBytes; + } + + return cBytes; +} + +/* Convert UTF-8 coded string to UNICODE + Return number of characters converted */ +int utf8ToUnicode ( const char* lpMultiByteStr, WCHAR* lpWideCharStr, int cmbChars ) +{ + const unsigned char* pmb = (unsigned char *)lpMultiByteStr; + unsigned short* pwc = (unsigned short *)lpWideCharStr; + const unsigned char* pmbe; + size_t cwChars = 0; + + if ( cmbChars >= 0 ) { + pmbe = pmb + cmbChars; + } else { + pmbe = (unsigned char *)((size_t)-1); + } + + while ( pmb < pmbe ) { + char mb = *pmb++; + unsigned int cc = 0; + unsigned int wc; + + while ( (cc < 7) && (mb & (1 << (7 - cc)))) { + cc++; + } + + if ( cc == 1 || cc > 6 ) // illegal character combination for UTF-8 + continue; + + if ( cc == 0 ) { + wc = mb; + } else { + wc = (mb & ((1 << (7 - cc)) - 1)) << ((cc - 1) * 6); + while ( --cc > 0 ) { + if ( pmb == pmbe ) // reached end of the buffer + return cwChars; + mb = *pmb++; + if ( ((mb >> 6) & 0x03) != 2 ) // not part of multibyte character + return cwChars; + wc |= (mb & 0x3F) << ((cc - 1) * 6); + } + } + + if ( wc & 0xFFFF0000 ) + wc = L'?'; + *pwc++ = wc; + cwChars++; + if ( wc == L'\0' ) + return cwChars; + } + + return cwChars; +} + +/* convert Windows ANSI to UTF-8 */ +int ConvertANSIToUTF8 ( const char* ansi, char* utf8 ) +{ + WCHAR* wszValue; // Unicode value + size_t ansi_len; + size_t len; + + *utf8 = '\0'; + if ( ansi == NULL ) + return 0; + + ansi_len = strlen ( ansi ); + + if ( (wszValue = (WCHAR *)malloc ( (ansi_len + 1) * 2 )) == NULL ) + return 0; + + /* Convert ANSI value to Unicode */ + if ( (len = MultiByteToWideChar ( CP_ACP, 0, ansi, ansi_len + 1, wszValue, (ansi_len + 1) * 2 )) == 0 ) { + free ( wszValue ); + return 0; + } + + /* Convert Unicode value to UTF-8 */ + if ( (len = unicodeToUtf8 ( wszValue, utf8, -1 )) == 0 ) { + free ( wszValue ); + return 0; + } + + free ( wszValue ); + + return len-1; +} + +/* convert UTF-8 to Windows ANSI */ +int ConvertUTF8ToANSI ( const char* utf8, char* ansi ) +{ + WCHAR* wszValue; // Unicode value + size_t utf8_len; + size_t len; + + *ansi = '\0'; + if ( utf8 == NULL ) + return 0; + + utf8_len = strlen ( utf8 ); + + if ( (wszValue = (WCHAR *)malloc ( (utf8_len + 1) * 2 )) == NULL ) + return 0; + + /* Convert UTF-8 value to Unicode */ + if ( (len = utf8ToUnicode ( utf8, wszValue, utf8_len + 1 )) == 0 ) { + free ( wszValue ); + return 0; + } + + /* Convert Unicode value to ANSI */ + if ( (len = WideCharToMultiByte ( CP_ACP, 0, wszValue, -1, ansi, (utf8_len + 1) * 2, NULL, NULL )) == 0 ) { + free ( wszValue ); + return 0; + } + + free ( wszValue ); + + return len-1; +} + +BOOL uSetDlgItemText(void *tagHandle, int fieldId, const char *str) +{ + char *temp; + size_t len; + int r; + + if (!str) return FALSE; + if (!*str) return FALSE; + len = strlen(str); + temp = (char *)malloc(len+1); + if (!temp) return FALSE; + memset(temp, '\0', len+1); + r = ConvertUTF8ToANSI(str, temp); + if (r > 0) + ModInitTag.SetFieldA(tagHandle, fieldId, temp); + free(temp); + + return r>0 ? TRUE : FALSE; +} + +UINT uGetDlgItemText(void *tagHandle, int fieldId, char *str, int max) +{ + char *temp, *utf8;; + int len; + + const char *p; + + if (!str || !max) return 0; + len = strlen( ModInitTag.GetFieldA(tagHandle, fieldId) ); + temp = (char *)malloc(len+1); + if (!temp) return 0; + utf8 = (char *)malloc((len+1)*4); + if (!utf8) + { + free(temp); + return 0; + } + + memset(temp, '\0', len+1); + memset(utf8, '\0', (len+1)*4); + memset(str, '\0', max); + p = ModInitTag.GetFieldA(tagHandle, fieldId); + memcpy(temp, p, len+1); + if (len > 0) + { + len = ConvertANSIToUTF8(temp, utf8); + if (len > max-1) + { + len = max-1; + utf8[max] = '\0'; + } + memcpy(str, utf8, len+1); + } + + free(temp); + free(utf8); + + return len; +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/QCDTagsDLL.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/QCDTagsDLL.h @@ -0,0 +1,14 @@ +#ifndef QCDTAGS_H +#define QCDTAGS_H + +#include "QCDModTagEditor.h" + +extern HINSTANCE hInstance; + +void ShutDown_Tag(int flags); +bool Read_Tag(LPCSTR filename, void* tagData); +bool Write_Tag(LPCSTR filename, void* tagData); +bool Strip_Tag(LPCSTR filename); + + +#endif \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/aac2mp4.cpp +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/aac2mp4.cpp @@ -0,0 +1,319 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: aac2mp4.cpp,v 1.3 2003/12/06 04:24:17 rjamorim Exp $ +**/ + +#include +#include +#include + +#include "aac2mp4.h" + +int covert_aac_to_mp4(char *inputFileName, char *mp4FileName) +{ + int Mp4TimeScale = 90000; + int allMpeg4Streams = 0; + MP4FileHandle mp4File; + FILE* inFile; + const char *type; + MP4TrackId createdTrackId = MP4_INVALID_TRACK_ID; + + mp4File = MP4Create(mp4FileName, 0, 0, 0); + if (mp4File) + { + MP4SetTimeScale(mp4File, Mp4TimeScale); + } else { + return 1; + } + + inFile = fopen(inputFileName, "rb"); + + if (inFile == NULL) + { + MP4Close(mp4File); + return 2; + } + + createdTrackId = AacCreator(mp4File, inFile); + + if (createdTrackId == MP4_INVALID_TRACK_ID) + { + fclose(inFile); + MP4Close(mp4File); + return 3; + } + + type = MP4GetTrackType(mp4File, createdTrackId); + + if (!strcmp(type, MP4_AUDIO_TRACK_TYPE)) + { + allMpeg4Streams &= + (MP4GetTrackAudioType(mp4File, createdTrackId) + == MP4_MPEG4_AUDIO_TYPE); + } + + if (inFile) + { + fclose(inFile); + } + + MP4Close(mp4File); + MP4MakeIsmaCompliant(mp4FileName, 0, allMpeg4Streams); + + return 0; +} + +#define ADTS_HEADER_MAX_SIZE 10 /* bytes */ + +static u_int8_t firstHeader[ADTS_HEADER_MAX_SIZE]; + +/* + * hdr must point to at least ADTS_HEADER_MAX_SIZE bytes of memory + */ +static bool LoadNextAdtsHeader(FILE* inFile, u_int8_t* hdr) +{ + u_int state = 0; + u_int dropped = 0; + u_int hdrByteSize = ADTS_HEADER_MAX_SIZE; + + while (1) { + /* read a byte */ + u_int8_t b; + + if (fread(&b, 1, 1, inFile) == 0) { + return false; + } + + /* header is complete, return it */ + if (state == hdrByteSize - 1) { + hdr[state] = b; + if (dropped > 0) { + fprintf(stderr, "Warning: dropped %u input bytes\n", dropped); + } + return true; + } + + /* collect requisite number of bytes, no constraints on data */ + if (state >= 2) { + hdr[state++] = b; + } else { + /* have first byte, check if we have 1111X00X */ + if (state == 1) { + if ((b & 0xF6) == 0xF0) { + hdr[state] = b; + state = 2; + /* compute desired header size */ + hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdr); + } else { + state = 0; + } + } + /* initial state, looking for 11111111 */ + if (state == 0) { + if (b == 0xFF) { + hdr[state] = b; + state = 1; + } else { + /* else drop it */ + dropped++; + } + } + } + } +} + +/* + * Load the next frame from the file + * into the supplied buffer, which better be large enough! + * + * Note: Frames are padded to byte boundaries + */ +static bool LoadNextAacFrame(FILE* inFile, u_int8_t* pBuf, u_int32_t* pBufSize, bool stripAdts) +{ + u_int16_t frameSize; + u_int16_t hdrBitSize, hdrByteSize; + u_int8_t hdrBuf[ADTS_HEADER_MAX_SIZE]; + + /* get the next AAC frame header, more or less */ + if (!LoadNextAdtsHeader(inFile, hdrBuf)) { + return false; + } + + /* get frame size from header */ + frameSize = MP4AV_AdtsGetFrameSize(hdrBuf); + + /* get header size in bits and bytes from header */ + hdrBitSize = MP4AV_AdtsGetHeaderBitSize(hdrBuf); + hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdrBuf); + + /* adjust the frame size to what remains to be read */ + frameSize -= hdrByteSize; + + if (stripAdts) { + if ((hdrBitSize % 8) == 0) { + /* header is byte aligned, i.e. MPEG-2 ADTS */ + /* read the frame data into the buffer */ + if (fread(pBuf, 1, frameSize, inFile) != frameSize) { + return false; + } + (*pBufSize) = frameSize; + } else { + /* header is not byte aligned, i.e. MPEG-4 ADTS */ + int i; + u_int8_t newByte; + int upShift = hdrBitSize % 8; + int downShift = 8 - upShift; + + pBuf[0] = hdrBuf[hdrBitSize / 8] << upShift; + + for (i = 0; i < frameSize; i++) { + if (fread(&newByte, 1, 1, inFile) != 1) { + return false; + } + pBuf[i] |= (newByte >> downShift); + pBuf[i+1] = (newByte << upShift); + } + (*pBufSize) = frameSize + 1; + } + } else { /* don't strip ADTS headers */ + memcpy(pBuf, hdrBuf, hdrByteSize); + if (fread(&pBuf[hdrByteSize], 1, frameSize, inFile) != frameSize) { + return false; + } + } + + return true; +} + +static bool GetFirstHeader(FILE* inFile) +{ + /* read file until we find an audio frame */ + fpos_t curPos; + + /* already read first header */ + if (firstHeader[0] == 0xff) { + return true; + } + + /* remember where we are */ + fgetpos(inFile, &curPos); + + /* go back to start of file */ + rewind(inFile); + + if (!LoadNextAdtsHeader(inFile, firstHeader)) { + return false; + } + + /* reposition the file to where we were */ + fsetpos(inFile, &curPos); + + return true; +} + +MP4TrackId AacCreator(MP4FileHandle mp4File, FILE* inFile) +{ + // collect all the necessary meta information + u_int32_t samplesPerSecond; + u_int8_t mpegVersion; + u_int8_t profile; + u_int8_t channelConfig; + + if (!GetFirstHeader(inFile)) { + return MP4_INVALID_TRACK_ID; + } + + samplesPerSecond = MP4AV_AdtsGetSamplingRate(firstHeader); + mpegVersion = MP4AV_AdtsGetVersion(firstHeader); + profile = MP4AV_AdtsGetProfile(firstHeader); + channelConfig = MP4AV_AdtsGetChannels(firstHeader); + + u_int8_t audioType = MP4_INVALID_AUDIO_TYPE; + switch (mpegVersion) { + case 0: + audioType = MP4_MPEG4_AUDIO_TYPE; + break; + case 1: + switch (profile) { + case 0: + audioType = MP4_MPEG2_AAC_MAIN_AUDIO_TYPE; + break; + case 1: + audioType = MP4_MPEG2_AAC_LC_AUDIO_TYPE; + break; + case 2: + audioType = MP4_MPEG2_AAC_SSR_AUDIO_TYPE; + break; + case 3: + return MP4_INVALID_TRACK_ID; + } + break; + } + + // add the new audio track + MP4TrackId trackId = + MP4AddAudioTrack(mp4File, + samplesPerSecond, 1024, audioType); + + if (trackId == MP4_INVALID_TRACK_ID) { + return MP4_INVALID_TRACK_ID; + } + + if (MP4GetNumberOfTracks(mp4File, MP4_AUDIO_TRACK_TYPE) == 1) { + MP4SetAudioProfileLevel(mp4File, 0x0F); + } + + u_int8_t* pConfig = NULL; + u_int32_t configLength = 0; + + MP4AV_AacGetConfiguration( + &pConfig, + &configLength, + profile, + samplesPerSecond, + channelConfig); + + if (!MP4SetTrackESConfiguration(mp4File, trackId, + pConfig, configLength)) { + MP4DeleteTrack(mp4File, trackId); + return MP4_INVALID_TRACK_ID; + } + + // parse the ADTS frames, and write the MP4 samples + u_int8_t sampleBuffer[8 * 1024]; + u_int32_t sampleSize = sizeof(sampleBuffer); + MP4SampleId sampleId = 1; + + while (LoadNextAacFrame(inFile, sampleBuffer, &sampleSize, true)) { + if (!MP4WriteSample(mp4File, trackId, sampleBuffer, sampleSize)) { + MP4DeleteTrack(mp4File, trackId); + return MP4_INVALID_TRACK_ID; + } + sampleId++; + sampleSize = sizeof(sampleBuffer); + } + + return trackId; +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/aac2mp4.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/aac2mp4.h @@ -0,0 +1,42 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: aac2mp4.h,v 1.3 2003/12/06 04:24:17 rjamorim Exp $ +**/ + +#ifndef AAC2MP4_H__ +#define AAC2MP4_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +int covert_aac_to_mp4(char *inputFileName, char *mp4FileName); +MP4TrackId AacCreator(MP4FileHandle mp4File, FILE* inFile); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/aacinfo.c +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/aacinfo.c @@ -0,0 +1,224 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: aacinfo.c,v 1.3 2003/12/06 04:24:17 rjamorim Exp $ +**/ + +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include +#include "aacinfo.h" +#include "utils.h" + +#define ADIF_MAX_SIZE 30 /* Should be enough */ +#define ADTS_MAX_SIZE 10 /* Should be enough */ + +static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000}; + +static int read_ADIF_header(FILE *file, faadAACInfo *info) +{ + int bitstream; + unsigned char buffer[ADIF_MAX_SIZE]; + int skip_size = 0; + int sf_idx; + + /* Get ADIF header data */ + info->headertype = 1; + + if (fread(buffer, 1, ADIF_MAX_SIZE, file) != ADIF_MAX_SIZE) + return -1; + + /* copyright string */ + if(buffer[0] & 0x80) + skip_size += 9; /* skip 9 bytes */ + + bitstream = buffer[0 + skip_size] & 0x10; + info->bitrate = ((unsigned int)(buffer[0 + skip_size] & 0x0F)<<19)| + ((unsigned int)buffer[1 + skip_size]<<11)| + ((unsigned int)buffer[2 + skip_size]<<3)| + ((unsigned int)buffer[3 + skip_size] & 0xE0); + + if (bitstream == 0) + { + info->object_type = ((buffer[6 + skip_size]&0x01)<<1)|((buffer[7 + skip_size]&0x80)>>7); + sf_idx = (buffer[7 + skip_size]&0x78)>>3; + } else { + info->object_type = (buffer[4 + skip_size] & 0x18)>>3; + sf_idx = ((buffer[4 + skip_size] & 0x07)<<1)|((buffer[5 + skip_size] & 0x80)>>7); + } + info->sampling_rate = sample_rates[sf_idx]; + + return 0; +} + +static int read_ADTS_header(FILE *file, faadAACInfo *info) +{ + /* Get ADTS header data */ + unsigned char buffer[ADTS_MAX_SIZE]; + int frames, t_framelength = 0, frame_length, sr_idx = 0, ID; + int second = 0, pos; + float frames_per_sec = 0; + unsigned long bytes; + unsigned long *tmp_seek_table = NULL; + + info->headertype = 2; + + /* Read all frames to ensure correct time and bitrate */ + for (frames = 0; /* */; frames++) + { + bytes = fread(buffer, 1, ADTS_MAX_SIZE, file); + + if (bytes != ADTS_MAX_SIZE) + break; + + /* check syncword */ + if (!((buffer[0] == 0xFF)&&((buffer[1] & 0xF6) == 0xF0))) + break; + + if (!frames) + { + /* fixed ADTS header is the same for every frame, so we read it only once */ + /* Syncword found, proceed to read in the fixed ADTS header */ + ID = buffer[1] & 0x08; + info->object_type = (buffer[2]&0xC0)>>6; + sr_idx = (buffer[2]&0x3C)>>2; + info->channels = ((buffer[2]&0x01)<<2)|((buffer[3]&0xC0)>>6); + + frames_per_sec = sample_rates[sr_idx] / 1024.f; + } + + /* ...and the variable ADTS header */ + if (ID == 0) + { + info->version = 4; + } else { /* MPEG-2 */ + info->version = 2; + } + frame_length = ((((unsigned int)buffer[3] & 0x3)) << 11) + | (((unsigned int)buffer[4]) << 3) | (buffer[5] >> 5); + + t_framelength += frame_length; + + pos = ftell(file) - ADTS_MAX_SIZE; + + fseek(file, frame_length - ADTS_MAX_SIZE, SEEK_CUR); + } + + if (frames > 0) + { + float sec_per_frame, bytes_per_frame; + info->sampling_rate = sample_rates[sr_idx]; + sec_per_frame = (float)info->sampling_rate/1024.0; + bytes_per_frame = (float)t_framelength / (float)frames; + info->bitrate = 8 * (int)floor(bytes_per_frame * sec_per_frame); + info->length = (int)floor((float)frames/frames_per_sec)*1000; + } else { + info->sampling_rate = 4; + info->bitrate = 128000; + info->length = 0; + info->channels = 0; + } + + return 0; +} + +int get_AAC_format(char *filename, faadAACInfo *info) +{ + unsigned long tagsize; + FILE *file; + char buffer[10]; + unsigned long file_len; + unsigned char adxx_id[5]; + unsigned long tmp; + + memset(info, 0, sizeof(faadAACInfo)); + + file = fopen(filename, "rb"); + + if(file == NULL) + return -1; + + fseek(file, 0, SEEK_END); + file_len = ftell(file); + fseek(file, 0, SEEK_SET); + + /* Skip the tag, if it's there */ + tmp = fread(buffer, 10, 1, file); + + if (StringComp(buffer, "ID3", 3) == 0) + { + /* high bit is not used */ + tagsize = (buffer[6] << 21) | (buffer[7] << 14) | + (buffer[8] << 7) | (buffer[9] << 0); + + fseek(file, tagsize, SEEK_CUR); + tagsize += 10; + } else { + tagsize = 0; + fseek(file, 0, SEEK_SET); + } + + if (file_len) + file_len -= tagsize; + + tmp = fread(adxx_id, 2, 1, file); + adxx_id[5-1] = 0; + info->length = 0; + + /* Determine the header type of the file, check the first two bytes */ + if (StringComp(adxx_id, "AD", 2) == 0) + { + /* We think its an ADIF header, but check the rest just to make sure */ + tmp = fread(adxx_id + 2, 2, 1, file); + + if (StringComp(adxx_id, "ADIF", 4) == 0) + { + read_ADIF_header(file, info); + + info->length = (int)((float)file_len*8000.0/((float)info->bitrate)); + } + } else { + /* No ADIF, check for ADTS header */ + if ((adxx_id[0] == 0xFF)&&((adxx_id[1] & 0xF6) == 0xF0)) + { + /* ADTS header located */ + fseek(file, tagsize, SEEK_SET); + read_ADTS_header(file, info); + } else { + /* Unknown/headerless AAC file, assume format: */ + info->version = 2; + info->bitrate = 128000; + info->sampling_rate = 44100; + info->channels = 2; + info->headertype = 0; + info->object_type = 1; + } + } + + fclose(file); + + return 0; +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/aacinfo.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/aacinfo.h @@ -0,0 +1,46 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: aacinfo.h,v 1.3 2003/12/06 04:24:17 rjamorim Exp $ +**/ + +#ifndef AACINFO_INCLUDED +#define AACINFO_INCLUDED + +typedef struct { + int version; + int channels; + int sampling_rate; + int bitrate; + int length; + int object_type; + int headertype; +} faadAACInfo; + +int get_AAC_format(char *filename, faadAACInfo *info); + +static int read_ADIF_header(FILE *file, faadAACInfo *info); +static int read_ADTS_header(FILE *file, faadAACInfo *info); + +#endif --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/config.c +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/config.c @@ -0,0 +1,48 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: config.c,v 1.3 2003/12/06 04:24:17 rjamorim Exp $ +**/ + +#define WIN32_LEAN_AND_MEAN +#include +#include "config.h" + +char app_name[] = "AudioCoding.com MPEG-4 General Audio player"; +char INI_FILE[MAX_PATH]; +int m_priority = 3; +int m_resolution = 0; +int m_show_errors = 1; +int m_use_for_aac = 1; +int m_downmix = 0; +int m_vbr_display = 0; +char titleformat[MAX_PATH]; + +void _r_s(char *name,char *data, int mlen) +{ + char buf[10]; + strcpy(buf,data); + GetPrivateProfileString(app_name,name,buf,data,mlen,INI_FILE); +} + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/config.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/config.h @@ -0,0 +1,42 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: config.h,v 1.3 2003/12/06 04:24:17 rjamorim Exp $ +**/ + +char app_name[]; +char INI_FILE[]; +int m_priority; +int m_resolution; +int m_show_errors; +int m_use_for_aac; +int m_downmix; +int m_vbr_display; +char titleformat[MAX_PATH]; + +#define RS(x) (_r_s(#x,x,sizeof(x))) +#define WS(x) (WritePrivateProfileString(app_name,#x,x,INI_FILE)) + +void _r_s(char *name,char *data, int mlen); + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/mbs.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/mbs.h @@ -0,0 +1,81 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001-2002. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MBS_INCLUDED__ +#define __MBS_INCLUDED__ + +class CMemoryBitstream { +public: + CMemoryBitstream() { + m_pBuf = NULL; + m_bitPos = 0; + m_numBits = 0; + } + + void AllocBytes(u_int32_t numBytes); + + void SetBytes(u_int8_t* pBytes, u_int32_t numBytes); + + void PutBytes(u_int8_t* pBytes, u_int32_t numBytes); + + void PutBits(u_int32_t bits, u_int32_t numBits); + + u_int32_t GetBits(u_int32_t numBits); + + void SkipBytes(u_int32_t numBytes) { + SkipBits(numBytes << 3); + } + + void SkipBits(u_int32_t numBits) { + SetBitPosition(GetBitPosition() + numBits); + } + + u_int32_t GetBitPosition() { + return m_bitPos; + } + + void SetBitPosition(u_int32_t bitPos) { + if (bitPos > m_numBits) { + throw; + } + m_bitPos = bitPos; + } + + u_int8_t* GetBuffer() { + return m_pBuf; + } + + u_int32_t GetNumberOfBytes() { + return (GetNumberOfBits() + 7) / 8; + } + + u_int32_t GetNumberOfBits() { + return m_numBits; + } + +protected: + u_int8_t* m_pBuf; + u_int32_t m_bitPos; + u_int32_t m_numBits; +}; + +#endif /* __MBS_INCLUDED__ */ + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/resource.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/resource.h @@ -0,0 +1,67 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by QCDMp4.rc +// +#define IDD_CONFIG 102 +#define IDC_TYPE 1000 +#define IDC_INFOTEXT 1000 +#define IDC_DURATION 1001 +#define IDC_BITRATE 1002 +#define IDC_SAMPLERATE 1003 +#define IDC_VTYPE 1004 +#define IDC_PRIORITY 1004 +#define IDC_VBITRATE 1005 +#define IDC_ERROR 1005 +#define IDC_VDURATION 1006 +#define IDC_16BITS 1006 +#define IDC_VSIZE 1007 +#define IDC_24BITS 1007 +#define IDC_CONVERT 1007 +#define IDC_VFPS 1008 +#define IDC_32BITS 1008 +#define IDC_CONVERT2 1008 +#define IDC_CHANNELS 1009 +#define IDC_24BITS2 1009 +#define IDC_16BITS_DITHERED 1009 +#define IDC_CONVERT1 1009 +#define IDC_USERDATA 1010 +#define IDC_USEFORAAC 1011 +#define IDC_METACOMPILATION 1012 +#define IDC_METANAME 1013 +#define IDC_METAARTIST 1014 +#define IDC_METAWRITER 1015 +#define IDC_METAALBUM 1016 +#define IDC_METACOMMENTS 1017 +#define IDC_METAGENRE 1018 +#define IDC_METAYEAR 1019 +#define IDC_METATRACK1 1020 +#define IDC_METADISK1 1021 +#define IDC_METATEMPO 1022 +#define IDC_METATRACK2 1023 +#define IDC_METADISK2 1024 +#define IDC_STATIC1 1025 +#define IDC_STATIC2 1026 +#define IDC_STATIC3 1027 +#define IDC_STATIC4 1028 +#define IDC_STATIC5 1029 +#define IDC_STATIC6 1030 +#define IDC_STATIC7 1031 +#define IDC_STATIC8 1032 +#define IDC_STATIC9 1033 +#define IDC_STATIC10 1034 +#define IDC_STATIC11 1035 +#define IDC_STATIC12 1036 +#define IDC_DOWNMIX 1038 +#define IDC_VBR 1039 +#define IDC_TITLEFORMAT 1040 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1041 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/utils.c +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/utils.c @@ -0,0 +1,153 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: utils.c,v 1.3 2003/12/06 04:24:17 rjamorim Exp $ +**/ + +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include "utils.h" + +int StringComp(char const *str1, char const *str2, unsigned long len) +{ + signed int c1 = 0, c2 = 0; + + while (len--) + { + c1 = tolower(*str1++); + c2 = tolower(*str2++); + + if (c1 == 0 || c1 != c2) + break; + } + + return c1 - c2; +} + +int GetAACTrack(MP4FileHandle infile) +{ + /* find AAC track */ + int i, rc; + int numTracks = MP4GetNumberOfTracks(infile, NULL, 0); + + for (i = 0; i < numTracks; i++) + { + MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0); + const char* trackType = MP4GetTrackType(infile, trackId); + + if (!strcmp(trackType, MP4_AUDIO_TRACK_TYPE)) + { + unsigned char *buff = NULL; + int buff_size = 0; + mp4AudioSpecificConfig mp4ASC; + + MP4GetTrackESConfiguration(infile, trackId, &buff, &buff_size); + + if (buff) + { + rc = AudioSpecificConfig(buff, buff_size, &mp4ASC); + free(buff); + + if (rc < 0) + return -1; + return trackId; + } + } + } + + /* can't decode this */ + return -1; +} + +int GetAudioTrack(MP4FileHandle infile) +{ + /* find AAC track */ + int i; + int numTracks = MP4GetNumberOfTracks(infile, NULL, 0); + + for (i = 0; i < numTracks; i++) + { + MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0); + const char* trackType = MP4GetTrackType(infile, trackId); + + if (!strcmp(trackType, MP4_AUDIO_TRACK_TYPE)) + { + return trackId; + } + } + + /* can't decode this */ + return -1; +} + +int GetVideoTrack(MP4FileHandle infile) +{ + /* find AAC track */ + int i; + int numTracks = MP4GetNumberOfTracks(infile, NULL, 0); + + for (i = 0; i < numTracks; i++) + { + MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0); + const char* trackType = MP4GetTrackType(infile, trackId); + + if (!strcmp(trackType, MP4_VIDEO_TRACK_TYPE)) + { + return trackId; + } + } + + /* can't decode this */ + return -1; +} + +LPTSTR PathFindFileName(LPCTSTR pPath) +{ + LPCTSTR pT; + + for (pT = pPath; *pPath; pPath = CharNext(pPath)) { + if ((pPath[0] == TEXT('\\') || pPath[0] == TEXT(':')) && pPath[1] && (pPath[1] != TEXT('\\'))) + pT = pPath + 1; + } + + return (LPTSTR)pT; // const -> non const +} + +char *convert3in4to3in3(void *sample_buffer, int samples) +{ + int i; + long *sample_buffer24 = (long*)sample_buffer; + char *data = malloc(samples*3*sizeof(char)); + + for (i = 0; i < samples; i++) + { + data[i*3] = sample_buffer24[i] & 0xFF; + data[i*3+1] = (sample_buffer24[i] >> 8) & 0xFF; + data[i*3+2] = (sample_buffer24[i] >> 16) & 0xFF; + } + + return data; +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/QCDMp4/utils.h +++ vlc-0.8.4.debian/extras/faad2/plugins/QCDMp4/utils.h @@ -0,0 +1,40 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: utils.h,v 1.3 2003/12/06 04:24:17 rjamorim Exp $ +**/ + +#ifndef UTILS_INCLUDED +#define UTILS_INCLUDED + +#include + +LPTSTR PathFindFileName(LPCTSTR pPath); +int GetVideoTrack(MP4FileHandle infile); +int GetAudioTrack(MP4FileHandle infile); +int GetAACTrack(MP4FileHandle infile); +int StringComp(char const *str1, char const *str2, unsigned long len); +char *convert3in4to3in3(void *sample_buffer, int samples); + +#endif \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/AUTHORS +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/AUTHORS @@ -0,0 +1,3 @@ +xmms-mp4 plugin for xmms-1.2.x + +re-coded by ciberfred from scratch --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/ChangeLog +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/ChangeLog @@ -0,0 +1,43 @@ +22 August 2004: + * move from libmp4v2 to libmp4ff + +1 December 2003: + * remove aac plug and merge the aac part with the mp4 part + so now 2 plugins in one :) + +4 juillet 2003: + * package the plugin for faad2 + * upgrade code to libfaad2-2.0 API + * version 0.5 + +15 juin 2003: + * better configuration code + (choose automaticaly at compile time) + * installation must be set by root + * version 0.4 + +15 mai 2003: + * update configure script to be better + * version 0.3 + +01 Novembre 2002: + * check automake/autoconf/libtool for plugin, now 'make install' work + * handle seeking + * configuration box created (thanks glade !) + * handle aac informations + * modification to a better infobox (thanks angain glade !) + * version 0.2 ready to public :) + +25 Aout 2002: + * gtk-1.2.x info file with some 'static' useful ID3 info + * title show in xmms correctly + * version 0.1 ready to public :) + +20 Aout 2002: + * everything... + * work with faad2lib-1.1, id3lib-3.8.0 (glibc-2.2.5, gcc-2.95.3) + i think the minimum required but need testing... + * playlist working + * handle id3tag, the plugin work :) + * new maintener : ciberfred + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/INSTALL +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/INSTALL @@ -0,0 +1,2 @@ +the installation of this plugin is provide by the faad2 package. +add to configure time the option '--with-xmms' and the plugin will be build \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/Makefile.am +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = src + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/Makefile.in @@ -0,0 +1,467 @@ +# Makefile.in generated by automake 1.8.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +subdir = plugins/bmp +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + AUTHORS ChangeLog INSTALL NEWS TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ +HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ +HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ +HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ +HAVE_XMMS_TRUE = @HAVE_XMMS_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MP4FF_LIBS = @MP4FF_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RPMBUILD = @RPMBUILD@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ +XMMS_CONFIG = @XMMS_CONFIG@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = src +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/bmp/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/bmp/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || mkdir "$(distdir)/$$subdir" \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="../$(top_distdir)" \ + distdir="../$(distdir)/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/NEWS +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/NEWS @@ -0,0 +1,21 @@ +22 Aout 2004 +------------ +modification du system de compilation, passage de libmp4v2 a libmp4ff +en static, libfaad en dynamique. + +1 Decembre 2003 +--------------- +merge du plugin aac et du plugin mp4. modification des script du projet faad +le plugin ne doit pas etre construit en meme temps que le projet + +4 Juillet 2003 +-------------- +integration du plugin xmms-aac dans le projet faad2 version 2.x + +15 aout 2002 +------------ + +Recodage en entier du plugin aac +me contacter par mail a : + +frederic.fondriest@laposte.net --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/README +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/README @@ -0,0 +1,23 @@ + xmms-mp4 plugin v0.5 + (dynamic version) + "a mp4/aac audio player for xmms" + coded by ciberfred from france + ------------- + +This source code allow to xmms to read .mp4/.m4a/.aac files + +About. + This plugin is a merge between aac and mp4 plugin. so now you could read +all new and old files encoded with different encoder and different format +(for the aac part). This is possible since the libfaad2 allow to read +old aac ADTS format. + +For any informations about this plugin contact me at : + +mail : frederic.fondriest@laposte.net +ICQ : 17293220 +aac plugin homepage (and more) : http://fondriest.frederic.free.fr/realisations/ +IRC : irc.eu.freenode.net (#lamip) + +-- +Frederic Fondriest --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/TODO +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/TODO @@ -0,0 +1,6 @@ +TODO: + + * handle AAC info such as MPEG-AAC type, header (ADTS/ADIF),... + * seeking... but it will certainly an option because it need + a reading of whole file.... + * any suggestions ... send me somes messages about it :) --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/src/Makefile.am +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/src/Makefile.am @@ -0,0 +1,12 @@ +libdir = `pkg-config --variable=input_plugin_dir bmp` +lib_LTLIBRARIES = libmp4.la + +libmp4_la_CFLAGS = `pkg-config --cflags bmp` -Wall \ + -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4ff + +libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la \ + $(top_builddir)/common/mp4ff/libmp4ff.la + +libmp4_la_LDFLAGS = -module -avoid-version `pkg-config --libs bmp` -lpthread + +libmp4_la_SOURCES = libmp4.c mp4_utils.c aac_utils.c --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/src/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/src/Makefile.in @@ -0,0 +1,547 @@ +# Makefile.in generated by automake 1.8.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SOURCES = $(libmp4_la_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +subdir = plugins/bmp/src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libmp4_la_DEPENDENCIES = $(top_builddir)/libfaad/libfaad.la \ + $(top_builddir)/common/mp4ff/libmp4ff.la +am_libmp4_la_OBJECTS = libmp4_la-libmp4.lo libmp4_la-mp4_utils.lo \ + libmp4_la-aac_utils.lo +libmp4_la_OBJECTS = $(am_libmp4_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/libmp4_la-aac_utils.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/libmp4_la-libmp4.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/libmp4_la-mp4_utils.Plo +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libmp4_la_SOURCES) +DIST_SOURCES = $(libmp4_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ +HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ +HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ +HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ +HAVE_XMMS_TRUE = @HAVE_XMMS_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MP4FF_LIBS = @MP4FF_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RPMBUILD = @RPMBUILD@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ +XMMS_CONFIG = @XMMS_CONFIG@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = `pkg-config --variable=input_plugin_dir bmp` +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +lib_LTLIBRARIES = libmp4.la +libmp4_la_CFLAGS = `pkg-config --cflags bmp` -Wall \ + -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4ff + +libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la \ + $(top_builddir)/common/mp4ff/libmp4ff.la + +libmp4_la_LDFLAGS = -module -avoid-version `pkg-config --libs bmp` -lpthread +libmp4_la_SOURCES = libmp4.c mp4_utils.c aac_utils.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/bmp/src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/bmp/src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmp4.la: $(libmp4_la_OBJECTS) $(libmp4_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libmp4_la_LDFLAGS) $(libmp4_la_OBJECTS) $(libmp4_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4_la-aac_utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4_la-libmp4.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4_la-mp4_utils.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libmp4_la-libmp4.o: libmp4.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-libmp4.o -MD -MP -MF "$(DEPDIR)/libmp4_la-libmp4.Tpo" -c -o libmp4_la-libmp4.o `test -f 'libmp4.c' || echo '$(srcdir)/'`libmp4.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-libmp4.Tpo" "$(DEPDIR)/libmp4_la-libmp4.Po"; else rm -f "$(DEPDIR)/libmp4_la-libmp4.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libmp4.c' object='libmp4_la-libmp4.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-libmp4.Po' tmpdepfile='$(DEPDIR)/libmp4_la-libmp4.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-libmp4.o `test -f 'libmp4.c' || echo '$(srcdir)/'`libmp4.c + +libmp4_la-libmp4.obj: libmp4.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-libmp4.obj -MD -MP -MF "$(DEPDIR)/libmp4_la-libmp4.Tpo" -c -o libmp4_la-libmp4.obj `if test -f 'libmp4.c'; then $(CYGPATH_W) 'libmp4.c'; else $(CYGPATH_W) '$(srcdir)/libmp4.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-libmp4.Tpo" "$(DEPDIR)/libmp4_la-libmp4.Po"; else rm -f "$(DEPDIR)/libmp4_la-libmp4.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libmp4.c' object='libmp4_la-libmp4.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-libmp4.Po' tmpdepfile='$(DEPDIR)/libmp4_la-libmp4.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-libmp4.obj `if test -f 'libmp4.c'; then $(CYGPATH_W) 'libmp4.c'; else $(CYGPATH_W) '$(srcdir)/libmp4.c'; fi` + +libmp4_la-libmp4.lo: libmp4.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-libmp4.lo -MD -MP -MF "$(DEPDIR)/libmp4_la-libmp4.Tpo" -c -o libmp4_la-libmp4.lo `test -f 'libmp4.c' || echo '$(srcdir)/'`libmp4.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-libmp4.Tpo" "$(DEPDIR)/libmp4_la-libmp4.Plo"; else rm -f "$(DEPDIR)/libmp4_la-libmp4.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libmp4.c' object='libmp4_la-libmp4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-libmp4.Plo' tmpdepfile='$(DEPDIR)/libmp4_la-libmp4.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-libmp4.lo `test -f 'libmp4.c' || echo '$(srcdir)/'`libmp4.c + +libmp4_la-mp4_utils.o: mp4_utils.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-mp4_utils.o -MD -MP -MF "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" -c -o libmp4_la-mp4_utils.o `test -f 'mp4_utils.c' || echo '$(srcdir)/'`mp4_utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" "$(DEPDIR)/libmp4_la-mp4_utils.Po"; else rm -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4_utils.c' object='libmp4_la-mp4_utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-mp4_utils.Po' tmpdepfile='$(DEPDIR)/libmp4_la-mp4_utils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-mp4_utils.o `test -f 'mp4_utils.c' || echo '$(srcdir)/'`mp4_utils.c + +libmp4_la-mp4_utils.obj: mp4_utils.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-mp4_utils.obj -MD -MP -MF "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" -c -o libmp4_la-mp4_utils.obj `if test -f 'mp4_utils.c'; then $(CYGPATH_W) 'mp4_utils.c'; else $(CYGPATH_W) '$(srcdir)/mp4_utils.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" "$(DEPDIR)/libmp4_la-mp4_utils.Po"; else rm -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4_utils.c' object='libmp4_la-mp4_utils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-mp4_utils.Po' tmpdepfile='$(DEPDIR)/libmp4_la-mp4_utils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-mp4_utils.obj `if test -f 'mp4_utils.c'; then $(CYGPATH_W) 'mp4_utils.c'; else $(CYGPATH_W) '$(srcdir)/mp4_utils.c'; fi` + +libmp4_la-mp4_utils.lo: mp4_utils.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-mp4_utils.lo -MD -MP -MF "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" -c -o libmp4_la-mp4_utils.lo `test -f 'mp4_utils.c' || echo '$(srcdir)/'`mp4_utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" "$(DEPDIR)/libmp4_la-mp4_utils.Plo"; else rm -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4_utils.c' object='libmp4_la-mp4_utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-mp4_utils.Plo' tmpdepfile='$(DEPDIR)/libmp4_la-mp4_utils.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-mp4_utils.lo `test -f 'mp4_utils.c' || echo '$(srcdir)/'`mp4_utils.c + +libmp4_la-aac_utils.o: aac_utils.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-aac_utils.o -MD -MP -MF "$(DEPDIR)/libmp4_la-aac_utils.Tpo" -c -o libmp4_la-aac_utils.o `test -f 'aac_utils.c' || echo '$(srcdir)/'`aac_utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo" "$(DEPDIR)/libmp4_la-aac_utils.Po"; else rm -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aac_utils.c' object='libmp4_la-aac_utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-aac_utils.Po' tmpdepfile='$(DEPDIR)/libmp4_la-aac_utils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-aac_utils.o `test -f 'aac_utils.c' || echo '$(srcdir)/'`aac_utils.c + +libmp4_la-aac_utils.obj: aac_utils.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-aac_utils.obj -MD -MP -MF "$(DEPDIR)/libmp4_la-aac_utils.Tpo" -c -o libmp4_la-aac_utils.obj `if test -f 'aac_utils.c'; then $(CYGPATH_W) 'aac_utils.c'; else $(CYGPATH_W) '$(srcdir)/aac_utils.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo" "$(DEPDIR)/libmp4_la-aac_utils.Po"; else rm -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aac_utils.c' object='libmp4_la-aac_utils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-aac_utils.Po' tmpdepfile='$(DEPDIR)/libmp4_la-aac_utils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-aac_utils.obj `if test -f 'aac_utils.c'; then $(CYGPATH_W) 'aac_utils.c'; else $(CYGPATH_W) '$(srcdir)/aac_utils.c'; fi` + +libmp4_la-aac_utils.lo: aac_utils.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-aac_utils.lo -MD -MP -MF "$(DEPDIR)/libmp4_la-aac_utils.Tpo" -c -o libmp4_la-aac_utils.lo `test -f 'aac_utils.c' || echo '$(srcdir)/'`aac_utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo" "$(DEPDIR)/libmp4_la-aac_utils.Plo"; else rm -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aac_utils.c' object='libmp4_la-aac_utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-aac_utils.Plo' tmpdepfile='$(DEPDIR)/libmp4_la-aac_utils.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-aac_utils.lo `test -f 'aac_utils.c' || echo '$(srcdir)/'`aac_utils.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/src/aac_utils.c +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/src/aac_utils.c @@ -0,0 +1,103 @@ +/* + * + * utils for AAC informations +*/ +#include +#include +#include + + +#define ADTS_HEADER_SIZE 8 +#define SEEK_TABLE_CHUNK 60 +#define MPEG4_TYPE 0 +#define MPEG2_TYPE 1 + +// Read ADTS header, the file descriptor must be at +// the begining of the aac frame not at the id3tag + +int getAacInfo(FILE *fd) +{ + unsigned char header[ADTS_HEADER_SIZE]; + unsigned int id; + unsigned long originPosition; + + originPosition = ftell(fd); + if(fread(header, 1, ADTS_HEADER_SIZE, fd) != ADTS_HEADER_SIZE){ + fseek(fd, originPosition, SEEK_SET); + return(-1); + } + if(!((header[0]==0xFF)&&((header[1]& 0xF6)==0xF0))){ + printf("Bad header\n"); + return(-1); + } + id = header[1]&0x08; + if(id==0){//MPEG-4 AAC + fseek(fd, originPosition, SEEK_SET); + return(MPEG4_TYPE); + }else{ + fseek(fd, originPosition, SEEK_SET); + return(MPEG2_TYPE); + } + fseek(fd, originPosition, SEEK_SET); + return(-1); +} + +// as AAC is VBR we need to check all ADTS header +// to enable seeking... +// there is no other solution +void checkADTSForSeeking(FILE *fd, + unsigned long **seekTable, + unsigned long *seekTableLength) +{ + unsigned long originPosition; + unsigned long position; + unsigned char header[ADTS_HEADER_SIZE]; + unsigned int frameCount, frameLength, frameInsec; + unsigned int id=0, seconds=0; + + originPosition = ftell(fd); + + for(frameCount=0,frameInsec=0;; frameCount++,frameInsec++){ + position = ftell(fd); + if(fread(header, 1, ADTS_HEADER_SIZE, fd)!=ADTS_HEADER_SIZE){ + break; + } + if(!strncmp(header, "ID3", 3)){ + break; + } + if(!((header[0]==0xFF)&&((header[1]& 0xF6)==0xF0))){ + printf("error : Bad 1st header, file may be corrupt !\n"); + break; + } + if(!frameCount){ + id=header[1]&0x08; + if(((*seekTable) = malloc(SEEK_TABLE_CHUNK * sizeof(unsigned long)))==0){ + printf("malloc error\n"); + return; + } + (*seekTableLength) = SEEK_TABLE_CHUNK; + } + + //if(id==0){//MPEG-4 + //frameLength = ((unsigned int)header[4]<<5)|((unsigned int)header[5]>>3); + //}else{//MPEG-2 + frameLength = (((unsigned int)header[3]&0x3)<<11)|((unsigned int)header[4]<<3)|(header[5]>>5); + //} + if(frameInsec==43){//??? + frameInsec=0; + } + if(frameInsec==0){ + if(seconds == (*seekTableLength)){ + (*seekTable) = realloc((*seekTable), (seconds+SEEK_TABLE_CHUNK)*sizeof(unsigned long)); + (*seekTableLength) = seconds+SEEK_TABLE_CHUNK; + } + (*seekTable)[seconds] = position; + seconds++; + } + if(fseek(fd, frameLength-ADTS_HEADER_SIZE, SEEK_CUR)==-1){ + break; + } + } + (*seekTableLength) = seconds; + fseek(fd, originPosition, SEEK_SET); +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/src/libmp4.c +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/src/libmp4.c @@ -0,0 +1,579 @@ +/* + * MP4/AAC decoder for xmms + * + * OPTIONNAL need + * -------------- + * libid3 (3.8.x - www.id3.org) +*/ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "faad.h" +#include "mp4ff.h" + +#define MP4_DESCRIPTION "MP4 & MPEG2/4-AAC audio player - 1.2.x" +#define MP4_VERSION "ver. 0.5-faad2-version - 22 August 2004" +#define MP4_ABOUT "Written by ciberfred" +#define BUFFER_SIZE FAAD_MIN_STREAMSIZE*64 + +static void mp4_init(void); +static void mp4_about(void); +static void mp4_play(char *); +static void mp4_stop(void); +static void mp4_pause(short); +static void mp4_seek(int); +static int mp4_getTime(void); +static void mp4_cleanup(void); +static void mp4_getSongTitle(char *, char **, int *); +static void mp4_getSongInfo(char *); +static int mp4_isFile(char *); +static void* mp4Decode(void *); + +InputPlugin mp4_ip = + { + 0, // handle + 0, // filename + MP4_DESCRIPTION, + mp4_init, + mp4_about, + 0, // configuration + mp4_isFile, + 0, //scandir + mp4_play, + mp4_stop, + mp4_pause, + mp4_seek, + 0, // set equalizer + mp4_getTime, + 0, // get volume + 0, + mp4_cleanup, + 0, // obsolete + 0, // send visualisation data + 0, // set player window info + 0, // set song title text + mp4_getSongTitle, // get song title text + mp4_getSongInfo, // info box + 0, // to output plugin + }; + +typedef struct _mp4cfg{ + gshort file_type; +#define FILE_UNKNOW 0 +#define FILE_MP4 1 +#define FILE_AAC 2 +} Mp4Config; + +static Mp4Config mp4cfg; +static gboolean bPlaying = FALSE; +static pthread_t decodeThread; +static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; +static int seekPosition = -1; + +// Functions from mp4_utils.c +extern int getAACTrack(mp4ff_t *infile); +extern mp4ff_callback_t *getMP4FF_cb(FILE *mp4file); +extern char *getMP4title(mp4ff_t *infile, char *filename); +extern void getMP4info(char* filename, FILE *mp4file); + +InputPlugin *get_iplugin_info(void) +{ + return(&mp4_ip); +} + +static void mp4_init(void) +{ + memset(&decodeThread, 0, sizeof(pthread_t)); + mp4cfg.file_type = FILE_UNKNOW; + seekPosition = -1; + return; +} + +static void mp4_play(char *filename) +{ + bPlaying = TRUE; + pthread_create(&decodeThread, 0, mp4Decode, g_strdup(filename)); + return; +} + +static void mp4_stop(void) +{ + if(bPlaying){ + bPlaying = FALSE; + pthread_join(decodeThread, NULL); + memset(&decodeThread, 0, sizeof(pthread_t)); + mp4_ip.output->close_audio(); + } +} + +static int mp4_isFile(char *filename) +{ + if(filename){ + gchar* extention; + + extention = strrchr(filename, '.'); + if(extention && + (!strncasecmp(extention, ".mp4", 4) || // official extention + !strncasecmp(extention, ".m4a", 4) || // Apple mp4 extention + !strncasecmp(extention, ".aac", 4) // old MPEG2/4-AAC extention + )){ + return (1); + } + } + return(0); +} + +static void mp4_about(void) +{ + static GtkWidget *aboutbox; + + if(aboutbox!=NULL) + return; + aboutbox = xmms_show_message("About MP4 AAC player plugin", + "libfaad2-" FAAD2_VERSION "\n" + "plugin version: " MP4_VERSION "\n" + MP4_ABOUT, + "Ok", FALSE, NULL, NULL); + gtk_signal_connect(GTK_OBJECT(aboutbox), "destroy", + GTK_SIGNAL_FUNC(gtk_widget_destroyed), + &aboutbox); +} + +static void mp4_pause(short flag) +{ + mp4_ip.output->pause(flag); +} + +static void mp4_seek(int time) +{ + seekPosition = time; + while(bPlaying && seekPosition!=-1) + xmms_usleep(10000); +} + +static int mp4_getTime(void) +{ + if(!bPlaying) + return (-1); + else + return (mp4_ip.output->output_time()); +} + +static void mp4_cleanup(void) +{ +} + +void mp4_get_file_type(FILE *mp4file) +{ + unsigned char header[10] = {0}; + + fseek(mp4file, 0, SEEK_SET); + fread(header, 1, 8, mp4file); + if(header[4]=='f' && + header[5]=='t' && + header[6]=='y' && + header[7]=='p'){ + mp4cfg.file_type = FILE_MP4; + }else{ + mp4cfg.file_type = FILE_AAC; + } +} + +static void mp4_getSongTitle(char *filename, char **title, int *len) { + FILE* mp4file; + + (*title) = NULL; + (*len) = -1; + + if((mp4file = fopen(filename, "rb"))){ + mp4_get_file_type(mp4file); + fseek(mp4file, 0, SEEK_SET); + if(mp4cfg.file_type == FILE_MP4){ + mp4ff_callback_t* mp4cb; + mp4ff_t* infile; + gint mp4track; + + mp4cb = getMP4FF_cb(mp4file); + if ((infile = mp4ff_open_read_metaonly(mp4cb)) && + ((mp4track = getAACTrack(infile)) >= 0)){ + (*title) = getMP4title(infile, filename); + + double track_duration = mp4ff_get_track_duration(infile, mp4track); + unsigned long time_scale = mp4ff_time_scale(infile, mp4track); + unsigned long length = (track_duration * 1000 / time_scale); + (*len) = length; + } + if(infile) mp4ff_close(infile); + if(mp4cb) g_free(mp4cb); + } + else{ + // Check AAC ID3 tag... + } + fclose(mp4file); + } +} + +static void mp4_getSongInfo(char *filename) +{ + FILE* mp4file; + if((mp4file = fopen(filename, "rb"))){ + if (mp4cfg.file_type == FILE_UNKNOW) + mp4_get_file_type(mp4file); + fseek(mp4file, 0, SEEK_SET); + if(mp4cfg.file_type == FILE_MP4) + getMP4info(filename, mp4file); + else if(mp4cfg.file_type == FILE_AAC) + /* + * check the id3tagv2 + */ + ; + fclose(mp4file); + } +} + +static void *mp4Decode(void *args) +{ + FILE* mp4file; + + pthread_mutex_lock(&mutex); + seekPosition = -1; + bPlaying = TRUE; + + if(!(mp4file = fopen(args, "rb"))){ + g_print("MP4!AAC - Can't open file\n"); + g_free(args); + bPlaying = FALSE; + pthread_mutex_unlock(&mutex); + pthread_exit(NULL); + + } + mp4_get_file_type(mp4file); + fseek(mp4file, 0, SEEK_SET); + if(mp4cfg.file_type == FILE_MP4){// We are reading a MP4 file + mp4ff_callback_t* mp4cb; + mp4ff_t* infile; + gint mp4track; + + mp4cb = getMP4FF_cb(mp4file); + if(!(infile = mp4ff_open_read(mp4cb))){ + g_print("MP4 - Can't open file\n"); + goto end; + } + + if((mp4track = getAACTrack(infile)) < 0){ + /* + * TODO: check here for others Audio format..... + * + */ + g_print("Unsupported Audio track type\n"); + g_free(args); + fclose(mp4file); + bPlaying = FALSE; + pthread_mutex_unlock(&mutex); + pthread_exit(NULL); + }else{ + faacDecHandle decoder; + unsigned char *buffer = NULL; + guint bufferSize = 0; + gulong samplerate; + guchar channels; + //guint avgBitrate; + //MP4Duration duration; + int msDuration; + int numSamples; + int sampleID = 0; + unsigned int framesize; + mp4AudioSpecificConfig mp4ASC; + gchar *xmmstitle; + + decoder = faacDecOpen(); + mp4ff_get_decoder_config(infile, mp4track, &buffer, &bufferSize); + if(faacDecInit2(decoder, buffer, bufferSize, &samplerate, &channels)<0){ + goto end; + } + if(buffer){ + framesize = 1024; + if(faacDecAudioSpecificConfig(buffer, bufferSize, &mp4ASC) >= 0){ + if(mp4ASC.frameLengthFlag == 1) framesize = 960; + if(mp4ASC.sbr_present_flag == 1) framesize *= 2; + } + g_free(buffer); + } + if(channels == 0){ + g_print("Number of Channels not supported\n"); + goto end; + } + + //duration = MP4GetTrackDuration(mp4file, mp4track); + //msDuration = MP4ConvertFromTrackDuration(mp4file, mp4track, + // duration,MP4_MSECS_TIME_SCALE); + + //msDuration = mp4ff_get_track_duration(infile, mp4track); + //printf("%d\n", msDuration); + + //numSamples = MP4GetTrackNumberOfSamples(mp4file, mp4track); + numSamples = mp4ff_num_samples(infile, mp4track); + { + float f = 1024.0; + if(mp4ASC.sbr_present_flag == 1) + f = f * 2.0; + msDuration = ((float)numSamples*(float)(f-1.0)/ + (float)samplerate)*1000; + } + xmmstitle = getMP4title(infile, args); + mp4_ip.output->open_audio(FMT_S16_NE, samplerate, channels); + mp4_ip.output->flush(0); + mp4_ip.set_info(xmmstitle, msDuration, -1, samplerate/1000, channels); + g_print("MP4 - %d channels @ %ld Hz\n", channels, samplerate); + + while(bPlaying){ + void* sampleBuffer; + faacDecFrameInfo frameInfo; + gint rc; + + if(seekPosition!=-1){ + /* + duration = MP4ConvertToTrackDuration(mp4file, + mp4track, + seekPosition*1000, + MP4_MSECS_TIME_SCALE); + sampleID = MP4GetSampleIdFromTime(mp4file, mp4track, duration, 0); + */ + float f = 1024.0; + if(mp4ASC.sbr_present_flag == 1) + f = f * 2.0; + sampleID = (float)seekPosition*(float)samplerate/(float)(f-1.0); + mp4_ip.output->flush(seekPosition*1000); + seekPosition = -1; + } + buffer=NULL; + bufferSize=0; + rc = mp4ff_read_sample(infile, mp4track, sampleID++, + &buffer, &bufferSize); + //g_print("%d/%d\n", sampleID-1, numSamples); + if((rc==0) || (buffer== NULL)){ + g_print("MP4: read error\n"); + sampleBuffer = NULL; + sampleID=0; + mp4_ip.output->buffer_free(); + goto end; + }else{ + sampleBuffer = faacDecDecode(decoder, &frameInfo, buffer, bufferSize); + if(frameInfo.error > 0){ + g_print("MP4: %s\n", + faacDecGetErrorMessage(frameInfo.error)); + goto end; + } + if(buffer){ + g_free(buffer); buffer=NULL; bufferSize=0; + } + while(bPlaying && mp4_ip.output->buffer_free()written_time(), + FMT_S16_NE, + channels, + frameInfo.samples<<1, + sampleBuffer); + mp4_ip.output->write_audio(sampleBuffer, frameInfo.samples<<1); + if(sampleID > numSamples){ + break; + } + } + while(bPlaying && mp4_ip.output->buffer_playing() && mp4_ip.output->buffer_free()){ + xmms_usleep(10000); + } +end: + mp4_ip.output->close_audio(); + g_free(args); + faacDecClose(decoder); + if(infile) mp4ff_close(infile); + if(mp4cb) g_free(mp4cb); + bPlaying = FALSE; + fclose(mp4file); + pthread_mutex_unlock(&mutex); + pthread_exit(NULL); + } + }else{ + // WE ARE READING AN AAC FILE + FILE *file = NULL; + faacDecHandle decoder = 0; + guchar *buffer = 0; + gulong bufferconsumed = 0; + gulong samplerate = 0; + guchar channels; + gulong buffervalid = 0; + TitleInput* input; + gchar *temp = g_strdup(args); + gchar *ext = strrchr(temp, '.'); + gchar *xmmstitle = NULL; + faacDecConfigurationPtr config; + + if((file = fopen(args, "rb")) == 0){ + g_print("AAC: can't find file %s\n", args); + bPlaying = FALSE; + pthread_mutex_unlock(&mutex); + pthread_exit(NULL); + } + if((decoder = faacDecOpen()) == NULL){ + g_print("AAC: Open Decoder Error\n"); + fclose(file); + bPlaying = FALSE; + pthread_mutex_unlock(&mutex); + pthread_exit(NULL); + } + config = faacDecGetCurrentConfiguration(decoder); + config->useOldADTSFormat = 0; + faacDecSetConfiguration(decoder, config); + if((buffer = g_malloc(BUFFER_SIZE)) == NULL){ + g_print("AAC: error g_malloc\n"); + fclose(file); + bPlaying = FALSE; + faacDecClose(decoder); + pthread_mutex_unlock(&mutex); + pthread_exit(NULL); + } + if((buffervalid = fread(buffer, 1, BUFFER_SIZE, file))==0){ + g_print("AAC: Error reading file\n"); + g_free(buffer); + fclose(file); + bPlaying = FALSE; + faacDecClose(decoder); + pthread_mutex_unlock(&mutex); + pthread_exit(NULL); + } + XMMS_NEW_TITLEINPUT(input); + input->file_name = g_basename(temp); + input->file_ext = ext ? ext+1 : NULL; + input->file_path = temp; + if(!strncmp(buffer, "ID3", 3)){ + gint size = 0; + + fseek(file, 0, SEEK_SET); + size = (buffer[6]<<21) | (buffer[7]<<14) | (buffer[8]<<7) | buffer[9]; + size+=10; + fread(buffer, 1, size, file); + buffervalid = fread(buffer, 1, BUFFER_SIZE, file); + } + xmmstitle = xmms_get_titlestring(xmms_get_gentitle_format(), input); + if(xmmstitle == NULL) + xmmstitle = g_strdup(input->file_name); + if(temp) g_free(temp); + if(input->performer) g_free(input->performer); + if(input->album_name) g_free(input->album_name); + if(input->track_name) g_free(input->track_name); + if(input->genre) g_free(input->genre); + g_free(input); + bufferconsumed = faacDecInit(decoder, + buffer, + buffervalid, + &samplerate, + &channels); + if(mp4_ip.output->open_audio(FMT_S16_NE,samplerate,channels) == FALSE){ + g_print("AAC: Output Error\n"); + g_free(buffer); buffer=0; + faacDecClose(decoder); + fclose(file); + mp4_ip.output->close_audio(); + /* + if(positionTable){ + g_free(positionTable); positionTable=0; + } + */ + g_free(xmmstitle); + bPlaying = FALSE; + pthread_mutex_unlock(&mutex); + pthread_exit(NULL); + } + //if(bSeek){ + //mp4_ip.set_info(xmmstitle, lenght*1000, -1, samplerate, channels); + //}else{ + mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels); + //} + mp4_ip.output->flush(0); + + while(bPlaying && buffervalid > 0){ + faacDecFrameInfo finfo; + unsigned long samplesdecoded; + char* sample_buffer = NULL; + /* + if(bSeek && seekPosition!=-1){ + fseek(file, positionTable[seekPosition], SEEK_SET); + bufferconsumed=0; + buffervalid = fread(buffer, 1, BUFFER_SIZE, file); + aac_ip.output->flush(seekPosition*1000); + seekPosition=-1; + } + */ + if(bufferconsumed > 0){ + memmove(buffer, &buffer[bufferconsumed], buffervalid-bufferconsumed); + buffervalid -= bufferconsumed; + buffervalid += fread(&buffer[buffervalid], 1, + BUFFER_SIZE-buffervalid, file); + bufferconsumed = 0; + } + sample_buffer = faacDecDecode(decoder, &finfo, buffer, buffervalid); + if(finfo.error){ + config = faacDecGetCurrentConfiguration(decoder); + if(config->useOldADTSFormat != 1){ + faacDecClose(decoder); + decoder = faacDecOpen(); + config = faacDecGetCurrentConfiguration(decoder); + config->useOldADTSFormat = 1; + faacDecSetConfiguration(decoder, config); + finfo.bytesconsumed=0; + finfo.samples = 0; + faacDecInit(decoder, + buffer, + buffervalid, + &samplerate, + &channels); + }else{ + g_print("FAAD2 Warning %s\n", faacDecGetErrorMessage(finfo.error)); + buffervalid = 0; + } + } + bufferconsumed += finfo.bytesconsumed; + samplesdecoded = finfo.samples; + if((samplesdecoded<=0) && !sample_buffer){ + g_print("AAC: error sample decoding\n"); + continue; + } + while(bPlaying && mp4_ip.output->buffer_free() < (samplesdecoded<<1)){ + xmms_usleep(10000); + } + mp4_ip.add_vis_pcm(mp4_ip.output->written_time(), + FMT_S16_LE, channels, + samplesdecoded<<1, sample_buffer); + mp4_ip.output->write_audio(sample_buffer, samplesdecoded<<1); + } + while(bPlaying && mp4_ip.output->buffer_playing()){ + xmms_usleep(10000); + } + mp4_ip.output->buffer_free(); + mp4_ip.output->close_audio(); + bPlaying = FALSE; + g_free(buffer); + faacDecClose(decoder); + g_free(xmmstitle); + fclose(file); + seekPosition = -1; + /* + if(positionTable){ + g_free(positionTable); positionTable=0; + } + */ + bPlaying = FALSE; + pthread_mutex_unlock(&mutex); + pthread_exit(NULL); + + } +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/bmp/src/mp4_utils.c +++ vlc-0.8.4.debian/extras/faad2/plugins/bmp/src/mp4_utils.c @@ -0,0 +1,469 @@ +/* + * some functions for MP4 files +*/ + +#include "mp4ff.h" +#include "faad.h" + +#include +#include +#include +#include +#include +#include +#include + +const char *mp4AudioNames[]= + { + "MPEG-1 Audio Layers 1,2 or 3", + "MPEG-2 low biterate (MPEG-1 extension) - MP3", + "MPEG-2 AAC Main Profile", + "MPEG-2 AAC Low Complexity profile", + "MPEG-2 AAC SSR profile", + "MPEG-4 audio (MPEG-4 AAC)", + 0 + }; + +/* MPEG-4 Audio types from 14496-3 Table 1.5.1 (from mp4.h)*/ +const char *mpeg4AudioNames[]= + { + "!!!!MPEG-4 Audio track Invalid !!!!!!!", + "MPEG-4 AAC Main profile", + "MPEG-4 AAC Low Complexity profile", + "MPEG-4 AAC SSR profile", + "MPEG-4 AAC Long Term Prediction profile", + "MPEG-4 AAC Scalable", + "MPEG-4 CELP", + "MPEG-4 HVXC", + "MPEG-4 Text To Speech", + "MPEG-4 Main Synthetic profile", + "MPEG-4 Wavetable Synthesis profile", + "MPEG-4 MIDI Profile", + "MPEG-4 Algorithmic Synthesis and Audio FX profile" + }; + +static GtkWidget *mp4_info_dialog = NULL; + +/* + * find AAC track +*/ + +int getAACTrack(mp4ff_t *infile) +{ + int i, rc; + int numTracks = mp4ff_total_tracks(infile); + + printf("total-tracks: %d\n", numTracks); + for(i=0; iread = read_callback; + mp4cb->seek = seek_callback; + mp4cb->user_data = mp4file; + return mp4cb; +} + +/* + * Function to display an info box for an mp4 file. + * This code is based heavily on fileinfo.c from the xmms mpg123 + * plugin, and the info box layout mimics that plugin. +*/ +void create_mp4_info_dialog (char *filename, FILE *mp4file, mp4ff_t *infile, gint mp4track) +{ + char *window_title, *value, *value2; + static GtkWidget *filename_entry, *title_entry, *artist_entry, *album_entry; + static GtkWidget *genre_entry, *year_entry, *track_entry, *comment_entry; + static GtkWidget *mp4_info_label; + + if (!mp4_info_dialog) + { + GtkWidget *dialog_vbox1, *vbox1, *hbox2, *hbox3, *hbox4; + GtkWidget *frame2, *frame3, *table1, *dialog_action_area1; + GtkWidget *filename_label, *title_label, *artist_label, *album_label; + GtkWidget *genre_label, *year_label, *track_label, *comment_label; + GtkWidget *close_button; + + mp4_info_dialog = gtk_dialog_new (); + gtk_object_set_data (GTK_OBJECT (mp4_info_dialog), "mp4_info_dialog", mp4_info_dialog); + gtk_window_set_policy (GTK_WINDOW (mp4_info_dialog), TRUE, TRUE, FALSE); + gtk_signal_connect(GTK_OBJECT (mp4_info_dialog), "destroy", + gtk_widget_destroyed, &mp4_info_dialog); + + dialog_vbox1 = GTK_DIALOG (mp4_info_dialog)->vbox; + gtk_object_set_data (GTK_OBJECT (mp4_info_dialog), "dialog_vbox1", dialog_vbox1); + gtk_container_set_border_width (GTK_CONTAINER (dialog_vbox1), 3); + + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_ref (hbox2); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "hbox2", hbox2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox2, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox2), 3); + + filename_label = gtk_label_new ("Filename: "); + gtk_widget_ref (filename_label); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "filename_label", filename_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (hbox2), filename_label, FALSE, FALSE, 0); + + filename_entry = gtk_entry_new (); + gtk_widget_ref (filename_entry); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "filename_entry", filename_entry, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (hbox2), filename_entry, TRUE, TRUE, 0); + gtk_entry_set_editable (GTK_ENTRY (filename_entry), FALSE); + + hbox3 = gtk_hbox_new (FALSE, 0); + gtk_widget_ref (hbox3); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "hbox3", hbox3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox3, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox3), 3); + + frame2 = gtk_frame_new ("Tag Info: "); + gtk_widget_ref (frame2); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "frame2", frame2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (hbox3), frame2, TRUE, TRUE, 0); + + table1 = gtk_table_new (6, 2, FALSE); + gtk_widget_ref (table1); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "table1", table1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_container_add (GTK_CONTAINER (frame2), table1); + gtk_container_set_border_width (GTK_CONTAINER (table1), 5); + + comment_label = gtk_label_new ("Comment: "); + gtk_widget_ref (comment_label); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "comment_label", comment_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), comment_label, 0, 1, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND), 0, 0); + gtk_misc_set_alignment (GTK_MISC (comment_label), 1, 0.5); + + genre_label = gtk_label_new ("Genre: "); + gtk_widget_ref (genre_label); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "genre_label", genre_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), genre_label, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND), 0, 0); + gtk_misc_set_alignment (GTK_MISC (genre_label), 1, 0.5); + + album_label = gtk_label_new ("Album: "); + gtk_widget_ref (album_label); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "album_label", album_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), album_label, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND), 0, 0); + gtk_misc_set_alignment (GTK_MISC (album_label), 1, 0.5); + + title_label = gtk_label_new ("Title: "); + gtk_widget_ref (title_label); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "title_label", title_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), title_label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND), 0, 0); + gtk_misc_set_alignment (GTK_MISC (title_label), 1, 0.5); + + artist_label = gtk_label_new ("Artist: "); + gtk_widget_ref (artist_label); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "artist_label", artist_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), artist_label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND), 0, 0); + gtk_misc_set_alignment (GTK_MISC (artist_label), 1, 0.5); + + year_label = gtk_label_new ("Year: "); + gtk_widget_ref (year_label); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "year_label", year_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), year_label, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND), 0, 0); + gtk_misc_set_alignment (GTK_MISC (year_label), 1, 0.5); + + hbox4 = gtk_hbox_new (FALSE, 0); + gtk_widget_ref (hbox4); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "hbox4", hbox4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), hbox4, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + year_entry = gtk_entry_new (); + gtk_widget_ref (year_entry); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "year_entry", year_entry, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (hbox4), year_entry, FALSE, FALSE, 0); + gtk_widget_set_usize (year_entry, 60, -2); + gtk_entry_set_editable (GTK_ENTRY (year_entry), FALSE); + + track_label = gtk_label_new (" Track: "); + gtk_widget_ref (track_label); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "track_label", track_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (hbox4), track_label, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (track_label), 1, 0.5); + + track_entry = gtk_entry_new (); + gtk_widget_ref (track_entry); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "track_entry", track_entry, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (hbox4), track_entry, FALSE, FALSE, 0); + gtk_widget_set_usize (track_entry, 60, -2); + gtk_entry_set_editable (GTK_ENTRY (track_entry), FALSE); + + title_entry = gtk_entry_new (); + gtk_widget_ref (title_entry); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "title_entry", title_entry, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), title_entry, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (title_entry), FALSE); + + artist_entry = gtk_entry_new (); + gtk_widget_ref (artist_entry); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "artist_entry", artist_entry, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), artist_entry, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (artist_entry), FALSE); + + album_entry = gtk_entry_new (); + gtk_widget_ref (album_entry); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "album_entry", album_entry, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), album_entry, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (album_entry), FALSE); + + genre_entry = gtk_entry_new (); + gtk_widget_ref (genre_entry); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "genre_entry", genre_entry, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), genre_entry, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (genre_entry), FALSE); + + comment_entry = gtk_entry_new (); + gtk_widget_ref (comment_entry); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "comment_entry", comment_entry, + (GtkDestroyNotify) gtk_widget_unref); + gtk_table_attach (GTK_TABLE (table1), comment_entry, 1, 2, 5, 6, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (comment_entry), FALSE); + + frame3 = gtk_frame_new ("MP4 Info: "); + gtk_widget_ref (frame3); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "frame3", frame3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (hbox3), frame3, FALSE, TRUE, 0); + + vbox1 = gtk_vbox_new (FALSE, 0); + gtk_widget_ref (vbox1); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "vbox1", vbox1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_container_add (GTK_CONTAINER (frame3), vbox1); + gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5); + + mp4_info_label = gtk_label_new (""); + gtk_widget_ref (mp4_info_label); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "mp4_info_label", mp4_info_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (vbox1), mp4_info_label, TRUE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (mp4_info_label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (mp4_info_label), 0, 0); + + dialog_action_area1 = GTK_DIALOG (mp4_info_dialog)->action_area; + gtk_object_set_data (GTK_OBJECT (mp4_info_dialog), "dialog_action_area1", dialog_action_area1); + gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area1), 4); + + close_button = gtk_button_new_with_label ("Close"); + gtk_widget_ref (close_button); + gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "close_button", close_button, + (GtkDestroyNotify) gtk_widget_unref); + gtk_box_pack_start (GTK_BOX (dialog_action_area1), close_button, FALSE, FALSE, 0); + + gtk_signal_connect_object (GTK_OBJECT (close_button), "clicked", + GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (mp4_info_dialog)); + + } + + window_title = g_strdup_printf("File Info - %s", g_basename(filename)); + gtk_window_set_title (GTK_WINDOW (mp4_info_dialog), window_title); + g_free(window_title); + + gtk_entry_set_text (GTK_ENTRY (filename_entry), filename); + + gtk_entry_set_text (GTK_ENTRY (title_entry), ""); + gtk_entry_set_text (GTK_ENTRY (artist_entry), ""); + gtk_entry_set_text (GTK_ENTRY (album_entry), ""); + gtk_entry_set_text (GTK_ENTRY (year_entry), ""); + gtk_entry_set_text (GTK_ENTRY (track_entry), ""); + gtk_entry_set_text (GTK_ENTRY (genre_entry), ""); + gtk_entry_set_text (GTK_ENTRY (comment_entry), ""); + + if ((mp4ff_meta_get_title(infile, &value)) && value != NULL) { + gtk_entry_set_text (GTK_ENTRY(title_entry), value); + g_free(value); + } + if ((mp4ff_meta_get_artist(infile, &value)) && value != NULL) { + gtk_entry_set_text (GTK_ENTRY(artist_entry), value); + g_free(value); + } + if ((mp4ff_meta_get_album(infile, &value)) && value != NULL) { + gtk_entry_set_text (GTK_ENTRY(album_entry), value); + g_free(value); + } + if ((mp4ff_meta_get_date(infile, &value)) && value != NULL) { + gtk_entry_set_text (GTK_ENTRY(year_entry), value); + g_free(value); + } + if ((mp4ff_meta_get_track(infile, &value)) && value != NULL) { + if ((mp4ff_meta_get_totaltracks(infile, &value2)) && value2 != NULL) { + char *tmp = g_strdup_printf("%s of %s", value, value2); + g_free(value2); + g_free(value); + value = tmp; + } + gtk_entry_set_text (GTK_ENTRY(track_entry), value); + g_free(value); + } + if ((mp4ff_meta_get_genre(infile, &value)) && value != NULL) { + gtk_entry_set_text (GTK_ENTRY(genre_entry), value); + g_free(value); + } + if ((mp4ff_meta_get_comment(infile, &value)) && value != NULL) { + gtk_entry_set_text (GTK_ENTRY(comment_entry), value); + g_free(value); + } + + // Get the length of the track. + double track_duration = mp4ff_get_track_duration(infile, mp4track); + unsigned long time_scale = mp4ff_time_scale(infile, mp4track); + unsigned long length = (track_duration / time_scale); + int min = length / 60; + int sec = length % 60; + + // Get other info about the track. + unsigned long bitrate = mp4ff_get_avg_bitrate(infile, mp4track) / 1000; + unsigned long samplerate = mp4ff_get_sample_rate(infile, mp4track); + unsigned long channels = mp4ff_get_channel_count(infile, mp4track); + unsigned long audio_type = mp4ff_get_audio_type(infile, mp4track); + fseek(mp4file, 0, SEEK_END); + int filesize = ftell(mp4file) / 1024; + + value = g_strdup_printf("Length: %d:%d\nAvg. Bitrate: %ld kbps\nSample Rate: %ld Hz\nChannels: %ld\nAudio Type: %ld\nFile Size: %d KB", min, sec, bitrate, samplerate, channels, audio_type, filesize); + gtk_label_set_text (GTK_LABEL(mp4_info_label), value); + g_free(value); + + gtk_widget_show_all(mp4_info_dialog); +} + + +void getMP4info(char* filename, FILE* mp4file) +{ + mp4ff_callback_t* mp4cb; + mp4ff_t* infile; + gint mp4track; + + mp4cb = getMP4FF_cb(mp4file); + if ((infile = mp4ff_open_read_metaonly(mp4cb)) && + ((mp4track = getAACTrack(infile)) >= 0)){ + create_mp4_info_dialog (filename, mp4file, infile, mp4track); + } + if(infile) mp4ff_close(infile); + if(mp4cb) g_free(mp4cb); +} + +/* Get the xmms titlestring for the file based on metadata. +The following code was adapted from the gtkpod project, specifically +mp4file.c (C) Jorg Schuler, but written to use the mp4ff library. The +mpg123 input plugin for xmms was used as a guide for this function. + --Jason Arroyo, 2004 */ +char *getMP4title(mp4ff_t *infile, char *filename) { + char *ret=NULL; + gchar *value, *path, *temp; + + TitleInput *input; + XMMS_NEW_TITLEINPUT(input); + + // Fill in the TitleInput with the relevant data + // from the mp4 file that can be used to display the title. + mp4ff_meta_get_title(infile, &input->track_name); + mp4ff_meta_get_artist(infile, &input->performer); + mp4ff_meta_get_album(infile, &input->album_name); + if (mp4ff_meta_get_track(infile, &value) && value != NULL) { + input->track_number = atoi(value); + g_free(value); + } + if (mp4ff_meta_get_date(infile, &value) && value != NULL) { + input->year = atoi(value); + g_free(value); + } + mp4ff_meta_get_genre(infile, &input->genre); + mp4ff_meta_get_comment(infile, &input->comment); + input->file_name = g_strdup(g_basename(filename)); + path = g_strdup(filename); + temp = strrchr(path, '.'); + if (temp != NULL) {++temp;} + input->file_ext = g_strdup_printf("%s", temp); + temp = strrchr(path, '/'); + if (temp) {*temp = '\0';} + input->file_path = g_strdup_printf("%s/", path); + + // Use the default xmms title format to format the + // title from the above info. + ret = xmms_get_titlestring(xmms_get_gentitle_format(), input); + + g_free(input->track_name); + g_free(input->performer); + g_free(input->album_name); + g_free(input->genre); + g_free(input->comment); + g_free(input->file_name); + g_free(input->file_ext); + g_free(input->file_path); + g_free(input); + g_free(path); + + return ret; +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/aac2mp4.cpp +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/aac2mp4.cpp @@ -0,0 +1,319 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: aac2mp4.cpp,v 1.4 2004/08/19 18:35:11 menno Exp $ +**/ + +#include +#include +#include + +#include "aac2mp4.h" + +int covert_aac_to_mp4(char *inputFileName, char *mp4FileName) +{ + int Mp4TimeScale = 90000; + int allMpeg4Streams = 0; + MP4FileHandle mp4File; + FILE* inFile; + const char *type; + MP4TrackId createdTrackId = MP4_INVALID_TRACK_ID; + + mp4File = MP4Create(mp4FileName, 0, 0); + if (mp4File) + { + MP4SetTimeScale(mp4File, Mp4TimeScale); + } else { + return 1; + } + + inFile = fopen(inputFileName, "rb"); + + if (inFile == NULL) + { + MP4Close(mp4File); + return 2; + } + + createdTrackId = AacCreator(mp4File, inFile); + + if (createdTrackId == MP4_INVALID_TRACK_ID) + { + fclose(inFile); + MP4Close(mp4File); + return 3; + } + + type = MP4GetTrackType(mp4File, createdTrackId); + + if (!strcmp(type, MP4_AUDIO_TRACK_TYPE)) + { + allMpeg4Streams &= + (MP4GetTrackEsdsObjectTypeId(mp4File, createdTrackId) + == MP4_MPEG4_AUDIO_TYPE); + } + + if (inFile) + { + fclose(inFile); + } + + MP4Close(mp4File); + MP4MakeIsmaCompliant(mp4FileName, 0, allMpeg4Streams); + + return 0; +} + +#define ADTS_HEADER_MAX_SIZE 10 /* bytes */ + +static u_int8_t firstHeader[ADTS_HEADER_MAX_SIZE]; + +/* + * hdr must point to at least ADTS_HEADER_MAX_SIZE bytes of memory + */ +static bool LoadNextAdtsHeader(FILE* inFile, u_int8_t* hdr) +{ + u_int state = 0; + u_int dropped = 0; + u_int hdrByteSize = ADTS_HEADER_MAX_SIZE; + + while (1) { + /* read a byte */ + u_int8_t b; + + if (fread(&b, 1, 1, inFile) == 0) { + return false; + } + + /* header is complete, return it */ + if (state == hdrByteSize - 1) { + hdr[state] = b; + if (dropped > 0) { + fprintf(stderr, "Warning: dropped %u input bytes\n", dropped); + } + return true; + } + + /* collect requisite number of bytes, no constraints on data */ + if (state >= 2) { + hdr[state++] = b; + } else { + /* have first byte, check if we have 1111X00X */ + if (state == 1) { + if ((b & 0xF6) == 0xF0) { + hdr[state] = b; + state = 2; + /* compute desired header size */ + hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdr); + } else { + state = 0; + } + } + /* initial state, looking for 11111111 */ + if (state == 0) { + if (b == 0xFF) { + hdr[state] = b; + state = 1; + } else { + /* else drop it */ + dropped++; + } + } + } + } +} + +/* + * Load the next frame from the file + * into the supplied buffer, which better be large enough! + * + * Note: Frames are padded to byte boundaries + */ +static bool LoadNextAacFrame(FILE* inFile, u_int8_t* pBuf, u_int32_t* pBufSize, bool stripAdts) +{ + u_int16_t frameSize; + u_int16_t hdrBitSize, hdrByteSize; + u_int8_t hdrBuf[ADTS_HEADER_MAX_SIZE]; + + /* get the next AAC frame header, more or less */ + if (!LoadNextAdtsHeader(inFile, hdrBuf)) { + return false; + } + + /* get frame size from header */ + frameSize = MP4AV_AdtsGetFrameSize(hdrBuf); + + /* get header size in bits and bytes from header */ + hdrBitSize = MP4AV_AdtsGetHeaderBitSize(hdrBuf); + hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdrBuf); + + /* adjust the frame size to what remains to be read */ + frameSize -= hdrByteSize; + + if (stripAdts) { + if ((hdrBitSize % 8) == 0) { + /* header is byte aligned, i.e. MPEG-2 ADTS */ + /* read the frame data into the buffer */ + if (fread(pBuf, 1, frameSize, inFile) != frameSize) { + return false; + } + (*pBufSize) = frameSize; + } else { + /* header is not byte aligned, i.e. MPEG-4 ADTS */ + int i; + u_int8_t newByte; + int upShift = hdrBitSize % 8; + int downShift = 8 - upShift; + + pBuf[0] = hdrBuf[hdrBitSize / 8] << upShift; + + for (i = 0; i < frameSize; i++) { + if (fread(&newByte, 1, 1, inFile) != 1) { + return false; + } + pBuf[i] |= (newByte >> downShift); + pBuf[i+1] = (newByte << upShift); + } + (*pBufSize) = frameSize + 1; + } + } else { /* don't strip ADTS headers */ + memcpy(pBuf, hdrBuf, hdrByteSize); + if (fread(&pBuf[hdrByteSize], 1, frameSize, inFile) != frameSize) { + return false; + } + } + + return true; +} + +static bool GetFirstHeader(FILE* inFile) +{ + /* read file until we find an audio frame */ + fpos_t curPos; + + /* already read first header */ + if (firstHeader[0] == 0xff) { + return true; + } + + /* remember where we are */ + fgetpos(inFile, &curPos); + + /* go back to start of file */ + rewind(inFile); + + if (!LoadNextAdtsHeader(inFile, firstHeader)) { + return false; + } + + /* reposition the file to where we were */ + fsetpos(inFile, &curPos); + + return true; +} + +MP4TrackId AacCreator(MP4FileHandle mp4File, FILE* inFile) +{ + // collect all the necessary meta information + u_int32_t samplesPerSecond; + u_int8_t mpegVersion; + u_int8_t profile; + u_int8_t channelConfig; + + if (!GetFirstHeader(inFile)) { + return MP4_INVALID_TRACK_ID; + } + + samplesPerSecond = MP4AV_AdtsGetSamplingRate(firstHeader); + mpegVersion = MP4AV_AdtsGetVersion(firstHeader); + profile = MP4AV_AdtsGetProfile(firstHeader); + channelConfig = MP4AV_AdtsGetChannels(firstHeader); + + u_int8_t audioType = MP4_INVALID_AUDIO_TYPE; + switch (mpegVersion) { + case 0: + audioType = MP4_MPEG4_AUDIO_TYPE; + break; + case 1: + switch (profile) { + case 0: + audioType = MP4_MPEG2_AAC_MAIN_AUDIO_TYPE; + break; + case 1: + audioType = MP4_MPEG2_AAC_LC_AUDIO_TYPE; + break; + case 2: + audioType = MP4_MPEG2_AAC_SSR_AUDIO_TYPE; + break; + case 3: + return MP4_INVALID_TRACK_ID; + } + break; + } + + // add the new audio track + MP4TrackId trackId = + MP4AddAudioTrack(mp4File, + samplesPerSecond, 1024, audioType); + + if (trackId == MP4_INVALID_TRACK_ID) { + return MP4_INVALID_TRACK_ID; + } + + if (MP4GetNumberOfTracks(mp4File, MP4_AUDIO_TRACK_TYPE) == 1) { + MP4SetAudioProfileLevel(mp4File, 0x0F); + } + + u_int8_t* pConfig = NULL; + u_int32_t configLength = 0; + + MP4AV_AacGetConfiguration( + &pConfig, + &configLength, + profile, + samplesPerSecond, + channelConfig); + + if (!MP4SetTrackESConfiguration(mp4File, trackId, + pConfig, configLength)) { + MP4DeleteTrack(mp4File, trackId); + return MP4_INVALID_TRACK_ID; + } + + // parse the ADTS frames, and write the MP4 samples + u_int8_t sampleBuffer[8 * 1024]; + u_int32_t sampleSize = sizeof(sampleBuffer); + MP4SampleId sampleId = 1; + + while (LoadNextAacFrame(inFile, sampleBuffer, &sampleSize, true)) { + if (!MP4WriteSample(mp4File, trackId, sampleBuffer, sampleSize)) { + MP4DeleteTrack(mp4File, trackId); + return MP4_INVALID_TRACK_ID; + } + sampleId++; + sampleSize = sizeof(sampleBuffer); + } + + return trackId; +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/aac2mp4.h +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/aac2mp4.h @@ -0,0 +1,42 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: aac2mp4.h,v 1.3 2003/07/29 08:20:14 menno Exp $ +**/ + +#ifndef AAC2MP4_H__ +#define AAC2MP4_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +int covert_aac_to_mp4(char *inputFileName, char *mp4FileName); +MP4TrackId AacCreator(MP4FileHandle mp4File, FILE* inFile); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/aacinfo.c +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/aacinfo.c @@ -0,0 +1,225 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: aacinfo.c,v 1.6 2004/10/18 19:25:00 menno Exp $ +**/ + +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include +#include +#include "aacinfo.h" +#include "utils.h" + +#define ADIF_MAX_SIZE 30 /* Should be enough */ +#define ADTS_MAX_SIZE 10 /* Should be enough */ + +static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000}; + +static int read_ADIF_header(FILE *file, faadAACInfo *info) +{ + int bitstream; + unsigned char buffer[ADIF_MAX_SIZE]; + int skip_size = 0; + int sf_idx; + + /* Get ADIF header data */ + info->headertype = 1; + + if (fread(buffer, 1, ADIF_MAX_SIZE, file) != ADIF_MAX_SIZE) + return -1; + + /* copyright string */ + if(buffer[0] & 0x80) + skip_size += 9; /* skip 9 bytes */ + + bitstream = buffer[0 + skip_size] & 0x10; + info->bitrate = ((unsigned int)(buffer[0 + skip_size] & 0x0F)<<19)| + ((unsigned int)buffer[1 + skip_size]<<11)| + ((unsigned int)buffer[2 + skip_size]<<3)| + ((unsigned int)buffer[3 + skip_size] & 0xE0); + + if (bitstream == 0) + { + info->object_type = ((buffer[6 + skip_size]&0x01)<<1)|((buffer[7 + skip_size]&0x80)>>7); + sf_idx = (buffer[7 + skip_size]&0x78)>>3; + } else { + info->object_type = (buffer[4 + skip_size] & 0x18)>>3; + sf_idx = ((buffer[4 + skip_size] & 0x07)<<1)|((buffer[5 + skip_size] & 0x80)>>7); + } + info->sampling_rate = sample_rates[sf_idx]; + + return 0; +} + +static int read_ADTS_header(FILE *file, faadAACInfo *info) +{ + /* Get ADTS header data */ + unsigned char buffer[ADTS_MAX_SIZE]; + int frames, t_framelength = 0, frame_length, sr_idx = 0, ID; + int second = 0, pos; + float frames_per_sec = 0; + unsigned long bytes; + unsigned long *tmp_seek_table = NULL; + + info->headertype = 2; + + /* Read all frames to ensure correct time and bitrate */ + for (frames = 0; /* */; frames++) + { + bytes = fread(buffer, 1, ADTS_MAX_SIZE, file); + + if (bytes != ADTS_MAX_SIZE) + break; + + /* check syncword */ + if (!((buffer[0] == 0xFF)&&((buffer[1] & 0xF6) == 0xF0))) + break; + + if (!frames) + { + /* fixed ADTS header is the same for every frame, so we read it only once */ + /* Syncword found, proceed to read in the fixed ADTS header */ + ID = buffer[1] & 0x08; + info->object_type = (buffer[2]&0xC0)>>6; + sr_idx = (buffer[2]&0x3C)>>2; + info->channels = ((buffer[2]&0x01)<<2)|((buffer[3]&0xC0)>>6); + + frames_per_sec = sample_rates[sr_idx] / 1024.f; + } + + /* ...and the variable ADTS header */ + if (ID == 0) + { + info->version = 4; + } else { /* MPEG-2 */ + info->version = 2; + } + frame_length = ((((unsigned int)buffer[3] & 0x3)) << 11) + | (((unsigned int)buffer[4]) << 3) | (buffer[5] >> 5); + + t_framelength += frame_length; + + pos = ftell(file) - ADTS_MAX_SIZE; + + fseek(file, frame_length - ADTS_MAX_SIZE, SEEK_CUR); + } + + if (frames > 0) + { + float sec_per_frame, bytes_per_frame; + info->sampling_rate = sample_rates[sr_idx]; + sec_per_frame = (float)info->sampling_rate/1024.0; + bytes_per_frame = (float)t_framelength / (float)frames; + info->bitrate = 8 * (int)floor(bytes_per_frame * sec_per_frame); + info->length = (int)floor((float)frames/frames_per_sec)*1000; + } else { + info->sampling_rate = 4; + info->bitrate = 128000; + info->length = 0; + info->channels = 0; + } + + return 0; +} + +int get_AAC_format(char *filename, faadAACInfo *info) +{ + unsigned long tagsize; + FILE *file; + char buffer[10]; + unsigned long file_len; + unsigned char adxx_id[5]; + unsigned long tmp; + + memset(info, 0, sizeof(faadAACInfo)); + + file = fopen(filename, "rb"); + + if(file == NULL) + return -1; + + fseek(file, 0, SEEK_END); + file_len = ftell(file); + fseek(file, 0, SEEK_SET); + + /* Skip the tag, if it's there */ + tmp = fread(buffer, 10, 1, file); + + if (StringComp(buffer, "ID3", 3) == 0) + { + /* high bit is not used */ + tagsize = (buffer[6] << 21) | (buffer[7] << 14) | + (buffer[8] << 7) | (buffer[9] << 0); + + fseek(file, tagsize, SEEK_CUR); + tagsize += 10; + } else { + tagsize = 0; + fseek(file, 0, SEEK_SET); + } + + if (file_len) + file_len -= tagsize; + + tmp = fread(adxx_id, 2, 1, file); + adxx_id[5-1] = 0; + info->length = 0; + + /* Determine the header type of the file, check the first two bytes */ + if (StringComp(adxx_id, "AD", 2) == 0) + { + /* We think its an ADIF header, but check the rest just to make sure */ + tmp = fread(adxx_id + 2, 2, 1, file); + + if (StringComp(adxx_id, "ADIF", 4) == 0) + { + read_ADIF_header(file, info); + + info->length = (int)((float)file_len*8000.0/((float)info->bitrate)); + } + } else { + /* No ADIF, check for ADTS header */ + if ((adxx_id[0] == 0xFF)&&((adxx_id[1] & 0xF6) == 0xF0)) + { + /* ADTS header located */ + fseek(file, tagsize, SEEK_SET); + read_ADTS_header(file, info); + } else { + /* Unknown/headerless AAC file, assume format: */ + info->version = 2; + info->bitrate = 128000; + info->sampling_rate = 44100; + info->channels = 2; + info->headertype = 0; + info->object_type = 1; + } + } + + fclose(file); + + return 0; +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/aacinfo.h +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/aacinfo.h @@ -0,0 +1,46 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: aacinfo.h,v 1.3 2003/07/29 08:20:14 menno Exp $ +**/ + +#ifndef AACINFO_INCLUDED +#define AACINFO_INCLUDED + +typedef struct { + int version; + int channels; + int sampling_rate; + int bitrate; + int length; + int object_type; + int headertype; +} faadAACInfo; + +int get_AAC_format(char *filename, faadAACInfo *info); + +static int read_ADIF_header(FILE *file, faadAACInfo *info); +static int read_ADTS_header(FILE *file, faadAACInfo *info); + +#endif --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/config.c +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/config.c @@ -0,0 +1,48 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: config.c,v 1.6 2003/09/03 20:19:07 menno Exp $ +**/ + +#define WIN32_LEAN_AND_MEAN +#include +#include "config.h" + +char app_name[] = "AudioCoding.com MPEG-4 General Audio player"; +char INI_FILE[MAX_PATH]; +int m_priority = 3; +int m_resolution = 0; +int m_show_errors = 1; +int m_use_for_aac = 1; +int m_downmix = 0; +int m_vbr_display = 0; +char titleformat[MAX_PATH]; + +void _r_s(char *name,char *data, int mlen) +{ + char buf[10]; + strcpy(buf,data); + GetPrivateProfileString(app_name,name,buf,data,mlen,INI_FILE); +} + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/config.h +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/config.h @@ -0,0 +1,42 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: config.h,v 1.6 2003/09/03 20:19:07 menno Exp $ +**/ + +char app_name[]; +char INI_FILE[]; +int m_priority; +int m_resolution; +int m_show_errors; +int m_use_for_aac; +int m_downmix; +int m_vbr_display; +char titleformat[MAX_PATH]; + +#define RS(x) (_r_s(#x,x,sizeof(x))) +#define WS(x) (WritePrivateProfileString(app_name,#x,x,INI_FILE)) + +void _r_s(char *name,char *data, int mlen); + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/in2.h +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/in2.h @@ -0,0 +1,104 @@ +#include "out.h" + +// note: exported symbol is now winampGetInModule2. + +#define IN_VER 0x100 + +typedef struct +{ + int version; // module type (IN_VER) + char *description; // description of module, with version string + + HWND hMainWindow; // winamp's main window (filled in by winamp) + HINSTANCE hDllInstance; // DLL instance handle (Also filled in by winamp) + + char *FileExtensions; // "mp3\0Layer 3 MPEG\0mp2\0Layer 2 MPEG\0mpg\0Layer 1 MPEG\0" + // May be altered from Config, so the user can select what they want + + int is_seekable; // is this stream seekable? + int UsesOutputPlug; // does this plug-in use the output plug-ins? (musn't ever change, ever :) + + void (*Config)(HWND hwndParent); // configuration dialog + void (*About)(HWND hwndParent); // about dialog + + void (*Init)(); // called at program init + void (*Quit)(); // called at program quit + + void (*GetFileInfo)(char *file, char *title, int *length_in_ms); // if file == NULL, current playing is used + int (*InfoBox)(char *file, HWND hwndParent); + + int (*IsOurFile)(char *fn); // called before extension checks, to allow detection of mms://, etc + // playback stuff + int (*Play)(char *fn); // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error + void (*Pause)(); // pause stream + void (*UnPause)(); // unpause stream + int (*IsPaused)(); // ispaused? return 1 if paused, 0 if not + void (*Stop)(); // stop (unload) stream + + // time stuff + int (*GetLength)(); // get length in ms + int (*GetOutputTime)(); // returns current output time in ms. (usually returns outMod->GetOutputTime() + void (*SetOutputTime)(int time_in_ms); // seeks to point in stream (in ms). Usually you signal yoru thread to seek, which seeks and calls outMod->Flush().. + + // volume stuff + void (*SetVolume)(int volume); // from 0 to 255.. usually just call outMod->SetVolume + void (*SetPan)(int pan); // from -127 to 127.. usually just call outMod->SetPan + + // in-window builtin vis stuff + + void (*SAVSAInit)(int maxlatency_in_ms, int srate); // call once in Play(). maxlatency_in_ms should be the value returned from outMod->Open() + // call after opening audio device with max latency in ms and samplerate + void (*SAVSADeInit)(); // call in Stop() + + + // simple vis supplying mode + void (*SAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); + // sets the spec data directly from PCM data + // quick and easy way to get vis working :) + // needs at least 576 samples :) + + // advanced vis supplying mode, only use if you're cool. Use SAAddPCMData for most stuff. + int (*SAGetMode)(); // gets csa (the current type (4=ws,2=osc,1=spec)) + // use when calling SAAdd() + void (*SAAdd)(void *data, int timestamp, int csa); // sets the spec data, filled in by winamp + + + // vis stuff (plug-in) + // simple vis supplying mode + void (*VSAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); // sets the vis data directly from PCM data + // quick and easy way to get vis working :) + // needs at least 576 samples :) + + // advanced vis supplying mode, only use if you're cool. Use VSAAddPCMData for most stuff. + int (*VSAGetMode)(int *specNch, int *waveNch); // use to figure out what to give to VSAAdd + void (*VSAAdd)(void *data, int timestamp); // filled in by winamp, called by plug-in + + + // call this in Play() to tell the vis plug-ins the current output params. + void (*VSASetInfo)(int nch, int srate); + + + // dsp plug-in processing: + // (filled in by winamp, called by input plug) + + // returns 1 if active (which means that the number of samples returned by dsp_dosamples + // could be greater than went in.. Use it to estimate if you'll have enough room in the + // output buffer + int (*dsp_isactive)(); + + // returns number of samples to output. This can be as much as twice numsamples. + // be sure to allocate enough buffer for samples, then. + int (*dsp_dosamples)(short int *samples, int numsamples, int bps, int nch, int srate); + + + // eq stuff + void (*EQSet)(int on, char data[10], int preamp); // 0-64 each, 31 is +0, 0 is +12, 63 is -12. Do nothing to ignore. + + // info setting (filled in by winamp) + void (*SetInfo)(int bitrate, int srate, int stereo, int synched); // if -1, changes ignored? :) + + Out_Module *outMod; // filled in by winamp, optionally used :) +} In_Module; + + + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/in_mp4.c +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/in_mp4.c @@ -0,0 +1,2878 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: in_mp4.c,v 1.56 2004/10/19 18:02:10 menno Exp $ +**/ + +//#define DEBUG_OUTPUT + +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include +#include +#include +#include +#include +#define USE_TAGGING +#include + +#include "resource.h" +#include "in2.h" +#include "utils.h" +#include "config.h" +#include "aacinfo.h" + +const char *long_ext_list = "MP4\0MPEG-4 Files (*.MP4)\0M4A\0MPEG-4 Files (*.M4A)\0AAC\0AAC Files (*.AAC)\0"; +const char *short_ext_list = "MP4\0MPEG-4 Files (*.MP4)\0M4A\0MPEG-4 Files (*.M4A)\0"; + +static long priority_table[] = { + 0, + THREAD_PRIORITY_HIGHEST, + THREAD_PRIORITY_ABOVE_NORMAL, + THREAD_PRIORITY_NORMAL, + THREAD_PRIORITY_BELOW_NORMAL, + THREAD_PRIORITY_LOWEST +}; +static int res_id_table[] = { + IDC_16BITS, + IDC_24BITS, + IDC_32BITS, + 0, + 0, + /*IDC_16BITS_DITHERED*/ IDC_16BITS /* temp hack */ +}; +static int res_table[] = { + 16, + 24, + 32, + 0, + 0, + 16 +}; +static char info_fn[_MAX_PATH]; + +// post this to the main window at end of file (after playback has stopped) +#define WM_WA_AAC_EOF WM_USER+2 + +struct seek_list +{ + struct seek_list *next; + __int64 offset; +}; + +typedef struct state +{ + /* general stuff */ + faacDecHandle hDecoder; + int samplerate; + unsigned char channels; + double decode_pos_ms; // current decoding position, in milliseconds + int paused; // are we paused? + int seek_needed; // if != -1, it is the point that the decode thread should seek to, in ms. + char filename[_MAX_PATH]; + int filetype; /* 0: MP4; 1: AAC */ + int last_frame; + __int64 last_offset; + + /* MP4 stuff */ + mp4ff_t *mp4file; + int mp4track; + long numSamples; + long sampleId; + mp4ff_callback_t mp4cb; + FILE *mp4File; + + /* AAC stuff */ + FILE *aacfile; + long m_aac_bytes_into_buffer; + long m_aac_bytes_consumed; + __int64 m_file_offset; + unsigned char *m_aac_buffer; + int m_at_eof; + double cur_pos_sec; + int m_header_type; + struct seek_list *m_head; + struct seek_list *m_tail; + unsigned long m_length; + + /* for gapless decoding */ + unsigned int useAacLength; + unsigned int framesize; + unsigned int initial; + unsigned long timescale; +} state; + +static state mp4state; + +static In_Module module; // the output module (declared near the bottom of this file) + +static int killPlayThread; +static int PlayThreadAlive = 0; // 1=play thread still running +HANDLE play_thread_handle = INVALID_HANDLE_VALUE; // the handle to the decode thread + +/* Function definitions */ +void *decode_aac_frame(state *st, faacDecFrameInfo *frameInfo); +DWORD WINAPI MP4PlayThread(void *b); // the decode thread procedure +DWORD WINAPI AACPlayThread(void *b); // the decode thread procedure + + +uint32_t read_callback(void *user_data, void *buffer, uint32_t length) +{ + return fread(buffer, 1, length, (FILE*)user_data); +} + +uint32_t seek_callback(void *user_data, uint64_t position) +{ + return fseek((FILE*)user_data, position, SEEK_SET); +} + +uint32_t write_callback(void *user_data, void *buffer, uint32_t length) +{ + return fwrite(buffer, 1, length, (FILE*)user_data); +} + +uint32_t truncate_callback(void *user_data) +{ + _chsize(fileno((FILE*)user_data), ftell((FILE*)user_data)); + return 1; +} + + +int tag_add_field(mp4ff_metadata_t *tags, const char *item, const char *value, size_t v_len) +{ + void *backup = (void *)tags->tags; + + if (!item || (item && !*item) || !value) return 0; + + tags->tags = (mp4ff_tag_t *)realloc(tags->tags, (tags->count+1) * sizeof(mp4ff_tag_t)); + if (!tags->tags) { + if (backup) free(backup); + return 0; + } + else + { + size_t i_len = strlen(item); + if (v_len == 0) v_len = strlen(value); + + tags->tags[tags->count].item = (char *)malloc(i_len+1); + tags->tags[tags->count].value = (char *)malloc(v_len+1); + + if (!tags->tags[tags->count].item || !tags->tags[tags->count].value) + { + if (!tags->tags[tags->count].item) free (tags->tags[tags->count].item); + if (!tags->tags[tags->count].value) free (tags->tags[tags->count].value); + tags->tags[tags->count].item = NULL; + tags->tags[tags->count].value = NULL; + return 0; + } + + memcpy(tags->tags[tags->count].item, item, i_len); + memcpy(tags->tags[tags->count].value, value, v_len); + tags->tags[tags->count].item[i_len] = '\0'; + tags->tags[tags->count].value[v_len] = '\0'; +// tags->tags[tags->count].len = v_len; + + tags->count++; + return 1; + } +} + +int tag_set_field(mp4ff_metadata_t *tags, const char *item, const char *value, size_t v_len) +{ + unsigned int i; + + if (!item || (item && !*item) || !value) return 0; + + for (i = 0; i < tags->count; i++) + { + if (!stricmp(tags->tags[i].item, item)) + { + void *backup = (void *)tags->tags[i].value; + if (v_len == 0) v_len = strlen(value); + + tags->tags[i].value = (char *)realloc(tags->tags[i].value, v_len+1); + if (!tags->tags[i].value) + { + if (backup) free(backup); + return 0; + } + + memcpy(tags->tags[i].value, value, v_len); + tags->tags[i].value[v_len] = '\0'; +// tags->tags[i].len = v_len; + + return 1; + } + } + + return tag_add_field(tags, item, value, v_len); +} + +int tag_delete(mp4ff_metadata_t *tags) +{ + unsigned int i; + + for (i = 0; i < tags->count; i++) + { + if (tags->tags[i].item) free(tags->tags[i].item); + if (tags->tags[i].value) free(tags->tags[i].value); + } + + if (tags->tags) free(tags->tags); + + tags->tags = NULL; + tags->count = 0; +} + +int ReadMP4Tag(mp4ff_t *file, mp4ff_metadata_t *tags) +{ + unsigned __int8 *pValue; + char *pName; + unsigned int i = 0; + + do { + pName = 0; + pValue = 0; + + + if (mp4ff_meta_get_by_index(file, i, (char **)&pName, &pValue)) + { + char *val = (char *)strdup(pValue); + if (!val) return 0; + + if (pName[0] == '©') + { + if (memcmp(pName, "©nam", 4) == 0) + { + tag_add_field(tags, "title", val, strlen(val)); + } else if (memcmp(pName, "©ART", 4) == 0) { + tag_add_field(tags, "artist", val, strlen(val)); + } else if (memcmp(pName, "©wrt", 4) == 0) { + tag_add_field(tags, "writer", val, strlen(val)); + } else if (memcmp(pName, "©alb", 4) == 0) { + tag_add_field(tags, "album", val, strlen(val)); + } else if (memcmp(pName, "©day", 4) == 0) { + tag_add_field(tags, "date", val, strlen(val)); + } else if (memcmp(pName, "©too", 4) == 0) { + tag_add_field(tags, "tool", val, strlen(val)); + } else if (memcmp(pName, "©cmt", 4) == 0) { + tag_add_field(tags, "comment", val, strlen(val)); + } else if (memcmp(pName, "©gen", 4) == 0) { + tag_add_field(tags, "genre", val, strlen(val)); + } else { + tag_add_field(tags, pName, val, strlen(val)); + } + } else if (memcmp(pName, "covr", 4) == 0) { + tag_add_field(tags, "cover", val, strlen(val)); + } else if (memcmp(pName, "gnre", 4) == 0) { + tag_add_field(tags, "genre", val, strlen(val)); + } else if (memcmp(pName, "trkn", 4) == 0) { + tag_add_field(tags, "tracknumber", val, strlen(val)); + } else if (memcmp(pName, "disk", 4) == 0) { + tag_add_field(tags, "disc", val, strlen(val)); + } else if (memcmp(pName, "cpil", 4) == 0) { + tag_add_field(tags, "compilation", val, strlen(val)); + } else if (memcmp(pName, "tmpo", 4) == 0) { + tag_add_field(tags, "tempo", val, strlen(val)); + } else if (memcmp(pName, "NDFL", 4) == 0) { + /* Removed */ + } else { + tag_add_field(tags, pName, val, strlen(val)); + } + + free(val); + } + + i++; + } while (pValue != NULL); + + return 1; +} + + +#ifdef DEBUG_OUTPUT +void in_mp4_DebugOutput(char *message) +{ + char s[1024]; + + sprintf(s, "in_mp4: %s", message); + OutputDebugString(s); +} +#endif + +int file_length(FILE *f) +{ + long end = 0; + long cur = ftell(f); + fseek(f, 0, SEEK_END); + end = ftell(f); + fseek(f, cur, SEEK_SET); + + return end; +} + +static void show_error(HWND hwnd, char *message, ...) +{ + if (m_show_errors) + MessageBox(hwnd, message, "Error", MB_OK); +} + +static void config_init() +{ + char *p=INI_FILE; + GetModuleFileName(NULL,INI_FILE,_MAX_PATH); + while (*p) p++; + while (p >= INI_FILE && *p != '.') p--; + strcpy(p+1,"ini"); +} + +void config_read() +{ + char priority[10]; + char resolution[10]; + char show_errors[10]; + char use_for_aac[10]; + char downmix[10]; + char vbr_display[10]; + + config_init(); + + strcpy(show_errors, "1"); + strcpy(priority, "3"); + strcpy(resolution, "0"); + strcpy(use_for_aac, "1"); + strcpy(downmix, "0"); + strcpy(vbr_display, "1"); + strcpy(titleformat, "%7"); + + RS(priority); + RS(resolution); + RS(show_errors); + RS(use_for_aac); + RS(downmix); + RS(vbr_display); + RS(titleformat); + + m_priority = atoi(priority); + m_resolution = atoi(resolution); + m_show_errors = atoi(show_errors); + m_use_for_aac = atoi(use_for_aac); + m_downmix = atoi(downmix); + m_vbr_display = atoi(vbr_display); +} + +void config_write() +{ + char priority[10]; + char resolution[10]; + char show_errors[10]; + char use_for_aac[10]; + char downmix[10]; + char vbr_display[10]; + + itoa(m_priority, priority, 10); + itoa(m_resolution, resolution, 10); + itoa(m_show_errors, show_errors, 10); + itoa(m_use_for_aac, use_for_aac, 10); + itoa(m_downmix, downmix, 10); + itoa(m_vbr_display, vbr_display, 10); + + WS(priority); + WS(resolution); + WS(show_errors); + WS(use_for_aac); + WS(downmix); + WS(vbr_display); + WS(titleformat); +} + +void init() +{ + config_read(); +} + +void quit() +{ +} + +/* Convert UNICODE to UTF-8 + Return number of bytes written */ +int unicodeToUtf8 ( const WCHAR* lpWideCharStr, char* lpMultiByteStr, int cwcChars ) +{ + const unsigned short* pwc = (unsigned short *)lpWideCharStr; + unsigned char* pmb = (unsigned char *)lpMultiByteStr; + const unsigned short* pwce; + size_t cBytes = 0; + + if ( cwcChars >= 0 ) { + pwce = pwc + cwcChars; + } else { + pwce = (unsigned short *)((size_t)-1); + } + + while ( pwc < pwce ) { + unsigned short wc = *pwc++; + + if ( wc < 0x00000080 ) { + *pmb++ = (char)wc; + cBytes++; + } else + if ( wc < 0x00000800 ) { + *pmb++ = (char)(0xC0 | ((wc >> 6) & 0x1F)); + cBytes++; + *pmb++ = (char)(0x80 | (wc & 0x3F)); + cBytes++; + } else + if ( wc < 0x00010000 ) { + *pmb++ = (char)(0xE0 | ((wc >> 12) & 0x0F)); + cBytes++; + *pmb++ = (char)(0x80 | ((wc >> 6) & 0x3F)); + cBytes++; + *pmb++ = (char)(0x80 | (wc & 0x3F)); + cBytes++; + } + if ( wc == L'\0' ) + return cBytes; + } + + return cBytes; +} + +/* Convert UTF-8 coded string to UNICODE + Return number of characters converted */ +int utf8ToUnicode ( const char* lpMultiByteStr, WCHAR* lpWideCharStr, int cmbChars ) +{ + const unsigned char* pmb = (unsigned char *)lpMultiByteStr; + unsigned short* pwc = (unsigned short *)lpWideCharStr; + const unsigned char* pmbe; + size_t cwChars = 0; + + if ( cmbChars >= 0 ) { + pmbe = pmb + cmbChars; + } else { + pmbe = (unsigned char *)((size_t)-1); + } + + while ( pmb < pmbe ) { + char mb = *pmb++; + unsigned int cc = 0; + unsigned int wc; + + while ( (cc < 7) && (mb & (1 << (7 - cc)))) { + cc++; + } + + if ( cc == 1 || cc > 6 ) // illegal character combination for UTF-8 + continue; + + if ( cc == 0 ) { + wc = mb; + } else { + wc = (mb & ((1 << (7 - cc)) - 1)) << ((cc - 1) * 6); + while ( --cc > 0 ) { + if ( pmb == pmbe ) // reached end of the buffer + return cwChars; + mb = *pmb++; + if ( ((mb >> 6) & 0x03) != 2 ) // not part of multibyte character + return cwChars; + wc |= (mb & 0x3F) << ((cc - 1) * 6); + } + } + + if ( wc & 0xFFFF0000 ) + wc = L'?'; + *pwc++ = wc; + cwChars++; + if ( wc == L'\0' ) + return cwChars; + } + + return cwChars; +} + +/* convert Windows ANSI to UTF-8 */ +int ConvertANSIToUTF8 ( const char* ansi, char* utf8 ) +{ + WCHAR* wszValue; // Unicode value + size_t ansi_len; + size_t len; + + *utf8 = '\0'; + if ( ansi == NULL ) + return 0; + + ansi_len = strlen ( ansi ); + + if ( (wszValue = (WCHAR *)malloc ( (ansi_len + 1) * 2 )) == NULL ) + return 0; + + /* Convert ANSI value to Unicode */ + if ( (len = MultiByteToWideChar ( CP_ACP, 0, ansi, ansi_len + 1, wszValue, (ansi_len + 1) * 2 )) == 0 ) { + free ( wszValue ); + return 0; + } + + /* Convert Unicode value to UTF-8 */ + if ( (len = unicodeToUtf8 ( wszValue, utf8, -1 )) == 0 ) { + free ( wszValue ); + return 0; + } + + free ( wszValue ); + + return len-1; +} + +/* convert UTF-8 to Windows ANSI */ +int ConvertUTF8ToANSI ( const char* utf8, char* ansi ) +{ + WCHAR* wszValue; // Unicode value + size_t utf8_len; + size_t len; + + *ansi = '\0'; + if ( utf8 == NULL ) + return 0; + + utf8_len = strlen ( utf8 ); + + if ( (wszValue = (WCHAR *)malloc ( (utf8_len + 1) * 2 )) == NULL ) + return 0; + + /* Convert UTF-8 value to Unicode */ + if ( (len = utf8ToUnicode ( utf8, wszValue, utf8_len + 1 )) == 0 ) { + free ( wszValue ); + return 0; + } + + /* Convert Unicode value to ANSI */ + if ( (len = WideCharToMultiByte ( CP_ACP, 0, wszValue, -1, ansi, (utf8_len + 1) * 2, NULL, NULL )) == 0 ) { + free ( wszValue ); + return 0; + } + + free ( wszValue ); + + return len-1; +} + +BOOL uSetDlgItemText(HWND hwnd, int id, const char *str) +{ + char *temp; + size_t len; + int r; + + if (!str) return FALSE; + if (!*str) return TRUE; + len = strlen(str); + temp = malloc(len+1); + if (!temp) return FALSE; + r = ConvertUTF8ToANSI(str, temp); + if (r > 0) + SetDlgItemText(hwnd, id, temp); + free(temp); + + return r>0 ? TRUE : FALSE; +} + +UINT uGetDlgItemText(HWND hwnd, int id, char *str, int max) +{ + char *temp, *utf8; + int len; + HWND w; + + if (!str || !max) return 0; + *str = '\0'; + w = GetDlgItem(hwnd, id); + len = GetWindowTextLength(w); + temp = malloc(len+1); + if (!temp) return 0; + utf8 = malloc((len+1)*4); + if (!utf8) + { + free(temp); + return 0; + } + + len = GetWindowText(w, temp, len+1); + if (len > 0) + { + len = ConvertANSIToUTF8(temp, utf8); + if (len > max-1) + { + len = max-1; + utf8[max] = '\0'; + } + memcpy(str, utf8, len+1); + } + + free(temp); + free(utf8); + + return len; +} + +static void mp4fileinfo(mp4ff_t *mp4, char *info, size_t len) +{ + char *ot[6] = { "NULL", "MAIN AAC", "LC AAC", "SSR AAC", "LTP AAC", "HE AAC" }; + long samples; + float f = 1024.0; + float seconds; + int track; + + faacDecHandle hDecoder; + faacDecFrameInfo frameInfo; + mp4AudioSpecificConfig mp4ASC = {0}; + unsigned char *buffer = NULL; + int buffer_size = 0; + unsigned long sr = 0; + unsigned char ch = 0; + + if ((track = GetAACTrack(mp4)) < 0) + { + info[0] = '\0'; + return; + } + + hDecoder = faacDecOpen(); + + samples = mp4ff_num_samples(mp4, track); + + mp4ff_get_decoder_config(mp4, track, &buffer, &buffer_size); + if (buffer) + { + if (faacDecAudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0) + { + if (mp4ASC.frameLengthFlag == 1) f = 960.0; + if (mp4ASC.sbr_present_flag == 1) f *= 2; + } + + if(faacDecInit2(hDecoder, buffer, buffer_size, &sr, &ch) < 0) + { + /* If some error initializing occured, skip the file */ + free(buffer); + return; + } + + free(buffer); + buffer = NULL; + } + + if (mp4ff_read_sample(mp4, track, 0, &buffer, &buffer_size) == 0) + { + return; + } + faacDecDecode(hDecoder, &frameInfo, buffer, buffer_size); + + if (buffer) free(buffer); + + seconds = (float)samples*(float)(f-1.0)/(float)mp4ASC.samplingFrequency; + + wsprintf(info, "MPEG-4 %s, %d.%d secs, %d ch, %d Hz\nSBR: %s\nParametric stereo: %s", + ot[(mp4ASC.objectTypeIndex > 5)?0:mp4ASC.objectTypeIndex], + (int)(seconds), + (int)(seconds*1000.0 + 0.5) % 1000, + mp4ASC.channelsConfiguration, + mp4ASC.samplingFrequency, + /* SBR: 0: off, 1: on; upsample, 2: on; downsampled, 3: off; upsampled */ + (frameInfo.sbr == 0) ? "off" : ((frameInfo.sbr == 1) ? "on, normal" : ((frameInfo.sbr == 2) ? "on, downsampled" : "off, upsampled")), + (frameInfo.ps == 0) ? "no" : "yes"); + + faacDecClose(hDecoder); +} + +BOOL CALLBACK mp4_info_dialog_proc(HWND hwndDlg, UINT message, + WPARAM wParam, LPARAM lParam) +{ + char file_info[1024]; + mp4ff_t *file; + FILE *mp4File; + mp4ff_callback_t mp4cb = {0}; + char *pVal; + mp4ff_metadata_t tags; + char dummy1[1024]; + char temp[1024]; + int dummy, dummy2, dummy3; + tags.count = 0; + tags.tags = NULL; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("mp4_info_dialog_proc"); +#endif + + switch (message) { + case WM_INITDIALOG: + EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT), FALSE); + ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT), SW_HIDE); + EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), FALSE); + ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), SW_HIDE); + EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), FALSE); + ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), SW_HIDE); + + mp4File = fopen(info_fn, "rb"); + mp4cb.read = read_callback; + mp4cb.seek = seek_callback; + mp4cb.user_data = mp4File; + + + file = mp4ff_open_read(&mp4cb); + if (file == NULL) + return FALSE; + + mp4fileinfo(file, file_info, 1024); + SetDlgItemText(hwndDlg, IDC_INFOTEXT, file_info); + + /* get Metadata */ + + pVal = NULL; + if (mp4ff_meta_get_title(file, &pVal)) + uSetDlgItemText(hwndDlg,IDC_METANAME, pVal); + + pVal = NULL; + if (mp4ff_meta_get_artist(file, &pVal)) + uSetDlgItemText(hwndDlg,IDC_METAARTIST, pVal); + + pVal = NULL; + if (mp4ff_meta_get_writer(file, &pVal)) + uSetDlgItemText(hwndDlg,IDC_METAWRITER, pVal); + + pVal = NULL; + if (mp4ff_meta_get_comment(file, &pVal)) + uSetDlgItemText(hwndDlg,IDC_METACOMMENTS, pVal); + + pVal = NULL; + if (mp4ff_meta_get_album(file, &pVal)) + uSetDlgItemText(hwndDlg,IDC_METAALBUM, pVal); + + pVal = NULL; + if (mp4ff_meta_get_genre(file, &pVal)) + uSetDlgItemText(hwndDlg,IDC_METAGENRE, pVal); + + pVal = NULL; + if (mp4ff_meta_get_track(file, &pVal)) + { + SetDlgItemText(hwndDlg,IDC_METATRACK1, pVal); + + //pVal = NULL; + //mp4ff_meta_get_totaltracks(file, &pVal); + //SetDlgItemText(hwndDlg, IDC_METATRACK2, pVal); + } + + pVal = NULL; + if (mp4ff_meta_get_disc(file, &pVal)) + { + SetDlgItemText(hwndDlg,IDC_METADISK1, pVal); + + //pVal = NULL; + //mp4ff_meta_get_totaldiscs(file, &pVal); + //SetDlgItemText(hwndDlg,IDC_METADISK2, pVal); + } + + pVal = NULL; + if (mp4ff_meta_get_date(file, &pVal)) + uSetDlgItemText(hwndDlg,IDC_METAYEAR, pVal); + +#if 0 + /* WERKT NIET */ +#endif + pVal = NULL; + if (mp4ff_meta_get_compilation(file, &pVal)) + { + if (strcmp(pVal, "1") == 0) + { + SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_SETCHECK, BST_CHECKED, 0); + } + } + + /* ! Metadata */ + + mp4ff_close(file); + fclose(mp4File); + + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDCANCEL: + EndDialog(hwndDlg, wParam); + return TRUE; + case IDOK: + + /* trying to edit currently playing file */ + + if (!stricmp(info_fn, mp4state.filename)) + { + MessageBox(module.hMainWindow, "Please stop playback before editing tags", "in_mp4", MB_ICONINFORMATION|MB_OK); + return TRUE; + } + + /* save Metadata changes */ + + tag_delete(&tags); + + mp4File = fopen(info_fn, "rb"); + mp4cb.read = read_callback; + mp4cb.seek = seek_callback; + mp4cb.write = write_callback; + mp4cb.truncate = truncate_callback; + mp4cb.user_data = mp4File; + + + file = mp4ff_open_read(&mp4cb); + if (file != NULL) + { + ReadMP4Tag(file, &tags); + mp4ff_close(file); + fclose(mp4File); + } + + mp4File = fopen(info_fn, "rb+"); + mp4cb.read = read_callback; + mp4cb.seek = seek_callback; + mp4cb.write = write_callback; + mp4cb.truncate = truncate_callback; + mp4cb.user_data = mp4File; + + + uGetDlgItemText(hwndDlg, IDC_METANAME, dummy1, 1024); + tag_set_field(&tags, "title", dummy1, strlen(dummy1)); + + uGetDlgItemText(hwndDlg, IDC_METAWRITER, dummy1, 1024); + tag_set_field(&tags, "writer", dummy1, strlen(dummy1)); + + uGetDlgItemText(hwndDlg, IDC_METAARTIST, dummy1, 1024); + tag_set_field(&tags, "artist", dummy1, strlen(dummy1)); + + uGetDlgItemText(hwndDlg, IDC_METAALBUM, dummy1, 1024); + tag_set_field(&tags, "album", dummy1, strlen(dummy1)); + + uGetDlgItemText(hwndDlg, IDC_METACOMMENTS, dummy1, 1024); + tag_set_field(&tags, "comment", dummy1, strlen(dummy1)); + + uGetDlgItemText(hwndDlg, IDC_METAGENRE, dummy1, 1024); + tag_set_field(&tags, "genre", dummy1, strlen(dummy1)); + + uGetDlgItemText(hwndDlg, IDC_METAYEAR, dummy1, 1024); + tag_set_field(&tags, "year", dummy1, strlen(dummy1)); + + GetDlgItemText(hwndDlg, IDC_METATRACK1, dummy1, 1024); + dummy = atoi(dummy1); + //GetDlgItemText(hwndDlg, IDC_METATRACK2, dummy1, 1024); + //dummy2 = atoi(dummy1); + //wsprintf(temp, "%d/%d", dummy, dummy2); + wsprintf(temp, "%d", dummy); + tag_set_field(&tags, "track", temp, strlen(dummy1)); + + GetDlgItemText(hwndDlg, IDC_METADISK1, dummy1, 1024); + dummy = atoi(dummy1); + //GetDlgItemText(hwndDlg, IDC_METADISK2, dummy1, 1024); + //dummy2 = atoi(dummy1); + //wsprintf(temp, "%d/%d", dummy, dummy2); + wsprintf(temp, "%d", dummy); + tag_set_field(&tags, "disc", temp, strlen(dummy1)); + + dummy3 = SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_GETCHECK, 0, 0); + tag_set_field(&tags, "compilation", (dummy3 ? "1" : "0"), 1); + + mp4ff_meta_update(&mp4cb, &tags); + + fclose(mp4File); + + /* ! */ + + EndDialog(hwndDlg, wParam); + return TRUE; + } + } + return FALSE; +} + +/* returns the name of the object type */ +char *get_ot_string(int ot) +{ + switch (ot) + { + case 0: + return "Main"; + case 1: + return "LC"; + case 2: + return "SSR"; + case 3: + return "LTP"; + } + return NULL; +} + +BOOL CALLBACK aac_info_dialog_proc(HWND hwndDlg, UINT message, + WPARAM wParam, LPARAM lParam) +{ + faadAACInfo aacInfo; + char *info_text, *header_string; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("aac_info_dialog_proc"); +#endif + + switch (message) { + case WM_INITDIALOG: + EnableWindow(GetDlgItem(hwndDlg,IDC_USERDATA), FALSE) ; + ShowWindow(GetDlgItem(hwndDlg,IDC_USERDATA), SW_HIDE); + + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC1), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC2), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC3), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC4), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC5), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC6), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC7), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC8), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC9), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC10), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC11), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC12), SW_HIDE); + + ShowWindow(GetDlgItem(hwndDlg,IDC_METANAME), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_METAARTIST), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_METAWRITER), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_METACOMMENTS), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_METAALBUM), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_METAGENRE), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_METATRACK1), SW_HIDE); + //ShowWindow(GetDlgItem(hwndDlg,IDC_METATRACK2), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_METADISK1), SW_HIDE); + //ShowWindow(GetDlgItem(hwndDlg,IDC_METADISK2), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_METAYEAR), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg,IDC_METACOMPILATION), SW_HIDE); + + info_text = malloc(1024*sizeof(char)); + + get_AAC_format(info_fn, &aacInfo); + + switch (aacInfo.headertype) + { + case 0: /* RAW */ + header_string = " RAW"; + break; + case 1: /* ADIF */ + header_string = " ADIF"; + break; + case 2: /* ADTS */ + header_string = " ADTS"; + break; + } + + sprintf(info_text, "%s AAC %s%s, %d sec, %d kbps, %d Hz", + (aacInfo.version==2)?"MPEG-2":"MPEG-4", get_ot_string(aacInfo.object_type), + header_string, + (int)((float)aacInfo.length/1000.0), (int)((float)aacInfo.bitrate/1000.0+0.5), + aacInfo.sampling_rate); + + SetDlgItemText(hwndDlg, IDC_INFOTEXT, info_text); + + free(info_text); + + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDCANCEL: + case IDOK: + EndDialog(hwndDlg, wParam); + return TRUE; + } + } + return FALSE; +} + +int infoDlg(char *fn, HWND hwndParent) +{ + if(!stricmp(fn + strlen(fn) - 3,"AAC")) + { + lstrcpy(info_fn, fn); + + DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_INFO), + hwndParent, aac_info_dialog_proc); + } else { + lstrcpy(info_fn, fn); + + DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_INFO), + hwndParent, mp4_info_dialog_proc); + } + + return 0; +} + +/* Get the title from the file */ +void ConstructTitle(mp4ff_t *file, char *filename, char *title, char *format) +{ + char temp[4096]; + int some_info = 0; + char *in = format; + char *out = temp;//title; + char *bound = out + sizeof(temp) - 256; //out + (MAX_PATH - 10 - 1); + char *pVal, dummy1[1024]; + short dummy, dummy2; + + while (*in && out < bound) + { + switch (*in) + { + case '%': + ++in; + break; + + default: + *out++ = *in++; + continue; + } + + /* handle % escape sequence */ + switch (*in++) + { + case '0': + pVal = NULL; + if (mp4ff_meta_get_track(file, &pVal)) + { + out += wsprintf(out, "%s", pVal); + some_info = 1; + } + break; + + case '1': + pVal = NULL; + if (mp4ff_meta_get_artist(file, &pVal)) + { + out += wsprintf(out, "%s", pVal); + some_info = 1; + } + break; + + case '2': + pVal = NULL; + if (mp4ff_meta_get_title(file, &pVal)) + { + out += wsprintf(out, "%s", pVal); + some_info = 1; + } + break; + + case '3': + pVal = NULL; + if (mp4ff_meta_get_album(file, &pVal)) + { + out += wsprintf(out, "%s", pVal); + some_info = 1; + } + break; + + case '4': + pVal = NULL; + if (mp4ff_meta_get_date(file, &pVal)) + { + out += wsprintf(out, "%s", pVal); + some_info = 1; + } + break; + + case '5': + pVal = NULL; + if (mp4ff_meta_get_comment(file, &pVal)) + { + out += wsprintf(out, "%s", pVal); + some_info = 1; + } + break; + + case '6': + pVal = NULL; + if (mp4ff_meta_get_genre(file, &pVal)) + { + out += wsprintf(out, "%s", pVal); + some_info = 1; + } + break; + + case '7': + { + const char *p=strrchr(filename,'\\'); + if (!p) p=filename; else p++; + out += ConvertANSIToUTF8(p, out); + some_info = 1; + break; + } + + default: + break; + } + } + + *out = '\0'; + + if (!some_info) + { + char *p=filename+lstrlen(filename); + while (*p != '\\' && p >= filename) p--; + lstrcpy(title,++p); + } + else + { + int len = ConvertUTF8ToANSI(temp, dummy1); + if (len > (MAX_PATH - 10 - 1)) len = (MAX_PATH - 10 - 1); + memcpy(title, dummy1, len); + title[len] = '\0'; + } +} + +BOOL CALLBACK config_dialog_proc(HWND hwndDlg, UINT message, + WPARAM wParam, LPARAM lParam) +{ + int i; + + switch (message) { + case WM_INITDIALOG: + SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_SETRANGE, TRUE, MAKELONG(1,5)); + SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_SETPOS, TRUE, m_priority); + SendMessage(GetDlgItem(hwndDlg, res_id_table[m_resolution]), BM_SETCHECK, BST_CHECKED, 0); + if (m_show_errors) + SendMessage(GetDlgItem(hwndDlg, IDC_ERROR), BM_SETCHECK, BST_CHECKED, 0); + if (m_use_for_aac) + SendMessage(GetDlgItem(hwndDlg, IDC_USEFORAAC), BM_SETCHECK, BST_CHECKED, 0); + if (m_downmix) + SendMessage(GetDlgItem(hwndDlg, IDC_DOWNMIX), BM_SETCHECK, BST_CHECKED, 0); + if (m_vbr_display) + SendMessage(GetDlgItem(hwndDlg, IDC_VBR), BM_SETCHECK, BST_CHECKED, 0); + SetDlgItemText(hwndDlg, IDC_TITLEFORMAT, titleformat); + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDCANCEL: + EndDialog(hwndDlg, wParam); + return TRUE; + case IDOK: + m_show_errors = SendMessage(GetDlgItem(hwndDlg, IDC_ERROR), BM_GETCHECK, 0, 0); + m_use_for_aac = SendMessage(GetDlgItem(hwndDlg, IDC_USEFORAAC), BM_GETCHECK, 0, 0); + m_downmix = SendMessage(GetDlgItem(hwndDlg, IDC_DOWNMIX), BM_GETCHECK, 0, 0); + m_vbr_display = SendMessage(GetDlgItem(hwndDlg, IDC_VBR), BM_GETCHECK, 0, 0); + GetDlgItemText(hwndDlg, IDC_TITLEFORMAT, titleformat, MAX_PATH); + + m_priority = SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_GETPOS, 0, 0); + for (i = 0; i < 6; i++) + { + if (SendMessage(GetDlgItem(hwndDlg, res_id_table[i]), BM_GETCHECK, 0, 0)) + { + m_resolution = i; + break; + } + } + + /* save config */ + config_write(); + + if (!m_use_for_aac) + { + module.FileExtensions = short_ext_list; + } else { + module.FileExtensions = long_ext_list; + } + + EndDialog(hwndDlg, wParam); + return TRUE; + } + } + return FALSE; +} + +void config(HWND hwndParent) +{ + DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_CONFIG), + hwndParent, config_dialog_proc); + + return; +} + +void about(HWND hwndParent) +{ + MessageBox(hwndParent, + "AudioCoding.com MPEG-4 AAC player " FAAD2_VERSION " compiled on " __DATE__ ".\n" + "Visit the website for more info.\n" + "Copyright 2002-2004 AudioCoding.com", + "About", + MB_OK); +} + +int isourfile(char *fn) +{ + if (!stricmp(fn + strlen(fn) - 3,"MP4") || !stricmp(fn + strlen(fn) - 3,"M4A")) + { + return 1; + } else if (m_use_for_aac) { + if (!stricmp(fn + strlen(fn) - 3,"AAC")) + { + return 1; + } + } + + return 0; +} + +int fill_buffer(state *st) +{ + int bread; + + if (st->m_aac_bytes_consumed > 0) + { + if (st->m_aac_bytes_into_buffer) + { + memmove((void*)st->m_aac_buffer, (void*)(st->m_aac_buffer + st->m_aac_bytes_consumed), + st->m_aac_bytes_into_buffer*sizeof(unsigned char)); + } + + if (!st->m_at_eof) + { + bread = fread((void*)(st->m_aac_buffer + st->m_aac_bytes_into_buffer), + 1, st->m_aac_bytes_consumed, st->aacfile); + + if (bread != st->m_aac_bytes_consumed) + st->m_at_eof = 1; + + st->m_aac_bytes_into_buffer += bread; + } + + st->m_aac_bytes_consumed = 0; + + if (st->m_aac_bytes_into_buffer > 3) + { + if (memcmp(st->m_aac_buffer, "TAG", 3) == 0) + st->m_aac_bytes_into_buffer = 0; + } + if (st->m_aac_bytes_into_buffer > 11) + { + if (memcmp(st->m_aac_buffer, "LYRICSBEGIN", 11) == 0) + st->m_aac_bytes_into_buffer = 0; + } + if (st->m_aac_bytes_into_buffer > 8) + { + if (memcmp(st->m_aac_buffer, "APETAGEX", 8) == 0) + st->m_aac_bytes_into_buffer = 0; + } + } + + return 1; +} + +void advance_buffer(state *st, int bytes) +{ + st->m_file_offset += bytes; + st->m_aac_bytes_consumed = bytes; + st->m_aac_bytes_into_buffer -= bytes; +} + +int adts_parse(state *st, __int64 *bitrate, double *length) +{ + static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000}; + int frames, frame_length; + int t_framelength = 0; + int samplerate; + double frames_per_sec, bytes_per_frame; + + /* Read all frames to ensure correct time and bitrate */ + for (frames = 0; /* */; frames++) + { + fill_buffer(st); + + if (st->m_aac_bytes_into_buffer > 7) + { + /* check syncword */ + if (!((st->m_aac_buffer[0] == 0xFF)&&((st->m_aac_buffer[1] & 0xF6) == 0xF0))) + break; + + st->m_tail->offset = st->m_file_offset; + st->m_tail->next = (struct seek_list*)malloc(sizeof(struct seek_list)); + st->m_tail = st->m_tail->next; + st->m_tail->next = NULL; + + if (frames == 0) + samplerate = sample_rates[(st->m_aac_buffer[2]&0x3c)>>2]; + + frame_length = ((((unsigned int)st->m_aac_buffer[3] & 0x3)) << 11) + | (((unsigned int)st->m_aac_buffer[4]) << 3) | (st->m_aac_buffer[5] >> 5); + + t_framelength += frame_length; + + if (frame_length > st->m_aac_bytes_into_buffer) + break; + + advance_buffer(st, frame_length); + } else { + break; + } + } + + frames_per_sec = (double)samplerate/1024.0; + if (frames != 0) + bytes_per_frame = (double)t_framelength/(double)(frames*1000); + else + bytes_per_frame = 0; + *bitrate = (__int64)(8. * bytes_per_frame * frames_per_sec + 0.5); + if (frames_per_sec != 0) + *length = (double)frames/frames_per_sec; + else + *length = 1; + + return 1; +} + +int skip_id3v2_tag() +{ + unsigned char buf[10]; + int bread, tagsize = 0; + + bread = fread(buf, 1, 10, mp4state.aacfile); + if (bread != 10) return -1; + + if (!memcmp(buf, "ID3", 3)) + { + /* high bit is not used */ + tagsize = (buf[6] << 21) | (buf[7] << 14) | (buf[8] << 7) | (buf[9] << 0); + + tagsize += 10; + fseek(mp4state.aacfile, tagsize, SEEK_SET); + } else { + fseek(mp4state.aacfile, 0, SEEK_SET); + } + + return tagsize; +} + +int play(char *fn) +{ + int maxlatency; + int thread_id; + int avg_bitrate, br, sr; + unsigned char *buffer; + int buffer_size; + faacDecConfigurationPtr config; + unsigned char header[8]; + FILE *hMP4File; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("play"); +#endif + + memset(&mp4state, 0, sizeof(state)); + + lstrcpy(mp4state.filename, fn); + + hMP4File = fopen(mp4state.filename, "rb"); + if (!hMP4File) + { + return -1; + } + fread(header, 1, 8, hMP4File); + fclose(hMP4File); + mp4state.filetype = 1; + if (header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p') + mp4state.filetype = 0; + + if (mp4state.filetype) + { + int tagsize = 0, tmp = 0, init; + int bread = 0; + double length = 0.; + __int64 bitrate = 128; +// faacDecFrameInfo frameInfo; + + module.is_seekable = 1; + + if (!(mp4state.aacfile = fopen(mp4state.filename, "rb"))) + { + // error + return -1; + } + + tagsize = skip_id3v2_tag(); + if (tagsize<0) return 0; + + if (!(mp4state.m_aac_buffer = (unsigned char*)malloc(768*6))) + { + show_error(module.hMainWindow, "Memory allocation error."); + return -1; + } + + for (init=0; init<2; init++) + { + mp4state.hDecoder = faacDecOpen(); + if (!mp4state.hDecoder) + { + show_error(module.hMainWindow, "Unable to open decoder library."); + return -1; + } + + config = faacDecGetCurrentConfiguration(mp4state.hDecoder); + config->outputFormat = m_resolution + 1; + config->downMatrix = m_downmix; + faacDecSetConfiguration(mp4state.hDecoder, config); + + memset(mp4state.m_aac_buffer, 0, 768*6); + bread = fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile); + mp4state.m_aac_bytes_into_buffer = bread; + mp4state.m_aac_bytes_consumed = 0; + mp4state.m_file_offset = 0; + mp4state.m_at_eof = (bread != 768*6) ? 1 : 0; + + if (init==0) + { + faacDecFrameInfo frameInfo; + + fill_buffer(&mp4state); + + if ((mp4state.m_aac_bytes_consumed = faacDecInit(mp4state.hDecoder, + mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer, + &mp4state.samplerate, &mp4state.channels)) < 0) + { + show_error(module.hMainWindow, "Can't initialize decoder library."); + return -1; + } + advance_buffer(&mp4state, mp4state.m_aac_bytes_consumed); + + do { + memset(&frameInfo, 0, sizeof(faacDecFrameInfo)); + fill_buffer(&mp4state); + faacDecDecode(mp4state.hDecoder, &frameInfo, mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer); + } while (!frameInfo.samples && !frameInfo.error); + + if (frameInfo.error) + { + show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error)); + return -1; + } + + mp4state.channels = frameInfo.channels; + mp4state.samplerate = frameInfo.samplerate; + mp4state.framesize = (frameInfo.channels != 0) ? frameInfo.samples/frameInfo.channels : 0; + /* + sbr = frameInfo.sbr; + profile = frameInfo.object_type; + header_type = frameInfo.header_type; + */ + + faacDecClose(mp4state.hDecoder); + fseek(mp4state.aacfile, tagsize, SEEK_SET); + } + } + + mp4state.m_head = (struct seek_list*)malloc(sizeof(struct seek_list)); + mp4state.m_tail = mp4state.m_head; + mp4state.m_tail->next = NULL; + + mp4state.m_header_type = 0; + if ((mp4state.m_aac_buffer[0] == 0xFF) && ((mp4state.m_aac_buffer[1] & 0xF6) == 0xF0)) + { + if (1) //(can_seek) + { + adts_parse(&mp4state, &bitrate, &length); + fseek(mp4state.aacfile, tagsize, SEEK_SET); + + bread = fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile); + if (bread != 768*6) + mp4state.m_at_eof = 1; + else + mp4state.m_at_eof = 0; + mp4state.m_aac_bytes_into_buffer = bread; + mp4state.m_aac_bytes_consumed = 0; + + mp4state.m_header_type = 1; + } + } else if (memcmp(mp4state.m_aac_buffer, "ADIF", 4) == 0) { + int skip_size = (mp4state.m_aac_buffer[4] & 0x80) ? 9 : 0; + bitrate = ((unsigned int)(mp4state.m_aac_buffer[4 + skip_size] & 0x0F)<<19) | + ((unsigned int)mp4state.m_aac_buffer[5 + skip_size]<<11) | + ((unsigned int)mp4state.m_aac_buffer[6 + skip_size]<<3) | + ((unsigned int)mp4state.m_aac_buffer[7 + skip_size] & 0xE0); + + length = (double)file_length(mp4state.aacfile); + if (length == -1) + { + module.is_seekable = 0; + length = 0; + } else { + length = ((double)length*8.)/((double)bitrate) + 0.5; + } + + mp4state.m_header_type = 2; + } else { + length = (double)file_length(mp4state.aacfile); + length = ((double)length*8.)/((double)bitrate*1000.) + 0.5; + + module.is_seekable = 1; + } + + mp4state.m_length = (int)(length*1000.); + + fill_buffer(&mp4state); + if ((mp4state.m_aac_bytes_consumed = faacDecInit(mp4state.hDecoder, + mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer, + &mp4state.samplerate, &mp4state.channels)) < 0) + { + show_error(module.hMainWindow, "Can't initialize decoder library."); + return -1; + } + advance_buffer(&mp4state, mp4state.m_aac_bytes_consumed); + + if (mp4state.m_header_type == 2) + avg_bitrate = bitrate; + else + avg_bitrate = bitrate*1000; + } else { + mp4state.hDecoder = faacDecOpen(); + if (!mp4state.hDecoder) + { + show_error(module.hMainWindow, "Unable to open decoder library."); + return -1; + } + + config = faacDecGetCurrentConfiguration(mp4state.hDecoder); + config->outputFormat = m_resolution + 1; + config->downMatrix = m_downmix; + faacDecSetConfiguration(mp4state.hDecoder, config); + + mp4state.mp4File = fopen(mp4state.filename, "rb"); + mp4state.mp4cb.read = read_callback; + mp4state.mp4cb.seek = seek_callback; + mp4state.mp4cb.user_data = mp4state.mp4File; + + + mp4state.mp4file = mp4ff_open_read(&mp4state.mp4cb); + if (!mp4state.mp4file) + { + show_error(module.hMainWindow, "Unable to open file."); + faacDecClose(mp4state.hDecoder); + return -1; + } + + if ((mp4state.mp4track = GetAACTrack(mp4state.mp4file)) < 0) + { + show_error(module.hMainWindow, "Unsupported Audio track type."); + faacDecClose(mp4state.hDecoder); + mp4ff_close(mp4state.mp4file); + fclose(mp4state.mp4File); + return -1; + } + + buffer = NULL; + buffer_size = 0; + mp4ff_get_decoder_config(mp4state.mp4file, mp4state.mp4track, + &buffer, &buffer_size); + if (!buffer) + { + faacDecClose(mp4state.hDecoder); + mp4ff_close(mp4state.mp4file); + fclose(mp4state.mp4File); + return -1; + } + + if(faacDecInit2(mp4state.hDecoder, buffer, buffer_size, + &mp4state.samplerate, &mp4state.channels) < 0) + { + /* If some error initializing occured, skip the file */ + faacDecClose(mp4state.hDecoder); + mp4ff_close(mp4state.mp4file); + fclose(mp4state.mp4File); + if (buffer) free (buffer); + return -1; + } + + /* for gapless decoding */ + { + mp4AudioSpecificConfig mp4ASC; + + mp4state.timescale = mp4ff_time_scale(mp4state.mp4file, mp4state.mp4track); + mp4state.framesize = 1024; + mp4state.useAacLength = 0; + + if (buffer) + { + if (faacDecAudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0) + { + if (mp4ASC.frameLengthFlag == 1) mp4state.framesize = 960; + if (mp4ASC.sbr_present_flag == 1) mp4state.framesize *= 2; + } + } + } + + free(buffer); + + avg_bitrate = mp4ff_get_avg_bitrate(mp4state.mp4file, mp4state.mp4track); + + mp4state.numSamples = mp4ff_num_samples(mp4state.mp4file, mp4state.mp4track); + mp4state.sampleId = 0; + + { + double timescale_div = 1.0 / (double)mp4ff_time_scale(mp4state.mp4file, mp4state.mp4track); + int64_t duration = mp4ff_get_track_duration_use_offsets(mp4state.mp4file, mp4state.mp4track); + if (duration == -1) + { + mp4state.m_length = 0; + } else { + mp4state.m_length = (int)((double)duration * timescale_div * 1000.0); + } + } + + module.is_seekable = 1; + } + + if (mp4state.channels == 0) + { + show_error(module.hMainWindow, "Number of channels not supported for playback."); + faacDecClose(mp4state.hDecoder); + if (mp4state.filetype) + fclose(mp4state.aacfile); + else { + mp4ff_close(mp4state.mp4file); + fclose(mp4state.mp4File); + } + return -1; + } + + if (m_downmix && (mp4state.channels == 5 || mp4state.channels == 6)) + mp4state.channels = 2; + + maxlatency = module.outMod->Open(mp4state.samplerate, (int)mp4state.channels, + res_table[m_resolution], -1, -1); + + if (maxlatency < 0) // error opening device + { + faacDecClose(mp4state.hDecoder); + if (mp4state.filetype) + fclose(mp4state.aacfile); + else { + mp4ff_close(mp4state.mp4file); + fclose(mp4state.mp4File); + } + return -1; + } + + mp4state.paused = 0; + mp4state.decode_pos_ms = 0; + mp4state.seek_needed = -1; + + // initialize vis stuff + module.SAVSAInit(maxlatency, mp4state.samplerate); + module.VSASetInfo((int)mp4state.channels, mp4state.samplerate); + + br = (int)floor(((float)avg_bitrate + 500.0)/1000.0 + 0.5); + sr = (int)floor((float)mp4state.samplerate/1000.0 + 0.5); + module.SetInfo(br, sr, (int)mp4state.channels, 1); + + module.outMod->SetVolume(-666); // set the output plug-ins default volume + + killPlayThread = 0; + + if (mp4state.filetype) + { + if ((play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AACPlayThread, + (void *)&killPlayThread, 0, &thread_id)) == NULL) + { + show_error(module.hMainWindow, "Cannot create playback thread"); + faacDecClose(mp4state.hDecoder); + fclose(mp4state.aacfile); + return -1; + } + } else { + if ((play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MP4PlayThread, + (void *)&killPlayThread, 0, &thread_id)) == NULL) + { + show_error(module.hMainWindow, "Cannot create playback thread"); + faacDecClose(mp4state.hDecoder); + mp4ff_close(mp4state.mp4file); + fclose(mp4state.mp4File); + return -1; + } + } + + SetThreadAffinityMask(play_thread_handle, 1); + + SetThreadPriority(play_thread_handle, priority_table[m_priority]); + + return 0; +} + +void pause() +{ +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("pause"); +#endif + + mp4state.paused = 1; + module.outMod->Pause(1); +} + +void unpause() +{ +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("unpause"); +#endif + + mp4state.paused = 0; + module.outMod->Pause(0); +} + +int ispaused() +{ +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("ispaused"); +#endif + + return mp4state.paused; +} + +void setvolume(int volume) +{ +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("setvolume"); +#endif + + module.outMod->SetVolume(volume); +} + +void setpan(int pan) +{ +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("setpan"); +#endif + + module.outMod->SetPan(pan); +} + +void stop() +{ + struct seek_list *target = mp4state.m_head; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("stop"); +#endif + + killPlayThread = 1; + + if (play_thread_handle != INVALID_HANDLE_VALUE) + { + if (WaitForSingleObject(play_thread_handle, INFINITE) == WAIT_TIMEOUT) + TerminateThread(play_thread_handle,0); + CloseHandle(play_thread_handle); + play_thread_handle = INVALID_HANDLE_VALUE; + } + + + if (mp4state.m_aac_buffer) + free(mp4state.m_aac_buffer); + + while (target) + { + struct seek_list *tmp = target; + target = target->next; + if (tmp) free(tmp); + } + faacDecClose(mp4state.hDecoder); + if (mp4state.filetype) + fclose(mp4state.aacfile); + else { + mp4ff_close(mp4state.mp4file); + fclose(mp4state.mp4File); + } + + module.outMod->Close(); + module.SAVSADeInit(); + + mp4state.filename[0] = '\0'; +} + +int getsonglength(const char *fn) +{ + long msDuration = 0; + + if(!stricmp(fn + strlen(fn) - 3,"MP4") || !stricmp(fn + strlen(fn) - 3,"M4A")) + { + int track; + int64_t length; + FILE *mp4File; + mp4ff_t *file; + mp4ff_callback_t mp4cb = {0}; + + mp4File = fopen(fn, "rb"); + mp4cb.read = read_callback; + mp4cb.seek = seek_callback; + mp4cb.user_data = mp4File; + + + file = mp4ff_open_read(&mp4cb); + if (file == NULL) + return 0; + + if ((track = GetAACTrack(file)) < 0) + { + mp4ff_close(file); + fclose(mp4File); + return -1; + } + + length = mp4ff_get_track_duration(file, track); + + msDuration = (long)((float)length*1000.0 / (float)mp4ff_time_scale(file, track) + 0.5); + + mp4ff_close(file); + fclose(mp4File); + + return msDuration; + } else { + int tagsize = 0; + int bread = 0; + double length = 0.; + __int64 bitrate = 128; + struct seek_list *target; + state len_state; + + memset(&len_state, 0, sizeof(state)); + + if (!(len_state.aacfile = fopen(fn, "rb"))) + { + // error + return 0; + } + + len_state.m_at_eof = 0; + + if (!(len_state.m_aac_buffer = (unsigned char*)malloc(768*6))) + { + //console::error("Memory allocation error.", "foo_mp4"); + return 0; + } + memset(len_state.m_aac_buffer, 0, 768*6); + + bread = fread(len_state.m_aac_buffer, 1, 768*6, len_state.aacfile); + len_state.m_aac_bytes_into_buffer = bread; + len_state.m_aac_bytes_consumed = 0; + len_state.m_file_offset = 0; + + if (bread != 768*6) + len_state.m_at_eof = 1; + + if (!memcmp(len_state.m_aac_buffer, "ID3", 3)) + { + /* high bit is not used */ + tagsize = (len_state.m_aac_buffer[6] << 21) | (len_state.m_aac_buffer[7] << 14) | + (len_state.m_aac_buffer[8] << 7) | (len_state.m_aac_buffer[9] << 0); + + tagsize += 10; + advance_buffer(&len_state, tagsize); + } + + len_state.m_head = (struct seek_list*)malloc(sizeof(struct seek_list)); + len_state.m_tail = len_state.m_head; + len_state.m_tail->next = NULL; + + len_state.m_header_type = 0; + if ((len_state.m_aac_buffer[0] == 0xFF) && ((len_state.m_aac_buffer[1] & 0xF6) == 0xF0)) + { + if (1) //(m_reader->can_seek()) + { + adts_parse(&len_state, &bitrate, &length); + fseek(len_state.aacfile, tagsize, SEEK_SET); + + bread = fread(len_state.m_aac_buffer, 1, 768*6, len_state.aacfile); + if (bread != 768*6) + len_state.m_at_eof = 1; + else + len_state.m_at_eof = 0; + len_state.m_aac_bytes_into_buffer = bread; + len_state.m_aac_bytes_consumed = 0; + + len_state.m_header_type = 1; + } + } else if (memcmp(len_state.m_aac_buffer, "ADIF", 4) == 0) { + int skip_size = (len_state.m_aac_buffer[4] & 0x80) ? 9 : 0; + bitrate = ((unsigned int)(len_state.m_aac_buffer[4 + skip_size] & 0x0F)<<19) | + ((unsigned int)len_state.m_aac_buffer[5 + skip_size]<<11) | + ((unsigned int)len_state.m_aac_buffer[6 + skip_size]<<3) | + ((unsigned int)len_state.m_aac_buffer[7 + skip_size] & 0xE0); + + length = (double)file_length(len_state.aacfile); + if (length == -1) + length = 0; + else + length = ((double)length*8.)/((double)bitrate) + 0.5; + + len_state.m_header_type = 2; + } else { + length = (double)file_length(len_state.aacfile); + length = ((double)length*8.)/((double)bitrate*1000.) + 0.5; + + len_state.m_header_type = 0; + } + + if (len_state.m_aac_buffer) + free(len_state.m_aac_buffer); + + target = len_state.m_head; + while (target) + { + struct seek_list *tmp = target; + target = target->next; + if (tmp) free(tmp); + } + + fclose(len_state.aacfile); + + return (int)(length*1000.); + } +} + +int getlength() +{ + if (!mp4state.filetype) + { + int track; + long msDuration; + long length; + + if ((track = GetAACTrack(mp4state.mp4file)) < 0) + { + return -1; + } + + length = mp4ff_get_track_duration(mp4state.mp4file, track); + + msDuration = (long)(length*1000.0 / (float)mp4ff_time_scale(mp4state.mp4file, track) + 0.5); + + return msDuration; + } else { + return mp4state.m_length; + } + return 0; +} + +int getoutputtime() +{ + return mp4state.decode_pos_ms+(module.outMod->GetOutputTime()-module.outMod->GetWrittenTime()); +} + +void setoutputtime(int time_in_ms) +{ +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("setoutputtime"); +#endif + + mp4state.seek_needed = time_in_ms; +} + +void getfileinfo(char *filename, char *title, int *length_in_ms) +{ + if (!filename || !*filename) /* currently playing file */ + { + if (length_in_ms) + *length_in_ms = getlength(); + + if (title) + { + if (mp4state.filetype == 0) + { + ConstructTitle(mp4state.mp4file, mp4state.filename, title, titleformat); + } else { + char *tmp2; + char *tmp = PathFindFileName(mp4state.filename); + strcpy(title, tmp); + tmp2 = strrchr(title, '.'); + tmp2[0] = '\0'; + } + } + } else { + if (length_in_ms) + *length_in_ms = getsonglength(filename); + + if (title) + { + unsigned char header[8]; + FILE *hMP4File = fopen(filename, "rb"); + if (!hMP4File) + { + return; + } + fread(header, 1, 8, hMP4File); + fclose(hMP4File); + + if (header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p') + { + FILE *mp4File; + mp4ff_t *file; + mp4ff_callback_t mp4cb = {0}; + + mp4File = fopen(filename, "rb"); + mp4cb.read = read_callback; + mp4cb.seek = seek_callback; + mp4cb.user_data = mp4File; + + file = mp4ff_open_read(&mp4cb); + if (file == NULL) + return; + + ConstructTitle(file, filename, title, titleformat); + + mp4ff_close(file); + fclose(mp4File); + } else { + char *tmp2; + char *tmp = PathFindFileName(filename); + strcpy(title, tmp); + tmp2 = strrchr(title, '.'); + tmp2[0] = '\0'; + } + } + } +} + +void eq_set(int on, char data[10], int preamp) +{ +} + +static void remap_channels(unsigned char *data, unsigned int samples, unsigned int bps) +{ + unsigned int i; + + switch (bps) + { + case 8: + { + unsigned char r1, r2, r3, r4, r5, r6; + for (i = 0; i < samples; i += 6) + { + r1 = data[i]; + r2 = data[i+1]; + r3 = data[i+2]; + r4 = data[i+3]; + r5 = data[i+4]; + r6 = data[i+5]; + data[i] = r2; + data[i+1] = r3; + data[i+2] = r1; + data[i+3] = r6; + data[i+4] = r4; + data[i+5] = r5; + } + } + break; + + case 16: + default: + { + unsigned short r1, r2, r3, r4, r5, r6; + unsigned short *sample_buffer = (unsigned short *)data; + for (i = 0; i < samples; i += 6) + { + r1 = sample_buffer[i]; + r2 = sample_buffer[i+1]; + r3 = sample_buffer[i+2]; + r4 = sample_buffer[i+3]; + r5 = sample_buffer[i+4]; + r6 = sample_buffer[i+5]; + sample_buffer[i] = r2; + sample_buffer[i+1] = r3; + sample_buffer[i+2] = r1; + sample_buffer[i+3] = r6; + sample_buffer[i+4] = r4; + sample_buffer[i+5] = r5; + } + } + break; + + case 24: + case 32: + { + unsigned int r1, r2, r3, r4, r5, r6; + unsigned int *sample_buffer = (unsigned int *)data; + for (i = 0; i < samples; i += 6) + { + r1 = sample_buffer[i]; + r2 = sample_buffer[i+1]; + r3 = sample_buffer[i+2]; + r4 = sample_buffer[i+3]; + r5 = sample_buffer[i+4]; + r6 = sample_buffer[i+5]; + sample_buffer[i] = r2; + sample_buffer[i+1] = r3; + sample_buffer[i+2] = r1; + sample_buffer[i+3] = r6; + sample_buffer[i+4] = r4; + sample_buffer[i+5] = r5; + } + } + break; + } +} + +DWORD WINAPI MP4PlayThread(void *b) +{ + int done = 0; + int l; + int seq_frames = 0; + int seq_bytes = 0; + + void *sample_buffer; + unsigned char *buffer; + int buffer_size; + faacDecFrameInfo frameInfo; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("MP4PlayThread"); +#endif + + PlayThreadAlive = 1; + mp4state.last_frame = 0; + mp4state.initial = 1; + + while (!*((int *)b)) + { + /* seeking */ + if (mp4state.seek_needed != -1) + { + int64_t duration; + int32_t skip_samples = 0; + + module.outMod->Flush(mp4state.decode_pos_ms); + duration = (int64_t)(mp4state.seek_needed/1000.0 * mp4state.samplerate + 0.5); + mp4state.sampleId = mp4ff_find_sample_use_offsets(mp4state.mp4file, + mp4state.mp4track, duration, &skip_samples); + + mp4state.decode_pos_ms = mp4state.seek_needed; + mp4state.seek_needed = -1; + } + + if (done) + { + module.outMod->CanWrite(); + + if (!module.outMod->IsPlaying()) + { + PostMessage(module.hMainWindow, WM_WA_AAC_EOF, 0, 0); + PlayThreadAlive = 0; + return 0; + } + + Sleep(10); + } else if (module.outMod->CanWrite() >= (2048*mp4state.channels*sizeof(short))) { + + if (mp4state.last_frame) + { + done = 1; + } else { + int rc; + + /* for gapless decoding */ + char *buf; + long dur; + unsigned int sample_count; + unsigned int delay = 0; + + /* get acces unit from MP4 file */ + buffer = NULL; + buffer_size = 0; + + dur = mp4ff_get_sample_duration(mp4state.mp4file, mp4state.mp4track, mp4state.sampleId); + rc = mp4ff_read_sample(mp4state.mp4file, mp4state.mp4track, mp4state.sampleId++, &buffer, &buffer_size); + + if (mp4state.sampleId == 1) dur = 0; + if (rc == 0 || buffer == NULL) + { + mp4state.last_frame = 1; + sample_buffer = NULL; + frameInfo.samples = 0; + } else { + sample_buffer = faacDecDecode(mp4state.hDecoder, &frameInfo, + buffer, buffer_size); + } + if (frameInfo.error > 0) + { + show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error)); + mp4state.last_frame = 1; + } + if (mp4state.sampleId >= mp4state.numSamples) + mp4state.last_frame = 1; + + if (buffer) free(buffer); + + if (mp4state.useAacLength || (mp4state.timescale != mp4state.samplerate)) { + sample_count = frameInfo.samples; + } else { + sample_count = (unsigned int)(dur * frameInfo.channels); + + if (!mp4state.useAacLength && !mp4state.initial && (mp4state.sampleId < mp4state.numSamples/2) && (dur*frameInfo.channels != frameInfo.samples)) + { + //fprintf(stderr, "MP4 seems to have incorrect frame duration, using values from AAC data.\n"); + mp4state.useAacLength = 1; + sample_count = frameInfo.samples; + } + } + + if (mp4state.initial && (sample_count < mp4state.framesize*mp4state.channels) && (frameInfo.samples > sample_count)) + { + delay = frameInfo.samples - sample_count; + } + + if (!killPlayThread && (sample_count > 0)) + { + buf = (char *)sample_buffer; + mp4state.initial = 0; + + switch (res_table[m_resolution]) + { + case 8: + buf += delay; + break; + case 16: + default: + buf += delay * 2; + break; + case 24: + case 32: + buf += delay * 4; + break; + case 64: + buf += delay * 8; + } + + if (frameInfo.channels == 6 && frameInfo.num_lfe_channels) + remap_channels(buf, sample_count, res_table[m_resolution]); + + if (res_table[m_resolution] == 24) + { + /* convert libfaad output (3 bytes packed in 4) */ + char *temp_buffer = convert3in4to3in3(buf, sample_count); + memcpy((void*)buf, (void*)temp_buffer, sample_count*3); + free(temp_buffer); + } + + module.SAAddPCMData(buf, (int)mp4state.channels, res_table[m_resolution], + mp4state.decode_pos_ms); + module.VSAAddPCMData(buf, (int)mp4state.channels, res_table[m_resolution], + mp4state.decode_pos_ms); + mp4state.decode_pos_ms += (double)sample_count * 1000.0 / + ((double)frameInfo.samplerate * (double)frameInfo.channels); + + l = sample_count * res_table[m_resolution] / 8; + + if (module.dsp_isactive()) + { + void *dsp_buffer = malloc(l*2); + memcpy(dsp_buffer, buf, l); + + l = module.dsp_dosamples((short*)dsp_buffer, + sample_count/frameInfo.channels, + res_table[m_resolution], + frameInfo.channels, + frameInfo.samplerate) * + (frameInfo.channels*(res_table[m_resolution]/8)); + + module.outMod->Write(dsp_buffer, l); + if (dsp_buffer) free(dsp_buffer); + } else { + module.outMod->Write(buf, l); + } + + /* VBR bitrate display */ + if (m_vbr_display) + { + seq_frames++; + seq_bytes += frameInfo.bytesconsumed; + if (seq_frames == (int)(floor((float)frameInfo.samplerate/(float)(sample_count/frameInfo.channels) + 0.5))) + { + module.SetInfo((int)floor(((float)seq_bytes*8.)/1000. + 0.5), + (int)floor(frameInfo.samplerate/1000. + 0.5), + mp4state.channels, 1); + + seq_frames = 0; + seq_bytes = 0; + } + } + } + } + } else { + Sleep(10); + } + } + + PlayThreadAlive = 0; + + return 0; +} + +void *decode_aac_frame(state *st, faacDecFrameInfo *frameInfo) +{ + void *sample_buffer = NULL; + + do + { + fill_buffer(st); + + if (st->m_aac_bytes_into_buffer != 0) + { + sample_buffer = faacDecDecode(st->hDecoder, frameInfo, + st->m_aac_buffer, st->m_aac_bytes_into_buffer); + + if (st->m_header_type != 1) + { + if (st->last_offset < st->m_file_offset) + { + st->m_tail->offset = st->m_file_offset; + st->m_tail->next = (struct seek_list*)malloc(sizeof(struct seek_list)); + st->m_tail = st->m_tail->next; + st->m_tail->next = NULL; + st->last_offset = st->m_file_offset; + } + } + + advance_buffer(st, frameInfo->bytesconsumed); + } else { + break; + } + + } while (!frameInfo->samples && !frameInfo->error); + + return sample_buffer; +} + +int aac_seek(state *st, double seconds) +{ + int i, frames; + int bread; + struct seek_list *target = st->m_head; + + if (1 /*can_seek*/ && ((st->m_header_type == 1) || (seconds < st->cur_pos_sec))) + { + frames = (int)(seconds*((double)st->samplerate/(double)st->framesize) + 0.5); + + for (i = 0; i < frames; i++) + { + if (target->next) + target = target->next; + else + return 0; + } + if (target->offset == 0 && frames > 0) + return 0; + fseek(st->aacfile, target->offset, SEEK_SET); + st->m_file_offset = target->offset; + + bread = fread(st->m_aac_buffer, 1, 768*6, st->aacfile); + if (bread != 768*6) + st->m_at_eof = 1; + else + st->m_at_eof = 0; + st->m_aac_bytes_into_buffer = bread; + st->m_aac_bytes_consumed = 0; + st->m_file_offset += bread; + + faacDecPostSeekReset(st->hDecoder, -1); + + return 1; + } else { + if (seconds > st->cur_pos_sec) + { + faacDecFrameInfo frameInfo; + + frames = (int)((seconds - st->cur_pos_sec)*((double)st->samplerate/(double)st->framesize)); + + if (frames > 0) + { + for (i = 0; i < frames; i++) + { + memset(&frameInfo, 0, sizeof(faacDecFrameInfo)); + decode_aac_frame(st, &frameInfo); + + if (frameInfo.error || (st->m_aac_bytes_into_buffer == 0)) + { + if (frameInfo.error) + { + if (faacDecGetErrorMessage(frameInfo.error) != NULL) + show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error)); + } + return 0; + } + } + } + + faacDecPostSeekReset(st->hDecoder, -1); + } + return 1; + } +} + +DWORD WINAPI AACPlayThread(void *b) +{ + int done = 0; + int l; + int seq_frames = 0; + int seq_bytes = 0; + +#ifdef DEBUG_OUTPUT + in_mp4_DebugOutput("AACPlayThread"); +#endif + + PlayThreadAlive = 1; + mp4state.last_frame = 0; + + while (!*((int *)b)) + { + /* seeking */ + if (mp4state.seek_needed != -1) + { + double ms; + + ms = mp4state.seek_needed/1000; + if (aac_seek(&mp4state, ms)!=0) + { + module.outMod->Flush(mp4state.decode_pos_ms); + mp4state.cur_pos_sec = ms; + mp4state.decode_pos_ms = mp4state.seek_needed; + } + mp4state.seek_needed = -1; + } + + if (done) + { + module.outMod->CanWrite(); + + if (!module.outMod->IsPlaying()) + { + PostMessage(module.hMainWindow, WM_WA_AAC_EOF, 0, 0); + PlayThreadAlive = 0; + return 0; + } + + Sleep(10); + } else if (module.outMod->CanWrite() >= (2048*mp4state.channels*sizeof(short))) { + faacDecFrameInfo frameInfo; + void *sample_buffer; + + memset(&frameInfo, 0, sizeof(faacDecFrameInfo)); + + sample_buffer = decode_aac_frame(&mp4state, &frameInfo); + + if (frameInfo.error || (mp4state.m_aac_bytes_into_buffer == 0)) + { + if (frameInfo.error) + { + if (faacDecGetErrorMessage(frameInfo.error) != NULL) + show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error)); + } + done = 1; + } + + if (!killPlayThread && (frameInfo.samples > 0)) + { + if (frameInfo.channels == 6 && frameInfo.num_lfe_channels) + remap_channels(sample_buffer, frameInfo.samples, res_table[m_resolution]); + + if (res_table[m_resolution] == 24) + { + /* convert libfaad output (3 bytes packed in 4 bytes) */ + char *temp_buffer = convert3in4to3in3(sample_buffer, frameInfo.samples); + memcpy((void*)sample_buffer, (void*)temp_buffer, frameInfo.samples*3); + free(temp_buffer); + } + + module.SAAddPCMData(sample_buffer, (int)mp4state.channels, res_table[m_resolution], + mp4state.decode_pos_ms); + module.VSAAddPCMData(sample_buffer, (int)mp4state.channels, res_table[m_resolution], + mp4state.decode_pos_ms); + mp4state.decode_pos_ms += (double)frameInfo.samples * 1000.0 / + ((double)frameInfo.samplerate* (double)frameInfo.channels); + + l = frameInfo.samples * res_table[m_resolution] / 8; + + if (module.dsp_isactive()) + { + void *dsp_buffer = malloc(l*2); + memcpy(dsp_buffer, sample_buffer, l); + + l = module.dsp_dosamples((short*)dsp_buffer, + frameInfo.samples/frameInfo.channels, + res_table[m_resolution], + frameInfo.channels, + frameInfo.samplerate) * + (frameInfo.channels*(res_table[m_resolution]/8)); + + module.outMod->Write(dsp_buffer, l); + if (dsp_buffer) free(dsp_buffer); + } else { + module.outMod->Write(sample_buffer, l); + } + + /* VBR bitrate display */ + if (m_vbr_display) + { + seq_frames++; + seq_bytes += frameInfo.bytesconsumed; + if (seq_frames == (int)(floor((float)frameInfo.samplerate/(float)(frameInfo.samples/frameInfo.channels) + 0.5))) + { + module.SetInfo((int)floor(((float)seq_bytes*8.)/1000. + 0.5), + (int)floor(frameInfo.samplerate/1000. + 0.5), + mp4state.channels, 1); + + seq_frames = 0; + seq_bytes = 0; + } + } + } + + if (frameInfo.channels > 0 && mp4state.samplerate > 0) + mp4state.cur_pos_sec += ((double)(frameInfo.samples/frameInfo.channels))/(double)mp4state.samplerate; + } else { + Sleep(10); + } + } + + PlayThreadAlive = 0; + + return 0; +} + +static In_Module module = +{ + IN_VER, + "AudioCoding.com MPEG-4 AAC player: " FAAD2_VERSION " compiled on " __DATE__, + 0, // hMainWindow + 0, // hDllInstance + NULL, + 1, // is_seekable + 1, // uses output + config, + about, + init, + quit, + getfileinfo, + infoDlg, + isourfile, + play, + pause, + unpause, + ispaused, + stop, + + getlength, + getoutputtime, + setoutputtime, + + setvolume, + setpan, + + 0,0,0,0,0,0,0,0,0, // vis stuff + + + 0,0, // dsp + + eq_set, + + NULL, // setinfo + + 0 // out_mod +}; + +__declspec(dllexport) In_Module* winampGetInModule2() +{ + config_read(); + + if (!m_use_for_aac) + { + module.FileExtensions = short_ext_list; + } else { + module.FileExtensions = long_ext_list; + } + + return &module; +} + +/* new Media Library interface */ + +int mp4_get_metadata(mp4ff_t *file, const char *item, char *dest, int dlen) +{ + char *pVal = NULL, dummy1[4096]; + + if (dlen < 1) return 0; + + if (!stricmp(item, "track") || !stricmp(item, "tracknumber")) + { + if (mp4ff_meta_get_track(file, &pVal)) + { + wsprintf(dummy1, "%s", pVal); + strncpy(dest, dummy1, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "disc") || !stricmp(item, "disknumber")) + { + if (mp4ff_meta_get_disc(file, &pVal)) + { + wsprintf(dummy1, "%s", pVal); + strncpy(dest, dummy1, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "compilation")) + { + uint8_t cpil = 0; + if (mp4ff_meta_get_compilation(file, &pVal)) + { + wsprintf(dummy1, "%s", pVal); + strncpy(dest, dummy1, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "tempo")) + { + if (mp4ff_meta_get_tempo(file, &pVal)) + { + wsprintf(dummy1, "%s", pVal); + strncpy(dest, dummy1, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "artist")) + { + if (mp4ff_meta_get_artist(file, &pVal)) + { + strncpy(dest, pVal, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "writer")) + { + if (mp4ff_meta_get_writer(file, &pVal)) + { + strncpy(dest, pVal, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "title")) + { + if (mp4ff_meta_get_title(file, &pVal)) + { + strncpy(dest, pVal, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "album")) + { + if (mp4ff_meta_get_album(file, &pVal)) + { + strncpy(dest, pVal, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "date") || !stricmp(item, "year")) + { + if (mp4ff_meta_get_date(file, &pVal)) + { + strncpy(dest, pVal, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "comment")) + { + if (mp4ff_meta_get_comment(file, &pVal)) + { + strncpy(dest, pVal, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "genre")) + { + if (mp4ff_meta_get_genre(file, &pVal)) + { + strncpy(dest, pVal, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } + else if (!stricmp(item, "tool")) + { + if (mp4ff_meta_get_tool(file, &pVal)) + { + strncpy(dest, pVal, dlen-1); + dest[dlen-1] = '\0'; + return 1; + } + } +#if 0 + else + { + uint32_t valueSize = 0; + uint8_t *pValue = NULL; + + if (MP4GetMetadataFreeForm(file, (char *)item, &pValue, &valueSize)) + { + unsigned int len = (valueSize < (unsigned int)(dlen-1)) ? valueSize : (unsigned int)(dlen-1); + memcpy(dest, pValue, len); + dest[len] = '\0'; + return 1; + } + } +#endif + + return 0; +} + +__declspec(dllexport) int winampGetExtendedFileInfo(const char *fn, const char *data, char *dest, int destlen) +{ + if (!fn || (fn && !*fn) || !destlen) return 0; + + dest[0] = '\0'; + + if (!stricmp(data, "length")) + { + char temp[32]; + int len = getsonglength(fn); + itoa(len, temp, 10); + strncpy(dest, temp, destlen-1); + dest[destlen-1] = '\0'; + } + else + { + char temp[2048], temp2[2048]; + FILE *mp4File; + mp4ff_callback_t mp4cb = {0}; + mp4ff_t *file; + + mp4File = fopen(fn, "rb"); + mp4cb.read = read_callback; + mp4cb.seek = seek_callback; + mp4cb.write = write_callback; + mp4cb.truncate = truncate_callback; + mp4cb.user_data = mp4File; + + + file = mp4ff_open_read(&mp4cb); + if (file == NULL) return 0; + + if (mp4_get_metadata(file, data, temp, sizeof(temp))) + { + int len = ConvertUTF8ToANSI(temp, temp2); + if (len > destlen-1) len = destlen-1; + memcpy(dest, temp2, len); + dest[len] = '\0'; + } + + mp4ff_close(file); + fclose(mp4File); + } + + return 1; +} + +static mp4ff_metadata_t mltags = {0, 0}; +static BOOL medialib_init = FALSE; +static char medialib_lastfn[2048] = ""; + +__declspec(dllexport) int winampSetExtendedFileInfo(const char *fn, const char *data, char *val) +{ + int len, ret = 0; + char *temp; + + if (!medialib_init || (medialib_init && stricmp(fn, medialib_lastfn))) { + FILE *mp4File; + mp4ff_callback_t mp4cb = {0}; + mp4ff_t *file; + strcpy(medialib_lastfn, fn); + + if (medialib_init) tag_delete(&mltags); + + mp4File = fopen(medialib_lastfn, "rb"); + mp4cb.read = read_callback; + mp4cb.seek = seek_callback; + mp4cb.user_data = mp4File; + + + file = mp4ff_open_read(&mp4cb); + if (file == NULL) return 0; + + ReadMP4Tag(file, &mltags); + + mp4ff_close(file); + fclose(mp4File); + + medialib_init = TRUE; + } + + len = strlen(val); + temp = (char *)malloc((len+1)*4); + if (!temp) return 0; + + if (ConvertANSIToUTF8(val, temp)) + { + ret = 1; + tag_set_field(&mltags, data, temp, len); + } + + free(temp); + + return ret; +} + +__declspec(dllexport) int winampWriteExtendedFileInfo() +{ + if (medialib_init) + { + FILE *mp4File; + mp4ff_callback_t mp4cb = {0}; + + mp4File = fopen(medialib_lastfn, "rb+"); + mp4cb.read = read_callback; + mp4cb.seek = seek_callback; + mp4cb.write = write_callback; + mp4cb.truncate = truncate_callback; + mp4cb.user_data = mp4File; + + mp4ff_meta_update(&mp4cb, &mltags); + + fclose(mp4File); + + return 1; + } + else + { + return 0; + } +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/in_mp4.dsp +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/in_mp4.dsp @@ -0,0 +1,155 @@ +# Microsoft Developer Studio Project File - Name="in_mp4" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=in_mp4 - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "in_mp4.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "in_mp4.mak" CFG="in_mp4 - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "in_mp4 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "in_mp4 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "in_mp4 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O1 /I "..\..\include" /I "..\..\common\mp4v2" /I "..\..\common\mp4av" /I "..\..\common\mp4ff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x413 /d "NDEBUG" +# ADD RSC /l 0x413 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 + +!ELSEIF "$(CFG)" == "in_mp4 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\common\mp4v2" /I "..\..\common\mp4av" /I "..\..\common\mp4ff" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x413 /d "_DEBUG" +# ADD RSC /l 0x413 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "in_mp4 - Win32 Release" +# Name "in_mp4 - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\aacinfo.c +# End Source File +# Begin Source File + +SOURCE=.\config.c +# End Source File +# Begin Source File + +SOURCE=.\in_mp4.c +# End Source File +# Begin Source File + +SOURCE=.\utils.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\aacinfo.h +# End Source File +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=.\in2.h +# End Source File +# Begin Source File + +SOURCE=..\..\common\mp4ff\mp4ff.h +# End Source File +# Begin Source File + +SOURCE=..\..\common\mp4ff\mp4ff_int_types.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\faad.h +# End Source File +# Begin Source File + +SOURCE=.\out.h +# End Source File +# Begin Source File + +SOURCE=.\utils.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\in_mp4.rc +# End Source File +# End Group +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/in_mp4.dsw +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/in_mp4.dsw @@ -0,0 +1,59 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "in_mp4"=.\in_mp4.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libfaad + End Project Dependency + Begin Project Dependency + Project_Dep_Name mp4ff + End Project Dependency +}}} + +############################################################################### + +Project: "libfaad"=..\..\libfaad\libfaad.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "mp4ff"=..\..\common\mp4ff\mp4ff.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/in_mp4.rc +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/in_mp4.rc @@ -0,0 +1,170 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Dutch (Netherlands) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD) +#ifdef _WIN32 +LANGUAGE LANG_DUTCH, SUBLANG_DUTCH +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE MOVEABLE PURE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE MOVEABLE PURE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE MOVEABLE PURE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_INFO DIALOGEX 0, 0, 303, 255 +STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "MPEG-4 File Info" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Track info",IDC_STATIC,7,7,289,64 + EDITTEXT IDC_METANAME,53,91,151,14,ES_AUTOHSCROLL + EDITTEXT IDC_METAARTIST,53,109,151,14,ES_AUTOHSCROLL + EDITTEXT IDC_METAWRITER,53,127,151,14,ES_AUTOHSCROLL + EDITTEXT IDC_METAALBUM,53,145,233,14,ES_AUTOHSCROLL + EDITTEXT IDC_METACOMMENTS,53,163,234,35,ES_AUTOHSCROLL + EDITTEXT IDC_METAGENRE,53,202,151,14,ES_AUTOHSCROLL + EDITTEXT IDC_METAYEAR,234,91,52,14,ES_AUTOHSCROLL + EDITTEXT IDC_METATRACK1,234,109,52,14,ES_AUTOHSCROLL + EDITTEXT IDC_METADISK1,234,127,52,14,ES_AUTOHSCROLL + CONTROL "Part of a compilation",IDC_METACOMPILATION,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,207,202,80,14 + DEFPUSHBUTTON "OK",IDOK,246,234,50,14 + PUSHBUTTON "Cancel",IDCANCEL,186,234,50,14 + LTEXT "",IDC_INFOTEXT,14,17,275,47,0,WS_EX_CLIENTEDGE + GROUPBOX "User data",IDC_USERDATA,7,76,289,151 + LTEXT "Name",IDC_STATIC1,13,91,20,14,SS_CENTERIMAGE + LTEXT "Artist",IDC_STATIC2,13,109,16,14,SS_CENTERIMAGE + LTEXT "Composer",IDC_STATIC3,13,127,32,14,SS_CENTERIMAGE + LTEXT "Album",IDC_STATIC4,13,145,20,14,SS_CENTERIMAGE + LTEXT "Comments",IDC_STATIC5,13,163,34,14,SS_CENTERIMAGE + LTEXT "Year",IDC_STATIC7,211,91,16,14,SS_CENTERIMAGE + LTEXT "Disc",IDC_STATIC9,211,127,15,14,SS_CENTERIMAGE + LTEXT "Track",IDC_STATIC8,211,109,20,14,SS_CENTERIMAGE + LTEXT "Genre",IDC_STATIC6,13,202,20,14,SS_CENTERIMAGE +END + +IDD_CONFIG DIALOG DISCARDABLE 0, 0, 233, 166 +STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Configuration" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Slider1",IDC_PRIORITY,"msctls_trackbar32",TBS_VERT | + TBS_NOTICKS | WS_TABSTOP,13,15,18,46 + CONTROL "16 bits",IDC_16BITS,"Button",BS_AUTORADIOBUTTON,77,18, + 37,10 + CONTROL "16 bits dithered",IDC_16BITS_DITHERED,"Button", + BS_AUTORADIOBUTTON | WS_DISABLED,77,29,64,10 + CONTROL "24 bits",IDC_24BITS,"Button",BS_AUTORADIOBUTTON,77,40, + 37,10 + CONTROL "32 bits",IDC_32BITS,"Button",BS_AUTORADIOBUTTON,77,51, + 37,10 + CONTROL "Downmix to stereo",IDC_DOWNMIX,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,13,74,10 + CONTROL "Use for AAC",IDC_USEFORAAC,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,26,55,10 + CONTROL "VBR Display",IDC_VBR,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,39,55,10 + CONTROL "Show errors",IDC_ERROR,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,152,52,53,10 + EDITTEXT IDC_TITLEFORMAT,14,86,121,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,176,145,50,14 + PUSHBUTTON "Cancel",IDCANCEL,176,125,50,14 + GROUPBOX "Priority",IDC_STATIC,7,7,57,58 + LTEXT "Highest",IDC_STATIC,34,18,25,8 + LTEXT "Normal",IDC_STATIC,34,35,23,8 + LTEXT "Lowest",IDC_STATIC,34,52,24,8 + GROUPBOX "Resolution",IDC_STATIC,71,7,73,58 + GROUPBOX "Title format",IDC_STATIC,7,72,137,87 + LTEXT "%0 - Track",IDC_STATIC,17,109,35,8 + LTEXT "%1 - Artist",IDC_STATIC,17,120,32,8 + LTEXT "%2 - Title",IDC_STATIC,17,131,30,8 + LTEXT "%3 - Album",IDC_STATIC,17,142,36,8 + LTEXT "%4 - Year",IDC_STATIC,68,109,31,8 + LTEXT "%5 - Comment",IDC_STATIC,68,120,46,8 + LTEXT "%6 - Genre",IDC_STATIC,68,131,36,8 + LTEXT "%7 - Filename",IDC_STATIC,68,142,44,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO MOVEABLE PURE +BEGIN + IDD_INFO, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 296 + TOPMARGIN, 7 + BOTTOMMARGIN, 248 + END + + IDD_CONFIG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 226 + TOPMARGIN, 7 + BOTTOMMARGIN, 159 + END +END +#endif // APSTUDIO_INVOKED + +#endif // Dutch (Netherlands) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/in_mp4.sln +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/in_mp4.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "in_mp4", "in_mp4.vcproj", "{2D8F479D-A591-4502-9456-398425D5F834}" + ProjectSection(ProjectDependencies) = postProject + {2398BB2F-FFF9-490B-B4CC-863F2D21AE46} = {2398BB2F-FFF9-490B-B4CC-863F2D21AE46} + {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49} = {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49} + {82CAD808-21AF-40A6-92EC-AE01AA67B413} = {82CAD808-21AF-40A6-92EC-AE01AA67B413} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "..\..\libfaad\libfaad.vcproj", "{82CAD808-21AF-40A6-92EC-AE01AA67B413}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4v2_st", "..\..\common\mp4v2\libmp4v2_st60.vcproj", "{2398BB2F-FFF9-490B-B4CC-863F2D21AE46}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4av_st", "..\..\common\mp4av\libmp4av_st.vcproj", "{8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {2D8F479D-A591-4502-9456-398425D5F834}.Debug.ActiveCfg = Debug|Win32 + {2D8F479D-A591-4502-9456-398425D5F834}.Debug.Build.0 = Debug|Win32 + {2D8F479D-A591-4502-9456-398425D5F834}.Release.ActiveCfg = Release|Win32 + {2D8F479D-A591-4502-9456-398425D5F834}.Release.Build.0 = Release|Win32 + {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Debug.ActiveCfg = Debug|Win32 + {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Debug.Build.0 = Debug|Win32 + {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Release.ActiveCfg = Release|Win32 + {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Release.Build.0 = Release|Win32 + {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Debug.ActiveCfg = Debug|Win32 + {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Debug.Build.0 = Debug|Win32 + {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Release.ActiveCfg = Release|Win32 + {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Release.Build.0 = Release|Win32 + {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Debug.ActiveCfg = Debug|Win32 + {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Debug.Build.0 = Debug|Win32 + {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Release.ActiveCfg = Release|Win32 + {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/in_mp4.vcproj +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/in_mp4.vcproj @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/mbs.h +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/mbs.h @@ -0,0 +1,81 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001-2002. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#ifndef __MBS_INCLUDED__ +#define __MBS_INCLUDED__ + +class CMemoryBitstream { +public: + CMemoryBitstream() { + m_pBuf = NULL; + m_bitPos = 0; + m_numBits = 0; + } + + void AllocBytes(u_int32_t numBytes); + + void SetBytes(u_int8_t* pBytes, u_int32_t numBytes); + + void PutBytes(u_int8_t* pBytes, u_int32_t numBytes); + + void PutBits(u_int32_t bits, u_int32_t numBits); + + u_int32_t GetBits(u_int32_t numBits); + + void SkipBytes(u_int32_t numBytes) { + SkipBits(numBytes << 3); + } + + void SkipBits(u_int32_t numBits) { + SetBitPosition(GetBitPosition() + numBits); + } + + u_int32_t GetBitPosition() { + return m_bitPos; + } + + void SetBitPosition(u_int32_t bitPos) { + if (bitPos > m_numBits) { + throw; + } + m_bitPos = bitPos; + } + + u_int8_t* GetBuffer() { + return m_pBuf; + } + + u_int32_t GetNumberOfBytes() { + return (GetNumberOfBits() + 7) / 8; + } + + u_int32_t GetNumberOfBits() { + return m_numBits; + } + +protected: + u_int8_t* m_pBuf; + u_int32_t m_bitPos; + u_int32_t m_numBits; +}; + +#endif /* __MBS_INCLUDED__ */ + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/out.h +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/out.h @@ -0,0 +1,52 @@ +#define OUT_VER 0x10 + +typedef struct +{ + int version; // module version (OUT_VER) + char *description; // description of module, with version string + int id; // module id. each input module gets its own. non-nullsoft modules should + // be >= 65536. + + HWND hMainWindow; // winamp's main window (filled in by winamp) + HINSTANCE hDllInstance; // DLL instance handle (filled in by winamp) + + void (*Config)(HWND hwndParent); // configuration dialog + void (*About)(HWND hwndParent); // about dialog + + void (*Init)(); // called when loaded + void (*Quit)(); // called when unloaded + + int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms); + // returns >=0 on success, <0 on failure + // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins. + // ... so don't expect the max latency returned to be what you asked for. + // returns max latency in ms (0 for diskwriters, etc) + // bufferlenms and prebufferms must be in ms. 0 to use defaults. + // prebufferms must be <= bufferlenms + + void (*Close)(); // close the ol' output device. + + int (*Write)(char *buf, int len); + // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data. + // 1 returns not able to write (yet). Non-blocking, always. + + int (*CanWrite)(); // returns number of bytes possible to write at a given time. + // Never will decrease unless you call Write (or Close, heh) + + int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be + // written (i.e. closing while IsPlaying() returns 1 would truncate the song + + int (*Pause)(int pause); // returns previous pause state + + void (*SetVolume)(int volume); // volume is 0-255 + void (*SetPan)(int pan); // pan is -128 to 128 + + void (*Flush)(int t); // flushes buffers and restarts output at time t (in ms) + // (used for seeking) + + int (*GetOutputTime)(); // returns played time in MS + int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff) + +} Out_Module; + + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/resource.h +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/resource.h @@ -0,0 +1,68 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by in_mp4.rc +// +#define IDD_INFO 101 +#define IDD_CONFIG 102 +#define IDC_TYPE 1000 +#define IDC_INFOTEXT 1000 +#define IDC_DURATION 1001 +#define IDC_BITRATE 1002 +#define IDC_SAMPLERATE 1003 +#define IDC_VTYPE 1004 +#define IDC_PRIORITY 1004 +#define IDC_VBITRATE 1005 +#define IDC_ERROR 1005 +#define IDC_VDURATION 1006 +#define IDC_16BITS 1006 +#define IDC_VSIZE 1007 +#define IDC_24BITS 1007 +#define IDC_CONVERT 1007 +#define IDC_VFPS 1008 +#define IDC_32BITS 1008 +#define IDC_CONVERT2 1008 +#define IDC_CHANNELS 1009 +#define IDC_24BITS2 1009 +#define IDC_16BITS_DITHERED 1009 +#define IDC_CONVERT1 1009 +#define IDC_USERDATA 1010 +#define IDC_USEFORAAC 1011 +#define IDC_METACOMPILATION 1012 +#define IDC_METANAME 1013 +#define IDC_METAARTIST 1014 +#define IDC_METAWRITER 1015 +#define IDC_METAALBUM 1016 +#define IDC_METACOMMENTS 1017 +#define IDC_METAGENRE 1018 +#define IDC_METAYEAR 1019 +#define IDC_METATRACK1 1020 +#define IDC_METADISK1 1021 +#define IDC_METATEMPO 1022 +#define IDC_METATRACK2 1023 +#define IDC_METADISK2 1024 +#define IDC_STATIC1 1025 +#define IDC_STATIC2 1026 +#define IDC_STATIC3 1027 +#define IDC_STATIC4 1028 +#define IDC_STATIC5 1029 +#define IDC_STATIC6 1030 +#define IDC_STATIC7 1031 +#define IDC_STATIC8 1032 +#define IDC_STATIC9 1033 +#define IDC_STATIC10 1034 +#define IDC_STATIC11 1035 +#define IDC_STATIC12 1036 +#define IDC_DOWNMIX 1038 +#define IDC_VBR 1039 +#define IDC_TITLEFORMAT 1040 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1041 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/utils.c +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/utils.c @@ -0,0 +1,151 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: utils.c,v 1.9 2004/10/18 19:25:00 menno Exp $ +**/ + +#define WIN32_LEAN_AND_MEAN +#include +#include +//#include +#include +#include +#include "utils.h" + +int StringComp(char const *str1, char const *str2, unsigned long len) +{ + signed int c1 = 0, c2 = 0; + + while (len--) + { + c1 = tolower(*str1++); + c2 = tolower(*str2++); + + if (c1 == 0 || c1 != c2) + break; + } + + return c1 - c2; +} + +int GetAACTrack(mp4ff_t *infile) +{ + /* find AAC track */ + int i, rc; + int numTracks = mp4ff_total_tracks(infile); + + for (i = 0; i < numTracks; i++) + { + unsigned char *buff = NULL; + int buff_size = 0; + mp4AudioSpecificConfig mp4ASC; + + mp4ff_get_decoder_config(infile, i, &buff, &buff_size); + + if (buff) + { + rc = faacDecAudioSpecificConfig(buff, buff_size, &mp4ASC); + free(buff); + + if (rc < 0) + continue; + return i; + } + } + + /* can't decode this */ + return -1; +} + +#if 0 +int GetAudioTrack(MP4FileHandle infile) +{ + /* find AAC track */ + int i; + int numTracks = MP4GetNumberOfTracks(infile, NULL, 0); + + for (i = 0; i < numTracks; i++) + { + MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0); + const char* trackType = MP4GetTrackType(infile, trackId); + + if (!strcmp(trackType, MP4_AUDIO_TRACK_TYPE)) + { + return trackId; + } + } + + /* can't decode this */ + return -1; +} + +int GetVideoTrack(MP4FileHandle infile) +{ + /* find AAC track */ + int i; + int numTracks = MP4GetNumberOfTracks(infile, NULL, 0); + + for (i = 0; i < numTracks; i++) + { + MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0); + const char* trackType = MP4GetTrackType(infile, trackId); + + if (!strcmp(trackType, MP4_VIDEO_TRACK_TYPE)) + { + return trackId; + } + } + + /* can't decode this */ + return -1; +} +#endif + +LPTSTR PathFindFileName(LPCTSTR pPath) +{ + LPCTSTR pT; + + for (pT = pPath; *pPath; pPath = CharNext(pPath)) { + if ((pPath[0] == TEXT('\\') || pPath[0] == TEXT(':')) && pPath[1] && (pPath[1] != TEXT('\\'))) + pT = pPath + 1; + } + + return (LPTSTR)pT; // const -> non const +} + +char *convert3in4to3in3(void *sample_buffer, int samples) +{ + int i; + long *sample_buffer24 = (long*)sample_buffer; + char *data = malloc(samples*3*sizeof(char)); + + for (i = 0; i < samples; i++) + { + data[i*3] = sample_buffer24[i] & 0xFF; + data[i*3+1] = (sample_buffer24[i] >> 8) & 0xFF; + data[i*3+2] = (sample_buffer24[i] >> 16) & 0xFF; + } + + return data; +} --- vlc-0.8.4.debian.orig/extras/faad2/plugins/in_mp4/utils.h +++ vlc-0.8.4.debian/extras/faad2/plugins/in_mp4/utils.h @@ -0,0 +1,41 @@ +/* +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: utils.h,v 1.4 2004/09/03 19:38:32 menno Exp $ +**/ + +#ifndef UTILS_INCLUDED +#define UTILS_INCLUDED + +//#include +#include + +LPTSTR PathFindFileName(LPCTSTR pPath); +//int GetVideoTrack(MP4FileHandle infile); +//int GetAudioTrack(MP4FileHandle infile); +int GetAACTrack(mp4ff_t *infile); +int StringComp(char const *str1, char const *str2, unsigned long len); +char *convert3in4to3in3(void *sample_buffer, int samples); + +#endif \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/mpeg4ip/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/plugins/mpeg4ip/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.8.5 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,6 +14,8 @@ @SET_MAKE@ +SOURCES = $(faad2_plugin_la_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -21,7 +23,6 @@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,6 +37,46 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ +subdir = plugins/mpeg4ip +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +faad2_plugin_la_DEPENDENCIES = $(top_builddir)/libfaad/libfaad.la +am_faad2_plugin_la_OBJECTS = faad2.lo aa_file.lo +faad2_plugin_la_OBJECTS = $(am_faad2_plugin_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/aa_file.Plo ./$(DEPDIR)/faad2.Plo +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(faad2_plugin_la_SOURCES) +DIST_SOURCES = $(faad2_plugin_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -45,6 +86,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -66,6 +109,8 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ @@ -91,12 +136,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ XMMS_CONFIG = @XMMS_CONFIG@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ @@ -104,6 +152,7 @@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -119,7 +168,6 @@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ -external_mp4v2 = @external_mp4v2@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -132,6 +180,7 @@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -139,7 +188,6 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ - lib_LTLIBRARIES = faad2_plugin.la faad2_plugin_la_LDFLAGS = -module faad2_plugin_la_SOURCES = \ @@ -148,69 +196,54 @@ aa_file.cpp \ aa_file.h - faad2_plugin_la_LIBADD = \ $(top_builddir)/libfaad/libfaad.la \ -lm - INCLUDES = -I$(top_srcdir)/include - AM_CFLAGS = -D_REENTRANT -fexceptions - AM_CXXFLAGS = -D_REENTRANT -DNOCONTROLS -fexceptions -subdir = plugins/mpeg4ip -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(lib_LTLIBRARIES) - -faad2_plugin_la_DEPENDENCIES = $(top_builddir)/libfaad/libfaad.la -am_faad2_plugin_la_OBJECTS = faad2.lo aa_file.lo -faad2_plugin_la_OBJECTS = $(am_faad2_plugin_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/aa_file.Plo ./$(DEPDIR)/faad2.Plo -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(faad2_plugin_la_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(faad2_plugin_la_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mpeg4ip/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu plugins/mpeg4ip/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -libLTLIBRARIES_INSTALL = $(INSTALL) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libdir) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done @@ -218,15 +251,15 @@ @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ + test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done @@ -234,7 +267,7 @@ $(CXXLINK) -rpath $(libdir) $(faad2_plugin_la_LDFLAGS) $(faad2_plugin_la_OBJECTS) $(faad2_plugin_la_LIBADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -243,37 +276,28 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faad2.Plo@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -285,14 +309,6 @@ -rm -f libtool uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -301,6 +317,7 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -312,10 +329,11 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -338,10 +356,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -355,7 +369,7 @@ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -373,9 +387,10 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) - installdirs: - $(mkinstalldirs) $(DESTDIR)$(libdir) + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -415,6 +430,8 @@ dvi-am: +html: html-am + info: info-am info-am: @@ -452,8 +469,8 @@ .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ --- vlc-0.8.4.debian.orig/extras/faad2/plugins/mpeg4ip/README_WIN32.txt +++ vlc-0.8.4.debian/extras/faad2/plugins/mpeg4ip/README_WIN32.txt @@ -0,0 +1,11 @@ +Creating mpeg4ip plugin for Windows. + +You will need to have mpeg4ip installed. If you install it on the same drive, with the top level directory +name of /mpeg4ip, you will have to do nothing other than move the faad2_plugin.dll from the Release or +Debug directory to the same directory as the other mpeg4ip plugins. + +If you install it somewhere else, you will have to change the include paths and link paths in the project +settings for faad2_plugin to the proper directory. Look for /mpeg4ip (or \mpeg4ip) and change all occurances +of these in the file. + +It might be best to hand-edit the faad_plugin.sdp file with wordpad and use the search and replace function. \ No newline at end of file --- vlc-0.8.4.debian.orig/extras/faad2/plugins/mpeg4ip/faad2_plugin.dsp +++ vlc-0.8.4.debian/extras/faad2/plugins/mpeg4ip/faad2_plugin.dsp @@ -0,0 +1,107 @@ +# Microsoft Developer Studio Project File - Name="faad2_plugin" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=faad2_plugin - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "faad2_plugin.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "faad2_plugin.mak" CFG="faad2_plugin - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "faad2_plugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "faad2_plugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "faad2_plugin - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /I "/mpeg4ip/include" /I "/mpeg4ip/player/src" /I "/mpeg4ip/player/lib/mp4util" /I "/mpeg4ip/lib/sdp" /I "/mpeg4ip/lib/SDL/include" /I "/mpeg4ip/lib/mp4v2" /D "_WINDOWS" /D "_WIN32" /D "WIN32" /D "NDEBUG" /YX /FD /I /mpeg4ip/include" /I /mpeg4ip/player/src" /I /mpeg4ip/lib/sdp" /I /mpeg4ip/player/lib/mp4util" /I /mpeg4ip/lib/SDL/include" " " " " " /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \mpeg4ip\player\lib\mp4util\Release\libmp4util60.lib \mpeg4ip\lib\bitstream\Release\bitstream60.lib /nologo /subsystem:windows /dll /machine:I386 /nodefaultlib:"libcmt.lib" /nodefaultlib:"libc.lib" + +!ELSEIF "$(CFG)" == "faad2_plugin - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /I "/mpeg4ip/include" /I "/mpeg4ip/player/src" /I "/mpeg4ip/player/lib/mp4util" /I "/mpeg4ip/lib/sdp" /I "/mpeg4ip/lib/SDL/include" /I "/mpeg4ip/lib/mp4v2" /D "_WINDOWS" /D "_WIN32" /D "WIN32" /D "_DEBUG" /YX /FD /I /mpeg4ip/lib/mp4v2" /I /mpeg4ip/lib/SDL" /I /mpeg4ip/include" /I /mpeg4ip/player/src" /I /mpeg4ip/lib/sdp" /I /mpeg4ip/player/lib/mp4util" /I /mpeg4ip/lib/SDL/include" " " " " " " " /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \mpeg4ip\player\lib\mp4util\Debug\libmp4util60.lib \mpeg4ip\lib\bitstream\Debug\bitstream60.lib /nologo /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libcd.lib" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "faad2_plugin - Win32 Release" +# Name "faad2_plugin - Win32 Debug" +# Begin Source File + +SOURCE=.\aa_file.cpp +# End Source File +# Begin Source File + +SOURCE=.\aa_file.h +# End Source File +# Begin Source File + +SOURCE=.\faad2.cpp +# End Source File +# Begin Source File + +SOURCE=.\faad2.h +# End Source File +# End Target +# End Project --- vlc-0.8.4.debian.orig/extras/faad2/plugins/mpeg4ip/faad2_plugin.dsw +++ vlc-0.8.4.debian/extras/faad2/plugins/mpeg4ip/faad2_plugin.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "faad2_plugin"=.\faad2_plugin.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libfaad + End Project Dependency +}}} + +############################################################################### + +Project: "libfaad"=..\..\libfaad\libfaad.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + --- vlc-0.8.4.debian.orig/extras/faad2/plugins/xmms/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/plugins/xmms/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.8.5 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -21,7 +20,6 @@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,6 +34,28 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ +subdir = plugins/xmms +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + AUTHORS ChangeLog INSTALL NEWS TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -45,6 +65,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -66,6 +88,8 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ @@ -91,12 +115,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ XMMS_CONFIG = @XMMS_CONFIG@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ @@ -104,6 +131,7 @@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -119,7 +147,6 @@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ -external_mp4v2 = @external_mp4v2@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -132,6 +159,7 @@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -140,29 +168,38 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = src -subdir = plugins/xmms -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = README $(srcdir)/Makefile.in AUTHORS ChangeLog INSTALL \ - Makefile.am NEWS TODO -DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/xmms/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu plugins/xmms/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo @@ -233,14 +270,6 @@ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -249,19 +278,22 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ + empty_fix=.; \ else \ include_option=--include; \ + empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ + test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -271,10 +303,11 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -297,10 +330,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -314,7 +343,7 @@ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -331,13 +360,13 @@ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ + test -d "$(distdir)/$$subdir" \ + || mkdir "$(distdir)/$$subdir" \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ + top_distdir="../$(top_distdir)" \ + distdir="../$(distdir)/$$subdir" \ distdir) \ || exit 1; \ fi; \ @@ -347,7 +376,6 @@ all-am: Makefile installdirs: installdirs-recursive installdirs-am: - install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -385,6 +413,8 @@ dvi-am: +html: html-recursive + info: info-recursive info-am: @@ -419,22 +449,18 @@ uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. --- vlc-0.8.4.debian.orig/extras/faad2/plugins/xmms/src/Makefile.am +++ vlc-0.8.4.debian/extras/faad2/plugins/xmms/src/Makefile.am @@ -5,7 +5,7 @@ -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4ff libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la \ - $(top_builddir)/common/mp4ff/libmp4ff.a + $(top_builddir)/common/mp4ff/libmp4ff.la libmp4_la_LDFLAGS = -module -avoid-version `$(XMMS_CONFIG) --libs` -lpthread --- vlc-0.8.4.debian.orig/extras/faad2/plugins/xmms/src/Makefile.in +++ vlc-0.8.4.debian/extras/faad2/plugins/xmms/src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.8.5 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,6 +14,8 @@ @SET_MAKE@ +SOURCES = $(libmp4_la_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -21,7 +23,6 @@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,6 +37,42 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ +subdir = plugins/xmms/src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libmp4_la_DEPENDENCIES = $(top_builddir)/libfaad/libfaad.la \ + $(top_builddir)/common/mp4ff/libmp4ff.la +am_libmp4_la_OBJECTS = libmp4_la-libmp4.lo libmp4_la-mp4_utils.lo \ + libmp4_la-aac_utils.lo +libmp4_la_OBJECTS = $(am_libmp4_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/libmp4_la-aac_utils.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/libmp4_la-libmp4.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/libmp4_la-mp4_utils.Plo +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libmp4_la_SOURCES) +DIST_SOURCES = $(libmp4_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -45,6 +82,8 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BMP_CFLAGS = @BMP_CFLAGS@ +BMP_LIBS = @BMP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -66,6 +105,8 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GTK_CONFIG = @GTK_CONFIG@ +HAVE_BMP_FALSE = @HAVE_BMP_FALSE@ +HAVE_BMP_TRUE = @HAVE_BMP_TRUE@ HAVE_MPEG4IP_PLUG_FALSE = @HAVE_MPEG4IP_PLUG_FALSE@ HAVE_MPEG4IP_PLUG_TRUE = @HAVE_MPEG4IP_PLUG_TRUE@ HAVE_XMMS_FALSE = @HAVE_XMMS_FALSE@ @@ -91,12 +132,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ XMMS_CONFIG = @XMMS_CONFIG@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ @@ -104,6 +148,7 @@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -119,7 +164,6 @@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ -external_mp4v2 = @external_mp4v2@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -132,6 +176,7 @@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -140,66 +185,55 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ lib_LTLIBRARIES = libmp4.la - libmp4_la_CFLAGS = `$(XMMS_CONFIG) --cflags` -Wall \ -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4ff - libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la \ - $(top_builddir)/common/mp4ff/libmp4ff.a - + $(top_builddir)/common/mp4ff/libmp4ff.la libmp4_la_LDFLAGS = -module -avoid-version `$(XMMS_CONFIG) --libs` -lpthread - libmp4_la_SOURCES = libmp4.c mp4_utils.c aac_utils.c -subdir = plugins/xmms/src -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(lib_LTLIBRARIES) - -libmp4_la_DEPENDENCIES = $(top_builddir)/libfaad/libfaad.la \ - $(top_builddir)/common/mp4ff/libmp4ff.a -am_libmp4_la_OBJECTS = libmp4_la-libmp4.lo libmp4_la-mp4_utils.lo \ - libmp4_la-aac_utils.lo -libmp4_la_OBJECTS = $(am_libmp4_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/libmp4_la-aac_utils.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/libmp4_la-libmp4.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/libmp4_la-mp4_utils.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libmp4_la_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libmp4_la_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/xmms/src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu plugins/xmms/src/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -libLTLIBRARIES_INSTALL = $(INSTALL) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libdir) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done @@ -207,15 +241,15 @@ @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ + test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done @@ -223,7 +257,7 @@ $(LINK) -rpath $(libdir) $(libmp4_la_LDFLAGS) $(libmp4_la_OBJECTS) $(libmp4_la_LIBADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -233,132 +267,96 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp4_la-mp4_utils.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libmp4_la-libmp4.o: libmp4.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-libmp4.o -MD -MP -MF "$(DEPDIR)/libmp4_la-libmp4.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4_la-libmp4.o `test -f 'libmp4.c' || echo '$(srcdir)/'`libmp4.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-libmp4.Tpo" "$(DEPDIR)/libmp4_la-libmp4.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4_la-libmp4.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-libmp4.o -MD -MP -MF "$(DEPDIR)/libmp4_la-libmp4.Tpo" -c -o libmp4_la-libmp4.o `test -f 'libmp4.c' || echo '$(srcdir)/'`libmp4.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-libmp4.Tpo" "$(DEPDIR)/libmp4_la-libmp4.Po"; else rm -f "$(DEPDIR)/libmp4_la-libmp4.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libmp4.c' object='libmp4_la-libmp4.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-libmp4.Po' tmpdepfile='$(DEPDIR)/libmp4_la-libmp4.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-libmp4.o `test -f 'libmp4.c' || echo '$(srcdir)/'`libmp4.c libmp4_la-libmp4.obj: libmp4.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-libmp4.obj -MD -MP -MF "$(DEPDIR)/libmp4_la-libmp4.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4_la-libmp4.obj `if test -f 'libmp4.c'; then $(CYGPATH_W) 'libmp4.c'; else $(CYGPATH_W) '$(srcdir)/libmp4.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-libmp4.Tpo" "$(DEPDIR)/libmp4_la-libmp4.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4_la-libmp4.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-libmp4.obj -MD -MP -MF "$(DEPDIR)/libmp4_la-libmp4.Tpo" -c -o libmp4_la-libmp4.obj `if test -f 'libmp4.c'; then $(CYGPATH_W) 'libmp4.c'; else $(CYGPATH_W) '$(srcdir)/libmp4.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-libmp4.Tpo" "$(DEPDIR)/libmp4_la-libmp4.Po"; else rm -f "$(DEPDIR)/libmp4_la-libmp4.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libmp4.c' object='libmp4_la-libmp4.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-libmp4.Po' tmpdepfile='$(DEPDIR)/libmp4_la-libmp4.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-libmp4.obj `if test -f 'libmp4.c'; then $(CYGPATH_W) 'libmp4.c'; else $(CYGPATH_W) '$(srcdir)/libmp4.c'; fi` libmp4_la-libmp4.lo: libmp4.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-libmp4.lo -MD -MP -MF "$(DEPDIR)/libmp4_la-libmp4.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4_la-libmp4.lo `test -f 'libmp4.c' || echo '$(srcdir)/'`libmp4.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-libmp4.Tpo" "$(DEPDIR)/libmp4_la-libmp4.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4_la-libmp4.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-libmp4.lo -MD -MP -MF "$(DEPDIR)/libmp4_la-libmp4.Tpo" -c -o libmp4_la-libmp4.lo `test -f 'libmp4.c' || echo '$(srcdir)/'`libmp4.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-libmp4.Tpo" "$(DEPDIR)/libmp4_la-libmp4.Plo"; else rm -f "$(DEPDIR)/libmp4_la-libmp4.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libmp4.c' object='libmp4_la-libmp4.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-libmp4.Plo' tmpdepfile='$(DEPDIR)/libmp4_la-libmp4.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-libmp4.lo `test -f 'libmp4.c' || echo '$(srcdir)/'`libmp4.c libmp4_la-mp4_utils.o: mp4_utils.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-mp4_utils.o -MD -MP -MF "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4_la-mp4_utils.o `test -f 'mp4_utils.c' || echo '$(srcdir)/'`mp4_utils.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" "$(DEPDIR)/libmp4_la-mp4_utils.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-mp4_utils.o -MD -MP -MF "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" -c -o libmp4_la-mp4_utils.o `test -f 'mp4_utils.c' || echo '$(srcdir)/'`mp4_utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" "$(DEPDIR)/libmp4_la-mp4_utils.Po"; else rm -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4_utils.c' object='libmp4_la-mp4_utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-mp4_utils.Po' tmpdepfile='$(DEPDIR)/libmp4_la-mp4_utils.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-mp4_utils.o `test -f 'mp4_utils.c' || echo '$(srcdir)/'`mp4_utils.c libmp4_la-mp4_utils.obj: mp4_utils.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-mp4_utils.obj -MD -MP -MF "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4_la-mp4_utils.obj `if test -f 'mp4_utils.c'; then $(CYGPATH_W) 'mp4_utils.c'; else $(CYGPATH_W) '$(srcdir)/mp4_utils.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" "$(DEPDIR)/libmp4_la-mp4_utils.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-mp4_utils.obj -MD -MP -MF "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" -c -o libmp4_la-mp4_utils.obj `if test -f 'mp4_utils.c'; then $(CYGPATH_W) 'mp4_utils.c'; else $(CYGPATH_W) '$(srcdir)/mp4_utils.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" "$(DEPDIR)/libmp4_la-mp4_utils.Po"; else rm -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4_utils.c' object='libmp4_la-mp4_utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-mp4_utils.Po' tmpdepfile='$(DEPDIR)/libmp4_la-mp4_utils.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-mp4_utils.obj `if test -f 'mp4_utils.c'; then $(CYGPATH_W) 'mp4_utils.c'; else $(CYGPATH_W) '$(srcdir)/mp4_utils.c'; fi` libmp4_la-mp4_utils.lo: mp4_utils.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-mp4_utils.lo -MD -MP -MF "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4_la-mp4_utils.lo `test -f 'mp4_utils.c' || echo '$(srcdir)/'`mp4_utils.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" "$(DEPDIR)/libmp4_la-mp4_utils.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-mp4_utils.lo -MD -MP -MF "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" -c -o libmp4_la-mp4_utils.lo `test -f 'mp4_utils.c' || echo '$(srcdir)/'`mp4_utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo" "$(DEPDIR)/libmp4_la-mp4_utils.Plo"; else rm -f "$(DEPDIR)/libmp4_la-mp4_utils.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mp4_utils.c' object='libmp4_la-mp4_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-mp4_utils.Plo' tmpdepfile='$(DEPDIR)/libmp4_la-mp4_utils.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-mp4_utils.lo `test -f 'mp4_utils.c' || echo '$(srcdir)/'`mp4_utils.c libmp4_la-aac_utils.o: aac_utils.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-aac_utils.o -MD -MP -MF "$(DEPDIR)/libmp4_la-aac_utils.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4_la-aac_utils.o `test -f 'aac_utils.c' || echo '$(srcdir)/'`aac_utils.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo" "$(DEPDIR)/libmp4_la-aac_utils.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-aac_utils.o -MD -MP -MF "$(DEPDIR)/libmp4_la-aac_utils.Tpo" -c -o libmp4_la-aac_utils.o `test -f 'aac_utils.c' || echo '$(srcdir)/'`aac_utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo" "$(DEPDIR)/libmp4_la-aac_utils.Po"; else rm -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aac_utils.c' object='libmp4_la-aac_utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-aac_utils.Po' tmpdepfile='$(DEPDIR)/libmp4_la-aac_utils.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-aac_utils.o `test -f 'aac_utils.c' || echo '$(srcdir)/'`aac_utils.c libmp4_la-aac_utils.obj: aac_utils.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-aac_utils.obj -MD -MP -MF "$(DEPDIR)/libmp4_la-aac_utils.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4_la-aac_utils.obj `if test -f 'aac_utils.c'; then $(CYGPATH_W) 'aac_utils.c'; else $(CYGPATH_W) '$(srcdir)/aac_utils.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo" "$(DEPDIR)/libmp4_la-aac_utils.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-aac_utils.obj -MD -MP -MF "$(DEPDIR)/libmp4_la-aac_utils.Tpo" -c -o libmp4_la-aac_utils.obj `if test -f 'aac_utils.c'; then $(CYGPATH_W) 'aac_utils.c'; else $(CYGPATH_W) '$(srcdir)/aac_utils.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo" "$(DEPDIR)/libmp4_la-aac_utils.Po"; else rm -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aac_utils.c' object='libmp4_la-aac_utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-aac_utils.Po' tmpdepfile='$(DEPDIR)/libmp4_la-aac_utils.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -c -o libmp4_la-aac_utils.obj `if test -f 'aac_utils.c'; then $(CYGPATH_W) 'aac_utils.c'; else $(CYGPATH_W) '$(srcdir)/aac_utils.c'; fi` libmp4_la-aac_utils.lo: aac_utils.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-aac_utils.lo -MD -MP -MF "$(DEPDIR)/libmp4_la-aac_utils.Tpo" \ -@am__fastdepCC_TRUE@ -c -o libmp4_la-aac_utils.lo `test -f 'aac_utils.c' || echo '$(srcdir)/'`aac_utils.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo" "$(DEPDIR)/libmp4_la-aac_utils.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp4_la_CFLAGS) $(CFLAGS) -MT libmp4_la-aac_utils.lo -MD -MP -MF "$(DEPDIR)/libmp4_la-aac_utils.Tpo" -c -o libmp4_la-aac_utils.lo `test -f 'aac_utils.c' || echo '$(srcdir)/'`aac_utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo" "$(DEPDIR)/libmp4_la-aac_utils.Plo"; else rm -f "$(DEPDIR)/libmp4_la-aac_utils.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aac_utils.c' object='libmp4_la-aac_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libmp4_la-aac_utils.Plo' tmpdepfile='$(DEPDIR)/libmp4_la-aac_utils.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @@ -374,14 +372,6 @@ -rm -f libtool uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -390,6 +380,7 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -401,10 +392,11 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -427,10 +419,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -444,7 +432,7 @@ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -462,9 +450,10 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) - installdirs: - $(mkinstalldirs) $(DESTDIR)$(libdir) + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -504,6 +493,8 @@ dvi-am: +html: html-am + info: info-am info-am: @@ -541,8 +532,8 @@ .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ --- vlc-0.8.4.debian.orig/extras/faad2/plugins/xmms/src/libmp4.c +++ vlc-0.8.4.debian/extras/faad2/plugins/xmms/src/libmp4.c @@ -16,7 +16,7 @@ #include #include -#include "neaacdec.h" +#include "faad.h" #include "mp4ff.h" #define MP4_DESCRIPTION "MP4 & MPEG2/4-AAC audio player - 1.2.x" @@ -280,7 +280,7 @@ pthread_mutex_unlock(&mutex); pthread_exit(NULL); }else{ - NeAACDecHandle decoder; + faacDecHandle decoder; unsigned char *buffer = NULL; guint bufferSize = 0; gulong samplerate; @@ -294,14 +294,14 @@ mp4AudioSpecificConfig mp4ASC; gchar *xmmstitle; - decoder = NeAACDecOpen(); + decoder = faacDecOpen(); mp4ff_get_decoder_config(infile, mp4track, &buffer, &bufferSize); - if(NeAACDecInit2(decoder, buffer, bufferSize, &samplerate, &channels)<0){ + if(faacDecInit2(decoder, buffer, bufferSize, &samplerate, &channels)<0){ goto end; } if(buffer){ framesize = 1024; - if(NeAACDecAudioSpecificConfig(buffer, bufferSize, &mp4ASC) >= 0){ + if(faacDecAudioSpecificConfig(buffer, bufferSize, &mp4ASC) >= 0){ if(mp4ASC.frameLengthFlag == 1) framesize = 960; if(mp4ASC.sbr_present_flag == 1) framesize *= 2; } @@ -366,7 +366,7 @@ mp4_ip.output->buffer_free(); goto end; }else{ - sampleBuffer = NeAACDecDecode(decoder, &frameInfo, buffer, bufferSize); + sampleBuffer = faacDecDecode(decoder, &frameInfo, buffer, bufferSize); if(frameInfo.error > 0){ g_print("MP4: %s\n", faacDecGetErrorMessage(frameInfo.error)); @@ -394,7 +394,7 @@ end: mp4_ip.output->close_audio(); g_free(args); - NeAACDecClose(decoder); + faacDecClose(decoder); if(infile) mp4ff_close(infile); if(mp4cb) g_free(mp4cb); bPlaying = FALSE; @@ -405,7 +405,7 @@ }else{ // WE ARE READING AN AAC FILE FILE *file = NULL; - NeAACDecHandle decoder = 0; + faacDecHandle decoder = 0; guchar *buffer = 0; gulong bufferconsumed = 0; gulong samplerate = 0; @@ -415,7 +415,7 @@ gchar *temp = g_strdup(args); gchar *ext = strrchr(temp, '.'); gchar *xmmstitle = NULL; - NeAACDecConfigurationPtr config; + faacDecConfigurationPtr config; if((file = fopen(args, "rb")) == 0){ g_print("AAC: can't find file %s\n", args); @@ -423,21 +423,21 @@ pthread_mutex_unlock(&mutex); pthread_exit(NULL); } - if((decoder = NeAACDecOpen()) == NULL){ + if((decoder = faacDecOpen()) == NULL){ g_print("AAC: Open Decoder Error\n"); fclose(file); bPlaying = FALSE; pthread_mutex_unlock(&mutex); pthread_exit(NULL); } - config = NeAACDecGetCurrentConfiguration(decoder); + config = faacDecGetCurrentConfiguration(decoder); config->useOldADTSFormat = 0; - NeAACDecSetConfiguration(decoder, config); + faacDecSetConfiguration(decoder, config); if((buffer = g_malloc(BUFFER_SIZE)) == NULL){ g_print("AAC: error g_malloc\n"); fclose(file); bPlaying = FALSE; - NeAACDecClose(decoder); + faacDecClose(decoder); pthread_mutex_unlock(&mutex); pthread_exit(NULL); } @@ -446,7 +446,7 @@ g_free(buffer); fclose(file); bPlaying = FALSE; - NeAACDecClose(decoder); + faacDecClose(decoder); pthread_mutex_unlock(&mutex); pthread_exit(NULL); } @@ -472,7 +472,7 @@ if(input->track_name) g_free(input->track_name); if(input->genre) g_free(input->genre); g_free(input); - bufferconsumed = NeAACDecInit(decoder, + bufferconsumed = faacDecInit(decoder, buffer, buffervalid, &samplerate, @@ -501,7 +501,7 @@ mp4_ip.output->flush(0); while(bPlaying && buffervalid > 0){ - NeAACDecFrameInfo finfo; + faacDecFrameInfo finfo; unsigned long samplesdecoded; char* sample_buffer = NULL; /* @@ -520,24 +520,24 @@ BUFFER_SIZE-buffervalid, file); bufferconsumed = 0; } - sample_buffer = NeAACDecDecode(decoder, &finfo, buffer, buffervalid); + sample_buffer = faacDecDecode(decoder, &finfo, buffer, buffervalid); if(finfo.error){ - config = NeAACDecGetCurrentConfiguration(decoder); + config = faacDecGetCurrentConfiguration(decoder); if(config->useOldADTSFormat != 1){ - NeAACDecClose(decoder); - decoder = NeAACDecOpen(); - config = NeAACDecGetCurrentConfiguration(decoder); + faacDecClose(decoder); + decoder = faacDecOpen(); + config = faacDecGetCurrentConfiguration(decoder); config->useOldADTSFormat = 1; - NeAACDecSetConfiguration(decoder, config); + faacDecSetConfiguration(decoder, config); finfo.bytesconsumed=0; finfo.samples = 0; - NeAACDecInit(decoder, + faacDecInit(decoder, buffer, buffervalid, &samplerate, &channels); }else{ - g_print("FAAD2 Warning %s\n", NeAACDecGetErrorMessage(finfo.error)); + g_print("FAAD2 Warning %s\n", faacDecGetErrorMessage(finfo.error)); buffervalid = 0; } } @@ -562,7 +562,7 @@ mp4_ip.output->close_audio(); bPlaying = FALSE; g_free(buffer); - NeAACDecClose(decoder); + faacDecClose(decoder); g_free(xmmstitle); fclose(file); seekPosition = -1; --- vlc-0.8.4.debian.orig/extras/faad2/plugins/xmms/src/mp4_utils.c +++ vlc-0.8.4.debian/extras/faad2/plugins/xmms/src/mp4_utils.c @@ -62,7 +62,7 @@ printf("testing-track: %d\n", i); mp4ff_get_decoder_config(infile, i, &buff, &buff_size); if(buff){ - rc = NeAACDecAudioSpecificConfig(buff, buff_size, &mp4ASC); + rc = faacDecAudioSpecificConfig(buff, buff_size, &mp4ASC); g_free(buff); if(rc < 0) continue; --- vlc-0.8.4.debian.orig/extras/x264/AUTHORS +++ vlc-0.8.4.debian/extras/x264/AUTHORS @@ -1,4 +1,4 @@ -# $Id: AUTHORS,v 1.1 2004/06/03 19:27:06 fenrir Exp $ +# Contributors to x264 # # The format of this file was inspired by the Linux kernel CREDITS file. # Authors are listed alphabetically. @@ -6,42 +6,94 @@ # The fields are: name (N), email (E), web-address (W), CVS account login (C), # PGP key ID and fingerprint (P), description (D), and snail-mail address (S). -N: Laurent Aimar -E: fenrir AT via.ecp DOT fr -C: fenrir -D: Intial import, maintainer -D: i386 asm (mmx/mmx2) -S: France +N: Alex Izvorski +E: aizvorski AT gmail DOT com +D: x86 asm (sse2) + +N: Alex Wright +E: alexw0885 AT hotmail DOT com +D: Motion estimation (subpel and mixed refs) +D: B-RDO + +N: Andrew Dunstan +D: win64 asm port + +N: bobololo +D: Avisynth input +D: MP4 muxing + +N: Christian Heine +E: sennindemokrit AT gmx DOT net +D: x86 asm N: Eric Petit E: titer AT videolan DOT org C: titer -D: Altivec +D: Altivec asm D: BeOS and MacOS X ports. S: France -N: Min Chen -E: chenm001 AT 163 DOT com -C: chenm001 -D: Win32/VC 6.0 port -D: gcc asm to nasm conversion -D: vfw interface -S: China +N: Francesco Corriga +D: VfW N: Justin Clay E: justin_clay AT hotmail DOT com C: wheatgerm -D: Inital work on vfw +D: Inital work on VfW S: Nova Scotia, Canada -N: Måns Rullgård -E: mru AT mru.ath DOT cx -C: mru -D: Rate control -S: Oslo, Norway +N: Laurent Aimar +E: fenrir AT via.ecp DOT fr +C: fenrir +D: Intial import, former maintainer +D: x86 asm (mmx/mmx2) +S: France N: Loren Merritt E: lorenm AT u.washington DOT edu -C: ? -D: Two pass rate control -S: ? +C: pengvado +D: maintainer +D: All areas of encoder analysis and algorithms +D: Motion estimation, rate control, macroblock & frame decisions, RDO, etc. +D: Multithreading +D: x86 and x86_64 asm (mmx/mmx2/sse2) +S: USA + +N: Mans Rullgard +E: mru AT inprovide DOT com +C: mru +D: Rate control +S: Southampton, UK + +N: Michael Niedermayer +E: michaelni AT gmx DOT at +D: Rate control + +N: Mike Matsnev +E: mike AT po DOT cs DOT msu DOT su +D: Matroska muxing + +N: Min Chen +E: chenm001 AT 163 DOT com +C: chenm001 +D: Win32/VC 6.0 port +D: gcc asm to nasm conversion +D: VfW +S: China + +N: Phil Jensen +E: philj AT csufresno DOT edu +D: SPARC asm + +N: Radek Czyz +E: radoslaw AT syskin DOT cjb DOT net +D: Cached motion compensation + +N: Riccardo Stievano +E: walkunafraid AT tin DOT it +D: VfW + +N: Tuukka Toivonen +E: tuukkat AT ee DOT oulu DOT fi +D: Visualization + --- vlc-0.8.4.debian.orig/extras/x264/Makefile +++ vlc-0.8.4.debian/extras/x264/Makefile @@ -24,11 +24,12 @@ common/i386/pixel-sse2.asm common/i386/quant-a.asm \ common/i386/deblock-a.asm OBJASM = $(ASMSRC:%.asm=%.o) +ASFLAGS += -Icommon/i386/ endif # MMX/SSE optims ifeq ($(ARCH),X86_64) -SRCS += common/i386/mc-c.c common/i386/dct-c.c common/i386/predict.c +SRCS += common/i386/mc-c.c common/i386/dct-c.c common/amd64/predict.c ASMSRC = common/amd64/dct-a.asm common/amd64/cpu-a.asm \ common/amd64/pixel-a.asm common/amd64/mc-a.asm \ common/amd64/mc-a2.asm common/amd64/predict-a.asm \ @@ -51,14 +52,12 @@ ifneq ($(HAVE_GETOPT_LONG),1) SRCS += extras/getopt.c -CFLAGS += -DHAVE_GETOPT_LONG=0 -else -CFLAGS += -DHAVE_GETOPT_LONG=1 endif OBJS = $(SRCS:%.c=%.o) DEP = depend +.PHONY: default fprofiled clean distclean install uninstall default: $(DEP) x264$(EXE) libx264.a: .depend $(OBJS) $(OBJASM) @@ -75,30 +74,58 @@ $(CC) -o $@ $< libx264.a $(LDFLAGS) common/amd64/*.o: common/amd64/amd64inc.asm +common/i386/*.o: common/i386/i386inc.asm %.o: %.asm $(AS) $(ASFLAGS) -o $@ $< -.depend: config.mak config.h +.depend: config.mak rm -f .depend # Hacky - because gcc 2.9x doesn't have -MT $(foreach SRC, $(SRCS) x264.c matroska.c, ( echo -n "`dirname $(SRC)`/" && $(CC) $(CFLAGS) $(SRC) -MM -g0 ) 1>> .depend;) -config.h: $(wildcard .svn/entries */.svn/entries */*/.svn/entries) - ./version.sh +config.mak: $(wildcard .svn/entries */.svn/entries */*/.svn/entries) + ./configure $(CONFIGURE_ARGS) depend: .depend ifneq ($(wildcard .depend),) include .depend endif +SRC2 = $(SRCS) x264.c matroska.c +# These should cover most of the important codepaths +OPT0 = --crf 30 -b1 -m1 -r1 --me dia --no-cabac +OPT1 = --crf 18 -b2 -m3 -r3 --me hex -8 --cqm jvt --direct spatial +OPT2 = --crf 24 -b3 -m6 -r6 --me umh -8 -w -t1 -A all --b-pyramid --b-rdo --mixed-refs + +ifeq (,$(VIDS)) +fprofiled: + @echo 'usage: make fprofiled VIDS="infile1 infile2 ..."' + @echo 'where infiles are anything that x264 understands,' + @echo 'i.e. YUV with resolution in the filename, or avisynth.' +else +fprofiled: + make clean + mv config.mak config.mak2 + sed -e 's/CFLAGS.*/& -fprofile-generate/; s/LDFLAGS.*/& -fprofile-generate/' config.mak2 > config.mak + make x264$(EXE) + $(foreach V, $(VIDS), $(foreach I, 0 1 2, ./x264$(EXE) $(OPT$I) $(V) --progress -o $(DEVNULL) ;)) + rm -f $(SRC2:%.c=%.o) + sed -e 's/CFLAGS.*/& -fprofile-use/; s/LDFLAGS.*/& -fprofile-use/' config.mak2 > config.mak + make + rm -f $(SRC2:%.c=%.gcda) $(SRC2:%.c=%.gcno) + mv config.mak2 config.mak +endif + clean: - rm -f $(OBJS) $(OBJASM) config.h *.a x264.o matroska.o x264 x264.exe .depend TAGS x264.pc + rm -f $(OBJS) $(OBJASM) *.a x264.o matroska.o x264 x264.exe .depend TAGS rm -f checkasm checkasm.exe tools/checkasm.o rm -f tools/avc2avi tools/avc2avi.exe tools/avc2avi.o rm -rf vfw/build/cygwin/bin + rm -f $(SRC2:%.c=%.gcda) $(SRC2:%.c=%.gcno) + - sed -e 's/ *-fprofile-\(generate\|use\)//g' config.mak > config.mak2 && mv config.mak2 config.mak distclean: clean - rm -f config.mak vfw/build/cygwin/config.mak + rm -f config.mak config.h vfw/build/cygwin/config.mak x264.pc install: x264 install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir) @@ -109,7 +136,6 @@ install x264 $(DESTDIR)$(bindir) ranlib $(DESTDIR)$(libdir)/libx264.a -.PHONY: uninstall uninstall: rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a rm -f $(DESTDIR)$(bindir)/x264 $(DESTDIR)$(libdir)/pkgconfig/x264.pc --- vlc-0.8.4.debian.orig/extras/x264/build/win32/libx264.vcproj +++ vlc-0.8.4.debian/extras/x264/build/win32/libx264.vcproj @@ -959,6 +959,9 @@ Name="I386" Filter="*.h,*.c,*-a.asm"> + + --- vlc-0.8.4.debian.orig/extras/x264/common/amd64/amd64inc.asm +++ vlc-0.8.4.debian/extras/x264/common/amd64/amd64inc.asm @@ -258,6 +258,14 @@ %endif ;linux +; PIC support macros. On x86_64 we just use RIP-relative addressing, which is +; much simpler than the GOT handling we need to perform on x86. +; +; - GLOBAL should be used as a suffix for global addressing, eg. +; mov eax, [foo GLOBAL] +; instead of +; mov eax, [foo] +; %ifdef __PIC__ %define GLOBAL wrt rip %else --- vlc-0.8.4.debian.orig/extras/x264/common/amd64/mc-a.asm +++ vlc-0.8.4.debian/extras/x264/common/amd64/mc-a.asm @@ -70,7 +70,7 @@ cglobal x264_mc_copy_w16_mmxext cglobal x264_mc_copy_w16_sse2 -cglobal x264_mc_chroma_sse +cglobal x264_mc_chroma_mmxext ;============================================================================= ; pixel avg @@ -403,13 +403,13 @@ ALIGN 16 ;----------------------------------------------------------------------------- -; void x264_mc_chroma_sse( uint8_t *src, int i_src_stride, +; void x264_mc_chroma_mmxext( uint8_t *src, int i_src_stride, ; uint8_t *dst, int i_dst_stride, ; int dx, int dy, -; int i_height, int i_width ) +; int i_width, int i_height ) ;----------------------------------------------------------------------------- -x264_mc_chroma_sse: +x264_mc_chroma_mmxext: movd mm0, parm5d movd mm1, parm6d @@ -432,7 +432,7 @@ mov rax, parm1q mov r10, parm3q - mov r11d, parm7d + mov r11d, parm8d ALIGN 4 .height_loop @@ -468,14 +468,12 @@ dec r11d jnz .height_loop - mov eax, parm8d ; i_width - sub eax, 8 + sub parm7d, 8 jnz .finish ; width != 8 so assume 4 - mov parm8d, eax ; i_width mov r10, parm3q ; dst mov rax, parm1q ; src - mov r11d, parm7d ; i_height + mov r11d, parm8d ; i_height add r10, 4 add rax, 4 jmp .height_loop --- vlc-0.8.4.debian.orig/extras/x264/common/amd64/pixel-a.asm +++ vlc-0.8.4.debian/extras/x264/common/amd64/pixel-a.asm @@ -262,6 +262,10 @@ cglobal x264_pixel_sad_4x8_mmxext cglobal x264_pixel_sad_4x4_mmxext +cglobal x264_pixel_sad_pde_16x16_mmxext +cglobal x264_pixel_sad_pde_16x8_mmxext +cglobal x264_pixel_sad_pde_8x16_mmxext + cglobal x264_pixel_ssd_16x16_mmxext cglobal x264_pixel_ssd_16x8_mmxext cglobal x264_pixel_ssd_8x16_mmxext @@ -377,6 +381,64 @@ +%macro PDE_CHECK 0 + movd eax, mm0 + cmp eax, parm5d ; prev_score + jl .continue + ret +ALIGN 4 +.continue: +%endmacro + +ALIGN 16 +;----------------------------------------------------------------------------- +; int __cdecl x264_pixel_sad_pde_16x16_mmxext (uint8_t *, int, uint8_t *, int, int ) +;----------------------------------------------------------------------------- +x264_pixel_sad_pde_16x16_mmxext: + SAD_START + SAD_INC_2x16P + SAD_INC_2x16P + SAD_INC_2x16P + SAD_INC_2x16P + PDE_CHECK + SAD_INC_2x16P + SAD_INC_2x16P + SAD_INC_2x16P + SAD_INC_2x16P + SAD_END + +ALIGN 16 +;----------------------------------------------------------------------------- +; int __cdecl x264_pixel_sad_pde_16x8_mmxext (uint8_t *, int, uint8_t *, int, int ) +;----------------------------------------------------------------------------- +x264_pixel_sad_pde_16x8_mmxext: + SAD_START + SAD_INC_2x16P + SAD_INC_2x16P + PDE_CHECK + SAD_INC_2x16P + SAD_INC_2x16P + SAD_END + +ALIGN 16 +;----------------------------------------------------------------------------- +; int __cdecl x264_pixel_sad_pde_8x16_mmxext (uint8_t *, int, uint8_t *, int, int ) +;----------------------------------------------------------------------------- +x264_pixel_sad_pde_8x16_mmxext: + SAD_START + SAD_INC_2x8P + SAD_INC_2x8P + SAD_INC_2x8P + SAD_INC_2x8P + PDE_CHECK + SAD_INC_2x8P + SAD_INC_2x8P + SAD_INC_2x8P + SAD_INC_2x8P + SAD_END + + + %macro SSD_START 0 firstpush rbx pushreg rbx --- vlc-0.8.4.debian.orig/extras/x264/common/amd64/predict.c +++ vlc-0.8.4.debian/extras/x264/common/amd64/predict.c @@ -0,0 +1,175 @@ +/***************************************************************************** + * predict.c: h264 encoder + ***************************************************************************** + * Copyright (C) 2006 x264 project + * + * Authors: Loren Merritt + * + * 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 USA + *****************************************************************************/ + +#ifdef HAVE_STDINT_H +#include +#else +#include +#endif + +#include "common/predict.h" +#include "common/i386/predict.h" + +extern void predict_16x16_v_mmx( uint8_t *src, int i_stride ); +extern void predict_8x8c_v_mmx( uint8_t *src, int i_stride ); + +/**************************************************************************** + * 16x16 prediction for intra luma block + ****************************************************************************/ + +#define PREDICT_16x16_DC(v) \ + for( i = 0; i < 16; i++ )\ + {\ + uint64_t *p = (uint64_t*)src;\ + *p++ = v;\ + *p++ = v;\ + src += i_stride;\ + } + +static void predict_16x16_dc( uint8_t *src, int i_stride ) +{ + uint32_t s = 0; + uint64_t dc; + int i; + + /* calculate DC value */ + for( i = 0; i < 16; i++ ) + { + s += src[-1 + i * i_stride]; + s += src[i - i_stride]; + } + dc = (( s + 16 ) >> 5) * 0x0101010101010101ULL; + + PREDICT_16x16_DC(dc); +} +static void predict_16x16_dc_left( uint8_t *src, int i_stride ) +{ + uint32_t s = 0; + uint64_t dc; + int i; + + for( i = 0; i < 16; i++ ) + { + s += src[-1 + i * i_stride]; + } + dc = (( s + 8 ) >> 4) * 0x0101010101010101ULL; + + PREDICT_16x16_DC(dc); +} +static void predict_16x16_h( uint8_t *src, int i_stride ) +{ + int i; + for( i = 0; i < 16; i++ ) + { + const uint64_t v = 0x0101010101010101ULL * src[-1]; + uint64_t *p = (uint64_t*)src; + *p++ = v; + *p++ = v; + src += i_stride; + } +} + + +/**************************************************************************** + * 8x8 prediction for intra chroma block + ****************************************************************************/ + +static void predict_8x8c_dc_left( uint8_t *src, int i_stride ) +{ + int y; + uint32_t s0 = 0, s1 = 0; + uint64_t dc0, dc1; + + for( y = 0; y < 4; y++ ) + { + s0 += src[y * i_stride - 1]; + s1 += src[(y+4) * i_stride - 1]; + } + dc0 = (( s0 + 2 ) >> 2)*0x0101010101010101ULL; + dc1 = (( s1 + 2 ) >> 2)*0x0101010101010101ULL; + + for( y = 0; y < 4; y++ ) + { + *(uint64_t*)src = dc0; + src += i_stride; + } + for( y = 0; y < 4; y++ ) + { + *(uint64_t*)src = dc1; + src += i_stride; + } + +} +static void predict_8x8c_dc_top( uint8_t *src, int i_stride ) +{ + int y, x; + uint32_t s0 = 0, s1 = 0; + uint64_t dc; + + for( x = 0; x < 4; x++ ) + { + s0 += src[x - i_stride]; + s1 += src[x + 4 - i_stride]; + } + dc = (( s0 + 2 ) >> 2)*0x01010101 + + (( s1 + 2 ) >> 2)*0x0101010100000000ULL; + + for( y = 0; y < 8; y++ ) + { + *(uint64_t*)src = dc; + src += i_stride; + } +} +static void predict_8x8c_h( uint8_t *src, int i_stride ) +{ + int i; + for( i = 0; i < 8; i++ ) + { + *(uint64_t*)src = 0x0101010101010101ULL * src[-1]; + src += i_stride; + } +} + + +/**************************************************************************** + * Exported functions: + ****************************************************************************/ +void x264_predict_16x16_init_mmxext( x264_predict_t pf[7] ) +{ + pf[I_PRED_16x16_V ] = predict_16x16_v_mmx; + pf[I_PRED_16x16_H ] = predict_16x16_h; + pf[I_PRED_16x16_DC] = predict_16x16_dc; + pf[I_PRED_16x16_DC_LEFT]= predict_16x16_dc_left; +} + +void x264_predict_8x8c_init_mmxext( x264_predict_t pf[7] ) +{ + pf[I_PRED_CHROMA_V ] = predict_8x8c_v_mmx; + pf[I_PRED_CHROMA_H ] = predict_8x8c_h; + pf[I_PRED_CHROMA_DC_LEFT]= predict_8x8c_dc_left; + pf[I_PRED_CHROMA_DC_TOP ]= predict_8x8c_dc_top; +} + +void x264_predict_8x8_init_mmxext( x264_predict8x8_t pf[12] ) +{ +} + --- vlc-0.8.4.debian.orig/extras/x264/common/cabac.c +++ vlc-0.8.4.debian/extras/x264/common/cabac.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include --- vlc-0.8.4.debian.orig/extras/x264/common/common.c +++ vlc-0.8.4.debian/extras/x264/common/common.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include #include @@ -121,6 +120,7 @@ param->analyse.b_chroma_me = 1; param->analyse.i_mv_range = -1; // set from level_idc param->analyse.i_chroma_qp_offset = 0; + param->analyse.b_fast_pskip = 1; param->analyse.b_psnr = 1; param->i_cqm_preset = X264_CQM_FLAT; @@ -131,6 +131,7 @@ memset( param->cqm_8iy, 16, 64 ); memset( param->cqm_8py, 16, 64 ); + param->b_repeat_headers = 1; param->b_aud = 0; } @@ -456,19 +457,23 @@ s += sprintf( s, " cqm=%d", p->i_cqm_preset ); s += sprintf( s, " chroma_qp_offset=%d", p->analyse.i_chroma_qp_offset ); s += sprintf( s, " slices=%d", p->i_threads ); + s += sprintf( s, " nr=%d", p->analyse.i_noise_reduction ); s += sprintf( s, " bframes=%d", p->i_bframe ); if( p->i_bframe ) { - s += sprintf( s, " b_pyramid=%d b_adapt=%d b_bias=%d direct=%d wpredb=%d", + s += sprintf( s, " b_pyramid=%d b_adapt=%d b_bias=%d direct=%d wpredb=%d bime=%d", p->b_bframe_pyramid, p->b_bframe_adaptive, p->i_bframe_bias, - p->analyse.i_direct_mv_pred, p->analyse.b_weighted_bipred ); + p->analyse.i_direct_mv_pred, p->analyse.b_weighted_bipred, + p->analyse.b_bidir_me ); } s += sprintf( s, " keyint=%d keyint_min=%d scenecut=%d", p->i_keyint_max, p->i_keyint_min, p->i_scenecut_threshold ); - s += sprintf( s, " pass=%d", p->rc.b_stat_read ? 2 : 1 ); + s += sprintf( s, " rc=%s", p->rc.b_stat_read && p->rc.b_cbr ? "2pass" : + p->rc.b_cbr ? p->rc.i_vbv_buffer_size ? "cbr" : "abr" : + p->rc.i_rf_constant ? "crf" : "cqp" ); if( p->rc.b_cbr || p->rc.i_rf_constant ) { if( p->rc.i_rf_constant ) @@ -482,7 +487,7 @@ if( p->rc.b_stat_read ) s += sprintf( s, " cplxblur=%.1f qblur=%.1f", p->rc.f_complexity_blur, p->rc.f_qblur ); - if( p->rc.i_vbv_max_bitrate && p->rc.i_vbv_buffer_size ) + if( p->rc.i_vbv_buffer_size ) s += sprintf( s, " vbv_maxrate=%d vbv_bufsize=%d", p->rc.i_vbv_max_bitrate, p->rc.i_vbv_buffer_size ); } --- vlc-0.8.4.debian.orig/extras/x264/common/common.h +++ vlc-0.8.4.debian/extras/x264/common/common.h @@ -30,6 +30,7 @@ #include #endif #include +#include #ifdef _MSC_VER #define snprintf _snprintf @@ -48,6 +49,12 @@ #define XCHG(type,a,b) { type t = a; a = b; b = t; } #define FIX8(f) ((int)(f*(1<<8)+.5)) +#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) +#define UNUSED __attribute__((unused)) +#else +#define UNUSED +#endif + /**************************************************************************** * Includes ****************************************************************************/ @@ -261,6 +268,10 @@ int unquant4_mf[4][52][16]; int unquant8_mf[2][52][64]; + uint32_t nr_residual_sum[4][64]; + uint32_t nr_offset[4][64]; + uint32_t nr_count[4]; + /* Slice header */ x264_slice_header_t sh; @@ -343,9 +354,15 @@ int i_subpel_refine; int b_chroma_me; int b_trellis; + int b_noise_reduction; + /* Allowed qpel MV range to stay within the picture + emulated edge pixels */ int mv_min[2]; int mv_max[2]; + /* Subpel MV range for motion search. + * same mv_min/max but includes levels' i_mv_range. */ + int mv_min_spel[2]; + int mv_max_spel[2]; /* Fullpel MV range for motion search */ int mv_min_fpel[2]; int mv_max_fpel[2]; @@ -395,6 +412,7 @@ /* pointer over mb of the references */ uint8_t *p_fref[2][16][4+2]; /* last: lN, lH, lV, lHV, cU, cV */ + uint16_t *p_integral[2][16]; /* common stride */ int i_stride[3]; --- vlc-0.8.4.debian.orig/extras/x264/common/cpu.c +++ vlc-0.8.4.debian/extras/x264/common/cpu.c @@ -21,17 +21,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#ifdef HAVE_STDINT_H -#include -#else -#include -#endif -#include #include -#include -#include "x264.h" -#include "cpu.h" +#include "common.h" #if defined(ARCH_X86) || defined(ARCH_X86_64) extern int x264_cpu_cpuid_test( void ); --- vlc-0.8.4.debian.orig/extras/x264/common/csp.c +++ vlc-0.8.4.debian/extras/x264/common/csp.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include --- vlc-0.8.4.debian.orig/extras/x264/common/dct.c +++ vlc-0.8.4.debian/extras/x264/common/dct.c @@ -21,16 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#ifdef HAVE_STDINT_H -#include -#else -#include -#endif -#include -#include - -#include "x264.h" - #include "common.h" #ifdef HAVE_MMXEXT # include "i386/dct.h" --- vlc-0.8.4.debian.orig/extras/x264/common/dct.h +++ vlc-0.8.4.debian/extras/x264/common/dct.h @@ -48,6 +48,12 @@ #define W(i) (i==0 ? FIX8(3.125) :\ i==1 ? FIX8(1.25) :\ i==2 ? FIX8(0.5) :0) +static const int x264_dct4_weight2_tab[16] = { + W(0), W(1), W(0), W(1), + W(1), W(2), W(1), W(2), + W(0), W(1), W(0), W(1), + W(1), W(2), W(1), W(2) +}; static const int x264_dct4_weight2_zigzag[16] = { W(0), W(1), W(1), W(0), W(2), W(0), W(1), W(1), W(1), W(1), W(2), W(0), W(2), W(1), W(1), W(2) @@ -60,6 +66,17 @@ i==3 ? FIX8(0.88637) :\ i==4 ? FIX8(1.60040) :\ i==5 ? FIX8(1.41850) :0) +static const int x264_dct8_weight2_tab[64] = { + W(0), W(3), W(4), W(3), W(0), W(3), W(4), W(3), + W(3), W(1), W(5), W(1), W(3), W(1), W(5), W(1), + W(4), W(5), W(2), W(5), W(4), W(5), W(2), W(5), + W(3), W(1), W(5), W(1), W(3), W(1), W(5), W(1), + + W(0), W(3), W(4), W(3), W(0), W(3), W(4), W(3), + W(3), W(1), W(5), W(1), W(3), W(1), W(5), W(1), + W(4), W(5), W(2), W(5), W(4), W(5), W(2), W(5), + W(3), W(1), W(5), W(1), W(3), W(1), W(5), W(1) +}; static const int x264_dct8_weight2_zigzag[64] = { W(0), W(3), W(3), W(4), W(1), W(4), W(3), W(5), W(5), W(3), W(0), W(1), W(2), W(1), W(0), W(3), --- vlc-0.8.4.debian.orig/extras/x264/common/display-x11.c +++ vlc-0.8.4.debian/extras/x264/common/display-x11.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include "display.h" --- vlc-0.8.4.debian.orig/extras/x264/common/frame.c +++ vlc-0.8.4.debian/extras/x264/common/frame.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include @@ -90,6 +89,12 @@ } } + if( h->param.analyse.i_me_method == X264_ME_ESA ) + { + frame->buffer[11] = x264_malloc( frame->i_stride[0] * (frame->i_lines[0] + 64) * sizeof(uint16_t) ); + frame->integral = (uint16_t*)frame->buffer[11] + frame->i_stride[0] * 32 + 32; + } + frame->i_poc = -1; frame->i_type = X264_TYPE_AUTO; frame->i_qpplus1 = 0; @@ -121,7 +126,7 @@ { x264_free( frame->buffer[i] ); } - for( i = 4; i < 11; i++ ) /* filtered planes */ + for( i = 4; i < 12; i++ ) /* filtered planes */ { x264_free( frame->buffer[i] ); } --- vlc-0.8.4.debian.orig/extras/x264/common/frame.h +++ vlc-0.8.4.debian/extras/x264/common/frame.h @@ -46,10 +46,11 @@ uint8_t *plane[4]; uint8_t *filtered[4]; /* plane[0], H, V, HV */ uint8_t *lowres[4]; /* half-size copy of input frame: Orig, H, V, HV */ + uint16_t *integral; /* for unrestricted mv we allocate more data than needed * allocated data are stored in buffer */ - void *buffer[11]; + void *buffer[12]; /* motion data */ int8_t *mb_type; --- vlc-0.8.4.debian.orig/extras/x264/common/i386/cpu-a.asm +++ vlc-0.8.4.debian/extras/x264/common/i386/cpu-a.asm @@ -27,14 +27,7 @@ ; Macros and other preprocessor constants ;============================================================================= -%macro cglobal 1 - %ifdef PREFIX - global _%1 - %define %1 _%1 - %else - global %1 - %endif -%endmacro +%include "i386inc.asm" ;============================================================================= ; Code --- vlc-0.8.4.debian.orig/extras/x264/common/i386/dct-a.asm +++ vlc-0.8.4.debian/extras/x264/common/i386/dct-a.asm @@ -38,14 +38,7 @@ ; Macros and other preprocessor constants ;============================================================================= -%macro cglobal 1 - %ifdef PREFIX - global _%1 - %define %1 _%1 - %else - global %1 - %endif -%endmacro +%include "i386inc.asm" %macro MMX_ZERO 1 pxor %1, %1 @@ -167,6 +160,9 @@ movq mm2, [eax+16] movq mm3, [eax+24] + picpush ebx + picgetgot ebx + MMX_SUMSUB_BADC mm1, mm0, mm3, mm2 ; mm1=s01 mm0=d01 mm3=s23 mm2=d23 MMX_SUMSUB_BADC mm3, mm1, mm2, mm0 ; mm3=s01+s23 mm1=s01-s23 mm2=d01+d23 mm0=d01-d23 @@ -177,7 +173,7 @@ MMX_TRANSPOSE mm0, mm2, mm3, mm4, mm1 ; in: mm0, mm2, mm3, mm4 out: mm0, mm4, mm1, mm3 - movq mm6, [x264_mmx_1] + movq mm6, [x264_mmx_1 GLOBAL] paddw mm0, mm6 paddw mm4, mm6 psraw mm0, 1 @@ -190,6 +186,7 @@ movq [eax+16], mm1 psraw mm3, 1 movq [eax+24], mm3 + picpop ebx ret cglobal x264_idct4x4dc_mmxext @@ -276,7 +273,6 @@ ; void __cdecl x264_add4x4_idct_mmxext( uint8_t *p_dst, int i_dst, int16_t dct[4][4] ) ;----------------------------------------------------------------------------- x264_add4x4_idct_mmxext: - ; Load dct coeffs mov eax, [esp+12] ; dct movq mm0, [eax+ 0] @@ -288,6 +284,9 @@ mov ecx, [esp+ 8] ; i_dst lea edx, [ecx+ecx*2] + picpush ebx + picgetgot ebx + ; out:mm0, mm1, mm2, mm3 MMX_TRANSPOSE mm0, mm4, mm3, mm1, mm2 @@ -305,13 +304,14 @@ MMX_SUMSUB_BADC mm2, mm3, mm4, mm1 ; mm2=s02+s13 mm3=s02-s13 mm4=d02+d13 mm1=d02-d13 MMX_ZERO mm7 - movq mm6, [x264_mmx_32] + movq mm6, [x264_mmx_32 GLOBAL] MMX_STORE_DIFF_4P mm2, mm0, mm6, mm7, [eax] MMX_STORE_DIFF_4P mm4, mm0, mm6, mm7, [eax+ecx] MMX_STORE_DIFF_4P mm1, mm0, mm6, mm7, [eax+ecx*2] MMX_STORE_DIFF_4P mm3, mm0, mm6, mm7, [eax+edx] + picpop ebx ret @@ -396,12 +396,15 @@ ; void __cdecl x264_xdct8_mmxext( int16_t dest[8][8] ); ;----------------------------------------------------------------------------- x264_xdct8_mmxext: - mov eax, [esp+04] ; dest - movq mm5, [x264_mmx_PPNN] - movq mm6, [x264_mmx_PNNP] - movq mm4, [x264_mmx_PPPN] - movq mm7, [x264_mmx_PPNP] + + picpush ebx + picgetgot ebx + + movq mm5, [x264_mmx_PPNN GLOBAL] + movq mm6, [x264_mmx_PNNP GLOBAL] + movq mm4, [x264_mmx_PPPN GLOBAL] + movq mm7, [x264_mmx_PPNP GLOBAL] ;------------------------------------------------------------------------- ; horizontal dct ( compute 1 row at a time -> 8 loops ) @@ -435,7 +438,7 @@ pshufw mm2, mm0, 11001001b ; (low)a1/a3/a0/a2(high) pshufw mm0, mm0, 10011100b ; (low)a0/a2/a1/a3(high) - pmullw mm2, [x264_mmx_2121] + pmullw mm2, [x264_mmx_2121 GLOBAL] pmullw mm0, mm5 ; (low)a0/a2/-a1/-a3(high) psraw mm2, 1 ; (low)a1/a3>>1/a0/a2>>1(high) paddw mm0, mm2 ; (low)dst0/dst2/dst4/dst6(high) @@ -457,6 +460,7 @@ %assign disp disp+16 %endrep + picpop ebx ret ALIGN 16 @@ -549,12 +553,15 @@ ; void __cdecl x264_xidct8_mmxext( int16_t dest[8][8] ); ;----------------------------------------------------------------------------- x264_xidct8_mmxext: - mov eax, [esp+04] ; dest - movq mm4, [x264_mmx_PPNN] - movq mm5, [x264_mmx_PNPN] - movq mm6, [x264_mmx_PPNP] - movq mm7, [x264_mmx_PPPN] + + picpush ebx + picgetgot ebx + + movq mm4, [x264_mmx_PPNN GLOBAL] + movq mm5, [x264_mmx_PNPN GLOBAL] + movq mm6, [x264_mmx_PPNP GLOBAL] + movq mm7, [x264_mmx_PPPN GLOBAL] ;------------------------------------------------------------------------- ; horizontal idct ( compute 1 row at a time -> 8 loops ) @@ -570,7 +577,7 @@ punpckhwd mm1, mm2 ; (low)d1,d5,d3,d7(high) pshufw mm2, mm0, 10110001b ; (low)d4,d0,d6,d2(high) - pmullw mm0, [x264_mmx_p2n2p1p1]; (low)2*d0,-2*d4,d2,d6(high) + pmullw mm0, [x264_mmx_p2n2p1p1 GLOBAL]; (low)2*d0,-2*d4,d2,d6(high) pmullw mm2, mm6 ; (low)d4,d0,-d6,d2(high) psraw mm0, 1 ; (low)d0,-d4,d2>>1,d6>>1(high) paddw mm0, mm2 ; (low)e0,e2,e4,e6(high) @@ -605,6 +612,7 @@ %assign disp disp+16 %endrep + picpop ebx ret ALIGN 16 --- vlc-0.8.4.debian.orig/extras/x264/common/i386/deblock-a.asm +++ vlc-0.8.4.debian/extras/x264/common/i386/deblock-a.asm @@ -22,14 +22,7 @@ BITS 32 -%macro cglobal 1 - %ifdef PREFIX - global _%1 - %define %1 _%1 - %else - global %1 - %endif -%endmacro +%include "i386inc.asm" SECTION .rodata align=16 pb_01: times 16 db 0x01 @@ -192,19 +185,19 @@ pxor mm4, mm2 ; b = p0^(q1>>2) psrlw mm3, 2 - pand mm3, [pb_3f] + pand mm3, [pb_3f GLOBAL] movq mm5, mm1 pxor mm5, mm3 ; c = q0^(p1>>2) psrlw mm0, 2 - pand mm0, [pb_3f] + pand mm0, [pb_3f GLOBAL] movq mm6, mm2 pxor mm6, mm0 ; d = (c^b) & ~(b^a) & 1 pxor mm6, mm5 pxor mm5, mm4 pandn mm5, mm6 - pand mm5, [pb_01] + pand mm5, [pb_01 GLOBAL] ; delta = (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3 ; = (avg(q0, p1>>2) + (d&a)) ; - (avg(p0, q1>>2) + (d^(d&a))) @@ -234,10 +227,10 @@ %macro LUMA_Q1_MMX 6 movq %6, mm1 pavgb %6, mm2 - pavgb %2, %6 ; avg(p2,avg(p0,q0)) + pavgb %2, %6 ; avg(p2,avg(p0,q0)) pxor %6, %3 - pand %6, [pb_01] ; (p2^avg(p0,q0))&1 - psubusb %2, %6 ; (p2+((p0+q0+1)>>1))>>1 + pand %6, [pb_01 GLOBAL] ; (p2^avg(p0,q0))&1 + psubusb %2, %6 ; (p2+((p0+q0+1)>>1))>>1 movq %6, %1 psubusb %6, %5 paddusb %5, %1 @@ -254,12 +247,14 @@ ; void x264_deblock_v8_luma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) ;----------------------------------------------------------------------------- x264_deblock_v8_luma_mmxext: + picpush ebx + picgetgot ebx push edi push esi - mov edi, [esp+12] ; pix - mov esi, [esp+16] ; stride - mov edx, [esp+20] ; alpha - mov ecx, [esp+24] ; beta + mov edi, [picesp+12] ; pix + mov esi, [picesp+16] ; stride + mov edx, [picesp+20] ; alpha + mov ecx, [picesp+24] ; beta dec edx dec ecx mov eax, edi @@ -274,12 +269,12 @@ movq mm3, [edi+esi] ; q1 LOAD_MASK_MMX edx, ecx - mov ecx, [esp+44] ; tc0, use only the low 16 bits + mov ecx, [picesp+44] ; tc0, use only the low 16 bits movd mm4, [ecx] punpcklbw mm4, mm4 punpcklbw mm4, mm4 ; tc = 4x tc0[1], 4x tc0[0] movq [esp+8], mm4 ; tc - pcmpgtb mm4, [pb_ff] + pcmpgtb mm4, [pb_ff GLOBAL] pand mm4, mm7 movq [esp+0], mm4 ; mask @@ -289,7 +284,7 @@ pcmpeqb mm6, mm4 pand mm6, mm4 pand mm4, [esp+8] ; tc - movq mm7, [pb_01] + movq mm7, [pb_01 GLOBAL] pand mm7, mm6 pand mm6, mm4 paddb mm7, mm4 @@ -303,18 +298,19 @@ pand mm6, mm5 movq mm5, [esp+8] ; tc pand mm5, mm6 - pand mm6, [pb_01] + pand mm6, [pb_01 GLOBAL] paddb mm7, mm6 movq mm3, [edi+esi] LUMA_Q1_MMX mm3, mm4, [edi+2*esi], [edi+esi], mm5, mm6 - DEBLOCK_P0_Q0_MMX + DEBLOCK_P0_Q0_MMX ; XXX: make sure ebx has the GOT in PIC mode movq [eax+2*esi], mm1 movq [edi], mm2 add esp, 16 pop esi pop edi + picpop ebx ret @@ -434,7 +430,8 @@ movd mm6, [ebx] punpcklbw mm6, mm6 pand mm7, mm6 - DEBLOCK_P0_Q0_MMX + picgetgot ebx ; no need to push ebx, it's already been done + DEBLOCK_P0_Q0_MMX ; XXX: make sure ebx has the GOT in PIC mode movq [eax+esi], mm1 movq [edi], mm2 @@ -461,7 +458,8 @@ movd mm6, [ebx] punpcklbw mm6, mm6 pand mm7, mm6 - DEBLOCK_P0_Q0_MMX + picgetgot ebx ; no need to push ebx, it's already been done + DEBLOCK_P0_Q0_MMX ; XXX: make sure ebx has the GOT in PIC mode movq mm0, [esp+8] movq mm3, [esp+0] @@ -478,7 +476,7 @@ %macro CHROMA_INTRA_P0 3 movq mm4, %1 pxor mm4, %3 - pand mm4, [pb_01] ; mm4 = (p0^q1)&1 + pand mm4, [pb_01 GLOBAL] ; mm4 = (p0^q1)&1 pavgb %1, %3 psubusb %1, mm4 pavgb %1, %2 ; dst = avg(p1, avg(p0,q1) - ((p0^q1)&1)) @@ -504,13 +502,16 @@ ;----------------------------------------------------------------------------- x264_deblock_v_chroma_intra_mmxext: CHROMA_V_START + picpush ebx + picgetgot ebx movq mm0, [eax] movq mm1, [eax+esi] movq mm2, [edi] movq mm3, [edi+esi] - CHROMA_INTRA_BODY + CHROMA_INTRA_BODY ; XXX: make sure ebx has the GOT in PIC mode movq [eax+esi], mm1 movq [edi], mm2 + picpop ebx CHROMA_END ALIGN 16 @@ -519,9 +520,12 @@ ;----------------------------------------------------------------------------- x264_deblock_h_chroma_intra_mmxext: CHROMA_H_START + picpush ebx + picgetgot ebx TRANSPOSE4x8_LOAD PASS8ROWS(eax, edi, esi, ebp) - CHROMA_INTRA_BODY + CHROMA_INTRA_BODY ; XXX: make sure ebx has the GOT in PIC mode TRANSPOSE8x4_STORE PASS8ROWS(eax, edi, esi, ebp) - pop ebp + picpop ebx + pop ebp ; needed because of CHROMA_H_START CHROMA_END --- vlc-0.8.4.debian.orig/extras/x264/common/i386/i386inc.asm +++ vlc-0.8.4.debian/extras/x264/common/i386/i386inc.asm @@ -0,0 +1,112 @@ +;***************************************************************************** +;* i386inc.asm: h264 encoder library +;***************************************************************************** +;* Copyright (C) 2006 x264 project +;* +;* Author: Sam Hocevar +;* +;* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA. +;***************************************************************************** + +BITS 32 + +;============================================================================= +; Macros and other preprocessor constants +;============================================================================= + +%macro cglobal 1 + %ifdef PREFIX + global _%1 + %define %1 _%1 + %else + global %1 + %endif +%endmacro + +; PIC support macros. All these macros are totally harmless when __PIC__ is +; not defined but can ruin everything if misused in PIC mode. On x86, shared +; objects cannot directly access global variables by address, they need to +; go through the GOT (global offset table). Most OSes do not care about it +; and let you load non-shared .so objects (Linux, Win32...). However, OS X +; requires PIC code in its .dylib objects. +; +; - GLOBAL should be used as a suffix for global addressing, eg. +; mov eax, [foo GLOBAL] +; instead of +; mov eax, [foo] +; +; - picgetgot computes the GOT address into the given register in PIC +; mode, otherwise does nothing. You need to do this before using GLOBAL. +; +; - picpush and picpop respectively push and pop the given register +; in PIC mode, otherwise do nothing. You should always use them around +; picgetgot except when sure that the register is no longer used and is +; being restored later by other means. +; +; - picesp is defined to compensate the changing of esp when pushing +; a register into the stack, eg. +; mov eax, [esp + 8] +; pushpic ebx +; mov eax, [picesp + 12] +; instead of +; mov eax, [esp + 8] +; pushpic ebx +; mov eax, [esp + 12] +; +%ifdef __PIC__ + %ifdef FORMAT_MACHO + ; There is no real global offset table on OS X, but we still + ; need to reference our variables by offset. + %define GLOBAL + ebx + %macro picgetgot 1 + call %%getgot + %%getgot: + pop %1 + sub %1, %%getgot + %endmacro + %else + %ifdef FORMAT_ELF + %define GOT _GLOBAL_OFFSET_TABLE_ + %else ; for a.out + %define GOT __GLOBAL_OFFSET_TABLE_ + %endif + extern GOT + ; FIXME: find an elegant way to use registers other than ebx + %define GLOBAL + ebx wrt ..gotoff + %macro picgetgot 1 + call %%getgot + %%getgot: + pop %1 + add %1, GOT + $$ - %%getgot wrt ..gotpc + %endmacro + %endif + %macro picpush 1 + push %1 + %endmacro + %macro picpop 1 + pop %1 + %endmacro + %define picesp esp+4 +%else + %define GLOBAL + %macro picgetgot 1 + %endmacro + %macro picpush 1 + %endmacro + %macro picpop 1 + %endmacro + %define picesp esp +%endif + --- vlc-0.8.4.debian.orig/extras/x264/common/i386/mc-a.asm +++ vlc-0.8.4.debian/extras/x264/common/i386/mc-a.asm @@ -36,14 +36,7 @@ ; Macros and other preprocessor constants ;============================================================================= -%macro cglobal 1 - %ifdef PREFIX - global _%1 - %define %1 _%1 - %else - global %1 - %endif -%endmacro +%include "i386inc.asm" ;============================================================================= ; Constants @@ -81,7 +74,7 @@ cglobal x264_mc_copy_w16_mmxext cglobal x264_mc_copy_w16_sse2 -cglobal x264_mc_chroma_sse +cglobal x264_mc_chroma_mmxext ;============================================================================= ; pixel avg @@ -272,18 +265,21 @@ %macro BIWEIGHT_START_MMX 0 push edi push esi - mov edi, [esp+12] ; dst - mov esi, [esp+16] ; i_dst - mov edx, [esp+20] ; src - mov ecx, [esp+24] ; i_src - - pshufw mm4, [esp+28], 0 ; weight_dst - movq mm5, [pw_64] - psubw mm5, mm4 ; weight_src - movq mm6, [pw_32] ; rounding + picpush ebx + picgetgot ebx + mov edi, [picesp+12] ; dst + mov esi, [picesp+16] ; i_dst + mov edx, [picesp+20] ; src + mov ecx, [picesp+24] ; i_src + + pshufw mm4, [picesp+28], 0 ; weight_dst + movq mm5, [pw_64 GLOBAL] + psubw mm5, mm4 ; weight_src + movq mm6, [pw_32 GLOBAL] ; rounding pxor mm7, mm7 %endmacro %macro BIWEIGHT_END_MMX 0 + picpop ebx pop esi pop edi ret @@ -295,7 +291,7 @@ ;----------------------------------------------------------------------------- x264_pixel_avg_weight_w16_mmxext: BIWEIGHT_START_MMX - mov eax, [esp+32] ; i_height + mov eax, [picesp+32] ; i_height ALIGN 4 .height_loop @@ -316,7 +312,7 @@ ;----------------------------------------------------------------------------- x264_pixel_avg_weight_w8_mmxext: BIWEIGHT_START_MMX - mov eax, [esp+32] + mov eax, [picesp+32] ALIGN 4 .height_loop @@ -508,24 +504,27 @@ ALIGN 16 ;----------------------------------------------------------------------------- -; void x264_mc_chroma_sse( uint8_t *src, int i_src_stride, +; void x264_mc_chroma_mmxext( uint8_t *src, int i_src_stride, ; uint8_t *dst, int i_dst_stride, ; int dx, int dy, -; int i_height, int i_width ) +; int i_width, int i_height ) ;----------------------------------------------------------------------------- -x264_mc_chroma_sse: +x264_mc_chroma_mmxext: + + picpush ebx + picgetgot ebx pxor mm3, mm3 - pshufw mm5, [esp+20], 0 ; mm5 - dx - pshufw mm6, [esp+24], 0 ; mm6 - dy + pshufw mm5, [picesp+20], 0 ; mm5 = dx + pshufw mm6, [picesp+24], 0 ; mm6 = dy - movq mm4, [pw_8] + movq mm4, [pw_8 GLOBAL] movq mm0, mm4 - psubw mm4, mm5 ; mm4 - 8-dx - psubw mm0, mm6 ; mm0 - 8-dy + psubw mm4, mm5 ; mm4 = 8-dx + psubw mm0, mm6 ; mm0 = 8-dy movq mm7, mm5 pmullw mm5, mm0 ; mm5 = dx*(8-dy) = cB @@ -535,10 +534,10 @@ push edi - mov eax, [esp+4+4] ; src - mov edi, [esp+4+12] ; dst - mov ecx, [esp+4+8] ; i_src_stride - mov edx, [esp+4+28] ; i_height + mov eax, [picesp+4+4] ; src + mov edi, [picesp+4+12] ; dst + mov ecx, [picesp+4+8] ; i_src_stride + mov edx, [picesp+4+32] ; i_height ALIGN 4 .height_loop @@ -557,7 +556,7 @@ punpcklbw mm2, mm3 punpcklbw mm1, mm3 - paddw mm0, [pw_32] + paddw mm0, [pw_32 GLOBAL] pmullw mm2, mm5 ; line * cB pmullw mm1, mm7 ; line * cD @@ -569,23 +568,22 @@ movd [edi], mm0 add eax, ecx - add edi, [esp+4+16] + add edi, [picesp+4+16] dec edx jnz .height_loop - mov eax, [esp+4+32] - sub eax, 8 - jnz .finish ; width != 8 so assume 4 - - mov [esp+4+32], eax - mov edi, [esp+4+12] ; dst - mov eax, [esp+4+4] ; src - mov edx, [esp+4+28] ; i_height + sub [picesp+4+28], dword 8 + jnz .finish ; width != 8 so assume 4 + + mov edi, [picesp+4+12] ; dst + mov eax, [picesp+4+4] ; src + mov edx, [picesp+4+32] ; i_height add edi, 4 add eax, 4 jmp .height_loop .finish pop edi + picpop ebx ret --- vlc-0.8.4.debian.orig/extras/x264/common/i386/mc-a2.asm +++ vlc-0.8.4.debian/extras/x264/common/i386/mc-a2.asm @@ -24,14 +24,7 @@ ; Macros and other preprocessor constants ;============================================================================= -%macro cglobal 1 - %ifdef PREFIX - global _%1 - %define %1 _%1 - %else - global %1 - %endif -%endmacro +%include "i386inc.asm" ;============================================================================= ; Read only data @@ -176,30 +169,33 @@ lea ebx, [ecx + ecx * 2] ; 3 * src_stride lea edx, [ecx + ecx * 4] ; 5 * src_stride + picpush ebx + picgetgot ebx + pxor mm0, mm0 ; 0 ---> mm0 - movq mm7, [mmx_dd_one] ; for rounding loopcy: -; mov eax, [esp + twidth] - xor eax, eax - mov edi, [esp + tdst1] - lea ebp, [esp + tbuffer] - mov esi, [esp + tsrc] + mov edi, [picesp + tdst1] + lea ebp, [picesp + tbuffer] + mov esi, [picesp + tsrc] + movq mm7, [mmx_dw_one GLOBAL] + + picpop ebx FILT_ALL esi pshufw mm2, mm1, 0 movq [ebp + 8], mm1 movq [ebp], mm2 - paddw mm1, [mmx_dw_one] + paddw mm1, mm7 psraw mm1, 5 packuswb mm1, mm1 movd [edi], mm1 - add eax, 8 + mov eax, 8 add esi, 4 loopcx1: @@ -207,7 +203,7 @@ FILT_ALL esi movq [ebp + 2 * eax], mm1 - paddw mm1, [mmx_dw_one] + paddw mm1, mm7 psraw mm1, 5 packuswb mm1, mm1 movd [edi + eax - 4], mm1 @@ -222,7 +218,7 @@ pshufw mm2, mm1, 7 movq [ebp + 2 * eax], mm1 movq [ebp + 2 * eax + 8], mm2 - paddw mm1, [mmx_dw_one] + paddw mm1, mm7 psraw mm1, 5 packuswb mm1, mm1 movd [edi + eax - 4], mm1 @@ -235,29 +231,33 @@ mov [esp + tdst1], edi mov edi, [esp + tdst2] - xor eax, eax +; mov eax, [esp + twidth] + sub eax, 4 + + picpush ebx + picgetgot ebx loopcx2: - movq mm2, [esp + 2 * eax + 2 + 4 + tbuffer] - movq mm3, [esp + 2 * eax + 4 + 4 + tbuffer] - movq mm4, [esp + 2 * eax + 6 + 4 + tbuffer] - movq mm5, [esp + 2 * eax + 8 + 4 + tbuffer] - movq mm1, [esp + 2 * eax + 4 + tbuffer] - movq mm6, [esp + 2 * eax + 10 + 4 + tbuffer] + movq mm2, [picesp + 2 * eax + 2 + 4 + tbuffer] + movq mm3, [picesp + 2 * eax + 4 + 4 + tbuffer] + movq mm4, [picesp + 2 * eax + 6 + 4 + tbuffer] + movq mm5, [picesp + 2 * eax + 8 + 4 + tbuffer] + movq mm1, [picesp + 2 * eax + 4 + tbuffer] + movq mm6, [picesp + 2 * eax + 10 + 4 + tbuffer] paddw mm2, mm5 paddw mm3, mm4 paddw mm1, mm6 - movq mm5, [mmx_dw_20] - movq mm4, [mmx_dw_5] + movq mm5, [mmx_dw_20 GLOBAL] + movq mm4, [mmx_dw_5 GLOBAL] movq mm6, mm1 pxor mm7, mm7 punpckhwd mm5, mm2 punpcklwd mm4, mm3 - punpcklwd mm2, [mmx_dw_20] - punpckhwd mm3, [mmx_dw_5] + punpcklwd mm2, [mmx_dw_20 GLOBAL] + punpckhwd mm3, [mmx_dw_5 GLOBAL] pcmpgtw mm7, mm1 @@ -270,8 +270,8 @@ paddd mm2, mm1 paddd mm3, mm6 - paddd mm2, [mmx_dd_one] - paddd mm3, [mmx_dd_one] + paddd mm2, [mmx_dd_one GLOBAL] + paddd mm3, [mmx_dd_one GLOBAL] psrad mm2, 10 psrad mm3, 10 @@ -281,19 +281,20 @@ movd [edi + eax], mm2 - add eax, 4 - cmp eax, [esp + twidth] - jnz loopcx2 + sub eax, 4 + jge loopcx2 - add edi, [esp + tdstp2] - mov [esp + tdst2], edi + add edi, [picesp + tdstp2] + mov [picesp + tdst2], edi - mov ebp, [esp + theight] + mov ebp, [picesp + theight] dec ebp test ebp, ebp - mov [esp + theight], ebp + mov [picesp + theight], ebp jnz loopcy + picpop ebx + add esp, [esp + toffset] pop ebp @@ -320,7 +321,10 @@ mov esi, [esp + 20] ; src pxor mm0, mm0 - movq mm7, [mmx_dw_one] + picpush ebx + picgetgot ebx + movq mm7, [mmx_dw_one GLOBAL] + picpop ebx mov ecx, [esp + 32] ; height --- vlc-0.8.4.debian.orig/extras/x264/common/i386/mc-c.c +++ vlc-0.8.4.debian/extras/x264/common/i386/mc-c.c @@ -21,21 +21,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#ifdef HAVE_STDINT_H -#include -#else -#include -#endif #include #include #include -#include -#include "x264.h" /* DECLARE_ALIGNED */ -#include "common/pixel.h" -#include "common/mc.h" -#include "common/clip1.h" -#include "mc.h" +#include "common/common.h" /* NASM functions */ extern void x264_pixel_avg_w4_mmxext( uint8_t *, int, uint8_t *, int, uint8_t *, int, int ); --- vlc-0.8.4.debian.orig/extras/x264/common/i386/mc.h +++ vlc-0.8.4.debian/extras/x264/common/i386/mc.h @@ -27,8 +27,7 @@ void x264_mc_mmxext_init( x264_mc_functions_t *pf ); void x264_mc_sse2_init( x264_mc_functions_t *pf ); -void x264_mc_chroma_sse( uint8_t *src, int i_src_stride, - uint8_t *dst, int i_dst_stride, - int dx, int dy, - int i_height, int i_width ); +void x264_mc_chroma_mmxext( uint8_t *src, int i_src_stride, + uint8_t *dst, int i_dst_stride, + int dx, int dy, int i_width, int i_height ); #endif --- vlc-0.8.4.debian.orig/extras/x264/common/i386/pixel-a.asm +++ vlc-0.8.4.debian/extras/x264/common/i386/pixel-a.asm @@ -27,14 +27,7 @@ ; Macros and other preprocessor constants ;============================================================================= -%macro cglobal 1 - %ifdef PREFIX - global _%1 - %define %1 _%1 - %else - global %1 - %endif -%endmacro +%include "i386inc.asm" %macro SAD_INC_2x16P 0 movq mm1, [eax] @@ -269,6 +262,10 @@ cglobal x264_pixel_sad_4x8_mmxext cglobal x264_pixel_sad_4x4_mmxext +cglobal x264_pixel_sad_pde_16x16_mmxext +cglobal x264_pixel_sad_pde_16x8_mmxext +cglobal x264_pixel_sad_pde_8x16_mmxext + cglobal x264_pixel_ssd_16x16_mmxext cglobal x264_pixel_ssd_16x8_mmxext cglobal x264_pixel_ssd_8x16_mmxext @@ -391,6 +388,66 @@ SAD_END +%macro PDE_CHECK 0 + movd ebx, mm0 + cmp ebx, [esp+24] ; prev_score + jl .continue + pop ebx + mov eax, 0xffff + ret +ALIGN 4 +.continue: + mov ebx, [esp+12] +%endmacro + +ALIGN 16 +;----------------------------------------------------------------------------- +; int __cdecl x264_pixel_sad_pde_16x16_mmxext (uint8_t *, int, uint8_t *, int, int ) +;----------------------------------------------------------------------------- +x264_pixel_sad_pde_16x16_mmxext: + SAD_START + SAD_INC_2x16P + SAD_INC_2x16P + SAD_INC_2x16P + SAD_INC_2x16P + PDE_CHECK + SAD_INC_2x16P + SAD_INC_2x16P + SAD_INC_2x16P + SAD_INC_2x16P + SAD_END + +ALIGN 16 +;----------------------------------------------------------------------------- +; int __cdecl x264_pixel_sad_pde_16x8_mmxext (uint8_t *, int, uint8_t *, int, int ) +;----------------------------------------------------------------------------- +x264_pixel_sad_pde_16x8_mmxext: + SAD_START + SAD_INC_2x16P + SAD_INC_2x16P + PDE_CHECK + SAD_INC_2x16P + SAD_INC_2x16P + SAD_END + +ALIGN 16 +;----------------------------------------------------------------------------- +; int __cdecl x264_pixel_sad_pde_8x16_mmxext (uint8_t *, int, uint8_t *, int, int ) +;----------------------------------------------------------------------------- +x264_pixel_sad_pde_8x16_mmxext: + SAD_START + SAD_INC_2x8P + SAD_INC_2x8P + SAD_INC_2x8P + SAD_INC_2x8P + PDE_CHECK + SAD_INC_2x8P + SAD_INC_2x8P + SAD_INC_2x8P + SAD_INC_2x8P + SAD_END + + %macro SSD_START 0 push ebx --- vlc-0.8.4.debian.orig/extras/x264/common/i386/pixel-sse2.asm +++ vlc-0.8.4.debian/extras/x264/common/i386/pixel-sse2.asm @@ -26,15 +26,7 @@ ; Macros and other preprocessor constants ;============================================================================= -%macro cglobal 1 - %ifdef PREFIX - global _%1 - %define %1 _%1 - %else - global %1 - %endif -%endmacro - +%include "i386inc.asm" %ifdef FORMAT_COFF SECTION .rodata data @@ -409,12 +401,14 @@ %endmacro %macro SUM_MM_SSE2 2 ; sum junk + ; ebx is no longer used at this point, so no push needed + picgetgot ebx ; each column sum of SATD is necessarily even, so we don't lose any precision by shifting first. psrlw %1, 1 movdqa %2, %1 psrldq %1, 2 paddusw %1, %2 - pand %1, [pd_0000ffff] + pand %1, [pd_0000ffff GLOBAL] movdqa %2, %1 psrldq %1, 4 paddd %1, %2 --- vlc-0.8.4.debian.orig/extras/x264/common/i386/pixel.h +++ vlc-0.8.4.debian/extras/x264/common/i386/pixel.h @@ -32,6 +32,10 @@ int x264_pixel_sad_4x8_mmxext( uint8_t *, int, uint8_t *, int ); int x264_pixel_sad_4x4_mmxext( uint8_t *, int, uint8_t *, int ); +int x264_pixel_sad_pde_16x16_mmxext( uint8_t *, int, uint8_t *, int, int ); +int x264_pixel_sad_pde_16x8_mmxext( uint8_t *, int, uint8_t *, int, int ); +int x264_pixel_sad_pde_8x16_mmxext( uint8_t *, int, uint8_t *, int, int ); + int x264_pixel_ssd_16x16_mmxext( uint8_t *, int, uint8_t *, int ); int x264_pixel_ssd_16x8_mmxext( uint8_t *, int, uint8_t *, int ); int x264_pixel_ssd_8x16_mmxext( uint8_t *, int, uint8_t *, int ); --- vlc-0.8.4.debian.orig/extras/x264/common/i386/predict-a.asm +++ vlc-0.8.4.debian/extras/x264/common/i386/predict-a.asm @@ -3,6 +3,8 @@ ;***************************************************************************** ;* Copyright (C) 2005 x264 project ;* +;* Authors: Loren Merritt +;* ;* 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 @@ -24,40 +26,151 @@ ; Macros and other preprocessor constants ;============================================================================= -%macro cglobal 1 - %ifdef PREFIX - global _%1 - %define %1 _%1 - %else - global %1 - %endif -%endmacro - -;============================================================================= -; Read only data -;============================================================================= - -SECTION .rodata data align=16 - -SECTION .data - -;============================================================================= -; Macros -;============================================================================= +%include "i386inc.asm" %macro SAVE_0_1 1 movq [%1] , mm0 movq [%1 + 8] , mm1 %endmacro +%macro SAVE_0_0 1 + movq [%1] , mm0 + movq [%1 + 8] , mm0 +%endmacro + + +SECTION .rodata data align=16 + +ALIGN 8 +pw_2: times 4 dw 2 +pw_8: times 4 dw 8 +pb_1: times 8 db 1 +pw_3210: + dw 0 + dw 1 + dw 2 + dw 3 + ;============================================================================= ; Code ;============================================================================= SECTION .text +cglobal predict_8x8_v_mmxext +cglobal predict_8x8_dc_core_mmxext cglobal predict_8x8c_v_mmx +cglobal predict_8x8c_dc_core_mmxext +cglobal predict_8x8c_p_core_mmx +cglobal predict_16x16_p_core_mmx cglobal predict_16x16_v_mmx +cglobal predict_16x16_dc_core_mmxext +cglobal predict_16x16_dc_top_mmxext + +%macro PRED8x8_LOWPASS 2 + movq mm3, mm1 + pavgb mm1, mm2 + pxor mm2, mm3 + movq %1 , %2 + pand mm2, [pb_1 GLOBAL] + psubusb mm1, mm2 + pavgb %1 , mm1 ; %1 = (t[n-1] + t[n]*2 + t[n+1] + 2) >> 2 +%endmacro + +%macro PRED8x8_LOAD_TOP 0 + mov edx, [picesp + 4] + mov ecx, [picesp + 8] + mov eax, [picesp +12] + sub edx, ecx + + and eax, 12 + movq mm1, [edx-1] + movq mm2, [edx+1] + + cmp eax, byte 8 + jge .have_topleft + mov al, [edx] + mov ah, [edx] + pinsrw mm1, ax, 0 + mov eax, [picesp + 12] +.have_topleft: + + and eax, byte 4 + jne .have_topright + mov al, [edx+7] + mov ah, [edx+7] + pinsrw mm2, ax, 3 +.have_topright: + + PRED8x8_LOWPASS mm0, [edx] +%endmacro + +;----------------------------------------------------------------------------- +; +; void predict_8x8_v_mmxext( uint8_t *src, int i_stride, int i_neighbors ) +; +;----------------------------------------------------------------------------- + +ALIGN 16 +predict_8x8_v_mmxext: + picpush ebx + picgetgot ebx + + PRED8x8_LOAD_TOP + lea eax, [ecx + 2*ecx] + movq [edx + ecx], mm0 ; 0 + movq [edx + 2*ecx], mm0 ; 1 + movq [edx + 4*ecx], mm0 ; 3 + movq [edx + 8*ecx], mm0 ; 7 + add edx, eax + movq [edx], mm0 ; 2 + movq [edx + 2*ecx], mm0 ; 4 + movq [edx + eax], mm0 ; 5 + movq [edx + 4*ecx], mm0 ; 6 + + picpop ebx + ret + +;----------------------------------------------------------------------------- +; +; void predict_8x8_dc_core_mmxext( uint8_t *src, int i_stride, int i_neighbors, int i_dc_left ); +; +;----------------------------------------------------------------------------- + +ALIGN 16 +predict_8x8_dc_core_mmxext: + picpush ebx + picgetgot ebx + + mov eax, [picesp + 16] + movq mm1, [eax-1] + movq mm2, [eax+1] + PRED8x8_LOWPASS mm4, [eax] + + PRED8x8_LOAD_TOP + + pxor mm1, mm1 + psadbw mm0, mm1 + psadbw mm4, mm1 + paddw mm0, [pw_8 GLOBAL] + paddw mm0, mm4 + psrlw mm0, 4 + pshufw mm0, mm0, 0 + packuswb mm0, mm0 + + lea eax, [ecx + 2*ecx] + movq [edx + ecx], mm0 ; 0 + movq [edx + 2*ecx], mm0 ; 1 + movq [edx + 4*ecx], mm0 ; 3 + movq [edx + 8*ecx], mm0 ; 7 + add edx, eax + movq [edx], mm0 ; 2 + movq [edx + 2*ecx], mm0 ; 4 + movq [edx + eax], mm0 ; 5 + movq [edx + 4*ecx], mm0 ; 6 + + picpop ebx + ret ;----------------------------------------------------------------------------- ; @@ -68,28 +181,189 @@ ALIGN 16 predict_8x8c_v_mmx : - ;push edi - ;push esi - mov edx , [esp + 4] mov ecx , [esp + 8] - sub edx , ecx ; esi <-- line -1 + sub edx , ecx ; edx <-- line -1 movq mm0 , [edx] movq [edx + ecx] , mm0 ; 0 movq [edx + 2 * ecx] , mm0 ; 1 movq [edx + 4 * ecx] , mm0 ; 3 movq [edx + 8 * ecx] , mm0 ; 7 - add edx , ecx ; esi <-- line 0 + add edx , ecx ; edx <-- line 0 movq [edx + 2 * ecx] , mm0 ; 2 movq [edx + 4 * ecx] , mm0 ; 4 - lea edx , [edx + 4 * ecx] ; esi <-- line 4 + lea edx , [edx + 4 * ecx] ; edx <-- line 4 movq [edx + ecx] , mm0 ; 5 movq [edx + 2 * ecx] , mm0 ; 6 - ;pop esi - ;pop edi + ret +;----------------------------------------------------------------------------- +; +; void predict_8x8c_dc_core_mmxext( uint8_t *src, int i_stride, int s2, int s3 ) +; +;----------------------------------------------------------------------------- + +ALIGN 16 +predict_8x8c_dc_core_mmxext: + picpush ebx + picgetgot ebx + + mov edx, [picesp + 4] + mov ecx, [picesp + 8] + sub edx, ecx + lea eax, [ecx + 2*ecx] + + movq mm0, [edx] + pxor mm1, mm1 + pxor mm2, mm2 + punpckhbw mm1, mm0 + punpcklbw mm0, mm2 + psadbw mm1, mm2 ; s1 + psadbw mm0, mm2 ; s0 + + paddw mm0, [picesp + 12] + pshufw mm2, [picesp + 16], 0 + psrlw mm0, 3 + paddw mm1, [pw_2 GLOBAL] + movq mm3, mm2 + pshufw mm1, mm1, 0 + pshufw mm0, mm0, 0 ; dc0 (w) + paddw mm3, mm1 + psrlw mm3, 3 ; dc3 (w) + psrlw mm2, 2 ; dc2 (w) + psrlw mm1, 2 ; dc1 (w) + + packuswb mm0, mm1 ; dc0,dc1 (b) + packuswb mm2, mm3 ; dc2,dc3 (b) + + movq [edx + ecx], mm0 ; 0 + movq [edx + 2*ecx], mm0 ; 1 + movq [edx + eax], mm0 ; 2 + movq [edx + 4*ecx], mm0 ; 3 + lea edx, [edx + 4*ecx] + movq [edx + ecx], mm2 ; 4 + movq [edx + 2*ecx], mm2 ; 5 + movq [edx + eax], mm2 ; 6 + movq [edx + 4*ecx], mm2 ; 7 + + picpop ebx + ret + +;----------------------------------------------------------------------------- +; +; void predict_8x8c_p_core_mmx( uint8_t *src, int i_stride, int i00, int b, int c ) +; +;----------------------------------------------------------------------------- + +ALIGN 16 +predict_8x8c_p_core_mmx: + picpush ebx + picgetgot ebx + + mov edx, [picesp + 4] + mov ecx, [picesp + 8] + + movd mm0, [picesp +12] + movd mm2, [picesp +16] + movd mm4, [picesp +20] + pshufw mm0, mm0, 0 + pshufw mm2, mm2, 0 + pshufw mm4, mm4, 0 + movq mm1, mm2 + pmullw mm2, [pw_3210 GLOBAL] + psllw mm1, 2 + paddsw mm0, mm2 ; mm0 = {i+0*b, i+1*b, i+2*b, i+3*b} + paddsw mm1, mm0 ; mm1 = {i+4*b, i+5*b, i+6*b, i+7*b} + pxor mm5, mm5 + + mov eax, 8 +ALIGN 4 +.loop: + movq mm6, mm0 + movq mm7, mm1 + psraw mm6, 5 + psraw mm7, 5 + pmaxsw mm6, mm5 + pmaxsw mm7, mm5 + packuswb mm6, mm7 + movq [edx], mm6 + + paddsw mm0, mm4 + paddsw mm1, mm4 + add edx, ecx + dec eax + jg .loop + + nop + picpop ebx + ret + +;----------------------------------------------------------------------------- +; +; void predict_16x16_p_core_mmx( uint8_t *src, int i_stride, int i00, int b, int c ) +; +;----------------------------------------------------------------------------- + +ALIGN 16 +predict_16x16_p_core_mmx: + + picpush ebx + picgetgot ebx + + mov edx, [picesp + 4] + mov ecx, [picesp + 8] + + movd mm0, [picesp +12] + movd mm2, [picesp +16] + movd mm4, [picesp +20] + pshufw mm0, mm0, 0 ; FIXME shuf these directly from memory + pshufw mm2, mm2, 0 ; if there is stack alignment? + pshufw mm4, mm4, 0 + movq mm5, mm2 + movq mm1, mm2 + pmullw mm5, [pw_3210 GLOBAL] + psllw mm2, 3 + psllw mm1, 2 + movq mm3, mm2 + paddsw mm0, mm5 ; mm0 = {i+ 0*b, i+ 1*b, i+ 2*b, i+ 3*b} + paddsw mm1, mm0 ; mm1 = {i+ 4*b, i+ 5*b, i+ 6*b, i+ 7*b} + paddsw mm2, mm0 ; mm2 = {i+ 8*b, i+ 9*b, i+10*b, i+11*b} + paddsw mm3, mm1 ; mm3 = {i+12*b, i+13*b, i+14*b, i+15*b} + pxor mm5, mm5 + + mov eax, 16 +ALIGN 4 +.loop: + movq mm6, mm0 + movq mm7, mm1 + psraw mm6, 5 + psraw mm7, 5 + pmaxsw mm6, mm5 + pmaxsw mm7, mm5 + packuswb mm6, mm7 + movq [edx], mm6 + + movq mm6, mm2 + movq mm7, mm3 + psraw mm6, 5 + psraw mm7, 5 + pmaxsw mm6, mm5 + pmaxsw mm7, mm5 + packuswb mm6, mm7 + movq [edx+8], mm6 + + paddsw mm0, mm4 + paddsw mm1, mm4 + paddsw mm2, mm4 + paddsw mm3, mm4 + add edx, ecx + dec eax + jg .loop + + nop + picpop ebx ret ;----------------------------------------------------------------------------- @@ -101,18 +375,13 @@ ALIGN 16 predict_16x16_v_mmx : - ;push edi - ;push esi - mov edx, [esp + 4] mov ecx, [esp + 8] - sub edx, ecx ; esi <-- line -1 + sub edx, ecx ; edx <-- line -1 movq mm0, [edx] movq mm1, [edx + 8] - mov eax, ecx - shl eax, 1 - add eax, ecx ; eax <-- 3* stride + lea eax, [ecx + 2*ecx] ; eax <-- 3* stride SAVE_0_1 (edx + ecx) ; 0 SAVE_0_1 (edx + 2 * ecx) ; 1 @@ -121,21 +390,68 @@ SAVE_0_1 (edx + 2 * eax) ; 5 SAVE_0_1 (edx + 8 * ecx) ; 7 SAVE_0_1 (edx + 4 * eax) ; 11 - add edx, ecx ; esi <-- line 0 + add edx, ecx ; edx <-- line 0 SAVE_0_1 (edx + 4 * ecx) ; 4 SAVE_0_1 (edx + 2 * eax) ; 6 SAVE_0_1 (edx + 8 * ecx) ; 8 SAVE_0_1 (edx + 4 * eax) ; 12 - lea edx, [edx + 8 * ecx] ; esi <-- line 8 + lea edx, [edx + 8 * ecx] ; edx <-- line 8 SAVE_0_1 (edx + ecx) ; 9 SAVE_0_1 (edx + 2 * ecx) ; 10 - lea edx, [edx + 4 * ecx] ; esi <-- line 12 + lea edx, [edx + 4 * ecx] ; edx <-- line 12 SAVE_0_1 (edx + ecx) ; 13 SAVE_0_1 (edx + 2 * ecx) ; 14 SAVE_0_1 (edx + eax) ; 15 + ret - ;pop esi - ;pop edi +;----------------------------------------------------------------------------- +; +; void predict_16x16_dc_core_mmxext( uint8_t *src, int i_stride, int i_dc_left ) +; +;----------------------------------------------------------------------------- + +%macro PRED16x16_DC 3 + mov edx, [%3 + 4] + mov ecx, [%3 + 8] + sub edx, ecx ; edx <-- line -1 + + pxor mm0, mm0 + pxor mm1, mm1 + psadbw mm0, [edx] + psadbw mm1, [edx + 8] + paddusw mm0, mm1 + paddusw mm0, %1 ; FIXME is stack alignment guaranteed? + psrlw mm0, %2 ; dc + push edi + pshufw mm0, mm0, 0 + lea eax, [ecx + 2*ecx] ; eax <-- 3* stride + packuswb mm0, mm0 ; dc in bytes + + mov edi, 4 +ALIGN 4 +.loop: + SAVE_0_0 (edx + ecx) ; 0 + SAVE_0_0 (edx + 2 * ecx) ; 1 + SAVE_0_0 (edx + eax) ; 2 + SAVE_0_0 (edx + 4 * ecx) ; 3 + dec edi + lea edx, [edx + 4 * ecx] + jg .loop + + pop edi +%endmacro +ALIGN 16 +predict_16x16_dc_core_mmxext: + PRED16x16_DC [esp+12], 5, esp ret + +ALIGN 16 +predict_16x16_dc_top_mmxext: + picpush ebx + picgetgot ebx + PRED16x16_DC [pw_8 GLOBAL], 4, picesp + picpop ebx + ret + --- vlc-0.8.4.debian.orig/extras/x264/common/i386/predict.c +++ vlc-0.8.4.debian/extras/x264/common/i386/predict.c @@ -21,359 +21,115 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -/* XXX predict4x4 are inspired from ffmpeg h264 decoder - */ - #ifdef HAVE_STDINT_H #include #else #include #endif -#include -#include -#include "x264.h" /* for keyword inline */ -#include "common/predict.h" +#include "common/clip1.h" +#include "common/common.h" #include "predict.h" -static inline int clip_uint8( int a ) -{ - if (a&(~255)) - return (-a)>>31; - else - return a; -} - -/**************************************************************************** - * 16x16 prediction for intra block DC, H, V, P - ****************************************************************************/ -static void predict_16x16_dc( uint8_t *src, int i_stride ) -{ - uint32_t dc = 0; - int i; - - /* calculate DC value */ - for( i = 0; i < 16; i++ ) - { - dc += src[-1 + i * i_stride]; - dc += src[i - i_stride]; - } - dc = (( dc + 16 ) >> 5) * 0x01010101; - - for( i = 0; i < 16; i++ ) - { - uint32_t *p = (uint32_t*)src; - - *p++ = dc; - *p++ = dc; - *p++ = dc; - *p++ = dc; - - src += i_stride; - } -} -static void predict_16x16_dc_left( uint8_t *src, int i_stride ) -{ - uint32_t dc = 0; - int i; - - for( i = 0; i < 16; i++ ) - { - dc += src[-1 + i * i_stride]; - } - dc = (( dc + 8 ) >> 4) * 0x01010101; - - for( i = 0; i < 16; i++ ) - { - uint32_t *p = (uint32_t*)src; - - *p++ = dc; - *p++ = dc; - *p++ = dc; - *p++ = dc; - - src += i_stride; - } -} -static void predict_16x16_dc_top( uint8_t *src, int i_stride ) -{ - uint32_t dc = 0; - int i; - - for( i = 0; i < 16; i++ ) - { - dc += src[i - i_stride]; - } - dc = (( dc + 8 ) >> 4) * 0x01010101; - - for( i = 0; i < 16; i++ ) - { - uint32_t *p = (uint32_t*)src; - - *p++ = dc; - *p++ = dc; - *p++ = dc; - *p++ = dc; - - src += i_stride; - } -} -static void predict_16x16_dc_128( uint8_t *src, int i_stride ) -{ - int i; - - for( i = 0; i < 16; i++ ) - { - uint32_t *p = (uint32_t*)src; - - *p++ = 0x80808080; - *p++ = 0x80808080; - *p++ = 0x80808080; - *p++ = 0x80808080; - - src += i_stride; - } -} -static void predict_16x16_h( uint8_t *src, int i_stride ) -{ - int i; - - for( i = 0; i < 16; i++ ) - { - const uint32_t v = 0x01010101 * src[-1]; - uint32_t *p = (uint32_t*)src; - - *p++ = v; - *p++ = v; - *p++ = v; - *p++ = v; - - src += i_stride; - - } -} - extern void predict_16x16_v_mmx( uint8_t *src, int i_stride ); +extern void predict_16x16_dc_core_mmxext( uint8_t *src, int i_stride, int i_dc_left ); +extern void predict_16x16_dc_top_mmxext( uint8_t *src, int i_stride ); +extern void predict_16x16_p_core_mmx( uint8_t *src, int i_stride, int i00, int b, int c ); +extern void predict_8x8c_p_core_mmx( uint8_t *src, int i_stride, int i00, int b, int c ); +extern void predict_8x8c_dc_core_mmxext( uint8_t *src, int i_stride, int s2, int s3 ); +extern void predict_8x8c_v_mmx( uint8_t *src, int i_stride ); +extern void predict_8x8_v_mmxext( uint8_t *src, int i_stride, int i_neighbors ); +extern void predict_8x8_dc_core_mmxext( uint8_t *src, int i_stride, int i_neighbors, uint8_t *pix_left ); - -/**************************************************************************** - * 8x8 prediction for intra chroma block DC, H, V, P - ****************************************************************************/ -static void predict_8x8c_dc_128( uint8_t *src, int i_stride ) -{ - int y; - - for( y = 0; y < 8; y++ ) - { - uint32_t *p = (uint32_t*)src; - - *p++ = 0x80808080; - *p++ = 0x80808080; - - src += i_stride; - } -} -static void predict_8x8c_dc_left( uint8_t *src, int i_stride ) +static void predict_16x16_p( uint8_t *src, int i_stride ) { - int y; - uint32_t dc0 = 0, dc1 = 0; + int a, b, c, i; + int H = 0; + int V = 0; + int i00; - for( y = 0; y < 4; y++ ) + for( i = 1; i <= 8; i++ ) { - dc0 += src[y * i_stride - 1]; - dc1 += src[(y+4) * i_stride - 1]; + H += i * ( src[7+i - i_stride ] - src[7-i - i_stride ] ); + V += i * ( src[(7+i)*i_stride -1] - src[(7-i)*i_stride -1] ); } - dc0 = (( dc0 + 2 ) >> 2)*0x01010101; - dc1 = (( dc1 + 2 ) >> 2)*0x01010101; - - for( y = 0; y < 4; y++ ) - { - uint32_t *p = (uint32_t*)src; - *p++ = dc0; - *p++ = dc0; - src += i_stride; - } - for( y = 0; y < 4; y++ ) - { - uint32_t *p = (uint32_t*)src; - *p++ = dc1; - *p++ = dc1; - - src += i_stride; - } + a = 16 * ( src[15*i_stride -1] + src[15 - i_stride] ); + b = ( 5 * H + 32 ) >> 6; + c = ( 5 * V + 32 ) >> 6; + i00 = a - b * 7 - c * 7 + 16; + predict_16x16_p_core_mmx( src, i_stride, i00, b, c ); } -static void predict_8x8c_dc_top( uint8_t *src, int i_stride ) -{ - int y, x; - uint32_t dc0 = 0, dc1 = 0; - - for( x = 0; x < 4; x++ ) - { - dc0 += src[x - i_stride]; - dc1 += src[x + 4 - i_stride]; - } - dc0 = (( dc0 + 2 ) >> 2)*0x01010101; - dc1 = (( dc1 + 2 ) >> 2)*0x01010101; - for( y = 0; y < 8; y++ ) - { - uint32_t *p = (uint32_t*)src; - *p++ = dc0; - *p++ = dc1; - - src += i_stride; - } -} -static void predict_8x8c_dc( uint8_t *src, int i_stride ) +static void predict_8x8c_p( uint8_t *src, int i_stride ) { - int y; - int s0 = 0, s1 = 0, s2 = 0, s3 = 0; - uint32_t dc0, dc1, dc2, dc3; - int i; + int a, b, c, i; + int H = 0; + int V = 0; + int i00; - /* First do : - s0 s1 - s2 - s3 - */ - for( i = 0; i < 4; i++ ) + for( i = 1; i <= 4; i++ ) { - s0 += src[i - i_stride]; - s1 += src[i + 4 - i_stride]; - s2 += src[-1 + i * i_stride]; - s3 += src[-1 + (i+4)*i_stride]; + H += i * ( src[3+i - i_stride] - src[3-i - i_stride] ); + V += i * ( src[(3+i)*i_stride -1] - src[(3-i)*i_stride -1] ); } - /* now calculate - dc0 dc1 - dc2 dc3 - */ - dc0 = (( s0 + s2 + 4 ) >> 3)*0x01010101; - dc1 = (( s1 + 2 ) >> 2)*0x01010101; - dc2 = (( s3 + 2 ) >> 2)*0x01010101; - dc3 = (( s1 + s3 + 4 ) >> 3)*0x01010101; - for( y = 0; y < 4; y++ ) - { - uint32_t *p = (uint32_t*)src; - *p++ = dc0; - *p++ = dc1; - - src += i_stride; - } + a = 16 * ( src[7*i_stride -1] + src[7 - i_stride] ); + b = ( 17 * H + 16 ) >> 5; + c = ( 17 * V + 16 ) >> 5; + i00 = a -3*b -3*c + 16; - for( y = 0; y < 4; y++ ) - { - uint32_t *p = (uint32_t*)src; - *p++ = dc2; - *p++ = dc3; - - src += i_stride; - } + predict_8x8c_p_core_mmx( src, i_stride, i00, b, c ); } -static void predict_8x8c_h( uint8_t *src, int i_stride ) +static void predict_16x16_dc( uint8_t *src, int i_stride ) { + uint32_t dc=16; int i; - for( i = 0; i < 8; i++ ) - { - uint32_t v = 0x01010101 * src[-1]; - uint32_t *p = (uint32_t*)src; - - *p++ = v; - *p++ = v; - - src += i_stride; - } -} - -extern void predict_8x8c_v_mmx( uint8_t *src, int i_stride ); - - -/**************************************************************************** - * 4x4 prediction for intra luma block - ****************************************************************************/ -static void predict_4x4_dc_128( uint8_t *src, int i_stride ) -{ - int y; - for( y = 0; y < 4; y++ ) + for( i = 0; i < 16; i+=2 ) { - uint32_t *p = (uint32_t*)src; - *p = 0x80808080; - - src += i_stride; - } -} -static void predict_4x4_dc_left( uint8_t *src, int i_stride ) -{ - int y; - uint32_t dc = (( src[-1+0*i_stride] + src[-1+i_stride]+ - src[-1+2*i_stride] + src[-1+3*i_stride] + 2 ) >> 2)*0x01010101; - - for( y = 0; y < 4; y++ ) - { - uint32_t *p = (uint32_t*)src; - *p = dc; - - src += i_stride; - } -} -static void predict_4x4_dc_top( uint8_t *src, int i_stride ) -{ - int y; - uint32_t dc = (( src[0 - i_stride] + src[1 - i_stride] + - src[2 - i_stride] + src[3 - i_stride] + 2 ) >> 2)*0x01010101; - - for( y = 0; y < 4; y++ ) - { - uint32_t *p = (uint32_t*)src; - *p = dc; - src += i_stride; + dc += src[-1 + i * i_stride]; + dc += src[-1 + (i+1) * i_stride]; } -} -static void predict_4x4_dc( uint8_t *src, int i_stride ) -{ - int y; - uint32_t dc = (( src[-1+0*i_stride] + src[-1+i_stride]+ - src[-1+2*i_stride] + src[-1+3*i_stride] + - src[0 - i_stride] + src[1 - i_stride] + - src[2 - i_stride] + src[3 - i_stride] + 4 ) >> 3)*0x01010101; - for( y = 0; y < 4; y++ ) - { - uint32_t *p = (uint32_t*)src; - *p = dc; - - src += i_stride; - } + predict_16x16_dc_core_mmxext( src, i_stride, dc ); } -static void predict_4x4_h( uint8_t *src, int i_stride ) -{ - int i; - - for( i = 0; i < 4; i++ ) - { - uint32_t *p = (uint32_t*)src; - *p = 0x01010101*src[-1]; - src += i_stride; - } -} -static void predict_4x4_v( uint8_t *src, int i_stride ) +static void predict_8x8c_dc( uint8_t *src, int i_stride ) { - uint32_t top = *((uint32_t*)&src[-i_stride]); - int i; + int s2 = 4 + + src[-1 + 0*i_stride] + + src[-1 + 1*i_stride] + + src[-1 + 2*i_stride] + + src[-1 + 3*i_stride]; + + int s3 = 2 + + src[-1 + 4*i_stride] + + src[-1 + 5*i_stride] + + src[-1 + 6*i_stride] + + src[-1 + 7*i_stride]; + + predict_8x8c_dc_core_mmxext( src, i_stride, s2, s3 ); +} + +#define SRC(x,y) src[(x)+(y)*i_stride] +static void predict_8x8_dc( uint8_t *src, int i_stride, int i_neighbor ) +{ + uint8_t l[10]; + l[0] = i_neighbor&MB_TOPLEFT ? SRC(-1,-1) : SRC(-1,0); + l[1] = SRC(-1,0); + l[2] = SRC(-1,1); + l[3] = SRC(-1,2); + l[4] = SRC(-1,3); + l[5] = SRC(-1,4); + l[6] = SRC(-1,5); + l[7] = SRC(-1,6); + l[8] = + l[9] = SRC(-1,7); - for( i = 0; i < 4; i++ ) - { - uint32_t *p = (uint32_t*)src; - - *p = top; - - src += i_stride; - } + predict_8x8_dc_core_mmxext( src, i_stride, i_neighbor, l+1 ); } /**************************************************************************** @@ -381,31 +137,22 @@ ****************************************************************************/ void x264_predict_16x16_init_mmxext( x264_predict_t pf[7] ) { - pf[I_PRED_16x16_V ] = predict_16x16_v_mmx; - pf[I_PRED_16x16_H ] = predict_16x16_h; - pf[I_PRED_16x16_DC] = predict_16x16_dc; - pf[I_PRED_16x16_DC_LEFT]= predict_16x16_dc_left; - pf[I_PRED_16x16_DC_TOP ]= predict_16x16_dc_top; - pf[I_PRED_16x16_DC_128 ]= predict_16x16_dc_128; + pf[I_PRED_16x16_V] = predict_16x16_v_mmx; + pf[I_PRED_16x16_DC] = predict_16x16_dc; + pf[I_PRED_16x16_DC_TOP] = predict_16x16_dc_top_mmxext; + pf[I_PRED_16x16_P] = predict_16x16_p; } void x264_predict_8x8c_init_mmxext( x264_predict_t pf[7] ) { - pf[I_PRED_CHROMA_V ] = predict_8x8c_v_mmx; - pf[I_PRED_CHROMA_H ] = predict_8x8c_h; - pf[I_PRED_CHROMA_DC] = predict_8x8c_dc; - pf[I_PRED_CHROMA_DC_LEFT]= predict_8x8c_dc_left; - pf[I_PRED_CHROMA_DC_TOP ]= predict_8x8c_dc_top; - pf[I_PRED_CHROMA_DC_128 ]= predict_8x8c_dc_128; + pf[I_PRED_CHROMA_V] = predict_8x8c_v_mmx; + pf[I_PRED_CHROMA_P] = predict_8x8c_p; + pf[I_PRED_CHROMA_DC] = predict_8x8c_dc; } -void x264_predict_4x4_init_mmxext( x264_predict_t pf[12] ) +void x264_predict_8x8_init_mmxext( x264_predict8x8_t pf[12] ) { - pf[I_PRED_4x4_V] = predict_4x4_v; - pf[I_PRED_4x4_H] = predict_4x4_h; - pf[I_PRED_4x4_DC] = predict_4x4_dc; - pf[I_PRED_4x4_DC_LEFT]= predict_4x4_dc_left; - pf[I_PRED_4x4_DC_TOP] = predict_4x4_dc_top; - pf[I_PRED_4x4_DC_128] = predict_4x4_dc_128; + pf[I_PRED_8x8_V] = predict_8x8_v_mmxext; + pf[I_PRED_8x8_DC] = predict_8x8_dc; } --- vlc-0.8.4.debian.orig/extras/x264/common/i386/predict.h +++ vlc-0.8.4.debian/extras/x264/common/i386/predict.h @@ -26,6 +26,6 @@ void x264_predict_16x16_init_mmxext ( x264_predict_t pf[7] ); void x264_predict_8x8c_init_mmxext ( x264_predict_t pf[7] ); -void x264_predict_4x4_init_mmxext ( x264_predict_t pf[12] ); +void x264_predict_8x8_init_mmxext ( x264_predict8x8_t pf[12] ); #endif --- vlc-0.8.4.debian.orig/extras/x264/common/i386/quant-a.asm +++ vlc-0.8.4.debian/extras/x264/common/i386/quant-a.asm @@ -33,14 +33,7 @@ BITS 32 -%macro cglobal 1 - %ifdef PREFIX - global _%1 - %define %1 _%1 - %else - global %1 - %endif -%endmacro +%include "i386inc.asm" SECTION .rodata pw_1: times 4 dw 1 @@ -489,7 +482,10 @@ .rshift16: neg eax - movq mm6, [pw_1] + picpush ebx + picgetgot ebx + movq mm6, [pw_1 GLOBAL] + picpop ebx movd mm5, eax pxor mm7, mm7 psllw mm6, mm5 @@ -508,7 +504,10 @@ .rshift32: neg eax - movq mm6, [pd_1] + picpush ebx + picgetgot ebx + movq mm6, [pd_1 GLOBAL] + picpop ebx movd mm5, eax pxor mm7, mm7 pslld mm6, mm5 --- vlc-0.8.4.debian.orig/extras/x264/common/macroblock.c +++ vlc-0.8.4.debian/extras/x264/common/macroblock.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include @@ -907,6 +906,14 @@ } } + if( h->fdec->integral ) + { + for( i = 0; i < h->i_ref0; i++ ) + h->mb.pic.p_integral[0][i] = &h->fref0[i]->integral[ 16 * ( i_mb_x + i_mb_y * h->fdec->i_stride[0] )]; + for( i = 0; i < h->i_ref1; i++ ) + h->mb.pic.p_integral[1][i] = &h->fref1[i]->integral[ 16 * ( i_mb_x + i_mb_y * h->fdec->i_stride[0] )]; + } + /* load cache */ if( i_mb_xy >= h->sh.i_first_mb + h->mb.i_mb_stride ) { --- vlc-0.8.4.debian.orig/extras/x264/common/mc.c +++ vlc-0.8.4.debian/extras/x264/common/mc.c @@ -21,22 +21,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#ifdef HAVE_STDINT_H -#include -#else -#include -#endif -#include #include #include -#include - -#include "x264.h" -#include "pixel.h" -#include "mc.h" +#include "common.h" #include "clip1.h" -#include "frame.h" #ifdef HAVE_MMXEXT #include "i386/mc.h" @@ -334,7 +323,7 @@ } #ifdef HAVE_MMXEXT -static void motion_compensation_chroma_sse( uint8_t *src, int i_src_stride, +static void motion_compensation_chroma_mmxext( uint8_t *src, int i_src_stride, uint8_t *dst, int i_dst_stride, int mvx, int mvy, int i_width, int i_height ) @@ -348,8 +337,8 @@ src += (mvy >> 3) * i_src_stride + (mvx >> 3); - x264_mc_chroma_sse(src, i_src_stride, dst, i_dst_stride, - d8x, d8y, i_height, i_width); + x264_mc_chroma_mmxext( src, i_src_stride, dst, i_dst_stride, + d8x, d8y, i_width, i_height ); } } #endif @@ -385,7 +374,7 @@ #ifdef HAVE_MMXEXT if( cpu&X264_CPU_MMXEXT ) { x264_mc_mmxext_init( pf ); - pf->mc_chroma = motion_compensation_chroma_sse; + pf->mc_chroma = motion_compensation_chroma_mmxext; } #endif #ifdef HAVE_SSE2 @@ -449,6 +438,30 @@ } } } + + /* generate integral image: + * each entry in frame->integral is the sum of all luma samples above and + * to the left of its location (inclusive). + * this allows us to calculate the DC of any rectangle by looking only + * at the corner entries. + * individual entries will overflow 16 bits, but that's ok: + * we only need the differences between entries, and those will be correct + * as long as we don't try to evaluate a rectangle bigger than 16x16. + * likewise, we don't really have to init the edges to 0, leaving garbage + * there wouldn't affect the results.*/ + + if( frame->integral ) + { + memset( frame->integral - 32 * stride - 32, 0, stride * sizeof(uint16_t) ); + for( y = -31; y < frame->i_lines[0] + 32; y++ ) + { + uint8_t *ref = frame->plane[0] + y * stride - 32; + uint16_t *line = frame->integral + y * stride - 32; + uint16_t v = line[0] = 0; + for( x = 1; x < stride; x++ ) + line[x] = v += ref[x] + line[x-stride] - line[x-stride-1]; + } + } } void x264_frame_init_lowres( int cpu, x264_frame_t *frame ) --- vlc-0.8.4.debian.orig/extras/x264/common/mdate.c +++ vlc-0.8.4.debian/extras/x264/common/mdate.c @@ -26,7 +26,6 @@ #else #include #endif -#include #if !(defined(_MSC_VER) || defined(__MINGW32__)) #include --- vlc-0.8.4.debian.orig/extras/x264/common/pixel.c +++ vlc-0.8.4.debian/extras/x264/common/pixel.c @@ -21,17 +21,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#ifdef HAVE_STDINT_H -#include -#else -#include -#endif -#include #include -#include -#include "x264.h" -#include "pixel.h" +#include "common.h" #include "clip1.h" #ifdef HAVE_MMXEXT @@ -346,6 +338,10 @@ pixf->sad[PIXEL_4x8 ] = x264_pixel_sad_4x8_mmxext; pixf->sad[PIXEL_4x4] = x264_pixel_sad_4x4_mmxext; + pixf->sad_pde[PIXEL_16x16] = x264_pixel_sad_pde_16x16_mmxext; + pixf->sad_pde[PIXEL_16x8 ] = x264_pixel_sad_pde_16x8_mmxext; + pixf->sad_pde[PIXEL_8x16 ] = x264_pixel_sad_pde_8x16_mmxext; + pixf->ssd[PIXEL_16x16] = x264_pixel_ssd_16x16_mmxext; pixf->ssd[PIXEL_16x8] = x264_pixel_ssd_16x8_mmxext; pixf->ssd[PIXEL_8x16] = x264_pixel_ssd_8x16_mmxext; --- vlc-0.8.4.debian.orig/extras/x264/common/pixel.h +++ vlc-0.8.4.debian/extras/x264/common/pixel.h @@ -25,6 +25,7 @@ #define _PIXEL_H 1 typedef int (*x264_pixel_cmp_t) ( uint8_t *, int, uint8_t *, int ); +typedef int (*x264_pixel_cmp_pde_t) ( uint8_t *, int, uint8_t *, int, int ); enum { @@ -66,6 +67,11 @@ x264_pixel_cmp_t satd[7]; x264_pixel_cmp_t sa8d[4]; x264_pixel_cmp_t mbcmp[7]; /* either satd or sad for subpel refine and mode decision */ + + /* partial distortion elimination: + * terminate early if partial score is worse than a threshold. + * may be NULL, in which case just use sad instead. */ + x264_pixel_cmp_pde_t sad_pde[7]; } x264_pixel_function_t; void x264_pixel_init( int cpu, x264_pixel_function_t *pixf ); --- vlc-0.8.4.debian.orig/extras/x264/common/predict.c +++ vlc-0.8.4.debian/extras/x264/common/predict.c @@ -5,6 +5,7 @@ * $Id: predict.c,v 1.1 2004/06/03 19:27:07 fenrir Exp $ * * Authors: Laurent Aimar + * Loren Merritt * * 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 @@ -21,18 +22,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -/* XXX predict4x4 are inspired from ffmpeg h264 decoder - */ +/* predict4x4 are inspired from ffmpeg h264 decoder */ -#ifdef HAVE_STDINT_H -#include -#else -#include -#endif -#include -#include #include "common.h" +#include "clip1.h" #ifdef _MSC_VER #undef HAVE_MMXEXT /* not finished now */ @@ -41,119 +35,100 @@ # include "i386/predict.h" #endif -static inline int clip_uint8( int a ) -{ - if (a&(~255)) - return (-a)>>31; - else - return a; -} - /**************************************************************************** - * 16x16 prediction for intra block DC, H, V, P + * 16x16 prediction for intra luma block ****************************************************************************/ + +#define PREDICT_16x16_DC(v) \ + for( i = 0; i < 16; i++ )\ + {\ + uint32_t *p = (uint32_t*)src;\ + *p++ = v;\ + *p++ = v;\ + *p++ = v;\ + *p++ = v;\ + src += i_stride;\ + } + static void predict_16x16_dc( uint8_t *src, int i_stride ) { - int dc = 0; - int i, j; + uint32_t dc = 0; + int i; - /* calculate DC value */ for( i = 0; i < 16; i++ ) { dc += src[-1 + i * i_stride]; dc += src[i - i_stride]; } - dc = ( dc + 16 ) >> 5; + dc = (( dc + 16 ) >> 5) * 0x01010101; - for( i = 0; i < 16; i++ ) - { - for( j = 0; j < 16; j++ ) - { - src[j] = dc; - } - src += i_stride; - } + PREDICT_16x16_DC(dc); } static void predict_16x16_dc_left( uint8_t *src, int i_stride ) { - int dc = 0; - int i,j; + uint32_t dc = 0; + int i; for( i = 0; i < 16; i++ ) { dc += src[-1 + i * i_stride]; } - dc = ( dc + 8 ) >> 4; + dc = (( dc + 8 ) >> 4) * 0x01010101; - for( i = 0; i < 16; i++ ) - { - for( j = 0; j < 16; j++ ) - { - src[j] = dc; - } - src += i_stride; - } + PREDICT_16x16_DC(dc); } static void predict_16x16_dc_top( uint8_t *src, int i_stride ) { - int dc = 0; - int i,j; + uint32_t dc = 0; + int i; for( i = 0; i < 16; i++ ) { dc += src[i - i_stride]; } - dc = ( dc + 8 ) >> 4; + dc = (( dc + 8 ) >> 4) * 0x01010101; - for( i = 0; i < 16; i++ ) - { - for( j = 0; j < 16; j++ ) - { - src[j] = dc; - } - src += i_stride; - } + PREDICT_16x16_DC(dc); } static void predict_16x16_dc_128( uint8_t *src, int i_stride ) { - int i,j; - - for( i = 0; i < 16; i++ ) - { - for( j = 0; j < 16; j++ ) - { - src[j] = 128; - } - src += i_stride; - } + int i; + PREDICT_16x16_DC(0x80808080); } static void predict_16x16_h( uint8_t *src, int i_stride ) { - int i,j; + int i; for( i = 0; i < 16; i++ ) { - uint8_t v; + const uint32_t v = 0x01010101 * src[-1]; + uint32_t *p = (uint32_t*)src; + + *p++ = v; + *p++ = v; + *p++ = v; + *p++ = v; - v = src[-1]; - for( j = 0; j < 16; j++ ) - { - src[j] = v; - } src += i_stride; } } static void predict_16x16_v( uint8_t *src, int i_stride ) { - int i,j; + uint32_t v0 = *(uint32_t*)&src[ 0-i_stride]; + uint32_t v1 = *(uint32_t*)&src[ 4-i_stride]; + uint32_t v2 = *(uint32_t*)&src[ 8-i_stride]; + uint32_t v3 = *(uint32_t*)&src[12-i_stride]; + int i; for( i = 0; i < 16; i++ ) { - for( j = 0; j < 16; j++ ) - { - src[i * i_stride +j] = src[j - i_stride]; - } + uint32_t *p = (uint32_t*)src; + *p++ = v0; + *p++ = v1; + *p++ = v2; + *p++ = v3; + src += i_stride; } } static void predict_16x16_p( uint8_t *src, int i_stride ) @@ -179,13 +154,11 @@ for( y = 0; y < 16; y++ ) { + int pix = i00; for( x = 0; x < 16; x++ ) { - int pix; - - pix = (i00+b*x)>>5; - - src[x] = clip_uint8( pix ); + src[x] = x264_clip_uint8( pix>>5 ); + pix += b; } src += i_stride; i00 += c; @@ -194,75 +167,79 @@ /**************************************************************************** - * 8x8 prediction for intra chroma block DC, H, V, P + * 8x8 prediction for intra chroma block ****************************************************************************/ + static void predict_8x8c_dc_128( uint8_t *src, int i_stride ) { - int x,y; + int y; for( y = 0; y < 8; y++ ) { - for( x = 0; x < 8; x++ ) - { - src[x] = 128; - } + uint32_t *p = (uint32_t*)src; + *p++ = 0x80808080; + *p++ = 0x80808080; src += i_stride; } } static void predict_8x8c_dc_left( uint8_t *src, int i_stride ) { - int x,y; - int dc0 = 0, dc1 = 0; + int y; + uint32_t dc0 = 0, dc1 = 0; for( y = 0; y < 4; y++ ) { dc0 += src[y * i_stride - 1]; dc1 += src[(y+4) * i_stride - 1]; } - dc0 = ( dc0 + 2 ) >> 2; - dc1 = ( dc1 + 2 ) >> 2; + dc0 = (( dc0 + 2 ) >> 2)*0x01010101; + dc1 = (( dc1 + 2 ) >> 2)*0x01010101; for( y = 0; y < 4; y++ ) { - for( x = 0; x < 8; x++ ) - { - src[ x] = dc0; - src[4*i_stride+x] = dc1; - } + uint32_t *p = (uint32_t*)src; + *p++ = dc0; + *p++ = dc0; src += i_stride; } + for( y = 0; y < 4; y++ ) + { + uint32_t *p = (uint32_t*)src; + *p++ = dc1; + *p++ = dc1; + src += i_stride; + } + } static void predict_8x8c_dc_top( uint8_t *src, int i_stride ) { - int x,y; - int dc0 = 0, dc1 = 0; + int y, x; + uint32_t dc0 = 0, dc1 = 0; for( x = 0; x < 4; x++ ) { dc0 += src[x - i_stride]; dc1 += src[x + 4 - i_stride]; } - dc0 = ( dc0 + 2 ) >> 2; - dc1 = ( dc1 + 2 ) >> 2; + dc0 = (( dc0 + 2 ) >> 2)*0x01010101; + dc1 = (( dc1 + 2 ) >> 2)*0x01010101; for( y = 0; y < 8; y++ ) { - for( x = 0; x < 4; x++ ) - { - src[x ] = dc0; - src[x + 4] = dc1; - } + uint32_t *p = (uint32_t*)src; + *p++ = dc0; + *p++ = dc1; src += i_stride; } } static void predict_8x8c_dc( uint8_t *src, int i_stride ) { - int x,y; + int y; int s0 = 0, s1 = 0, s2 = 0, s3 = 0; - int dc0, dc1, dc2, dc3; + uint32_t dc0, dc1, dc2, dc3; int i; - /* First do : + /* s0 s1 s2 s3 @@ -274,58 +251,58 @@ s2 += src[-1 + i * i_stride]; s3 += src[-1 + (i+4)*i_stride]; } - /* now calculate + /* dc0 dc1 dc2 dc3 */ - dc0 = ( s0 + s2 + 4 ) >> 3; - dc1 = ( s1 + 2 ) >> 2; - dc2 = ( s3 + 2 ) >> 2; - dc3 = ( s1 + s3 + 4 ) >> 3; + dc0 = (( s0 + s2 + 4 ) >> 3)*0x01010101; + dc1 = (( s1 + 2 ) >> 2)*0x01010101; + dc2 = (( s3 + 2 ) >> 2)*0x01010101; + dc3 = (( s1 + s3 + 4 ) >> 3)*0x01010101; for( y = 0; y < 4; y++ ) { - for( x = 0; x < 4; x++ ) - { - src[ x ] = dc0; - src[ x + 4] = dc1; - src[4*i_stride + x ] = dc2; - src[4*i_stride + x + 4] = dc3; - } + uint32_t *p = (uint32_t*)src; + *p++ = dc0; + *p++ = dc1; src += i_stride; } -} + for( y = 0; y < 4; y++ ) + { + uint32_t *p = (uint32_t*)src; + *p++ = dc2; + *p++ = dc3; + src += i_stride; + } +} static void predict_8x8c_h( uint8_t *src, int i_stride ) { - int i,j; + int i; for( i = 0; i < 8; i++ ) { - uint8_t v; - - v = src[-1]; - - for( j = 0; j < 8; j++ ) - { - src[j] = v; - } + uint32_t v = 0x01010101 * src[-1]; + uint32_t *p = (uint32_t*)src; + *p++ = v; + *p++ = v; src += i_stride; } } static void predict_8x8c_v( uint8_t *src, int i_stride ) { - int i,j; + uint32_t v0 = *(uint32_t*)&src[0-i_stride]; + uint32_t v1 = *(uint32_t*)&src[4-i_stride]; + int i; for( i = 0; i < 8; i++ ) { - for( j = 0; j < 8; j++ ) - { - src[i * i_stride +j] = src[j - i_stride]; - } + uint32_t *p = (uint32_t*)src; + *p++ = v0; + *p++ = v1; + src += i_stride; } } - static void predict_8x8c_p( uint8_t *src, int i_stride ) { int i; @@ -348,12 +325,11 @@ for( y = 0; y < 8; y++ ) { + int pix = i00; for( x = 0; x < 8; x++ ) { - int pix; - - pix = (i00 +b*x) >> 5; - src[x] = clip_uint8( pix ); + src[x] = x264_clip_uint8( pix>>5 ); + pix += b; } src += i_stride; i00 += c; @@ -363,92 +339,60 @@ /**************************************************************************** * 4x4 prediction for intra luma block ****************************************************************************/ + +#define PREDICT_4x4_DC(v) \ +{\ + int i;\ + for( i = 0; i < 4; i++ )\ + {\ + *(uint32_t*)src = v;\ + src += i_stride;\ + }\ +} + static void predict_4x4_dc_128( uint8_t *src, int i_stride ) { - int x,y; - for( y = 0; y < 4; y++ ) - { - for( x = 0; x < 4; x++ ) - { - src[x] = 128; - } - src += i_stride; - } + PREDICT_4x4_DC(0x80808080); } static void predict_4x4_dc_left( uint8_t *src, int i_stride ) { - int x,y; - int dc = ( src[-1+0*i_stride] + src[-1+i_stride]+ - src[-1+2*i_stride] + src[-1+3*i_stride] + 2 ) >> 2; - - for( y = 0; y < 4; y++ ) - { - for( x = 0; x < 4; x++ ) - { - src[x] = dc; - } - src += i_stride; - } + uint32_t dc = (( src[-1+0*i_stride] + src[-1+i_stride]+ + src[-1+2*i_stride] + src[-1+3*i_stride] + 2 ) >> 2)*0x01010101; + PREDICT_4x4_DC(dc); } static void predict_4x4_dc_top( uint8_t *src, int i_stride ) { - int x,y; - int dc = ( src[0 - i_stride] + src[1 - i_stride] + - src[2 - i_stride] + src[3 - i_stride] + 2 ) >> 2; - - for( y = 0; y < 4; y++ ) - { - for( x = 0; x < 4; x++ ) - { - src[x] = dc; - } - src += i_stride; - } + uint32_t dc = (( src[0 - i_stride] + src[1 - i_stride] + + src[2 - i_stride] + src[3 - i_stride] + 2 ) >> 2)*0x01010101; + PREDICT_4x4_DC(dc); } static void predict_4x4_dc( uint8_t *src, int i_stride ) { - int x,y; - int dc = ( src[-1+0*i_stride] + src[-1+i_stride]+ - src[-1+2*i_stride] + src[-1+3*i_stride] + - src[0 - i_stride] + src[1 - i_stride] + - src[2 - i_stride] + src[3 - i_stride] + 4 ) >> 3; - - for( y = 0; y < 4; y++ ) - { - for( x = 0; x < 4; x++ ) - { - src[x] = dc; - } - src += i_stride; - } + uint32_t dc = (( src[-1+0*i_stride] + src[-1+i_stride] + + src[-1+2*i_stride] + src[-1+3*i_stride] + + src[0 - i_stride] + src[1 - i_stride] + + src[2 - i_stride] + src[3 - i_stride] + 4 ) >> 3)*0x01010101; + PREDICT_4x4_DC(dc); } static void predict_4x4_h( uint8_t *src, int i_stride ) { - int i,j; + int i; for( i = 0; i < 4; i++ ) { - uint8_t v; - - v = src[-1]; - - for( j = 0; j < 4; j++ ) - { - src[j] = v; - } + *(uint32_t*)src = 0x01010101*src[-1]; src += i_stride; } } static void predict_4x4_v( uint8_t *src, int i_stride ) { - int i,j; + uint32_t top = *((uint32_t*)&src[-i_stride]); + int i; for( i = 0; i < 4; i++ ) { - for( j = 0; j < 4; j++ ) - { - src[i * i_stride +j] = src[j - i_stride]; - } + *(uint32_t*)src = top; + src += i_stride; } } @@ -456,48 +400,47 @@ const int l0 = src[-1+0*i_stride]; \ const int l1 = src[-1+1*i_stride]; \ const int l2 = src[-1+2*i_stride]; \ - const int l3 = src[-1+3*i_stride]; + UNUSED const int l3 = src[-1+3*i_stride]; #define PREDICT_4x4_LOAD_TOP \ const int t0 = src[0-1*i_stride]; \ const int t1 = src[1-1*i_stride]; \ const int t2 = src[2-1*i_stride]; \ - const int t3 = src[3-1*i_stride]; + UNUSED const int t3 = src[3-1*i_stride]; #define PREDICT_4x4_LOAD_TOP_RIGHT \ const int t4 = src[4-1*i_stride]; \ const int t5 = src[5-1*i_stride]; \ const int t6 = src[6-1*i_stride]; \ - const int t7 = src[7-1*i_stride]; - + UNUSED const int t7 = src[7-1*i_stride]; static void predict_4x4_ddl( uint8_t *src, int i_stride ) { PREDICT_4x4_LOAD_TOP PREDICT_4x4_LOAD_TOP_RIGHT - src[0*i_stride+0] = ( t0 + 2*t1+ t2 + 2 ) >> 2; + src[0*i_stride+0] = ( t0 + 2*t1 + t2 + 2 ) >> 2; src[0*i_stride+1] = - src[1*i_stride+0] = ( t1 + 2*t2+ t3 + 2 ) >> 2; + src[1*i_stride+0] = ( t1 + 2*t2 + t3 + 2 ) >> 2; src[0*i_stride+2] = src[1*i_stride+1] = - src[2*i_stride+0] = ( t2 + 2*t3+ t4 + 2 ) >> 2; + src[2*i_stride+0] = ( t2 + 2*t3 + t4 + 2 ) >> 2; src[0*i_stride+3] = src[1*i_stride+2] = src[2*i_stride+1] = - src[3*i_stride+0] = ( t3 + 2*t4+ t5 + 2 ) >> 2; + src[3*i_stride+0] = ( t3 + 2*t4 + t5 + 2 ) >> 2; src[1*i_stride+3] = src[2*i_stride+2] = - src[3*i_stride+1] = ( t4 + 2*t5+ t6 + 2 ) >> 2; + src[3*i_stride+1] = ( t4 + 2*t5 + t6 + 2 ) >> 2; src[2*i_stride+3] = - src[3*i_stride+2] = ( t5 + 2*t6+ t7 + 2 ) >> 2; + src[3*i_stride+2] = ( t5 + 2*t6 + t7 + 2 ) >> 2; - src[3*i_stride+3] = ( t6 + 3 * t7 + 2 ) >> 2; + src[3*i_stride+3] = ( t6 + 3*t7 + 2 ) >> 2; } static void predict_4x4_ddr( uint8_t *src, int i_stride ) { @@ -508,7 +451,7 @@ src[0*i_stride+0] = src[1*i_stride+1] = src[2*i_stride+2] = - src[3*i_stride+3] = ( t0 + 2*lt +l0 + 2 ) >> 2; + src[3*i_stride+3] = ( t0 + 2 * lt + l0 + 2 ) >> 2; src[0*i_stride+1] = src[1*i_stride+2] = @@ -598,8 +541,8 @@ src[0*i_stride+2]= src[2*i_stride+1]= ( t2 + t3 + 1 ) >> 1; src[0*i_stride+3]= - src[2*i_stride+2]= ( t3 + t4+ 1 ) >> 1; - src[2*i_stride+3]= ( t4 + t5+ 1 ) >> 1; + src[2*i_stride+2]= ( t3 + t4 + 1 ) >> 1; + src[2*i_stride+3]= ( t4 + t5 + 1 ) >> 1; src[1*i_stride+0]= ( t0 + 2 * t1 + t2 + 2 ) >> 2; src[1*i_stride+1]= src[3*i_stride+0]= ( t1 + 2 * t2 + t3 + 2 ) >> 2; @@ -648,7 +591,7 @@ const int l0 = ((i_neighbor&MB_TOPLEFT ? SRC(-1,-1) : SRC(-1,0)) \ + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \ PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \ - const int l7 = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2; + UNUSED const int l7 = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2; #define PT(x) \ const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2; @@ -656,7 +599,7 @@ const int t0 = ((i_neighbor&MB_TOPLEFT ? SRC(-1,-1) : SRC(0,-1)) \ + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \ PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \ - const int t7 = ((i_neighbor&MB_TOPRIGHT ? SRC(8,-1) : SRC(7,-1)) \ + UNUSED const int t7 = ((i_neighbor&MB_TOPRIGHT ? SRC(8,-1) : SRC(7,-1)) \ + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2; \ #define PTR(x) \ @@ -929,6 +872,13 @@ pf[I_PRED_8x8_DC_LEFT]= predict_8x8_dc_left; pf[I_PRED_8x8_DC_TOP] = predict_8x8_dc_top; pf[I_PRED_8x8_DC_128] = predict_8x8_dc_128; + +#ifdef HAVE_MMXEXT + if( cpu&X264_CPU_MMXEXT ) + { + x264_predict_8x8_init_mmxext( pf ); + } +#endif } void x264_predict_4x4_init( int cpu, x264_predict_t pf[12] ) @@ -945,12 +895,5 @@ pf[I_PRED_4x4_DC_LEFT]= predict_4x4_dc_left; pf[I_PRED_4x4_DC_TOP] = predict_4x4_dc_top; pf[I_PRED_4x4_DC_128] = predict_4x4_dc_128; - -#ifdef HAVE_MMXEXT - if( cpu&X264_CPU_MMXEXT ) - { - x264_predict_4x4_init_mmxext( pf ); - } -#endif } --- vlc-0.8.4.debian.orig/extras/x264/configure +++ vlc-0.8.4.debian/extras/x264/configure @@ -14,6 +14,7 @@ echo " --enable-debug adds -g, doesn't strip" echo " --enable-gprof adds -pg, doesn't strip" echo " --enable-visualize enables visualization (X11 only)" +echo " --enable-pic build position-independent code" echo " --extra-asflags=EASFLAGS add EASFLAGS to ASFLAGS" echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS" echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS" @@ -21,17 +22,33 @@ exit 1 fi +cc_check() { + rm -f conftest* + cat > conftest.c << EOF +#include <$1> +int main () { $3 return 0; } +EOF + $CC $CFLAGS $LDFLAGS $2 conftest.c -o conftest 2>$DEVNULL + TMP="$?" + rm -f conftest.c conftest + return $TMP +} + +rm -f config.h config.mak x264.pc + prefix='/usr/local' exec_prefix='${prefix}' bindir='${exec_prefix}/bin' libdir='${exec_prefix}/lib' includedir='${prefix}/include' +DEVNULL='/dev/null' -avis_input="no" -mp4_output="no" -pthread="no" +avis_input="auto" +mp4_output="auto" +pthread="auto" debug="no" gprof="no" +pic="no" vfw="no" vis="no" @@ -41,7 +58,7 @@ HAVE_GETOPT_LONG=1 AS="nasm" -ASFLAGS="-f elf" +ASFLAGS="-f elf -DFORMAT_ELF" EXE="" @@ -75,11 +92,15 @@ LDFLAGS="$LDFLAGS -mno-cygwin" ASFLAGS="-f win32 -DPREFIX" EXE=".exe" + DEVNULL="NUL" + vfw="yes" ;; MINGW*) SYS="MINGW" ASFLAGS="-f win32 -DPREFIX" EXE=".exe" + DEVNULL="NUL" + vfw="yes" ;; SunOS) SYS="SunOS" @@ -98,6 +119,12 @@ i386|i486|i586|i686|BePC) ARCH="X86" CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2" + if [ "$SYS" = MACOSX ]; then + ASFLAGS="-f macho -DPREFIX -DFORMAT_MACHO" + fi + if [ "$SYS" = FREEBSD -o "$SYS" = NETBSD ]; then + ASFLAGS="-f aoutb -DFORMAT_AOUTB" + fi ;; x86_64) ARCH="X86_64" @@ -136,7 +163,7 @@ m68k) ARCH="M68K" ;; - arm) + arm|armv5tel) ARCH="ARM" ;; s390|s390x) @@ -174,20 +201,17 @@ includedir="$optarg" ;; --enable-avis-input) - if [ $SYS = CYGWIN -o $SYS = MINGW ]; then - CFLAGS="$CFLAGS -DAVIS_INPUT" - LDFLAGS="$LDFLAGS -lvfw32" - avis_input="yes" - fi + avis_input="yes" + ;; + --disable-avis-input) + avis_input="no" ;; --enable-mp4-output) - CFLAGS="$CFLAGS -DMP4_OUTPUT" - LDFLAGS="$LDFLAGS -lgpac_static" - if [ $SYS = CYGWIN -o $SYS = MINGW ]; then - LDFLAGS="$LDFLAGS -lwinmm" - fi mp4_output="yes" ;; + --disable-mp4-output) + mp4_output="no" + ;; --extra-asflags=*) ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}" ;; @@ -200,15 +224,10 @@ VFW_LDFLAGS="${opt#--extra-ldflags=}" ;; --enable-pthread) - CFLAGS="$CFLAGS -DHAVE_PTHREAD=1" pthread="yes" - case $SYS in - MINGW|CYGWIN|BEOS) - ;; - *) - LDFLAGS="$LDFLAGS -lpthread" - ;; - esac + ;; + --disable-pthread) + pthread="no" ;; --enable-debug) CFLAGS="$CFLAGS -g" @@ -219,9 +238,17 @@ LDFLAGS="$LDFLAGS -pg" gprof="yes" ;; + --enable-pic) + CFLAGS="$CFLAGS -fPIC" + ASFLAGS="$ASFLAGS -D__PIC__" + pic="yes" + ;; --enable-vfw) vfw="yes" ;; + --disable-vfw) + vfw="no" + ;; --enable-visualize) LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" CFLAGS="$CFLAGS -DVISUALIZE=1" @@ -233,14 +260,70 @@ esac done -VFWFLAGS= +# autodetect options that weren't forced nor disabled + +if test "$pthread" = "auto" ; then + case $SYS in + MINGW|CYGWIN|BEOS) + pthread="yes" + ;; + *) + pthread="no" + cc_check pthread.h -lpthread && pthread="yes" + ;; + esac +fi +if test "$pthread" = "yes" ; then + CFLAGS="$CFLAGS -DHAVE_PTHREAD=1" + case $SYS in + MINGW|CYGWIN|BEOS) + ;; + *) LDFLAGS="$LDFLAGS -lpthread" + ;; + esac +fi + +MP4_LDFLAGS="-lgpac_static" +if [ $SYS = CYGWIN -o $SYS = MINGW ]; then + MP4_LDFLAGS="$MP4_LDFLAGS -lwinmm" +fi +if [ "$mp4_output" = "auto" ] ; then + mp4_output="no" + cc_check gpac/isomedia.h "$MP4_LDFLAGS" && mp4_output="yes" +fi +if [ "$mp4_output" = "yes" ] ; then + echo "#define MP4_OUTPUT" >> config.h + LDFLAGS="$LDFLAGS $MP4_LDFLAGS" +fi + +if [ "$avis_input" = "auto" ] ; then + if [ $SYS = CYGWIN -o $SYS = MINGW ]; then + avis_input="yes" + else + avis_input="no"; + fi +fi +if [ "$avis_input" = "yes" ] ; then + echo "#define AVIS_INPUT" >> config.h + LDFLAGS="$LDFLAGS -lvfw32" +fi + if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then CFLAGS="$CFLAGS -s -fomit-frame-pointer" LDFLAGS="$LDFLAGS -s" VFW_LDFLAGS="$VFW_LDFLAGS -s" fi -rm -f config.mak +if cc_check "stdio.h" "" "fseeko(stdin,0,0);" ; then + echo "#define fseek fseeko" >> config.h + echo "#define ftell ftello" >> config.h +elif cc_check "stdio.h" "" "fseeko64(stdin,0,0);" ; then + echo "#define fseek fseeko64" >> config.h + echo "#define ftell ftello64" >> config.h +fi + +# generate config files + cat > config.mak << EOF prefix=$prefix exec_prefix=$exec_prefix @@ -258,6 +341,8 @@ EXE=$EXE VIS=$vis HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG +DEVNULL=$DEVNULL +CONFIGURE_ARGS=$@ EOF if [ "$vfw" = "yes" ]; then @@ -269,8 +354,8 @@ echo "default: x264vfw.dll" >> config.mak fi -# x264.pc file creation -rm -f x264.pc +./version.sh + cat > x264.pc << EOF prefix=$prefix exec_prefix=$exec_prefix @@ -279,7 +364,7 @@ Name: x264 Description: H.264 (MPEG4 AVC) encoder library -Version: +Version: $(grep POINTVER < config.h | sed -e 's/.* "//; s/".*//') Libs: -L$libdir -lx264 Cflags: -I$includedir EOF @@ -293,7 +378,8 @@ echo "vfw: $vfw" echo "debug: $debug" echo "gprof: $gprof" +echo "PIC: $pic" echo "visualize: $vis" echo -echo "You can run 'make' now." +echo "You can run 'make' or 'make fprofiled' now." --- vlc-0.8.4.debian.orig/extras/x264/encoder/analyse.c +++ vlc-0.8.4.debian/extras/x264/encoder/analyse.c @@ -22,7 +22,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include #include @@ -83,6 +82,7 @@ /* Take some shortcuts in intra search if intra is deemed unlikely */ int b_fast_intra; int i_best_satd; + int b_try_pskip; /* Luma part */ int i_sad_i16x16; @@ -168,9 +168,9 @@ /* could be faster, but isn't called many times */ /* factor of 4 from qpel, 2 from sign, and 2 because mv can be opposite from mvp */ int i; - p_cost_mv[a->i_qp] = x264_malloc( (4*4*h->param.analyse.i_mv_range + 1) * sizeof(int16_t) ); - p_cost_mv[a->i_qp] += 2*4*h->param.analyse.i_mv_range; - for( i = 0; i <= 2*4*h->param.analyse.i_mv_range; i++ ) + p_cost_mv[a->i_qp] = x264_malloc( (4*4*2048 + 1) * sizeof(int16_t) ); + p_cost_mv[a->i_qp] += 2*4*2048; + for( i = 0; i <= 2*4*2048; i++ ) { p_cost_mv[a->i_qp][-i] = p_cost_mv[a->i_qp][i] = a->i_lambda * bs_size_se( i ); @@ -197,6 +197,7 @@ && h->mb.i_subpel_refine >= 5; h->mb.b_trellis = h->param.analyse.i_trellis > 1; h->mb.b_transform_8x8 = 0; + h->mb.b_noise_reduction = 0; /* I: Intra part */ a->i_sad_i16x16 = @@ -215,16 +216,20 @@ /* Calculate max allowed MV range */ #define CLIP_FMV(mv) x264_clip3( mv, -i_fmv_range, i_fmv_range ) + h->mb.mv_min[0] = 4*( -16*h->mb.i_mb_x - 24 ); + h->mb.mv_max[0] = 4*( 16*( h->sps->i_mb_width - h->mb.i_mb_x - 1 ) + 24 ); h->mb.mv_min_fpel[0] = CLIP_FMV( -16*h->mb.i_mb_x - 8 ); - h->mb.mv_max_fpel[0] = CLIP_FMV( 16*( h->sps->i_mb_width - h->mb.i_mb_x ) - 8 ); - h->mb.mv_min[0] = 4*( h->mb.mv_min_fpel[0] - 16 ); - h->mb.mv_max[0] = 4*( h->mb.mv_max_fpel[0] + 16 ); + h->mb.mv_max_fpel[0] = CLIP_FMV( 16*( h->sps->i_mb_width - h->mb.i_mb_x - 1 ) + 8 ); + h->mb.mv_min_spel[0] = 4*( h->mb.mv_min_fpel[0] - 16 ); + h->mb.mv_max_spel[0] = 4*( h->mb.mv_max_fpel[0] + 16 ); if( h->mb.i_mb_x == 0) { + h->mb.mv_min[1] = 4*( -16*h->mb.i_mb_y - 24 ); + h->mb.mv_max[1] = 4*( 16*( h->sps->i_mb_height - h->mb.i_mb_y - 1 ) + 24 ); h->mb.mv_min_fpel[1] = CLIP_FMV( -16*h->mb.i_mb_y - 8 ); - h->mb.mv_max_fpel[1] = CLIP_FMV( 16*( h->sps->i_mb_height - h->mb.i_mb_y ) - 8 ); - h->mb.mv_min[1] = 4*( h->mb.mv_min_fpel[1] - 16 ); - h->mb.mv_max[1] = 4*( h->mb.mv_max_fpel[1] + 16 ); + h->mb.mv_max_fpel[1] = CLIP_FMV( 16*( h->sps->i_mb_height - h->mb.i_mb_y - 1 ) + 8 ); + h->mb.mv_min_spel[1] = 4*( h->mb.mv_min_fpel[1] - 16 ); + h->mb.mv_max_spel[1] = 4*( h->mb.mv_max_fpel[1] + 16 ); } #undef CLIP_FMV @@ -663,13 +668,14 @@ (m)->p_fenc[1] = &(src)[1][((xoff)>>1)+((yoff)>>1)*(m)->i_stride[1]]; \ (m)->p_fenc[2] = &(src)[2][((xoff)>>1)+((yoff)>>1)*(m)->i_stride[1]]; -#define LOAD_HPELS(m, src, xoff, yoff) \ +#define LOAD_HPELS(m, src, list, ref, xoff, yoff) \ (m)->p_fref[0] = &(src)[0][(xoff)+(yoff)*(m)->i_stride[0]]; \ (m)->p_fref[1] = &(src)[1][(xoff)+(yoff)*(m)->i_stride[0]]; \ (m)->p_fref[2] = &(src)[2][(xoff)+(yoff)*(m)->i_stride[0]]; \ (m)->p_fref[3] = &(src)[3][(xoff)+(yoff)*(m)->i_stride[0]]; \ (m)->p_fref[4] = &(src)[4][((xoff)>>1)+((yoff)>>1)*(m)->i_stride[1]]; \ - (m)->p_fref[5] = &(src)[5][((xoff)>>1)+((yoff)>>1)*(m)->i_stride[1]]; + (m)->p_fref[5] = &(src)[5][((xoff)>>1)+((yoff)>>1)*(m)->i_stride[1]]; \ + (m)->integral = &h->mb.pic.p_integral[list][ref][(xoff)+(yoff)*(m)->i_stride[0]]; #define REF_COST(list, ref) \ (a->i_lambda * bs_size_te( h->sh.i_num_ref_idx_l##list##_active - 1, ref )) @@ -696,11 +702,26 @@ m.i_ref = i_ref; /* search with ref */ - LOAD_HPELS( &m, h->mb.pic.p_fref[0][i_ref], 0, 0 ); + LOAD_HPELS( &m, h->mb.pic.p_fref[0][i_ref], 0, i_ref, 0, 0 ); x264_mb_predict_mv_16x16( h, 0, i_ref, m.mvp ); x264_mb_predict_mv_ref16x16( h, 0, i_ref, mvc, &i_mvc ); x264_me_search_ref( h, &m, mvc, i_mvc, p_halfpel_thresh ); + /* early termination + * SSD threshold would probably be better than SATD */ + if( i_ref == 0 && a->b_try_pskip && m.cost-m.cost_mv < 300*a->i_lambda ) + { + int mvskip[2]; + x264_mb_predict_mv_pskip( h, mvskip ); + if( abs(m.mv[0]-mvskip[0]) + abs(m.mv[1]-mvskip[1]) <= 1 + && x264_macroblock_probe_pskip( h ) ) + { + h->mb.i_type = P_SKIP; + x264_analyse_update_cache( h, a ); + return; + } + } + m.cost += i_ref_cost; i_halfpel_thresh += i_ref_cost; @@ -716,10 +737,10 @@ x264_macroblock_cache_ref( h, 0, 0, 4, 4, 0, a->l0.me16x16.i_ref ); + h->mb.i_type = P_L0; if( a->b_mbrd ) { a->i_best_satd = a->l0.me16x16.cost; - h->mb.i_type = P_L0; h->mb.i_partition = D_16x16; x264_macroblock_cache_mv ( h, 0, 0, 4, 4, 0, a->l0.me16x16.mv[0], a->l0.me16x16.mv[1] ); a->l0.me16x16.cost = x264_rd_cost_mb( h, a->i_lambda2 ); @@ -776,7 +797,7 @@ m.i_ref_cost = i_ref_cost; m.i_ref = i_ref; - LOAD_HPELS( &m, h->mb.pic.p_fref[0][i_ref], 8*x8, 8*y8 ); + LOAD_HPELS( &m, h->mb.pic.p_fref[0][i_ref], 0, i_ref, 8*x8, 8*y8 ); x264_macroblock_cache_ref( h, 2*x8, 2*y8, 2, 2, 0, i_ref ); x264_mb_predict_mv( h, 0, 4*i, 2, m.mvp ); x264_me_search_ref( h, &m, a->l0.mvc[i_ref], i+1, p_halfpel_thresh ); @@ -836,7 +857,7 @@ m->i_ref = i_ref; LOAD_FENC( m, p_fenc, 8*x8, 8*y8 ); - LOAD_HPELS( m, p_fref, 8*x8, 8*y8 ); + LOAD_HPELS( m, p_fref, 0, i_ref, 8*x8, 8*y8 ); x264_mb_predict_mv( h, 0, 4*i, 2, m->mvp ); x264_me_search( h, m, mvc, i_mvc ); @@ -899,7 +920,7 @@ *(uint64_t*)mvc[1] = *(uint64_t*)a->l0.mvc[i_ref][2*i+1]; *(uint64_t*)mvc[2] = *(uint64_t*)a->l0.mvc[i_ref][2*i+2]; - LOAD_HPELS( &m, h->mb.pic.p_fref[0][i_ref], 0, 8*i ); + LOAD_HPELS( &m, h->mb.pic.p_fref[0][i_ref], 0, i_ref, 0, 8*i ); x264_macroblock_cache_ref( h, 0, 2*i, 4, 2, 0, i_ref ); x264_mb_predict_mv( h, 0, 8*i, 4, m.mvp ); x264_me_search( h, &m, mvc, 3 ); @@ -955,7 +976,7 @@ *(uint64_t*)mvc[1] = *(uint64_t*)a->l0.mvc[i_ref][i+1]; *(uint64_t*)mvc[2] = *(uint64_t*)a->l0.mvc[i_ref][i+3]; - LOAD_HPELS( &m, h->mb.pic.p_fref[0][i_ref], 8*i, 0 ); + LOAD_HPELS( &m, h->mb.pic.p_fref[0][i_ref], 0, i_ref, 8*i, 0 ); x264_macroblock_cache_ref( h, 2*i, 0, 2, 4, 0, i_ref ); x264_mb_predict_mv( h, 0, 4*i, 2, m.mvp ); x264_me_search( h, &m, mvc, 3 ); @@ -1015,7 +1036,7 @@ { uint8_t **p_fref = h->mb.pic.p_fref[0][a->l0.me8x8[i8x8].i_ref]; uint8_t **p_fenc = h->mb.pic.p_fenc; - + const int i_ref = a->l0.me8x8[i8x8].i_ref; int i4x4; /* XXX Needed for x264_mb_predict_mv */ @@ -1034,7 +1055,7 @@ m->p_cost_mv = a->p_cost_mv; LOAD_FENC( m, p_fenc, 4*x4, 4*y4 ); - LOAD_HPELS( m, p_fref, 4*x4, 4*y4 ); + LOAD_HPELS( m, p_fref, 0, i_ref, 4*x4, 4*y4 ); x264_mb_predict_mv( h, 0, idx, 1, m->mvp ); x264_me_search( h, m, &a->l0.me8x8[i8x8].mv, i_mvc ); @@ -1045,7 +1066,7 @@ a->l0.me4x4[i8x8][1].cost + a->l0.me4x4[i8x8][2].cost + a->l0.me4x4[i8x8][3].cost + - REF_COST( 0, a->l0.me8x8[i8x8].i_ref ) + + REF_COST( 0, i_ref ) + a->i_lambda * i_sub_mb_p_cost_table[D_L0_4x4]; if( h->mb.b_chroma_me ) a->l0.i_cost4x4[i8x8] += x264_mb_analyse_inter_p4x4_chroma( h, a, p_fref, i8x8, PIXEL_4x4 ); @@ -1055,7 +1076,7 @@ { uint8_t **p_fref = h->mb.pic.p_fref[0][a->l0.me8x8[i8x8].i_ref]; uint8_t **p_fenc = h->mb.pic.p_fenc; - + const int i_ref = a->l0.me8x8[i8x8].i_ref; int i8x4; /* XXX Needed for x264_mb_predict_mv */ @@ -1074,7 +1095,7 @@ m->p_cost_mv = a->p_cost_mv; LOAD_FENC( m, p_fenc, 4*x4, 4*y4 ); - LOAD_HPELS( m, p_fref, 4*x4, 4*y4 ); + LOAD_HPELS( m, p_fref, 0, i_ref, 4*x4, 4*y4 ); x264_mb_predict_mv( h, 0, idx, 2, m->mvp ); x264_me_search( h, m, &a->l0.me4x4[i8x8][0].mv, i_mvc ); @@ -1082,7 +1103,7 @@ x264_macroblock_cache_mv( h, x4, y4, 2, 1, 0, m->mv[0], m->mv[1] ); } a->l0.i_cost8x4[i8x8] = a->l0.me8x4[i8x8][0].cost + a->l0.me8x4[i8x8][1].cost + - REF_COST( 0, a->l0.me8x8[i8x8].i_ref ) + + REF_COST( 0, i_ref ) + a->i_lambda * i_sub_mb_p_cost_table[D_L0_8x4]; if( h->mb.b_chroma_me ) a->l0.i_cost8x4[i8x8] += x264_mb_analyse_inter_p4x4_chroma( h, a, p_fref, i8x8, PIXEL_8x4 ); @@ -1092,7 +1113,7 @@ { uint8_t **p_fref = h->mb.pic.p_fref[0][a->l0.me8x8[i8x8].i_ref]; uint8_t **p_fenc = h->mb.pic.p_fenc; - + const int i_ref = a->l0.me8x8[i8x8].i_ref; int i4x8; /* XXX Needed for x264_mb_predict_mv */ @@ -1111,7 +1132,7 @@ m->p_cost_mv = a->p_cost_mv; LOAD_FENC( m, p_fenc, 4*x4, 4*y4 ); - LOAD_HPELS( m, p_fref, 4*x4, 4*y4 ); + LOAD_HPELS( m, p_fref, 0, i_ref, 4*x4, 4*y4 ); x264_mb_predict_mv( h, 0, idx, 1, m->mvp ); x264_me_search( h, m, &a->l0.me4x4[i8x8][0].mv, i_mvc ); @@ -1119,7 +1140,7 @@ x264_macroblock_cache_mv( h, x4, y4, 1, 2, 0, m->mv[0], m->mv[1] ); } a->l0.i_cost4x8[i8x8] = a->l0.me4x8[i8x8][0].cost + a->l0.me4x8[i8x8][1].cost + - REF_COST( 0, a->l0.me8x8[i8x8].i_ref ) + + REF_COST( 0, i_ref ) + a->i_lambda * i_sub_mb_p_cost_table[D_L0_4x8]; if( h->mb.b_chroma_me ) a->l0.i_cost4x8[i8x8] += x264_mb_analyse_inter_p4x4_chroma( h, a, p_fref, i8x8, PIXEL_4x8 ); @@ -1192,7 +1213,7 @@ for( i_ref = 0; i_ref < h->i_ref0; i_ref++ ) { /* search with ref */ - LOAD_HPELS( &m, h->mb.pic.p_fref[0][i_ref], 0, 0 ); + LOAD_HPELS( &m, h->mb.pic.p_fref[0][i_ref], 0, i_ref, 0, 0 ); x264_mb_predict_mv_16x16( h, 0, i_ref, m.mvp ); x264_mb_predict_mv_ref16x16( h, 0, i_ref, mvc, &i_mvc ); x264_me_search_ref( h, &m, mvc, i_mvc, p_halfpel_thresh ); @@ -1220,7 +1241,7 @@ for( i_ref = 0; i_ref < h->i_ref1; i_ref++ ) { /* search with ref */ - LOAD_HPELS( &m, h->mb.pic.p_fref[1][i_ref], 0, 0 ); + LOAD_HPELS( &m, h->mb.pic.p_fref[1][i_ref], 1, i_ref, 0, 0 ); x264_mb_predict_mv_16x16( h, 1, i_ref, m.mvp ); x264_mb_predict_mv_ref16x16( h, 1, i_ref, mvc, &i_mvc ); x264_me_search_ref( h, &m, mvc, i_mvc, p_halfpel_thresh ); @@ -1451,7 +1472,7 @@ m->p_cost_mv = a->p_cost_mv; LOAD_FENC( m, h->mb.pic.p_fenc, 8*x8, 8*y8 ); - LOAD_HPELS( m, p_fref[l], 8*x8, 8*y8 ); + LOAD_HPELS( m, p_fref[l], l, lX->i_ref, 8*x8, 8*y8 ); x264_mb_predict_mv( h, l, 4*i, 2, m->mvp ); x264_me_search( h, m, &lX->me16x16.mv, 1 ); @@ -1540,7 +1561,7 @@ m->p_cost_mv = a->p_cost_mv; LOAD_FENC( m, h->mb.pic.p_fenc, 0, 8*i ); - LOAD_HPELS( m, p_fref[l], 0, 8*i ); + LOAD_HPELS( m, p_fref[l], l, lX->i_ref, 0, 8*i ); mvc[0][0] = lX->me8x8[2*i].mv[0]; mvc[0][1] = lX->me8x8[2*i].mv[1]; @@ -1624,7 +1645,7 @@ m->p_cost_mv = a->p_cost_mv; LOAD_FENC( m, h->mb.pic.p_fenc, 8*i, 0 ); - LOAD_HPELS( m, p_fref[l], 8*i, 0 ); + LOAD_HPELS( m, p_fref[l], l, lX->i_ref, 8*i, 0 ); mvc[0][0] = lX->me8x8[i].mv[0]; mvc[0][1] = lX->me8x8[i].mv[1]; @@ -1683,6 +1704,35 @@ } } +static void refine_bidir( x264_t *h, x264_mb_analysis_t *a ) +{ + const int i_biweight = h->mb.bipred_weight[a->l0.i_ref][a->l1.i_ref]; + int i; + + switch( h->mb.i_partition ) + { + case D_16x16: + if( h->mb.i_type == B_BI_BI ) + x264_me_refine_bidir( h, &a->l0.me16x16, &a->l1.me16x16, i_biweight ); + break; + case D_16x8: + for( i=0; i<2; i++ ) + if( a->i_mb_partition16x8[i] == D_BI_8x8 ) + x264_me_refine_bidir( h, &a->l0.me16x8[i], &a->l1.me16x8[i], i_biweight ); + break; + case D_8x16: + for( i=0; i<2; i++ ) + if( a->i_mb_partition8x16[i] == D_BI_8x8 ) + x264_me_refine_bidir( h, &a->l0.me8x16[i], &a->l1.me8x16[i], i_biweight ); + break; + case D_8x8: + for( i=0; i<4; i++ ) + if( h->mb.i_sub_partition[i] == D_BI_8x8 ) + x264_me_refine_bidir( h, &a->l0.me8x8[i], &a->l1.me8x8[i], i_biweight ); + break; + } +} + static inline void x264_mb_analyse_transform( x264_t *h ) { h->mb.cache.b_transform_8x8_allowed = @@ -1766,13 +1816,16 @@ int i_intra_cost, i_intra_type; /* Fast P_SKIP detection */ - if( !h->mb.b_lossless && - (( h->mb.i_mb_type_left == P_SKIP ) || - ( h->mb.i_mb_type_top == P_SKIP ) || - ( h->mb.i_mb_type_topleft == P_SKIP ) || - ( h->mb.i_mb_type_topright == P_SKIP ))) + analysis.b_try_pskip = 0; + if( h->param.analyse.b_fast_pskip ) { - b_skip = x264_macroblock_probe_pskip( h ); + if( h->param.analyse.i_subpel_refine >= 3 ) + analysis.b_try_pskip = 1; + else if( h->mb.i_mb_type_left == P_SKIP || + h->mb.i_mb_type_top == P_SKIP || + h->mb.i_mb_type_topleft == P_SKIP || + h->mb.i_mb_type_topright == P_SKIP ) + b_skip = x264_macroblock_probe_pskip( h ); } if( b_skip ) @@ -1791,7 +1844,7 @@ x264_mb_analyse_inter_p16x16( h, &analysis ); - if( analysis.b_mbrd && h->mb.i_type == P_SKIP ) + if( h->mb.i_type == P_SKIP ) return; if( flags & X264_ANALYSE_PSUB16x16 ) @@ -2210,6 +2263,9 @@ } h->mb.i_type = i_type; + + if( h->param.analyse.b_bidir_me ) + refine_bidir( h, &analysis ); } } @@ -2219,6 +2275,7 @@ x264_mb_analyse_transform( h ); h->mb.b_trellis = h->param.analyse.i_trellis; + h->mb.b_noise_reduction = h->param.analyse.i_noise_reduction; } /*-------------------- Update MB from the analysis ----------------------*/ --- vlc-0.8.4.debian.orig/extras/x264/encoder/cabac.c +++ vlc-0.8.4.debian/extras/x264/encoder/cabac.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include @@ -194,13 +193,13 @@ static const int i_mb_bits[9*3][7] = { { 1,1,0,0,0,1 }, { 1,1,0,0,1,0, }, { 1,0,0 }, /* L0 L0 */ - { 1,1,0,1,0,1 }, { 1,1,0,1,1,0 }, {}, /* L0 L1 */ - { 1,1,1,0,0,0,0 }, { 1,1,1,0,0,0,1 }, {}, /* L0 BI */ - { 1,1,0,1,1,1 }, { 1,1,1,1,1,0 }, {}, /* L1 L0 */ + { 1,1,0,1,0,1 }, { 1,1,0,1,1,0 }, {0}, /* L0 L1 */ + { 1,1,1,0,0,0,0 }, { 1,1,1,0,0,0,1 }, {0}, /* L0 BI */ + { 1,1,0,1,1,1 }, { 1,1,1,1,1,0 }, {0}, /* L1 L0 */ { 1,1,0,0,1,1 }, { 1,1,0,1,0,0 }, { 1,0,1 }, /* L1 L1 */ - { 1,1,1,0,0,1,0 }, { 1,1,1,0,0,1,1 }, {}, /* L1 BI */ - { 1,1,1,0,1,0,0 }, { 1,1,1,0,1,0,1 }, {}, /* BI L0 */ - { 1,1,1,0,1,1,0 }, { 1,1,1,0,1,1,1 }, {}, /* BI L1 */ + { 1,1,1,0,0,1,0 }, { 1,1,1,0,0,1,1 }, {0}, /* L1 BI */ + { 1,1,1,0,1,0,0 }, { 1,1,1,0,1,0,1 }, {0}, /* BI L0 */ + { 1,1,1,0,1,1,0 }, { 1,1,1,0,1,1,1 }, {0}, /* BI L1 */ { 1,1,1,1,0,0,0 }, { 1,1,1,1,0,0,1 }, { 1,1,0,0,0,0 }, /* BI BI */ }; --- vlc-0.8.4.debian.orig/extras/x264/encoder/cavlc.c +++ vlc-0.8.4.debian/extras/x264/encoder/cavlc.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include --- vlc-0.8.4.debian.orig/extras/x264/encoder/encoder.c +++ vlc-0.8.4.debian/extras/x264/encoder/encoder.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include #include @@ -352,6 +351,8 @@ } #endif + if( h->param.rc.b_cbr ) + h->param.rc.i_rf_constant = 0; if( h->param.rc.i_rf_constant > 0 ) h->param.rc.i_qp_constant = h->param.rc.i_rf_constant; h->param.rc.i_rf_constant = x264_clip3( h->param.rc.i_rf_constant, 0, 51 ); @@ -367,6 +368,8 @@ h->param.analyse.b_psnr = 0; h->param.analyse.i_chroma_qp_offset = 0; h->param.analyse.i_trellis = 0; + h->param.analyse.b_fast_pskip = 0; + h->param.analyse.i_noise_reduction = 0; } if( ( h->param.i_width % 16 || h->param.i_height % 16 ) && !h->mb.b_lossless ) @@ -417,6 +420,8 @@ h->param.analyse.i_chroma_qp_offset = x264_clip3(h->param.analyse.i_chroma_qp_offset, -12, 12); if( !h->param.b_cabac ) h->param.analyse.i_trellis = 0; + h->param.analyse.i_trellis = x264_clip3( h->param.analyse.i_trellis, 0, 2 ); + h->param.analyse.i_noise_reduction = x264_clip3( h->param.analyse.i_noise_reduction, 0, 1<<16 ); { const x264_level_t *l = x264_levels; @@ -438,6 +443,20 @@ if( h->param.rc.f_complexity_blur < 0 ) h->param.rc.f_complexity_blur = 0; + /* ensure the booleans are 0 or 1 so they can be used in math */ +#define BOOLIFY(x) h->param.x = !!h->param.x + BOOLIFY( b_cabac ); + BOOLIFY( b_deblocking_filter ); + BOOLIFY( analyse.b_transform_8x8 ); + BOOLIFY( analyse.b_weighted_bipred ); + BOOLIFY( analyse.b_bidir_me ); + BOOLIFY( analyse.b_chroma_me ); + BOOLIFY( analyse.b_fast_pskip ); + BOOLIFY( rc.b_cbr ); + BOOLIFY( rc.b_stat_write ); + BOOLIFY( rc.b_stat_read ); +#undef BOOLIFY + return 0; } @@ -1325,7 +1344,7 @@ h->i_nal_ref_idc = i_nal_ref_idc; /* Write SPS and PPS */ - if( i_nal_type == NAL_SLICE_IDR ) + if( i_nal_type == NAL_SLICE_IDR && h->param.b_repeat_headers ) { if( h->fenc->i_frame == 0 ) { @@ -1490,6 +1509,8 @@ x264_frame_put( h->frames.unused, h->fenc ); + x264_noise_reduction_update( h ); + TIMER_STOP( i_mtime_encode_frame ); /* ---------------------- Compute/Print statistics --------------------- */ --- vlc-0.8.4.debian.orig/extras/x264/encoder/macroblock.c +++ vlc-0.8.4.debian/extras/x264/encoder/macroblock.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include @@ -207,6 +206,8 @@ h->dctf.sub4x4_dct( dct4x4, p_src, i_stride, p_dst, i_stride ); + if( h->mb.b_noise_reduction ) + x264_denoise_dct( h, (int16_t*)dct4x4 ); if( h->mb.b_trellis ) x264_quant_4x4_trellis( h, dct4x4, CQM_4IY, i_qscale, DCT_LUMA_4x4, 1 ); else @@ -229,6 +230,8 @@ h->dctf.sub8x8_dct8( dct8x8, p_src, i_stride, p_dst, i_stride ); + if( h->mb.b_noise_reduction ) + x264_denoise_dct( h, (int16_t*)dct8x8 ); if( h->mb.b_trellis ) x264_quant_8x8_trellis( h, dct8x8, CQM_8IY, i_qscale, 1 ); else @@ -269,6 +272,8 @@ dct4x4[0][block_idx_y[i]][block_idx_x[i]] = dct4x4[1+i][0][0]; /* quant/scan/dequant */ + if( h->mb.b_noise_reduction ) + x264_denoise_dct( h, (int16_t*)dct4x4[i] ); if( h->mb.b_trellis ) x264_quant_4x4_trellis( h, dct4x4[1+i], CQM_4IY, i_qscale, DCT_LUMA_AC, 1 ); else @@ -501,6 +506,8 @@ for( idx = 0; idx < 4; idx++ ) { + if( h->mb.b_noise_reduction ) + x264_denoise_dct( h, (int16_t*)dct8x8[idx] ); if( h->mb.b_trellis ) x264_quant_8x8_trellis( h, dct8x8[idx], CQM_8PY, i_qp, 0 ); else @@ -552,6 +559,8 @@ { idx = i8x8 * 4 + i4x4; + if( h->mb.b_noise_reduction ) + x264_denoise_dct( h, (int16_t*)dct4x4[idx] ); if( h->mb.b_trellis ) x264_quant_4x4_trellis( h, dct4x4[idx], CQM_4PY, i_qp, DCT_LUMA_4x4, 0 ); else @@ -790,3 +799,63 @@ return 1; } + +/**************************************************************************** + * DCT-domain noise reduction / adaptive deadzone + * from libavcodec + ****************************************************************************/ + +void x264_noise_reduction_update( x264_t *h ) +{ + int cat, i; + for( cat = 0; cat < 4; cat++ ) + { + int b_8x8 = cat >= 2; + int size = b_8x8 ? 64 : 16; + const int *weight = b_8x8 ? x264_dct8_weight2_tab : x264_dct4_weight2_tab; + + if( h->nr_count[cat] > (b_8x8 ? (1<<16) : (1<<18)) ) + { + for( i = 0; i < size; i++ ) + h->nr_residual_sum[cat][i] >>= 1; + h->nr_count[cat] >>= 1; + } + + for( i = 0; i < size; i++ ) + h->nr_offset[cat][i] = + ((uint64_t)h->param.analyse.i_noise_reduction * h->nr_count[cat] + + h->nr_residual_sum[cat][i]/2) + / ((uint64_t)h->nr_residual_sum[cat][i] * weight[i]/256 + 1); + } +} + +void x264_denoise_dct( x264_t *h, int16_t *dct ) +{ + const int cat = !IS_INTRA(h->mb.i_type) + 2*h->mb.b_transform_8x8; + int i; + + h->nr_count[cat]++; + + for( i = (cat >= 2 ? 63 : 15); i >= 1; i-- ) + { + int level = dct[i]; + if( level ) + { + if( level > 0 ) + { + h->nr_residual_sum[cat][i] += level; + level -= h->nr_offset[cat][i]; + if( level < 0 ) + level = 0; + } + else + { + h->nr_residual_sum[cat][i] -= level; + level += h->nr_offset[cat][i]; + if( level > 0 ) + level = 0; + } + dct[i] = level; + } + } +} --- vlc-0.8.4.debian.orig/extras/x264/encoder/macroblock.h +++ vlc-0.8.4.debian/extras/x264/encoder/macroblock.h @@ -46,6 +46,9 @@ void x264_quant_8x8_trellis( x264_t *h, int16_t dct[8][8], int i_quant_cat, int i_qp, int b_intra ); +void x264_noise_reduction_update( x264_t *h ); +void x264_denoise_dct( x264_t *h, int16_t *dct ); + static inline int array_non_zero( int *v, int i_count ) { int i; --- vlc-0.8.4.debian.orig/extras/x264/encoder/me.c +++ vlc-0.8.4.debian/extras/x264/encoder/me.c @@ -22,7 +22,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include @@ -40,7 +39,7 @@ {0,2,1,0}, {0,2,1,1}, {0,2,1,2}, - {0,0,2,3}}; + {0,0,2,2}}; static void refine_subpel( x264_t *h, x264_me_t *m, int hpel_iters, int qpel_iters, int *p_halfpel_thresh, int b_refine_qpel ); @@ -62,6 +61,19 @@ #define COST_MV( mx, my ) COST_MV_INT( mx, my, 0, 0 ) #define COST_MV_DIR( mx, my, d ) COST_MV_INT( mx, my, 1, d ) +#define COST_MV_PDE( mx, my ) \ +{ \ + int cost = h->pixf.sad_pde[i_pixel]( m->p_fenc[0], m->i_stride[0], \ + &p_fref[(my)*m->i_stride[0]+(mx)], m->i_stride[0], \ + bcost - p_cost_mvx[ (mx)<<2 ] - p_cost_mvy[ (my)<<2 ] ); \ + if( cost < bcost - p_cost_mvx[ (mx)<<2 ] - p_cost_mvy[ (my)<<2 ] ) \ + { \ + bcost = cost + p_cost_mvx[ (mx)<<2 ] + p_cost_mvy[ (my)<<2 ]; \ + bmx = mx; \ + bmy = my; \ + } \ +} + #define DIA1_ITER( mx, my )\ {\ omx = mx; omy = my;\ @@ -71,11 +83,53 @@ COST_MV( omx+1, omy );\ } +#define DIA2 \ + {\ + COST_MV( omx , omy-2 );\ + COST_MV( omx-1, omy-1 );/* 1 */\ + COST_MV( omx+1, omy-1 );/* 1 1 */\ + COST_MV( omx-2, omy );/* 1 0 1 */\ + COST_MV( omx+2, omy );/* 1 1 */\ + COST_MV( omx-1, omy+1 );/* 1 */\ + COST_MV( omx+1, omy+1 );\ + COST_MV( omx , omy+2 );\ + }\ + +#define OCT2 \ + {\ + COST_MV( omx-1, omy-2 );\ + COST_MV( omx+1, omy-2 );/* 1 1 */\ + COST_MV( omx-2, omy-1 );/* 1 1 */\ + COST_MV( omx+2, omy-1 );/* 0 */\ + COST_MV( omx-2, omy+1 );/* 1 1 */\ + COST_MV( omx+2, omy+1 );/* 1 1 */\ + COST_MV( omx-1, omy+2 );\ + COST_MV( omx+1, omy+2 );\ + } + +#define CROSS( start, x_max, y_max ) \ + { \ + for( i = start; i < x_max; i+=2 ) \ + { \ + if( omx + i <= mv_x_max ) \ + COST_MV( omx + i, omy ); \ + if( omx - i >= mv_x_min ) \ + COST_MV( omx - i, omy ); \ + } \ + for( i = start; i < y_max; i+=2 ) \ + { \ + if( omy + i <= mv_y_max ) \ + COST_MV( omx, omy + i ); \ + if( omy - i >= mv_y_min ) \ + COST_MV( omx, omy - i ); \ + } \ + } + void x264_me_search_ref( x264_t *h, x264_me_t *m, int (*mvc)[2], int i_mvc, int *p_halfpel_thresh ) { const int i_pixel = m->i_pixel; - const int i_me_range = h->param.analyse.i_me_range; + int i_me_range = h->param.analyse.i_me_range; int bmx, bmy, bcost; int omx, omy, pmx, pmy; uint8_t *p_fref = m->p_fref[0]; @@ -93,8 +147,8 @@ if( h->mb.i_me_method == X264_ME_UMH ) { /* clamp mvp to inside frame+padding, so that we don't have to check it each iteration */ - p_cost_mvx = m->p_cost_mv - x264_clip3( m->mvp[0], h->mb.mv_min[0], h->mb.mv_max[0] ); - p_cost_mvy = m->p_cost_mv - x264_clip3( m->mvp[1], h->mb.mv_min[1], h->mb.mv_max[1] ); + p_cost_mvx = m->p_cost_mv - x264_clip3( m->mvp[0], h->mb.mv_min_spel[0], h->mb.mv_max_spel[0] ); + p_cost_mvy = m->p_cost_mv - x264_clip3( m->mvp[1], h->mb.mv_min_spel[1], h->mb.mv_max_spel[1] ); } bmx = pmx = x264_clip3( ( m->mvp[0] + 2 ) >> 2, mv_x_min, mv_x_max ); @@ -185,12 +239,15 @@ case X264_ME_UMH: { /* Uneven-cross Multi-Hexagon-grid Search - * as in JM, except without early termination */ + * as in JM, except with different early termination */ + + static const int x264_pixel_size_shift[7] = { 0, 1, 1, 2, 3, 3, 4 }; - int ucost; - int cross_start; + int ucost1, ucost2; + int cross_start = 1; /* refine predictors */ + ucost1 = bcost; DIA1_ITER( pmx, pmy ); if( pmx || pmy ) DIA1_ITER( 0, 0 ); @@ -198,31 +255,93 @@ if(i_pixel == PIXEL_4x4) goto me_hex2; - ucost = bcost; + ucost2 = bcost; if( (bmx || bmy) && (bmx!=pmx || bmy!=pmy) ) DIA1_ITER( bmx, bmy ); - - /* cross */ + if( bcost == ucost2 ) + cross_start = 3; omx = bmx; omy = bmy; - cross_start = ( bcost == ucost ) ? 3 : 1; - for( i = cross_start; i < i_me_range; i+=2 ) + + /* early termination */ +#define SAD_THRESH(v) ( bcost < ( v >> x264_pixel_size_shift[i_pixel] ) ) + if( bcost == ucost2 && SAD_THRESH(2000) ) { - if( omx + i <= mv_x_max ) - COST_MV( omx + i, omy ); - if( omx - i >= mv_x_min ) - COST_MV( omx - i, omy ); + DIA2; + if( bcost == ucost1 && SAD_THRESH(500) ) + break; + if( bcost == ucost2 ) + { + int range = (i_me_range>>1) | 1; + CROSS( 3, range, range ); + OCT2; + if( bcost == ucost2 ) + break; + cross_start = range + 2; + } } - for( i = cross_start; i < i_me_range/2; i+=2 ) + + /* adaptive search range */ + if( i_mvc ) { - if( omy + i <= mv_y_max ) - COST_MV( omx, omy + i ); - if( omy - i >= mv_y_min ) - COST_MV( omx, omy - i ); + /* range multipliers based on casual inspection of some statistics of + * average distance between current predictor and final mv found by ESA. + * these have not been tuned much by actual encoding. */ + static const int range_mul[4][4] = + { + { 3, 3, 4, 4 }, + { 3, 4, 4, 4 }, + { 4, 4, 4, 5 }, + { 4, 4, 5, 6 }, + }; + int mvd; + int sad_ctx, mvd_ctx; + + if( i_mvc == 1 ) + { + if( i_pixel == PIXEL_16x16 ) + /* mvc is probably the same as mvp, so the difference isn't meaningful. + * but prediction usually isn't too bad, so just use medium range */ + mvd = 25; + else + mvd = abs( m->mvp[0] - mvc[0][0] ) + + abs( m->mvp[1] - mvc[0][1] ); + } + else + { + /* calculate the degree of agreement between predictors. */ + /* in 16x16, mvc includes all the neighbors used to make mvp, + * so don't count mvp separately. */ + int i_denom = i_mvc - 1; + mvd = 0; + if( i_pixel != PIXEL_16x16 ) + { + mvd = abs( m->mvp[0] - mvc[0][0] ) + + abs( m->mvp[1] - mvc[0][1] ); + i_denom++; + } + for( i = 0; i < i_mvc-1; i++ ) + mvd += abs( mvc[i][0] - mvc[i+1][0] ) + + abs( mvc[i][1] - mvc[i+1][1] ); + mvd /= i_denom; //FIXME idiv + } + + sad_ctx = SAD_THRESH(1000) ? 0 + : SAD_THRESH(2000) ? 1 + : SAD_THRESH(4000) ? 2 : 3; + mvd_ctx = mvd < 10 ? 0 + : mvd < 20 ? 1 + : mvd < 40 ? 2 : 3; + + i_me_range = i_me_range * range_mul[mvd_ctx][sad_ctx] / 4; } + /* FIXME if the above DIA2/OCT2/CROSS found a new mv, it has not updated omx/omy. + * we are still centered on the same place as the DIA2. is this desirable? */ + CROSS( cross_start, i_me_range, i_me_range/2 ); + /* 5x5 ESA */ omx = bmx; omy = bmy; - for( i = (bcost == ucost) ? 4 : 0; i < 24; i++ ) + for( i = (bcost == ucost2) ? 4 : 0; i < 24; i++ ) { static const int square2[24][2] = { { 1, 0}, { 0, 1}, {-1, 0}, { 0,-1}, @@ -234,24 +353,40 @@ }; COST_MV( omx + square2[i][0], omy + square2[i][1] ); } + /* hexagon grid */ omx = bmx; omy = bmy; for( i = 1; i <= i_me_range/4; i++ ) { - int bounds_check = 4*i > X264_MIN4( mv_x_max-omx, mv_y_max-omy, omx-mv_x_min, omy-mv_y_min ); - for( j = 0; j < 16; j++ ) + static const int hex4[16][2] = { + {-4, 2}, {-4, 1}, {-4, 0}, {-4,-1}, {-4,-2}, + { 4,-2}, { 4,-1}, { 4, 0}, { 4, 1}, { 4, 2}, + { 2, 3}, { 0, 4}, {-2, 3}, + {-2,-3}, { 0,-4}, { 2,-3}, + }; + const int bounds_check = 4*i > X264_MIN4( mv_x_max-omx, mv_y_max-omy, omx-mv_x_min, omy-mv_y_min ); + + if( h->pixf.sad_pde[i_pixel] ) { - static const int hex4[16][2] = { - {-4, 2}, {-4, 1}, {-4, 0}, {-4,-1}, {-4,-2}, - { 4,-2}, { 4,-1}, { 4, 0}, { 4, 1}, { 4, 2}, - { 2, 3}, { 0, 4}, {-2, 3}, - {-2,-3}, { 0,-4}, { 2,-3}, - }; - int mx = omx + hex4[j][0]*i; - int my = omy + hex4[j][1]*i; - if( !bounds_check || ( mx >= mv_x_min && mx <= mv_x_max - && my >= mv_y_min && my <= mv_y_max ) ) - COST_MV( mx, my ); + for( j = 0; j < 16; j++ ) + { + int mx = omx + hex4[j][0]*i; + int my = omy + hex4[j][1]*i; + if( !bounds_check || ( mx >= mv_x_min && mx <= mv_x_max + && my >= mv_y_min && my <= mv_y_max ) ) + COST_MV_PDE( mx, my ); + } + } + else + { + for( j = 0; j < 16; j++ ) + { + int mx = omx + hex4[j][0]*i; + int my = omy + hex4[j][1]*i; + if( !bounds_check || ( mx >= mv_x_min && mx <= mv_x_max + && my >= mv_y_min && my <= mv_y_max ) ) + COST_MV( mx, my ); + } } } goto me_hex2; @@ -263,11 +398,49 @@ const int min_y = X264_MAX( bmy - i_me_range, mv_y_min); const int max_x = X264_MIN( bmx + i_me_range, mv_x_max); const int max_y = X264_MIN( bmy + i_me_range, mv_y_max); - for( omy = min_y; omy <= max_y; omy++ ) - for( omx = min_x; omx <= max_x; omx++ ) - { - COST_MV( omx, omy ); - } + int mx, my; +#if 0 + /* plain old exhaustive search */ + for( my = min_y; my <= max_y; my++ ) + for( mx = min_x; mx <= max_x; mx++ ) + COST_MV( mx, my ); +#else + /* successive elimination by comparing DC before a full SAD, + * because sum(abs(diff)) >= abs(diff(sum)). */ + const int stride = m->i_stride[0]; + const int dw = x264_pixel_size[i_pixel].w; + const int dh = x264_pixel_size[i_pixel].h * stride; + static uint8_t zero[16*16] = {0,}; + const int enc_dc = h->pixf.sad[i_pixel]( m->p_fenc[0], stride, zero, 16 ); + const uint16_t *integral_base = &m->integral[ -1 - 1*stride ]; + + if( h->pixf.sad_pde[i_pixel] ) + { + for( my = min_y; my <= max_y; my++ ) + for( mx = min_x; mx <= max_x; mx++ ) + { + const uint16_t *integral = &integral_base[ mx + my * stride ]; + const uint16_t ref_dc = integral[ 0 ] + integral[ dh + dw ] + - integral[ dw ] - integral[ dh ]; + const int bsad = bcost - p_cost_mvx[ (mx)<<2 ] - p_cost_mvy[ (my)<<2 ]; + if( abs( ref_dc - enc_dc ) < bsad ) + COST_MV_PDE( mx, my ); + } + } + else + { + for( my = min_y; my <= max_y; my++ ) + for( mx = min_x; mx <= max_x; mx++ ) + { + const uint16_t *integral = &integral_base[ mx + my * stride ]; + const uint16_t ref_dc = integral[ 0 ] + integral[ dh + dw ] + - integral[ dw ] - integral[ dh ]; + const int bsad = bcost - p_cost_mvx[ (mx)<<2 ] - p_cost_mvy[ (my)<<2 ]; + if( abs( ref_dc - enc_dc ) < bsad ) + COST_MV( mx, my ); + } + } +#endif } break; } @@ -303,7 +476,8 @@ refine_subpel( h, m, hpel, qpel, NULL, 1 ); } -#define COST_MV_SAD( mx, my ) \ +#define COST_MV_SAD( mx, my, dir ) \ +if( b_refine_qpel || (dir^1) != odir ) \ { \ int stride = 16; \ uint8_t *src = h->mc.get_ref( m->p_fref, m->i_stride[0], pix, &stride, mx, my, bw, bh ); \ @@ -314,6 +488,7 @@ bcost = cost; \ bmx = mx; \ bmy = my; \ + bdir = dir; \ } \ } @@ -362,25 +537,26 @@ int odir = -1, bdir; - /* try the subpel component of the predicted mv if it's close to - * the result of the fullpel search */ + /* try the subpel component of the predicted mv */ if( hpel_iters ) { - int mx = x264_clip3( m->mvp[0], h->mb.mv_min[0], h->mb.mv_max[0] ); - int my = x264_clip3( m->mvp[1], h->mb.mv_min[1], h->mb.mv_max[1] ); + int mx = x264_clip3( m->mvp[0], h->mb.mv_min_spel[0], h->mb.mv_max_spel[0] ); + int my = x264_clip3( m->mvp[1], h->mb.mv_min_spel[1], h->mb.mv_max_spel[1] ); if( mx != bmx || my != bmy ) - COST_MV_SAD( mx, my ); + COST_MV_SAD( mx, my, -1 ); } /* hpel search */ + bdir = -1; for( i = hpel_iters; i > 0; i-- ) { + odir = bdir; omx = bmx; omy = bmy; - COST_MV_SAD( omx, omy - 2 ); - COST_MV_SAD( omx, omy + 2 ); - COST_MV_SAD( omx - 2, omy ); - COST_MV_SAD( omx + 2, omy ); + COST_MV_SAD( omx, omy - 2, 0 ); + COST_MV_SAD( omx, omy + 2, 1 ); + COST_MV_SAD( omx - 2, omy, 2 ); + COST_MV_SAD( omx + 2, omy, 3 ); if( bmx == omx && bmy == omy ) break; } @@ -427,3 +603,112 @@ m->cost_mv = p_cost_mvx[ bmx ] + p_cost_mvy[ bmy ]; } +#define BIME_CACHE( dx, dy ) \ +{ \ + int i = 4 + 3*dx + dy; \ + h->mc.mc_luma( m0->p_fref, m0->i_stride[0], pix0[i], bw, om0x+dx, om0y+dy, bw, bh ); \ + h->mc.mc_luma( m1->p_fref, m1->i_stride[0], pix1[i], bw, om1x+dx, om1y+dy, bw, bh ); \ +} + +#define BIME_CACHE2(a,b) \ + BIME_CACHE(a,b) \ + BIME_CACHE(-(a),-(b)) + +#define COST_BIMV_SATD( m0x, m0y, m1x, m1y ) \ +if( pass == 0 || !visited[(m0x)&7][(m0y)&7][(m1x)&7][(m1y)&7] ) \ +{ \ + int cost; \ + int i0 = 4 + 3*(m0x-om0x) + (m0y-om0y); \ + int i1 = 4 + 3*(m1x-om1x) + (m1y-om1y); \ + visited[(m0x)&7][(m0y)&7][(m1x)&7][(m1y)&7] = 1; \ + memcpy( pix, pix0[i0], bs ); \ + if( i_weight == 32 ) \ + h->mc.avg[i_pixel]( pix, bw, pix1[i1], bw ); \ + else \ + h->mc.avg_weight[i_pixel]( pix, bw, pix1[i1], bw, i_weight ); \ + cost = h->pixf.mbcmp[i_pixel]( m0->p_fenc[0], m0->i_stride[0], pix, bw ) \ + + p_cost_m0x[ m0x ] + p_cost_m0y[ m0y ] \ + + p_cost_m1x[ m1x ] + p_cost_m1y[ m1y ]; \ + if( cost < bcost ) \ + { \ + bcost = cost; \ + bm0x = m0x; \ + bm0y = m0y; \ + bm1x = m1x; \ + bm1y = m1y; \ + } \ +} + +#define CHECK_BIDIR(a,b,c,d) \ + COST_BIMV_SATD(om0x+a, om0y+b, om1x+c, om1y+d) + +#define CHECK_BIDIR2(a,b,c,d) \ + CHECK_BIDIR(a,b,c,d) \ + CHECK_BIDIR(-(a),-(b),-(c),-(d)) + +#define CHECK_BIDIR8(a,b,c,d) \ + CHECK_BIDIR2(a,b,c,d) \ + CHECK_BIDIR2(b,c,d,a) \ + CHECK_BIDIR2(c,d,a,b) \ + CHECK_BIDIR2(d,a,b,c) + +int x264_me_refine_bidir( x264_t *h, x264_me_t *m0, x264_me_t *m1, int i_weight ) +{ + const int i_pixel = m0->i_pixel; + const int bw = x264_pixel_size[i_pixel].w; + const int bh = x264_pixel_size[i_pixel].h; + const int bs = bw*bh; + const int16_t *p_cost_m0x = m0->p_cost_mv - x264_clip3( m0->mvp[0], h->mb.mv_min_spel[0], h->mb.mv_max_spel[0] ); + const int16_t *p_cost_m0y = m0->p_cost_mv - x264_clip3( m0->mvp[1], h->mb.mv_min_spel[0], h->mb.mv_max_spel[0] ); + const int16_t *p_cost_m1x = m1->p_cost_mv - x264_clip3( m1->mvp[0], h->mb.mv_min_spel[0], h->mb.mv_max_spel[0] ); + const int16_t *p_cost_m1y = m1->p_cost_mv - x264_clip3( m1->mvp[1], h->mb.mv_min_spel[0], h->mb.mv_max_spel[0] ); + DECLARE_ALIGNED( uint8_t, pix0[9][16*16], 16 ); + DECLARE_ALIGNED( uint8_t, pix1[9][16*16], 16 ); + DECLARE_ALIGNED( uint8_t, pix[16*16], 16 ); + int bm0x = m0->mv[0], om0x = bm0x; + int bm0y = m0->mv[1], om0y = bm0y; + int bm1x = m1->mv[0], om1x = bm1x; + int bm1y = m1->mv[1], om1y = bm1y; + int bcost = COST_MAX; + int pass = 0; + uint8_t visited[8][8][8][8]; + memset( visited, 0, sizeof(visited) ); + + BIME_CACHE( 0, 0 ); + CHECK_BIDIR( 0, 0, 0, 0 ); + + for( pass = 0; pass < 8; pass++ ) + { + /* check all mv pairs that differ in at most 2 components from the current mvs. */ + /* doesn't do chroma ME. this probably doesn't matter, as the gains + * from bidir ME are the same with and without chroma ME. */ + + BIME_CACHE2( 1, 0 ); + BIME_CACHE2( 0, 1 ); + BIME_CACHE2( 1, 1 ); + BIME_CACHE2( 1,-1 ); + + CHECK_BIDIR8( 0, 0, 0, 1 ); + CHECK_BIDIR8( 0, 0, 1, 1 ); + CHECK_BIDIR2( 0, 1, 0, 1 ); + CHECK_BIDIR2( 1, 0, 1, 0 ); + CHECK_BIDIR8( 0, 0,-1, 1 ); + CHECK_BIDIR2( 0,-1, 0, 1 ); + CHECK_BIDIR2(-1, 0, 1, 0 ); + + if( om0x == bm0x && om0y == bm0y && om1x == bm1x && om1y == bm1y ) + break; + + om0x = bm0x; + om0y = bm0y; + om1x = bm1x; + om1y = bm1y; + BIME_CACHE( 0, 0 ); + } + + m0->mv[0] = bm0x; + m0->mv[1] = bm0y; + m1->mv[0] = bm1x; + m1->mv[1] = bm1y; + return bcost; +} --- vlc-0.8.4.debian.orig/extras/x264/encoder/me.h +++ vlc-0.8.4.debian/extras/x264/encoder/me.h @@ -36,6 +36,7 @@ uint8_t *p_fref[6]; uint8_t *p_fenc[3]; + uint16_t *integral; int i_stride[2]; int mvp[2]; @@ -51,5 +52,6 @@ { x264_me_search_ref( h, m, mvc, i_mvc, NULL ); } void x264_me_refine_qpel( x264_t *h, x264_me_t *m ); +int x264_me_refine_bidir( x264_t *h, x264_me_t *m0, x264_me_t *m1, int i_weight ); #endif --- vlc-0.8.4.debian.orig/extras/x264/encoder/ratecontrol.c +++ vlc-0.8.4.debian/extras/x264/encoder/ratecontrol.c @@ -25,7 +25,6 @@ #define _ISOC99_SOURCE #undef NDEBUG // always check asserts, the speed effect is far too small to disable them -#include #include #include #include @@ -39,6 +38,9 @@ #if defined(SYS_FREEBSD) || defined(SYS_BEOS) || defined(SYS_NETBSD) #define exp2f(x) powf( 2, (x) ) #endif +#if defined(_MSC_VER) +#define isfinite _finite +#endif #if defined(_MSC_VER) || defined(SYS_SunOS) #define exp2f(x) pow( 2, (x) ) #define sqrtf sqrt @@ -190,10 +192,19 @@ rc->last_non_b_pict_type = -1; rc->cbr_decay = 1.0; - if( rc->b_2pass && h->param.rc.i_rf_constant ) + if( h->param.rc.i_rf_constant && h->param.rc.b_stat_read ) + { x264_log(h, X264_LOG_ERROR, "constant rate-factor is incompatible with 2pass.\n"); - if( h->param.rc.i_vbv_max_bitrate && !h->param.rc.b_cbr && !h->param.rc.i_rf_constant ) + return -1; + } + if( h->param.rc.i_vbv_buffer_size && !h->param.rc.b_cbr && !h->param.rc.i_rf_constant ) x264_log(h, X264_LOG_ERROR, "VBV is incompatible with constant QP.\n"); + if( h->param.rc.i_vbv_buffer_size && h->param.rc.b_cbr + && h->param.rc.i_vbv_max_bitrate == 0 ) + { + x264_log( h, X264_LOG_DEBUG, "VBV maxrate unspecified, assuming CBR\n" ); + h->param.rc.i_vbv_max_bitrate = h->param.rc.i_bitrate; + } if( h->param.rc.i_vbv_max_bitrate < h->param.rc.i_bitrate && h->param.rc.i_vbv_max_bitrate > 0) x264_log(h, X264_LOG_ERROR, "max bitrate less than average bitrate, ignored.\n"); @@ -211,8 +222,8 @@ rc->cbr_decay = 1.0 - rc->buffer_rate / rc->buffer_size * 0.5 * X264_MAX(0, 1.5 - rc->buffer_rate * rc->fps / rc->bitrate); } - else if( h->param.rc.i_vbv_max_bitrate || h->param.rc.i_vbv_buffer_size ) - x264_log(h, X264_LOG_ERROR, "VBV maxrate or buffer size specified, but not both.\n"); + else if( h->param.rc.i_vbv_max_bitrate ) + x264_log(h, X264_LOG_ERROR, "VBV maxrate specified, but no bufsize.\n"); if(rc->rate_tolerance < 0.01) { x264_log(h, X264_LOG_ERROR, "bitrate tolerance too small, using .01\n"); rc->rate_tolerance = 0.01; @@ -748,7 +759,7 @@ q = x264_eval((char*)h->param.rc.psz_rc_eq, const_values, const_names, func1, func1_names, NULL, NULL, rce); // avoid NaN's in the rc_eq - if(q != q || rce->i_tex_bits + rce->p_tex_bits + rce->mv_bits == 0) + if(!isfinite(q) || rce->i_tex_bits + rce->p_tex_bits + rce->mv_bits == 0) q = rcc->last_qscale; else { rcc->last_rceq = q; @@ -1021,7 +1032,7 @@ } else { - if( h->stat.i_slice_count[h->param.i_keyint_max > 1 ? SLICE_TYPE_P : SLICE_TYPE_I] < 5 ) + if( h->stat.i_slice_count[SLICE_TYPE_P] + h->stat.i_slice_count[SLICE_TYPE_I] < 6 ) { float w = h->stat.i_slice_count[SLICE_TYPE_P] / 5.; float q2 = qp2qscale(ABR_INIT_QP); --- vlc-0.8.4.debian.orig/extras/x264/encoder/rdo.c +++ vlc-0.8.4.debian/extras/x264/encoder/rdo.c @@ -295,9 +295,8 @@ // that are better left coded, especially at QP > 40. for( abs_level = q; abs_level >= q-1; abs_level-- ) { - int u = (unquant_mf[zigzag[i]] * abs_level + 128) >> 8; - int64_t d = i_coef - u; - uint64_t ssd = d*d * coef_weight[i]; + int d = i_coef - ((unquant_mf[zigzag[i]] * abs_level + 128) >> 8); + uint64_t ssd = (int64_t)d*d * coef_weight[i]; for( j = 0; j < 8; j++ ) { @@ -309,7 +308,7 @@ /* code the proposed level, and count how much entropy it would take */ if( abs_level || node_ctx ) { - uint64_t f8_bits = cost_sig[ abs_level != 0 ]; + unsigned f8_bits = cost_sig[ abs_level != 0 ]; if( abs_level ) { const int i_prefix = X264_MIN( abs_level - 1, 14 ); @@ -330,7 +329,7 @@ node_ctx = coeff_abs_level_transition[0][node_ctx]; } } - n.score += f8_bits * i_lambda2 >> ( CABAC_SIZE_BITS - LAMBDA_BITS ); + n.score += (uint64_t)f8_bits * i_lambda2 >> ( CABAC_SIZE_BITS - LAMBDA_BITS ); } n.score += ssd; --- vlc-0.8.4.debian.orig/extras/x264/encoder/set.c +++ vlc-0.8.4.debian/extras/x264/encoder/set.c @@ -21,18 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#ifdef HAVE_STDINT_H -#include -#else -#include -#endif -#include #include #include -#include #include -#include "x264.h" #include "common/common.h" #ifndef _MSC_VER #include "config.h" @@ -46,15 +38,31 @@ const uint8_t *def_list = (idx==CQM_4IC) ? pps->scaling_list[CQM_4IY] : (idx==CQM_4PC) ? pps->scaling_list[CQM_4PY] : x264_cqm_jvt[idx]; - int j; - if( memcmp( list, def_list, len ) ) + if( !memcmp( list, def_list, len ) ) + bs_write( s, 1, 0 ); // scaling_list_present_flag + else if( !memcmp( list, x264_cqm_jvt[idx], len ) ) { bs_write( s, 1, 1 ); // scaling_list_present_flag - for( j = 0; j < len; j++ ) - bs_write_se( s, list[zigzag[j]] - (j>0 ? list[zigzag[j-1]] : 8) ); // delta + bs_write_se( s, -8 ); // use jvt list } else - bs_write( s, 1, 0 ); // scaling_list_present_flag + { + int j, run; + bs_write( s, 1, 1 ); // scaling_list_present_flag + + // try run-length compression of trailing values + for( run = len; run > 1; run-- ) + if( list[zigzag[run-1]] != list[zigzag[run-2]] ) + break; + if( run < len && len - run < bs_size_se( (int8_t)-list[zigzag[run]] ) ) + run = len; + + for( j = 0; j < run; j++ ) + bs_write_se( s, (int8_t)(list[zigzag[j]] - (j>0 ? list[zigzag[j-1]] : 8)) ); // delta + + if( run < len ) + bs_write_se( s, (int8_t)-list[zigzag[run]] ); + } } void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param ) @@ -104,11 +112,7 @@ } } - sps->vui.i_num_reorder_frames = param->b_bframe_pyramid ? 2 : param->i_bframe ? 1 : 0; - /* extra slot with pyramid so that we don't have to override the - * order of forgetting old pictures */ - sps->vui.i_max_dec_frame_buffering = - sps->i_num_ref_frames = X264_MIN(16, param->i_frame_reference + sps->vui.i_num_reorder_frames + param->b_bframe_pyramid); + sps->b_vui = 1; sps->b_gaps_in_frame_num_value_allowed = 0; sps->i_mb_width = ( param->i_width + 15 ) / 16; @@ -129,21 +133,17 @@ sps->b_crop = sps->crop.i_left || sps->crop.i_top || sps->crop.i_right || sps->crop.i_bottom; - sps->b_vui = 0; sps->vui.b_aspect_ratio_info_present = 0; - if( param->vui.i_sar_width > 0 && param->vui.i_sar_height > 0 ) { sps->vui.b_aspect_ratio_info_present = 1; sps->vui.i_sar_width = param->vui.i_sar_width; sps->vui.i_sar_height= param->vui.i_sar_height; } - sps->b_vui |= sps->vui.b_aspect_ratio_info_present; sps->vui.b_overscan_info_present = ( param->vui.i_overscan ? 1 : 0 ); if( sps->vui.b_overscan_info_present ) sps->vui.b_overscan_info = ( param->vui.i_overscan == 2 ? 1 : 0 ); - sps->b_vui |= sps->vui.b_overscan_info_present; sps->vui.b_signal_type_present = 0; sps->vui.i_vidformat = ( param->vui.i_vidformat <= 5 ? param->vui.i_vidformat : 5 ); @@ -166,7 +166,6 @@ { sps->vui.b_signal_type_present = 1; } - sps->b_vui |= sps->vui.b_signal_type_present; /* FIXME: not sufficient for interlaced video */ sps->vui.b_chroma_loc_info_present = ( param->vui.i_chroma_loc ? 1 : 0 ); @@ -175,21 +174,23 @@ sps->vui.i_chroma_loc_top = param->vui.i_chroma_loc; sps->vui.i_chroma_loc_bottom = param->vui.i_chroma_loc; } - sps->b_vui |= sps->vui.b_chroma_loc_info_present; sps->vui.b_timing_info_present = 0; if( param->i_fps_num > 0 && param->i_fps_den > 0) { sps->vui.b_timing_info_present = 1; - /* The standard is confusing me, but this seems to work best - with other encoders */ sps->vui.i_num_units_in_tick = param->i_fps_den; - sps->vui.i_time_scale = param->i_fps_num; + sps->vui.i_time_scale = param->i_fps_num * 2; sps->vui.b_fixed_frame_rate = 1; } - sps->b_vui |= sps->vui.b_timing_info_present; - sps->vui.b_bitstream_restriction = param->i_bframe > 0; + sps->vui.i_num_reorder_frames = param->b_bframe_pyramid ? 2 : param->i_bframe ? 1 : 0; + /* extra slot with pyramid so that we don't have to override the + * order of forgetting old pictures */ + sps->vui.i_max_dec_frame_buffering = + sps->i_num_ref_frames = X264_MIN(16, param->i_frame_reference + sps->vui.i_num_reorder_frames + param->b_bframe_pyramid); + + sps->vui.b_bitstream_restriction = 1; if( sps->vui.b_bitstream_restriction ) { sps->vui.b_motion_vectors_over_pic_boundaries = 1; @@ -198,7 +199,6 @@ sps->vui.i_log2_max_mv_length_horizontal = sps->vui.i_log2_max_mv_length_vertical = (int)(log(param->analyse.i_mv_range*4-1)/log(2)) + 1; } - sps->b_vui |= sps->vui.b_bitstream_restriction; } --- vlc-0.8.4.debian.orig/extras/x264/encoder/slicetype_decision.c +++ vlc-0.8.4.debian/extras/x264/encoder/slicetype_decision.c @@ -20,7 +20,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include #include #include #include @@ -31,41 +30,14 @@ #include "me.h" -static void x264_mb_analyse_load_costs_lowres( x264_t *h, x264_mb_analysis_t *a ) -{ - static int16_t *p_cost_mv; - - if( !p_cost_mv ) - { - int i; - x264_cpu_restore( h->param.cpu ); - p_cost_mv = x264_malloc( (2*2*h->param.analyse.i_mv_range + 1) * sizeof(int16_t) ); - p_cost_mv += 2*h->param.analyse.i_mv_range; - for( i = 0; i <= 2*h->param.analyse.i_mv_range; i++ ) - p_cost_mv[-i] = - p_cost_mv[i] = (int)( a->i_lambda * (1 + 2*log(2*i+1)/log(2)) ); - } - - a->p_cost_mv = p_cost_mv; -} - static void x264_lowres_context_init( x264_t *h, x264_mb_analysis_t *a ) { a->i_qp = 12; // arbitrary, but low because SATD scores are 1/4 normal a->i_lambda = i_qp0_cost_table[ a->i_qp ]; - x264_mb_analyse_load_costs_lowres( h, a ); + x264_mb_analyse_load_costs( h, a ); h->mb.i_me_method = X264_MIN( X264_ME_HEX, h->param.analyse.i_me_method ); // maybe dia? h->mb.i_subpel_refine = 4; // 3 should be enough, but not tweaking for speed now h->mb.b_chroma_me = 0; - - h->mb.mv_min_fpel[0] = - h->mb.mv_min_fpel[1] = -16; - h->mb.mv_max_fpel[0] = - h->mb.mv_max_fpel[1] = 16; - h->mb.mv_min[0] = - h->mb.mv_min[1] = -4*32; - h->mb.mv_max[0] = - h->mb.mv_max[1] = 4*32; } int x264_slicetype_mb_cost( x264_t *h, x264_mb_analysis_t *a, @@ -93,6 +65,19 @@ if( !p0 && !p1 && !b ) goto lowres_intra_mb; + // no need for h->mb.mv_min[] + h->mb.mv_min_fpel[0] = -16*h->mb.i_mb_x - 8; + h->mb.mv_max_fpel[0] = 16*( h->sps->i_mb_width - h->mb.i_mb_x - 1 ) + 8; + h->mb.mv_min_spel[0] = 4*( h->mb.mv_min_fpel[0] - 16 ); + h->mb.mv_max_spel[0] = 4*( h->mb.mv_max_fpel[0] + 16 ); + if( h->mb.i_mb_x <= 1) + { + h->mb.mv_min_fpel[1] = -16*h->mb.i_mb_y - 8; + h->mb.mv_max_fpel[1] = 16*( h->sps->i_mb_height - h->mb.i_mb_y - 1 ) + 8; + h->mb.mv_min_spel[1] = 4*( h->mb.mv_min_fpel[1] - 16 ); + h->mb.mv_max_spel[1] = 4*( h->mb.mv_max_fpel[1] + 16 ); + } + #define LOAD_HPELS_LUMA(dst, src) \ { \ (dst)[0] = &(src)[0][i_pel_offset]; \ @@ -150,7 +135,8 @@ dmv[1][1] = dmv[0][1] - mvr[1]; TRY_BIDIR( dmv[0], dmv[1], 0 ); - TRY_BIDIR( mv0, mv0, 0 ); + if( dmv[0][0] || dmv[0][1] || dmv[1][0] || dmv[1][1] ); + TRY_BIDIR( mv0, mv0, 0 ); // if( i_bcost < 60 ) // arbitrary threshold // return i_bcost; } @@ -158,7 +144,7 @@ i_cost_bak = i_bcost; for( l = 0; l < 1 + b_bidir; l++ ) { - int16_t (*fenc_mv)[2] = &fenc->mv[0][i_mb_xy]; + int16_t (*fenc_mv)[2] = &fenc->mv[l][i_mb_xy]; mvc[0][0] = fenc_mv[-1][0]; mvc[0][1] = fenc_mv[-1][1]; mvc[1][0] = fenc_mv[-i_mb_stride][0]; @@ -176,7 +162,7 @@ i_bcost = X264_MIN( i_bcost, m[l].cost + 3 ); } - if( b_bidir ) + if( b_bidir && (m[0].mv[0] || m[0].mv[1] || m[1].mv[0] || m[1].mv[1]) ) TRY_BIDIR( m[0].mv, m[1].mv, 5 ); if( i_bcost < i_cost_bak ) @@ -228,9 +214,9 @@ /* Init MVs so that we don't have to check edge conditions when loading predictors. */ /* FIXME: not needed every time */ - memset( frames[p1]->mv[0], 0, h->sps->i_mb_height * h->sps->i_mb_width * 2*sizeof(int) ); + memset( frames[b]->mv[0], 0, h->sps->i_mb_height * h->sps->i_mb_width * 2*sizeof(int16_t) ); if( b != p1 ) - memset( frames[p1]->mv[1], 0, h->sps->i_mb_height * h->sps->i_mb_width * 2*sizeof(int) ); + memset( frames[b]->mv[1], 0, h->sps->i_mb_height * h->sps->i_mb_width * 2*sizeof(int16_t) ); if( b == p1 ) frames[b]->i_intra_mbs[b-p0] = 0; @@ -284,9 +270,9 @@ if( frames[2]->i_intra_mbs[2] > i_mb_count / 2 ) goto no_b_frames; - cost2p0 = x264_slicetype_frame_cost( h, &a, frames, 1, 2, 2 ); - cost1p0 = x264_slicetype_frame_cost( h, &a, frames, 0, 1, 1 ); cost1b1 = x264_slicetype_frame_cost( h, &a, frames, 0, 2, 1 ); + cost1p0 = x264_slicetype_frame_cost( h, &a, frames, 0, 1, 1 ); + cost2p0 = x264_slicetype_frame_cost( h, &a, frames, 1, 2, 2 ); // fprintf( stderr, "PP: %d + %d <=> BP: %d + %d \n", // cost1p0, cost2p0, cost1b1, cost2p1 ); if( cost1p0 + cost2p0 < cost1b1 + cost2p1 ) --- vlc-0.8.4.debian.orig/extras/x264/matroska.c +++ vlc-0.8.4.debian/extras/x264/matroska.c @@ -21,6 +21,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#define _LARGEFILE_SOURCE +#define _FILE_OFFSET_BITS 64 + #include #include #include --- vlc-0.8.4.debian.orig/extras/x264/tools/checkasm.c +++ vlc-0.8.4.debian/extras/x264/tools/checkasm.c @@ -14,7 +14,7 @@ #include "common/ppc/mc.h" #endif -/* buf1, buf2: initialised to randome data and shouldn't write into them */ +/* buf1, buf2: initialised to random data and shouldn't write into them */ uint8_t * buf1, * buf2; /* buf3, buf4: used to store output */ uint8_t * buf3, * buf4; @@ -455,16 +455,78 @@ return ret; } +static int check_intra( int cpu_ref, int cpu_new ) +{ + int ret = 0, ok = 1, used_asm = 0; + int i; + struct + { + x264_predict_t predict_16x16[4+3]; + x264_predict_t predict_8x8c[4+3]; + x264_predict8x8_t predict_8x8[9+3]; + x264_predict_t predict_4x4[9+3]; + } ip_c, ip_ref, ip_a; + + x264_predict_16x16_init( 0, ip_c.predict_16x16 ); + x264_predict_8x8c_init( 0, ip_c.predict_8x8c ); + x264_predict_8x8_init( 0, ip_c.predict_8x8 ); + x264_predict_4x4_init( 0, ip_c.predict_4x4 ); + + x264_predict_16x16_init( cpu_ref, ip_ref.predict_16x16 ); + x264_predict_8x8c_init( cpu_ref, ip_ref.predict_8x8c ); + x264_predict_8x8_init( cpu_ref, ip_ref.predict_8x8 ); + x264_predict_4x4_init( cpu_ref, ip_ref.predict_4x4 ); + + x264_predict_16x16_init( cpu_new, ip_a.predict_16x16 ); + x264_predict_8x8c_init( cpu_new, ip_a.predict_8x8c ); + x264_predict_8x8_init( cpu_new, ip_a.predict_8x8 ); + x264_predict_4x4_init( cpu_new, ip_a.predict_4x4 ); + +#define INTRA_TEST( name, dir, ... ) \ + if( ip_a.name[dir] != ip_ref.name[dir] )\ + { \ + used_asm = 1; \ + memcpy( buf3, buf1, 32*20 );\ + memcpy( buf4, buf1, 32*20 );\ + ip_c.name[dir]( buf3+48, 32, ##__VA_ARGS__ );\ + ip_a.name[dir]( buf4+48, 32, ##__VA_ARGS__ );\ + if( memcmp( buf3, buf4, 32*20 ) )\ + {\ + fprintf( stderr, #name "[%d] : [FAILED]\n", dir );\ + ok = 0;\ + }\ + } + + for( i = 0; i < 12; i++ ) + INTRA_TEST( predict_4x4, i ); + for( i = 0; i < 7; i++ ) + INTRA_TEST( predict_8x8c, i ); + for( i = 0; i < 7; i++ ) + INTRA_TEST( predict_16x16, i ); + for( i = 0; i < 12; i++ ) + INTRA_TEST( predict_8x8, i, 0xf ); + INTRA_TEST( predict_8x8, I_PRED_8x8_V, MB_LEFT|MB_TOP ); + INTRA_TEST( predict_8x8, I_PRED_8x8_DC, MB_LEFT|MB_TOP ); + INTRA_TEST( predict_8x8, I_PRED_8x8_V, MB_LEFT|MB_TOP|MB_TOPLEFT ); + INTRA_TEST( predict_8x8, I_PRED_8x8_DC, MB_LEFT|MB_TOP|MB_TOPLEFT ); + INTRA_TEST( predict_8x8, I_PRED_8x8_V, MB_LEFT|MB_TOP|MB_TOPRIGHT ); + INTRA_TEST( predict_8x8, I_PRED_8x8_DC, MB_LEFT|MB_TOP|MB_TOPRIGHT ); + + report( "intra pred :" ); + return ret; +} + int check_all( int cpu_ref, int cpu_new ) { return check_pixel( cpu_ref, cpu_new ) + check_dct( cpu_ref, cpu_new ) + check_mc( cpu_ref, cpu_new ) + + check_intra( cpu_ref, cpu_new ) + check_deblock( cpu_ref, cpu_new ) + check_quant( cpu_ref, cpu_new ); } -int main() +int main(int argc, char *argv[]) { int ret = 0; int i; @@ -475,7 +537,9 @@ buf4 = x264_malloc( 1024 ); buf5 = x264_malloc( 1024 ); - srand( x264_mdate() ); + i = ( argc > 1 ) ? atoi(argv[1]) : x264_mdate(); + fprintf( stderr, "x264: using random seed %u\n", i ); + srand( i ); for( i = 0; i < 1024; i++ ) { --- vlc-0.8.4.debian.orig/extras/x264/version.sh +++ vlc-0.8.4.debian/extras/x264/version.sh @@ -2,7 +2,11 @@ VER=`svnversion .` if [ "x$VER" != x -a "$VER" != exported ] then - echo "#define X264_VERSION \" svn-$VER\"" > config.h + echo "#define X264_VERSION \" svn-$VER\"" >> config.h + VER=`echo $VER | sed -e 's/[^0-9].*//'` else - echo "#define X264_VERSION \"\"" > config.h + echo "#define X264_VERSION \"\"" >> config.h + VER="x" fi +API=`grep '#define X264_BUILD' < x264.h | sed -e 's/.* \([1-9][0-9]*\).*/\1/'` +echo "#define X264_POINTVER \"0.$API.$VER\"" >> config.h --- vlc-0.8.4.debian.orig/extras/x264/x264.c +++ vlc-0.8.4.debian/extras/x264/x264.c @@ -21,6 +21,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#define _LARGEFILE_SOURCE +#define _FILE_OFFSET_BITS 64 + #include #include #include @@ -36,6 +39,10 @@ #include /* _O_BINARY */ #endif +#ifndef _MSC_VER +#include "config.h" +#endif + #ifdef AVIS_INPUT #include #include @@ -49,10 +56,6 @@ #include "common/common.h" #include "x264.h" -#ifndef _MSC_VER -#include "config.h" -#endif - #include "matroska.h" #define DATA_MAX 3000000 @@ -256,11 +259,14 @@ " --b-rdo RD based mode decision for B-frames. Requires subme 6.\n" " --mixed-refs Decide references on a per partition basis\n" " --no-chroma-me Ignore chroma in motion estimation\n" + " --bime Jointly optimize both MVs in B-frames\n" " -8, --8x8dct Adaptive spatial transform size\n" " -t, --trellis Trellis RD quantization. Requires CABAC. [%d]\n" " - 0: disabled\n" " - 1: enabled only on the final encode of a MB\n" " - 2: enabled on all mode decisions\n" + " --no-fast-pskip Disables early SKIP detection on P-frames\n" + " --nr Noise reduction [%d]\n" "\n" " --cqm Preset quant matrices [\"flat\"]\n" " - jvt, flat\n" @@ -354,6 +360,7 @@ defaults->analyse.i_me_range, defaults->analyse.i_subpel_refine, defaults->analyse.i_trellis, + defaults->analyse.i_noise_reduction, strtable_lookup( overscan_str, defaults->vui.i_overscan ), strtable_lookup( vidformat_str, defaults->vui.i_vidformat ), strtable_lookup( fullrange_str, defaults->vui.b_fullrange ), @@ -478,6 +485,9 @@ #define OPT_MIXED_REFS 314 #define OPT_CRF 315 #define OPT_B_RDO 316 +#define OPT_NO_FAST_PSKIP 317 +#define OPT_BIME 318 +#define OPT_NR 319 static struct option long_options[] = { @@ -511,11 +521,13 @@ { "me", required_argument, NULL, OPT_ME }, { "merange", required_argument, NULL, OPT_MERANGE }, { "subme", required_argument, NULL, 'm' }, - { "b-rdo", no_argument, NULL, OPT_B_RDO }, + { "b-rdo", no_argument, NULL, OPT_B_RDO }, { "mixed-refs", no_argument, NULL, OPT_MIXED_REFS }, { "no-chroma-me", no_argument, NULL, OPT_NO_CHROMA_ME }, + { "bime", no_argument, NULL, OPT_BIME }, { "8x8dct", no_argument, NULL, '8' }, { "trellis", required_argument, NULL, 't' }, + { "no-fast-pskip", no_argument, NULL, OPT_NO_FAST_PSKIP }, { "level", required_argument, NULL, OPT_LEVEL }, { "ratetol", required_argument, NULL, OPT_RATETOL }, { "vbv-maxrate", required_argument, NULL, OPT_VBVMAXRATE }, @@ -538,6 +550,7 @@ { "progress",no_argument, NULL, OPT_PROGRESS }, { "visualize",no_argument, NULL, OPT_VISUALIZE }, { "aud", no_argument, NULL, OPT_AUD }, + { "nr", required_argument, NULL, OPT_NR }, { "cqm", required_argument, NULL, OPT_CQM }, { "cqmfile", required_argument, NULL, OPT_CQMFILE }, { "cqm4", required_argument, NULL, OPT_CQM4 }, @@ -742,12 +755,18 @@ case OPT_NO_CHROMA_ME: param->analyse.b_chroma_me = 0; break; + case OPT_BIME: + param->analyse.b_bidir_me = 1; + break; case '8': param->analyse.b_transform_8x8 = 1; break; case 't': param->analyse.i_trellis = atoi(optarg); break; + case OPT_NO_FAST_PSKIP: + param->analyse.b_fast_pskip = 0; + break; case OPT_LEVEL: if( atof(optarg) < 6 ) param->i_level_idc = (int)(10*atof(optarg)+.5); @@ -832,6 +851,9 @@ fprintf( stderr, "not compiled with visualization support\n" ); #endif break; + case OPT_NR: + param->analyse.i_noise_reduction = atoi(optarg); + break; case OPT_CQM: if( strstr( optarg, "flat" ) ) param->i_cqm_preset = X264_CQM_FLAT; @@ -878,11 +900,11 @@ break; case OPT_CQM4PY: param->i_cqm_preset = X264_CQM_CUSTOM; - b_error |= parse_cqm( optarg, param->cqm_4iy, 16 ); + b_error |= parse_cqm( optarg, param->cqm_4py, 16 ); break; case OPT_CQM4PC: param->i_cqm_preset = X264_CQM_CUSTOM; - b_error |= parse_cqm( optarg, param->cqm_4ic, 16 ); + b_error |= parse_cqm( optarg, param->cqm_4pc, 16 ); break; case OPT_CQM8I: param->i_cqm_preset = X264_CQM_CUSTOM; @@ -1163,7 +1185,7 @@ if( !fseek( f, 0, SEEK_END ) ) { - int64_t i_size = ftell( f ); + uint64_t i_size = ftell( f ); fseek( f, 0, SEEK_SET ); i_frame_total = (int)(i_size / ( i_width * i_height * 3 / 2 )); } @@ -1177,7 +1199,7 @@ FILE *f = (FILE *)handle; if( i_frame != prev_frame+1 ) - if( fseek( f, i_frame * i_width * i_height * 3 / 2, SEEK_SET ) ) + if( fseek( f, (uint64_t)i_frame * i_width * i_height * 3 / 2, SEEK_SET ) ) return -1; if( fread( p_pic->img.plane[0], 1, i_width * i_height, f ) <= 0 @@ -1468,6 +1490,8 @@ gf_isom_avc_config_new(p_mp4->p_file, p_mp4->i_track, p_mp4->p_config, NULL, NULL, &p_mp4->i_descidx); + gf_isom_set_track_enabled(p_mp4->p_file, p_mp4->i_track, 1); + gf_isom_set_visual_info(p_mp4->p_file, p_mp4->i_track, p_mp4->i_descidx, p_param->i_width, p_param->i_height); @@ -1549,9 +1573,9 @@ static int set_eop_mp4( hnd_t handle, x264_picture_t *p_picture ) { mp4_t *p_mp4 = (mp4_t *)handle; - uint32_t dts = p_mp4->i_numframe * p_mp4->i_time_inc; - uint32_t pts = p_picture->i_pts; - int offset = p_mp4->i_init_delay + pts - dts; + uint64_t dts = (uint64_t)p_mp4->i_numframe * p_mp4->i_time_inc; + uint64_t pts = (uint64_t)p_picture->i_pts; + int32_t offset = p_mp4->i_init_delay + pts - dts; p_mp4->p_sample->IsRAP = p_picture->i_type == X264_TYPE_IDR ? 1 : 0; p_mp4->p_sample->DTS = dts; @@ -1604,7 +1628,7 @@ avcC[1] = p_mkv->sps[1]; avcC[2] = p_mkv->sps[2]; avcC[3] = p_mkv->sps[3]; - avcC[4] = 0xfe; // nalu size length is three bytes + avcC[4] = 0xff; // nalu size length is four bytes avcC[5] = 0xe1; // one sps avcC[6] = p_mkv->sps_len >> 8; @@ -1712,7 +1736,7 @@ { mkv_t *p_mkv = handle; uint8_t type = p_nalu[4] & 0x1f; - uint8_t dsize[3]; + uint8_t dsize[4]; int psize; switch( type ) @@ -1752,10 +1776,11 @@ p_mkv->b_writing_frame = 1; } psize = i_size - 4 ; - dsize[0] = psize >> 16; - dsize[1] = psize >> 8; - dsize[2] = psize; - if( mk_addFrameData(p_mkv->w, dsize, 3) < 0 || + dsize[0] = psize >> 24; + dsize[1] = psize >> 16; + dsize[2] = psize >> 8; + dsize[3] = psize; + if( mk_addFrameData(p_mkv->w, dsize, 4) < 0 || mk_addFrameData(p_mkv->w, p_nalu + 4, i_size - 4) < 0 ) return -1; break; --- vlc-0.8.4.debian.orig/extras/x264/x264.h +++ vlc-0.8.4.debian/extras/x264/x264.h @@ -35,7 +35,7 @@ #include -#define X264_BUILD 40 +#define X264_BUILD 44 /* x264_t: * opaque handler for decoder and encoder */ @@ -196,10 +196,13 @@ int i_me_range; /* integer pixel motion estimation search range (from predicted mv) */ int i_mv_range; /* maximum length of a mv (in pixels) */ int i_subpel_refine; /* subpixel motion estimation quality */ + int b_bidir_me; /* jointly optimize both MVs in B-frames */ int b_chroma_me; /* chroma ME for subpel and mode decision in P-frames */ int b_bframe_rdo; /* RD based mode decision for B-frames */ int b_mixed_references; /* allow each mb partition in P-frames to have it's own reference number */ int i_trellis; /* trellis RD quantization */ + int b_fast_pskip; /* early SKIP detection on P-frames */ + int i_noise_reduction; /* adaptive pseudo-deadzone */ int b_psnr; /* Do we compute PSNR stats (save a few % of cpu) */ } analyse; @@ -239,6 +242,7 @@ } rc; int b_aud; /* generate access unit delimiters */ + int b_repeat_headers; /* put SPS/PPS before each keyframe */ } x264_param_t; typedef struct {